simplelogin-client 0.0.1

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.
@@ -0,0 +1,2564 @@
1
+ 'use strict';
2
+ /* eslint-disable */
3
+ // @ts-nocheck
4
+ /**
5
+ * SimpleLogin (unofficial)
6
+ * The unofficial SimpleLogin API docs as OpenAPI 3.0.0 spec. This is based on the official markdown based docs, but written in OpenAPI to allow for easier integration with other tools and generation of client SDKs. Please do not contact the SimpleLogin team for support or issues with this API documentation.
7
+ *
8
+ * OpenAPI spec version: 4.22.0
9
+ * Contact: contact@ketrwu.de
10
+ *
11
+ * NOTE: This file is auto generated by the swagger code generator program.
12
+ * https://github.com/swagger-api/swagger-codegen.git
13
+ * Do not edit the file manually.
14
+ */
15
+ var __createBinding =
16
+ (this && this.__createBinding) ||
17
+ (Object.create
18
+ ? function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = {
23
+ enumerable: true,
24
+ get: function () {
25
+ return m[k];
26
+ },
27
+ };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }
31
+ : function (o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ o[k2] = m[k];
34
+ });
35
+ var __setModuleDefault =
36
+ (this && this.__setModuleDefault) ||
37
+ (Object.create
38
+ ? function (o, v) {
39
+ Object.defineProperty(o, 'default', { enumerable: true, value: v });
40
+ }
41
+ : function (o, v) {
42
+ o['default'] = v;
43
+ });
44
+ var __importStar =
45
+ (this && this.__importStar) ||
46
+ function (mod) {
47
+ if (mod && mod.__esModule) return mod;
48
+ var result = {};
49
+ if (mod != null)
50
+ for (var k in mod)
51
+ if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ Object.defineProperty(exports, '__esModule', { value: true });
56
+ exports.MailboxApi =
57
+ exports.MailboxApiFactory =
58
+ exports.MailboxApiFp =
59
+ exports.MailboxApiFetchParamCreator =
60
+ exports.CustomDomainApi =
61
+ exports.CustomDomainApiFactory =
62
+ exports.CustomDomainApiFp =
63
+ exports.CustomDomainApiFetchParamCreator =
64
+ exports.AliasApi =
65
+ exports.AliasApiFactory =
66
+ exports.AliasApiFp =
67
+ exports.AliasApiFetchParamCreator =
68
+ exports.AccountApi =
69
+ exports.AccountApiFactory =
70
+ exports.AccountApiFp =
71
+ exports.AccountApiFetchParamCreator =
72
+ exports.RequiredError =
73
+ exports.BaseAPI =
74
+ exports.COLLECTION_FORMATS =
75
+ exports.BASE_PATH =
76
+ void 0;
77
+ const url = __importStar(require('url'));
78
+ const defaultFetchApi = typeof fetch === 'undefined' ? undefined : fetch;
79
+ exports.BASE_PATH = 'https://app.simplelogin.io/api'.replace(/\/+$/, '');
80
+ /**
81
+ *
82
+ * @export
83
+ */
84
+ exports.COLLECTION_FORMATS = {
85
+ csv: ',',
86
+ ssv: ' ',
87
+ tsv: '\t',
88
+ pipes: '|',
89
+ };
90
+ /**
91
+ *
92
+ * @export
93
+ * @class BaseAPI
94
+ */
95
+ class BaseAPI {
96
+ basePath;
97
+ fetch;
98
+ configuration;
99
+ constructor(configuration, basePath = exports.BASE_PATH, fetch = defaultFetchApi) {
100
+ this.basePath = basePath;
101
+ this.fetch = fetch;
102
+ if (configuration) {
103
+ this.configuration = configuration;
104
+ this.basePath = configuration.basePath || this.basePath;
105
+ }
106
+ }
107
+ }
108
+ exports.BaseAPI = BaseAPI;
109
+ /**
110
+ *
111
+ * @export
112
+ * @class RequiredError
113
+ * @extends {Error}
114
+ */
115
+ class RequiredError extends Error {
116
+ field;
117
+ name;
118
+ constructor(field, msg) {
119
+ super(msg);
120
+ this.field = field;
121
+ }
122
+ }
123
+ exports.RequiredError = RequiredError;
124
+ /**
125
+ * AccountApi - fetch parameter creator
126
+ * @export
127
+ */
128
+ const AccountApiFetchParamCreator = function (configuration) {
129
+ return {
130
+ /**
131
+ * Activate a new account with the activation code that was sent to the user's email.
132
+ * @summary Activate account
133
+ * @param {AuthActivatePost} body
134
+ * @param {*} [options] Override http request option.
135
+ * @throws {RequiredError}
136
+ */
137
+ activateAccount(body, options = {}) {
138
+ // verify required parameter 'body' is not null or undefined
139
+ if (body === null || body === undefined) {
140
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling activateAccount.');
141
+ }
142
+ const localVarPath = `/auth/activate`;
143
+ const localVarUrlObj = url.parse(localVarPath, true);
144
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
145
+ const localVarHeaderParameter = {};
146
+ const localVarQueryParameter = {};
147
+ localVarHeaderParameter['Content-Type'] = 'application/json';
148
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
149
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
150
+ delete localVarUrlObj.search;
151
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
152
+ const needsSerialization =
153
+ 'AuthActivatePost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
154
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
155
+ return {
156
+ url: url.format(localVarUrlObj),
157
+ options: localVarRequestOptions,
158
+ };
159
+ },
160
+ /**
161
+ * Create a new API key
162
+ * @summary Create API key
163
+ * @param {UserApiKeyPost} body
164
+ * @param {*} [options] Override http request option.
165
+ * @throws {RequiredError}
166
+ */
167
+ createApiKey(body, options = {}) {
168
+ // verify required parameter 'body' is not null or undefined
169
+ if (body === null || body === undefined) {
170
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling createApiKey.');
171
+ }
172
+ const localVarPath = `/user/api_key`;
173
+ const localVarUrlObj = url.parse(localVarPath, true);
174
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
175
+ const localVarHeaderParameter = {};
176
+ const localVarQueryParameter = {};
177
+ // authentication apiKeyAuth required
178
+ if (configuration && configuration.apiKey) {
179
+ const localVarApiKeyValue =
180
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
181
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
182
+ }
183
+ localVarHeaderParameter['Content-Type'] = 'application/json';
184
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
185
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
186
+ delete localVarUrlObj.search;
187
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
188
+ const needsSerialization =
189
+ 'UserApiKeyPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
190
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
191
+ return {
192
+ url: url.format(localVarUrlObj),
193
+ options: localVarRequestOptions,
194
+ };
195
+ },
196
+ /**
197
+ * Delete user (requires sudo mode)
198
+ * @summary Delete user
199
+ * @param {*} [options] Override http request option.
200
+ * @throws {RequiredError}
201
+ */
202
+ deleteUser(options = {}) {
203
+ const localVarPath = `/user`;
204
+ const localVarUrlObj = url.parse(localVarPath, true);
205
+ const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options);
206
+ const localVarHeaderParameter = {};
207
+ const localVarQueryParameter = {};
208
+ // authentication apiKeyAuth required
209
+ if (configuration && configuration.apiKey) {
210
+ const localVarApiKeyValue =
211
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
212
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
213
+ }
214
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
215
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
216
+ delete localVarUrlObj.search;
217
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
218
+ return {
219
+ url: url.format(localVarUrlObj),
220
+ options: localVarRequestOptions,
221
+ };
222
+ },
223
+ /**
224
+ * Enable sudo mode
225
+ * @summary Enable sudo mode
226
+ * @param {SudoPatch} body
227
+ * @param {*} [options] Override http request option.
228
+ * @throws {RequiredError}
229
+ */
230
+ enableSudoMode(body, options = {}) {
231
+ // verify required parameter 'body' is not null or undefined
232
+ if (body === null || body === undefined) {
233
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling enableSudoMode.');
234
+ }
235
+ const localVarPath = `/sudo`;
236
+ const localVarUrlObj = url.parse(localVarPath, true);
237
+ const localVarRequestOptions = Object.assign({ method: 'PATCH' }, options);
238
+ const localVarHeaderParameter = {};
239
+ const localVarQueryParameter = {};
240
+ // authentication apiKeyAuth required
241
+ if (configuration && configuration.apiKey) {
242
+ const localVarApiKeyValue =
243
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
244
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
245
+ }
246
+ localVarHeaderParameter['Content-Type'] = 'application/json';
247
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
248
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
249
+ delete localVarUrlObj.search;
250
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
251
+ const needsSerialization =
252
+ 'SudoPatch' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
253
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
254
+ return {
255
+ url: url.format(localVarUrlObj),
256
+ options: localVarRequestOptions,
257
+ };
258
+ },
259
+ /**
260
+ * Request a link to reset the password for a registered account.
261
+ * @summary Forgot password
262
+ * @param {AuthForgotPasswordPost} body
263
+ * @param {*} [options] Override http request option.
264
+ * @throws {RequiredError}
265
+ */
266
+ forgotPassword(body, options = {}) {
267
+ // verify required parameter 'body' is not null or undefined
268
+ if (body === null || body === undefined) {
269
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling forgotPassword.');
270
+ }
271
+ const localVarPath = `/auth/forgot_password`;
272
+ const localVarUrlObj = url.parse(localVarPath, true);
273
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
274
+ const localVarHeaderParameter = {};
275
+ const localVarQueryParameter = {};
276
+ localVarHeaderParameter['Content-Type'] = 'application/json';
277
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
278
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
279
+ delete localVarUrlObj.search;
280
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
281
+ const needsSerialization =
282
+ 'AuthForgotPasswordPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
283
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
284
+ return {
285
+ url: url.format(localVarUrlObj),
286
+ options: localVarRequestOptions,
287
+ };
288
+ },
289
+ /**
290
+ * Get a one time use cookie to exchange it for a valid cookie in the web app
291
+ * @summary Get cookie token
292
+ * @param {*} [options] Override http request option.
293
+ * @throws {RequiredError}
294
+ */
295
+ getCookieToken(options = {}) {
296
+ const localVarPath = `/user/cookie_token`;
297
+ const localVarUrlObj = url.parse(localVarPath, true);
298
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
299
+ const localVarHeaderParameter = {};
300
+ const localVarQueryParameter = {};
301
+ // authentication apiKeyAuth required
302
+ if (configuration && configuration.apiKey) {
303
+ const localVarApiKeyValue =
304
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
305
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
306
+ }
307
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
308
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
309
+ delete localVarUrlObj.search;
310
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
311
+ return {
312
+ url: url.format(localVarUrlObj),
313
+ options: localVarRequestOptions,
314
+ };
315
+ },
316
+ /**
317
+ * Get user info
318
+ * @summary Get user info
319
+ * @param {*} [options] Override http request option.
320
+ * @throws {RequiredError}
321
+ */
322
+ getUserInfo(options = {}) {
323
+ const localVarPath = `/user_info`;
324
+ const localVarUrlObj = url.parse(localVarPath, true);
325
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
326
+ const localVarHeaderParameter = {};
327
+ const localVarQueryParameter = {};
328
+ // authentication apiKeyAuth required
329
+ if (configuration && configuration.apiKey) {
330
+ const localVarApiKeyValue =
331
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
332
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
333
+ }
334
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
335
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
336
+ delete localVarUrlObj.search;
337
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
338
+ return {
339
+ url: url.format(localVarUrlObj),
340
+ options: localVarRequestOptions,
341
+ };
342
+ },
343
+ /**
344
+ * Login using email and password to get an access token.
345
+ * @summary Login
346
+ * @param {AuthLoginPost} body
347
+ * @param {*} [options] Override http request option.
348
+ * @throws {RequiredError}
349
+ */
350
+ login(body, options = {}) {
351
+ // verify required parameter 'body' is not null or undefined
352
+ if (body === null || body === undefined) {
353
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling login.');
354
+ }
355
+ const localVarPath = `/auth/login`;
356
+ const localVarUrlObj = url.parse(localVarPath, true);
357
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
358
+ const localVarHeaderParameter = {};
359
+ const localVarQueryParameter = {};
360
+ localVarHeaderParameter['Content-Type'] = 'application/json';
361
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
362
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
363
+ delete localVarUrlObj.search;
364
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
365
+ const needsSerialization =
366
+ 'AuthLoginPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
367
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
368
+ return {
369
+ url: url.format(localVarUrlObj),
370
+ options: localVarRequestOptions,
371
+ };
372
+ },
373
+ /**
374
+ * Log out user
375
+ * @summary Logout
376
+ * @param {*} [options] Override http request option.
377
+ * @throws {RequiredError}
378
+ */
379
+ logout(options = {}) {
380
+ const localVarPath = `/logout`;
381
+ const localVarUrlObj = url.parse(localVarPath, true);
382
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
383
+ const localVarHeaderParameter = {};
384
+ const localVarQueryParameter = {};
385
+ // authentication apiKeyAuth required
386
+ if (configuration && configuration.apiKey) {
387
+ const localVarApiKeyValue =
388
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
389
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
390
+ }
391
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
392
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
393
+ delete localVarUrlObj.search;
394
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
395
+ return {
396
+ url: url.format(localVarUrlObj),
397
+ options: localVarRequestOptions,
398
+ };
399
+ },
400
+ /**
401
+ * Authenticate using MFA
402
+ * @summary MFA authentication
403
+ * @param {AuthMfaPost} body The api_key is used in all subsequent requests. It's empty if MFA is enabled. If user hasn't enabled MFA, mfa_key is empty.
404
+ * @param {*} [options] Override http request option.
405
+ * @throws {RequiredError}
406
+ */
407
+ mfa(body, options = {}) {
408
+ // verify required parameter 'body' is not null or undefined
409
+ if (body === null || body === undefined) {
410
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling mfa.');
411
+ }
412
+ const localVarPath = `/auth/mfa`;
413
+ const localVarUrlObj = url.parse(localVarPath, true);
414
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
415
+ const localVarHeaderParameter = {};
416
+ const localVarQueryParameter = {};
417
+ localVarHeaderParameter['Content-Type'] = 'application/json';
418
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
419
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
420
+ delete localVarUrlObj.search;
421
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
422
+ const needsSerialization =
423
+ 'AuthMfaPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
424
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
425
+ return {
426
+ url: url.format(localVarUrlObj),
427
+ options: localVarRequestOptions,
428
+ };
429
+ },
430
+ /**
431
+ * Request a new activation code for an account that was already registered, but not activated yet.
432
+ * @summary Reactivate account
433
+ * @param {AuthReactivatePost} body
434
+ * @param {*} [options] Override http request option.
435
+ * @throws {RequiredError}
436
+ */
437
+ reactivateAccount(body, options = {}) {
438
+ // verify required parameter 'body' is not null or undefined
439
+ if (body === null || body === undefined) {
440
+ throw new RequiredError(
441
+ 'body',
442
+ 'Required parameter body was null or undefined when calling reactivateAccount.',
443
+ );
444
+ }
445
+ const localVarPath = `/auth/reactivate`;
446
+ const localVarUrlObj = url.parse(localVarPath, true);
447
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
448
+ const localVarHeaderParameter = {};
449
+ const localVarQueryParameter = {};
450
+ localVarHeaderParameter['Content-Type'] = 'application/json';
451
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
452
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
453
+ delete localVarUrlObj.search;
454
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
455
+ const needsSerialization =
456
+ 'AuthReactivatePost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
457
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
458
+ return {
459
+ url: url.format(localVarUrlObj),
460
+ options: localVarRequestOptions,
461
+ };
462
+ },
463
+ /**
464
+ * Register a new account
465
+ * @summary Register account
466
+ * @param {AuthRegisterPost} body
467
+ * @param {*} [options] Override http request option.
468
+ * @throws {RequiredError}
469
+ */
470
+ registerAccount(body, options = {}) {
471
+ // verify required parameter 'body' is not null or undefined
472
+ if (body === null || body === undefined) {
473
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling registerAccount.');
474
+ }
475
+ const localVarPath = `/auth/register`;
476
+ const localVarUrlObj = url.parse(localVarPath, true);
477
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
478
+ const localVarHeaderParameter = {};
479
+ const localVarQueryParameter = {};
480
+ localVarHeaderParameter['Content-Type'] = 'application/json';
481
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
482
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
483
+ delete localVarUrlObj.search;
484
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
485
+ const needsSerialization =
486
+ 'AuthRegisterPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
487
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
488
+ return {
489
+ url: url.format(localVarUrlObj),
490
+ options: localVarRequestOptions,
491
+ };
492
+ },
493
+ /**
494
+ * Update user info
495
+ * @summary Update user info
496
+ * @param {UserInfoPatch} body
497
+ * @param {*} [options] Override http request option.
498
+ * @throws {RequiredError}
499
+ */
500
+ updateUserInfo(body, options = {}) {
501
+ // verify required parameter 'body' is not null or undefined
502
+ if (body === null || body === undefined) {
503
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateUserInfo.');
504
+ }
505
+ const localVarPath = `/user_info`;
506
+ const localVarUrlObj = url.parse(localVarPath, true);
507
+ const localVarRequestOptions = Object.assign({ method: 'PATCH' }, options);
508
+ const localVarHeaderParameter = {};
509
+ const localVarQueryParameter = {};
510
+ // authentication apiKeyAuth required
511
+ if (configuration && configuration.apiKey) {
512
+ const localVarApiKeyValue =
513
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
514
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
515
+ }
516
+ localVarHeaderParameter['Content-Type'] = 'application/json';
517
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
518
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
519
+ delete localVarUrlObj.search;
520
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
521
+ const needsSerialization =
522
+ 'UserInfoPatch' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
523
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
524
+ return {
525
+ url: url.format(localVarUrlObj),
526
+ options: localVarRequestOptions,
527
+ };
528
+ },
529
+ };
530
+ };
531
+ exports.AccountApiFetchParamCreator = AccountApiFetchParamCreator;
532
+ /**
533
+ * AccountApi - functional programming interface
534
+ * @export
535
+ */
536
+ const AccountApiFp = function (configuration) {
537
+ return {
538
+ /**
539
+ * Activate a new account with the activation code that was sent to the user's email.
540
+ * @summary Activate account
541
+ * @param {AuthActivatePost} body
542
+ * @param {*} [options] Override http request option.
543
+ * @throws {RequiredError}
544
+ */
545
+ activateAccount(body, options) {
546
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).activateAccount(body, options);
547
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
548
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
549
+ if (response.status >= 200 && response.status < 300) {
550
+ return response;
551
+ } else {
552
+ throw response;
553
+ }
554
+ });
555
+ };
556
+ },
557
+ /**
558
+ * Create a new API key
559
+ * @summary Create API key
560
+ * @param {UserApiKeyPost} body
561
+ * @param {*} [options] Override http request option.
562
+ * @throws {RequiredError}
563
+ */
564
+ createApiKey(body, options) {
565
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).createApiKey(body, options);
566
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
567
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
568
+ if (response.status >= 200 && response.status < 300) {
569
+ return response.json();
570
+ } else {
571
+ throw response;
572
+ }
573
+ });
574
+ };
575
+ },
576
+ /**
577
+ * Delete user (requires sudo mode)
578
+ * @summary Delete user
579
+ * @param {*} [options] Override http request option.
580
+ * @throws {RequiredError}
581
+ */
582
+ deleteUser(options) {
583
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).deleteUser(options);
584
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
585
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
586
+ if (response.status >= 200 && response.status < 300) {
587
+ return response.json();
588
+ } else {
589
+ throw response;
590
+ }
591
+ });
592
+ };
593
+ },
594
+ /**
595
+ * Enable sudo mode
596
+ * @summary Enable sudo mode
597
+ * @param {SudoPatch} body
598
+ * @param {*} [options] Override http request option.
599
+ * @throws {RequiredError}
600
+ */
601
+ enableSudoMode(body, options) {
602
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).enableSudoMode(body, options);
603
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
604
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
605
+ if (response.status >= 200 && response.status < 300) {
606
+ return response.json();
607
+ } else {
608
+ throw response;
609
+ }
610
+ });
611
+ };
612
+ },
613
+ /**
614
+ * Request a link to reset the password for a registered account.
615
+ * @summary Forgot password
616
+ * @param {AuthForgotPasswordPost} body
617
+ * @param {*} [options] Override http request option.
618
+ * @throws {RequiredError}
619
+ */
620
+ forgotPassword(body, options) {
621
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).forgotPassword(body, options);
622
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
623
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
624
+ if (response.status >= 200 && response.status < 300) {
625
+ return response;
626
+ } else {
627
+ throw response;
628
+ }
629
+ });
630
+ };
631
+ },
632
+ /**
633
+ * Get a one time use cookie to exchange it for a valid cookie in the web app
634
+ * @summary Get cookie token
635
+ * @param {*} [options] Override http request option.
636
+ * @throws {RequiredError}
637
+ */
638
+ getCookieToken(options) {
639
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).getCookieToken(options);
640
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
641
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
642
+ if (response.status >= 200 && response.status < 300) {
643
+ return response.json();
644
+ } else {
645
+ throw response;
646
+ }
647
+ });
648
+ };
649
+ },
650
+ /**
651
+ * Get user info
652
+ * @summary Get user info
653
+ * @param {*} [options] Override http request option.
654
+ * @throws {RequiredError}
655
+ */
656
+ getUserInfo(options) {
657
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).getUserInfo(options);
658
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
659
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
660
+ if (response.status >= 200 && response.status < 300) {
661
+ return response.json();
662
+ } else {
663
+ throw response;
664
+ }
665
+ });
666
+ };
667
+ },
668
+ /**
669
+ * Login using email and password to get an access token.
670
+ * @summary Login
671
+ * @param {AuthLoginPost} body
672
+ * @param {*} [options] Override http request option.
673
+ * @throws {RequiredError}
674
+ */
675
+ login(body, options) {
676
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).login(body, options);
677
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
678
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
679
+ if (response.status >= 200 && response.status < 300) {
680
+ return response.json();
681
+ } else {
682
+ throw response;
683
+ }
684
+ });
685
+ };
686
+ },
687
+ /**
688
+ * Log out user
689
+ * @summary Logout
690
+ * @param {*} [options] Override http request option.
691
+ * @throws {RequiredError}
692
+ */
693
+ logout(options) {
694
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).logout(options);
695
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
696
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
697
+ if (response.status >= 200 && response.status < 300) {
698
+ return response.json();
699
+ } else {
700
+ throw response;
701
+ }
702
+ });
703
+ };
704
+ },
705
+ /**
706
+ * Authenticate using MFA
707
+ * @summary MFA authentication
708
+ * @param {AuthMfaPost} body The api_key is used in all subsequent requests. It&#x27;s empty if MFA is enabled. If user hasn&#x27;t enabled MFA, mfa_key is empty.
709
+ * @param {*} [options] Override http request option.
710
+ * @throws {RequiredError}
711
+ */
712
+ mfa(body, options) {
713
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).mfa(body, options);
714
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
715
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
716
+ if (response.status >= 200 && response.status < 300) {
717
+ return response.json();
718
+ } else {
719
+ throw response;
720
+ }
721
+ });
722
+ };
723
+ },
724
+ /**
725
+ * Request a new activation code for an account that was already registered, but not activated yet.
726
+ * @summary Reactivate account
727
+ * @param {AuthReactivatePost} body
728
+ * @param {*} [options] Override http request option.
729
+ * @throws {RequiredError}
730
+ */
731
+ reactivateAccount(body, options) {
732
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).reactivateAccount(
733
+ body,
734
+ options,
735
+ );
736
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
737
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
738
+ if (response.status >= 200 && response.status < 300) {
739
+ return response;
740
+ } else {
741
+ throw response;
742
+ }
743
+ });
744
+ };
745
+ },
746
+ /**
747
+ * Register a new account
748
+ * @summary Register account
749
+ * @param {AuthRegisterPost} body
750
+ * @param {*} [options] Override http request option.
751
+ * @throws {RequiredError}
752
+ */
753
+ registerAccount(body, options) {
754
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).registerAccount(body, options);
755
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
756
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
757
+ if (response.status >= 200 && response.status < 300) {
758
+ return response;
759
+ } else {
760
+ throw response;
761
+ }
762
+ });
763
+ };
764
+ },
765
+ /**
766
+ * Update user info
767
+ * @summary Update user info
768
+ * @param {UserInfoPatch} body
769
+ * @param {*} [options] Override http request option.
770
+ * @throws {RequiredError}
771
+ */
772
+ updateUserInfo(body, options) {
773
+ const localVarFetchArgs = (0, exports.AccountApiFetchParamCreator)(configuration).updateUserInfo(body, options);
774
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
775
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
776
+ if (response.status >= 200 && response.status < 300) {
777
+ return response.json();
778
+ } else {
779
+ throw response;
780
+ }
781
+ });
782
+ };
783
+ },
784
+ };
785
+ };
786
+ exports.AccountApiFp = AccountApiFp;
787
+ /**
788
+ * AccountApi - factory interface
789
+ * @export
790
+ */
791
+ const AccountApiFactory = function (configuration, fetch, basePath) {
792
+ return {
793
+ /**
794
+ * Activate a new account with the activation code that was sent to the user's email.
795
+ * @summary Activate account
796
+ * @param {AuthActivatePost} body
797
+ * @param {*} [options] Override http request option.
798
+ * @throws {RequiredError}
799
+ */
800
+ activateAccount(body, options) {
801
+ return (0, exports.AccountApiFp)(configuration).activateAccount(body, options)(fetch, basePath);
802
+ },
803
+ /**
804
+ * Create a new API key
805
+ * @summary Create API key
806
+ * @param {UserApiKeyPost} body
807
+ * @param {*} [options] Override http request option.
808
+ * @throws {RequiredError}
809
+ */
810
+ createApiKey(body, options) {
811
+ return (0, exports.AccountApiFp)(configuration).createApiKey(body, options)(fetch, basePath);
812
+ },
813
+ /**
814
+ * Delete user (requires sudo mode)
815
+ * @summary Delete user
816
+ * @param {*} [options] Override http request option.
817
+ * @throws {RequiredError}
818
+ */
819
+ deleteUser(options) {
820
+ return (0, exports.AccountApiFp)(configuration).deleteUser(options)(fetch, basePath);
821
+ },
822
+ /**
823
+ * Enable sudo mode
824
+ * @summary Enable sudo mode
825
+ * @param {SudoPatch} body
826
+ * @param {*} [options] Override http request option.
827
+ * @throws {RequiredError}
828
+ */
829
+ enableSudoMode(body, options) {
830
+ return (0, exports.AccountApiFp)(configuration).enableSudoMode(body, options)(fetch, basePath);
831
+ },
832
+ /**
833
+ * Request a link to reset the password for a registered account.
834
+ * @summary Forgot password
835
+ * @param {AuthForgotPasswordPost} body
836
+ * @param {*} [options] Override http request option.
837
+ * @throws {RequiredError}
838
+ */
839
+ forgotPassword(body, options) {
840
+ return (0, exports.AccountApiFp)(configuration).forgotPassword(body, options)(fetch, basePath);
841
+ },
842
+ /**
843
+ * Get a one time use cookie to exchange it for a valid cookie in the web app
844
+ * @summary Get cookie token
845
+ * @param {*} [options] Override http request option.
846
+ * @throws {RequiredError}
847
+ */
848
+ getCookieToken(options) {
849
+ return (0, exports.AccountApiFp)(configuration).getCookieToken(options)(fetch, basePath);
850
+ },
851
+ /**
852
+ * Get user info
853
+ * @summary Get user info
854
+ * @param {*} [options] Override http request option.
855
+ * @throws {RequiredError}
856
+ */
857
+ getUserInfo(options) {
858
+ return (0, exports.AccountApiFp)(configuration).getUserInfo(options)(fetch, basePath);
859
+ },
860
+ /**
861
+ * Login using email and password to get an access token.
862
+ * @summary Login
863
+ * @param {AuthLoginPost} body
864
+ * @param {*} [options] Override http request option.
865
+ * @throws {RequiredError}
866
+ */
867
+ login(body, options) {
868
+ return (0, exports.AccountApiFp)(configuration).login(body, options)(fetch, basePath);
869
+ },
870
+ /**
871
+ * Log out user
872
+ * @summary Logout
873
+ * @param {*} [options] Override http request option.
874
+ * @throws {RequiredError}
875
+ */
876
+ logout(options) {
877
+ return (0, exports.AccountApiFp)(configuration).logout(options)(fetch, basePath);
878
+ },
879
+ /**
880
+ * Authenticate using MFA
881
+ * @summary MFA authentication
882
+ * @param {AuthMfaPost} body The api_key is used in all subsequent requests. It&#x27;s empty if MFA is enabled. If user hasn&#x27;t enabled MFA, mfa_key is empty.
883
+ * @param {*} [options] Override http request option.
884
+ * @throws {RequiredError}
885
+ */
886
+ mfa(body, options) {
887
+ return (0, exports.AccountApiFp)(configuration).mfa(body, options)(fetch, basePath);
888
+ },
889
+ /**
890
+ * Request a new activation code for an account that was already registered, but not activated yet.
891
+ * @summary Reactivate account
892
+ * @param {AuthReactivatePost} body
893
+ * @param {*} [options] Override http request option.
894
+ * @throws {RequiredError}
895
+ */
896
+ reactivateAccount(body, options) {
897
+ return (0, exports.AccountApiFp)(configuration).reactivateAccount(body, options)(fetch, basePath);
898
+ },
899
+ /**
900
+ * Register a new account
901
+ * @summary Register account
902
+ * @param {AuthRegisterPost} body
903
+ * @param {*} [options] Override http request option.
904
+ * @throws {RequiredError}
905
+ */
906
+ registerAccount(body, options) {
907
+ return (0, exports.AccountApiFp)(configuration).registerAccount(body, options)(fetch, basePath);
908
+ },
909
+ /**
910
+ * Update user info
911
+ * @summary Update user info
912
+ * @param {UserInfoPatch} body
913
+ * @param {*} [options] Override http request option.
914
+ * @throws {RequiredError}
915
+ */
916
+ updateUserInfo(body, options) {
917
+ return (0, exports.AccountApiFp)(configuration).updateUserInfo(body, options)(fetch, basePath);
918
+ },
919
+ };
920
+ };
921
+ exports.AccountApiFactory = AccountApiFactory;
922
+ /**
923
+ * AccountApi - object-oriented interface
924
+ * @export
925
+ * @class AccountApi
926
+ * @extends {BaseAPI}
927
+ */
928
+ class AccountApi extends BaseAPI {
929
+ /**
930
+ * Activate a new account with the activation code that was sent to the user's email.
931
+ * @summary Activate account
932
+ * @param {AuthActivatePost} body
933
+ * @param {*} [options] Override http request option.
934
+ * @throws {RequiredError}
935
+ * @memberof AccountApi
936
+ */
937
+ activateAccount(body, options) {
938
+ return (0, exports.AccountApiFp)(this.configuration).activateAccount(body, options)(this.fetch, this.basePath);
939
+ }
940
+ /**
941
+ * Create a new API key
942
+ * @summary Create API key
943
+ * @param {UserApiKeyPost} body
944
+ * @param {*} [options] Override http request option.
945
+ * @throws {RequiredError}
946
+ * @memberof AccountApi
947
+ */
948
+ createApiKey(body, options) {
949
+ return (0, exports.AccountApiFp)(this.configuration).createApiKey(body, options)(this.fetch, this.basePath);
950
+ }
951
+ /**
952
+ * Delete user (requires sudo mode)
953
+ * @summary Delete user
954
+ * @param {*} [options] Override http request option.
955
+ * @throws {RequiredError}
956
+ * @memberof AccountApi
957
+ */
958
+ deleteUser(options) {
959
+ return (0, exports.AccountApiFp)(this.configuration).deleteUser(options)(this.fetch, this.basePath);
960
+ }
961
+ /**
962
+ * Enable sudo mode
963
+ * @summary Enable sudo mode
964
+ * @param {SudoPatch} body
965
+ * @param {*} [options] Override http request option.
966
+ * @throws {RequiredError}
967
+ * @memberof AccountApi
968
+ */
969
+ enableSudoMode(body, options) {
970
+ return (0, exports.AccountApiFp)(this.configuration).enableSudoMode(body, options)(this.fetch, this.basePath);
971
+ }
972
+ /**
973
+ * Request a link to reset the password for a registered account.
974
+ * @summary Forgot password
975
+ * @param {AuthForgotPasswordPost} body
976
+ * @param {*} [options] Override http request option.
977
+ * @throws {RequiredError}
978
+ * @memberof AccountApi
979
+ */
980
+ forgotPassword(body, options) {
981
+ return (0, exports.AccountApiFp)(this.configuration).forgotPassword(body, options)(this.fetch, this.basePath);
982
+ }
983
+ /**
984
+ * Get a one time use cookie to exchange it for a valid cookie in the web app
985
+ * @summary Get cookie token
986
+ * @param {*} [options] Override http request option.
987
+ * @throws {RequiredError}
988
+ * @memberof AccountApi
989
+ */
990
+ getCookieToken(options) {
991
+ return (0, exports.AccountApiFp)(this.configuration).getCookieToken(options)(this.fetch, this.basePath);
992
+ }
993
+ /**
994
+ * Get user info
995
+ * @summary Get user info
996
+ * @param {*} [options] Override http request option.
997
+ * @throws {RequiredError}
998
+ * @memberof AccountApi
999
+ */
1000
+ getUserInfo(options) {
1001
+ return (0, exports.AccountApiFp)(this.configuration).getUserInfo(options)(this.fetch, this.basePath);
1002
+ }
1003
+ /**
1004
+ * Login using email and password to get an access token.
1005
+ * @summary Login
1006
+ * @param {AuthLoginPost} body
1007
+ * @param {*} [options] Override http request option.
1008
+ * @throws {RequiredError}
1009
+ * @memberof AccountApi
1010
+ */
1011
+ login(body, options) {
1012
+ return (0, exports.AccountApiFp)(this.configuration).login(body, options)(this.fetch, this.basePath);
1013
+ }
1014
+ /**
1015
+ * Log out user
1016
+ * @summary Logout
1017
+ * @param {*} [options] Override http request option.
1018
+ * @throws {RequiredError}
1019
+ * @memberof AccountApi
1020
+ */
1021
+ logout(options) {
1022
+ return (0, exports.AccountApiFp)(this.configuration).logout(options)(this.fetch, this.basePath);
1023
+ }
1024
+ /**
1025
+ * Authenticate using MFA
1026
+ * @summary MFA authentication
1027
+ * @param {AuthMfaPost} body The api_key is used in all subsequent requests. It&#x27;s empty if MFA is enabled. If user hasn&#x27;t enabled MFA, mfa_key is empty.
1028
+ * @param {*} [options] Override http request option.
1029
+ * @throws {RequiredError}
1030
+ * @memberof AccountApi
1031
+ */
1032
+ mfa(body, options) {
1033
+ return (0, exports.AccountApiFp)(this.configuration).mfa(body, options)(this.fetch, this.basePath);
1034
+ }
1035
+ /**
1036
+ * Request a new activation code for an account that was already registered, but not activated yet.
1037
+ * @summary Reactivate account
1038
+ * @param {AuthReactivatePost} body
1039
+ * @param {*} [options] Override http request option.
1040
+ * @throws {RequiredError}
1041
+ * @memberof AccountApi
1042
+ */
1043
+ reactivateAccount(body, options) {
1044
+ return (0, exports.AccountApiFp)(this.configuration).reactivateAccount(body, options)(this.fetch, this.basePath);
1045
+ }
1046
+ /**
1047
+ * Register a new account
1048
+ * @summary Register account
1049
+ * @param {AuthRegisterPost} body
1050
+ * @param {*} [options] Override http request option.
1051
+ * @throws {RequiredError}
1052
+ * @memberof AccountApi
1053
+ */
1054
+ registerAccount(body, options) {
1055
+ return (0, exports.AccountApiFp)(this.configuration).registerAccount(body, options)(this.fetch, this.basePath);
1056
+ }
1057
+ /**
1058
+ * Update user info
1059
+ * @summary Update user info
1060
+ * @param {UserInfoPatch} body
1061
+ * @param {*} [options] Override http request option.
1062
+ * @throws {RequiredError}
1063
+ * @memberof AccountApi
1064
+ */
1065
+ updateUserInfo(body, options) {
1066
+ return (0, exports.AccountApiFp)(this.configuration).updateUserInfo(body, options)(this.fetch, this.basePath);
1067
+ }
1068
+ }
1069
+ exports.AccountApi = AccountApi;
1070
+ /**
1071
+ * AliasApi - fetch parameter creator
1072
+ * @export
1073
+ */
1074
+ const AliasApiFetchParamCreator = function (configuration) {
1075
+ return {
1076
+ /**
1077
+ * Create a new contact for an alias by id.
1078
+ * @summary Create contact
1079
+ * @param {AliasAliasIdContactsPost} body Updated settings for the given alias.
1080
+ * @param {number} aliasId ID of an alias
1081
+ * @param {*} [options] Override http request option.
1082
+ * @throws {RequiredError}
1083
+ */
1084
+ createContact(body, aliasId, options = {}) {
1085
+ // verify required parameter 'body' is not null or undefined
1086
+ if (body === null || body === undefined) {
1087
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling createContact.');
1088
+ }
1089
+ // verify required parameter 'aliasId' is not null or undefined
1090
+ if (aliasId === null || aliasId === undefined) {
1091
+ throw new RequiredError(
1092
+ 'aliasId',
1093
+ 'Required parameter aliasId was null or undefined when calling createContact.',
1094
+ );
1095
+ }
1096
+ const localVarPath = `/aliases/{alias_id}/contacts`.replace(
1097
+ `{${'alias_id'}}`,
1098
+ encodeURIComponent(String(aliasId)),
1099
+ );
1100
+ const localVarUrlObj = url.parse(localVarPath, true);
1101
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1102
+ const localVarHeaderParameter = {};
1103
+ const localVarQueryParameter = {};
1104
+ // authentication apiKeyAuth required
1105
+ if (configuration && configuration.apiKey) {
1106
+ const localVarApiKeyValue =
1107
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1108
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1109
+ }
1110
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1111
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1112
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1113
+ delete localVarUrlObj.search;
1114
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1115
+ const needsSerialization =
1116
+ 'AliasAliasIdContactsPost' !== 'string' ||
1117
+ localVarRequestOptions.headers['Content-Type'] === 'application/json';
1118
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
1119
+ return {
1120
+ url: url.format(localVarUrlObj),
1121
+ options: localVarRequestOptions,
1122
+ };
1123
+ },
1124
+ /**
1125
+ * Create a new custom alias
1126
+ * @summary Create custom alias
1127
+ * @param {AliasCustomNewPost} body
1128
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1129
+ * @param {*} [options] Override http request option.
1130
+ * @throws {RequiredError}
1131
+ */
1132
+ createCustomAlias(body, hostname, options = {}) {
1133
+ // verify required parameter 'body' is not null or undefined
1134
+ if (body === null || body === undefined) {
1135
+ throw new RequiredError(
1136
+ 'body',
1137
+ 'Required parameter body was null or undefined when calling createCustomAlias.',
1138
+ );
1139
+ }
1140
+ const localVarPath = `/v3/alias/custom/new`;
1141
+ const localVarUrlObj = url.parse(localVarPath, true);
1142
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1143
+ const localVarHeaderParameter = {};
1144
+ const localVarQueryParameter = {};
1145
+ // authentication apiKeyAuth required
1146
+ if (configuration && configuration.apiKey) {
1147
+ const localVarApiKeyValue =
1148
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1149
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1150
+ }
1151
+ if (hostname !== undefined) {
1152
+ localVarQueryParameter['hostname'] = hostname;
1153
+ }
1154
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1155
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1156
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1157
+ delete localVarUrlObj.search;
1158
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1159
+ const needsSerialization =
1160
+ 'AliasCustomNewPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1161
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
1162
+ return {
1163
+ url: url.format(localVarUrlObj),
1164
+ options: localVarRequestOptions,
1165
+ };
1166
+ },
1167
+ /**
1168
+ * Create a new random alias
1169
+ * @summary Create random alias
1170
+ * @param {AliasRandomNewPost} body
1171
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1172
+ * @param {string} [mode] Either &#x60;uuid&#x60; or &#x60;word&#x60;. By default, use the user setting when creating new random alias.
1173
+ * @param {*} [options] Override http request option.
1174
+ * @throws {RequiredError}
1175
+ */
1176
+ createRandomAlias(body, hostname, mode, options = {}) {
1177
+ // verify required parameter 'body' is not null or undefined
1178
+ if (body === null || body === undefined) {
1179
+ throw new RequiredError(
1180
+ 'body',
1181
+ 'Required parameter body was null or undefined when calling createRandomAlias.',
1182
+ );
1183
+ }
1184
+ const localVarPath = `/alias/random/new`;
1185
+ const localVarUrlObj = url.parse(localVarPath, true);
1186
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1187
+ const localVarHeaderParameter = {};
1188
+ const localVarQueryParameter = {};
1189
+ // authentication apiKeyAuth required
1190
+ if (configuration && configuration.apiKey) {
1191
+ const localVarApiKeyValue =
1192
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1193
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1194
+ }
1195
+ if (hostname !== undefined) {
1196
+ localVarQueryParameter['hostname'] = hostname;
1197
+ }
1198
+ if (mode !== undefined) {
1199
+ localVarQueryParameter['mode'] = mode;
1200
+ }
1201
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1202
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1203
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1204
+ delete localVarUrlObj.search;
1205
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1206
+ const needsSerialization =
1207
+ 'AliasRandomNewPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1208
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
1209
+ return {
1210
+ url: url.format(localVarUrlObj),
1211
+ options: localVarRequestOptions,
1212
+ };
1213
+ },
1214
+ /**
1215
+ * Delete specific alias by id.
1216
+ * @summary Delete alias
1217
+ * @param {number} aliasId ID of an alias
1218
+ * @param {*} [options] Override http request option.
1219
+ * @throws {RequiredError}
1220
+ */
1221
+ deleteAlias(aliasId, options = {}) {
1222
+ // verify required parameter 'aliasId' is not null or undefined
1223
+ if (aliasId === null || aliasId === undefined) {
1224
+ throw new RequiredError(
1225
+ 'aliasId',
1226
+ 'Required parameter aliasId was null or undefined when calling deleteAlias.',
1227
+ );
1228
+ }
1229
+ const localVarPath = `/aliases/{alias_id}`.replace(`{${'alias_id'}}`, encodeURIComponent(String(aliasId)));
1230
+ const localVarUrlObj = url.parse(localVarPath, true);
1231
+ const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options);
1232
+ const localVarHeaderParameter = {};
1233
+ const localVarQueryParameter = {};
1234
+ // authentication apiKeyAuth required
1235
+ if (configuration && configuration.apiKey) {
1236
+ const localVarApiKeyValue =
1237
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1238
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1239
+ }
1240
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1241
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1242
+ delete localVarUrlObj.search;
1243
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1244
+ return {
1245
+ url: url.format(localVarUrlObj),
1246
+ options: localVarRequestOptions,
1247
+ };
1248
+ },
1249
+ /**
1250
+ * Get activities for specific alias by id.
1251
+ * @summary Get activities
1252
+ * @param {number} aliasId ID of an alias
1253
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1254
+ * @param {*} [options] Override http request option.
1255
+ * @throws {RequiredError}
1256
+ */
1257
+ getActivities(aliasId, pageId, options = {}) {
1258
+ // verify required parameter 'aliasId' is not null or undefined
1259
+ if (aliasId === null || aliasId === undefined) {
1260
+ throw new RequiredError(
1261
+ 'aliasId',
1262
+ 'Required parameter aliasId was null or undefined when calling getActivities.',
1263
+ );
1264
+ }
1265
+ // verify required parameter 'pageId' is not null or undefined
1266
+ if (pageId === null || pageId === undefined) {
1267
+ throw new RequiredError(
1268
+ 'pageId',
1269
+ 'Required parameter pageId was null or undefined when calling getActivities.',
1270
+ );
1271
+ }
1272
+ const localVarPath = `/aliases/{alias_id}/activities`.replace(
1273
+ `{${'alias_id'}}`,
1274
+ encodeURIComponent(String(aliasId)),
1275
+ );
1276
+ const localVarUrlObj = url.parse(localVarPath, true);
1277
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1278
+ const localVarHeaderParameter = {};
1279
+ const localVarQueryParameter = {};
1280
+ // authentication apiKeyAuth required
1281
+ if (configuration && configuration.apiKey) {
1282
+ const localVarApiKeyValue =
1283
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1284
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1285
+ }
1286
+ if (pageId !== undefined) {
1287
+ localVarQueryParameter['page_id'] = pageId;
1288
+ }
1289
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1290
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1291
+ delete localVarUrlObj.search;
1292
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1293
+ return {
1294
+ url: url.format(localVarUrlObj),
1295
+ options: localVarRequestOptions,
1296
+ };
1297
+ },
1298
+ /**
1299
+ * Get specific alias by id.
1300
+ * @summary Get alias
1301
+ * @param {number} aliasId ID of an alias
1302
+ * @param {*} [options] Override http request option.
1303
+ * @throws {RequiredError}
1304
+ */
1305
+ getAlias(aliasId, options = {}) {
1306
+ // verify required parameter 'aliasId' is not null or undefined
1307
+ if (aliasId === null || aliasId === undefined) {
1308
+ throw new RequiredError('aliasId', 'Required parameter aliasId was null or undefined when calling getAlias.');
1309
+ }
1310
+ const localVarPath = `/aliases/{alias_id}`.replace(`{${'alias_id'}}`, encodeURIComponent(String(aliasId)));
1311
+ const localVarUrlObj = url.parse(localVarPath, true);
1312
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1313
+ const localVarHeaderParameter = {};
1314
+ const localVarQueryParameter = {};
1315
+ // authentication apiKeyAuth required
1316
+ if (configuration && configuration.apiKey) {
1317
+ const localVarApiKeyValue =
1318
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1319
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1320
+ }
1321
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1322
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1323
+ delete localVarUrlObj.search;
1324
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1325
+ return {
1326
+ url: url.format(localVarUrlObj),
1327
+ options: localVarRequestOptions,
1328
+ };
1329
+ },
1330
+ /**
1331
+ * User alias info and suggestion. Used by the first extension screen when user opens the extension.
1332
+ * @summary Get alias options
1333
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1334
+ * @param {*} [options] Override http request option.
1335
+ * @throws {RequiredError}
1336
+ */
1337
+ getAliasOptions(hostname, options = {}) {
1338
+ const localVarPath = `/v5/alias/options`;
1339
+ const localVarUrlObj = url.parse(localVarPath, true);
1340
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1341
+ const localVarHeaderParameter = {};
1342
+ const localVarQueryParameter = {};
1343
+ // authentication apiKeyAuth required
1344
+ if (configuration && configuration.apiKey) {
1345
+ const localVarApiKeyValue =
1346
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1347
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1348
+ }
1349
+ if (hostname !== undefined) {
1350
+ localVarQueryParameter['hostname'] = hostname;
1351
+ }
1352
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1353
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1354
+ delete localVarUrlObj.search;
1355
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1356
+ return {
1357
+ url: url.format(localVarUrlObj),
1358
+ options: localVarRequestOptions,
1359
+ };
1360
+ },
1361
+ /**
1362
+ * Get user aliases. Please note `pinned`, `disabled`, `enabled` are exclusive, i.e. only one can be present. They can only be set to `true`.
1363
+ * @summary Get aliases
1364
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1365
+ * @param {boolean} [pinned] If set, only pinned aliases are returned.
1366
+ * @param {boolean} [disabled] If set, only disabled aliases are returned.
1367
+ * @param {boolean} [enabled] If set, only enabled aliases are returned.
1368
+ * @param {*} [options] Override http request option.
1369
+ * @throws {RequiredError}
1370
+ */
1371
+ getAliases(pageId, pinned, disabled, enabled, options = {}) {
1372
+ // verify required parameter 'pageId' is not null or undefined
1373
+ if (pageId === null || pageId === undefined) {
1374
+ throw new RequiredError('pageId', 'Required parameter pageId was null or undefined when calling getAliases.');
1375
+ }
1376
+ const localVarPath = `/v2/aliases`;
1377
+ const localVarUrlObj = url.parse(localVarPath, true);
1378
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1379
+ const localVarHeaderParameter = {};
1380
+ const localVarQueryParameter = {};
1381
+ // authentication apiKeyAuth required
1382
+ if (configuration && configuration.apiKey) {
1383
+ const localVarApiKeyValue =
1384
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1385
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1386
+ }
1387
+ if (pageId !== undefined) {
1388
+ localVarQueryParameter['page_id'] = pageId;
1389
+ }
1390
+ if (pinned !== undefined) {
1391
+ localVarQueryParameter['pinned'] = pinned;
1392
+ }
1393
+ if (disabled !== undefined) {
1394
+ localVarQueryParameter['disabled'] = disabled;
1395
+ }
1396
+ if (enabled !== undefined) {
1397
+ localVarQueryParameter['enabled'] = enabled;
1398
+ }
1399
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1400
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1401
+ delete localVarUrlObj.search;
1402
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1403
+ return {
1404
+ url: url.format(localVarUrlObj),
1405
+ options: localVarRequestOptions,
1406
+ };
1407
+ },
1408
+ /**
1409
+ * Get contacts for specific alias by id.
1410
+ * @summary Get contacts
1411
+ * @param {number} aliasId ID of an alias
1412
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1413
+ * @param {*} [options] Override http request option.
1414
+ * @throws {RequiredError}
1415
+ */
1416
+ getContacts(aliasId, pageId, options = {}) {
1417
+ // verify required parameter 'aliasId' is not null or undefined
1418
+ if (aliasId === null || aliasId === undefined) {
1419
+ throw new RequiredError(
1420
+ 'aliasId',
1421
+ 'Required parameter aliasId was null or undefined when calling getContacts.',
1422
+ );
1423
+ }
1424
+ // verify required parameter 'pageId' is not null or undefined
1425
+ if (pageId === null || pageId === undefined) {
1426
+ throw new RequiredError('pageId', 'Required parameter pageId was null or undefined when calling getContacts.');
1427
+ }
1428
+ const localVarPath = `/aliases/{alias_id}/contacts`.replace(
1429
+ `{${'alias_id'}}`,
1430
+ encodeURIComponent(String(aliasId)),
1431
+ );
1432
+ const localVarUrlObj = url.parse(localVarPath, true);
1433
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1434
+ const localVarHeaderParameter = {};
1435
+ const localVarQueryParameter = {};
1436
+ // authentication apiKeyAuth required
1437
+ if (configuration && configuration.apiKey) {
1438
+ const localVarApiKeyValue =
1439
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1440
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1441
+ }
1442
+ if (pageId !== undefined) {
1443
+ localVarQueryParameter['page_id'] = pageId;
1444
+ }
1445
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1446
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1447
+ delete localVarUrlObj.search;
1448
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1449
+ return {
1450
+ url: url.format(localVarUrlObj),
1451
+ options: localVarRequestOptions,
1452
+ };
1453
+ },
1454
+ /**
1455
+ * Enable or disable specific alias by id.
1456
+ * @summary Toggle alias
1457
+ * @param {number} aliasId ID of an alias
1458
+ * @param {*} [options] Override http request option.
1459
+ * @throws {RequiredError}
1460
+ */
1461
+ toggleAlias(aliasId, options = {}) {
1462
+ // verify required parameter 'aliasId' is not null or undefined
1463
+ if (aliasId === null || aliasId === undefined) {
1464
+ throw new RequiredError(
1465
+ 'aliasId',
1466
+ 'Required parameter aliasId was null or undefined when calling toggleAlias.',
1467
+ );
1468
+ }
1469
+ const localVarPath = `/aliases/{alias_id}/toggle`.replace(`{${'alias_id'}}`, encodeURIComponent(String(aliasId)));
1470
+ const localVarUrlObj = url.parse(localVarPath, true);
1471
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1472
+ const localVarHeaderParameter = {};
1473
+ const localVarQueryParameter = {};
1474
+ // authentication apiKeyAuth required
1475
+ if (configuration && configuration.apiKey) {
1476
+ const localVarApiKeyValue =
1477
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1478
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1479
+ }
1480
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1481
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1482
+ delete localVarUrlObj.search;
1483
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1484
+ return {
1485
+ url: url.format(localVarUrlObj),
1486
+ options: localVarRequestOptions,
1487
+ };
1488
+ },
1489
+ /**
1490
+ * Update specific alias by id.
1491
+ * @summary Update alias
1492
+ * @param {AliasAliasIdPatch} body Updated settings for the given alias.
1493
+ * @param {number} aliasId ID of an alias
1494
+ * @param {*} [options] Override http request option.
1495
+ * @throws {RequiredError}
1496
+ */
1497
+ updateAlias(body, aliasId, options = {}) {
1498
+ // verify required parameter 'body' is not null or undefined
1499
+ if (body === null || body === undefined) {
1500
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateAlias.');
1501
+ }
1502
+ // verify required parameter 'aliasId' is not null or undefined
1503
+ if (aliasId === null || aliasId === undefined) {
1504
+ throw new RequiredError(
1505
+ 'aliasId',
1506
+ 'Required parameter aliasId was null or undefined when calling updateAlias.',
1507
+ );
1508
+ }
1509
+ const localVarPath = `/aliases/{alias_id}`.replace(`{${'alias_id'}}`, encodeURIComponent(String(aliasId)));
1510
+ const localVarUrlObj = url.parse(localVarPath, true);
1511
+ const localVarRequestOptions = Object.assign({ method: 'PATCH' }, options);
1512
+ const localVarHeaderParameter = {};
1513
+ const localVarQueryParameter = {};
1514
+ // authentication apiKeyAuth required
1515
+ if (configuration && configuration.apiKey) {
1516
+ const localVarApiKeyValue =
1517
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
1518
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
1519
+ }
1520
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1521
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1522
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1523
+ delete localVarUrlObj.search;
1524
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1525
+ const needsSerialization =
1526
+ 'AliasAliasIdPatch' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1527
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
1528
+ return {
1529
+ url: url.format(localVarUrlObj),
1530
+ options: localVarRequestOptions,
1531
+ };
1532
+ },
1533
+ };
1534
+ };
1535
+ exports.AliasApiFetchParamCreator = AliasApiFetchParamCreator;
1536
+ /**
1537
+ * AliasApi - functional programming interface
1538
+ * @export
1539
+ */
1540
+ const AliasApiFp = function (configuration) {
1541
+ return {
1542
+ /**
1543
+ * Create a new contact for an alias by id.
1544
+ * @summary Create contact
1545
+ * @param {AliasAliasIdContactsPost} body Updated settings for the given alias.
1546
+ * @param {number} aliasId ID of an alias
1547
+ * @param {*} [options] Override http request option.
1548
+ * @throws {RequiredError}
1549
+ */
1550
+ createContact(body, aliasId, options) {
1551
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).createContact(
1552
+ body,
1553
+ aliasId,
1554
+ options,
1555
+ );
1556
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1557
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1558
+ if (response.status >= 200 && response.status < 300) {
1559
+ return response.json();
1560
+ } else {
1561
+ throw response;
1562
+ }
1563
+ });
1564
+ };
1565
+ },
1566
+ /**
1567
+ * Create a new custom alias
1568
+ * @summary Create custom alias
1569
+ * @param {AliasCustomNewPost} body
1570
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1571
+ * @param {*} [options] Override http request option.
1572
+ * @throws {RequiredError}
1573
+ */
1574
+ createCustomAlias(body, hostname, options) {
1575
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).createCustomAlias(
1576
+ body,
1577
+ hostname,
1578
+ options,
1579
+ );
1580
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1581
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1582
+ if (response.status >= 200 && response.status < 300) {
1583
+ return response.json();
1584
+ } else {
1585
+ throw response;
1586
+ }
1587
+ });
1588
+ };
1589
+ },
1590
+ /**
1591
+ * Create a new random alias
1592
+ * @summary Create random alias
1593
+ * @param {AliasRandomNewPost} body
1594
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1595
+ * @param {string} [mode] Either &#x60;uuid&#x60; or &#x60;word&#x60;. By default, use the user setting when creating new random alias.
1596
+ * @param {*} [options] Override http request option.
1597
+ * @throws {RequiredError}
1598
+ */
1599
+ createRandomAlias(body, hostname, mode, options) {
1600
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).createRandomAlias(
1601
+ body,
1602
+ hostname,
1603
+ mode,
1604
+ options,
1605
+ );
1606
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1607
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1608
+ if (response.status >= 200 && response.status < 300) {
1609
+ return response.json();
1610
+ } else {
1611
+ throw response;
1612
+ }
1613
+ });
1614
+ };
1615
+ },
1616
+ /**
1617
+ * Delete specific alias by id.
1618
+ * @summary Delete alias
1619
+ * @param {number} aliasId ID of an alias
1620
+ * @param {*} [options] Override http request option.
1621
+ * @throws {RequiredError}
1622
+ */
1623
+ deleteAlias(aliasId, options) {
1624
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).deleteAlias(aliasId, options);
1625
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1626
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1627
+ if (response.status >= 200 && response.status < 300) {
1628
+ return response.json();
1629
+ } else {
1630
+ throw response;
1631
+ }
1632
+ });
1633
+ };
1634
+ },
1635
+ /**
1636
+ * Get activities for specific alias by id.
1637
+ * @summary Get activities
1638
+ * @param {number} aliasId ID of an alias
1639
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1640
+ * @param {*} [options] Override http request option.
1641
+ * @throws {RequiredError}
1642
+ */
1643
+ getActivities(aliasId, pageId, options) {
1644
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).getActivities(
1645
+ aliasId,
1646
+ pageId,
1647
+ options,
1648
+ );
1649
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1650
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1651
+ if (response.status >= 200 && response.status < 300) {
1652
+ return response.json();
1653
+ } else {
1654
+ throw response;
1655
+ }
1656
+ });
1657
+ };
1658
+ },
1659
+ /**
1660
+ * Get specific alias by id.
1661
+ * @summary Get alias
1662
+ * @param {number} aliasId ID of an alias
1663
+ * @param {*} [options] Override http request option.
1664
+ * @throws {RequiredError}
1665
+ */
1666
+ getAlias(aliasId, options) {
1667
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).getAlias(aliasId, options);
1668
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1669
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1670
+ if (response.status >= 200 && response.status < 300) {
1671
+ return response.json();
1672
+ } else {
1673
+ throw response;
1674
+ }
1675
+ });
1676
+ };
1677
+ },
1678
+ /**
1679
+ * User alias info and suggestion. Used by the first extension screen when user opens the extension.
1680
+ * @summary Get alias options
1681
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1682
+ * @param {*} [options] Override http request option.
1683
+ * @throws {RequiredError}
1684
+ */
1685
+ getAliasOptions(hostname, options) {
1686
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).getAliasOptions(
1687
+ hostname,
1688
+ options,
1689
+ );
1690
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1691
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1692
+ if (response.status >= 200 && response.status < 300) {
1693
+ return response.json();
1694
+ } else {
1695
+ throw response;
1696
+ }
1697
+ });
1698
+ };
1699
+ },
1700
+ /**
1701
+ * Get user aliases. Please note `pinned`, `disabled`, `enabled` are exclusive, i.e. only one can be present. They can only be set to `true`.
1702
+ * @summary Get aliases
1703
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1704
+ * @param {boolean} [pinned] If set, only pinned aliases are returned.
1705
+ * @param {boolean} [disabled] If set, only disabled aliases are returned.
1706
+ * @param {boolean} [enabled] If set, only enabled aliases are returned.
1707
+ * @param {*} [options] Override http request option.
1708
+ * @throws {RequiredError}
1709
+ */
1710
+ getAliases(pageId, pinned, disabled, enabled, options) {
1711
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).getAliases(
1712
+ pageId,
1713
+ pinned,
1714
+ disabled,
1715
+ enabled,
1716
+ options,
1717
+ );
1718
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1719
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1720
+ if (response.status >= 200 && response.status < 300) {
1721
+ return response.json();
1722
+ } else {
1723
+ throw response;
1724
+ }
1725
+ });
1726
+ };
1727
+ },
1728
+ /**
1729
+ * Get contacts for specific alias by id.
1730
+ * @summary Get contacts
1731
+ * @param {number} aliasId ID of an alias
1732
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1733
+ * @param {*} [options] Override http request option.
1734
+ * @throws {RequiredError}
1735
+ */
1736
+ getContacts(aliasId, pageId, options) {
1737
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).getContacts(
1738
+ aliasId,
1739
+ pageId,
1740
+ options,
1741
+ );
1742
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1743
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1744
+ if (response.status >= 200 && response.status < 300) {
1745
+ return response.json();
1746
+ } else {
1747
+ throw response;
1748
+ }
1749
+ });
1750
+ };
1751
+ },
1752
+ /**
1753
+ * Enable or disable specific alias by id.
1754
+ * @summary Toggle alias
1755
+ * @param {number} aliasId ID of an alias
1756
+ * @param {*} [options] Override http request option.
1757
+ * @throws {RequiredError}
1758
+ */
1759
+ toggleAlias(aliasId, options) {
1760
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).toggleAlias(aliasId, options);
1761
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1762
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1763
+ if (response.status >= 200 && response.status < 300) {
1764
+ return response.json();
1765
+ } else {
1766
+ throw response;
1767
+ }
1768
+ });
1769
+ };
1770
+ },
1771
+ /**
1772
+ * Update specific alias by id.
1773
+ * @summary Update alias
1774
+ * @param {AliasAliasIdPatch} body Updated settings for the given alias.
1775
+ * @param {number} aliasId ID of an alias
1776
+ * @param {*} [options] Override http request option.
1777
+ * @throws {RequiredError}
1778
+ */
1779
+ updateAlias(body, aliasId, options) {
1780
+ const localVarFetchArgs = (0, exports.AliasApiFetchParamCreator)(configuration).updateAlias(
1781
+ body,
1782
+ aliasId,
1783
+ options,
1784
+ );
1785
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
1786
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1787
+ if (response.status >= 200 && response.status < 300) {
1788
+ return response.json();
1789
+ } else {
1790
+ throw response;
1791
+ }
1792
+ });
1793
+ };
1794
+ },
1795
+ };
1796
+ };
1797
+ exports.AliasApiFp = AliasApiFp;
1798
+ /**
1799
+ * AliasApi - factory interface
1800
+ * @export
1801
+ */
1802
+ const AliasApiFactory = function (configuration, fetch, basePath) {
1803
+ return {
1804
+ /**
1805
+ * Create a new contact for an alias by id.
1806
+ * @summary Create contact
1807
+ * @param {AliasAliasIdContactsPost} body Updated settings for the given alias.
1808
+ * @param {number} aliasId ID of an alias
1809
+ * @param {*} [options] Override http request option.
1810
+ * @throws {RequiredError}
1811
+ */
1812
+ createContact(body, aliasId, options) {
1813
+ return (0, exports.AliasApiFp)(configuration).createContact(body, aliasId, options)(fetch, basePath);
1814
+ },
1815
+ /**
1816
+ * Create a new custom alias
1817
+ * @summary Create custom alias
1818
+ * @param {AliasCustomNewPost} body
1819
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1820
+ * @param {*} [options] Override http request option.
1821
+ * @throws {RequiredError}
1822
+ */
1823
+ createCustomAlias(body, hostname, options) {
1824
+ return (0, exports.AliasApiFp)(configuration).createCustomAlias(body, hostname, options)(fetch, basePath);
1825
+ },
1826
+ /**
1827
+ * Create a new random alias
1828
+ * @summary Create random alias
1829
+ * @param {AliasRandomNewPost} body
1830
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1831
+ * @param {string} [mode] Either &#x60;uuid&#x60; or &#x60;word&#x60;. By default, use the user setting when creating new random alias.
1832
+ * @param {*} [options] Override http request option.
1833
+ * @throws {RequiredError}
1834
+ */
1835
+ createRandomAlias(body, hostname, mode, options) {
1836
+ return (0, exports.AliasApiFp)(configuration).createRandomAlias(body, hostname, mode, options)(fetch, basePath);
1837
+ },
1838
+ /**
1839
+ * Delete specific alias by id.
1840
+ * @summary Delete alias
1841
+ * @param {number} aliasId ID of an alias
1842
+ * @param {*} [options] Override http request option.
1843
+ * @throws {RequiredError}
1844
+ */
1845
+ deleteAlias(aliasId, options) {
1846
+ return (0, exports.AliasApiFp)(configuration).deleteAlias(aliasId, options)(fetch, basePath);
1847
+ },
1848
+ /**
1849
+ * Get activities for specific alias by id.
1850
+ * @summary Get activities
1851
+ * @param {number} aliasId ID of an alias
1852
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1853
+ * @param {*} [options] Override http request option.
1854
+ * @throws {RequiredError}
1855
+ */
1856
+ getActivities(aliasId, pageId, options) {
1857
+ return (0, exports.AliasApiFp)(configuration).getActivities(aliasId, pageId, options)(fetch, basePath);
1858
+ },
1859
+ /**
1860
+ * Get specific alias by id.
1861
+ * @summary Get alias
1862
+ * @param {number} aliasId ID of an alias
1863
+ * @param {*} [options] Override http request option.
1864
+ * @throws {RequiredError}
1865
+ */
1866
+ getAlias(aliasId, options) {
1867
+ return (0, exports.AliasApiFp)(configuration).getAlias(aliasId, options)(fetch, basePath);
1868
+ },
1869
+ /**
1870
+ * User alias info and suggestion. Used by the first extension screen when user opens the extension.
1871
+ * @summary Get alias options
1872
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1873
+ * @param {*} [options] Override http request option.
1874
+ * @throws {RequiredError}
1875
+ */
1876
+ getAliasOptions(hostname, options) {
1877
+ return (0, exports.AliasApiFp)(configuration).getAliasOptions(hostname, options)(fetch, basePath);
1878
+ },
1879
+ /**
1880
+ * Get user aliases. Please note `pinned`, `disabled`, `enabled` are exclusive, i.e. only one can be present. They can only be set to `true`.
1881
+ * @summary Get aliases
1882
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1883
+ * @param {boolean} [pinned] If set, only pinned aliases are returned.
1884
+ * @param {boolean} [disabled] If set, only disabled aliases are returned.
1885
+ * @param {boolean} [enabled] If set, only enabled aliases are returned.
1886
+ * @param {*} [options] Override http request option.
1887
+ * @throws {RequiredError}
1888
+ */
1889
+ getAliases(pageId, pinned, disabled, enabled, options) {
1890
+ return (0, exports.AliasApiFp)(configuration).getAliases(
1891
+ pageId,
1892
+ pinned,
1893
+ disabled,
1894
+ enabled,
1895
+ options,
1896
+ )(fetch, basePath);
1897
+ },
1898
+ /**
1899
+ * Get contacts for specific alias by id.
1900
+ * @summary Get contacts
1901
+ * @param {number} aliasId ID of an alias
1902
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
1903
+ * @param {*} [options] Override http request option.
1904
+ * @throws {RequiredError}
1905
+ */
1906
+ getContacts(aliasId, pageId, options) {
1907
+ return (0, exports.AliasApiFp)(configuration).getContacts(aliasId, pageId, options)(fetch, basePath);
1908
+ },
1909
+ /**
1910
+ * Enable or disable specific alias by id.
1911
+ * @summary Toggle alias
1912
+ * @param {number} aliasId ID of an alias
1913
+ * @param {*} [options] Override http request option.
1914
+ * @throws {RequiredError}
1915
+ */
1916
+ toggleAlias(aliasId, options) {
1917
+ return (0, exports.AliasApiFp)(configuration).toggleAlias(aliasId, options)(fetch, basePath);
1918
+ },
1919
+ /**
1920
+ * Update specific alias by id.
1921
+ * @summary Update alias
1922
+ * @param {AliasAliasIdPatch} body Updated settings for the given alias.
1923
+ * @param {number} aliasId ID of an alias
1924
+ * @param {*} [options] Override http request option.
1925
+ * @throws {RequiredError}
1926
+ */
1927
+ updateAlias(body, aliasId, options) {
1928
+ return (0, exports.AliasApiFp)(configuration).updateAlias(body, aliasId, options)(fetch, basePath);
1929
+ },
1930
+ };
1931
+ };
1932
+ exports.AliasApiFactory = AliasApiFactory;
1933
+ /**
1934
+ * AliasApi - object-oriented interface
1935
+ * @export
1936
+ * @class AliasApi
1937
+ * @extends {BaseAPI}
1938
+ */
1939
+ class AliasApi extends BaseAPI {
1940
+ /**
1941
+ * Create a new contact for an alias by id.
1942
+ * @summary Create contact
1943
+ * @param {AliasAliasIdContactsPost} body Updated settings for the given alias.
1944
+ * @param {number} aliasId ID of an alias
1945
+ * @param {*} [options] Override http request option.
1946
+ * @throws {RequiredError}
1947
+ * @memberof AliasApi
1948
+ */
1949
+ createContact(body, aliasId, options) {
1950
+ return (0, exports.AliasApiFp)(this.configuration).createContact(body, aliasId, options)(this.fetch, this.basePath);
1951
+ }
1952
+ /**
1953
+ * Create a new custom alias
1954
+ * @summary Create custom alias
1955
+ * @param {AliasCustomNewPost} body
1956
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1957
+ * @param {*} [options] Override http request option.
1958
+ * @throws {RequiredError}
1959
+ * @memberof AliasApi
1960
+ */
1961
+ createCustomAlias(body, hostname, options) {
1962
+ return (0, exports.AliasApiFp)(this.configuration).createCustomAlias(
1963
+ body,
1964
+ hostname,
1965
+ options,
1966
+ )(this.fetch, this.basePath);
1967
+ }
1968
+ /**
1969
+ * Create a new random alias
1970
+ * @summary Create random alias
1971
+ * @param {AliasRandomNewPost} body
1972
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
1973
+ * @param {string} [mode] Either &#x60;uuid&#x60; or &#x60;word&#x60;. By default, use the user setting when creating new random alias.
1974
+ * @param {*} [options] Override http request option.
1975
+ * @throws {RequiredError}
1976
+ * @memberof AliasApi
1977
+ */
1978
+ createRandomAlias(body, hostname, mode, options) {
1979
+ return (0, exports.AliasApiFp)(this.configuration).createRandomAlias(
1980
+ body,
1981
+ hostname,
1982
+ mode,
1983
+ options,
1984
+ )(this.fetch, this.basePath);
1985
+ }
1986
+ /**
1987
+ * Delete specific alias by id.
1988
+ * @summary Delete alias
1989
+ * @param {number} aliasId ID of an alias
1990
+ * @param {*} [options] Override http request option.
1991
+ * @throws {RequiredError}
1992
+ * @memberof AliasApi
1993
+ */
1994
+ deleteAlias(aliasId, options) {
1995
+ return (0, exports.AliasApiFp)(this.configuration).deleteAlias(aliasId, options)(this.fetch, this.basePath);
1996
+ }
1997
+ /**
1998
+ * Get activities for specific alias by id.
1999
+ * @summary Get activities
2000
+ * @param {number} aliasId ID of an alias
2001
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
2002
+ * @param {*} [options] Override http request option.
2003
+ * @throws {RequiredError}
2004
+ * @memberof AliasApi
2005
+ */
2006
+ getActivities(aliasId, pageId, options) {
2007
+ return (0, exports.AliasApiFp)(this.configuration).getActivities(
2008
+ aliasId,
2009
+ pageId,
2010
+ options,
2011
+ )(this.fetch, this.basePath);
2012
+ }
2013
+ /**
2014
+ * Get specific alias by id.
2015
+ * @summary Get alias
2016
+ * @param {number} aliasId ID of an alias
2017
+ * @param {*} [options] Override http request option.
2018
+ * @throws {RequiredError}
2019
+ * @memberof AliasApi
2020
+ */
2021
+ getAlias(aliasId, options) {
2022
+ return (0, exports.AliasApiFp)(this.configuration).getAlias(aliasId, options)(this.fetch, this.basePath);
2023
+ }
2024
+ /**
2025
+ * User alias info and suggestion. Used by the first extension screen when user opens the extension.
2026
+ * @summary Get alias options
2027
+ * @param {string} [hostname] This information is important to know where an alias is used in order to suggest user the same alias if they want to create on alias on the same website in the future.
2028
+ * @param {*} [options] Override http request option.
2029
+ * @throws {RequiredError}
2030
+ * @memberof AliasApi
2031
+ */
2032
+ getAliasOptions(hostname, options) {
2033
+ return (0, exports.AliasApiFp)(this.configuration).getAliasOptions(hostname, options)(this.fetch, this.basePath);
2034
+ }
2035
+ /**
2036
+ * Get user aliases. Please note `pinned`, `disabled`, `enabled` are exclusive, i.e. only one can be present. They can only be set to `true`.
2037
+ * @summary Get aliases
2038
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
2039
+ * @param {boolean} [pinned] If set, only pinned aliases are returned.
2040
+ * @param {boolean} [disabled] If set, only disabled aliases are returned.
2041
+ * @param {boolean} [enabled] If set, only enabled aliases are returned.
2042
+ * @param {*} [options] Override http request option.
2043
+ * @throws {RequiredError}
2044
+ * @memberof AliasApi
2045
+ */
2046
+ getAliases(pageId, pinned, disabled, enabled, options) {
2047
+ return (0, exports.AliasApiFp)(this.configuration).getAliases(
2048
+ pageId,
2049
+ pinned,
2050
+ disabled,
2051
+ enabled,
2052
+ options,
2053
+ )(this.fetch, this.basePath);
2054
+ }
2055
+ /**
2056
+ * Get contacts for specific alias by id.
2057
+ * @summary Get contacts
2058
+ * @param {number} aliasId ID of an alias
2059
+ * @param {number} pageId The endpoint returns maximum 20 aliases for each page.
2060
+ * @param {*} [options] Override http request option.
2061
+ * @throws {RequiredError}
2062
+ * @memberof AliasApi
2063
+ */
2064
+ getContacts(aliasId, pageId, options) {
2065
+ return (0, exports.AliasApiFp)(this.configuration).getContacts(aliasId, pageId, options)(this.fetch, this.basePath);
2066
+ }
2067
+ /**
2068
+ * Enable or disable specific alias by id.
2069
+ * @summary Toggle alias
2070
+ * @param {number} aliasId ID of an alias
2071
+ * @param {*} [options] Override http request option.
2072
+ * @throws {RequiredError}
2073
+ * @memberof AliasApi
2074
+ */
2075
+ toggleAlias(aliasId, options) {
2076
+ return (0, exports.AliasApiFp)(this.configuration).toggleAlias(aliasId, options)(this.fetch, this.basePath);
2077
+ }
2078
+ /**
2079
+ * Update specific alias by id.
2080
+ * @summary Update alias
2081
+ * @param {AliasAliasIdPatch} body Updated settings for the given alias.
2082
+ * @param {number} aliasId ID of an alias
2083
+ * @param {*} [options] Override http request option.
2084
+ * @throws {RequiredError}
2085
+ * @memberof AliasApi
2086
+ */
2087
+ updateAlias(body, aliasId, options) {
2088
+ return (0, exports.AliasApiFp)(this.configuration).updateAlias(body, aliasId, options)(this.fetch, this.basePath);
2089
+ }
2090
+ }
2091
+ exports.AliasApi = AliasApi;
2092
+ /**
2093
+ * CustomDomainApi - fetch parameter creator
2094
+ * @export
2095
+ */
2096
+ const CustomDomainApiFetchParamCreator = function (configuration) {
2097
+ return {
2098
+ /**
2099
+ * Get users custom domains.
2100
+ * @summary Get custom domains
2101
+ * @param {number} aliasId ID of an alias
2102
+ * @param {*} [options] Override http request option.
2103
+ * @throws {RequiredError}
2104
+ */
2105
+ getCustomDomains(aliasId, options = {}) {
2106
+ // verify required parameter 'aliasId' is not null or undefined
2107
+ if (aliasId === null || aliasId === undefined) {
2108
+ throw new RequiredError(
2109
+ 'aliasId',
2110
+ 'Required parameter aliasId was null or undefined when calling getCustomDomains.',
2111
+ );
2112
+ }
2113
+ const localVarPath = `/custom_domains`.replace(`{${'alias_id'}}`, encodeURIComponent(String(aliasId)));
2114
+ const localVarUrlObj = url.parse(localVarPath, true);
2115
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2116
+ const localVarHeaderParameter = {};
2117
+ const localVarQueryParameter = {};
2118
+ // authentication apiKeyAuth required
2119
+ if (configuration && configuration.apiKey) {
2120
+ const localVarApiKeyValue =
2121
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
2122
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
2123
+ }
2124
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
2125
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
2126
+ delete localVarUrlObj.search;
2127
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2128
+ return {
2129
+ url: url.format(localVarUrlObj),
2130
+ options: localVarRequestOptions,
2131
+ };
2132
+ },
2133
+ };
2134
+ };
2135
+ exports.CustomDomainApiFetchParamCreator = CustomDomainApiFetchParamCreator;
2136
+ /**
2137
+ * CustomDomainApi - functional programming interface
2138
+ * @export
2139
+ */
2140
+ const CustomDomainApiFp = function (configuration) {
2141
+ return {
2142
+ /**
2143
+ * Get users custom domains.
2144
+ * @summary Get custom domains
2145
+ * @param {number} aliasId ID of an alias
2146
+ * @param {*} [options] Override http request option.
2147
+ * @throws {RequiredError}
2148
+ */
2149
+ getCustomDomains(aliasId, options) {
2150
+ const localVarFetchArgs = (0, exports.CustomDomainApiFetchParamCreator)(configuration).getCustomDomains(
2151
+ aliasId,
2152
+ options,
2153
+ );
2154
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
2155
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
2156
+ if (response.status >= 200 && response.status < 300) {
2157
+ return response.json();
2158
+ } else {
2159
+ throw response;
2160
+ }
2161
+ });
2162
+ };
2163
+ },
2164
+ };
2165
+ };
2166
+ exports.CustomDomainApiFp = CustomDomainApiFp;
2167
+ /**
2168
+ * CustomDomainApi - factory interface
2169
+ * @export
2170
+ */
2171
+ const CustomDomainApiFactory = function (configuration, fetch, basePath) {
2172
+ return {
2173
+ /**
2174
+ * Get users custom domains.
2175
+ * @summary Get custom domains
2176
+ * @param {number} aliasId ID of an alias
2177
+ * @param {*} [options] Override http request option.
2178
+ * @throws {RequiredError}
2179
+ */
2180
+ getCustomDomains(aliasId, options) {
2181
+ return (0, exports.CustomDomainApiFp)(configuration).getCustomDomains(aliasId, options)(fetch, basePath);
2182
+ },
2183
+ };
2184
+ };
2185
+ exports.CustomDomainApiFactory = CustomDomainApiFactory;
2186
+ /**
2187
+ * CustomDomainApi - object-oriented interface
2188
+ * @export
2189
+ * @class CustomDomainApi
2190
+ * @extends {BaseAPI}
2191
+ */
2192
+ class CustomDomainApi extends BaseAPI {
2193
+ /**
2194
+ * Get users custom domains.
2195
+ * @summary Get custom domains
2196
+ * @param {number} aliasId ID of an alias
2197
+ * @param {*} [options] Override http request option.
2198
+ * @throws {RequiredError}
2199
+ * @memberof CustomDomainApi
2200
+ */
2201
+ getCustomDomains(aliasId, options) {
2202
+ return (0, exports.CustomDomainApiFp)(this.configuration).getCustomDomains(aliasId, options)(
2203
+ this.fetch,
2204
+ this.basePath,
2205
+ );
2206
+ }
2207
+ }
2208
+ exports.CustomDomainApi = CustomDomainApi;
2209
+ /**
2210
+ * MailboxApi - fetch parameter creator
2211
+ * @export
2212
+ */
2213
+ const MailboxApiFetchParamCreator = function (configuration) {
2214
+ return {
2215
+ /**
2216
+ * Create a new mailbox
2217
+ * @summary Create mailbox
2218
+ * @param {MailboxPost} body The new mailbox address
2219
+ * @param {*} [options] Override http request option.
2220
+ * @throws {RequiredError}
2221
+ */
2222
+ createMailbox(body, options = {}) {
2223
+ // verify required parameter 'body' is not null or undefined
2224
+ if (body === null || body === undefined) {
2225
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling createMailbox.');
2226
+ }
2227
+ const localVarPath = `/mailboxes`;
2228
+ const localVarUrlObj = url.parse(localVarPath, true);
2229
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
2230
+ const localVarHeaderParameter = {};
2231
+ const localVarQueryParameter = {};
2232
+ // authentication apiKeyAuth required
2233
+ if (configuration && configuration.apiKey) {
2234
+ const localVarApiKeyValue =
2235
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
2236
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
2237
+ }
2238
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2239
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
2240
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
2241
+ delete localVarUrlObj.search;
2242
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2243
+ const needsSerialization =
2244
+ 'MailboxPost' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
2245
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
2246
+ return {
2247
+ url: url.format(localVarUrlObj),
2248
+ options: localVarRequestOptions,
2249
+ };
2250
+ },
2251
+ /**
2252
+ * Delete specific mailbox by id.
2253
+ * @summary Delete mailbox
2254
+ * @param {number} mailboxId ID of a mailbox
2255
+ * @param {*} [options] Override http request option.
2256
+ * @throws {RequiredError}
2257
+ */
2258
+ deleteMailbox(mailboxId, options = {}) {
2259
+ // verify required parameter 'mailboxId' is not null or undefined
2260
+ if (mailboxId === null || mailboxId === undefined) {
2261
+ throw new RequiredError(
2262
+ 'mailboxId',
2263
+ 'Required parameter mailboxId was null or undefined when calling deleteMailbox.',
2264
+ );
2265
+ }
2266
+ const localVarPath = `/mailboxes/{mailbox_id}`.replace(
2267
+ `{${'mailbox_id'}}`,
2268
+ encodeURIComponent(String(mailboxId)),
2269
+ );
2270
+ const localVarUrlObj = url.parse(localVarPath, true);
2271
+ const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options);
2272
+ const localVarHeaderParameter = {};
2273
+ const localVarQueryParameter = {};
2274
+ // authentication apiKeyAuth required
2275
+ if (configuration && configuration.apiKey) {
2276
+ const localVarApiKeyValue =
2277
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
2278
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
2279
+ }
2280
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
2281
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
2282
+ delete localVarUrlObj.search;
2283
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2284
+ return {
2285
+ url: url.format(localVarUrlObj),
2286
+ options: localVarRequestOptions,
2287
+ };
2288
+ },
2289
+ /**
2290
+ * Get user mailboxes.
2291
+ * @summary Get mailboxes
2292
+ * @param {*} [options] Override http request option.
2293
+ * @throws {RequiredError}
2294
+ */
2295
+ getMailboxes(options = {}) {
2296
+ const localVarPath = `/v2/mailboxes`;
2297
+ const localVarUrlObj = url.parse(localVarPath, true);
2298
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
2299
+ const localVarHeaderParameter = {};
2300
+ const localVarQueryParameter = {};
2301
+ // authentication apiKeyAuth required
2302
+ if (configuration && configuration.apiKey) {
2303
+ const localVarApiKeyValue =
2304
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
2305
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
2306
+ }
2307
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
2308
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
2309
+ delete localVarUrlObj.search;
2310
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2311
+ return {
2312
+ url: url.format(localVarUrlObj),
2313
+ options: localVarRequestOptions,
2314
+ };
2315
+ },
2316
+ /**
2317
+ * Update specific mailbox by id.
2318
+ * @summary Update mailbox
2319
+ * @param {MailboxMailboxIdPut} body Updated settings of mailbox
2320
+ * @param {number} mailboxId ID of a mailbox
2321
+ * @param {*} [options] Override http request option.
2322
+ * @throws {RequiredError}
2323
+ */
2324
+ updateMailbox(body, mailboxId, options = {}) {
2325
+ // verify required parameter 'body' is not null or undefined
2326
+ if (body === null || body === undefined) {
2327
+ throw new RequiredError('body', 'Required parameter body was null or undefined when calling updateMailbox.');
2328
+ }
2329
+ // verify required parameter 'mailboxId' is not null or undefined
2330
+ if (mailboxId === null || mailboxId === undefined) {
2331
+ throw new RequiredError(
2332
+ 'mailboxId',
2333
+ 'Required parameter mailboxId was null or undefined when calling updateMailbox.',
2334
+ );
2335
+ }
2336
+ const localVarPath = `/mailboxes/{mailbox_id}`.replace(
2337
+ `{${'mailbox_id'}}`,
2338
+ encodeURIComponent(String(mailboxId)),
2339
+ );
2340
+ const localVarUrlObj = url.parse(localVarPath, true);
2341
+ const localVarRequestOptions = Object.assign({ method: 'PUT' }, options);
2342
+ const localVarHeaderParameter = {};
2343
+ const localVarQueryParameter = {};
2344
+ // authentication apiKeyAuth required
2345
+ if (configuration && configuration.apiKey) {
2346
+ const localVarApiKeyValue =
2347
+ typeof configuration.apiKey === 'function' ? configuration.apiKey('Authentication') : configuration.apiKey;
2348
+ localVarHeaderParameter['Authentication'] = localVarApiKeyValue;
2349
+ }
2350
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2351
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
2352
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
2353
+ delete localVarUrlObj.search;
2354
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
2355
+ const needsSerialization =
2356
+ 'MailboxMailboxIdPut' !== 'string' || localVarRequestOptions.headers['Content-Type'] === 'application/json';
2357
+ localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : body || '';
2358
+ return {
2359
+ url: url.format(localVarUrlObj),
2360
+ options: localVarRequestOptions,
2361
+ };
2362
+ },
2363
+ };
2364
+ };
2365
+ exports.MailboxApiFetchParamCreator = MailboxApiFetchParamCreator;
2366
+ /**
2367
+ * MailboxApi - functional programming interface
2368
+ * @export
2369
+ */
2370
+ const MailboxApiFp = function (configuration) {
2371
+ return {
2372
+ /**
2373
+ * Create a new mailbox
2374
+ * @summary Create mailbox
2375
+ * @param {MailboxPost} body The new mailbox address
2376
+ * @param {*} [options] Override http request option.
2377
+ * @throws {RequiredError}
2378
+ */
2379
+ createMailbox(body, options) {
2380
+ const localVarFetchArgs = (0, exports.MailboxApiFetchParamCreator)(configuration).createMailbox(body, options);
2381
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
2382
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
2383
+ if (response.status >= 200 && response.status < 300) {
2384
+ return response.json();
2385
+ } else {
2386
+ throw response;
2387
+ }
2388
+ });
2389
+ };
2390
+ },
2391
+ /**
2392
+ * Delete specific mailbox by id.
2393
+ * @summary Delete mailbox
2394
+ * @param {number} mailboxId ID of a mailbox
2395
+ * @param {*} [options] Override http request option.
2396
+ * @throws {RequiredError}
2397
+ */
2398
+ deleteMailbox(mailboxId, options) {
2399
+ const localVarFetchArgs = (0, exports.MailboxApiFetchParamCreator)(configuration).deleteMailbox(
2400
+ mailboxId,
2401
+ options,
2402
+ );
2403
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
2404
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
2405
+ if (response.status >= 200 && response.status < 300) {
2406
+ return response;
2407
+ } else {
2408
+ throw response;
2409
+ }
2410
+ });
2411
+ };
2412
+ },
2413
+ /**
2414
+ * Get user mailboxes.
2415
+ * @summary Get mailboxes
2416
+ * @param {*} [options] Override http request option.
2417
+ * @throws {RequiredError}
2418
+ */
2419
+ getMailboxes(options) {
2420
+ const localVarFetchArgs = (0, exports.MailboxApiFetchParamCreator)(configuration).getMailboxes(options);
2421
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
2422
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
2423
+ if (response.status >= 200 && response.status < 300) {
2424
+ return response.json();
2425
+ } else {
2426
+ throw response;
2427
+ }
2428
+ });
2429
+ };
2430
+ },
2431
+ /**
2432
+ * Update specific mailbox by id.
2433
+ * @summary Update mailbox
2434
+ * @param {MailboxMailboxIdPut} body Updated settings of mailbox
2435
+ * @param {number} mailboxId ID of a mailbox
2436
+ * @param {*} [options] Override http request option.
2437
+ * @throws {RequiredError}
2438
+ */
2439
+ updateMailbox(body, mailboxId, options) {
2440
+ const localVarFetchArgs = (0, exports.MailboxApiFetchParamCreator)(configuration).updateMailbox(
2441
+ body,
2442
+ mailboxId,
2443
+ options,
2444
+ );
2445
+ return (fetch = defaultFetchApi, basePath = exports.BASE_PATH) => {
2446
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
2447
+ if (response.status >= 200 && response.status < 300) {
2448
+ return response;
2449
+ } else {
2450
+ throw response;
2451
+ }
2452
+ });
2453
+ };
2454
+ },
2455
+ };
2456
+ };
2457
+ exports.MailboxApiFp = MailboxApiFp;
2458
+ /**
2459
+ * MailboxApi - factory interface
2460
+ * @export
2461
+ */
2462
+ const MailboxApiFactory = function (configuration, fetch, basePath) {
2463
+ return {
2464
+ /**
2465
+ * Create a new mailbox
2466
+ * @summary Create mailbox
2467
+ * @param {MailboxPost} body The new mailbox address
2468
+ * @param {*} [options] Override http request option.
2469
+ * @throws {RequiredError}
2470
+ */
2471
+ createMailbox(body, options) {
2472
+ return (0, exports.MailboxApiFp)(configuration).createMailbox(body, options)(fetch, basePath);
2473
+ },
2474
+ /**
2475
+ * Delete specific mailbox by id.
2476
+ * @summary Delete mailbox
2477
+ * @param {number} mailboxId ID of a mailbox
2478
+ * @param {*} [options] Override http request option.
2479
+ * @throws {RequiredError}
2480
+ */
2481
+ deleteMailbox(mailboxId, options) {
2482
+ return (0, exports.MailboxApiFp)(configuration).deleteMailbox(mailboxId, options)(fetch, basePath);
2483
+ },
2484
+ /**
2485
+ * Get user mailboxes.
2486
+ * @summary Get mailboxes
2487
+ * @param {*} [options] Override http request option.
2488
+ * @throws {RequiredError}
2489
+ */
2490
+ getMailboxes(options) {
2491
+ return (0, exports.MailboxApiFp)(configuration).getMailboxes(options)(fetch, basePath);
2492
+ },
2493
+ /**
2494
+ * Update specific mailbox by id.
2495
+ * @summary Update mailbox
2496
+ * @param {MailboxMailboxIdPut} body Updated settings of mailbox
2497
+ * @param {number} mailboxId ID of a mailbox
2498
+ * @param {*} [options] Override http request option.
2499
+ * @throws {RequiredError}
2500
+ */
2501
+ updateMailbox(body, mailboxId, options) {
2502
+ return (0, exports.MailboxApiFp)(configuration).updateMailbox(body, mailboxId, options)(fetch, basePath);
2503
+ },
2504
+ };
2505
+ };
2506
+ exports.MailboxApiFactory = MailboxApiFactory;
2507
+ /**
2508
+ * MailboxApi - object-oriented interface
2509
+ * @export
2510
+ * @class MailboxApi
2511
+ * @extends {BaseAPI}
2512
+ */
2513
+ class MailboxApi extends BaseAPI {
2514
+ /**
2515
+ * Create a new mailbox
2516
+ * @summary Create mailbox
2517
+ * @param {MailboxPost} body The new mailbox address
2518
+ * @param {*} [options] Override http request option.
2519
+ * @throws {RequiredError}
2520
+ * @memberof MailboxApi
2521
+ */
2522
+ createMailbox(body, options) {
2523
+ return (0, exports.MailboxApiFp)(this.configuration).createMailbox(body, options)(this.fetch, this.basePath);
2524
+ }
2525
+ /**
2526
+ * Delete specific mailbox by id.
2527
+ * @summary Delete mailbox
2528
+ * @param {number} mailboxId ID of a mailbox
2529
+ * @param {*} [options] Override http request option.
2530
+ * @throws {RequiredError}
2531
+ * @memberof MailboxApi
2532
+ */
2533
+ deleteMailbox(mailboxId, options) {
2534
+ return (0, exports.MailboxApiFp)(this.configuration).deleteMailbox(mailboxId, options)(this.fetch, this.basePath);
2535
+ }
2536
+ /**
2537
+ * Get user mailboxes.
2538
+ * @summary Get mailboxes
2539
+ * @param {*} [options] Override http request option.
2540
+ * @throws {RequiredError}
2541
+ * @memberof MailboxApi
2542
+ */
2543
+ getMailboxes(options) {
2544
+ return (0, exports.MailboxApiFp)(this.configuration).getMailboxes(options)(this.fetch, this.basePath);
2545
+ }
2546
+ /**
2547
+ * Update specific mailbox by id.
2548
+ * @summary Update mailbox
2549
+ * @param {MailboxMailboxIdPut} body Updated settings of mailbox
2550
+ * @param {number} mailboxId ID of a mailbox
2551
+ * @param {*} [options] Override http request option.
2552
+ * @throws {RequiredError}
2553
+ * @memberof MailboxApi
2554
+ */
2555
+ updateMailbox(body, mailboxId, options) {
2556
+ return (0, exports.MailboxApiFp)(this.configuration).updateMailbox(
2557
+ body,
2558
+ mailboxId,
2559
+ options,
2560
+ )(this.fetch, this.basePath);
2561
+ }
2562
+ }
2563
+ exports.MailboxApi = MailboxApi;
2564
+ //# sourceMappingURL=api.js.map