@emilgroup/insurance-sdk-node 1.1.0 → 1.2.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 (73) hide show
  1. package/.openapi-generator/FILES +10 -1
  2. package/README.md +3 -3
  3. package/api/policies-api.ts +223 -0
  4. package/api/products-api.ts +144 -8
  5. package/base.ts +43 -5
  6. package/dist/api/policies-api.d.ts +122 -0
  7. package/dist/api/policies-api.js +191 -0
  8. package/dist/api/products-api.d.ts +82 -8
  9. package/dist/api/products-api.js +116 -8
  10. package/dist/base.d.ts +1 -0
  11. package/dist/base.js +35 -5
  12. package/dist/models/calculate-custom-premium-request-dto.d.ts +1 -0
  13. package/dist/models/calculate-custom-premium-request-dto.js +2 -1
  14. package/dist/models/calculate-premium-request-dto.d.ts +10 -3
  15. package/dist/models/create-account-request-dto.d.ts +6 -0
  16. package/dist/models/create-custom-application-request-dto.d.ts +1 -0
  17. package/dist/models/create-custom-application-request-dto.js +2 -1
  18. package/dist/models/create-dummy-policy-request-dto.d.ts +7 -0
  19. package/dist/models/create-lead-request-dto.d.ts +8 -1
  20. package/dist/models/create-policy-request-dto.d.ts +7 -0
  21. package/dist/models/create-product-field-request-dto.d.ts +6 -0
  22. package/dist/models/get-product-factors-for-version-request-dto.d.ts +36 -0
  23. package/dist/models/{grpc-create-policy-request-dto.js → get-product-factors-for-version-request-dto.js} +0 -0
  24. package/dist/models/get-product-factors-for-version-response-class.d.ts +25 -0
  25. package/dist/models/get-product-factors-for-version-response-class.js +15 -0
  26. package/dist/models/grpc-policy-object-dto.d.ts +30 -0
  27. package/dist/models/grpc-policy-object-dto.js +15 -0
  28. package/dist/models/grpc-update-policy-request-dto.d.ts +50 -0
  29. package/dist/models/grpc-update-policy-request-dto.js +15 -0
  30. package/dist/models/index.d.ts +10 -1
  31. package/dist/models/index.js +10 -1
  32. package/dist/models/policy-class.d.ts +6 -0
  33. package/dist/models/policy-premium-item-class.d.ts +6 -0
  34. package/dist/models/premium-override-dto.d.ts +53 -0
  35. package/dist/models/premium-override-dto.js +25 -0
  36. package/dist/models/premium-override-request-dto.d.ts +25 -0
  37. package/dist/models/premium-override-request-dto.js +15 -0
  38. package/dist/models/terminate-policy-request-dto.d.ts +24 -0
  39. package/dist/models/terminate-policy-request-dto.js +15 -0
  40. package/dist/models/terminate-policy-response-class.d.ts +25 -0
  41. package/dist/models/terminate-policy-response-class.js +15 -0
  42. package/dist/models/{grpc-create-policy-request-dto.d.ts → to-grpc-create-policy-request-dto.d.ts} +12 -5
  43. package/dist/models/to-grpc-create-policy-request-dto.js +15 -0
  44. package/dist/models/update-lead-request-dto.d.ts +7 -0
  45. package/dist/models/update-policy-request-dto.d.ts +7 -6
  46. package/dist/models/update-product-field-request-dto.d.ts +6 -0
  47. package/dist/models/withdraw-policy-response-class.d.ts +25 -0
  48. package/dist/models/withdraw-policy-response-class.js +15 -0
  49. package/models/calculate-custom-premium-request-dto.ts +2 -1
  50. package/models/calculate-premium-request-dto.ts +10 -3
  51. package/models/create-account-request-dto.ts +6 -0
  52. package/models/create-custom-application-request-dto.ts +2 -1
  53. package/models/create-dummy-policy-request-dto.ts +7 -0
  54. package/models/create-lead-request-dto.ts +8 -1
  55. package/models/create-policy-request-dto.ts +7 -0
  56. package/models/create-product-field-request-dto.ts +6 -0
  57. package/models/get-product-factors-for-version-request-dto.ts +42 -0
  58. package/models/get-product-factors-for-version-response-class.ts +31 -0
  59. package/models/grpc-policy-object-dto.ts +36 -0
  60. package/models/grpc-update-policy-request-dto.ts +56 -0
  61. package/models/index.ts +10 -1
  62. package/models/policy-class.ts +6 -0
  63. package/models/policy-premium-item-class.ts +6 -0
  64. package/models/premium-override-dto.ts +63 -0
  65. package/models/premium-override-request-dto.ts +31 -0
  66. package/models/terminate-policy-request-dto.ts +30 -0
  67. package/models/terminate-policy-response-class.ts +31 -0
  68. package/models/{grpc-create-policy-request-dto.ts → to-grpc-create-policy-request-dto.ts} +12 -5
  69. package/models/update-lead-request-dto.ts +7 -0
  70. package/models/update-policy-request-dto.ts +7 -6
  71. package/models/update-product-field-request-dto.ts +6 -0
  72. package/models/withdraw-policy-response-class.ts +31 -0
  73. package/package.json +4 -3
@@ -21,6 +21,7 @@ import { CreateProductResponseClass } from '../models';
21
21
  import { GetPremiumFormulaResponseClass } from '../models';
22
22
  import { GetProductFactorResponseClass } from '../models';
23
23
  import { GetProductFactorValueResponseClass } from '../models';
24
+ import { GetProductFactorsForVersionResponseClass } from '../models';
24
25
  import { GetProductFieldResponseClass } from '../models';
25
26
  import { GetProductResponseClass } from '../models';
26
27
  import { GetProductVersionResponseClass } from '../models';
@@ -142,6 +143,17 @@ export declare const ProductsApiAxiosParamCreator: (configuration?: Configuratio
142
143
  * @throws {RequiredError}
143
144
  */
144
145
  getProductFactorValue: (productVersionId: number, label: string, key: string, name: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
146
+ /**
147
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
148
+ * @summary Returns all product factors for the product version with all without values
149
+ * @param {number} productVersionId Product Version Id
150
+ * @param {string} values Which values to return for every factor (None or Short for short value lists only or All)
151
+ * @param {string} [authorization] Bearer Token
152
+ * @param {boolean} [forPublic] true if this is a call from PublivAPI or false otherwise (default)
153
+ * @param {*} [options] Override http request option.
154
+ * @throws {RequiredError}
155
+ */
156
+ getProductFactorsForVersion: (productVersionId: number, values: string, authorization?: string, forPublic?: boolean, options?: AxiosRequestConfig) => Promise<RequestArgs>;
145
157
  /**
146
158
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
147
159
  * @summary Retrieve the product field
@@ -232,7 +244,7 @@ export declare const ProductsApiAxiosParamCreator: (configuration?: Configuratio
232
244
  */
233
245
  listProducts: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
234
246
  /**
235
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
247
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
236
248
  * @summary Upload product factors
237
249
  * @param {string} [authorization] Bearer Token
238
250
  * @param {number} [productVersionId]
@@ -282,7 +294,7 @@ export declare const ProductsApiAxiosParamCreator: (configuration?: Configuratio
282
294
  */
283
295
  updateProductVersion: (id: number, updateProductVersionRequestDto: UpdateProductVersionRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
284
296
  /**
285
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
297
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
286
298
  * @summary Validate product factors
287
299
  * @param {string} [authorization] Bearer Token
288
300
  * @param {any} [factors]
@@ -394,6 +406,17 @@ export declare const ProductsApiFp: (configuration?: Configuration) => {
394
406
  * @throws {RequiredError}
395
407
  */
396
408
  getProductFactorValue(productVersionId: number, label: string, key: string, name: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductFactorValueResponseClass>>;
409
+ /**
410
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
411
+ * @summary Returns all product factors for the product version with all without values
412
+ * @param {number} productVersionId Product Version Id
413
+ * @param {string} values Which values to return for every factor (None or Short for short value lists only or All)
414
+ * @param {string} [authorization] Bearer Token
415
+ * @param {boolean} [forPublic] true if this is a call from PublivAPI or false otherwise (default)
416
+ * @param {*} [options] Override http request option.
417
+ * @throws {RequiredError}
418
+ */
419
+ getProductFactorsForVersion(productVersionId: number, values: string, authorization?: string, forPublic?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductFactorsForVersionResponseClass>>;
397
420
  /**
398
421
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
399
422
  * @summary Retrieve the product field
@@ -484,7 +507,7 @@ export declare const ProductsApiFp: (configuration?: Configuration) => {
484
507
  */
485
508
  listProducts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListProductsResponseClass>>;
486
509
  /**
487
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
510
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
488
511
  * @summary Upload product factors
489
512
  * @param {string} [authorization] Bearer Token
490
513
  * @param {number} [productVersionId]
@@ -534,7 +557,7 @@ export declare const ProductsApiFp: (configuration?: Configuration) => {
534
557
  */
535
558
  updateProductVersion(id: number, updateProductVersionRequestDto: UpdateProductVersionRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateProductVersionResponseClass>>;
536
559
  /**
537
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
560
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
538
561
  * @summary Validate product factors
539
562
  * @param {string} [authorization] Bearer Token
540
563
  * @param {any} [factors]
@@ -646,6 +669,17 @@ export declare const ProductsApiFactory: (configuration?: Configuration, basePat
646
669
  * @throws {RequiredError}
647
670
  */
648
671
  getProductFactorValue(productVersionId: number, label: string, key: string, name: string, authorization?: string, options?: any): AxiosPromise<GetProductFactorValueResponseClass>;
672
+ /**
673
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
674
+ * @summary Returns all product factors for the product version with all without values
675
+ * @param {number} productVersionId Product Version Id
676
+ * @param {string} values Which values to return for every factor (None or Short for short value lists only or All)
677
+ * @param {string} [authorization] Bearer Token
678
+ * @param {boolean} [forPublic] true if this is a call from PublivAPI or false otherwise (default)
679
+ * @param {*} [options] Override http request option.
680
+ * @throws {RequiredError}
681
+ */
682
+ getProductFactorsForVersion(productVersionId: number, values: string, authorization?: string, forPublic?: boolean, options?: any): AxiosPromise<GetProductFactorsForVersionResponseClass>;
649
683
  /**
650
684
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
651
685
  * @summary Retrieve the product field
@@ -736,7 +770,7 @@ export declare const ProductsApiFactory: (configuration?: Configuration, basePat
736
770
  */
737
771
  listProducts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListProductsResponseClass>;
738
772
  /**
739
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
773
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
740
774
  * @summary Upload product factors
741
775
  * @param {string} [authorization] Bearer Token
742
776
  * @param {number} [productVersionId]
@@ -786,7 +820,7 @@ export declare const ProductsApiFactory: (configuration?: Configuration, basePat
786
820
  */
787
821
  updateProductVersion(id: number, updateProductVersionRequestDto: UpdateProductVersionRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateProductVersionResponseClass>;
788
822
  /**
789
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
823
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
790
824
  * @summary Validate product factors
791
825
  * @param {string} [authorization] Bearer Token
792
826
  * @param {any} [factors]
@@ -1033,6 +1067,37 @@ export interface ProductsApiGetProductFactorValueRequest {
1033
1067
  */
1034
1068
  readonly authorization?: string;
1035
1069
  }
1070
+ /**
1071
+ * Request parameters for getProductFactorsForVersion operation in ProductsApi.
1072
+ * @export
1073
+ * @interface ProductsApiGetProductFactorsForVersionRequest
1074
+ */
1075
+ export interface ProductsApiGetProductFactorsForVersionRequest {
1076
+ /**
1077
+ * Product Version Id
1078
+ * @type {number}
1079
+ * @memberof ProductsApiGetProductFactorsForVersion
1080
+ */
1081
+ readonly productVersionId: number;
1082
+ /**
1083
+ * Which values to return for every factor (None or Short for short value lists only or All)
1084
+ * @type {string}
1085
+ * @memberof ProductsApiGetProductFactorsForVersion
1086
+ */
1087
+ readonly values: string;
1088
+ /**
1089
+ * Bearer Token
1090
+ * @type {string}
1091
+ * @memberof ProductsApiGetProductFactorsForVersion
1092
+ */
1093
+ readonly authorization?: string;
1094
+ /**
1095
+ * true if this is a call from PublivAPI or false otherwise (default)
1096
+ * @type {boolean}
1097
+ * @memberof ProductsApiGetProductFactorsForVersion
1098
+ */
1099
+ readonly forPublic?: boolean;
1100
+ }
1036
1101
  /**
1037
1102
  * Request parameters for getProductField operation in ProductsApi.
1038
1103
  * @export
@@ -1563,6 +1628,15 @@ export declare class ProductsApi extends BaseAPI {
1563
1628
  * @memberof ProductsApi
1564
1629
  */
1565
1630
  getProductFactorValue(requestParameters: ProductsApiGetProductFactorValueRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetProductFactorValueResponseClass, any>>;
1631
+ /**
1632
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
1633
+ * @summary Returns all product factors for the product version with all without values
1634
+ * @param {ProductsApiGetProductFactorsForVersionRequest} requestParameters Request parameters.
1635
+ * @param {*} [options] Override http request option.
1636
+ * @throws {RequiredError}
1637
+ * @memberof ProductsApi
1638
+ */
1639
+ getProductFactorsForVersion(requestParameters: ProductsApiGetProductFactorsForVersionRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetProductFactorsForVersionResponseClass, any>>;
1566
1640
  /**
1567
1641
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
1568
1642
  * @summary Retrieve the product field
@@ -1627,7 +1701,7 @@ export declare class ProductsApi extends BaseAPI {
1627
1701
  */
1628
1702
  listProducts(requestParameters?: ProductsApiListProductsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListProductsResponseClass, any>>;
1629
1703
  /**
1630
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
1704
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
1631
1705
  * @summary Upload product factors
1632
1706
  * @param {ProductsApiStoreProductFactorsRequest} requestParameters Request parameters.
1633
1707
  * @param {*} [options] Override http request option.
@@ -1672,7 +1746,7 @@ export declare class ProductsApi extends BaseAPI {
1672
1746
  */
1673
1747
  updateProductVersion(requestParameters: ProductsApiUpdateProductVersionRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateProductVersionResponseClass, any>>;
1674
1748
  /**
1675
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
1749
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
1676
1750
  * @summary Validate product factors
1677
1751
  * @param {ProductsApiValidateProductFactorsRequest} requestParameters Request parameters.
1678
1752
  * @param {*} [options] Override http request option.
@@ -625,6 +625,66 @@ var ProductsApiAxiosParamCreator = function (configuration) {
625
625
  });
626
626
  });
627
627
  },
628
+ /**
629
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
630
+ * @summary Returns all product factors for the product version with all without values
631
+ * @param {number} productVersionId Product Version Id
632
+ * @param {string} values Which values to return for every factor (None or Short for short value lists only or All)
633
+ * @param {string} [authorization] Bearer Token
634
+ * @param {boolean} [forPublic] true if this is a call from PublivAPI or false otherwise (default)
635
+ * @param {*} [options] Override http request option.
636
+ * @throws {RequiredError}
637
+ */
638
+ getProductFactorsForVersion: function (productVersionId, values, authorization, forPublic, options) {
639
+ if (options === void 0) { options = {}; }
640
+ return __awaiter(_this, void 0, void 0, function () {
641
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
642
+ return __generator(this, function (_a) {
643
+ switch (_a.label) {
644
+ case 0:
645
+ // verify required parameter 'productVersionId' is not null or undefined
646
+ (0, common_1.assertParamExists)('getProductFactorsForVersion', 'productVersionId', productVersionId);
647
+ // verify required parameter 'values' is not null or undefined
648
+ (0, common_1.assertParamExists)('getProductFactorsForVersion', 'values', values);
649
+ localVarPath = "/insuranceservice/v1/product-factors/for-version";
650
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
651
+ if (configuration) {
652
+ baseOptions = configuration.baseOptions;
653
+ baseAccessToken = configuration.accessToken;
654
+ }
655
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
656
+ localVarHeaderParameter = {};
657
+ localVarQueryParameter = {};
658
+ // authentication bearer required
659
+ // http bearer authentication required
660
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
661
+ case 1:
662
+ // authentication bearer required
663
+ // http bearer authentication required
664
+ _a.sent();
665
+ if (productVersionId !== undefined) {
666
+ localVarQueryParameter['productVersionId'] = productVersionId;
667
+ }
668
+ if (values !== undefined) {
669
+ localVarQueryParameter['values'] = values;
670
+ }
671
+ if (forPublic !== undefined) {
672
+ localVarQueryParameter['forPublic'] = forPublic;
673
+ }
674
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
675
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
676
+ }
677
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
678
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
679
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
680
+ return [2 /*return*/, {
681
+ url: (0, common_1.toPathString)(localVarUrlObj),
682
+ options: localVarRequestOptions,
683
+ }];
684
+ }
685
+ });
686
+ });
687
+ },
628
688
  /**
629
689
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
630
690
  * @summary Retrieve the product field
@@ -1068,7 +1128,7 @@ var ProductsApiAxiosParamCreator = function (configuration) {
1068
1128
  });
1069
1129
  },
1070
1130
  /**
1071
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
1131
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
1072
1132
  * @summary Upload product factors
1073
1133
  * @param {string} [authorization] Bearer Token
1074
1134
  * @param {number} [productVersionId]
@@ -1335,7 +1395,7 @@ var ProductsApiAxiosParamCreator = function (configuration) {
1335
1395
  });
1336
1396
  },
1337
1397
  /**
1338
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
1398
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
1339
1399
  * @summary Validate product factors
1340
1400
  * @param {string} [authorization] Bearer Token
1341
1401
  * @param {any} [factors]
@@ -1613,6 +1673,29 @@ var ProductsApiFp = function (configuration) {
1613
1673
  });
1614
1674
  });
1615
1675
  },
1676
+ /**
1677
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
1678
+ * @summary Returns all product factors for the product version with all without values
1679
+ * @param {number} productVersionId Product Version Id
1680
+ * @param {string} values Which values to return for every factor (None or Short for short value lists only or All)
1681
+ * @param {string} [authorization] Bearer Token
1682
+ * @param {boolean} [forPublic] true if this is a call from PublivAPI or false otherwise (default)
1683
+ * @param {*} [options] Override http request option.
1684
+ * @throws {RequiredError}
1685
+ */
1686
+ getProductFactorsForVersion: function (productVersionId, values, authorization, forPublic, options) {
1687
+ return __awaiter(this, void 0, void 0, function () {
1688
+ var localVarAxiosArgs;
1689
+ return __generator(this, function (_a) {
1690
+ switch (_a.label) {
1691
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getProductFactorsForVersion(productVersionId, values, authorization, forPublic, options)];
1692
+ case 1:
1693
+ localVarAxiosArgs = _a.sent();
1694
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
1695
+ }
1696
+ });
1697
+ });
1698
+ },
1616
1699
  /**
1617
1700
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
1618
1701
  * @summary Retrieve the product field
@@ -1787,7 +1870,7 @@ var ProductsApiFp = function (configuration) {
1787
1870
  });
1788
1871
  },
1789
1872
  /**
1790
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
1873
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
1791
1874
  * @summary Upload product factors
1792
1875
  * @param {string} [authorization] Bearer Token
1793
1876
  * @param {number} [productVersionId]
@@ -1897,7 +1980,7 @@ var ProductsApiFp = function (configuration) {
1897
1980
  });
1898
1981
  },
1899
1982
  /**
1900
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
1983
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
1901
1984
  * @summary Validate product factors
1902
1985
  * @param {string} [authorization] Bearer Token
1903
1986
  * @param {any} [factors]
@@ -2045,6 +2128,19 @@ var ProductsApiFactory = function (configuration, basePath, axios) {
2045
2128
  getProductFactorValue: function (productVersionId, label, key, name, authorization, options) {
2046
2129
  return localVarFp.getProductFactorValue(productVersionId, label, key, name, authorization, options).then(function (request) { return request(axios, basePath); });
2047
2130
  },
2131
+ /**
2132
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
2133
+ * @summary Returns all product factors for the product version with all without values
2134
+ * @param {number} productVersionId Product Version Id
2135
+ * @param {string} values Which values to return for every factor (None or Short for short value lists only or All)
2136
+ * @param {string} [authorization] Bearer Token
2137
+ * @param {boolean} [forPublic] true if this is a call from PublivAPI or false otherwise (default)
2138
+ * @param {*} [options] Override http request option.
2139
+ * @throws {RequiredError}
2140
+ */
2141
+ getProductFactorsForVersion: function (productVersionId, values, authorization, forPublic, options) {
2142
+ return localVarFp.getProductFactorsForVersion(productVersionId, values, authorization, forPublic, options).then(function (request) { return request(axios, basePath); });
2143
+ },
2048
2144
  /**
2049
2145
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
2050
2146
  * @summary Retrieve the product field
@@ -2149,7 +2245,7 @@ var ProductsApiFactory = function (configuration, basePath, axios) {
2149
2245
  return localVarFp.listProducts(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
2150
2246
  },
2151
2247
  /**
2152
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
2248
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
2153
2249
  * @summary Upload product factors
2154
2250
  * @param {string} [authorization] Bearer Token
2155
2251
  * @param {number} [productVersionId]
@@ -2209,7 +2305,7 @@ var ProductsApiFactory = function (configuration, basePath, axios) {
2209
2305
  return localVarFp.updateProductVersion(id, updateProductVersionRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
2210
2306
  },
2211
2307
  /**
2212
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
2308
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
2213
2309
  * @summary Validate product factors
2214
2310
  * @param {string} [authorization] Bearer Token
2215
2311
  * @param {any} [factors]
@@ -2353,6 +2449,18 @@ var ProductsApi = /** @class */ (function (_super) {
2353
2449
  var _this = this;
2354
2450
  return (0, exports.ProductsApiFp)(this.configuration).getProductFactorValue(requestParameters.productVersionId, requestParameters.label, requestParameters.key, requestParameters.name, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
2355
2451
  };
2452
+ /**
2453
+ * Returns product factors without values (values=none), or with values if their number less or equal to 200 (values=short), or with all values (values=all - this may take several seconds).
2454
+ * @summary Returns all product factors for the product version with all without values
2455
+ * @param {ProductsApiGetProductFactorsForVersionRequest} requestParameters Request parameters.
2456
+ * @param {*} [options] Override http request option.
2457
+ * @throws {RequiredError}
2458
+ * @memberof ProductsApi
2459
+ */
2460
+ ProductsApi.prototype.getProductFactorsForVersion = function (requestParameters, options) {
2461
+ var _this = this;
2462
+ return (0, exports.ProductsApiFp)(this.configuration).getProductFactorsForVersion(requestParameters.productVersionId, requestParameters.values, requestParameters.authorization, requestParameters.forPublic, options).then(function (request) { return request(_this.axios, _this.basePath); });
2463
+ };
2356
2464
  /**
2357
2465
  * Retrieves the details of the product field that was previously created. Supply the unique product field id that was returned when you created it and Emil Api will return the corresponding product field information.
2358
2466
  * @summary Retrieve the product field
@@ -2443,7 +2551,7 @@ var ProductsApi = /** @class */ (function (_super) {
2443
2551
  return (0, exports.ProductsApiFp)(this.configuration).listProducts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
2444
2552
  };
2445
2553
  /**
2446
- * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
2554
+ * Upload a CSV file containing product factors necessary for a product. The columns must be in the following order: group,label,key,name,value. It is advised to validate the file first.
2447
2555
  * @summary Upload product factors
2448
2556
  * @param {ProductsApiStoreProductFactorsRequest} requestParameters Request parameters.
2449
2557
  * @param {*} [options] Override http request option.
@@ -2504,7 +2612,7 @@ var ProductsApi = /** @class */ (function (_super) {
2504
2612
  return (0, exports.ProductsApiFp)(this.configuration).updateProductVersion(requestParameters.id, requestParameters.updateProductVersionRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
2505
2613
  };
2506
2614
  /**
2507
- * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
2615
+ * Validate a CSV file containing all product factors. The columns must be in the following order: group,label,key,name,value.
2508
2616
  * @summary Validate product factors
2509
2617
  * @param {ProductsApiValidateProductFactorsRequest} requestParameters Request parameters.
2510
2618
  * @param {*} [options] Override http request option.
package/dist/base.d.ts CHANGED
@@ -49,6 +49,7 @@ export declare class BaseAPI {
49
49
  protected basePath: string;
50
50
  protected axios: AxiosInstance;
51
51
  protected configuration: Configuration;
52
+ private lastRequestConfig?;
52
53
  private username?;
53
54
  private password?;
54
55
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
package/dist/base.js CHANGED
@@ -109,7 +109,7 @@ var axios_1 = __importDefault(require("axios"));
109
109
  var fs = __importStar(require("fs"));
110
110
  var path = __importStar(require("path"));
111
111
  var os = __importStar(require("os"));
112
- exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
112
+ exports.BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
113
113
  var CONFIG_DIRECTORY = '.emil';
114
114
  var CONFIG_FILENAME = 'credentials';
115
115
  var KEY_USERNAME = 'emil_username';
@@ -130,6 +130,7 @@ var Environment;
130
130
  Environment["Production"] = "https://apiv2.emil.de";
131
131
  Environment["Test"] = "https://apiv2-test.emil.de";
132
132
  })(Environment = exports.Environment || (exports.Environment = {}));
133
+ var NETWORK_ERROR_MESSAGE = "Network Error";
133
134
  /**
134
135
  *
135
136
  * @export
@@ -253,9 +254,9 @@ var BaseAPI = /** @class */ (function () {
253
254
  case 1:
254
255
  response = _a.sent();
255
256
  accessToken = response.data.accessToken;
256
- refreshToken = this.extractRefreshToken(response);
257
257
  this.configuration.username = username;
258
258
  this.configuration.accessToken = "Bearer ".concat(accessToken);
259
+ refreshToken = this.extractRefreshToken(response);
259
260
  this.configuration.refreshToken = refreshToken;
260
261
  return [2 /*return*/];
261
262
  }
@@ -302,10 +303,17 @@ var BaseAPI = /** @class */ (function () {
302
303
  };
303
304
  BaseAPI.prototype.attachInterceptor = function (axios) {
304
305
  var _this = this;
306
+ axios.interceptors.request.use(function (config) {
307
+ var _a;
308
+ if (((_a = config.url) === null || _a === void 0 ? void 0 : _a.indexOf('refresh-token')) === -1) {
309
+ _this.lastRequestConfig = config;
310
+ }
311
+ return config;
312
+ });
305
313
  axios.interceptors.response.use(function (res) {
306
314
  return res;
307
315
  }, function (err) { return __awaiter(_this, void 0, void 0, function () {
308
- var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1;
316
+ var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1, tokenString, accessToken, localVarHeaderParameter, _error_2;
309
317
  return __generator(this, function (_a) {
310
318
  switch (_a.label) {
311
319
  case 0:
@@ -335,8 +343,30 @@ var BaseAPI = /** @class */ (function () {
335
343
  if (err.response.status === 403 && err.response.data) {
336
344
  return [2 /*return*/, Promise.reject(err.response.data)];
337
345
  }
338
- _a.label = 5;
339
- case 5: return [2 /*return*/, Promise.reject(err)];
346
+ return [3 /*break*/, 9];
347
+ case 5:
348
+ if (!(err.message === NETWORK_ERROR_MESSAGE && !originalConfig._retry)) return [3 /*break*/, 9];
349
+ _a.label = 6;
350
+ case 6:
351
+ _a.trys.push([6, 8, , 9]);
352
+ return [4 /*yield*/, this.refreshToken()];
353
+ case 7:
354
+ tokenString = _a.sent();
355
+ accessToken = "Bearer ".concat(tokenString);
356
+ localVarHeaderParameter = {};
357
+ localVarHeaderParameter['Authorization'] = accessToken;
358
+ this.lastRequestConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
359
+ originalConfig = __assign({}, this.lastRequestConfig);
360
+ originalConfig._retry = true;
361
+ this.configuration.accessToken = accessToken;
362
+ return [2 /*return*/, axios(originalConfig)];
363
+ case 8:
364
+ _error_2 = _a.sent();
365
+ if (_error_2.response && _error_2.response.data) {
366
+ return [2 /*return*/, Promise.reject(_error_2.response.data)];
367
+ }
368
+ return [2 /*return*/, Promise.reject(_error_2)];
369
+ case 9: return [2 /*return*/, Promise.reject(err)];
340
370
  }
341
371
  });
342
372
  }); });
@@ -30,5 +30,6 @@ export interface CalculateCustomPremiumRequestDto {
30
30
  }
31
31
  export declare const CalculateCustomPremiumRequestDtoProviderEnum: {
32
32
  readonly Squarelife: "squarelife";
33
+ readonly Janitos: "janitos";
33
34
  };
34
35
  export declare type CalculateCustomPremiumRequestDtoProviderEnum = typeof CalculateCustomPremiumRequestDtoProviderEnum[keyof typeof CalculateCustomPremiumRequestDtoProviderEnum];
@@ -15,5 +15,6 @@
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.CalculateCustomPremiumRequestDtoProviderEnum = void 0;
17
17
  exports.CalculateCustomPremiumRequestDtoProviderEnum = {
18
- Squarelife: 'squarelife'
18
+ Squarelife: 'squarelife',
19
+ Janitos: 'janitos'
19
20
  };
@@ -9,7 +9,8 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { PolicyObjectDto } from './policy-object-dto';
12
+ import { GrpcPolicyObjectDto } from './grpc-policy-object-dto';
13
+ import { PremiumOverrideRequestDto } from './premium-override-request-dto';
13
14
  /**
14
15
  *
15
16
  * @export
@@ -24,8 +25,14 @@ export interface CalculatePremiumRequestDto {
24
25
  'productVersionId': number;
25
26
  /**
26
27
  * Policy Objects
27
- * @type {Array<PolicyObjectDto>}
28
+ * @type {Array<GrpcPolicyObjectDto>}
28
29
  * @memberof CalculatePremiumRequestDto
29
30
  */
30
- 'policyObjects': Array<PolicyObjectDto>;
31
+ 'policyObjects': Array<GrpcPolicyObjectDto>;
32
+ /**
33
+ * Premium Override request
34
+ * @type {Array<PremiumOverrideRequestDto>}
35
+ * @memberof CalculatePremiumRequestDto
36
+ */
37
+ 'premiumOverride'?: Array<PremiumOverrideRequestDto>;
31
38
  }
@@ -81,4 +81,10 @@ export interface CreateAccountRequestDto {
81
81
  * @memberof CreateAccountRequestDto
82
82
  */
83
83
  'accountNumber'?: string;
84
+ /**
85
+ * Optional custom fields for account
86
+ * @type {object}
87
+ * @memberof CreateAccountRequestDto
88
+ */
89
+ 'customFields'?: object;
84
90
  }
@@ -36,5 +36,6 @@ export interface CreateCustomApplicationRequestDto {
36
36
  }
37
37
  export declare const CreateCustomApplicationRequestDtoProviderEnum: {
38
38
  readonly Squarelife: "squarelife";
39
+ readonly Janitos: "janitos";
39
40
  };
40
41
  export declare type CreateCustomApplicationRequestDtoProviderEnum = typeof CreateCustomApplicationRequestDtoProviderEnum[keyof typeof CreateCustomApplicationRequestDtoProviderEnum];
@@ -15,5 +15,6 @@
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.CreateCustomApplicationRequestDtoProviderEnum = void 0;
17
17
  exports.CreateCustomApplicationRequestDtoProviderEnum = {
18
- Squarelife: 'squarelife'
18
+ Squarelife: 'squarelife',
19
+ Janitos: 'janitos'
19
20
  };
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import { PolicyObjectDto } from './policy-object-dto';
13
+ import { PremiumOverrideRequestDto } from './premium-override-request-dto';
13
14
  /**
14
15
  *
15
16
  * @export
@@ -28,4 +29,10 @@ export interface CreateDummyPolicyRequestDto {
28
29
  * @memberof CreateDummyPolicyRequestDto
29
30
  */
30
31
  'policyObjects': Array<PolicyObjectDto>;
32
+ /**
33
+ * Premium Override
34
+ * @type {Array<PremiumOverrideRequestDto>}
35
+ * @memberof CreateDummyPolicyRequestDto
36
+ */
37
+ 'premiumOverride'?: Array<PremiumOverrideRequestDto>;
31
38
  }
@@ -12,6 +12,7 @@
12
12
  import { CreateAccountRequestDto } from './create-account-request-dto';
13
13
  import { CreateBankAccountRequestDto } from './create-bank-account-request-dto';
14
14
  import { CreatePolicyRequestDto } from './create-policy-request-dto';
15
+ import { PremiumOverrideRequestDto } from './premium-override-request-dto';
15
16
  import { UploadedDocumentDto } from './uploaded-document-dto';
16
17
  /**
17
18
  *
@@ -19,6 +20,12 @@ import { UploadedDocumentDto } from './uploaded-document-dto';
19
20
  * @interface CreateLeadRequestDto
20
21
  */
21
22
  export interface CreateLeadRequestDto {
23
+ /**
24
+ * Premium Override
25
+ * @type {Array<PremiumOverrideRequestDto>}
26
+ * @memberof CreateLeadRequestDto
27
+ */
28
+ 'premiumOverride'?: Array<PremiumOverrideRequestDto>;
22
29
  /**
23
30
  *
24
31
  * @type {CreateAccountRequestDto}
@@ -36,7 +43,7 @@ export interface CreateLeadRequestDto {
36
43
  * @type {object}
37
44
  * @memberof CreateLeadRequestDto
38
45
  */
39
- 'customData': object;
46
+ 'customData'?: object;
40
47
  /**
41
48
  *
42
49
  * @type {string}
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import { PolicyObjectDto } from './policy-object-dto';
13
+ import { PremiumOverrideRequestDto } from './premium-override-request-dto';
13
14
  /**
14
15
  *
15
16
  * @export
@@ -34,4 +35,10 @@ export interface CreatePolicyRequestDto {
34
35
  * @memberof CreatePolicyRequestDto
35
36
  */
36
37
  'policyObjects': Array<PolicyObjectDto>;
38
+ /**
39
+ * Premium Override
40
+ * @type {Array<PremiumOverrideRequestDto>}
41
+ * @memberof CreatePolicyRequestDto
42
+ */
43
+ 'premiumOverride'?: Array<PremiumOverrideRequestDto>;
37
44
  }
@@ -105,6 +105,12 @@ export interface CreateProductFieldRequestDto {
105
105
  * @memberof CreateProductFieldRequestDto
106
106
  */
107
107
  'maxValue'?: object;
108
+ /**
109
+ * order index for the product field for display on the booking funnel, not defined for hidden fields
110
+ * @type {number}
111
+ * @memberof CreateProductFieldRequestDto
112
+ */
113
+ 'order'?: number;
108
114
  }
109
115
  export declare const CreateProductFieldRequestDtoTypeEntityEnum: {
110
116
  readonly SystemProductFieldType: "system_product_field_type";