@emilgroup/customer-sdk-node 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.openapi-generator/FILES +8 -4
  2. package/README.md +12 -12
  3. package/api/customers-api.ts +304 -114
  4. package/base.ts +57 -43
  5. package/dist/api/customers-api.d.ts +180 -76
  6. package/dist/api/customers-api.js +249 -89
  7. package/dist/base.d.ts +3 -0
  8. package/dist/base.js +75 -42
  9. package/dist/models/{login-request-dto.d.ts → authentication-result-class.d.ts} +8 -14
  10. package/dist/models/{invite-customer-request-dto.js → authentication-result-class.js} +0 -0
  11. package/dist/models/index.d.ts +8 -4
  12. package/dist/models/index.js +8 -4
  13. package/dist/models/initiate-auth-request-dto.d.ts +36 -0
  14. package/dist/models/{invite-customer-response-class.js → initiate-auth-request-dto.js} +0 -0
  15. package/dist/models/initiate-auth-response-class.d.ts +43 -0
  16. package/dist/models/{login-request-dto.js → initiate-auth-response-class.js} +0 -0
  17. package/dist/models/{invite-customer-request-dto.d.ts → invite-by-customer-request-dto.d.ts} +6 -6
  18. package/dist/models/{login-response-class.js → invite-by-customer-request-dto.js} +0 -0
  19. package/dist/models/invite-by-customer-response-class.d.ts +25 -0
  20. package/dist/models/invite-by-customer-response-class.js +15 -0
  21. package/dist/models/{invite-customer-response-class.d.ts → invite-by-tenant-response-class.d.ts} +3 -3
  22. package/dist/models/invite-by-tenant-response-class.js +15 -0
  23. package/dist/models/respond-to-auth-challenge-class.d.ts +43 -0
  24. package/dist/models/respond-to-auth-challenge-class.js +15 -0
  25. package/dist/models/respond-to-auth-challenge-request-dto.d.ts +42 -0
  26. package/dist/models/respond-to-auth-challenge-request-dto.js +15 -0
  27. package/models/{login-request-dto.ts → authentication-result-class.ts} +8 -14
  28. package/models/index.ts +8 -4
  29. package/models/initiate-auth-request-dto.ts +42 -0
  30. package/models/initiate-auth-response-class.ts +49 -0
  31. package/models/{invite-customer-request-dto.ts → invite-by-customer-request-dto.ts} +6 -6
  32. package/models/invite-by-customer-response-class.ts +31 -0
  33. package/models/{invite-customer-response-class.ts → invite-by-tenant-response-class.ts} +3 -3
  34. package/models/respond-to-auth-challenge-class.ts +49 -0
  35. package/models/respond-to-auth-challenge-request-dto.ts +48 -0
  36. package/package.json +1 -1
  37. package/dist/models/login-response-class.d.ts +0 -30
  38. package/models/login-response-class.ts +0 -36
@@ -167,7 +167,7 @@ var CustomersApiAxiosParamCreator = function (configuration) {
167
167
  });
168
168
  },
169
169
  /**
170
- * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
170
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
171
171
  * @summary Get policy details
172
172
  * @param {string} policyCode The policy code
173
173
  * @param {string} customerCode The customer code or \"me\" for the currently logged in customer
@@ -212,22 +212,96 @@ var CustomersApiAxiosParamCreator = function (configuration) {
212
212
  });
213
213
  });
214
214
  },
215
+ /**
216
+ * Start auth process to get new access token, refresh token after successful login.
217
+ * @summary Initiate auth by customer
218
+ * @param {InitiateAuthRequestDto} initiateAuthRequestDto
219
+ * @param {*} [options] Override http request option.
220
+ * @throws {RequiredError}
221
+ */
222
+ initiateAuth: function (initiateAuthRequestDto, options) {
223
+ if (options === void 0) { options = {}; }
224
+ return __awaiter(_this, void 0, void 0, function () {
225
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
226
+ return __generator(this, function (_a) {
227
+ // verify required parameter 'initiateAuthRequestDto' is not null or undefined
228
+ (0, common_1.assertParamExists)('initiateAuth', 'initiateAuthRequestDto', initiateAuthRequestDto);
229
+ localVarPath = "/v1/customers/auth/initiate";
230
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
231
+ if (configuration) {
232
+ baseOptions = configuration.baseOptions;
233
+ baseAccessToken = configuration.accessToken;
234
+ }
235
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
236
+ localVarHeaderParameter = {};
237
+ localVarQueryParameter = {};
238
+ localVarHeaderParameter['Content-Type'] = 'application/json';
239
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
240
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
241
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
242
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(initiateAuthRequestDto, localVarRequestOptions, configuration);
243
+ return [2 /*return*/, {
244
+ url: (0, common_1.toPathString)(localVarUrlObj),
245
+ options: localVarRequestOptions,
246
+ }];
247
+ });
248
+ });
249
+ },
250
+ /**
251
+ * 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.
252
+ * @summary Invite by customer
253
+ * @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
254
+ * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
255
+ * @param {*} [options] Override http request option.
256
+ * @throws {RequiredError}
257
+ */
258
+ inviteByCustomer: function (inviteByCustomerRequestDto, authorization, options) {
259
+ if (options === void 0) { options = {}; }
260
+ return __awaiter(_this, void 0, void 0, function () {
261
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
262
+ return __generator(this, function (_a) {
263
+ // verify required parameter 'inviteByCustomerRequestDto' is not null or undefined
264
+ (0, common_1.assertParamExists)('inviteByCustomer', 'inviteByCustomerRequestDto', inviteByCustomerRequestDto);
265
+ localVarPath = "/v1/customers/invites/by-customer";
266
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
267
+ if (configuration) {
268
+ baseOptions = configuration.baseOptions;
269
+ baseAccessToken = configuration.accessToken;
270
+ }
271
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
272
+ localVarHeaderParameter = {};
273
+ localVarQueryParameter = {};
274
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
275
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
276
+ }
277
+ localVarHeaderParameter['Content-Type'] = 'application/json';
278
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
279
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
280
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
281
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(inviteByCustomerRequestDto, localVarRequestOptions, configuration);
282
+ return [2 /*return*/, {
283
+ url: (0, common_1.toPathString)(localVarUrlObj),
284
+ options: localVarRequestOptions,
285
+ }];
286
+ });
287
+ });
288
+ },
215
289
  /**
216
290
  * 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
291
+ * @summary Invite by tenant
292
+ * @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
219
293
  * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
220
294
  * @param {*} [options] Override http request option.
221
295
  * @throws {RequiredError}
222
296
  */
223
- inviteCustomer: function (inviteCustomerRequestDto, authorization, options) {
297
+ inviteByTenant: function (inviteByCustomerRequestDto, authorization, options) {
224
298
  if (options === void 0) { options = {}; }
225
299
  return __awaiter(_this, void 0, void 0, function () {
226
300
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
227
301
  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";
302
+ // verify required parameter 'inviteByCustomerRequestDto' is not null or undefined
303
+ (0, common_1.assertParamExists)('inviteByTenant', 'inviteByCustomerRequestDto', inviteByCustomerRequestDto);
304
+ localVarPath = "/v1/customers/invites/by-tenant";
231
305
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
232
306
  if (configuration) {
233
307
  baseOptions = configuration.baseOptions;
@@ -243,7 +317,7 @@ var CustomersApiAxiosParamCreator = function (configuration) {
243
317
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
244
318
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
245
319
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
246
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(inviteCustomerRequestDto, localVarRequestOptions, configuration);
320
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(inviteByCustomerRequestDto, localVarRequestOptions, configuration);
247
321
  return [2 /*return*/, {
248
322
  url: (0, common_1.toPathString)(localVarUrlObj),
249
323
  options: localVarRequestOptions,
@@ -376,20 +450,21 @@ var CustomersApiAxiosParamCreator = function (configuration) {
376
450
  });
377
451
  },
378
452
  /**
379
- * Get new access token, refresh token after successful login.
380
- * @summary Login by customer
381
- * @param {LoginRequestDto} loginRequestDto
453
+ * Get new access token, new refresh token.
454
+ * @summary Refresh token by customer
455
+ * @param {RefreshTokenDto} refreshTokenDto
456
+ * @param {string} [cookie] HTTP only cookie that was sent during login.
382
457
  * @param {*} [options] Override http request option.
383
458
  * @throws {RequiredError}
384
459
  */
385
- login: function (loginRequestDto, options) {
460
+ refreshToken: function (refreshTokenDto, cookie, options) {
386
461
  if (options === void 0) { options = {}; }
387
462
  return __awaiter(_this, void 0, void 0, function () {
388
463
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
389
464
  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";
465
+ // verify required parameter 'refreshTokenDto' is not null or undefined
466
+ (0, common_1.assertParamExists)('refreshToken', 'refreshTokenDto', refreshTokenDto);
467
+ localVarPath = "/v1/customers/refresh-token";
393
468
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
394
469
  if (configuration) {
395
470
  baseOptions = configuration.baseOptions;
@@ -398,11 +473,14 @@ var CustomersApiAxiosParamCreator = function (configuration) {
398
473
  localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
399
474
  localVarHeaderParameter = {};
400
475
  localVarQueryParameter = {};
476
+ if (cookie !== undefined && cookie !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
477
+ localVarHeaderParameter['Cookie'] = String(cookie ? cookie : baseAccessToken);
478
+ }
401
479
  localVarHeaderParameter['Content-Type'] = 'application/json';
402
480
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
403
481
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
404
482
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
405
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(loginRequestDto, localVarRequestOptions, configuration);
483
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(refreshTokenDto, localVarRequestOptions, configuration);
406
484
  return [2 /*return*/, {
407
485
  url: (0, common_1.toPathString)(localVarUrlObj),
408
486
  options: localVarRequestOptions,
@@ -411,21 +489,20 @@ var CustomersApiAxiosParamCreator = function (configuration) {
411
489
  });
412
490
  },
413
491
  /**
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.
492
+ * Change customer\'s password using the token provided by the reset password endpoint.
493
+ * @summary Change password by customer
494
+ * @param {ResetPasswordByCustomerRequestDto} resetPasswordByCustomerRequestDto
418
495
  * @param {*} [options] Override http request option.
419
496
  * @throws {RequiredError}
420
497
  */
421
- refreshToken: function (refreshTokenDto, cookie, options) {
498
+ resetPassword: function (resetPasswordByCustomerRequestDto, options) {
422
499
  if (options === void 0) { options = {}; }
423
500
  return __awaiter(_this, void 0, void 0, function () {
424
501
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
425
502
  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";
503
+ // verify required parameter 'resetPasswordByCustomerRequestDto' is not null or undefined
504
+ (0, common_1.assertParamExists)('resetPassword', 'resetPasswordByCustomerRequestDto', resetPasswordByCustomerRequestDto);
505
+ localVarPath = "/v1/customers/reset-password";
429
506
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
430
507
  if (configuration) {
431
508
  baseOptions = configuration.baseOptions;
@@ -434,14 +511,11 @@ var CustomersApiAxiosParamCreator = function (configuration) {
434
511
  localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
435
512
  localVarHeaderParameter = {};
436
513
  localVarQueryParameter = {};
437
- if (cookie !== undefined && cookie !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
438
- localVarHeaderParameter['Cookie'] = String(cookie ? cookie : baseAccessToken);
439
- }
440
514
  localVarHeaderParameter['Content-Type'] = 'application/json';
441
515
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
442
516
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
443
517
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
444
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(refreshTokenDto, localVarRequestOptions, configuration);
518
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(resetPasswordByCustomerRequestDto, localVarRequestOptions, configuration);
445
519
  return [2 /*return*/, {
446
520
  url: (0, common_1.toPathString)(localVarUrlObj),
447
521
  options: localVarRequestOptions,
@@ -450,20 +524,20 @@ var CustomersApiAxiosParamCreator = function (configuration) {
450
524
  });
451
525
  },
452
526
  /**
453
- * Change customer\'s password using the token provided by the reset password endpoint.
454
- * @summary Change password by customer
455
- * @param {ResetPasswordByCustomerRequestDto} resetPasswordByCustomerRequestDto
527
+ * Respond to the auth challenge to get new access token, refresh token after successful login.
528
+ * @summary Respond to auth challenge by customer
529
+ * @param {RespondToAuthChallengeRequestDto} respondToAuthChallengeRequestDto
456
530
  * @param {*} [options] Override http request option.
457
531
  * @throws {RequiredError}
458
532
  */
459
- resetPassword: function (resetPasswordByCustomerRequestDto, options) {
533
+ respondToAuthChallenge: function (respondToAuthChallengeRequestDto, options) {
460
534
  if (options === void 0) { options = {}; }
461
535
  return __awaiter(_this, void 0, void 0, function () {
462
536
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
463
537
  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";
538
+ // verify required parameter 'respondToAuthChallengeRequestDto' is not null or undefined
539
+ (0, common_1.assertParamExists)('respondToAuthChallenge', 'respondToAuthChallengeRequestDto', respondToAuthChallengeRequestDto);
540
+ localVarPath = "/v1/customers/auth/respond";
467
541
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
468
542
  if (configuration) {
469
543
  baseOptions = configuration.baseOptions;
@@ -476,7 +550,7 @@ var CustomersApiAxiosParamCreator = function (configuration) {
476
550
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
477
551
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
478
552
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
479
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(resetPasswordByCustomerRequestDto, localVarRequestOptions, configuration);
553
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(respondToAuthChallengeRequestDto, localVarRequestOptions, configuration);
480
554
  return [2 /*return*/, {
481
555
  url: (0, common_1.toPathString)(localVarUrlObj),
482
556
  options: localVarRequestOptions,
@@ -607,7 +681,7 @@ var CustomersApiFp = function (configuration) {
607
681
  });
608
682
  },
609
683
  /**
610
- * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
684
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
611
685
  * @summary Get policy details
612
686
  * @param {string} policyCode The policy code
613
687
  * @param {string} customerCode The customer code or \"me\" for the currently logged in customer
@@ -629,20 +703,61 @@ var CustomersApiFp = function (configuration) {
629
703
  });
630
704
  });
631
705
  },
706
+ /**
707
+ * Start auth process to get new access token, refresh token after successful login.
708
+ * @summary Initiate auth by customer
709
+ * @param {InitiateAuthRequestDto} initiateAuthRequestDto
710
+ * @param {*} [options] Override http request option.
711
+ * @throws {RequiredError}
712
+ */
713
+ initiateAuth: function (initiateAuthRequestDto, options) {
714
+ return __awaiter(this, void 0, void 0, function () {
715
+ var localVarAxiosArgs;
716
+ return __generator(this, function (_a) {
717
+ switch (_a.label) {
718
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.initiateAuth(initiateAuthRequestDto, options)];
719
+ case 1:
720
+ localVarAxiosArgs = _a.sent();
721
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
722
+ }
723
+ });
724
+ });
725
+ },
632
726
  /**
633
727
  * 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
728
+ * @summary Invite by customer
729
+ * @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
636
730
  * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
637
731
  * @param {*} [options] Override http request option.
638
732
  * @throws {RequiredError}
639
733
  */
640
- inviteCustomer: function (inviteCustomerRequestDto, authorization, options) {
734
+ inviteByCustomer: function (inviteByCustomerRequestDto, authorization, options) {
641
735
  return __awaiter(this, void 0, void 0, function () {
642
736
  var localVarAxiosArgs;
643
737
  return __generator(this, function (_a) {
644
738
  switch (_a.label) {
645
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.inviteCustomer(inviteCustomerRequestDto, authorization, options)];
739
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.inviteByCustomer(inviteByCustomerRequestDto, authorization, options)];
740
+ case 1:
741
+ localVarAxiosArgs = _a.sent();
742
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
743
+ }
744
+ });
745
+ });
746
+ },
747
+ /**
748
+ * 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.
749
+ * @summary Invite by tenant
750
+ * @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
751
+ * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
752
+ * @param {*} [options] Override http request option.
753
+ * @throws {RequiredError}
754
+ */
755
+ inviteByTenant: function (inviteByCustomerRequestDto, authorization, 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.inviteByTenant(inviteByCustomerRequestDto, authorization, options)];
646
761
  case 1:
647
762
  localVarAxiosArgs = _a.sent();
648
763
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -705,18 +820,19 @@ var CustomersApiFp = function (configuration) {
705
820
  });
706
821
  },
707
822
  /**
708
- * Get new access token, refresh token after successful login.
709
- * @summary Login by customer
710
- * @param {LoginRequestDto} loginRequestDto
823
+ * Get new access token, new refresh token.
824
+ * @summary Refresh token by customer
825
+ * @param {RefreshTokenDto} refreshTokenDto
826
+ * @param {string} [cookie] HTTP only cookie that was sent during login.
711
827
  * @param {*} [options] Override http request option.
712
828
  * @throws {RequiredError}
713
829
  */
714
- login: function (loginRequestDto, options) {
830
+ refreshToken: function (refreshTokenDto, cookie, options) {
715
831
  return __awaiter(this, void 0, void 0, function () {
716
832
  var localVarAxiosArgs;
717
833
  return __generator(this, function (_a) {
718
834
  switch (_a.label) {
719
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.login(loginRequestDto, options)];
835
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.refreshToken(refreshTokenDto, cookie, options)];
720
836
  case 1:
721
837
  localVarAxiosArgs = _a.sent();
722
838
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -725,19 +841,18 @@ var CustomersApiFp = function (configuration) {
725
841
  });
726
842
  },
727
843
  /**
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.
844
+ * Change customer\'s password using the token provided by the reset password endpoint.
845
+ * @summary Change password by customer
846
+ * @param {ResetPasswordByCustomerRequestDto} resetPasswordByCustomerRequestDto
732
847
  * @param {*} [options] Override http request option.
733
848
  * @throws {RequiredError}
734
849
  */
735
- refreshToken: function (refreshTokenDto, cookie, options) {
850
+ resetPassword: function (resetPasswordByCustomerRequestDto, options) {
736
851
  return __awaiter(this, void 0, void 0, function () {
737
852
  var localVarAxiosArgs;
738
853
  return __generator(this, function (_a) {
739
854
  switch (_a.label) {
740
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.refreshToken(refreshTokenDto, cookie, options)];
855
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.resetPassword(resetPasswordByCustomerRequestDto, options)];
741
856
  case 1:
742
857
  localVarAxiosArgs = _a.sent();
743
858
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -746,18 +861,18 @@ var CustomersApiFp = function (configuration) {
746
861
  });
747
862
  },
748
863
  /**
749
- * Change customer\'s password using the token provided by the reset password endpoint.
750
- * @summary Change password by customer
751
- * @param {ResetPasswordByCustomerRequestDto} resetPasswordByCustomerRequestDto
864
+ * Respond to the auth challenge to get new access token, refresh token after successful login.
865
+ * @summary Respond to auth challenge by customer
866
+ * @param {RespondToAuthChallengeRequestDto} respondToAuthChallengeRequestDto
752
867
  * @param {*} [options] Override http request option.
753
868
  * @throws {RequiredError}
754
869
  */
755
- resetPassword: function (resetPasswordByCustomerRequestDto, options) {
870
+ respondToAuthChallenge: function (respondToAuthChallengeRequestDto, options) {
756
871
  return __awaiter(this, void 0, void 0, function () {
757
872
  var localVarAxiosArgs;
758
873
  return __generator(this, function (_a) {
759
874
  switch (_a.label) {
760
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.resetPassword(resetPasswordByCustomerRequestDto, options)];
875
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.respondToAuthChallenge(respondToAuthChallengeRequestDto, options)];
761
876
  case 1:
762
877
  localVarAxiosArgs = _a.sent();
763
878
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -836,7 +951,7 @@ var CustomersApiFactory = function (configuration, basePath, axios) {
836
951
  return localVarFp.forgotPassword(forgotPasswordRequestDto, options).then(function (request) { return request(axios, basePath); });
837
952
  },
838
953
  /**
839
- * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
954
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
840
955
  * @summary Get policy details
841
956
  * @param {string} policyCode The policy code
842
957
  * @param {string} customerCode The customer code or \"me\" for the currently logged in customer
@@ -848,16 +963,37 @@ var CustomersApiFactory = function (configuration, basePath, axios) {
848
963
  getPolicy: function (policyCode, customerCode, expand, authorization, options) {
849
964
  return localVarFp.getPolicy(policyCode, customerCode, expand, authorization, options).then(function (request) { return request(axios, basePath); });
850
965
  },
966
+ /**
967
+ * Start auth process to get new access token, refresh token after successful login.
968
+ * @summary Initiate auth by customer
969
+ * @param {InitiateAuthRequestDto} initiateAuthRequestDto
970
+ * @param {*} [options] Override http request option.
971
+ * @throws {RequiredError}
972
+ */
973
+ initiateAuth: function (initiateAuthRequestDto, options) {
974
+ return localVarFp.initiateAuth(initiateAuthRequestDto, options).then(function (request) { return request(axios, basePath); });
975
+ },
851
976
  /**
852
977
  * 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
978
+ * @summary Invite by customer
979
+ * @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
855
980
  * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
856
981
  * @param {*} [options] Override http request option.
857
982
  * @throws {RequiredError}
858
983
  */
859
- inviteCustomer: function (inviteCustomerRequestDto, authorization, options) {
860
- return localVarFp.inviteCustomer(inviteCustomerRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
984
+ inviteByCustomer: function (inviteByCustomerRequestDto, authorization, options) {
985
+ return localVarFp.inviteByCustomer(inviteByCustomerRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
986
+ },
987
+ /**
988
+ * 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.
989
+ * @summary Invite by tenant
990
+ * @param {InviteByCustomerRequestDto} inviteByCustomerRequestDto
991
+ * @param {string} [authorization] Bearer Token: provided by the Emil Insurance Suite\'s Auth login endpoint under the name accessToken
992
+ * @param {*} [options] Override http request option.
993
+ * @throws {RequiredError}
994
+ */
995
+ inviteByTenant: function (inviteByCustomerRequestDto, authorization, options) {
996
+ return localVarFp.inviteByTenant(inviteByCustomerRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
861
997
  },
862
998
  /**
863
999
  * List all the invoices of a customer
@@ -893,16 +1029,6 @@ var CustomersApiFactory = function (configuration, basePath, axios) {
893
1029
  listPolicies: function (customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options) {
894
1030
  return localVarFp.listPolicies(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options).then(function (request) { return request(axios, basePath); });
895
1031
  },
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
1032
  /**
907
1033
  * Get new access token, new refresh token.
908
1034
  * @summary Refresh token by customer
@@ -924,6 +1050,16 @@ var CustomersApiFactory = function (configuration, basePath, axios) {
924
1050
  resetPassword: function (resetPasswordByCustomerRequestDto, options) {
925
1051
  return localVarFp.resetPassword(resetPasswordByCustomerRequestDto, options).then(function (request) { return request(axios, basePath); });
926
1052
  },
1053
+ /**
1054
+ * Respond to the auth challenge to get new access token, refresh token after successful login.
1055
+ * @summary Respond to auth challenge by customer
1056
+ * @param {RespondToAuthChallengeRequestDto} respondToAuthChallengeRequestDto
1057
+ * @param {*} [options] Override http request option.
1058
+ * @throws {RequiredError}
1059
+ */
1060
+ respondToAuthChallenge: function (respondToAuthChallengeRequestDto, options) {
1061
+ return localVarFp.respondToAuthChallenge(respondToAuthChallengeRequestDto, options).then(function (request) { return request(axios, basePath); });
1062
+ },
927
1063
  /**
928
1064
  * Verify the invite sent to the customer via email.
929
1065
  * @summary Verify customer\'s invite token
@@ -983,7 +1119,7 @@ var CustomersApi = /** @class */ (function (_super) {
983
1119
  return (0, exports.CustomersApiFp)(this.configuration).forgotPassword(requestParameters.forgotPasswordRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
984
1120
  };
985
1121
  /**
986
- * Get detailed policy that belongs to a customer. The details can be expanded using expand query parameter.
1122
+ * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
987
1123
  * @summary Get policy details
988
1124
  * @param {CustomersApiGetPolicyRequest} requestParameters Request parameters.
989
1125
  * @param {*} [options] Override http request option.
@@ -994,17 +1130,41 @@ var CustomersApi = /** @class */ (function (_super) {
994
1130
  var _this = this;
995
1131
  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
1132
  };
1133
+ /**
1134
+ * Start auth process to get new access token, refresh token after successful login.
1135
+ * @summary Initiate auth by customer
1136
+ * @param {CustomersApiInitiateAuthRequest} requestParameters Request parameters.
1137
+ * @param {*} [options] Override http request option.
1138
+ * @throws {RequiredError}
1139
+ * @memberof CustomersApi
1140
+ */
1141
+ CustomersApi.prototype.initiateAuth = function (requestParameters, options) {
1142
+ var _this = this;
1143
+ return (0, exports.CustomersApiFp)(this.configuration).initiateAuth(requestParameters.initiateAuthRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
1144
+ };
997
1145
  /**
998
1146
  * 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.
1147
+ * @summary Invite by customer
1148
+ * @param {CustomersApiInviteByCustomerRequest} requestParameters Request parameters.
1001
1149
  * @param {*} [options] Override http request option.
1002
1150
  * @throws {RequiredError}
1003
1151
  * @memberof CustomersApi
1004
1152
  */
1005
- CustomersApi.prototype.inviteCustomer = function (requestParameters, options) {
1153
+ CustomersApi.prototype.inviteByCustomer = function (requestParameters, options) {
1006
1154
  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); });
1155
+ return (0, exports.CustomersApiFp)(this.configuration).inviteByCustomer(requestParameters.inviteByCustomerRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1156
+ };
1157
+ /**
1158
+ * 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.
1159
+ * @summary Invite by tenant
1160
+ * @param {CustomersApiInviteByTenantRequest} requestParameters Request parameters.
1161
+ * @param {*} [options] Override http request option.
1162
+ * @throws {RequiredError}
1163
+ * @memberof CustomersApi
1164
+ */
1165
+ CustomersApi.prototype.inviteByTenant = function (requestParameters, options) {
1166
+ var _this = this;
1167
+ return (0, exports.CustomersApiFp)(this.configuration).inviteByTenant(requestParameters.inviteByCustomerRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1008
1168
  };
1009
1169
  /**
1010
1170
  * List all the invoices of a customer
@@ -1030,18 +1190,6 @@ var CustomersApi = /** @class */ (function (_super) {
1030
1190
  var _this = this;
1031
1191
  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
1192
  };
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
1193
  /**
1046
1194
  * Get new access token, new refresh token.
1047
1195
  * @summary Refresh token by customer
@@ -1066,6 +1214,18 @@ var CustomersApi = /** @class */ (function (_super) {
1066
1214
  var _this = this;
1067
1215
  return (0, exports.CustomersApiFp)(this.configuration).resetPassword(requestParameters.resetPasswordByCustomerRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
1068
1216
  };
1217
+ /**
1218
+ * Respond to the auth challenge to get new access token, refresh token after successful login.
1219
+ * @summary Respond to auth challenge by customer
1220
+ * @param {CustomersApiRespondToAuthChallengeRequest} requestParameters Request parameters.
1221
+ * @param {*} [options] Override http request option.
1222
+ * @throws {RequiredError}
1223
+ * @memberof CustomersApi
1224
+ */
1225
+ CustomersApi.prototype.respondToAuthChallenge = function (requestParameters, options) {
1226
+ var _this = this;
1227
+ return (0, exports.CustomersApiFp)(this.configuration).respondToAuthChallenge(requestParameters.respondToAuthChallengeRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
1228
+ };
1069
1229
  /**
1070
1230
  * Verify the invite sent to the customer via email.
1071
1231
  * @summary Verify customer\'s invite token
package/dist/base.d.ts CHANGED
@@ -49,11 +49,14 @@ export declare class BaseAPI {
49
49
  protected basePath: string;
50
50
  protected axios: AxiosInstance;
51
51
  protected configuration: Configuration | undefined;
52
+ private username?;
53
+ private password?;
52
54
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
53
55
  selectEnvironment(env: Environment): void;
54
56
  authorize(username: string, password: string, tenantSlug: string): Promise<void>;
55
57
  refreshTokenInternal(): Promise<string>;
56
58
  private extractRefreshToken;
59
+ private attachInterceptor;
57
60
  }
58
61
  /**
59
62
  *