@emilgroup/public-api-sdk-node 1.33.0 → 1.34.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 +2 -0
- package/README.md +2 -2
- package/api/documents-api.ts +40 -40
- package/api/products-api.ts +39 -39
- package/base.ts +48 -5
- package/common.ts +2 -2
- package/configuration.ts +9 -0
- package/dist/api/documents-api.d.ts +40 -40
- package/dist/api/documents-api.js +21 -21
- package/dist/api/products-api.d.ts +39 -39
- package/dist/api/products-api.js +21 -21
- package/dist/base.d.ts +12 -2
- package/dist/base.js +44 -4
- package/dist/common.js +2 -2
- package/dist/configuration.d.ts +6 -0
- package/dist/configuration.js +8 -0
- package/dist/models/complete-eis-payment-setup-request-dto.d.ts +54 -0
- package/dist/models/complete-eis-payment-setup-request-dto.js +15 -0
- package/dist/models/complete-payment-setup-request-dto.d.ts +7 -0
- package/dist/models/get-public-psp-settings-response-class.d.ts +6 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/initiate-eis-payment-setup-request-dto.d.ts +36 -0
- package/dist/models/initiate-eis-payment-setup-request-dto.js +15 -0
- package/dist/models/initiate-payment-setup-request-dto.d.ts +7 -0
- package/dist/models/product-field-class.d.ts +24 -0
- package/models/complete-eis-payment-setup-request-dto.ts +60 -0
- package/models/complete-payment-setup-request-dto.ts +7 -0
- package/models/get-public-psp-settings-response-class.ts +6 -0
- package/models/index.ts +2 -0
- package/models/initiate-eis-payment-setup-request-dto.ts +42 -0
- package/models/initiate-payment-setup-request-dto.ts +7 -0
- package/models/product-field-class.ts +24 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -27,6 +27,7 @@ models/calculate-product-fields-response-class.ts
|
|
|
27
27
|
models/card-details-dto.ts
|
|
28
28
|
models/complete-adyen-payment-setup-request-dto.ts
|
|
29
29
|
models/complete-braintree-payment-setup-request-dto.ts
|
|
30
|
+
models/complete-eis-payment-setup-request-dto.ts
|
|
30
31
|
models/complete-email-verification-dto.ts
|
|
31
32
|
models/complete-email-verification-response-class.ts
|
|
32
33
|
models/complete-payment-setup-request-dto.ts
|
|
@@ -57,6 +58,7 @@ models/initiate-adyen-payment-setup-request-dto.ts
|
|
|
57
58
|
models/initiate-adyen-payment-setup-response-class.ts
|
|
58
59
|
models/initiate-braintree-payment-setup-request-dto.ts
|
|
59
60
|
models/initiate-braintree-payment-setup-response-class.ts
|
|
61
|
+
models/initiate-eis-payment-setup-request-dto.ts
|
|
60
62
|
models/initiate-email-verification-dto.ts
|
|
61
63
|
models/initiate-email-verification-response-class.ts
|
|
62
64
|
models/initiate-lead-response-class.ts
|
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/public-api-sdk-node@1.
|
|
20
|
+
npm install @emilgroup/public-api-sdk-node@1.34.1 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/public-api-sdk-node@1.
|
|
24
|
+
yarn add @emilgroup/public-api-sdk-node@1.34.1
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `PublicApi`.
|
package/api/documents-api.ts
CHANGED
|
@@ -310,17 +310,17 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
310
310
|
* @summary List product documents
|
|
311
311
|
* @param {string} productCode
|
|
312
312
|
* @param {string} [authorization] Bearer Token
|
|
313
|
-
* @param {
|
|
314
|
-
* @param {
|
|
315
|
-
* @param {
|
|
316
|
-
* @param {
|
|
317
|
-
* @param {
|
|
318
|
-
* @param {
|
|
319
|
-
* @param {
|
|
313
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
314
|
+
* @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.
|
|
315
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
316
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
317
|
+
* @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.
|
|
318
|
+
* @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.
|
|
319
|
+
* @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.
|
|
320
320
|
* @param {*} [options] Override http request option.
|
|
321
321
|
* @throws {RequiredError}
|
|
322
322
|
*/
|
|
323
|
-
listProductDocuments: async (productCode: string, authorization?: string, pageSize?:
|
|
323
|
+
listProductDocuments: async (productCode: string, authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
324
324
|
// verify required parameter 'productCode' is not null or undefined
|
|
325
325
|
assertParamExists('listProductDocuments', 'productCode', productCode)
|
|
326
326
|
const localVarPath = `/publicapi/v1/documents/{productCode}`
|
|
@@ -514,17 +514,17 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
|
|
514
514
|
* @summary List product documents
|
|
515
515
|
* @param {string} productCode
|
|
516
516
|
* @param {string} [authorization] Bearer Token
|
|
517
|
-
* @param {
|
|
518
|
-
* @param {
|
|
519
|
-
* @param {
|
|
520
|
-
* @param {
|
|
521
|
-
* @param {
|
|
522
|
-
* @param {
|
|
523
|
-
* @param {
|
|
517
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
518
|
+
* @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.
|
|
519
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
520
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
521
|
+
* @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.
|
|
522
|
+
* @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.
|
|
523
|
+
* @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.
|
|
524
524
|
* @param {*} [options] Override http request option.
|
|
525
525
|
* @throws {RequiredError}
|
|
526
526
|
*/
|
|
527
|
-
async listProductDocuments(productCode: string, authorization?: string, pageSize?:
|
|
527
|
+
async 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>> {
|
|
528
528
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listProductDocuments(productCode, authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
529
529
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
530
530
|
},
|
|
@@ -617,17 +617,17 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
|
|
617
617
|
* @summary List product documents
|
|
618
618
|
* @param {string} productCode
|
|
619
619
|
* @param {string} [authorization] Bearer Token
|
|
620
|
-
* @param {
|
|
621
|
-
* @param {
|
|
622
|
-
* @param {
|
|
623
|
-
* @param {
|
|
624
|
-
* @param {
|
|
625
|
-
* @param {
|
|
626
|
-
* @param {
|
|
620
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
621
|
+
* @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.
|
|
622
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
623
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
624
|
+
* @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.
|
|
625
|
+
* @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.
|
|
626
|
+
* @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.
|
|
627
627
|
* @param {*} [options] Override http request option.
|
|
628
628
|
* @throws {RequiredError}
|
|
629
629
|
*/
|
|
630
|
-
listProductDocuments(productCode: string, authorization?: string, pageSize?:
|
|
630
|
+
listProductDocuments(productCode: string, authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListProductDocumentsResponseClass> {
|
|
631
631
|
return localVarFp.listProductDocuments(productCode, authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
632
632
|
},
|
|
633
633
|
/**
|
|
@@ -820,52 +820,52 @@ export interface DocumentsApiListProductDocumentsRequest {
|
|
|
820
820
|
|
|
821
821
|
/**
|
|
822
822
|
* A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
823
|
-
* @type {
|
|
823
|
+
* @type {number}
|
|
824
824
|
* @memberof DocumentsApiListProductDocuments
|
|
825
825
|
*/
|
|
826
|
-
readonly pageSize?:
|
|
826
|
+
readonly pageSize?: number
|
|
827
827
|
|
|
828
828
|
/**
|
|
829
|
-
* 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,
|
|
830
|
-
* @type {
|
|
829
|
+
* 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.
|
|
830
|
+
* @type {string}
|
|
831
831
|
* @memberof DocumentsApiListProductDocuments
|
|
832
832
|
*/
|
|
833
|
-
readonly pageToken?:
|
|
833
|
+
readonly pageToken?: string
|
|
834
834
|
|
|
835
835
|
/**
|
|
836
836
|
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
837
|
-
* @type {
|
|
837
|
+
* @type {string}
|
|
838
838
|
* @memberof DocumentsApiListProductDocuments
|
|
839
839
|
*/
|
|
840
|
-
readonly filter?:
|
|
840
|
+
readonly filter?: string
|
|
841
841
|
|
|
842
842
|
/**
|
|
843
843
|
* To search the list by any field, pass search=xxx to fetch the result.
|
|
844
|
-
* @type {
|
|
844
|
+
* @type {string}
|
|
845
845
|
* @memberof DocumentsApiListProductDocuments
|
|
846
846
|
*/
|
|
847
|
-
readonly search?:
|
|
847
|
+
readonly search?: string
|
|
848
848
|
|
|
849
849
|
/**
|
|
850
850
|
* 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.
|
|
851
|
-
* @type {
|
|
851
|
+
* @type {string}
|
|
852
852
|
* @memberof DocumentsApiListProductDocuments
|
|
853
853
|
*/
|
|
854
|
-
readonly order?:
|
|
854
|
+
readonly order?: string
|
|
855
855
|
|
|
856
856
|
/**
|
|
857
|
-
* 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
|
|
858
|
-
* @type {
|
|
857
|
+
* 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.
|
|
858
|
+
* @type {string}
|
|
859
859
|
* @memberof DocumentsApiListProductDocuments
|
|
860
860
|
*/
|
|
861
|
-
readonly expand?:
|
|
861
|
+
readonly expand?: string
|
|
862
862
|
|
|
863
863
|
/**
|
|
864
864
|
* 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.
|
|
865
|
-
* @type {
|
|
865
|
+
* @type {string}
|
|
866
866
|
* @memberof DocumentsApiListProductDocuments
|
|
867
867
|
*/
|
|
868
|
-
readonly filters?:
|
|
868
|
+
readonly filters?: string
|
|
869
869
|
}
|
|
870
870
|
|
|
871
871
|
/**
|
package/api/products-api.ts
CHANGED
|
@@ -396,17 +396,17 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
396
396
|
* 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.
|
|
397
397
|
* @summary List products
|
|
398
398
|
* @param {string} [authorization] Bearer Token
|
|
399
|
-
* @param {
|
|
400
|
-
* @param {
|
|
401
|
-
* @param {
|
|
402
|
-
* @param {
|
|
403
|
-
* @param {
|
|
404
|
-
* @param {
|
|
405
|
-
* @param {
|
|
399
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
400
|
+
* @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.
|
|
401
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
402
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
403
|
+
* @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.
|
|
404
|
+
* @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
|
|
405
|
+
* @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.
|
|
406
406
|
* @param {*} [options] Override http request option.
|
|
407
407
|
* @throws {RequiredError}
|
|
408
408
|
*/
|
|
409
|
-
listProducts: async (authorization?: string, pageSize?:
|
|
409
|
+
listProducts: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
410
410
|
const localVarPath = `/publicapi/v1/products`;
|
|
411
411
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
412
412
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -570,17 +570,17 @@ export const ProductsApiFp = function(configuration?: Configuration) {
|
|
|
570
570
|
* 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.
|
|
571
571
|
* @summary List products
|
|
572
572
|
* @param {string} [authorization] Bearer Token
|
|
573
|
-
* @param {
|
|
574
|
-
* @param {
|
|
575
|
-
* @param {
|
|
576
|
-
* @param {
|
|
577
|
-
* @param {
|
|
578
|
-
* @param {
|
|
579
|
-
* @param {
|
|
573
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
574
|
+
* @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.
|
|
575
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
576
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
577
|
+
* @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.
|
|
578
|
+
* @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
|
|
579
|
+
* @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.
|
|
580
580
|
* @param {*} [options] Override http request option.
|
|
581
581
|
* @throws {RequiredError}
|
|
582
582
|
*/
|
|
583
|
-
async listProducts(authorization?: string, pageSize?:
|
|
583
|
+
async 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>> {
|
|
584
584
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listProducts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
585
585
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
586
586
|
},
|
|
@@ -679,17 +679,17 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
|
|
|
679
679
|
* 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.
|
|
680
680
|
* @summary List products
|
|
681
681
|
* @param {string} [authorization] Bearer Token
|
|
682
|
-
* @param {
|
|
683
|
-
* @param {
|
|
684
|
-
* @param {
|
|
685
|
-
* @param {
|
|
686
|
-
* @param {
|
|
687
|
-
* @param {
|
|
688
|
-
* @param {
|
|
682
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
683
|
+
* @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.
|
|
684
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
685
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
686
|
+
* @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.
|
|
687
|
+
* @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
|
|
688
|
+
* @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.
|
|
689
689
|
* @param {*} [options] Override http request option.
|
|
690
690
|
* @throws {RequiredError}
|
|
691
691
|
*/
|
|
692
|
-
listProducts(authorization?: string, pageSize?:
|
|
692
|
+
listProducts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListProductsResponseClass> {
|
|
693
693
|
return localVarFp.listProducts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
694
694
|
},
|
|
695
695
|
};
|
|
@@ -885,52 +885,52 @@ export interface ProductsApiListProductsRequest {
|
|
|
885
885
|
|
|
886
886
|
/**
|
|
887
887
|
* A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
888
|
-
* @type {
|
|
888
|
+
* @type {number}
|
|
889
889
|
* @memberof ProductsApiListProducts
|
|
890
890
|
*/
|
|
891
|
-
readonly pageSize?:
|
|
891
|
+
readonly pageSize?: number
|
|
892
892
|
|
|
893
893
|
/**
|
|
894
|
-
* 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,
|
|
895
|
-
* @type {
|
|
894
|
+
* 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.
|
|
895
|
+
* @type {string}
|
|
896
896
|
* @memberof ProductsApiListProducts
|
|
897
897
|
*/
|
|
898
|
-
readonly pageToken?:
|
|
898
|
+
readonly pageToken?: string
|
|
899
899
|
|
|
900
900
|
/**
|
|
901
901
|
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
902
|
-
* @type {
|
|
902
|
+
* @type {string}
|
|
903
903
|
* @memberof ProductsApiListProducts
|
|
904
904
|
*/
|
|
905
|
-
readonly filter?:
|
|
905
|
+
readonly filter?: string
|
|
906
906
|
|
|
907
907
|
/**
|
|
908
908
|
* To search the list by any field, pass search=xxx to fetch the result.
|
|
909
|
-
* @type {
|
|
909
|
+
* @type {string}
|
|
910
910
|
* @memberof ProductsApiListProducts
|
|
911
911
|
*/
|
|
912
|
-
readonly search?:
|
|
912
|
+
readonly search?: string
|
|
913
913
|
|
|
914
914
|
/**
|
|
915
915
|
* 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.
|
|
916
|
-
* @type {
|
|
916
|
+
* @type {string}
|
|
917
917
|
* @memberof ProductsApiListProducts
|
|
918
918
|
*/
|
|
919
|
-
readonly order?:
|
|
919
|
+
readonly order?: string
|
|
920
920
|
|
|
921
921
|
/**
|
|
922
922
|
* You can expand product versions and insured object types list in this endpoint.
|
|
923
|
-
* @type {
|
|
923
|
+
* @type {string}
|
|
924
924
|
* @memberof ProductsApiListProducts
|
|
925
925
|
*/
|
|
926
|
-
readonly expand?:
|
|
926
|
+
readonly expand?: string
|
|
927
927
|
|
|
928
928
|
/**
|
|
929
929
|
* 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.
|
|
930
|
-
* @type {
|
|
930
|
+
* @type {string}
|
|
931
931
|
* @memberof ProductsApiListProducts
|
|
932
932
|
*/
|
|
933
|
-
readonly filters?:
|
|
933
|
+
readonly filters?: string
|
|
934
934
|
}
|
|
935
935
|
|
|
936
936
|
/**
|
package/base.ts
CHANGED
|
@@ -44,9 +44,20 @@ export interface LoginClass {
|
|
|
44
44
|
permissions: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
export interface SwitchWorkspaceRequest {
|
|
48
|
+
username: string;
|
|
49
|
+
targetWorkspace: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface SwitchWorkspaceResponseClass {
|
|
53
|
+
accessToken: string;
|
|
54
|
+
permissions: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
export enum Environment {
|
|
48
58
|
Production = 'https://apiv2.emil.de',
|
|
49
59
|
Test = 'https://apiv2-test.emil.de',
|
|
60
|
+
Staging = 'https://apiv2-staging.emil.de',
|
|
50
61
|
Development = 'https://apiv2-dev.emil.de',
|
|
51
62
|
ProductionZurich = 'https://eu-central-2.apiv2.emil.de',
|
|
52
63
|
}
|
|
@@ -93,13 +104,13 @@ export class BaseAPI {
|
|
|
93
104
|
this.attachInterceptor(axios);
|
|
94
105
|
}
|
|
95
106
|
|
|
96
|
-
async initialize(env: Environment = Environment.Production) {
|
|
107
|
+
async initialize(env: Environment = Environment.Production, targetWorkspace?: string) {
|
|
97
108
|
this.configuration.basePath = env;
|
|
98
109
|
|
|
99
110
|
await this.loadCredentials();
|
|
100
111
|
|
|
101
112
|
if (this.username) {
|
|
102
|
-
await this.authorize(this.username, this.password);
|
|
113
|
+
await this.authorize(this.username, this.password, targetWorkspace);
|
|
103
114
|
this.password = null; // to avoid keeping password loaded in memory.
|
|
104
115
|
}
|
|
105
116
|
}
|
|
@@ -149,7 +160,7 @@ export class BaseAPI {
|
|
|
149
160
|
this.configuration.basePath = env;
|
|
150
161
|
}
|
|
151
162
|
|
|
152
|
-
async authorize(username: string, password: string): Promise<void> {
|
|
163
|
+
async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
|
|
153
164
|
const options: AxiosRequestConfig = {
|
|
154
165
|
method: 'POST',
|
|
155
166
|
url: `${this.configuration.basePath}/authservice/v1/login`,
|
|
@@ -169,6 +180,38 @@ export class BaseAPI {
|
|
|
169
180
|
|
|
170
181
|
const refreshToken = this.extractRefreshToken(response)
|
|
171
182
|
this.configuration.refreshToken = refreshToken;
|
|
183
|
+
|
|
184
|
+
// Switch workspace if provided
|
|
185
|
+
if (targetWorkspace) {
|
|
186
|
+
await this.switchWorkspace(targetWorkspace);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async switchWorkspace(targetWorkspace: string): Promise<void> {
|
|
191
|
+
const options: AxiosRequestConfig = {
|
|
192
|
+
method: 'POST',
|
|
193
|
+
url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
|
|
194
|
+
headers: {
|
|
195
|
+
'Content-Type': 'application/json',
|
|
196
|
+
'Authorization': `Bearer ${this.configuration.accessToken}`,
|
|
197
|
+
'Cookie': this.configuration.refreshToken,
|
|
198
|
+
},
|
|
199
|
+
data: {
|
|
200
|
+
username: this.configuration.username,
|
|
201
|
+
targetWorkspace,
|
|
202
|
+
} as SwitchWorkspaceRequest,
|
|
203
|
+
withCredentials: true,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
207
|
+
|
|
208
|
+
const { data: { accessToken } } = response;
|
|
209
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
210
|
+
|
|
211
|
+
const refreshToken = this.extractRefreshToken(response);
|
|
212
|
+
if (refreshToken) {
|
|
213
|
+
this.configuration.refreshToken = refreshToken;
|
|
214
|
+
}
|
|
172
215
|
}
|
|
173
216
|
|
|
174
217
|
async refreshTokenInternal(): Promise<string> {
|
|
@@ -224,7 +267,7 @@ export class BaseAPI {
|
|
|
224
267
|
const tokenString = await this.refreshTokenInternal();
|
|
225
268
|
const accessToken = `Bearer ${tokenString}`;
|
|
226
269
|
|
|
227
|
-
originalConfig.headers['Authorization'] =
|
|
270
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
228
271
|
|
|
229
272
|
this.configuration.accessToken = accessToken;
|
|
230
273
|
|
|
@@ -277,7 +320,7 @@ export class BaseAPI {
|
|
|
277
320
|
* @extends {Error}
|
|
278
321
|
*/
|
|
279
322
|
export class RequiredError extends Error {
|
|
280
|
-
name: "RequiredError" = "RequiredError";
|
|
323
|
+
override name: "RequiredError" = "RequiredError";
|
|
281
324
|
constructor(public field: string, msg?: string) {
|
|
282
325
|
super(msg);
|
|
283
326
|
}
|
package/common.ts
CHANGED
|
@@ -66,7 +66,7 @@ export const setBearerAuthToObject = async function (object: any, configuration?
|
|
|
66
66
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
67
67
|
? await configuration.accessToken()
|
|
68
68
|
: await configuration.accessToken;
|
|
69
|
-
object["Authorization"] =
|
|
69
|
+
object["Authorization"] = configuration.getBearerToken(accessToken);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -79,7 +79,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
|
|
|
79
79
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
80
80
|
? await configuration.accessToken(name, scopes)
|
|
81
81
|
: await configuration.accessToken;
|
|
82
|
-
object["Authorization"] =
|
|
82
|
+
object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
package/configuration.ts
CHANGED
|
@@ -106,4 +106,13 @@ export class Configuration {
|
|
|
106
106
|
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
107
107
|
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Returns "Bearer" token.
|
|
112
|
+
* @param token - access token.
|
|
113
|
+
* @return Bearer token.
|
|
114
|
+
*/
|
|
115
|
+
public getBearerToken(token?: string): string {
|
|
116
|
+
return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
|
|
117
|
+
}
|
|
109
118
|
}
|