@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.
- package/.openapi-generator/FILES +1 -1
- package/README.md +11 -11
- package/api/accounts-api.ts +54 -40
- package/api.ts +0 -5
- package/base.ts +122 -63
- package/common.ts +61 -0
- package/configuration.ts +0 -8
- package/dist/api/accounts-api.d.ts +46 -37
- package/dist/api/accounts-api.js +32 -26
- package/dist/api.d.ts +0 -4
- package/dist/api.js +0 -6
- package/dist/base.d.ts +10 -6
- package/dist/base.js +103 -61
- package/dist/common.d.ts +26 -0
- package/dist/common.js +35 -2
- package/dist/configuration.d.ts +0 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/models/account-class.d.ts +31 -5
- package/dist/models/account-class.js +7 -0
- package/dist/models/create-account-request-dto.d.ts +41 -11
- package/dist/models/create-account-request-dto.js +11 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/policy-class.d.ts +30 -0
- package/dist/models/update-account-request-dto.d.ts +42 -18
- package/dist/models/update-account-request-dto.js +11 -1
- package/index.ts +1 -1
- package/models/account-class.ts +34 -5
- package/models/create-account-request-dto.ts +42 -10
- package/models/index.ts +1 -1
- package/models/policy-class.ts +36 -0
- package/models/update-account-request-dto.ts +43 -17
- package/package.json +3 -3
- package/dist/models/get-account-request-dto.d.ts +0 -30
- package/models/get-account-request-dto.ts +0 -36
- /package/dist/models/{get-account-request-dto.js → policy-class.js} +0 -0
|
@@ -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
|
|
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 {
|
|
59
|
-
* @param {
|
|
60
|
-
* @param {
|
|
61
|
-
* @param {
|
|
62
|
-
* @param {
|
|
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=1, your subsequent call can include pageToken=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=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?:
|
|
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
|
|
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 {
|
|
116
|
-
* @param {
|
|
117
|
-
* @param {
|
|
118
|
-
* @param {
|
|
119
|
-
* @param {
|
|
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=1, your subsequent call can include pageToken=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=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?:
|
|
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
|
|
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 {
|
|
173
|
-
* @param {
|
|
174
|
-
* @param {
|
|
175
|
-
* @param {
|
|
176
|
-
* @param {
|
|
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=1, your subsequent call can include pageToken=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=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?:
|
|
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.
|
|
269
|
-
* @type {
|
|
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?:
|
|
275
|
+
readonly pageSize?: any;
|
|
273
276
|
/**
|
|
274
|
-
* A cursor for use in pagination.
|
|
275
|
-
* @type {
|
|
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=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
278
|
+
* @type {any}
|
|
276
279
|
* @memberof AccountsApiListAccounts
|
|
277
280
|
*/
|
|
278
|
-
readonly pageToken?:
|
|
281
|
+
readonly pageToken?: any;
|
|
279
282
|
/**
|
|
280
|
-
* Filter the response by one or multiple fields.
|
|
281
|
-
* @type {
|
|
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?:
|
|
287
|
+
readonly filter?: any;
|
|
285
288
|
/**
|
|
286
|
-
*
|
|
287
|
-
* @type {
|
|
289
|
+
* Search the list by any field. For instance, if you want to search by code add code=xxx in order to fetch the result.
|
|
290
|
+
* @type {any}
|
|
288
291
|
* @memberof AccountsApiListAccounts
|
|
289
292
|
*/
|
|
290
|
-
readonly
|
|
293
|
+
readonly search?: any;
|
|
291
294
|
/**
|
|
292
|
-
*
|
|
293
|
-
* @type {
|
|
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
|
|
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
|
|
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.
|
package/dist/api/accounts-api.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]) {
|
|
@@ -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
|
|
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 {
|
|
249
|
-
* @param {
|
|
250
|
-
* @param {
|
|
251
|
-
* @param {
|
|
252
|
-
* @param {
|
|
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=1, your subsequent call can include pageToken=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=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
|
|
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 {
|
|
440
|
-
* @param {
|
|
441
|
-
* @param {
|
|
442
|
-
* @param {
|
|
443
|
-
* @param {
|
|
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=1, your subsequent call can include pageToken=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=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
|
|
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 {
|
|
531
|
-
* @param {
|
|
532
|
-
* @param {
|
|
533
|
-
* @param {
|
|
534
|
-
* @param {
|
|
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=1, your subsequent call can include pageToken=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=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
|
|
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
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
|
-
|
|
57
|
-
private
|
|
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 = "
|
|
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
|
-
|
|
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
|
|
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.
|
|
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.
|
|
171
|
+
BaseAPI.prototype.refreshTokenInternal = function () {
|
|
198
172
|
return __awaiter(this, void 0, void 0, function () {
|
|
199
|
-
var
|
|
200
|
-
return __generator(this, function (
|
|
201
|
-
switch (
|
|
173
|
+
var username, options, accessToken;
|
|
174
|
+
return __generator(this, function (_a) {
|
|
175
|
+
switch (_a.label) {
|
|
202
176
|
case 0:
|
|
203
|
-
|
|
204
|
-
if (!username
|
|
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 = (
|
|
192
|
+
accessToken = (_a.sent()).data.accessToken;
|
|
220
193
|
return [2 /*return*/, accessToken];
|
|
221
194
|
}
|
|
222
195
|
});
|
|
223
196
|
});
|
|
224
197
|
};
|
|
225
|
-
BaseAPI.prototype.
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
|
|
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
|
}());
|