@emilgroup/account-sdk 1.1.0 → 1.4.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.
@@ -52,18 +52,19 @@ export declare const AccountsApiAxiosParamCreator: (configuration?: Configuratio
52
52
  */
53
53
  getAccount: (code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
54
54
  /**
55
- * 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.
55
+ * 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.
56
56
  * @summary List accounts
57
57
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
58
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
59
- * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
60
- * @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**
61
- * @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**.
62
- * @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**.
58
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
59
+ * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
60
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
61
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
62
+ * @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.
63
+ * @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.
63
64
  * @param {*} [options] Override http request option.
64
65
  * @throws {RequiredError}
65
66
  */
66
- listAccounts: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
67
+ listAccounts: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
67
68
  /**
68
69
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
69
70
  * @summary Update the account
@@ -109,18 +110,19 @@ export declare const AccountsApiFp: (configuration?: Configuration) => {
109
110
  */
110
111
  getAccount(code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetAccountResponseClass>>;
111
112
  /**
112
- * 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.
113
+ * 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.
113
114
  * @summary List accounts
114
115
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
115
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
116
- * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
117
- * @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**
118
- * @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**.
119
- * @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**.
116
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
117
+ * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
118
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
119
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
120
+ * @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.
121
+ * @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.
120
122
  * @param {*} [options] Override http request option.
121
123
  * @throws {RequiredError}
122
124
  */
123
- listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListAccountsResponseClass>>;
125
+ listAccounts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListAccountsResponseClass>>;
124
126
  /**
125
127
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
126
128
  * @summary Update the account
@@ -166,18 +168,19 @@ export declare const AccountsApiFactory: (configuration?: Configuration, basePat
166
168
  */
167
169
  getAccount(code: string, authorization?: string, expand?: string, options?: any): AxiosPromise<GetAccountResponseClass>;
168
170
  /**
169
- * 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.
171
+ * 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.
170
172
  * @summary List accounts
171
173
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
172
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
173
- * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
174
- * @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**
175
- * @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**.
176
- * @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**.
174
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
175
+ * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
176
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
177
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
178
+ * @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.
179
+ * @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.
177
180
  * @param {*} [options] Override http request option.
178
181
  * @throws {RequiredError}
179
182
  */
180
- listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListAccountsResponseClass>;
183
+ listAccounts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListAccountsResponseClass>;
181
184
  /**
182
185
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
183
186
  * @summary Update the account
@@ -265,35 +268,41 @@ export interface AccountsApiListAccountsRequest {
265
268
  */
266
269
  readonly authorization?: string;
267
270
  /**
268
- * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
269
- * @type {number}
271
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
272
+ * @type {any}
270
273
  * @memberof AccountsApiListAccounts
271
274
  */
272
- readonly pageSize?: number;
275
+ readonly pageSize?: any;
273
276
  /**
274
- * 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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
275
- * @type {string}
277
+ * 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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
278
+ * @type {any}
276
279
  * @memberof AccountsApiListAccounts
277
280
  */
278
- readonly pageToken?: string;
281
+ readonly pageToken?: any;
279
282
  /**
280
- * 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**
281
- * @type {string}
283
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
284
+ * @type {any}
282
285
  * @memberof AccountsApiListAccounts
283
286
  */
284
- readonly filter?: string;
287
+ readonly filter?: any;
285
288
  /**
286
- * 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**.
287
- * @type {string}
289
+ * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
290
+ * @type {any}
288
291
  * @memberof AccountsApiListAccounts
289
292
  */
290
- readonly order?: string;
293
+ readonly search?: any;
291
294
  /**
292
- * 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**.
293
- * @type {string}
295
+ * 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.
296
+ * @type {any}
294
297
  * @memberof AccountsApiListAccounts
295
298
  */
296
- readonly expand?: string;
299
+ readonly order?: any;
300
+ /**
301
+ * 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.
302
+ * @type {any}
303
+ * @memberof AccountsApiListAccounts
304
+ */
305
+ readonly expand?: any;
297
306
  }
298
307
  /**
299
308
  * Request parameters for updateAccount operation in AccountsApi.
@@ -355,7 +364,7 @@ export declare class AccountsApi extends BaseAPI {
355
364
  */
356
365
  getAccount(requestParameters: AccountsApiGetAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponseClass, any>>;
357
366
  /**
358
- * 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.
367
+ * 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.
359
368
  * @summary List accounts
360
369
  * @param {AccountsApiListAccountsRequest} requestParameters Request parameters.
361
370
  * @param {*} [options] Override http request option.
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
56
- while (_) try {
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
57
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
58
  if (y = 0, t) op = [op[0] & 2, t.value];
59
59
  switch (op[0]) {
@@ -242,18 +242,19 @@ var AccountsApiAxiosParamCreator = function (configuration) {
242
242
  });
243
243
  },
244
244
  /**
245
- * 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.
245
+ * 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.
246
246
  * @summary List accounts
247
247
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
248
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
249
- * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
250
- * @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**
251
- * @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**.
252
- * @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**.
248
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
249
+ * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
250
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
251
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
252
+ * @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.
253
+ * @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.
253
254
  * @param {*} [options] Override http request option.
254
255
  * @throws {RequiredError}
255
256
  */
256
- listAccounts: function (authorization, pageSize, pageToken, filter, order, expand, options) {
257
+ listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
257
258
  if (options === void 0) { options = {}; }
258
259
  return __awaiter(_this, void 0, void 0, function () {
259
260
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
@@ -285,6 +286,9 @@ var AccountsApiAxiosParamCreator = function (configuration) {
285
286
  if (filter !== undefined) {
286
287
  localVarQueryParameter['filter'] = filter;
287
288
  }
289
+ if (search !== undefined) {
290
+ localVarQueryParameter['search'] = search;
291
+ }
288
292
  if (order !== undefined) {
289
293
  localVarQueryParameter['order'] = order;
290
294
  }
@@ -433,23 +437,24 @@ var AccountsApiFp = function (configuration) {
433
437
  });
434
438
  },
435
439
  /**
436
- * 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.
440
+ * 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.
437
441
  * @summary List accounts
438
442
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
439
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
440
- * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
441
- * @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**
442
- * @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**.
443
- * @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**.
443
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
444
+ * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
445
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
446
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
447
+ * @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.
448
+ * @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.
444
449
  * @param {*} [options] Override http request option.
445
450
  * @throws {RequiredError}
446
451
  */
447
- listAccounts: function (authorization, pageSize, pageToken, filter, order, expand, options) {
452
+ listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
448
453
  return __awaiter(this, void 0, void 0, function () {
449
454
  var localVarAxiosArgs;
450
455
  return __generator(this, function (_a) {
451
456
  switch (_a.label) {
452
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listAccounts(authorization, pageSize, pageToken, filter, order, expand, options)];
457
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, options)];
453
458
  case 1:
454
459
  localVarAxiosArgs = _a.sent();
455
460
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -524,19 +529,20 @@ var AccountsApiFactory = function (configuration, basePath, axios) {
524
529
  return localVarFp.getAccount(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
525
530
  },
526
531
  /**
527
- * 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.
532
+ * 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.
528
533
  * @summary List accounts
529
534
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
530
- * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
531
- * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
532
- * @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**
533
- * @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**.
534
- * @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**.
535
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
536
+ * @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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
537
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
538
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
539
+ * @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.
540
+ * @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.
535
541
  * @param {*} [options] Override http request option.
536
542
  * @throws {RequiredError}
537
543
  */
538
- listAccounts: function (authorization, pageSize, pageToken, filter, order, expand, options) {
539
- return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, order, expand, options).then(function (request) { return request(axios, basePath); });
544
+ listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
545
+ return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
540
546
  },
541
547
  /**
542
548
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
@@ -601,7 +607,7 @@ var AccountsApi = /** @class */ (function (_super) {
601
607
  return (0, exports.AccountsApiFp)(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
602
608
  };
603
609
  /**
604
- * 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.
610
+ * 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.
605
611
  * @summary List accounts
606
612
  * @param {AccountsApiListAccountsRequest} requestParameters Request parameters.
607
613
  * @param {*} [options] Override http request option.
@@ -611,7 +617,7 @@ var AccountsApi = /** @class */ (function (_super) {
611
617
  AccountsApi.prototype.listAccounts = function (requestParameters, options) {
612
618
  var _this = this;
613
619
  if (requestParameters === void 0) { requestParameters = {}; }
614
- 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); });
620
+ return (0, 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); });
615
621
  };
616
622
  /**
617
623
  * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
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
@@ -27,10 +27,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
27
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.Environment = void 0;
31
30
  __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 = {}));
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
  *
package/dist/base.js CHANGED
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
53
  function verb(n) { return function (v) { return step([n, v]); }; }
54
54
  function step(op) {
55
55
  if (f) throw new TypeError("Generator is already executing.");
56
- while (_) try {
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
57
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
58
  if (y = 0, t) op = [op[0] & 2, t.value];
59
59
  switch (op[0]) {
@@ -78,12 +78,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
78
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
79
79
  };
80
80
  Object.defineProperty(exports, "__esModule", { value: true });
81
- exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
81
+ exports.RequiredError = exports.BaseAPI = exports.resetRetry = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
82
82
  var configuration_1 = require("./configuration");
83
+ var common_1 = require("./common");
83
84
  // Some imports not used depending on template conditions
84
85
  // @ts-ignore
85
86
  var axios_1 = __importDefault(require("axios"));
86
- exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
87
+ exports.BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
87
88
  /**
88
89
  *
89
90
  * @export
@@ -98,7 +99,16 @@ var Environment;
98
99
  (function (Environment) {
99
100
  Environment["Production"] = "https://apiv2.emil.de";
100
101
  Environment["Test"] = "https://apiv2-test.emil.de";
102
+ Environment["Development"] = "https://apiv2-dev.emil.de";
101
103
  })(Environment = exports.Environment || (exports.Environment = {}));
104
+ var _retry_count = 0;
105
+ var _retry = null;
106
+ function resetRetry() {
107
+ _retry_count = 0;
108
+ }
109
+ exports.resetRetry = resetRetry;
110
+ var NETWORK_ERROR_MESSAGE = "Network Error";
111
+ var TOKEN_DATA = 'APP_TOKEN';
102
112
  /**
103
113
  *
104
114
  * @export
@@ -108,66 +118,29 @@ var BaseAPI = /** @class */ (function () {
108
118
  function BaseAPI(configuration, basePath, axios) {
109
119
  if (basePath === void 0) { basePath = exports.BASE_PATH; }
110
120
  if (axios === void 0) { axios = axios_1.default; }
111
- var _this = this;
112
121
  this.basePath = basePath;
113
122
  this.axios = axios;
123
+ this.loadTokenData();
114
124
  if (configuration) {
115
125
  this.configuration = configuration;
116
126
  this.basePath = configuration.basePath || this.basePath;
117
127
  }
118
128
  else {
129
+ var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
119
130
  this.configuration = new configuration_1.Configuration({
120
131
  basePath: this.basePath,
132
+ accessToken: accessToken ? "Bearer ".concat(accessToken) : '',
133
+ username: username,
121
134
  });
122
135
  }
123
- axios.interceptors.response.use(function (res) {
124
- return res;
125
- }, function (err) { return __awaiter(_this, void 0, void 0, function () {
126
- var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1;
127
- return __generator(this, function (_a) {
128
- switch (_a.label) {
129
- case 0:
130
- originalConfig = err.config;
131
- if (!err.response) return [3 /*break*/, 5];
132
- if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
133
- originalConfig._retry = true;
134
- _a.label = 1;
135
- case 1:
136
- _a.trys.push([1, 3, , 4]);
137
- return [4 /*yield*/, this.refreshToken()];
138
- case 2:
139
- tokenString = _a.sent();
140
- accessToken = "Bearer ".concat(tokenString);
141
- localVarHeaderParameter = {};
142
- localVarHeaderParameter['Authorization'] = accessToken;
143
- originalConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
144
- this.configuration.accessToken = accessToken;
145
- return [2 /*return*/, axios(originalConfig)];
146
- case 3:
147
- _error_1 = _a.sent();
148
- if (_error_1.response && _error_1.response.data) {
149
- return [2 /*return*/, Promise.reject(_error_1.response.data)];
150
- }
151
- return [2 /*return*/, Promise.reject(_error_1)];
152
- case 4:
153
- if (err.response.status === 403 && err.response.data) {
154
- return [2 /*return*/, Promise.reject(err.response.data)];
155
- }
156
- _a.label = 5;
157
- case 5: return [2 /*return*/, Promise.reject(err)];
158
- }
159
- });
160
- }); });
136
+ this.attachInterceptor(axios);
161
137
  }
162
- BaseAPI.prototype.getConfiguration = function () {
163
- return this.configuration;
164
- };
165
138
  BaseAPI.prototype.selectEnvironment = function (env) {
166
139
  this.configuration.basePath = env;
167
140
  };
168
141
  BaseAPI.prototype.authorize = function (username, password) {
169
142
  return __awaiter(this, void 0, void 0, function () {
170
- var options, response, accessToken, refreshToken;
143
+ var options, response, accessToken;
171
144
  return __generator(this, function (_a) {
172
145
  switch (_a.label) {
173
146
  case 0:
@@ -185,23 +158,24 @@ var BaseAPI = /** @class */ (function () {
185
158
  case 1:
186
159
  response = _a.sent();
187
160
  accessToken = response.data.accessToken;
188
- refreshToken = this.extractRefreshToken(response);
189
161
  this.configuration.username = username;
190
162
  this.configuration.accessToken = "Bearer ".concat(accessToken);
191
- this.configuration.refreshToken = refreshToken;
163
+ this.tokenData.username = username;
164
+ this.tokenData.accessToken = accessToken;
165
+ this.storeTokenData(__assign({}, this.tokenData));
192
166
  return [2 /*return*/];
193
167
  }
194
168
  });
195
169
  });
196
170
  };
197
- BaseAPI.prototype.refreshToken = function () {
171
+ BaseAPI.prototype.refreshTokenInternal = function () {
198
172
  return __awaiter(this, void 0, void 0, function () {
199
- var _a, username, refreshToken, options, accessToken;
200
- return __generator(this, function (_b) {
201
- switch (_b.label) {
173
+ var username, options, accessToken;
174
+ return __generator(this, function (_a) {
175
+ switch (_a.label) {
202
176
  case 0:
203
- _a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
204
- if (!username || !refreshToken) {
177
+ username = this.configuration.username;
178
+ if (!username) {
205
179
  return [2 /*return*/, ''];
206
180
  }
207
181
  options = {
@@ -209,25 +183,93 @@ var BaseAPI = /** @class */ (function () {
209
183
  url: "".concat(this.configuration.basePath, "/authservice/v1/refresh-token"),
210
184
  headers: {
211
185
  'Content-Type': 'application/json',
212
- Cookie: refreshToken,
213
186
  },
214
187
  data: { username: username },
215
188
  withCredentials: true,
216
189
  };
217
190
  return [4 /*yield*/, axios_1.default.request(options)];
218
191
  case 1:
219
- accessToken = (_b.sent()).data.accessToken;
192
+ accessToken = (_a.sent()).data.accessToken;
220
193
  return [2 /*return*/, accessToken];
221
194
  }
222
195
  });
223
196
  });
224
197
  };
225
- BaseAPI.prototype.extractRefreshToken = function (response) {
226
- if (response.headers && response.headers['set-cookie']
227
- && response.headers['set-cookie'].length > 0) {
228
- return "".concat(response.headers['set-cookie'][0].split(';')[0], ";");
198
+ BaseAPI.prototype.storeTokenData = function (tokenData) {
199
+ if (typeof window !== 'undefined') {
200
+ (0, common_1.defaultStorage)().set(TOKEN_DATA, tokenData);
201
+ }
202
+ };
203
+ BaseAPI.prototype.loadTokenData = function () {
204
+ if (typeof window !== 'undefined') {
205
+ this.tokenData = (0, common_1.defaultStorage)().get(TOKEN_DATA) || {};
229
206
  }
230
- return '';
207
+ };
208
+ BaseAPI.prototype.cleanTokenData = function () {
209
+ this.storeTokenData(null);
210
+ };
211
+ BaseAPI.prototype.attachInterceptor = function (axios) {
212
+ var _this = this;
213
+ axios.interceptors.response.use(function (res) {
214
+ return res;
215
+ }, function (err) { return __awaiter(_this, void 0, void 0, function () {
216
+ var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
217
+ return __generator(this, function (_a) {
218
+ switch (_a.label) {
219
+ case 0:
220
+ originalConfig = err.config;
221
+ if (!(err.response && !(err.response instanceof XMLHttpRequest))) return [3 /*break*/, 5];
222
+ if (!((err.response.status === 401 || err.response.status === 403)
223
+ && !originalConfig._retry)) return [3 /*break*/, 4];
224
+ originalConfig._retry = true;
225
+ _a.label = 1;
226
+ case 1:
227
+ _a.trys.push([1, 3, , 4]);
228
+ return [4 /*yield*/, this.refreshTokenInternal()];
229
+ case 2:
230
+ tokenString = _a.sent();
231
+ accessToken = "Bearer ".concat(tokenString);
232
+ delete originalConfig.headers['Authorization'];
233
+ originalConfig.headers['Authorization'] = accessToken;
234
+ this.configuration.accessToken = accessToken;
235
+ this.tokenData.accessToken = tokenString;
236
+ this.storeTokenData(this.tokenData);
237
+ return [2 /*return*/, axios(originalConfig)];
238
+ case 3:
239
+ _error_1 = _a.sent();
240
+ if (_error_1.response && _error_1.response.data) {
241
+ return [2 /*return*/, Promise.reject(_error_1.response.data)];
242
+ }
243
+ return [2 /*return*/, Promise.reject(_error_1)];
244
+ case 4: return [3 /*break*/, 9];
245
+ case 5:
246
+ if (!(err.message === NETWORK_ERROR_MESSAGE
247
+ && originalConfig.headers.hasOwnProperty('Authorization')
248
+ && _retry_count < 4)) return [3 /*break*/, 9];
249
+ _retry_count++;
250
+ _a.label = 6;
251
+ case 6:
252
+ _a.trys.push([6, 8, , 9]);
253
+ return [4 /*yield*/, this.refreshTokenInternal()];
254
+ case 7:
255
+ tokenString = _a.sent();
256
+ accessToken = "Bearer ".concat(tokenString);
257
+ _retry = true;
258
+ originalConfig.headers['Authorization'] = accessToken;
259
+ this.configuration.accessToken = accessToken;
260
+ this.tokenData.accessToken = tokenString;
261
+ this.storeTokenData(this.tokenData);
262
+ return [2 /*return*/, axios.request(__assign({}, originalConfig))];
263
+ case 8:
264
+ _error_2 = _a.sent();
265
+ if (_error_2.response && _error_2.response.data) {
266
+ return [2 /*return*/, Promise.reject(_error_2.response.data)];
267
+ }
268
+ return [2 /*return*/, Promise.reject(_error_2)];
269
+ case 9: return [2 /*return*/, Promise.reject(err)];
270
+ }
271
+ });
272
+ }); });
231
273
  };
232
274
  return BaseAPI;
233
275
  }());