Skip to content

Commit f7d1fd9

Browse files
committed
init
0 parents  commit f7d1fd9

17 files changed

+607
-0
lines changed

api.yaml

+245
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
swagger: "2.0"
2+
info:
3+
description: "This is a simple api description"
4+
version: "1.0.0"
5+
title: "weMail Client API"
6+
contact:
7+
8+
host: "api.getwemail.io"
9+
basePath: "/api/v1"
10+
tags:
11+
- name: "List"
12+
- name: "Subscriber"
13+
- name: "Tag"
14+
15+
schemes:
16+
- "https"
17+
paths:
18+
/lists:
19+
get:
20+
tags:
21+
- "List"
22+
summary: "List of list"
23+
parameters:
24+
- in: header
25+
name: X-API-KEY
26+
type: string
27+
required: true
28+
responses:
29+
200:
30+
description: OK
31+
schema:
32+
type: object
33+
properties:
34+
id:
35+
type: string
36+
format: uuid
37+
name:
38+
type: string
39+
description:
40+
type: string
41+
subscribed:
42+
type: string
43+
unsubscribed:
44+
type: string
45+
unconfirmed:
46+
type: string
47+
created_at:
48+
type: string
49+
format: date-time
50+
401:
51+
description: Unauthorized
52+
/lists/{list_id}/subscribers:
53+
post:
54+
summary: "Create a subscriber"
55+
tags:
56+
- "Subscriber"
57+
parameters:
58+
- in: path
59+
name: list_id
60+
type: string
61+
required: true
62+
- in: header
63+
name: X-API-KEY
64+
type: string
65+
required: true
66+
- in: "body"
67+
name: "body"
68+
required: true
69+
schema:
70+
type: object
71+
properties:
72+
first_name:
73+
type: string
74+
last_name:
75+
type: string
76+
email:
77+
type: string
78+
mobile:
79+
type: string
80+
phone:
81+
type: string
82+
address1:
83+
type: string
84+
address2:
85+
type: string
86+
country:
87+
type: string
88+
date_of_birth:
89+
type: string
90+
format: date
91+
timezone:
92+
type: string
93+
tags:
94+
type: object
95+
required:
96+
- email
97+
98+
responses:
99+
200:
100+
description: OK
101+
schema:
102+
type: object
103+
properties:
104+
id:
105+
type: string
106+
format: uuid
107+
first_name:
108+
type: string
109+
last_name:
110+
type: string
111+
email:
112+
type: string
113+
mobile:
114+
type: string
115+
phone:
116+
type: string
117+
address1:
118+
type: string
119+
address2:
120+
type: string
121+
country:
122+
type: string
123+
date_of_birth:
124+
type: string
125+
format: date
126+
timezone:
127+
type: string
128+
tags:
129+
type: object
130+
created_at:
131+
type: string
132+
format: date-time
133+
updated_at:
134+
type: string
135+
format: date-time
136+
401:
137+
description: Unauthorized
138+
/lists/{list_id}/tags:
139+
get:
140+
tags:
141+
- "Tag"
142+
summary: "Get tag"
143+
produces:
144+
- "application/json"
145+
parameters:
146+
- in: path
147+
name: list_id
148+
type: string
149+
format: uuid
150+
required: true
151+
description: Numeric id of the list.
152+
- in: header
153+
name: X-API-KEY
154+
type: string
155+
responses:
156+
200:
157+
description: OK
158+
schema:
159+
type: object
160+
properties:
161+
id:
162+
type: integer
163+
name:
164+
type: string
165+
post:
166+
tags:
167+
- "Tag"
168+
summary: "Create tag"
169+
produces:
170+
- "application/json"
171+
parameters:
172+
- in: "body"
173+
name: "body"
174+
description: "Create a tag object"
175+
required: true
176+
schema:
177+
type: object
178+
properties:
179+
name:
180+
type: string
181+
required:
182+
- name
183+
- in: path
184+
name: list_id
185+
type: integer
186+
required: true
187+
description: Numeric id of the list.
188+
- in: header
189+
name: X-API-KEY
190+
type: string
191+
responses:
192+
default:
193+
description: "successful operation"
194+
/tags/{tag_id}:
195+
put:
196+
tags:
197+
- "Tag"
198+
summary: "Update tag"
199+
parameters:
200+
- in: path
201+
name: tag_id
202+
type: integer
203+
required: true
204+
- in: header
205+
name: X-API-KEY
206+
type: string
207+
- in: "body"
208+
name: "body"
209+
description: "Update a tag object"
210+
required: true
211+
schema:
212+
type: object
213+
properties:
214+
name:
215+
type: string
216+
required:
217+
- name
218+
responses:
219+
200:
220+
description: OK
221+
schema:
222+
type: object
223+
properties:
224+
id:
225+
type: integer
226+
name:
227+
type: string
228+
delete:
229+
tags:
230+
- "Tag"
231+
summary: "Delete tag"
232+
parameters:
233+
- in: path
234+
name: tag_id
235+
type: integer
236+
required: true
237+
description: Numeric id of the tag.
238+
- in: header
239+
name: X-API-KEY
240+
type: string
241+
responses:
242+
200:
243+
description: OK
244+
schema:
245+
type: object

favicon-16x16.png

665 Bytes
Loading

favicon-32x32.png

628 Bytes
Loading

index.html

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!-- HTML for static distribution bundle build -->
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>weMail Client API</title>
7+
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
8+
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
9+
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
10+
<style>
11+
html
12+
{
13+
box-sizing: border-box;
14+
overflow: -moz-scrollbars-vertical;
15+
overflow-y: scroll;
16+
}
17+
18+
*,
19+
*:before,
20+
*:after
21+
{
22+
box-sizing: inherit;
23+
}
24+
25+
body
26+
{
27+
margin:0;
28+
background: #fafafa;
29+
}
30+
</style>
31+
</head>
32+
33+
<body>
34+
<div id="swagger-ui"></div>
35+
36+
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
37+
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
38+
<script>
39+
window.onload = function() {
40+
// Begin Swagger UI call region
41+
const ui = SwaggerUIBundle({
42+
url: "api.yaml",
43+
dom_id: '#swagger-ui',
44+
deepLinking: true,
45+
presets: [
46+
SwaggerUIBundle.presets.apis,
47+
SwaggerUIStandalonePreset
48+
],
49+
plugins: [
50+
SwaggerUIBundle.plugins.DownloadUrl
51+
],
52+
layout: "StandaloneLayout"
53+
})
54+
// End Swagger UI call region
55+
56+
window.ui = ui
57+
}
58+
</script>
59+
</body>
60+
</html>

oauth2-redirect.html

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<title>Swagger UI: OAuth2 Redirect</title>
4+
<body onload="run()">
5+
</body>
6+
</html>
7+
<script>
8+
'use strict';
9+
function run () {
10+
var oauth2 = window.opener.swaggerUIRedirectOauth2;
11+
var sentState = oauth2.state;
12+
var redirectUrl = oauth2.redirectUrl;
13+
var isValid, qp, arr;
14+
15+
if (/code|token|error/.test(window.location.hash)) {
16+
qp = window.location.hash.substring(1);
17+
} else {
18+
qp = location.search.substring(1);
19+
}
20+
21+
arr = qp.split("&")
22+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
23+
qp = qp ? JSON.parse('{' + arr.join() + '}',
24+
function (key, value) {
25+
return key === "" ? value : decodeURIComponent(value)
26+
}
27+
) : {}
28+
29+
isValid = qp.state === sentState
30+
31+
if ((
32+
oauth2.auth.schema.get("flow") === "accessCode"||
33+
oauth2.auth.schema.get("flow") === "authorizationCode"
34+
) && !oauth2.auth.code) {
35+
if (!isValid) {
36+
oauth2.errCb({
37+
authId: oauth2.auth.name,
38+
source: "auth",
39+
level: "warning",
40+
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
41+
});
42+
}
43+
44+
if (qp.code) {
45+
delete oauth2.state;
46+
oauth2.auth.code = qp.code;
47+
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
48+
} else {
49+
let oauthErrorMsg
50+
if (qp.error) {
51+
oauthErrorMsg = "["+qp.error+"]: " +
52+
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
53+
(qp.error_uri ? "More info: "+qp.error_uri : "");
54+
}
55+
56+
oauth2.errCb({
57+
authId: oauth2.auth.name,
58+
source: "auth",
59+
level: "error",
60+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
61+
});
62+
}
63+
} else {
64+
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
65+
}
66+
window.close();
67+
}
68+
</script>

swagger-ui-bundle.js

+92
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-bundle.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle-core.js

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle-core.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle.js

+92
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-es-bundle.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-standalone-preset.js

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui-standalone-preset.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.css

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.css.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.js

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swagger-ui.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)