@emilgroup/public-api-sdk 1.32.0 → 1.32.1-beta.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 (35) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +2 -2
  3. package/api/documents-api.ts +40 -40
  4. package/api/products-api.ts +39 -39
  5. package/base.ts +52 -3
  6. package/common.ts +2 -2
  7. package/configuration.ts +9 -0
  8. package/dist/api/documents-api.d.ts +40 -40
  9. package/dist/api/documents-api.js +21 -21
  10. package/dist/api/products-api.d.ts +39 -39
  11. package/dist/api/products-api.js +21 -21
  12. package/dist/base.d.ts +10 -1
  13. package/dist/base.js +46 -2
  14. package/dist/common.js +2 -2
  15. package/dist/configuration.d.ts +6 -0
  16. package/dist/configuration.js +8 -0
  17. package/dist/models/complete-eis-payment-setup-request-dto.d.ts +54 -0
  18. package/dist/models/complete-eis-payment-setup-request-dto.js +15 -0
  19. package/dist/models/complete-payment-setup-request-dto.d.ts +7 -0
  20. package/dist/models/get-public-psp-settings-response-class.d.ts +6 -0
  21. package/dist/models/index.d.ts +2 -0
  22. package/dist/models/index.js +2 -0
  23. package/dist/models/initiate-eis-payment-setup-request-dto.d.ts +36 -0
  24. package/dist/models/initiate-eis-payment-setup-request-dto.js +15 -0
  25. package/dist/models/initiate-payment-setup-request-dto.d.ts +7 -0
  26. package/dist/models/product-field-class.d.ts +24 -0
  27. package/models/complete-eis-payment-setup-request-dto.ts +60 -0
  28. package/models/complete-payment-setup-request-dto.ts +7 -0
  29. package/models/get-public-psp-settings-response-class.ts +6 -0
  30. package/models/index.ts +2 -0
  31. package/models/initiate-eis-payment-setup-request-dto.ts +42 -0
  32. package/models/initiate-payment-setup-request-dto.ts +7 -0
  33. package/models/product-field-class.ts +24 -0
  34. package/package.json +1 -1
  35. package/tsconfig.json +1 -0
@@ -80,17 +80,17 @@ export declare const DocumentsApiAxiosParamCreator: (configuration?: Configurati
80
80
  * @summary List product documents
81
81
  * @param {string} productCode
82
82
  * @param {string} [authorization] Bearer Token
83
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
84
- * @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.
85
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
86
- * @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
87
- * @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.
88
- * @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.
89
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
83
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
84
+ * @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.
85
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
86
+ * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
87
+ * @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.
88
+ * @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.
89
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
90
90
  * @param {*} [options] Override http request option.
91
91
  * @throws {RequiredError}
92
92
  */
93
- listProductDocuments: (productCode: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
93
+ listProductDocuments: (productCode: string, authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
94
94
  /**
95
95
  * This will create a URL that allows user upload its documents in Database.The URL can expire between 5 minutes and 7 days.
96
96
  * @summary Upload documents using pre-signed URL
@@ -163,17 +163,17 @@ export declare const DocumentsApiFp: (configuration?: Configuration) => {
163
163
  * @summary List product documents
164
164
  * @param {string} productCode
165
165
  * @param {string} [authorization] Bearer Token
166
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
167
- * @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.
168
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
169
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
170
- * @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.
171
- * @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.
172
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
166
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
167
+ * @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.
168
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
169
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
170
+ * @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.
171
+ * @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.
172
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
173
173
  * @param {*} [options] Override http request option.
174
174
  * @throws {RequiredError}
175
175
  */
176
- listProductDocuments(productCode: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListProductDocumentsResponseClass>>;
176
+ listProductDocuments(productCode: string, authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListProductDocumentsResponseClass>>;
177
177
  /**
178
178
  * This will create a URL that allows user upload its documents in Database.The URL can expire between 5 minutes and 7 days.
179
179
  * @summary Upload documents using pre-signed URL
@@ -246,17 +246,17 @@ export declare const DocumentsApiFactory: (configuration?: Configuration, basePa
246
246
  * @summary List product documents
247
247
  * @param {string} productCode
248
248
  * @param {string} [authorization] Bearer Token
249
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
250
- * @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.
251
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
252
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
253
- * @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.
254
- * @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.
255
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
249
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
250
+ * @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.
251
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
252
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
253
+ * @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.
254
+ * @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.
255
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
256
256
  * @param {*} [options] Override http request option.
257
257
  * @throws {RequiredError}
258
258
  */
259
- listProductDocuments(productCode: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: any): AxiosPromise<ListProductDocumentsResponseClass>;
259
+ listProductDocuments(productCode: string, authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListProductDocumentsResponseClass>;
260
260
  /**
261
261
  * This will create a URL that allows user upload its documents in Database.The URL can expire between 5 minutes and 7 days.
262
262
  * @summary Upload documents using pre-signed URL
@@ -424,46 +424,46 @@ export interface DocumentsApiListProductDocumentsRequest {
424
424
  readonly authorization?: string;
425
425
  /**
426
426
  * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
427
- * @type {any}
427
+ * @type {number}
428
428
  * @memberof DocumentsApiListProductDocuments
429
429
  */
430
- readonly pageSize?: any;
430
+ readonly pageSize?: number;
431
431
  /**
432
- * 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.
433
- * @type {any}
432
+ * 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.
433
+ * @type {string}
434
434
  * @memberof DocumentsApiListProductDocuments
435
435
  */
436
- readonly pageToken?: any;
436
+ readonly pageToken?: string;
437
437
  /**
438
438
  * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
439
- * @type {any}
439
+ * @type {string}
440
440
  * @memberof DocumentsApiListProductDocuments
441
441
  */
442
- readonly filter?: any;
442
+ readonly filter?: string;
443
443
  /**
444
444
  * To search the list by any field, pass search&#x3D;xxx to fetch the result.
445
- * @type {any}
445
+ * @type {string}
446
446
  * @memberof DocumentsApiListProductDocuments
447
447
  */
448
- readonly search?: any;
448
+ readonly search?: string;
449
449
  /**
450
450
  * 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.
451
- * @type {any}
451
+ * @type {string}
452
452
  * @memberof DocumentsApiListProductDocuments
453
453
  */
454
- readonly order?: any;
454
+ readonly order?: string;
455
455
  /**
456
- * 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.
457
- * @type {any}
456
+ * 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.
457
+ * @type {string}
458
458
  * @memberof DocumentsApiListProductDocuments
459
459
  */
460
- readonly expand?: any;
460
+ readonly expand?: string;
461
461
  /**
462
462
  * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
463
- * @type {any}
463
+ * @type {string}
464
464
  * @memberof DocumentsApiListProductDocuments
465
465
  */
466
- readonly filters?: any;
466
+ readonly filters?: string;
467
467
  }
468
468
  /**
469
469
  * Request parameters for preSignedPost operation in DocumentsApi.
@@ -368,13 +368,13 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
368
368
  * @summary List product documents
369
369
  * @param {string} productCode
370
370
  * @param {string} [authorization] Bearer Token
371
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
372
- * @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.
373
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
374
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
375
- * @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.
376
- * @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.
377
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
371
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
372
+ * @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.
373
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
374
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
375
+ * @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.
376
+ * @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.
377
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
378
378
  * @param {*} [options] Override http request option.
379
379
  * @throws {RequiredError}
380
380
  */
@@ -615,13 +615,13 @@ var DocumentsApiFp = function (configuration) {
615
615
  * @summary List product documents
616
616
  * @param {string} productCode
617
617
  * @param {string} [authorization] Bearer Token
618
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
619
- * @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.
620
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
621
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
622
- * @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.
623
- * @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.
624
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
618
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
619
+ * @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.
620
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
621
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
622
+ * @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.
623
+ * @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.
624
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
625
625
  * @param {*} [options] Override http request option.
626
626
  * @throws {RequiredError}
627
627
  */
@@ -736,13 +736,13 @@ var DocumentsApiFactory = function (configuration, basePath, axios) {
736
736
  * @summary List product documents
737
737
  * @param {string} productCode
738
738
  * @param {string} [authorization] Bearer Token
739
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
740
- * @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.
741
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
742
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
743
- * @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.
744
- * @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.
745
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
739
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
740
+ * @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.
741
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
742
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
743
+ * @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.
744
+ * @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.
745
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
746
746
  * @param {*} [options] Override http request option.
747
747
  * @throws {RequiredError}
748
748
  */
@@ -99,17 +99,17 @@ export declare const ProductsApiAxiosParamCreator: (configuration?: Configuratio
99
99
  * Returns a list of products you have previously created. The products are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
100
100
  * @summary List products
101
101
  * @param {string} [authorization] Bearer Token
102
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
103
- * @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.
104
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
105
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
106
- * @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.
107
- * @param {any} [expand] You can expand product versions and insured object types list in this endpoint.
108
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
102
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
103
+ * @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.
104
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
105
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
106
+ * @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.
107
+ * @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
108
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
109
109
  * @param {*} [options] Override http request option.
110
110
  * @throws {RequiredError}
111
111
  */
112
- listProducts: (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
112
+ listProducts: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
113
113
  };
114
114
  /**
115
115
  * ProductsApi - functional programming interface
@@ -187,17 +187,17 @@ export declare const ProductsApiFp: (configuration?: Configuration) => {
187
187
  * Returns a list of products you have previously created. The products are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
188
188
  * @summary List products
189
189
  * @param {string} [authorization] Bearer Token
190
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
191
- * @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.
192
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
193
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
194
- * @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.
195
- * @param {any} [expand] You can expand product versions and insured object types list in this endpoint.
196
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
190
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
191
+ * @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.
192
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
193
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
194
+ * @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.
195
+ * @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
196
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
197
197
  * @param {*} [options] Override http request option.
198
198
  * @throws {RequiredError}
199
199
  */
200
- listProducts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListProductsResponseClass>>;
200
+ listProducts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListProductsResponseClass>>;
201
201
  };
202
202
  /**
203
203
  * ProductsApi - factory interface
@@ -275,17 +275,17 @@ export declare const ProductsApiFactory: (configuration?: Configuration, basePat
275
275
  * Returns a list of products you have previously created. The products are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
276
276
  * @summary List products
277
277
  * @param {string} [authorization] Bearer Token
278
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
279
- * @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.
280
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
281
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
282
- * @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.
283
- * @param {any} [expand] You can expand product versions and insured object types list in this endpoint.
284
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
278
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
279
+ * @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.
280
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
281
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
282
+ * @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.
283
+ * @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
284
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
285
285
  * @param {*} [options] Override http request option.
286
286
  * @throws {RequiredError}
287
287
  */
288
- listProducts(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, filters?: any, options?: any): AxiosPromise<ListProductsResponseClass>;
288
+ listProducts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListProductsResponseClass>;
289
289
  };
290
290
  /**
291
291
  * Request parameters for calculateProductFields operation in ProductsApi.
@@ -458,46 +458,46 @@ export interface ProductsApiListProductsRequest {
458
458
  readonly authorization?: string;
459
459
  /**
460
460
  * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
461
- * @type {any}
461
+ * @type {number}
462
462
  * @memberof ProductsApiListProducts
463
463
  */
464
- readonly pageSize?: any;
464
+ readonly pageSize?: number;
465
465
  /**
466
- * 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.
467
- * @type {any}
466
+ * 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.
467
+ * @type {string}
468
468
  * @memberof ProductsApiListProducts
469
469
  */
470
- readonly pageToken?: any;
470
+ readonly pageToken?: string;
471
471
  /**
472
472
  * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
473
- * @type {any}
473
+ * @type {string}
474
474
  * @memberof ProductsApiListProducts
475
475
  */
476
- readonly filter?: any;
476
+ readonly filter?: string;
477
477
  /**
478
478
  * To search the list by any field, pass search&#x3D;xxx to fetch the result.
479
- * @type {any}
479
+ * @type {string}
480
480
  * @memberof ProductsApiListProducts
481
481
  */
482
- readonly search?: any;
482
+ readonly search?: string;
483
483
  /**
484
484
  * 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.
485
- * @type {any}
485
+ * @type {string}
486
486
  * @memberof ProductsApiListProducts
487
487
  */
488
- readonly order?: any;
488
+ readonly order?: string;
489
489
  /**
490
490
  * You can expand product versions and insured object types list in this endpoint.
491
- * @type {any}
491
+ * @type {string}
492
492
  * @memberof ProductsApiListProducts
493
493
  */
494
- readonly expand?: any;
494
+ readonly expand?: string;
495
495
  /**
496
496
  * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
497
- * @type {any}
497
+ * @type {string}
498
498
  * @memberof ProductsApiListProducts
499
499
  */
500
- readonly filters?: any;
500
+ readonly filters?: string;
501
501
  }
502
502
  /**
503
503
  * ProductsApi - object-oriented interface
@@ -453,13 +453,13 @@ var ProductsApiAxiosParamCreator = function (configuration) {
453
453
  * Returns a list of products you have previously created. The products are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
454
454
  * @summary List products
455
455
  * @param {string} [authorization] Bearer Token
456
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
457
- * @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.
458
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
459
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
460
- * @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.
461
- * @param {any} [expand] You can expand product versions and insured object types list in this endpoint.
462
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
456
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
457
+ * @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.
458
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
459
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
460
+ * @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.
461
+ * @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
462
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
463
463
  * @param {*} [options] Override http request option.
464
464
  * @throws {RequiredError}
465
465
  */
@@ -686,13 +686,13 @@ var ProductsApiFp = function (configuration) {
686
686
  * Returns a list of products you have previously created. The products are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
687
687
  * @summary List products
688
688
  * @param {string} [authorization] Bearer Token
689
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
690
- * @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.
691
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
692
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
693
- * @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.
694
- * @param {any} [expand] You can expand product versions and insured object types list in this endpoint.
695
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
689
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
690
+ * @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.
691
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
692
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
693
+ * @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.
694
+ * @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
695
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
696
696
  * @param {*} [options] Override http request option.
697
697
  * @throws {RequiredError}
698
698
  */
@@ -804,13 +804,13 @@ var ProductsApiFactory = function (configuration, basePath, axios) {
804
804
  * Returns a list of products you have previously created. The products are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
805
805
  * @summary List products
806
806
  * @param {string} [authorization] Bearer Token
807
- * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
808
- * @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.
809
- * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
810
- * @param {any} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
811
- * @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.
812
- * @param {any} [expand] You can expand product versions and insured object types list in this endpoint.
813
- * @param {any} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
807
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
808
+ * @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.
809
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
810
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
811
+ * @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.
812
+ * @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
813
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time.
814
814
  * @param {*} [options] Override http request option.
815
815
  * @throws {RequiredError}
816
816
  */
package/dist/base.d.ts CHANGED
@@ -26,6 +26,14 @@ export interface LoginClass {
26
26
  accessToken: string;
27
27
  permissions: string;
28
28
  }
29
+ export interface SwitchWorkspaceRequest {
30
+ username: string;
31
+ targetWorkspace: string;
32
+ }
33
+ export interface SwitchWorkspaceResponseClass {
34
+ accessToken: string;
35
+ permissions: string;
36
+ }
29
37
  export declare enum Environment {
30
38
  Production = "https://apiv2.emil.de",
31
39
  Test = "https://apiv2-test.emil.de",
@@ -57,7 +65,8 @@ export declare class BaseAPI {
57
65
  selectEnvironment(env: Environment): void;
58
66
  selectBasePath(path: string): void;
59
67
  getPermissions(): Array<string>;
60
- authorize(username: string, password: string): Promise<void>;
68
+ authorize(username: string, password: string, targetWorkspace?: string): Promise<void>;
69
+ switchWorkspace(targetWorkspace: string): Promise<void>;
61
70
  refreshTokenInternal(): Promise<LoginClass>;
62
71
  private storeTokenData;
63
72
  loadTokenData(): void;
package/dist/base.js CHANGED
@@ -124,9 +124,13 @@ var BaseAPI = /** @class */ (function () {
124
124
  this.axios = axios;
125
125
  this.loadTokenData();
126
126
  if (configuration) {
127
+ var accessToken = this.tokenData.accessToken;
127
128
  this.configuration = configuration;
128
129
  this.basePath = configuration.basePath || this.basePath;
129
- this.configuration.accessToken = this.tokenData.accessToken ? "Bearer ".concat(this.tokenData.accessToken) : '';
130
+ // Use config token if provided, otherwise use tokenData token
131
+ var configToken = this.configuration.accessToken;
132
+ var storedToken = accessToken ? "Bearer ".concat(accessToken) : '';
133
+ this.configuration.accessToken = configToken || storedToken;
130
134
  }
131
135
  else {
132
136
  var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
@@ -151,7 +155,7 @@ var BaseAPI = /** @class */ (function () {
151
155
  }
152
156
  return this.tokenData.permissions.split(',');
153
157
  };
154
- BaseAPI.prototype.authorize = function (username, password) {
158
+ BaseAPI.prototype.authorize = function (username, password, targetWorkspace) {
155
159
  return __awaiter(this, void 0, void 0, function () {
156
160
  var options, response, _a, accessToken, permissions;
157
161
  return __generator(this, function (_b) {
@@ -176,6 +180,46 @@ var BaseAPI = /** @class */ (function () {
176
180
  this.tokenData.username = username;
177
181
  this.tokenData.accessToken = accessToken;
178
182
  this.tokenData.permissions = permissions;
183
+ if (!targetWorkspace) return [3 /*break*/, 3];
184
+ return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
185
+ case 2:
186
+ _b.sent();
187
+ return [3 /*break*/, 4];
188
+ case 3:
189
+ // Only store if no workspace switch (since switchWorkspace will store after switching)
190
+ this.storeTokenData(__assign({}, this.tokenData));
191
+ _b.label = 4;
192
+ case 4: return [2 /*return*/];
193
+ }
194
+ });
195
+ });
196
+ };
197
+ BaseAPI.prototype.switchWorkspace = function (targetWorkspace) {
198
+ return __awaiter(this, void 0, void 0, function () {
199
+ var options, response, _a, accessToken, permissions;
200
+ return __generator(this, function (_b) {
201
+ switch (_b.label) {
202
+ case 0:
203
+ options = {
204
+ method: 'POST',
205
+ url: "".concat(this.configuration.basePath, "/authservice/v1/workspaces/switch"),
206
+ headers: {
207
+ 'Content-Type': 'application/json',
208
+ 'Authorization': "Bearer ".concat(this.configuration.accessToken),
209
+ },
210
+ data: {
211
+ username: this.configuration.username,
212
+ targetWorkspace: targetWorkspace,
213
+ },
214
+ withCredentials: true,
215
+ };
216
+ return [4 /*yield*/, axios_1.default.request(options)];
217
+ case 1:
218
+ response = _b.sent();
219
+ _a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
220
+ this.configuration.accessToken = "Bearer ".concat(accessToken);
221
+ this.tokenData.accessToken = accessToken;
222
+ this.tokenData.permissions = permissions;
179
223
  this.storeTokenData(__assign({}, this.tokenData));
180
224
  return [2 /*return*/];
181
225
  }
package/dist/common.js CHANGED
@@ -140,7 +140,7 @@ var setBearerAuthToObject = function (object, configuration) {
140
140
  _b.label = 4;
141
141
  case 4:
142
142
  accessToken = _a;
143
- object["Authorization"] = "Bearer " + accessToken;
143
+ object["Authorization"] = configuration.getBearerToken(accessToken);
144
144
  _b.label = 5;
145
145
  case 5: return [2 /*return*/];
146
146
  }
@@ -170,7 +170,7 @@ var setOAuthToObject = function (object, name, scopes, configuration) {
170
170
  _b.label = 4;
171
171
  case 4:
172
172
  localVarAccessTokenValue = _a;
173
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
173
+ object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
174
174
  _b.label = 5;
175
175
  case 5: return [2 /*return*/];
176
176
  }
@@ -80,4 +80,10 @@ export declare class Configuration {
80
80
  * @return True if the given MIME is JSON, false otherwise.
81
81
  */
82
82
  isJsonMime(mime: string): boolean;
83
+ /**
84
+ * Returns "Bearer" token.
85
+ * @param token - access token.
86
+ * @return Bearer token.
87
+ */
88
+ getBearerToken(token?: string): string;
83
89
  }
@@ -39,6 +39,14 @@ var Configuration = /** @class */ (function () {
39
39
  var jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
40
40
  return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
41
41
  };
42
+ /**
43
+ * Returns "Bearer" token.
44
+ * @param token - access token.
45
+ * @return Bearer token.
46
+ */
47
+ Configuration.prototype.getBearerToken = function (token) {
48
+ return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
49
+ };
42
50
  return Configuration;
43
51
  }());
44
52
  exports.Configuration = Configuration;