@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.
- 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 +52 -3
- 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 +10 -1
- package/dist/base.js +46 -2
- 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@1.32.0 --save
|
|
20
|
+
npm install @emilgroup/public-api-sdk@1.32.1-beta.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/public-api-sdk@1.32.0
|
|
24
|
+
yarn add @emilgroup/public-api-sdk@1.32.1-beta.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `PublicApi`.
|
package/api/documents-api.ts
CHANGED
|
@@ -306,17 +306,17 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
306
306
|
* @summary List product documents
|
|
307
307
|
* @param {string} productCode
|
|
308
308
|
* @param {string} [authorization] Bearer Token
|
|
309
|
-
* @param {
|
|
310
|
-
* @param {
|
|
311
|
-
* @param {
|
|
312
|
-
* @param {
|
|
313
|
-
* @param {
|
|
314
|
-
* @param {
|
|
315
|
-
* @param {
|
|
309
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
310
|
+
* @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.
|
|
311
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
312
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
313
|
+
* @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.
|
|
314
|
+
* @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.
|
|
315
|
+
* @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.
|
|
316
316
|
* @param {*} [options] Override http request option.
|
|
317
317
|
* @throws {RequiredError}
|
|
318
318
|
*/
|
|
319
|
-
listProductDocuments: async (productCode: string, authorization?: string, pageSize?:
|
|
319
|
+
listProductDocuments: async (productCode: string, authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
320
320
|
// verify required parameter 'productCode' is not null or undefined
|
|
321
321
|
assertParamExists('listProductDocuments', 'productCode', productCode)
|
|
322
322
|
const localVarPath = `/publicapi/v1/documents/{productCode}`
|
|
@@ -510,17 +510,17 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
|
|
510
510
|
* @summary List product documents
|
|
511
511
|
* @param {string} productCode
|
|
512
512
|
* @param {string} [authorization] Bearer Token
|
|
513
|
-
* @param {
|
|
514
|
-
* @param {
|
|
515
|
-
* @param {
|
|
516
|
-
* @param {
|
|
517
|
-
* @param {
|
|
518
|
-
* @param {
|
|
519
|
-
* @param {
|
|
513
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
514
|
+
* @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.
|
|
515
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
516
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
517
|
+
* @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.
|
|
518
|
+
* @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.
|
|
519
|
+
* @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.
|
|
520
520
|
* @param {*} [options] Override http request option.
|
|
521
521
|
* @throws {RequiredError}
|
|
522
522
|
*/
|
|
523
|
-
async listProductDocuments(productCode: string, authorization?: string, pageSize?:
|
|
523
|
+
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>> {
|
|
524
524
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listProductDocuments(productCode, authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
525
525
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
526
526
|
},
|
|
@@ -613,17 +613,17 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
|
|
613
613
|
* @summary List product documents
|
|
614
614
|
* @param {string} productCode
|
|
615
615
|
* @param {string} [authorization] Bearer Token
|
|
616
|
-
* @param {
|
|
617
|
-
* @param {
|
|
618
|
-
* @param {
|
|
619
|
-
* @param {
|
|
620
|
-
* @param {
|
|
621
|
-
* @param {
|
|
622
|
-
* @param {
|
|
616
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
617
|
+
* @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.
|
|
618
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
619
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
620
|
+
* @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.
|
|
621
|
+
* @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.
|
|
622
|
+
* @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.
|
|
623
623
|
* @param {*} [options] Override http request option.
|
|
624
624
|
* @throws {RequiredError}
|
|
625
625
|
*/
|
|
626
|
-
listProductDocuments(productCode: string, authorization?: string, pageSize?:
|
|
626
|
+
listProductDocuments(productCode: string, authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListProductDocumentsResponseClass> {
|
|
627
627
|
return localVarFp.listProductDocuments(productCode, authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
628
628
|
},
|
|
629
629
|
/**
|
|
@@ -816,52 +816,52 @@ export interface DocumentsApiListProductDocumentsRequest {
|
|
|
816
816
|
|
|
817
817
|
/**
|
|
818
818
|
* A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
819
|
-
* @type {
|
|
819
|
+
* @type {number}
|
|
820
820
|
* @memberof DocumentsApiListProductDocuments
|
|
821
821
|
*/
|
|
822
|
-
readonly pageSize?:
|
|
822
|
+
readonly pageSize?: number
|
|
823
823
|
|
|
824
824
|
/**
|
|
825
|
-
* 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,
|
|
826
|
-
* @type {
|
|
825
|
+
* 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.
|
|
826
|
+
* @type {string}
|
|
827
827
|
* @memberof DocumentsApiListProductDocuments
|
|
828
828
|
*/
|
|
829
|
-
readonly pageToken?:
|
|
829
|
+
readonly pageToken?: string
|
|
830
830
|
|
|
831
831
|
/**
|
|
832
832
|
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
833
|
-
* @type {
|
|
833
|
+
* @type {string}
|
|
834
834
|
* @memberof DocumentsApiListProductDocuments
|
|
835
835
|
*/
|
|
836
|
-
readonly filter?:
|
|
836
|
+
readonly filter?: string
|
|
837
837
|
|
|
838
838
|
/**
|
|
839
839
|
* To search the list by any field, pass search=xxx to fetch the result.
|
|
840
|
-
* @type {
|
|
840
|
+
* @type {string}
|
|
841
841
|
* @memberof DocumentsApiListProductDocuments
|
|
842
842
|
*/
|
|
843
|
-
readonly search?:
|
|
843
|
+
readonly search?: string
|
|
844
844
|
|
|
845
845
|
/**
|
|
846
846
|
* 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.
|
|
847
|
-
* @type {
|
|
847
|
+
* @type {string}
|
|
848
848
|
* @memberof DocumentsApiListProductDocuments
|
|
849
849
|
*/
|
|
850
|
-
readonly order?:
|
|
850
|
+
readonly order?: string
|
|
851
851
|
|
|
852
852
|
/**
|
|
853
|
-
* 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
|
|
854
|
-
* @type {
|
|
853
|
+
* 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.
|
|
854
|
+
* @type {string}
|
|
855
855
|
* @memberof DocumentsApiListProductDocuments
|
|
856
856
|
*/
|
|
857
|
-
readonly expand?:
|
|
857
|
+
readonly expand?: string
|
|
858
858
|
|
|
859
859
|
/**
|
|
860
860
|
* 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.
|
|
861
|
-
* @type {
|
|
861
|
+
* @type {string}
|
|
862
862
|
* @memberof DocumentsApiListProductDocuments
|
|
863
863
|
*/
|
|
864
|
-
readonly filters?:
|
|
864
|
+
readonly filters?: string
|
|
865
865
|
}
|
|
866
866
|
|
|
867
867
|
/**
|
package/api/products-api.ts
CHANGED
|
@@ -392,17 +392,17 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
392
392
|
* 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.
|
|
393
393
|
* @summary List products
|
|
394
394
|
* @param {string} [authorization] Bearer Token
|
|
395
|
-
* @param {
|
|
396
|
-
* @param {
|
|
397
|
-
* @param {
|
|
398
|
-
* @param {
|
|
399
|
-
* @param {
|
|
400
|
-
* @param {
|
|
401
|
-
* @param {
|
|
395
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
396
|
+
* @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.
|
|
397
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
398
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
399
|
+
* @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.
|
|
400
|
+
* @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
|
|
401
|
+
* @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.
|
|
402
402
|
* @param {*} [options] Override http request option.
|
|
403
403
|
* @throws {RequiredError}
|
|
404
404
|
*/
|
|
405
|
-
listProducts: async (authorization?: string, pageSize?:
|
|
405
|
+
listProducts: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
406
406
|
const localVarPath = `/publicapi/v1/products`;
|
|
407
407
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
408
408
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -566,17 +566,17 @@ export const ProductsApiFp = function(configuration?: Configuration) {
|
|
|
566
566
|
* 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.
|
|
567
567
|
* @summary List products
|
|
568
568
|
* @param {string} [authorization] Bearer Token
|
|
569
|
-
* @param {
|
|
570
|
-
* @param {
|
|
571
|
-
* @param {
|
|
572
|
-
* @param {
|
|
573
|
-
* @param {
|
|
574
|
-
* @param {
|
|
575
|
-
* @param {
|
|
569
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
570
|
+
* @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.
|
|
571
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
572
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
573
|
+
* @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.
|
|
574
|
+
* @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
|
|
575
|
+
* @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.
|
|
576
576
|
* @param {*} [options] Override http request option.
|
|
577
577
|
* @throws {RequiredError}
|
|
578
578
|
*/
|
|
579
|
-
async listProducts(authorization?: string, pageSize?:
|
|
579
|
+
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>> {
|
|
580
580
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listProducts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
581
581
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
582
582
|
},
|
|
@@ -675,17 +675,17 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
|
|
|
675
675
|
* 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.
|
|
676
676
|
* @summary List products
|
|
677
677
|
* @param {string} [authorization] Bearer Token
|
|
678
|
-
* @param {
|
|
679
|
-
* @param {
|
|
680
|
-
* @param {
|
|
681
|
-
* @param {
|
|
682
|
-
* @param {
|
|
683
|
-
* @param {
|
|
684
|
-
* @param {
|
|
678
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
679
|
+
* @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.
|
|
680
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
681
|
+
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
682
|
+
* @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.
|
|
683
|
+
* @param {string} [expand] You can expand product versions and insured object types list in this endpoint.
|
|
684
|
+
* @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.
|
|
685
685
|
* @param {*} [options] Override http request option.
|
|
686
686
|
* @throws {RequiredError}
|
|
687
687
|
*/
|
|
688
|
-
listProducts(authorization?: string, pageSize?:
|
|
688
|
+
listProducts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListProductsResponseClass> {
|
|
689
689
|
return localVarFp.listProducts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
690
690
|
},
|
|
691
691
|
};
|
|
@@ -881,52 +881,52 @@ export interface ProductsApiListProductsRequest {
|
|
|
881
881
|
|
|
882
882
|
/**
|
|
883
883
|
* A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
884
|
-
* @type {
|
|
884
|
+
* @type {number}
|
|
885
885
|
* @memberof ProductsApiListProducts
|
|
886
886
|
*/
|
|
887
|
-
readonly pageSize?:
|
|
887
|
+
readonly pageSize?: number
|
|
888
888
|
|
|
889
889
|
/**
|
|
890
|
-
* 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,
|
|
891
|
-
* @type {
|
|
890
|
+
* 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.
|
|
891
|
+
* @type {string}
|
|
892
892
|
* @memberof ProductsApiListProducts
|
|
893
893
|
*/
|
|
894
|
-
readonly pageToken?:
|
|
894
|
+
readonly pageToken?: string
|
|
895
895
|
|
|
896
896
|
/**
|
|
897
897
|
* Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
|
|
898
|
-
* @type {
|
|
898
|
+
* @type {string}
|
|
899
899
|
* @memberof ProductsApiListProducts
|
|
900
900
|
*/
|
|
901
|
-
readonly filter?:
|
|
901
|
+
readonly filter?: string
|
|
902
902
|
|
|
903
903
|
/**
|
|
904
904
|
* To search the list by any field, pass search=xxx to fetch the result.
|
|
905
|
-
* @type {
|
|
905
|
+
* @type {string}
|
|
906
906
|
* @memberof ProductsApiListProducts
|
|
907
907
|
*/
|
|
908
|
-
readonly search?:
|
|
908
|
+
readonly search?: string
|
|
909
909
|
|
|
910
910
|
/**
|
|
911
911
|
* 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.
|
|
912
|
-
* @type {
|
|
912
|
+
* @type {string}
|
|
913
913
|
* @memberof ProductsApiListProducts
|
|
914
914
|
*/
|
|
915
|
-
readonly order?:
|
|
915
|
+
readonly order?: string
|
|
916
916
|
|
|
917
917
|
/**
|
|
918
918
|
* You can expand product versions and insured object types list in this endpoint.
|
|
919
|
-
* @type {
|
|
919
|
+
* @type {string}
|
|
920
920
|
* @memberof ProductsApiListProducts
|
|
921
921
|
*/
|
|
922
|
-
readonly expand?:
|
|
922
|
+
readonly expand?: string
|
|
923
923
|
|
|
924
924
|
/**
|
|
925
925
|
* 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.
|
|
926
|
-
* @type {
|
|
926
|
+
* @type {string}
|
|
927
927
|
* @memberof ProductsApiListProducts
|
|
928
928
|
*/
|
|
929
|
-
readonly filters?:
|
|
929
|
+
readonly filters?: string
|
|
930
930
|
}
|
|
931
931
|
|
|
932
932
|
/**
|
package/base.ts
CHANGED
|
@@ -37,6 +37,16 @@ export interface LoginClass {
|
|
|
37
37
|
permissions: string;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export interface SwitchWorkspaceRequest {
|
|
41
|
+
username: string;
|
|
42
|
+
targetWorkspace: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SwitchWorkspaceResponseClass {
|
|
46
|
+
accessToken: string;
|
|
47
|
+
permissions: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
export enum Environment {
|
|
41
51
|
Production = 'https://apiv2.emil.de',
|
|
42
52
|
Test = 'https://apiv2-test.emil.de',
|
|
@@ -87,9 +97,14 @@ export class BaseAPI {
|
|
|
87
97
|
this.loadTokenData();
|
|
88
98
|
|
|
89
99
|
if (configuration) {
|
|
100
|
+
const { accessToken } = this.tokenData;
|
|
90
101
|
this.configuration = configuration;
|
|
91
102
|
this.basePath = configuration.basePath || this.basePath;
|
|
92
|
-
|
|
103
|
+
|
|
104
|
+
// Use config token if provided, otherwise use tokenData token
|
|
105
|
+
const configToken = this.configuration.accessToken;
|
|
106
|
+
const storedToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
107
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
93
108
|
} else {
|
|
94
109
|
const { accessToken, username } = this.tokenData;
|
|
95
110
|
|
|
@@ -119,7 +134,7 @@ export class BaseAPI {
|
|
|
119
134
|
return this.tokenData.permissions.split(',');
|
|
120
135
|
}
|
|
121
136
|
|
|
122
|
-
async authorize(username: string, password: string): Promise<void> {
|
|
137
|
+
async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
|
|
123
138
|
const options: AxiosRequestConfig = {
|
|
124
139
|
method: 'POST',
|
|
125
140
|
url: `${this.configuration.basePath}/authservice/v1/login`,
|
|
@@ -141,6 +156,40 @@ export class BaseAPI {
|
|
|
141
156
|
this.tokenData.accessToken = accessToken;
|
|
142
157
|
this.tokenData.permissions = permissions;
|
|
143
158
|
|
|
159
|
+
// Switch workspace if provided
|
|
160
|
+
if (targetWorkspace) {
|
|
161
|
+
await this.switchWorkspace(targetWorkspace);
|
|
162
|
+
} else {
|
|
163
|
+
// Only store if no workspace switch (since switchWorkspace will store after switching)
|
|
164
|
+
this.storeTokenData({
|
|
165
|
+
...this.tokenData
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async switchWorkspace(targetWorkspace: string): Promise<void> {
|
|
171
|
+
const options: AxiosRequestConfig = {
|
|
172
|
+
method: 'POST',
|
|
173
|
+
url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
|
|
174
|
+
headers: {
|
|
175
|
+
'Content-Type': 'application/json',
|
|
176
|
+
'Authorization': `Bearer ${this.configuration.accessToken}`,
|
|
177
|
+
},
|
|
178
|
+
data: {
|
|
179
|
+
username: this.configuration.username,
|
|
180
|
+
targetWorkspace,
|
|
181
|
+
} as SwitchWorkspaceRequest,
|
|
182
|
+
withCredentials: true,
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
186
|
+
|
|
187
|
+
const { data: { accessToken, permissions } } = response;
|
|
188
|
+
|
|
189
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
190
|
+
this.tokenData.accessToken = accessToken;
|
|
191
|
+
this.tokenData.permissions = permissions;
|
|
192
|
+
|
|
144
193
|
this.storeTokenData({
|
|
145
194
|
...this.tokenData
|
|
146
195
|
});
|
|
@@ -270,7 +319,7 @@ export class BaseAPI {
|
|
|
270
319
|
* @extends {Error}
|
|
271
320
|
*/
|
|
272
321
|
export class RequiredError extends Error {
|
|
273
|
-
name: "RequiredError" = "RequiredError";
|
|
322
|
+
override name: "RequiredError" = "RequiredError";
|
|
274
323
|
constructor(public field: string, msg?: string) {
|
|
275
324
|
super(msg);
|
|
276
325
|
}
|
package/common.ts
CHANGED
|
@@ -65,7 +65,7 @@ export const setBearerAuthToObject = async function (object: any, configuration?
|
|
|
65
65
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
66
66
|
? await configuration.accessToken()
|
|
67
67
|
: await configuration.accessToken;
|
|
68
|
-
object["Authorization"] =
|
|
68
|
+
object["Authorization"] = configuration.getBearerToken(accessToken);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -78,7 +78,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
|
|
|
78
78
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
79
79
|
? await configuration.accessToken(name, scopes)
|
|
80
80
|
: await configuration.accessToken;
|
|
81
|
-
object["Authorization"] =
|
|
81
|
+
object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
package/configuration.ts
CHANGED
|
@@ -98,4 +98,13 @@ export class Configuration {
|
|
|
98
98
|
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
99
99
|
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Returns "Bearer" token.
|
|
104
|
+
* @param token - access token.
|
|
105
|
+
* @return Bearer token.
|
|
106
|
+
*/
|
|
107
|
+
public getBearerToken(token?: string): string {
|
|
108
|
+
return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
|
|
109
|
+
}
|
|
101
110
|
}
|