@emilgroup/customer-sdk-node 1.0.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 (91) hide show
  1. package/.openapi-generator/FILES +35 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +51 -0
  5. package/api/customers-api.ts +1284 -0
  6. package/api.ts +36 -0
  7. package/base.ts +187 -0
  8. package/common.ts +139 -0
  9. package/configuration.ts +118 -0
  10. package/dist/api/customers-api.d.ts +730 -0
  11. package/dist/api/customers-api.js +1095 -0
  12. package/dist/api.d.ts +16 -0
  13. package/dist/api.js +36 -0
  14. package/dist/base.d.ts +68 -0
  15. package/dist/base.js +251 -0
  16. package/dist/common.d.ts +66 -0
  17. package/dist/common.js +244 -0
  18. package/dist/configuration.d.ts +98 -0
  19. package/dist/configuration.js +45 -0
  20. package/dist/index.d.ts +15 -0
  21. package/dist/index.js +35 -0
  22. package/dist/models/create-account-request-dto.d.ts +102 -0
  23. package/dist/models/create-account-request-dto.js +21 -0
  24. package/dist/models/create-customer-request-dto.d.ts +43 -0
  25. package/dist/models/create-customer-request-dto.js +15 -0
  26. package/dist/models/create-customer-response-class.d.ts +24 -0
  27. package/dist/models/create-customer-response-class.js +15 -0
  28. package/dist/models/forgot-password-request-dto.d.ts +30 -0
  29. package/dist/models/forgot-password-request-dto.js +15 -0
  30. package/dist/models/get-policy-response-class.d.ts +25 -0
  31. package/dist/models/get-policy-response-class.js +15 -0
  32. package/dist/models/index.d.ts +21 -0
  33. package/dist/models/index.js +37 -0
  34. package/dist/models/invite-class.d.ts +54 -0
  35. package/dist/models/invite-class.js +15 -0
  36. package/dist/models/invite-customer-request-dto.d.ts +30 -0
  37. package/dist/models/invite-customer-request-dto.js +15 -0
  38. package/dist/models/invite-customer-response-class.d.ts +25 -0
  39. package/dist/models/invite-customer-response-class.js +15 -0
  40. package/dist/models/list-invoices-response-class.d.ts +30 -0
  41. package/dist/models/list-invoices-response-class.js +15 -0
  42. package/dist/models/list-policies-response-class.d.ts +31 -0
  43. package/dist/models/list-policies-response-class.js +15 -0
  44. package/dist/models/login-request-dto.d.ts +36 -0
  45. package/dist/models/login-request-dto.js +15 -0
  46. package/dist/models/login-response-class.d.ts +30 -0
  47. package/dist/models/login-response-class.js +15 -0
  48. package/dist/models/policy-class.d.ts +55 -0
  49. package/dist/models/policy-class.js +15 -0
  50. package/dist/models/policy-object-class.d.ts +30 -0
  51. package/dist/models/policy-object-class.js +15 -0
  52. package/dist/models/policy-premium-class.d.ts +43 -0
  53. package/dist/models/policy-premium-class.js +15 -0
  54. package/dist/models/policy-premium-item-class.d.ts +36 -0
  55. package/dist/models/policy-premium-item-class.js +15 -0
  56. package/dist/models/policy-version-class.d.ts +49 -0
  57. package/dist/models/policy-version-class.js +15 -0
  58. package/dist/models/refresh-token-dto.d.ts +30 -0
  59. package/dist/models/refresh-token-dto.js +15 -0
  60. package/dist/models/reset-password-by-customer-request-dto.d.ts +36 -0
  61. package/dist/models/reset-password-by-customer-request-dto.js +15 -0
  62. package/dist/models/timeslice-class.d.ts +56 -0
  63. package/dist/models/timeslice-class.js +15 -0
  64. package/dist/models/verify-customer-invite-response-class.d.ts +36 -0
  65. package/dist/models/verify-customer-invite-response-class.js +15 -0
  66. package/git_push.sh +57 -0
  67. package/index.ts +19 -0
  68. package/models/create-account-request-dto.ts +111 -0
  69. package/models/create-customer-request-dto.ts +49 -0
  70. package/models/create-customer-response-class.ts +30 -0
  71. package/models/forgot-password-request-dto.ts +36 -0
  72. package/models/get-policy-response-class.ts +31 -0
  73. package/models/index.ts +21 -0
  74. package/models/invite-class.ts +60 -0
  75. package/models/invite-customer-request-dto.ts +36 -0
  76. package/models/invite-customer-response-class.ts +31 -0
  77. package/models/list-invoices-response-class.ts +36 -0
  78. package/models/list-policies-response-class.ts +37 -0
  79. package/models/login-request-dto.ts +42 -0
  80. package/models/login-response-class.ts +36 -0
  81. package/models/policy-class.ts +61 -0
  82. package/models/policy-object-class.ts +36 -0
  83. package/models/policy-premium-class.ts +49 -0
  84. package/models/policy-premium-item-class.ts +42 -0
  85. package/models/policy-version-class.ts +55 -0
  86. package/models/refresh-token-dto.ts +36 -0
  87. package/models/reset-password-by-customer-request-dto.ts +42 -0
  88. package/models/timeslice-class.ts +62 -0
  89. package/models/verify-customer-invite-response-class.ts +42 -0
  90. package/package.json +29 -0
  91. package/tsconfig.json +22 -0
@@ -0,0 +1,1095 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL CustomerService
6
+ * The EMIL CustomerService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (_) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.CustomersApi = exports.CustomersApiFactory = exports.CustomersApiFp = exports.CustomersApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
92
+ /**
93
+ * CustomersApi - axios parameter creator
94
+ * @export
95
+ */
96
+ var CustomersApiAxiosParamCreator = function (configuration) {
97
+ var _this = this;
98
+ return {
99
+ /**
100
+ * Register a customer using the invite token sent to customer\'s email address. Customer can set a new password for his account created during booking a policy.
101
+ * @summary Register a customer after invite
102
+ * @param {CreateCustomerRequestDto} createCustomerRequestDto
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ createCustomer: function (createCustomerRequestDto, options) {
107
+ if (options === void 0) { options = {}; }
108
+ return __awaiter(_this, void 0, void 0, function () {
109
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
110
+ return __generator(this, function (_a) {
111
+ // verify required parameter 'createCustomerRequestDto' is not null or undefined
112
+ (0, common_1.assertParamExists)('createCustomer', 'createCustomerRequestDto', createCustomerRequestDto);
113
+ localVarPath = "/v1/customers/create";
114
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
115
+ if (configuration) {
116
+ baseOptions = configuration.baseOptions;
117
+ baseAccessToken = configuration.accessToken;
118
+ }
119
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
120
+ localVarHeaderParameter = {};
121
+ localVarQueryParameter = {};
122
+ localVarHeaderParameter['Content-Type'] = 'application/json';
123
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
124
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
125
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
126
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createCustomerRequestDto, localVarRequestOptions, configuration);
127
+ return [2 /*return*/, {
128
+ url: (0, common_1.toPathString)(localVarUrlObj),
129
+ options: localVarRequestOptions,
130
+ }];
131
+ });
132
+ });
133
+ },
134
+ /**
135
+ * Send a customer a reset-password token via email.
136
+ * @summary Forgot password by customer
137
+ * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto
138
+ * @param {*} [options] Override http request option.
139
+ * @throws {RequiredError}
140
+ */
141
+ forgotPassword: function (forgotPasswordRequestDto, options) {
142
+ if (options === void 0) { options = {}; }
143
+ return __awaiter(_this, void 0, void 0, function () {
144
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
145
+ return __generator(this, function (_a) {
146
+ // verify required parameter 'forgotPasswordRequestDto' is not null or undefined
147
+ (0, common_1.assertParamExists)('forgotPassword', 'forgotPasswordRequestDto', forgotPasswordRequestDto);
148
+ localVarPath = "/v1/customers/forgot-password";
149
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
150
+ if (configuration) {
151
+ baseOptions = configuration.baseOptions;
152
+ baseAccessToken = configuration.accessToken;
153
+ }
154
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
155
+ localVarHeaderParameter = {};
156
+ localVarQueryParameter = {};
157
+ localVarHeaderParameter['Content-Type'] = 'application/json';
158
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
159
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
160
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
161
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(forgotPasswordRequestDto, localVarRequestOptions, configuration);
162
+ return [2 /*return*/, {
163
+ url: (0, common_1.toPathString)(localVarUrlObj),
164
+ options: localVarRequestOptions,
165
+ }];
166
+ });
167
+ });
168
+ },
169
+ /**
170
+ * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
171
+ * @summary Get policy details
172
+ * @param {string} policyCode The policy code
173
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
174
+ * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
175
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
176
+ * @param {*} [options] Override http request option.
177
+ * @throws {RequiredError}
178
+ */
179
+ getPolicy: function (policyCode, customerCode, expand, authorization, options) {
180
+ if (options === void 0) { options = {}; }
181
+ return __awaiter(_this, void 0, void 0, function () {
182
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
183
+ return __generator(this, function (_a) {
184
+ // verify required parameter 'policyCode' is not null or undefined
185
+ (0, common_1.assertParamExists)('getPolicy', 'policyCode', policyCode);
186
+ // verify required parameter 'customerCode' is not null or undefined
187
+ (0, common_1.assertParamExists)('getPolicy', 'customerCode', customerCode);
188
+ localVarPath = "/v1/customers/{customerCode}/policies/{policyCode}"
189
+ .replace("{".concat("policyCode", "}"), encodeURIComponent(String(policyCode)))
190
+ .replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
191
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
192
+ if (configuration) {
193
+ baseOptions = configuration.baseOptions;
194
+ baseAccessToken = configuration.accessToken;
195
+ }
196
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
197
+ localVarHeaderParameter = {};
198
+ localVarQueryParameter = {};
199
+ if (expand !== undefined) {
200
+ localVarQueryParameter['expand'] = expand;
201
+ }
202
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
203
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
204
+ }
205
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
206
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
207
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
208
+ return [2 /*return*/, {
209
+ url: (0, common_1.toPathString)(localVarUrlObj),
210
+ options: localVarRequestOptions,
211
+ }];
212
+ });
213
+ });
214
+ },
215
+ /**
216
+ * Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
217
+ * @summary Invite a customer to register
218
+ * @param {InviteCustomerRequestDto} inviteCustomerRequestDto
219
+ * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\&#39;s Auth login endpoint under the name accessToken
220
+ * @param {*} [options] Override http request option.
221
+ * @throws {RequiredError}
222
+ */
223
+ inviteCustomer: function (inviteCustomerRequestDto, authorization, options) {
224
+ if (options === void 0) { options = {}; }
225
+ return __awaiter(_this, void 0, void 0, function () {
226
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
227
+ return __generator(this, function (_a) {
228
+ // verify required parameter 'inviteCustomerRequestDto' is not null or undefined
229
+ (0, common_1.assertParamExists)('inviteCustomer', 'inviteCustomerRequestDto', inviteCustomerRequestDto);
230
+ localVarPath = "/v1/customers/invites";
231
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
232
+ if (configuration) {
233
+ baseOptions = configuration.baseOptions;
234
+ baseAccessToken = configuration.accessToken;
235
+ }
236
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
237
+ localVarHeaderParameter = {};
238
+ localVarQueryParameter = {};
239
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
240
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
241
+ }
242
+ localVarHeaderParameter['Content-Type'] = 'application/json';
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
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(inviteCustomerRequestDto, localVarRequestOptions, configuration);
247
+ return [2 /*return*/, {
248
+ url: (0, common_1.toPathString)(localVarUrlObj),
249
+ options: localVarRequestOptions,
250
+ }];
251
+ });
252
+ });
253
+ },
254
+ /**
255
+ * List all the invoices of a customer
256
+ * @summary List invoices of a customer
257
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
258
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
259
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
260
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
261
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
262
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
263
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
264
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
265
+ * @param {*} [options] Override http request option.
266
+ * @throws {RequiredError}
267
+ */
268
+ listInvoices: function (customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options) {
269
+ if (options === void 0) { options = {}; }
270
+ return __awaiter(_this, void 0, void 0, function () {
271
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
272
+ return __generator(this, function (_a) {
273
+ // verify required parameter 'customerCode' is not null or undefined
274
+ (0, common_1.assertParamExists)('listInvoices', 'customerCode', customerCode);
275
+ localVarPath = "/v1/customers/{customerCode}/invoices"
276
+ .replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
277
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
278
+ if (configuration) {
279
+ baseOptions = configuration.baseOptions;
280
+ baseAccessToken = configuration.accessToken;
281
+ }
282
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
283
+ localVarHeaderParameter = {};
284
+ localVarQueryParameter = {};
285
+ if (pageSize !== undefined) {
286
+ localVarQueryParameter['pageSize'] = pageSize;
287
+ }
288
+ if (pageToken !== undefined) {
289
+ localVarQueryParameter['pageToken'] = pageToken;
290
+ }
291
+ if (filter !== undefined) {
292
+ localVarQueryParameter['filter'] = filter;
293
+ }
294
+ if (search !== undefined) {
295
+ localVarQueryParameter['search'] = search;
296
+ }
297
+ if (order !== undefined) {
298
+ localVarQueryParameter['order'] = order;
299
+ }
300
+ if (expand !== undefined) {
301
+ localVarQueryParameter['expand'] = expand;
302
+ }
303
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
304
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
305
+ }
306
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
307
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
308
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
309
+ return [2 /*return*/, {
310
+ url: (0, common_1.toPathString)(localVarUrlObj),
311
+ options: localVarRequestOptions,
312
+ }];
313
+ });
314
+ });
315
+ },
316
+ /**
317
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
318
+ * @summary List policies of a customer
319
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
320
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
321
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
322
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
323
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
324
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
325
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
326
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
327
+ * @param {*} [options] Override http request option.
328
+ * @throws {RequiredError}
329
+ */
330
+ listPolicies: function (customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options) {
331
+ if (options === void 0) { options = {}; }
332
+ return __awaiter(_this, void 0, void 0, function () {
333
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
334
+ return __generator(this, function (_a) {
335
+ // verify required parameter 'customerCode' is not null or undefined
336
+ (0, common_1.assertParamExists)('listPolicies', 'customerCode', customerCode);
337
+ localVarPath = "/v1/customers/{customerCode}/policies"
338
+ .replace("{".concat("customerCode", "}"), encodeURIComponent(String(customerCode)));
339
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
340
+ if (configuration) {
341
+ baseOptions = configuration.baseOptions;
342
+ baseAccessToken = configuration.accessToken;
343
+ }
344
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
345
+ localVarHeaderParameter = {};
346
+ localVarQueryParameter = {};
347
+ if (pageSize !== undefined) {
348
+ localVarQueryParameter['pageSize'] = pageSize;
349
+ }
350
+ if (pageToken !== undefined) {
351
+ localVarQueryParameter['pageToken'] = pageToken;
352
+ }
353
+ if (filter !== undefined) {
354
+ localVarQueryParameter['filter'] = filter;
355
+ }
356
+ if (search !== undefined) {
357
+ localVarQueryParameter['search'] = search;
358
+ }
359
+ if (order !== undefined) {
360
+ localVarQueryParameter['order'] = order;
361
+ }
362
+ if (expand !== undefined) {
363
+ localVarQueryParameter['expand'] = expand;
364
+ }
365
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
366
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
367
+ }
368
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
369
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
370
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
371
+ return [2 /*return*/, {
372
+ url: (0, common_1.toPathString)(localVarUrlObj),
373
+ options: localVarRequestOptions,
374
+ }];
375
+ });
376
+ });
377
+ },
378
+ /**
379
+ * Get new access token, refresh token after successful login.
380
+ * @summary Login by customer
381
+ * @param {LoginRequestDto} loginRequestDto
382
+ * @param {*} [options] Override http request option.
383
+ * @throws {RequiredError}
384
+ */
385
+ login: function (loginRequestDto, options) {
386
+ if (options === void 0) { options = {}; }
387
+ return __awaiter(_this, void 0, void 0, function () {
388
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
389
+ return __generator(this, function (_a) {
390
+ // verify required parameter 'loginRequestDto' is not null or undefined
391
+ (0, common_1.assertParamExists)('login', 'loginRequestDto', loginRequestDto);
392
+ localVarPath = "/v1/customers/login";
393
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
394
+ if (configuration) {
395
+ baseOptions = configuration.baseOptions;
396
+ baseAccessToken = configuration.accessToken;
397
+ }
398
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
399
+ localVarHeaderParameter = {};
400
+ localVarQueryParameter = {};
401
+ localVarHeaderParameter['Content-Type'] = 'application/json';
402
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
403
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
404
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
405
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(loginRequestDto, localVarRequestOptions, configuration);
406
+ return [2 /*return*/, {
407
+ url: (0, common_1.toPathString)(localVarUrlObj),
408
+ options: localVarRequestOptions,
409
+ }];
410
+ });
411
+ });
412
+ },
413
+ /**
414
+ * Get new access token, new refresh token.
415
+ * @summary Refresh token by customer
416
+ * @param {RefreshTokenDto} refreshTokenDto
417
+ * @param {string} [cookie] HTTP only cookie that was sent during login.
418
+ * @param {*} [options] Override http request option.
419
+ * @throws {RequiredError}
420
+ */
421
+ refreshToken: function (refreshTokenDto, cookie, options) {
422
+ if (options === void 0) { options = {}; }
423
+ return __awaiter(_this, void 0, void 0, function () {
424
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
425
+ return __generator(this, function (_a) {
426
+ // verify required parameter 'refreshTokenDto' is not null or undefined
427
+ (0, common_1.assertParamExists)('refreshToken', 'refreshTokenDto', refreshTokenDto);
428
+ localVarPath = "/v1/customers/refresh-token";
429
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
430
+ if (configuration) {
431
+ baseOptions = configuration.baseOptions;
432
+ baseAccessToken = configuration.accessToken;
433
+ }
434
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
435
+ localVarHeaderParameter = {};
436
+ localVarQueryParameter = {};
437
+ if (cookie !== undefined && cookie !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
438
+ localVarHeaderParameter['Cookie'] = String(cookie ? cookie : baseAccessToken);
439
+ }
440
+ localVarHeaderParameter['Content-Type'] = 'application/json';
441
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
442
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
443
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
444
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(refreshTokenDto, localVarRequestOptions, configuration);
445
+ return [2 /*return*/, {
446
+ url: (0, common_1.toPathString)(localVarUrlObj),
447
+ options: localVarRequestOptions,
448
+ }];
449
+ });
450
+ });
451
+ },
452
+ /**
453
+ * Change customer\'s password using the token provided by the reset password endpoint.
454
+ * @summary Change password by customer
455
+ * @param {ResetPasswordByCustomerRequestDto} resetPasswordByCustomerRequestDto
456
+ * @param {*} [options] Override http request option.
457
+ * @throws {RequiredError}
458
+ */
459
+ resetPassword: function (resetPasswordByCustomerRequestDto, options) {
460
+ if (options === void 0) { options = {}; }
461
+ return __awaiter(_this, void 0, void 0, function () {
462
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
463
+ return __generator(this, function (_a) {
464
+ // verify required parameter 'resetPasswordByCustomerRequestDto' is not null or undefined
465
+ (0, common_1.assertParamExists)('resetPassword', 'resetPasswordByCustomerRequestDto', resetPasswordByCustomerRequestDto);
466
+ localVarPath = "/v1/customers/reset-password";
467
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
468
+ if (configuration) {
469
+ baseOptions = configuration.baseOptions;
470
+ baseAccessToken = configuration.accessToken;
471
+ }
472
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
473
+ localVarHeaderParameter = {};
474
+ localVarQueryParameter = {};
475
+ localVarHeaderParameter['Content-Type'] = 'application/json';
476
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
477
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
478
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
479
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(resetPasswordByCustomerRequestDto, localVarRequestOptions, configuration);
480
+ return [2 /*return*/, {
481
+ url: (0, common_1.toPathString)(localVarUrlObj),
482
+ options: localVarRequestOptions,
483
+ }];
484
+ });
485
+ });
486
+ },
487
+ /**
488
+ * Verify the invite sent to the customer via email.
489
+ * @summary Verify customer\'s invite token
490
+ * @param {string} inviteToken Invite token sent to the customer
491
+ * @param {*} [options] Override http request option.
492
+ * @throws {RequiredError}
493
+ */
494
+ verifyInvite: function (inviteToken, options) {
495
+ if (options === void 0) { options = {}; }
496
+ return __awaiter(_this, void 0, void 0, function () {
497
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
498
+ return __generator(this, function (_a) {
499
+ // verify required parameter 'inviteToken' is not null or undefined
500
+ (0, common_1.assertParamExists)('verifyInvite', 'inviteToken', inviteToken);
501
+ localVarPath = "/v1/customers/invites/verify";
502
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
503
+ if (configuration) {
504
+ baseOptions = configuration.baseOptions;
505
+ baseAccessToken = configuration.accessToken;
506
+ }
507
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
508
+ localVarHeaderParameter = {};
509
+ localVarQueryParameter = {};
510
+ if (inviteToken !== undefined) {
511
+ localVarQueryParameter['inviteToken'] = inviteToken;
512
+ }
513
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
514
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
515
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
516
+ return [2 /*return*/, {
517
+ url: (0, common_1.toPathString)(localVarUrlObj),
518
+ options: localVarRequestOptions,
519
+ }];
520
+ });
521
+ });
522
+ },
523
+ /**
524
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
525
+ * @summary Verify a reset password token
526
+ * @param {string} resetToken reset password token
527
+ * @param {*} [options] Override http request option.
528
+ * @throws {RequiredError}
529
+ */
530
+ verifyResetPasswordToken: function (resetToken, options) {
531
+ if (options === void 0) { options = {}; }
532
+ return __awaiter(_this, void 0, void 0, function () {
533
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
534
+ return __generator(this, function (_a) {
535
+ // verify required parameter 'resetToken' is not null or undefined
536
+ (0, common_1.assertParamExists)('verifyResetPasswordToken', 'resetToken', resetToken);
537
+ localVarPath = "/v1/customers/verify-reset-password";
538
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
539
+ if (configuration) {
540
+ baseOptions = configuration.baseOptions;
541
+ baseAccessToken = configuration.accessToken;
542
+ }
543
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
544
+ localVarHeaderParameter = {};
545
+ localVarQueryParameter = {};
546
+ if (resetToken !== undefined) {
547
+ localVarQueryParameter['resetToken'] = resetToken;
548
+ }
549
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
550
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
551
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
552
+ return [2 /*return*/, {
553
+ url: (0, common_1.toPathString)(localVarUrlObj),
554
+ options: localVarRequestOptions,
555
+ }];
556
+ });
557
+ });
558
+ },
559
+ };
560
+ };
561
+ exports.CustomersApiAxiosParamCreator = CustomersApiAxiosParamCreator;
562
+ /**
563
+ * CustomersApi - functional programming interface
564
+ * @export
565
+ */
566
+ var CustomersApiFp = function (configuration) {
567
+ var localVarAxiosParamCreator = (0, exports.CustomersApiAxiosParamCreator)(configuration);
568
+ return {
569
+ /**
570
+ * Register a customer using the invite token sent to customer\'s email address. Customer can set a new password for his account created during booking a policy.
571
+ * @summary Register a customer after invite
572
+ * @param {CreateCustomerRequestDto} createCustomerRequestDto
573
+ * @param {*} [options] Override http request option.
574
+ * @throws {RequiredError}
575
+ */
576
+ createCustomer: function (createCustomerRequestDto, options) {
577
+ return __awaiter(this, void 0, void 0, function () {
578
+ var localVarAxiosArgs;
579
+ return __generator(this, function (_a) {
580
+ switch (_a.label) {
581
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createCustomer(createCustomerRequestDto, options)];
582
+ case 1:
583
+ localVarAxiosArgs = _a.sent();
584
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
585
+ }
586
+ });
587
+ });
588
+ },
589
+ /**
590
+ * Send a customer a reset-password token via email.
591
+ * @summary Forgot password by customer
592
+ * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto
593
+ * @param {*} [options] Override http request option.
594
+ * @throws {RequiredError}
595
+ */
596
+ forgotPassword: function (forgotPasswordRequestDto, options) {
597
+ return __awaiter(this, void 0, void 0, function () {
598
+ var localVarAxiosArgs;
599
+ return __generator(this, function (_a) {
600
+ switch (_a.label) {
601
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.forgotPassword(forgotPasswordRequestDto, options)];
602
+ case 1:
603
+ localVarAxiosArgs = _a.sent();
604
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
605
+ }
606
+ });
607
+ });
608
+ },
609
+ /**
610
+ * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
611
+ * @summary Get policy details
612
+ * @param {string} policyCode The policy code
613
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
614
+ * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
615
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
616
+ * @param {*} [options] Override http request option.
617
+ * @throws {RequiredError}
618
+ */
619
+ getPolicy: function (policyCode, customerCode, expand, authorization, options) {
620
+ return __awaiter(this, void 0, void 0, function () {
621
+ var localVarAxiosArgs;
622
+ return __generator(this, function (_a) {
623
+ switch (_a.label) {
624
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getPolicy(policyCode, customerCode, expand, authorization, options)];
625
+ case 1:
626
+ localVarAxiosArgs = _a.sent();
627
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
628
+ }
629
+ });
630
+ });
631
+ },
632
+ /**
633
+ * Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
634
+ * @summary Invite a customer to register
635
+ * @param {InviteCustomerRequestDto} inviteCustomerRequestDto
636
+ * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\&#39;s Auth login endpoint under the name accessToken
637
+ * @param {*} [options] Override http request option.
638
+ * @throws {RequiredError}
639
+ */
640
+ inviteCustomer: function (inviteCustomerRequestDto, authorization, options) {
641
+ return __awaiter(this, void 0, void 0, function () {
642
+ var localVarAxiosArgs;
643
+ return __generator(this, function (_a) {
644
+ switch (_a.label) {
645
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.inviteCustomer(inviteCustomerRequestDto, authorization, options)];
646
+ case 1:
647
+ localVarAxiosArgs = _a.sent();
648
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
649
+ }
650
+ });
651
+ });
652
+ },
653
+ /**
654
+ * List all the invoices of a customer
655
+ * @summary List invoices of a customer
656
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
657
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
658
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
659
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
660
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
661
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
662
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
663
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
664
+ * @param {*} [options] Override http request option.
665
+ * @throws {RequiredError}
666
+ */
667
+ listInvoices: function (customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options) {
668
+ return __awaiter(this, void 0, void 0, function () {
669
+ var localVarAxiosArgs;
670
+ return __generator(this, function (_a) {
671
+ switch (_a.label) {
672
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listInvoices(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options)];
673
+ case 1:
674
+ localVarAxiosArgs = _a.sent();
675
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
676
+ }
677
+ });
678
+ });
679
+ },
680
+ /**
681
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
682
+ * @summary List policies of a customer
683
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
684
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
685
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
686
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
687
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
688
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
689
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
690
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
691
+ * @param {*} [options] Override http request option.
692
+ * @throws {RequiredError}
693
+ */
694
+ listPolicies: function (customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options) {
695
+ return __awaiter(this, void 0, void 0, function () {
696
+ var localVarAxiosArgs;
697
+ return __generator(this, function (_a) {
698
+ switch (_a.label) {
699
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listPolicies(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options)];
700
+ case 1:
701
+ localVarAxiosArgs = _a.sent();
702
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
703
+ }
704
+ });
705
+ });
706
+ },
707
+ /**
708
+ * Get new access token, refresh token after successful login.
709
+ * @summary Login by customer
710
+ * @param {LoginRequestDto} loginRequestDto
711
+ * @param {*} [options] Override http request option.
712
+ * @throws {RequiredError}
713
+ */
714
+ login: function (loginRequestDto, options) {
715
+ return __awaiter(this, void 0, void 0, function () {
716
+ var localVarAxiosArgs;
717
+ return __generator(this, function (_a) {
718
+ switch (_a.label) {
719
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.login(loginRequestDto, options)];
720
+ case 1:
721
+ localVarAxiosArgs = _a.sent();
722
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
723
+ }
724
+ });
725
+ });
726
+ },
727
+ /**
728
+ * Get new access token, new refresh token.
729
+ * @summary Refresh token by customer
730
+ * @param {RefreshTokenDto} refreshTokenDto
731
+ * @param {string} [cookie] HTTP only cookie that was sent during login.
732
+ * @param {*} [options] Override http request option.
733
+ * @throws {RequiredError}
734
+ */
735
+ refreshToken: function (refreshTokenDto, cookie, options) {
736
+ return __awaiter(this, void 0, void 0, function () {
737
+ var localVarAxiosArgs;
738
+ return __generator(this, function (_a) {
739
+ switch (_a.label) {
740
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.refreshToken(refreshTokenDto, cookie, options)];
741
+ case 1:
742
+ localVarAxiosArgs = _a.sent();
743
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
744
+ }
745
+ });
746
+ });
747
+ },
748
+ /**
749
+ * Change customer\'s password using the token provided by the reset password endpoint.
750
+ * @summary Change password by customer
751
+ * @param {ResetPasswordByCustomerRequestDto} resetPasswordByCustomerRequestDto
752
+ * @param {*} [options] Override http request option.
753
+ * @throws {RequiredError}
754
+ */
755
+ resetPassword: function (resetPasswordByCustomerRequestDto, options) {
756
+ return __awaiter(this, void 0, void 0, function () {
757
+ var localVarAxiosArgs;
758
+ return __generator(this, function (_a) {
759
+ switch (_a.label) {
760
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.resetPassword(resetPasswordByCustomerRequestDto, options)];
761
+ case 1:
762
+ localVarAxiosArgs = _a.sent();
763
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
764
+ }
765
+ });
766
+ });
767
+ },
768
+ /**
769
+ * Verify the invite sent to the customer via email.
770
+ * @summary Verify customer\'s invite token
771
+ * @param {string} inviteToken Invite token sent to the customer
772
+ * @param {*} [options] Override http request option.
773
+ * @throws {RequiredError}
774
+ */
775
+ verifyInvite: function (inviteToken, options) {
776
+ return __awaiter(this, void 0, void 0, function () {
777
+ var localVarAxiosArgs;
778
+ return __generator(this, function (_a) {
779
+ switch (_a.label) {
780
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.verifyInvite(inviteToken, options)];
781
+ case 1:
782
+ localVarAxiosArgs = _a.sent();
783
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
784
+ }
785
+ });
786
+ });
787
+ },
788
+ /**
789
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
790
+ * @summary Verify a reset password token
791
+ * @param {string} resetToken reset password token
792
+ * @param {*} [options] Override http request option.
793
+ * @throws {RequiredError}
794
+ */
795
+ verifyResetPasswordToken: function (resetToken, options) {
796
+ return __awaiter(this, void 0, void 0, function () {
797
+ var localVarAxiosArgs;
798
+ return __generator(this, function (_a) {
799
+ switch (_a.label) {
800
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.verifyResetPasswordToken(resetToken, options)];
801
+ case 1:
802
+ localVarAxiosArgs = _a.sent();
803
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
804
+ }
805
+ });
806
+ });
807
+ },
808
+ };
809
+ };
810
+ exports.CustomersApiFp = CustomersApiFp;
811
+ /**
812
+ * CustomersApi - factory interface
813
+ * @export
814
+ */
815
+ var CustomersApiFactory = function (configuration, basePath, axios) {
816
+ var localVarFp = (0, exports.CustomersApiFp)(configuration);
817
+ return {
818
+ /**
819
+ * Register a customer using the invite token sent to customer\'s email address. Customer can set a new password for his account created during booking a policy.
820
+ * @summary Register a customer after invite
821
+ * @param {CreateCustomerRequestDto} createCustomerRequestDto
822
+ * @param {*} [options] Override http request option.
823
+ * @throws {RequiredError}
824
+ */
825
+ createCustomer: function (createCustomerRequestDto, options) {
826
+ return localVarFp.createCustomer(createCustomerRequestDto, options).then(function (request) { return request(axios, basePath); });
827
+ },
828
+ /**
829
+ * Send a customer a reset-password token via email.
830
+ * @summary Forgot password by customer
831
+ * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto
832
+ * @param {*} [options] Override http request option.
833
+ * @throws {RequiredError}
834
+ */
835
+ forgotPassword: function (forgotPasswordRequestDto, options) {
836
+ return localVarFp.forgotPassword(forgotPasswordRequestDto, options).then(function (request) { return request(axios, basePath); });
837
+ },
838
+ /**
839
+ * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
840
+ * @summary Get policy details
841
+ * @param {string} policyCode The policy code
842
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
843
+ * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
844
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
845
+ * @param {*} [options] Override http request option.
846
+ * @throws {RequiredError}
847
+ */
848
+ getPolicy: function (policyCode, customerCode, expand, authorization, options) {
849
+ return localVarFp.getPolicy(policyCode, customerCode, expand, authorization, options).then(function (request) { return request(axios, basePath); });
850
+ },
851
+ /**
852
+ * Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
853
+ * @summary Invite a customer to register
854
+ * @param {InviteCustomerRequestDto} inviteCustomerRequestDto
855
+ * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\&#39;s Auth login endpoint under the name accessToken
856
+ * @param {*} [options] Override http request option.
857
+ * @throws {RequiredError}
858
+ */
859
+ inviteCustomer: function (inviteCustomerRequestDto, authorization, options) {
860
+ return localVarFp.inviteCustomer(inviteCustomerRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
861
+ },
862
+ /**
863
+ * List all the invoices of a customer
864
+ * @summary List invoices of a customer
865
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
866
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
867
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
868
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
869
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
870
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
871
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
872
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
873
+ * @param {*} [options] Override http request option.
874
+ * @throws {RequiredError}
875
+ */
876
+ listInvoices: function (customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options) {
877
+ return localVarFp.listInvoices(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options).then(function (request) { return request(axios, basePath); });
878
+ },
879
+ /**
880
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
881
+ * @summary List policies of a customer
882
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer
883
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
884
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
885
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
886
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
887
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
888
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
889
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
890
+ * @param {*} [options] Override http request option.
891
+ * @throws {RequiredError}
892
+ */
893
+ listPolicies: function (customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options) {
894
+ return localVarFp.listPolicies(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options).then(function (request) { return request(axios, basePath); });
895
+ },
896
+ /**
897
+ * Get new access token, refresh token after successful login.
898
+ * @summary Login by customer
899
+ * @param {LoginRequestDto} loginRequestDto
900
+ * @param {*} [options] Override http request option.
901
+ * @throws {RequiredError}
902
+ */
903
+ login: function (loginRequestDto, options) {
904
+ return localVarFp.login(loginRequestDto, options).then(function (request) { return request(axios, basePath); });
905
+ },
906
+ /**
907
+ * Get new access token, new refresh token.
908
+ * @summary Refresh token by customer
909
+ * @param {RefreshTokenDto} refreshTokenDto
910
+ * @param {string} [cookie] HTTP only cookie that was sent during login.
911
+ * @param {*} [options] Override http request option.
912
+ * @throws {RequiredError}
913
+ */
914
+ refreshToken: function (refreshTokenDto, cookie, options) {
915
+ return localVarFp.refreshToken(refreshTokenDto, cookie, options).then(function (request) { return request(axios, basePath); });
916
+ },
917
+ /**
918
+ * Change customer\'s password using the token provided by the reset password endpoint.
919
+ * @summary Change password by customer
920
+ * @param {ResetPasswordByCustomerRequestDto} resetPasswordByCustomerRequestDto
921
+ * @param {*} [options] Override http request option.
922
+ * @throws {RequiredError}
923
+ */
924
+ resetPassword: function (resetPasswordByCustomerRequestDto, options) {
925
+ return localVarFp.resetPassword(resetPasswordByCustomerRequestDto, options).then(function (request) { return request(axios, basePath); });
926
+ },
927
+ /**
928
+ * Verify the invite sent to the customer via email.
929
+ * @summary Verify customer\'s invite token
930
+ * @param {string} inviteToken Invite token sent to the customer
931
+ * @param {*} [options] Override http request option.
932
+ * @throws {RequiredError}
933
+ */
934
+ verifyInvite: function (inviteToken, options) {
935
+ return localVarFp.verifyInvite(inviteToken, options).then(function (request) { return request(axios, basePath); });
936
+ },
937
+ /**
938
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
939
+ * @summary Verify a reset password token
940
+ * @param {string} resetToken reset password token
941
+ * @param {*} [options] Override http request option.
942
+ * @throws {RequiredError}
943
+ */
944
+ verifyResetPasswordToken: function (resetToken, options) {
945
+ return localVarFp.verifyResetPasswordToken(resetToken, options).then(function (request) { return request(axios, basePath); });
946
+ },
947
+ };
948
+ };
949
+ exports.CustomersApiFactory = CustomersApiFactory;
950
+ /**
951
+ * CustomersApi - object-oriented interface
952
+ * @export
953
+ * @class CustomersApi
954
+ * @extends {BaseAPI}
955
+ */
956
+ var CustomersApi = /** @class */ (function (_super) {
957
+ __extends(CustomersApi, _super);
958
+ function CustomersApi() {
959
+ return _super !== null && _super.apply(this, arguments) || this;
960
+ }
961
+ /**
962
+ * Register a customer using the invite token sent to customer\'s email address. Customer can set a new password for his account created during booking a policy.
963
+ * @summary Register a customer after invite
964
+ * @param {CustomersApiCreateCustomerRequest} requestParameters Request parameters.
965
+ * @param {*} [options] Override http request option.
966
+ * @throws {RequiredError}
967
+ * @memberof CustomersApi
968
+ */
969
+ CustomersApi.prototype.createCustomer = function (requestParameters, options) {
970
+ var _this = this;
971
+ return (0, exports.CustomersApiFp)(this.configuration).createCustomer(requestParameters.createCustomerRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
972
+ };
973
+ /**
974
+ * Send a customer a reset-password token via email.
975
+ * @summary Forgot password by customer
976
+ * @param {CustomersApiForgotPasswordRequest} requestParameters Request parameters.
977
+ * @param {*} [options] Override http request option.
978
+ * @throws {RequiredError}
979
+ * @memberof CustomersApi
980
+ */
981
+ CustomersApi.prototype.forgotPassword = function (requestParameters, options) {
982
+ var _this = this;
983
+ return (0, exports.CustomersApiFp)(this.configuration).forgotPassword(requestParameters.forgotPasswordRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
984
+ };
985
+ /**
986
+ * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
987
+ * @summary Get policy details
988
+ * @param {CustomersApiGetPolicyRequest} requestParameters Request parameters.
989
+ * @param {*} [options] Override http request option.
990
+ * @throws {RequiredError}
991
+ * @memberof CustomersApi
992
+ */
993
+ CustomersApi.prototype.getPolicy = function (requestParameters, options) {
994
+ var _this = this;
995
+ return (0, exports.CustomersApiFp)(this.configuration).getPolicy(requestParameters.policyCode, requestParameters.customerCode, requestParameters.expand, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
996
+ };
997
+ /**
998
+ * Send a customer an invite via email to register. An account should have been created before inviting the customer. To invite users without accounts and policies is not yet supported.
999
+ * @summary Invite a customer to register
1000
+ * @param {CustomersApiInviteCustomerRequest} requestParameters Request parameters.
1001
+ * @param {*} [options] Override http request option.
1002
+ * @throws {RequiredError}
1003
+ * @memberof CustomersApi
1004
+ */
1005
+ CustomersApi.prototype.inviteCustomer = function (requestParameters, options) {
1006
+ var _this = this;
1007
+ return (0, exports.CustomersApiFp)(this.configuration).inviteCustomer(requestParameters.inviteCustomerRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1008
+ };
1009
+ /**
1010
+ * List all the invoices of a customer
1011
+ * @summary List invoices of a customer
1012
+ * @param {CustomersApiListInvoicesRequest} requestParameters Request parameters.
1013
+ * @param {*} [options] Override http request option.
1014
+ * @throws {RequiredError}
1015
+ * @memberof CustomersApi
1016
+ */
1017
+ CustomersApi.prototype.listInvoices = function (requestParameters, options) {
1018
+ var _this = this;
1019
+ return (0, exports.CustomersApiFp)(this.configuration).listInvoices(requestParameters.customerCode, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1020
+ };
1021
+ /**
1022
+ * List all the policies that belong to a customer, the policies can be filtered by policy code, policy number.
1023
+ * @summary List policies of a customer
1024
+ * @param {CustomersApiListPoliciesRequest} requestParameters Request parameters.
1025
+ * @param {*} [options] Override http request option.
1026
+ * @throws {RequiredError}
1027
+ * @memberof CustomersApi
1028
+ */
1029
+ CustomersApi.prototype.listPolicies = function (requestParameters, options) {
1030
+ var _this = this;
1031
+ return (0, exports.CustomersApiFp)(this.configuration).listPolicies(requestParameters.customerCode, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1032
+ };
1033
+ /**
1034
+ * Get new access token, refresh token after successful login.
1035
+ * @summary Login by customer
1036
+ * @param {CustomersApiLoginRequest} requestParameters Request parameters.
1037
+ * @param {*} [options] Override http request option.
1038
+ * @throws {RequiredError}
1039
+ * @memberof CustomersApi
1040
+ */
1041
+ CustomersApi.prototype.login = function (requestParameters, options) {
1042
+ var _this = this;
1043
+ return (0, exports.CustomersApiFp)(this.configuration).login(requestParameters.loginRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
1044
+ };
1045
+ /**
1046
+ * Get new access token, new refresh token.
1047
+ * @summary Refresh token by customer
1048
+ * @param {CustomersApiRefreshTokenRequest} requestParameters Request parameters.
1049
+ * @param {*} [options] Override http request option.
1050
+ * @throws {RequiredError}
1051
+ * @memberof CustomersApi
1052
+ */
1053
+ CustomersApi.prototype.refreshToken = function (requestParameters, options) {
1054
+ var _this = this;
1055
+ return (0, exports.CustomersApiFp)(this.configuration).refreshToken(requestParameters.refreshTokenDto, requestParameters.cookie, options).then(function (request) { return request(_this.axios, _this.basePath); });
1056
+ };
1057
+ /**
1058
+ * Change customer\'s password using the token provided by the reset password endpoint.
1059
+ * @summary Change password by customer
1060
+ * @param {CustomersApiResetPasswordRequest} requestParameters Request parameters.
1061
+ * @param {*} [options] Override http request option.
1062
+ * @throws {RequiredError}
1063
+ * @memberof CustomersApi
1064
+ */
1065
+ CustomersApi.prototype.resetPassword = function (requestParameters, options) {
1066
+ var _this = this;
1067
+ return (0, exports.CustomersApiFp)(this.configuration).resetPassword(requestParameters.resetPasswordByCustomerRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
1068
+ };
1069
+ /**
1070
+ * Verify the invite sent to the customer via email.
1071
+ * @summary Verify customer\'s invite token
1072
+ * @param {CustomersApiVerifyInviteRequest} requestParameters Request parameters.
1073
+ * @param {*} [options] Override http request option.
1074
+ * @throws {RequiredError}
1075
+ * @memberof CustomersApi
1076
+ */
1077
+ CustomersApi.prototype.verifyInvite = function (requestParameters, options) {
1078
+ var _this = this;
1079
+ return (0, exports.CustomersApiFp)(this.configuration).verifyInvite(requestParameters.inviteToken, options).then(function (request) { return request(_this.axios, _this.basePath); });
1080
+ };
1081
+ /**
1082
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
1083
+ * @summary Verify a reset password token
1084
+ * @param {CustomersApiVerifyResetPasswordTokenRequest} requestParameters Request parameters.
1085
+ * @param {*} [options] Override http request option.
1086
+ * @throws {RequiredError}
1087
+ * @memberof CustomersApi
1088
+ */
1089
+ CustomersApi.prototype.verifyResetPasswordToken = function (requestParameters, options) {
1090
+ var _this = this;
1091
+ return (0, exports.CustomersApiFp)(this.configuration).verifyResetPasswordToken(requestParameters.resetToken, options).then(function (request) { return request(_this.axios, _this.basePath); });
1092
+ };
1093
+ return CustomersApi;
1094
+ }(base_1.BaseAPI));
1095
+ exports.CustomersApi = CustomersApi;