@epilot/email-settings-client 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 epilot GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/dist/client.d.ts CHANGED
File without changes
package/dist/client.js CHANGED
File without changes
File without changes
File without changes
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './client';
2
- export type { Client, Components, Paths, PathsDictionary, OperationMethods } from './openapi';
2
+ export * from './openapi';
3
3
  export type { OpenAPIClient, OpenAPIClientAxios, Document } from 'openapi-client-axios';
package/dist/index.js CHANGED
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client"), exports);
18
+ __exportStar(require("./openapi"), exports);
18
19
  //# sourceMappingURL=index.js.map
package/dist/openapi.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  /* eslint-disable */
2
+
2
3
  import type {
3
4
  OpenAPIClient,
4
5
  Parameters,
5
6
  UnknownParamsObject,
6
7
  OperationResponse,
7
8
  AxiosRequestConfig,
8
- } from 'openapi-client-axios';
9
+ } from 'openapi-client-axios';
9
10
 
10
11
  declare namespace Components {
11
12
  namespace Schemas {
@@ -31,6 +32,10 @@ declare namespace Components {
31
32
  * * 1d
32
33
  * * 5000 // It converts to 5 seconds.When expressed as a numerical value, it will be interpreted as being in milliseconds.
33
34
  * - Defaults to 3 minutes
35
+ * - Negative values will be treated same as positive values
36
+ * - If not set, defaults to 3 min
37
+ * - If set as 0, then the no email will be treated as a duplicate
38
+ * - Cannot have multiple values
34
39
  *
35
40
  */
36
41
  export type RestrictDuplicatesWithinSetting = "restrict_duplicates_within";
@@ -59,10 +64,14 @@ declare namespace Components {
59
64
  * * 1d
60
65
  * * 5000 // It converts to 5 seconds.When expressed as a numerical value, it will be interpreted as being in milliseconds.
61
66
  * - Defaults to 3 minutes
67
+ * - Negative values will be treated same as positive values
68
+ * - If not set, defaults to 3 min
69
+ * - If set as 0, then the no email will be treated as a duplicate
70
+ * - Cannot have multiple values
62
71
  *
63
72
  */
64
73
  RestrictDuplicatesWithinSetting;
65
- export type SettingsResponse = Setting[];
74
+ export type SettingsResponse = Setting[] | Setting;
66
75
  /**
67
76
  * Setting that allows to add a signature.
68
77
  */
@@ -110,6 +119,12 @@ declare namespace Paths {
110
119
  namespace DeleteSetting {
111
120
  export interface RequestBody {
112
121
  type: Components.Schemas.SettingType;
122
+ /**
123
+ * ID of setting
124
+ * example:
125
+ * a10bd0ff-4391-4cfc-88ee-b19d718a9bf7
126
+ */
127
+ id: string;
113
128
  }
114
129
  namespace Responses {
115
130
  export type $200 = Components.Schemas.Setting;
@@ -351,3 +366,13 @@ export interface PathsDictionary {
351
366
  }
352
367
 
353
368
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
369
+
370
+ export type Domain = Components.Schemas.Domain;
371
+ export type EmailAddressSetting = Components.Schemas.EmailAddressSetting;
372
+ export type EmailDomainSetting = Components.Schemas.EmailDomainSetting;
373
+ export type RestrictDuplicatesWithinSetting = Components.Schemas.RestrictDuplicatesWithinSetting;
374
+ export type Setting = Components.Schemas.Setting;
375
+ export type SettingType = Components.Schemas.SettingType;
376
+ export type SettingsResponse = Components.Schemas.SettingsResponse;
377
+ export type SignatureSetting = Components.Schemas.SignatureSetting;
378
+ export type WhitelistEmailAddressSetting = Components.Schemas.WhitelistEmailAddressSetting;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/email-settings-client",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "API Client for epilot Email Settings API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "typescript": "tsc",
24
24
  "bundle-definition": "webpack",
25
25
  "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/email-settings.yaml",
26
- "typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ./src/openapi.json >> src/openapi.d.ts",
26
+ "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
27
27
  "build": "tsc && npm run bundle-definition",
28
28
  "build:watch": "npm run build && tsc -w",
29
29
  "prepublishOnly": "npm run typegen && npm run build",
@@ -60,8 +60,7 @@
60
60
  "copy-webpack-plugin": "^7.0.0",
61
61
  "jest": "^26.6.3",
62
62
  "json-loader": "^0.5.7",
63
- "openapi-client-axios-typegen": "^7.4.1",
64
- "openapicmd": "^2.1.0",
63
+ "openapicmd": "^2.6.0",
65
64
  "ts-jest": "^26.5.0",
66
65
  "ts-loader": "^8.0.14",
67
66
  "ts-node": "^10.9.1",
@@ -69,5 +68,5 @@
69
68
  "webpack": "^5.18.0",
70
69
  "webpack-cli": "^4.4.0"
71
70
  },
72
- "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
73
- }
71
+ "gitHead": "6c12dc4aaf7ddf60ad11c6f596fb478559fa3052"
72
+ }
@@ -0,0 +1,378 @@
1
+ /* eslint-disable */
2
+
3
+ import type {
4
+ OpenAPIClient,
5
+ Parameters,
6
+ UnknownParamsObject,
7
+ OperationResponse,
8
+ AxiosRequestConfig,
9
+ } from 'openapi-client-axios';
10
+
11
+ declare namespace Components {
12
+ namespace Schemas {
13
+ export interface Domain {
14
+ /**
15
+ * example:
16
+ * subdomain.epilot.cloud
17
+ */
18
+ domain?: string;
19
+ }
20
+ /**
21
+ * Setting that allows to add an email address on the custom domain. For e.g; john@doe.com
22
+ */
23
+ export type EmailAddressSetting = "email_address";
24
+ /**
25
+ * Setting that allows to add a custom domain. For e.g; doe.com
26
+ */
27
+ export type EmailDomainSetting = "email_domain";
28
+ /**
29
+ * - Restrict duplicates within:
30
+ * * 10s
31
+ * * 5m
32
+ * * 1d
33
+ * * 5000 // It converts to 5 seconds.When expressed as a numerical value, it will be interpreted as being in milliseconds.
34
+ * - Defaults to 3 minutes
35
+ * - Negative values will be treated same as positive values
36
+ * - If not set, defaults to 3 min
37
+ * - If set as 0, then the no email will be treated as a duplicate
38
+ * - Cannot have multiple values
39
+ *
40
+ */
41
+ export type RestrictDuplicatesWithinSetting = "restrict_duplicates_within";
42
+ export interface Setting {
43
+ [name: string]: any;
44
+ id?: string;
45
+ name?: string;
46
+ org_id?: string;
47
+ type: SettingType;
48
+ value?: string;
49
+ html?: string;
50
+ created_at?: string;
51
+ updated_at?: string;
52
+ created_by?: string;
53
+ updated_by?: string;
54
+ }
55
+ export type SettingType = /* Setting that allows to add a signature. */ SignatureSetting | /* Setting that allows to add a custom domain. For e.g; doe.com */ EmailDomainSetting | /* Setting that allows to add an email address on the custom domain. For e.g; john@doe.com */ EmailAddressSetting | /**
56
+ * - Setting that specifies a list of addresses exempt from being flagged as duplicate emails.
57
+ * - An email will be flagged as a duplicate if it has the same content and is sent to the same recipient within the time frame specified in the RestrictDuplicatesWithinSetting.
58
+ *
59
+ */
60
+ WhitelistEmailAddressSetting | /**
61
+ * - Restrict duplicates within:
62
+ * * 10s
63
+ * * 5m
64
+ * * 1d
65
+ * * 5000 // It converts to 5 seconds.When expressed as a numerical value, it will be interpreted as being in milliseconds.
66
+ * - Defaults to 3 minutes
67
+ * - Negative values will be treated same as positive values
68
+ * - If not set, defaults to 3 min
69
+ * - If set as 0, then the no email will be treated as a duplicate
70
+ * - Cannot have multiple values
71
+ *
72
+ */
73
+ RestrictDuplicatesWithinSetting;
74
+ export type SettingsResponse = Setting[] | Setting;
75
+ /**
76
+ * Setting that allows to add a signature.
77
+ */
78
+ export type SignatureSetting = "signature";
79
+ /**
80
+ * - Setting that specifies a list of addresses exempt from being flagged as duplicate emails.
81
+ * - An email will be flagged as a duplicate if it has the same content and is sent to the same recipient within the time frame specified in the RestrictDuplicatesWithinSetting.
82
+ *
83
+ */
84
+ export type WhitelistEmailAddressSetting = "whitelist_email_address";
85
+ }
86
+ }
87
+ declare namespace Paths {
88
+ namespace AddDomain {
89
+ export type RequestBody = Components.Schemas.Domain;
90
+ namespace Responses {
91
+ export type $200 = Components.Schemas.SettingsResponse;
92
+ export interface $403 {
93
+ }
94
+ export interface $404 {
95
+ }
96
+ }
97
+ }
98
+ namespace AddSetting {
99
+ export type RequestBody = Components.Schemas.Setting;
100
+ namespace Responses {
101
+ export type $200 = Components.Schemas.SettingsResponse;
102
+ export interface $403 {
103
+ }
104
+ export interface $404 {
105
+ }
106
+ }
107
+ }
108
+ namespace DeleteDomain {
109
+ export type RequestBody = Components.Schemas.Domain;
110
+ namespace Responses {
111
+ export interface $204 {
112
+ }
113
+ export interface $403 {
114
+ }
115
+ export interface $404 {
116
+ }
117
+ }
118
+ }
119
+ namespace DeleteSetting {
120
+ export interface RequestBody {
121
+ type: Components.Schemas.SettingType;
122
+ /**
123
+ * ID of setting
124
+ * example:
125
+ * a10bd0ff-4391-4cfc-88ee-b19d718a9bf7
126
+ */
127
+ id: string;
128
+ }
129
+ namespace Responses {
130
+ export type $200 = Components.Schemas.Setting;
131
+ export interface $403 {
132
+ }
133
+ export interface $404 {
134
+ }
135
+ }
136
+ }
137
+ namespace GetSettings {
138
+ namespace Parameters {
139
+ export type Id = string;
140
+ export type Type = Components.Schemas.SettingType;
141
+ }
142
+ export interface QueryParameters {
143
+ type: Parameters.Type;
144
+ id?: Parameters.Id;
145
+ }
146
+ namespace Responses {
147
+ export type $200 = Components.Schemas.SettingsResponse;
148
+ export interface $403 {
149
+ }
150
+ export interface $404 {
151
+ }
152
+ }
153
+ }
154
+ namespace UpdateSetting {
155
+ namespace Parameters {
156
+ export type Id = string;
157
+ }
158
+ export interface PathParameters {
159
+ id: Parameters.Id;
160
+ }
161
+ export type RequestBody = Components.Schemas.Setting;
162
+ namespace Responses {
163
+ export type $200 = Components.Schemas.Setting;
164
+ export interface $403 {
165
+ }
166
+ export interface $404 {
167
+ }
168
+ }
169
+ }
170
+ namespace VerifyDomain {
171
+ export type RequestBody = Components.Schemas.Domain;
172
+ namespace Responses {
173
+ export type $200 = Components.Schemas.SettingsResponse;
174
+ export interface $403 {
175
+ }
176
+ export interface $404 {
177
+ }
178
+ }
179
+ }
180
+ namespace VerifyNameServers {
181
+ export type RequestBody = Components.Schemas.Domain;
182
+ namespace Responses {
183
+ export type $200 = Components.Schemas.SettingsResponse;
184
+ export interface $403 {
185
+ }
186
+ export interface $404 {
187
+ }
188
+ }
189
+ }
190
+ }
191
+
192
+ export interface OperationMethods {
193
+ /**
194
+ * getSettings - getSettings
195
+ *
196
+ * Get all settings by type
197
+ */
198
+ 'getSettings'(
199
+ parameters?: Parameters<Paths.GetSettings.QueryParameters> | null,
200
+ data?: any,
201
+ config?: AxiosRequestConfig
202
+ ): OperationResponse<Paths.GetSettings.Responses.$200>
203
+ /**
204
+ * addSetting - addSetting
205
+ *
206
+ * Add setting
207
+ */
208
+ 'addSetting'(
209
+ parameters?: Parameters<UnknownParamsObject> | null,
210
+ data?: Paths.AddSetting.RequestBody,
211
+ config?: AxiosRequestConfig
212
+ ): OperationResponse<Paths.AddSetting.Responses.$200>
213
+ /**
214
+ * deleteSetting - deleteSetting
215
+ *
216
+ * delete setting by ID and type
217
+ */
218
+ 'deleteSetting'(
219
+ parameters?: Parameters<UnknownParamsObject> | null,
220
+ data?: Paths.DeleteSetting.RequestBody,
221
+ config?: AxiosRequestConfig
222
+ ): OperationResponse<Paths.DeleteSetting.Responses.$200>
223
+ /**
224
+ * updateSetting - updateSetting
225
+ *
226
+ * Update setting by ID
227
+ */
228
+ 'updateSetting'(
229
+ parameters?: Parameters<Paths.UpdateSetting.PathParameters> | null,
230
+ data?: Paths.UpdateSetting.RequestBody,
231
+ config?: AxiosRequestConfig
232
+ ): OperationResponse<Paths.UpdateSetting.Responses.$200>
233
+ /**
234
+ * addDomain - addDomain
235
+ *
236
+ * Add domain
237
+ */
238
+ 'addDomain'(
239
+ parameters?: Parameters<UnknownParamsObject> | null,
240
+ data?: Paths.AddDomain.RequestBody,
241
+ config?: AxiosRequestConfig
242
+ ): OperationResponse<Paths.AddDomain.Responses.$200>
243
+ /**
244
+ * deleteDomain - deleteDomain
245
+ *
246
+ * Delete domain
247
+ */
248
+ 'deleteDomain'(
249
+ parameters?: Parameters<UnknownParamsObject> | null,
250
+ data?: Paths.DeleteDomain.RequestBody,
251
+ config?: AxiosRequestConfig
252
+ ): OperationResponse<Paths.DeleteDomain.Responses.$204>
253
+ /**
254
+ * verifyNameServers - verifyNameServers
255
+ *
256
+ * Verify name servers
257
+ */
258
+ 'verifyNameServers'(
259
+ parameters?: Parameters<UnknownParamsObject> | null,
260
+ data?: Paths.VerifyNameServers.RequestBody,
261
+ config?: AxiosRequestConfig
262
+ ): OperationResponse<Paths.VerifyNameServers.Responses.$200>
263
+ /**
264
+ * verifyDomain - verifyDomain
265
+ *
266
+ * Verify domain
267
+ */
268
+ 'verifyDomain'(
269
+ parameters?: Parameters<UnknownParamsObject> | null,
270
+ data?: Paths.VerifyDomain.RequestBody,
271
+ config?: AxiosRequestConfig
272
+ ): OperationResponse<Paths.VerifyDomain.Responses.$200>
273
+ }
274
+
275
+ export interface PathsDictionary {
276
+ ['/v1/email-settings']: {
277
+ /**
278
+ * getSettings - getSettings
279
+ *
280
+ * Get all settings by type
281
+ */
282
+ 'get'(
283
+ parameters?: Parameters<Paths.GetSettings.QueryParameters> | null,
284
+ data?: any,
285
+ config?: AxiosRequestConfig
286
+ ): OperationResponse<Paths.GetSettings.Responses.$200>
287
+ /**
288
+ * addSetting - addSetting
289
+ *
290
+ * Add setting
291
+ */
292
+ 'post'(
293
+ parameters?: Parameters<UnknownParamsObject> | null,
294
+ data?: Paths.AddSetting.RequestBody,
295
+ config?: AxiosRequestConfig
296
+ ): OperationResponse<Paths.AddSetting.Responses.$200>
297
+ /**
298
+ * deleteSetting - deleteSetting
299
+ *
300
+ * delete setting by ID and type
301
+ */
302
+ 'delete'(
303
+ parameters?: Parameters<UnknownParamsObject> | null,
304
+ data?: Paths.DeleteSetting.RequestBody,
305
+ config?: AxiosRequestConfig
306
+ ): OperationResponse<Paths.DeleteSetting.Responses.$200>
307
+ }
308
+ ['/v1/email-settings/{id}']: {
309
+ /**
310
+ * updateSetting - updateSetting
311
+ *
312
+ * Update setting by ID
313
+ */
314
+ 'post'(
315
+ parameters?: Parameters<Paths.UpdateSetting.PathParameters> | null,
316
+ data?: Paths.UpdateSetting.RequestBody,
317
+ config?: AxiosRequestConfig
318
+ ): OperationResponse<Paths.UpdateSetting.Responses.$200>
319
+ }
320
+ ['/v1/email-settings/domain']: {
321
+ /**
322
+ * addDomain - addDomain
323
+ *
324
+ * Add domain
325
+ */
326
+ 'post'(
327
+ parameters?: Parameters<UnknownParamsObject> | null,
328
+ data?: Paths.AddDomain.RequestBody,
329
+ config?: AxiosRequestConfig
330
+ ): OperationResponse<Paths.AddDomain.Responses.$200>
331
+ /**
332
+ * deleteDomain - deleteDomain
333
+ *
334
+ * Delete domain
335
+ */
336
+ 'delete'(
337
+ parameters?: Parameters<UnknownParamsObject> | null,
338
+ data?: Paths.DeleteDomain.RequestBody,
339
+ config?: AxiosRequestConfig
340
+ ): OperationResponse<Paths.DeleteDomain.Responses.$204>
341
+ }
342
+ ['/v1/email-settings/domain/name-servers:verify']: {
343
+ /**
344
+ * verifyNameServers - verifyNameServers
345
+ *
346
+ * Verify name servers
347
+ */
348
+ 'post'(
349
+ parameters?: Parameters<UnknownParamsObject> | null,
350
+ data?: Paths.VerifyNameServers.RequestBody,
351
+ config?: AxiosRequestConfig
352
+ ): OperationResponse<Paths.VerifyNameServers.Responses.$200>
353
+ }
354
+ ['/v1/email-settings/domain:verify']: {
355
+ /**
356
+ * verifyDomain - verifyDomain
357
+ *
358
+ * Verify domain
359
+ */
360
+ 'post'(
361
+ parameters?: Parameters<UnknownParamsObject> | null,
362
+ data?: Paths.VerifyDomain.RequestBody,
363
+ config?: AxiosRequestConfig
364
+ ): OperationResponse<Paths.VerifyDomain.Responses.$200>
365
+ }
366
+ }
367
+
368
+ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
369
+
370
+ export type Domain = Components.Schemas.Domain;
371
+ export type EmailAddressSetting = Components.Schemas.EmailAddressSetting;
372
+ export type EmailDomainSetting = Components.Schemas.EmailDomainSetting;
373
+ export type RestrictDuplicatesWithinSetting = Components.Schemas.RestrictDuplicatesWithinSetting;
374
+ export type Setting = Components.Schemas.Setting;
375
+ export type SettingType = Components.Schemas.SettingType;
376
+ export type SettingsResponse = Components.Schemas.SettingsResponse;
377
+ export type SignatureSetting = Components.Schemas.SignatureSetting;
378
+ export type WhitelistEmailAddressSetting = Components.Schemas.WhitelistEmailAddressSetting;