@emilgroup/customer-sdk-node 1.4.0 → 1.6.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 +9 -1
- package/README.md +2 -2
- package/api/customers-api.ts +353 -0
- package/base.ts +56 -13
- package/dist/api/customers-api.d.ts +205 -0
- package/dist/api/customers-api.js +271 -0
- package/dist/base.d.ts +1 -0
- package/dist/base.js +46 -8
- package/dist/models/account-class.d.ts +132 -0
- package/dist/models/{create-account-request-dto.js → account-class.js} +0 -6
- package/dist/models/create-customer-request-dto.d.ts +0 -7
- package/dist/models/create-customer-response-class.d.ts +3 -2
- package/dist/models/customer-class.d.ts +67 -0
- package/dist/models/customer-class.js +15 -0
- package/dist/models/customer-document-class.d.ts +99 -0
- package/dist/models/customer-document-class.js +36 -0
- package/dist/models/get-customer-document-download-url-response-class.d.ts +24 -0
- package/dist/models/get-customer-document-download-url-response-class.js +15 -0
- package/dist/models/get-customer-response-class.d.ts +3 -2
- package/dist/models/index.d.ts +9 -1
- package/dist/models/index.js +9 -1
- package/dist/models/invoice-class.d.ts +135 -0
- package/dist/models/invoice-class.js +28 -0
- package/dist/models/list-documents-response-class.d.ts +3 -2
- package/dist/models/list-invoices-response-class.d.ts +3 -2
- package/dist/models/reset-password-by-customer-request-dto.d.ts +1 -1
- package/dist/models/shared-invoice-item-class.d.ts +102 -0
- package/dist/models/shared-invoice-item-class.js +15 -0
- package/dist/models/terminate-customer-policy-request-dto.d.ts +24 -0
- package/dist/models/terminate-customer-policy-request-dto.js +15 -0
- package/dist/models/terminate-customer-policy-response-class.d.ts +25 -0
- package/dist/models/terminate-customer-policy-response-class.js +15 -0
- package/dist/models/update-account-request-dto.d.ts +10 -10
- package/dist/models/update-customer-response-class.d.ts +3 -2
- package/dist/models/withdraw-customer-policy-response-class.d.ts +25 -0
- package/dist/models/withdraw-customer-policy-response-class.js +15 -0
- package/models/account-class.ts +138 -0
- package/models/create-customer-request-dto.ts +0 -7
- package/models/create-customer-response-class.ts +3 -2
- package/models/customer-class.ts +73 -0
- package/models/customer-document-class.ts +108 -0
- package/models/get-customer-document-download-url-response-class.ts +30 -0
- package/models/get-customer-response-class.ts +3 -2
- package/models/index.ts +9 -1
- package/models/invoice-class.ts +145 -0
- package/models/list-documents-response-class.ts +3 -2
- package/models/list-invoices-response-class.ts +3 -2
- package/models/reset-password-by-customer-request-dto.ts +1 -1
- package/models/shared-invoice-item-class.ts +108 -0
- package/models/terminate-customer-policy-request-dto.ts +30 -0
- package/models/terminate-customer-policy-response-class.ts +31 -0
- package/models/update-account-request-dto.ts +10 -10
- package/models/update-customer-response-class.ts +3 -2
- package/models/withdraw-customer-policy-response-class.ts +31 -0
- package/package.json +1 -1
- package/dist/models/create-account-request-dto.d.ts +0 -102
- package/models/create-account-request-dto.ts +0 -111
|
@@ -208,6 +208,48 @@ var CustomersApiAxiosParamCreator = function (configuration) {
|
|
|
208
208
|
});
|
|
209
209
|
});
|
|
210
210
|
},
|
|
211
|
+
/**
|
|
212
|
+
* Get a presigned download url for document
|
|
213
|
+
* @summary Get a presigned download url for document
|
|
214
|
+
* @param {string} documentCode The document code
|
|
215
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
216
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
217
|
+
* @param {*} [options] Override http request option.
|
|
218
|
+
* @throws {RequiredError}
|
|
219
|
+
*/
|
|
220
|
+
getCustomerDocumentDownloadUrl: function (documentCode, customerCode, authorization, options) {
|
|
221
|
+
if (options === void 0) { options = {}; }
|
|
222
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
223
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
224
|
+
return __generator(this, function (_a) {
|
|
225
|
+
// verify required parameter 'documentCode' is not null or undefined
|
|
226
|
+
(0, common_1.assertParamExists)('getCustomerDocumentDownloadUrl', 'documentCode', documentCode);
|
|
227
|
+
// verify required parameter 'customerCode' is not null or undefined
|
|
228
|
+
(0, common_1.assertParamExists)('getCustomerDocumentDownloadUrl', 'customerCode', customerCode);
|
|
229
|
+
localVarPath = "/v1/customers/{customerCode}/documents/{documentCode}/download-url"
|
|
230
|
+
.replace("{".concat("documentCode", "}"), encodeURIComponent(String(documentCode)))
|
|
231
|
+
.replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
|
|
232
|
+
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
233
|
+
if (configuration) {
|
|
234
|
+
baseOptions = configuration.baseOptions;
|
|
235
|
+
baseAccessToken = configuration.accessToken;
|
|
236
|
+
}
|
|
237
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
238
|
+
localVarHeaderParameter = {};
|
|
239
|
+
localVarQueryParameter = {};
|
|
240
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
241
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
242
|
+
}
|
|
243
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
244
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
245
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
246
|
+
return [2 /*return*/, {
|
|
247
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
248
|
+
options: localVarRequestOptions,
|
|
249
|
+
}];
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
},
|
|
211
253
|
/**
|
|
212
254
|
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
213
255
|
* @summary Get policy details
|
|
@@ -709,6 +751,53 @@ var CustomersApiAxiosParamCreator = function (configuration) {
|
|
|
709
751
|
});
|
|
710
752
|
});
|
|
711
753
|
},
|
|
754
|
+
/**
|
|
755
|
+
* Request to terminate an existing policy by customer
|
|
756
|
+
* @summary Terminate a policy by customer
|
|
757
|
+
* @param {string} policyCode The policy code
|
|
758
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
759
|
+
* @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
|
|
760
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
761
|
+
* @param {*} [options] Override http request option.
|
|
762
|
+
* @throws {RequiredError}
|
|
763
|
+
*/
|
|
764
|
+
terminateCustomerPolicy: function (policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options) {
|
|
765
|
+
if (options === void 0) { options = {}; }
|
|
766
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
767
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
768
|
+
return __generator(this, function (_a) {
|
|
769
|
+
// verify required parameter 'policyCode' is not null or undefined
|
|
770
|
+
(0, common_1.assertParamExists)('terminateCustomerPolicy', 'policyCode', policyCode);
|
|
771
|
+
// verify required parameter 'customerCode' is not null or undefined
|
|
772
|
+
(0, common_1.assertParamExists)('terminateCustomerPolicy', 'customerCode', customerCode);
|
|
773
|
+
// verify required parameter 'terminateCustomerPolicyRequestDto' is not null or undefined
|
|
774
|
+
(0, common_1.assertParamExists)('terminateCustomerPolicy', 'terminateCustomerPolicyRequestDto', terminateCustomerPolicyRequestDto);
|
|
775
|
+
localVarPath = "/v1/customers/{customerCode}/policies/{policyCode}/terminate"
|
|
776
|
+
.replace("{".concat("policyCode", "}"), encodeURIComponent(String(policyCode)))
|
|
777
|
+
.replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
|
|
778
|
+
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
779
|
+
if (configuration) {
|
|
780
|
+
baseOptions = configuration.baseOptions;
|
|
781
|
+
baseAccessToken = configuration.accessToken;
|
|
782
|
+
}
|
|
783
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
784
|
+
localVarHeaderParameter = {};
|
|
785
|
+
localVarQueryParameter = {};
|
|
786
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
787
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
788
|
+
}
|
|
789
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
790
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
791
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
792
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
793
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(terminateCustomerPolicyRequestDto, localVarRequestOptions, configuration);
|
|
794
|
+
return [2 /*return*/, {
|
|
795
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
796
|
+
options: localVarRequestOptions,
|
|
797
|
+
}];
|
|
798
|
+
});
|
|
799
|
+
});
|
|
800
|
+
},
|
|
712
801
|
/**
|
|
713
802
|
* Update customer details like phone, email, names, addresses etc
|
|
714
803
|
* @summary Update customer details
|
|
@@ -824,6 +913,48 @@ var CustomersApiAxiosParamCreator = function (configuration) {
|
|
|
824
913
|
});
|
|
825
914
|
});
|
|
826
915
|
},
|
|
916
|
+
/**
|
|
917
|
+
* Withdraw policy by customer
|
|
918
|
+
* @summary Withdraw policy by customer
|
|
919
|
+
* @param {string} policyCode The policy code
|
|
920
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
921
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
922
|
+
* @param {*} [options] Override http request option.
|
|
923
|
+
* @throws {RequiredError}
|
|
924
|
+
*/
|
|
925
|
+
withdrawCustomerPolicy: function (policyCode, customerCode, authorization, options) {
|
|
926
|
+
if (options === void 0) { options = {}; }
|
|
927
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
928
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
929
|
+
return __generator(this, function (_a) {
|
|
930
|
+
// verify required parameter 'policyCode' is not null or undefined
|
|
931
|
+
(0, common_1.assertParamExists)('withdrawCustomerPolicy', 'policyCode', policyCode);
|
|
932
|
+
// verify required parameter 'customerCode' is not null or undefined
|
|
933
|
+
(0, common_1.assertParamExists)('withdrawCustomerPolicy', 'customerCode', customerCode);
|
|
934
|
+
localVarPath = "/v1/customers/{customerCode}/policies/{policyCode}/withdraw"
|
|
935
|
+
.replace("{".concat("policyCode", "}"), encodeURIComponent(String(policyCode)))
|
|
936
|
+
.replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
|
|
937
|
+
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
938
|
+
if (configuration) {
|
|
939
|
+
baseOptions = configuration.baseOptions;
|
|
940
|
+
baseAccessToken = configuration.accessToken;
|
|
941
|
+
}
|
|
942
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
943
|
+
localVarHeaderParameter = {};
|
|
944
|
+
localVarQueryParameter = {};
|
|
945
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
946
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
947
|
+
}
|
|
948
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
949
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
950
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
951
|
+
return [2 /*return*/, {
|
|
952
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
953
|
+
options: localVarRequestOptions,
|
|
954
|
+
}];
|
|
955
|
+
});
|
|
956
|
+
});
|
|
957
|
+
},
|
|
827
958
|
};
|
|
828
959
|
};
|
|
829
960
|
exports.CustomersApiAxiosParamCreator = CustomersApiAxiosParamCreator;
|
|
@@ -896,6 +1027,28 @@ var CustomersApiFp = function (configuration) {
|
|
|
896
1027
|
});
|
|
897
1028
|
});
|
|
898
1029
|
},
|
|
1030
|
+
/**
|
|
1031
|
+
* Get a presigned download url for document
|
|
1032
|
+
* @summary Get a presigned download url for document
|
|
1033
|
+
* @param {string} documentCode The document code
|
|
1034
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
1035
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1036
|
+
* @param {*} [options] Override http request option.
|
|
1037
|
+
* @throws {RequiredError}
|
|
1038
|
+
*/
|
|
1039
|
+
getCustomerDocumentDownloadUrl: function (documentCode, customerCode, authorization, options) {
|
|
1040
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1041
|
+
var localVarAxiosArgs;
|
|
1042
|
+
return __generator(this, function (_a) {
|
|
1043
|
+
switch (_a.label) {
|
|
1044
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getCustomerDocumentDownloadUrl(documentCode, customerCode, authorization, options)];
|
|
1045
|
+
case 1:
|
|
1046
|
+
localVarAxiosArgs = _a.sent();
|
|
1047
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
});
|
|
1051
|
+
},
|
|
899
1052
|
/**
|
|
900
1053
|
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
901
1054
|
* @summary Get policy details
|
|
@@ -1146,6 +1299,29 @@ var CustomersApiFp = function (configuration) {
|
|
|
1146
1299
|
});
|
|
1147
1300
|
});
|
|
1148
1301
|
},
|
|
1302
|
+
/**
|
|
1303
|
+
* Request to terminate an existing policy by customer
|
|
1304
|
+
* @summary Terminate a policy by customer
|
|
1305
|
+
* @param {string} policyCode The policy code
|
|
1306
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
1307
|
+
* @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
|
|
1308
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1309
|
+
* @param {*} [options] Override http request option.
|
|
1310
|
+
* @throws {RequiredError}
|
|
1311
|
+
*/
|
|
1312
|
+
terminateCustomerPolicy: function (policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options) {
|
|
1313
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1314
|
+
var localVarAxiosArgs;
|
|
1315
|
+
return __generator(this, function (_a) {
|
|
1316
|
+
switch (_a.label) {
|
|
1317
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.terminateCustomerPolicy(policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options)];
|
|
1318
|
+
case 1:
|
|
1319
|
+
localVarAxiosArgs = _a.sent();
|
|
1320
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
1321
|
+
}
|
|
1322
|
+
});
|
|
1323
|
+
});
|
|
1324
|
+
},
|
|
1149
1325
|
/**
|
|
1150
1326
|
* Update customer details like phone, email, names, addresses etc
|
|
1151
1327
|
* @summary Update customer details
|
|
@@ -1208,6 +1384,28 @@ var CustomersApiFp = function (configuration) {
|
|
|
1208
1384
|
});
|
|
1209
1385
|
});
|
|
1210
1386
|
},
|
|
1387
|
+
/**
|
|
1388
|
+
* Withdraw policy by customer
|
|
1389
|
+
* @summary Withdraw policy by customer
|
|
1390
|
+
* @param {string} policyCode The policy code
|
|
1391
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
1392
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1393
|
+
* @param {*} [options] Override http request option.
|
|
1394
|
+
* @throws {RequiredError}
|
|
1395
|
+
*/
|
|
1396
|
+
withdrawCustomerPolicy: function (policyCode, customerCode, authorization, options) {
|
|
1397
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1398
|
+
var localVarAxiosArgs;
|
|
1399
|
+
return __generator(this, function (_a) {
|
|
1400
|
+
switch (_a.label) {
|
|
1401
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.withdrawCustomerPolicy(policyCode, customerCode, authorization, options)];
|
|
1402
|
+
case 1:
|
|
1403
|
+
localVarAxiosArgs = _a.sent();
|
|
1404
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
1405
|
+
}
|
|
1406
|
+
});
|
|
1407
|
+
});
|
|
1408
|
+
},
|
|
1211
1409
|
};
|
|
1212
1410
|
};
|
|
1213
1411
|
exports.CustomersApiFp = CustomersApiFp;
|
|
@@ -1250,6 +1448,18 @@ var CustomersApiFactory = function (configuration, basePath, axios) {
|
|
|
1250
1448
|
getCustomer: function (customerCode, expand, authorization, options) {
|
|
1251
1449
|
return localVarFp.getCustomer(customerCode, expand, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1252
1450
|
},
|
|
1451
|
+
/**
|
|
1452
|
+
* Get a presigned download url for document
|
|
1453
|
+
* @summary Get a presigned download url for document
|
|
1454
|
+
* @param {string} documentCode The document code
|
|
1455
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
1456
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1457
|
+
* @param {*} [options] Override http request option.
|
|
1458
|
+
* @throws {RequiredError}
|
|
1459
|
+
*/
|
|
1460
|
+
getCustomerDocumentDownloadUrl: function (documentCode, customerCode, authorization, options) {
|
|
1461
|
+
return localVarFp.getCustomerDocumentDownloadUrl(documentCode, customerCode, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1462
|
+
},
|
|
1253
1463
|
/**
|
|
1254
1464
|
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
1255
1465
|
* @summary Get policy details
|
|
@@ -1390,6 +1600,19 @@ var CustomersApiFactory = function (configuration, basePath, axios) {
|
|
|
1390
1600
|
respondToAuthChallenge: function (respondToAuthChallengeRequestDto, options) {
|
|
1391
1601
|
return localVarFp.respondToAuthChallenge(respondToAuthChallengeRequestDto, options).then(function (request) { return request(axios, basePath); });
|
|
1392
1602
|
},
|
|
1603
|
+
/**
|
|
1604
|
+
* Request to terminate an existing policy by customer
|
|
1605
|
+
* @summary Terminate a policy by customer
|
|
1606
|
+
* @param {string} policyCode The policy code
|
|
1607
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
1608
|
+
* @param {TerminateCustomerPolicyRequestDto} terminateCustomerPolicyRequestDto
|
|
1609
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1610
|
+
* @param {*} [options] Override http request option.
|
|
1611
|
+
* @throws {RequiredError}
|
|
1612
|
+
*/
|
|
1613
|
+
terminateCustomerPolicy: function (policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options) {
|
|
1614
|
+
return localVarFp.terminateCustomerPolicy(policyCode, customerCode, terminateCustomerPolicyRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1615
|
+
},
|
|
1393
1616
|
/**
|
|
1394
1617
|
* Update customer details like phone, email, names, addresses etc
|
|
1395
1618
|
* @summary Update customer details
|
|
@@ -1422,6 +1645,18 @@ var CustomersApiFactory = function (configuration, basePath, axios) {
|
|
|
1422
1645
|
verifyResetPasswordToken: function (resetToken, options) {
|
|
1423
1646
|
return localVarFp.verifyResetPasswordToken(resetToken, options).then(function (request) { return request(axios, basePath); });
|
|
1424
1647
|
},
|
|
1648
|
+
/**
|
|
1649
|
+
* Withdraw policy by customer
|
|
1650
|
+
* @summary Withdraw policy by customer
|
|
1651
|
+
* @param {string} policyCode The policy code
|
|
1652
|
+
* @param {string} customerCode The customer code or \"me\" for the currently logged in customer
|
|
1653
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1654
|
+
* @param {*} [options] Override http request option.
|
|
1655
|
+
* @throws {RequiredError}
|
|
1656
|
+
*/
|
|
1657
|
+
withdrawCustomerPolicy: function (policyCode, customerCode, authorization, options) {
|
|
1658
|
+
return localVarFp.withdrawCustomerPolicy(policyCode, customerCode, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1659
|
+
},
|
|
1425
1660
|
};
|
|
1426
1661
|
};
|
|
1427
1662
|
exports.CustomersApiFactory = CustomersApiFactory;
|
|
@@ -1472,6 +1707,18 @@ var CustomersApi = /** @class */ (function (_super) {
|
|
|
1472
1707
|
var _this = this;
|
|
1473
1708
|
return (0, exports.CustomersApiFp)(this.configuration).getCustomer(requestParameters.customerCode, requestParameters.expand, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1474
1709
|
};
|
|
1710
|
+
/**
|
|
1711
|
+
* Get a presigned download url for document
|
|
1712
|
+
* @summary Get a presigned download url for document
|
|
1713
|
+
* @param {CustomersApiGetCustomerDocumentDownloadUrlRequest} requestParameters Request parameters.
|
|
1714
|
+
* @param {*} [options] Override http request option.
|
|
1715
|
+
* @throws {RequiredError}
|
|
1716
|
+
* @memberof CustomersApi
|
|
1717
|
+
*/
|
|
1718
|
+
CustomersApi.prototype.getCustomerDocumentDownloadUrl = function (requestParameters, options) {
|
|
1719
|
+
var _this = this;
|
|
1720
|
+
return (0, exports.CustomersApiFp)(this.configuration).getCustomerDocumentDownloadUrl(requestParameters.documentCode, requestParameters.customerCode, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1721
|
+
};
|
|
1475
1722
|
/**
|
|
1476
1723
|
* Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
|
|
1477
1724
|
* @summary Get policy details
|
|
@@ -1604,6 +1851,18 @@ var CustomersApi = /** @class */ (function (_super) {
|
|
|
1604
1851
|
var _this = this;
|
|
1605
1852
|
return (0, exports.CustomersApiFp)(this.configuration).respondToAuthChallenge(requestParameters.respondToAuthChallengeRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1606
1853
|
};
|
|
1854
|
+
/**
|
|
1855
|
+
* Request to terminate an existing policy by customer
|
|
1856
|
+
* @summary Terminate a policy by customer
|
|
1857
|
+
* @param {CustomersApiTerminateCustomerPolicyRequest} requestParameters Request parameters.
|
|
1858
|
+
* @param {*} [options] Override http request option.
|
|
1859
|
+
* @throws {RequiredError}
|
|
1860
|
+
* @memberof CustomersApi
|
|
1861
|
+
*/
|
|
1862
|
+
CustomersApi.prototype.terminateCustomerPolicy = function (requestParameters, options) {
|
|
1863
|
+
var _this = this;
|
|
1864
|
+
return (0, exports.CustomersApiFp)(this.configuration).terminateCustomerPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.terminateCustomerPolicyRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1865
|
+
};
|
|
1607
1866
|
/**
|
|
1608
1867
|
* Update customer details like phone, email, names, addresses etc
|
|
1609
1868
|
* @summary Update customer details
|
|
@@ -1640,6 +1899,18 @@ var CustomersApi = /** @class */ (function (_super) {
|
|
|
1640
1899
|
var _this = this;
|
|
1641
1900
|
return (0, exports.CustomersApiFp)(this.configuration).verifyResetPasswordToken(requestParameters.resetToken, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1642
1901
|
};
|
|
1902
|
+
/**
|
|
1903
|
+
* Withdraw policy by customer
|
|
1904
|
+
* @summary Withdraw policy by customer
|
|
1905
|
+
* @param {CustomersApiWithdrawCustomerPolicyRequest} requestParameters Request parameters.
|
|
1906
|
+
* @param {*} [options] Override http request option.
|
|
1907
|
+
* @throws {RequiredError}
|
|
1908
|
+
* @memberof CustomersApi
|
|
1909
|
+
*/
|
|
1910
|
+
CustomersApi.prototype.withdrawCustomerPolicy = function (requestParameters, options) {
|
|
1911
|
+
var _this = this;
|
|
1912
|
+
return (0, exports.CustomersApiFp)(this.configuration).withdrawCustomerPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1913
|
+
};
|
|
1643
1914
|
return CustomersApi;
|
|
1644
1915
|
}(base_1.BaseAPI));
|
|
1645
1916
|
exports.CustomersApi = CustomersApi;
|
package/dist/base.d.ts
CHANGED
package/dist/base.js
CHANGED
|
@@ -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
|
|
@@ -254,9 +255,9 @@ var BaseAPI = /** @class */ (function () {
|
|
|
254
255
|
case 1:
|
|
255
256
|
response = _a.sent();
|
|
256
257
|
accessToken = response.data.accessToken;
|
|
257
|
-
refreshToken = this.extractRefreshToken(response);
|
|
258
258
|
this.configuration.username = username;
|
|
259
259
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
260
|
+
refreshToken = this.extractRefreshToken(response);
|
|
260
261
|
this.configuration.refreshToken = refreshToken;
|
|
261
262
|
return [2 /*return*/];
|
|
262
263
|
}
|
|
@@ -288,12 +289,12 @@ var BaseAPI = /** @class */ (function () {
|
|
|
288
289
|
response = _a.sent();
|
|
289
290
|
if (response.data.authenticationResult) {
|
|
290
291
|
accessToken = response.data.authenticationResult.accessToken;
|
|
291
|
-
refreshToken = this.extractRefreshToken(response);
|
|
292
292
|
this.configuration.username = username;
|
|
293
293
|
this.configuration.tenantSlug = tenantSlug;
|
|
294
294
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
295
|
-
this.configuration.refreshToken = refreshToken;
|
|
296
295
|
this.isCustomerToken = true;
|
|
296
|
+
refreshToken = this.extractRefreshToken(response);
|
|
297
|
+
this.configuration.refreshToken = refreshToken;
|
|
297
298
|
}
|
|
298
299
|
return [2 /*return*/, response];
|
|
299
300
|
}
|
|
@@ -318,10 +319,10 @@ var BaseAPI = /** @class */ (function () {
|
|
|
318
319
|
response = _a.sent();
|
|
319
320
|
if (response.data.authenticationResult) {
|
|
320
321
|
accessToken = response.data.authenticationResult.accessToken;
|
|
321
|
-
refreshToken = this.extractRefreshToken(response);
|
|
322
322
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
323
|
-
this.configuration.refreshToken = refreshToken;
|
|
324
323
|
this.isCustomerToken = true;
|
|
324
|
+
refreshToken = this.extractRefreshToken(response);
|
|
325
|
+
this.configuration.refreshToken = refreshToken;
|
|
325
326
|
}
|
|
326
327
|
return [2 /*return*/, response];
|
|
327
328
|
}
|
|
@@ -393,10 +394,17 @@ var BaseAPI = /** @class */ (function () {
|
|
|
393
394
|
};
|
|
394
395
|
BaseAPI.prototype.attachInterceptor = function (axios) {
|
|
395
396
|
var _this = this;
|
|
397
|
+
axios.interceptors.request.use(function (config) {
|
|
398
|
+
var _a;
|
|
399
|
+
if (((_a = config.url) === null || _a === void 0 ? void 0 : _a.indexOf('refresh-token')) === -1) {
|
|
400
|
+
_this.lastRequestConfig = config;
|
|
401
|
+
}
|
|
402
|
+
return config;
|
|
403
|
+
});
|
|
396
404
|
axios.interceptors.response.use(function (res) {
|
|
397
405
|
return res;
|
|
398
406
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
399
|
-
var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1;
|
|
407
|
+
var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1, tokenString, accessToken, localVarHeaderParameter, _error_2;
|
|
400
408
|
return __generator(this, function (_a) {
|
|
401
409
|
switch (_a.label) {
|
|
402
410
|
case 0:
|
|
@@ -434,8 +442,38 @@ var BaseAPI = /** @class */ (function () {
|
|
|
434
442
|
if (err.response.status === 403 && err.response.data) {
|
|
435
443
|
return [2 /*return*/, Promise.reject(err.response.data)];
|
|
436
444
|
}
|
|
437
|
-
|
|
438
|
-
case 8:
|
|
445
|
+
return [3 /*break*/, 15];
|
|
446
|
+
case 8:
|
|
447
|
+
if (!(err.message === NETWORK_ERROR_MESSAGE && !originalConfig._retry)) return [3 /*break*/, 15];
|
|
448
|
+
_a.label = 9;
|
|
449
|
+
case 9:
|
|
450
|
+
_a.trys.push([9, 14, , 15]);
|
|
451
|
+
tokenString = void 0;
|
|
452
|
+
if (!this.isCustomerToken) return [3 /*break*/, 11];
|
|
453
|
+
return [4 /*yield*/, this.refreshTokenCustomer()];
|
|
454
|
+
case 10:
|
|
455
|
+
tokenString = _a.sent();
|
|
456
|
+
return [3 /*break*/, 13];
|
|
457
|
+
case 11: return [4 /*yield*/, this.refreshTokenTenant()];
|
|
458
|
+
case 12:
|
|
459
|
+
tokenString = _a.sent();
|
|
460
|
+
_a.label = 13;
|
|
461
|
+
case 13:
|
|
462
|
+
accessToken = "Bearer ".concat(tokenString);
|
|
463
|
+
localVarHeaderParameter = {};
|
|
464
|
+
localVarHeaderParameter['Authorization'] = accessToken;
|
|
465
|
+
this.lastRequestConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
|
|
466
|
+
originalConfig = __assign({}, this.lastRequestConfig);
|
|
467
|
+
originalConfig._retry = true;
|
|
468
|
+
this.configuration.accessToken = accessToken;
|
|
469
|
+
return [2 /*return*/, axios(originalConfig)];
|
|
470
|
+
case 14:
|
|
471
|
+
_error_2 = _a.sent();
|
|
472
|
+
if (_error_2.response && _error_2.response.data) {
|
|
473
|
+
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
474
|
+
}
|
|
475
|
+
return [2 /*return*/, Promise.reject(_error_2)];
|
|
476
|
+
case 15: return [2 /*return*/, Promise.reject(err)];
|
|
439
477
|
}
|
|
440
478
|
});
|
|
441
479
|
}); });
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL CustomerService
|
|
3
|
+
* The EMIL CustomerService API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AccountClass
|
|
16
|
+
*/
|
|
17
|
+
export interface AccountClass {
|
|
18
|
+
/**
|
|
19
|
+
* Internal unique identifier for the object. You should not have to use this, use code instead.
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof AccountClass
|
|
22
|
+
*/
|
|
23
|
+
'id': number;
|
|
24
|
+
/**
|
|
25
|
+
* Unique identifier for the object.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof AccountClass
|
|
28
|
+
*/
|
|
29
|
+
'code': string;
|
|
30
|
+
/**
|
|
31
|
+
* Optional field in order to use a specific account number.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof AccountClass
|
|
34
|
+
*/
|
|
35
|
+
'accountNumber': string;
|
|
36
|
+
/**
|
|
37
|
+
* The account\'s first name.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AccountClass
|
|
40
|
+
*/
|
|
41
|
+
'firstName': string;
|
|
42
|
+
/**
|
|
43
|
+
* The account\'s last name.
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof AccountClass
|
|
46
|
+
*/
|
|
47
|
+
'lastName': string;
|
|
48
|
+
/**
|
|
49
|
+
* The account\'s email address, It is displayed alongside the account in your dashboard and can be useful for searching and tracking.
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof AccountClass
|
|
52
|
+
*/
|
|
53
|
+
'email': string;
|
|
54
|
+
/**
|
|
55
|
+
* The account\'s gender.
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof AccountClass
|
|
58
|
+
*/
|
|
59
|
+
'gender': string;
|
|
60
|
+
/**
|
|
61
|
+
* The account\'s street name.
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof AccountClass
|
|
64
|
+
*/
|
|
65
|
+
'street': string;
|
|
66
|
+
/**
|
|
67
|
+
* The account\'s house number.
|
|
68
|
+
* @type {string}
|
|
69
|
+
* @memberof AccountClass
|
|
70
|
+
*/
|
|
71
|
+
'houseNumber': string;
|
|
72
|
+
/**
|
|
73
|
+
* The account\'s ZIP or postal code
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @memberof AccountClass
|
|
76
|
+
*/
|
|
77
|
+
'zipCode': string;
|
|
78
|
+
/**
|
|
79
|
+
* The account\'s city, district, suburb, town, or village.
|
|
80
|
+
* @type {string}
|
|
81
|
+
* @memberof AccountClass
|
|
82
|
+
*/
|
|
83
|
+
'city': string;
|
|
84
|
+
/**
|
|
85
|
+
* The account\'s date of birth
|
|
86
|
+
* @type {string}
|
|
87
|
+
* @memberof AccountClass
|
|
88
|
+
*/
|
|
89
|
+
'birthDate': string;
|
|
90
|
+
/**
|
|
91
|
+
* The account\'s phone number.
|
|
92
|
+
* @type {string}
|
|
93
|
+
* @memberof AccountClass
|
|
94
|
+
*/
|
|
95
|
+
'phone': string;
|
|
96
|
+
/**
|
|
97
|
+
* The account\'s version.
|
|
98
|
+
* @type {number}
|
|
99
|
+
* @memberof AccountClass
|
|
100
|
+
*/
|
|
101
|
+
'version': number;
|
|
102
|
+
/**
|
|
103
|
+
* Time at which the object was created.
|
|
104
|
+
* @type {string}
|
|
105
|
+
* @memberof AccountClass
|
|
106
|
+
*/
|
|
107
|
+
'createdAt': string;
|
|
108
|
+
/**
|
|
109
|
+
* Time at which the object was updated.
|
|
110
|
+
* @type {string}
|
|
111
|
+
* @memberof AccountClass
|
|
112
|
+
*/
|
|
113
|
+
'updatedAt': string;
|
|
114
|
+
/**
|
|
115
|
+
* Policies linked to the account.
|
|
116
|
+
* @type {Array<string>}
|
|
117
|
+
* @memberof AccountClass
|
|
118
|
+
*/
|
|
119
|
+
'policies': Array<string>;
|
|
120
|
+
/**
|
|
121
|
+
* Optional field contain extra information
|
|
122
|
+
* @type {object}
|
|
123
|
+
* @memberof AccountClass
|
|
124
|
+
*/
|
|
125
|
+
'metadata': object;
|
|
126
|
+
/**
|
|
127
|
+
* Optional field contain custom fields
|
|
128
|
+
* @type {object}
|
|
129
|
+
* @memberof AccountClass
|
|
130
|
+
*/
|
|
131
|
+
'customFields': object;
|
|
132
|
+
}
|
|
@@ -13,9 +13,3 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.CreateAccountRequestDtoGenderEnum = void 0;
|
|
17
|
-
exports.CreateAccountRequestDtoGenderEnum = {
|
|
18
|
-
Male: 'male',
|
|
19
|
-
Female: 'female',
|
|
20
|
-
Unspecified: 'unspecified'
|
|
21
|
-
};
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import { CreateAccountRequestDto } from './create-account-request-dto';
|
|
13
12
|
/**
|
|
14
13
|
*
|
|
15
14
|
* @export
|
|
@@ -34,10 +33,4 @@ export interface CreateCustomerRequestDto {
|
|
|
34
33
|
* @memberof CreateCustomerRequestDto
|
|
35
34
|
*/
|
|
36
35
|
'isEulaAccepted': boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Optional account data
|
|
39
|
-
* @type {CreateAccountRequestDto}
|
|
40
|
-
* @memberof CreateCustomerRequestDto
|
|
41
|
-
*/
|
|
42
|
-
'account'?: CreateAccountRequestDto;
|
|
43
36
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import { CustomerClass } from './customer-class';
|
|
12
13
|
/**
|
|
13
14
|
*
|
|
14
15
|
* @export
|
|
@@ -17,8 +18,8 @@
|
|
|
17
18
|
export interface CreateCustomerResponseClass {
|
|
18
19
|
/**
|
|
19
20
|
* Customer object
|
|
20
|
-
* @type {
|
|
21
|
+
* @type {CustomerClass}
|
|
21
22
|
* @memberof CreateCustomerResponseClass
|
|
22
23
|
*/
|
|
23
|
-
'customer':
|
|
24
|
+
'customer': CustomerClass;
|
|
24
25
|
}
|