@emilgroup/account-sdk 1.0.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.openapi-generator/FILES +1 -1
  2. package/README.md +11 -11
  3. package/api/accounts-api.ts +54 -44
  4. package/api.ts +0 -9
  5. package/base.ts +124 -65
  6. package/common.ts +61 -2
  7. package/configuration.ts +0 -8
  8. package/dist/api/accounts-api.d.ts +54 -45
  9. package/dist/api/accounts-api.js +76 -80
  10. package/dist/api.d.ts +0 -4
  11. package/dist/api.js +4 -21
  12. package/dist/base.d.ts +10 -6
  13. package/dist/base.js +105 -66
  14. package/dist/common.d.ts +26 -1
  15. package/dist/common.js +43 -22
  16. package/dist/configuration.d.ts +0 -7
  17. package/dist/configuration.js +0 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +8 -19
  20. package/dist/models/account-class.d.ts +31 -5
  21. package/dist/models/account-class.js +6 -0
  22. package/dist/models/create-account-request-dto.d.ts +40 -10
  23. package/dist/models/create-account-request-dto.js +10 -1
  24. package/dist/models/index.d.ts +1 -1
  25. package/dist/models/index.js +6 -24
  26. package/dist/models/policy-class.d.ts +30 -0
  27. package/dist/models/update-account-request-dto.d.ts +41 -17
  28. package/dist/models/update-account-request-dto.js +10 -1
  29. package/index.ts +1 -1
  30. package/models/account-class.ts +34 -5
  31. package/models/create-account-request-dto.ts +42 -10
  32. package/models/index.ts +1 -1
  33. package/models/policy-class.ts +36 -0
  34. package/models/update-account-request-dto.ts +43 -17
  35. package/package.json +3 -5
  36. package/dist/models/get-account-request-dto.d.ts +0 -30
  37. package/models/get-account-request-dto.ts +0 -36
  38. /package/dist/models/{get-account-request-dto.js → policy-class.js} +0 -0
@@ -16,12 +16,10 @@ var __extends = (this && this.__extends) || (function () {
16
16
  var extendStatics = function (d, b) {
17
17
  extendStatics = Object.setPrototypeOf ||
18
18
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
19
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
20
20
  return extendStatics(d, b);
21
21
  };
22
22
  return function (d, b) {
23
- if (typeof b !== "function" && b !== null)
24
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
23
  extendStatics(d, b);
26
24
  function __() { this.constructor = d; }
27
25
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -78,22 +76,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
78
76
  return (mod && mod.__esModule) ? mod : { "default": mod };
79
77
  };
80
78
  Object.defineProperty(exports, "__esModule", { value: true });
81
- exports.AccountsApi = exports.AccountsApiFactory = exports.AccountsApiFp = exports.AccountsApiAxiosParamCreator = void 0;
82
79
  var axios_1 = __importDefault(require("axios"));
83
80
  // Some imports not used depending on template conditions
84
81
  // @ts-ignore
85
82
  var common_1 = require("../common");
86
83
  // @ts-ignore
87
84
  var base_1 = require("../base");
88
- // URLSearchParams not necessarily used
89
- // @ts-ignore
90
- var url_1 = require("url");
91
- var FormData = require('form-data');
92
85
  /**
93
86
  * AccountsApi - axios parameter creator
94
87
  * @export
95
88
  */
96
- var AccountsApiAxiosParamCreator = function (configuration) {
89
+ exports.AccountsApiAxiosParamCreator = function (configuration) {
97
90
  var _this = this;
98
91
  return {
99
92
  /**
@@ -112,9 +105,9 @@ var AccountsApiAxiosParamCreator = function (configuration) {
112
105
  switch (_a.label) {
113
106
  case 0:
114
107
  // verify required parameter 'createAccountRequestDto' is not null or undefined
115
- (0, common_1.assertParamExists)('createAccount', 'createAccountRequestDto', createAccountRequestDto);
108
+ common_1.assertParamExists('createAccount', 'createAccountRequestDto', createAccountRequestDto);
116
109
  localVarPath = "/accountservice/v1/accounts";
117
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
110
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
118
111
  if (configuration) {
119
112
  baseOptions = configuration.baseOptions;
120
113
  baseAccessToken = configuration.accessToken;
@@ -124,7 +117,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
124
117
  localVarQueryParameter = {};
125
118
  // authentication bearer required
126
119
  // http bearer authentication required
127
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
120
+ return [4 /*yield*/, common_1.setBearerAuthToObject(localVarHeaderParameter, configuration)];
128
121
  case 1:
129
122
  // authentication bearer required
130
123
  // http bearer authentication required
@@ -133,12 +126,12 @@ var AccountsApiAxiosParamCreator = function (configuration) {
133
126
  localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
134
127
  }
135
128
  localVarHeaderParameter['Content-Type'] = 'application/json';
136
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
129
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
137
130
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
138
131
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
139
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createAccountRequestDto, localVarRequestOptions, configuration);
132
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(createAccountRequestDto, localVarRequestOptions, configuration);
140
133
  return [2 /*return*/, {
141
- url: (0, common_1.toPathString)(localVarUrlObj),
134
+ url: common_1.toPathString(localVarUrlObj),
142
135
  options: localVarRequestOptions,
143
136
  }];
144
137
  }
@@ -161,10 +154,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
161
154
  switch (_a.label) {
162
155
  case 0:
163
156
  // verify required parameter 'code' is not null or undefined
164
- (0, common_1.assertParamExists)('deleteAccount', 'code', code);
157
+ common_1.assertParamExists('deleteAccount', 'code', code);
165
158
  localVarPath = "/accountservice/v1/accounts/{code}"
166
- .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
167
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
159
+ .replace("{" + "code" + "}", encodeURIComponent(String(code)));
160
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
168
161
  if (configuration) {
169
162
  baseOptions = configuration.baseOptions;
170
163
  baseAccessToken = configuration.accessToken;
@@ -174,7 +167,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
174
167
  localVarQueryParameter = {};
175
168
  // authentication bearer required
176
169
  // http bearer authentication required
177
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
170
+ return [4 /*yield*/, common_1.setBearerAuthToObject(localVarHeaderParameter, configuration)];
178
171
  case 1:
179
172
  // authentication bearer required
180
173
  // http bearer authentication required
@@ -182,11 +175,11 @@ var AccountsApiAxiosParamCreator = function (configuration) {
182
175
  if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
183
176
  localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
184
177
  }
185
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
178
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
186
179
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
187
180
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
188
181
  return [2 /*return*/, {
189
- url: (0, common_1.toPathString)(localVarUrlObj),
182
+ url: common_1.toPathString(localVarUrlObj),
190
183
  options: localVarRequestOptions,
191
184
  }];
192
185
  }
@@ -210,10 +203,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
210
203
  switch (_a.label) {
211
204
  case 0:
212
205
  // verify required parameter 'code' is not null or undefined
213
- (0, common_1.assertParamExists)('getAccount', 'code', code);
206
+ common_1.assertParamExists('getAccount', 'code', code);
214
207
  localVarPath = "/accountservice/v1/accounts/{code}"
215
- .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
216
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
208
+ .replace("{" + "code" + "}", encodeURIComponent(String(code)));
209
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
217
210
  if (configuration) {
218
211
  baseOptions = configuration.baseOptions;
219
212
  baseAccessToken = configuration.accessToken;
@@ -223,7 +216,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
223
216
  localVarQueryParameter = {};
224
217
  // authentication bearer required
225
218
  // http bearer authentication required
226
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
219
+ return [4 /*yield*/, common_1.setBearerAuthToObject(localVarHeaderParameter, configuration)];
227
220
  case 1:
228
221
  // authentication bearer required
229
222
  // http bearer authentication required
@@ -234,11 +227,11 @@ var AccountsApiAxiosParamCreator = function (configuration) {
234
227
  if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
235
228
  localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
236
229
  }
237
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
230
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
238
231
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
239
232
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
240
233
  return [2 /*return*/, {
241
- url: (0, common_1.toPathString)(localVarUrlObj),
234
+ url: common_1.toPathString(localVarUrlObj),
242
235
  options: localVarRequestOptions,
243
236
  }];
244
237
  }
@@ -246,18 +239,19 @@ var AccountsApiAxiosParamCreator = function (configuration) {
246
239
  });
247
240
  },
248
241
  /**
249
- * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
242
+ * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
250
243
  * @summary List accounts
251
244
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
252
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
253
- * @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
254
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
255
- * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
256
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
245
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
246
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
247
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
248
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code=xxx in order to fetch the result.
249
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
250
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
257
251
  * @param {*} [options] Override http request option.
258
252
  * @throws {RequiredError}
259
253
  */
260
- listAccounts: function (authorization, pageSize, pageToken, filter, order, expand, options) {
254
+ listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
261
255
  if (options === void 0) { options = {}; }
262
256
  return __awaiter(_this, void 0, void 0, function () {
263
257
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
@@ -265,7 +259,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
265
259
  switch (_a.label) {
266
260
  case 0:
267
261
  localVarPath = "/accountservice/v1/accounts";
268
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
262
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
269
263
  if (configuration) {
270
264
  baseOptions = configuration.baseOptions;
271
265
  baseAccessToken = configuration.accessToken;
@@ -275,7 +269,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
275
269
  localVarQueryParameter = {};
276
270
  // authentication bearer required
277
271
  // http bearer authentication required
278
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
272
+ return [4 /*yield*/, common_1.setBearerAuthToObject(localVarHeaderParameter, configuration)];
279
273
  case 1:
280
274
  // authentication bearer required
281
275
  // http bearer authentication required
@@ -289,6 +283,9 @@ var AccountsApiAxiosParamCreator = function (configuration) {
289
283
  if (filter !== undefined) {
290
284
  localVarQueryParameter['filter'] = filter;
291
285
  }
286
+ if (search !== undefined) {
287
+ localVarQueryParameter['search'] = search;
288
+ }
292
289
  if (order !== undefined) {
293
290
  localVarQueryParameter['order'] = order;
294
291
  }
@@ -298,11 +295,11 @@ var AccountsApiAxiosParamCreator = function (configuration) {
298
295
  if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
299
296
  localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
300
297
  }
301
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
298
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
302
299
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
303
300
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
304
301
  return [2 /*return*/, {
305
- url: (0, common_1.toPathString)(localVarUrlObj),
302
+ url: common_1.toPathString(localVarUrlObj),
306
303
  options: localVarRequestOptions,
307
304
  }];
308
305
  }
@@ -326,12 +323,12 @@ var AccountsApiAxiosParamCreator = function (configuration) {
326
323
  switch (_a.label) {
327
324
  case 0:
328
325
  // verify required parameter 'code' is not null or undefined
329
- (0, common_1.assertParamExists)('updateAccount', 'code', code);
326
+ common_1.assertParamExists('updateAccount', 'code', code);
330
327
  // verify required parameter 'updateAccountRequestDto' is not null or undefined
331
- (0, common_1.assertParamExists)('updateAccount', 'updateAccountRequestDto', updateAccountRequestDto);
328
+ common_1.assertParamExists('updateAccount', 'updateAccountRequestDto', updateAccountRequestDto);
332
329
  localVarPath = "/accountservice/v1/accounts/{code}"
333
- .replace("{".concat("code", "}"), encodeURIComponent(String(code)));
334
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
330
+ .replace("{" + "code" + "}", encodeURIComponent(String(code)));
331
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
335
332
  if (configuration) {
336
333
  baseOptions = configuration.baseOptions;
337
334
  baseAccessToken = configuration.accessToken;
@@ -341,7 +338,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
341
338
  localVarQueryParameter = {};
342
339
  // authentication bearer required
343
340
  // http bearer authentication required
344
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
341
+ return [4 /*yield*/, common_1.setBearerAuthToObject(localVarHeaderParameter, configuration)];
345
342
  case 1:
346
343
  // authentication bearer required
347
344
  // http bearer authentication required
@@ -350,12 +347,12 @@ var AccountsApiAxiosParamCreator = function (configuration) {
350
347
  localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
351
348
  }
352
349
  localVarHeaderParameter['Content-Type'] = 'application/json';
353
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
350
+ common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
354
351
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
355
352
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
356
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateAccountRequestDto, localVarRequestOptions, configuration);
353
+ localVarRequestOptions.data = common_1.serializeDataIfNeeded(updateAccountRequestDto, localVarRequestOptions, configuration);
357
354
  return [2 /*return*/, {
358
- url: (0, common_1.toPathString)(localVarUrlObj),
355
+ url: common_1.toPathString(localVarUrlObj),
359
356
  options: localVarRequestOptions,
360
357
  }];
361
358
  }
@@ -364,13 +361,12 @@ var AccountsApiAxiosParamCreator = function (configuration) {
364
361
  },
365
362
  };
366
363
  };
367
- exports.AccountsApiAxiosParamCreator = AccountsApiAxiosParamCreator;
368
364
  /**
369
365
  * AccountsApi - functional programming interface
370
366
  * @export
371
367
  */
372
- var AccountsApiFp = function (configuration) {
373
- var localVarAxiosParamCreator = (0, exports.AccountsApiAxiosParamCreator)(configuration);
368
+ exports.AccountsApiFp = function (configuration) {
369
+ var localVarAxiosParamCreator = exports.AccountsApiAxiosParamCreator(configuration);
374
370
  return {
375
371
  /**
376
372
  * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
@@ -388,7 +384,7 @@ var AccountsApiFp = function (configuration) {
388
384
  case 0: return [4 /*yield*/, localVarAxiosParamCreator.createAccount(createAccountRequestDto, authorization, options)];
389
385
  case 1:
390
386
  localVarAxiosArgs = _a.sent();
391
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
387
+ return [2 /*return*/, common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
392
388
  }
393
389
  });
394
390
  });
@@ -409,7 +405,7 @@ var AccountsApiFp = function (configuration) {
409
405
  case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteAccount(code, authorization, options)];
410
406
  case 1:
411
407
  localVarAxiosArgs = _a.sent();
412
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
408
+ return [2 /*return*/, common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
413
409
  }
414
410
  });
415
411
  });
@@ -431,32 +427,33 @@ var AccountsApiFp = function (configuration) {
431
427
  case 0: return [4 /*yield*/, localVarAxiosParamCreator.getAccount(code, authorization, expand, options)];
432
428
  case 1:
433
429
  localVarAxiosArgs = _a.sent();
434
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
430
+ return [2 /*return*/, common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
435
431
  }
436
432
  });
437
433
  });
438
434
  },
439
435
  /**
440
- * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
436
+ * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
441
437
  * @summary List accounts
442
438
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
443
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
444
- * @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
445
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
446
- * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
447
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
439
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
440
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
441
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
442
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code=xxx in order to fetch the result.
443
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
444
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
448
445
  * @param {*} [options] Override http request option.
449
446
  * @throws {RequiredError}
450
447
  */
451
- listAccounts: function (authorization, pageSize, pageToken, filter, order, expand, options) {
448
+ listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
452
449
  return __awaiter(this, void 0, void 0, function () {
453
450
  var localVarAxiosArgs;
454
451
  return __generator(this, function (_a) {
455
452
  switch (_a.label) {
456
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listAccounts(authorization, pageSize, pageToken, filter, order, expand, options)];
453
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, options)];
457
454
  case 1:
458
455
  localVarAxiosArgs = _a.sent();
459
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
456
+ return [2 /*return*/, common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
460
457
  }
461
458
  });
462
459
  });
@@ -478,20 +475,19 @@ var AccountsApiFp = function (configuration) {
478
475
  case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateAccount(code, updateAccountRequestDto, authorization, options)];
479
476
  case 1:
480
477
  localVarAxiosArgs = _a.sent();
481
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
478
+ return [2 /*return*/, common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
482
479
  }
483
480
  });
484
481
  });
485
482
  },
486
483
  };
487
484
  };
488
- exports.AccountsApiFp = AccountsApiFp;
489
485
  /**
490
486
  * AccountsApi - factory interface
491
487
  * @export
492
488
  */
493
- var AccountsApiFactory = function (configuration, basePath, axios) {
494
- var localVarFp = (0, exports.AccountsApiFp)(configuration);
489
+ exports.AccountsApiFactory = function (configuration, basePath, axios) {
490
+ var localVarFp = exports.AccountsApiFp(configuration);
495
491
  return {
496
492
  /**
497
493
  * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
@@ -528,19 +524,20 @@ var AccountsApiFactory = function (configuration, basePath, axios) {
528
524
  return localVarFp.getAccount(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
529
525
  },
530
526
  /**
531
- * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
527
+ * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
532
528
  * @summary List accounts
533
529
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
534
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
535
- * @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
536
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
537
- * @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
538
- * @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
530
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
531
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
532
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
533
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code=xxx in order to fetch the result.
534
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
535
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
539
536
  * @param {*} [options] Override http request option.
540
537
  * @throws {RequiredError}
541
538
  */
542
- listAccounts: function (authorization, pageSize, pageToken, filter, order, expand, options) {
543
- return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, order, expand, options).then(function (request) { return request(axios, basePath); });
539
+ listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
540
+ return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
544
541
  },
545
542
  /**
546
543
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
@@ -556,7 +553,6 @@ var AccountsApiFactory = function (configuration, basePath, axios) {
556
553
  },
557
554
  };
558
555
  };
559
- exports.AccountsApiFactory = AccountsApiFactory;
560
556
  /**
561
557
  * AccountsApi - object-oriented interface
562
558
  * @export
@@ -578,7 +574,7 @@ var AccountsApi = /** @class */ (function (_super) {
578
574
  */
579
575
  AccountsApi.prototype.createAccount = function (requestParameters, options) {
580
576
  var _this = this;
581
- return (0, exports.AccountsApiFp)(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
577
+ return exports.AccountsApiFp(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
582
578
  };
583
579
  /**
584
580
  * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
@@ -590,7 +586,7 @@ var AccountsApi = /** @class */ (function (_super) {
590
586
  */
591
587
  AccountsApi.prototype.deleteAccount = function (requestParameters, options) {
592
588
  var _this = this;
593
- return (0, exports.AccountsApiFp)(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
589
+ return exports.AccountsApiFp(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
594
590
  };
595
591
  /**
596
592
  * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
@@ -602,10 +598,10 @@ var AccountsApi = /** @class */ (function (_super) {
602
598
  */
603
599
  AccountsApi.prototype.getAccount = function (requestParameters, options) {
604
600
  var _this = this;
605
- return (0, exports.AccountsApiFp)(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
601
+ return exports.AccountsApiFp(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
606
602
  };
607
603
  /**
608
- * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
604
+ * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
609
605
  * @summary List accounts
610
606
  * @param {AccountsApiListAccountsRequest} requestParameters Request parameters.
611
607
  * @param {*} [options] Override http request option.
@@ -615,7 +611,7 @@ var AccountsApi = /** @class */ (function (_super) {
615
611
  AccountsApi.prototype.listAccounts = function (requestParameters, options) {
616
612
  var _this = this;
617
613
  if (requestParameters === void 0) { requestParameters = {}; }
618
- return (0, exports.AccountsApiFp)(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
614
+ return exports.AccountsApiFp(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
619
615
  };
620
616
  /**
621
617
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
@@ -627,7 +623,7 @@ var AccountsApi = /** @class */ (function (_super) {
627
623
  */
628
624
  AccountsApi.prototype.updateAccount = function (requestParameters, options) {
629
625
  var _this = this;
630
- return (0, exports.AccountsApiFp)(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
626
+ return exports.AccountsApiFp(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
631
627
  };
632
628
  return AccountsApi;
633
629
  }(base_1.BaseAPI));
package/dist/api.d.ts CHANGED
@@ -10,7 +10,3 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export * from './api/accounts-api';
13
- export declare enum Environment {
14
- Production = "https://apiv2.emil.de",
15
- Test = "https://apiv2-test.emil.de"
16
- }
package/dist/api.js CHANGED
@@ -12,25 +12,8 @@
12
12
  * https://openapi-generator.tech
13
13
  * Do not edit the class manually.
14
14
  */
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- var desc = Object.getOwnPropertyDescriptor(m, k);
18
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
- desc = { enumerable: true, get: function() { return m[k]; } };
20
- }
21
- Object.defineProperty(o, k2, desc);
22
- }) : (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- o[k2] = m[k];
25
- }));
26
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
- };
15
+ function __export(m) {
16
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
17
+ }
29
18
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.Environment = void 0;
31
- __exportStar(require("./api/accounts-api"), exports);
32
- var Environment;
33
- (function (Environment) {
34
- Environment["Production"] = "https://apiv2.emil.de";
35
- Environment["Test"] = "https://apiv2-test.emil.de";
36
- })(Environment = exports.Environment || (exports.Environment = {}));
19
+ __export(require("./api/accounts-api"));
package/dist/base.d.ts CHANGED
@@ -25,12 +25,13 @@ export declare const COLLECTION_FORMATS: {
25
25
  export interface LoginClass {
26
26
  accessToken: string;
27
27
  permissions: Array<string>;
28
- newPasswordRequired: boolean;
29
28
  }
30
29
  export declare enum Environment {
31
30
  Production = "https://apiv2.emil.de",
32
- Test = "https://apiv2-test.emil.de"
31
+ Test = "https://apiv2-test.emil.de",
32
+ Development = "https://apiv2-dev.emil.de"
33
33
  }
34
+ export declare function resetRetry(): void;
34
35
  /**
35
36
  *
36
37
  * @export
@@ -48,13 +49,16 @@ export interface RequestArgs {
48
49
  export declare class BaseAPI {
49
50
  protected basePath: string;
50
51
  protected axios: AxiosInstance;
51
- protected configuration: Configuration;
52
+ protected configuration: Configuration | undefined;
53
+ private tokenData?;
52
54
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
53
- getConfiguration(): Configuration;
54
55
  selectEnvironment(env: Environment): void;
55
56
  authorize(username: string, password: string): Promise<void>;
56
- refreshToken(): Promise<string>;
57
- private extractRefreshToken;
57
+ refreshTokenInternal(): Promise<string>;
58
+ private storeTokenData;
59
+ loadTokenData(): void;
60
+ cleanTokenData(): void;
61
+ private attachInterceptor;
58
62
  }
59
63
  /**
60
64
  *