@emilgroup/customer-sdk-node 1.9.0-beta.0 → 1.9.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.
@@ -6,6 +6,7 @@ api.ts
6
6
  api/claims-api.ts
7
7
  api/customers-api.ts
8
8
  api/policies-api.ts
9
+ api/products-api.ts
9
10
  base.ts
10
11
  common.ts
11
12
  configuration.ts
@@ -25,10 +26,12 @@ models/create-customer-response-class.ts
25
26
  models/create-presigned-post-response-class.ts
26
27
  models/customer-class.ts
27
28
  models/customer-document-class.ts
29
+ models/customer-product-class.ts
28
30
  models/forgot-password-request-dto.ts
29
31
  models/get-customer-document-download-url-response-class.ts
30
32
  models/get-customer-response-class.ts
31
33
  models/get-policy-response-class.ts
34
+ models/get-product-response-class.ts
32
35
  models/index.ts
33
36
  models/initiate-auth-request-dto.ts
34
37
  models/initiate-auth-response-class.ts
@@ -55,12 +58,10 @@ models/reset-password-by-customer-request-dto.ts
55
58
  models/respond-to-auth-challenge-class.ts
56
59
  models/respond-to-auth-challenge-request-dto.ts
57
60
  models/shared-customer-policy-object-request-dto.ts
58
- models/shared-customer-product-class.ts
59
61
  models/shared-invoice-item-class.ts
60
62
  models/terminate-customer-policy-request-dto.ts
61
63
  models/terminate-customer-policy-response-class.ts
62
64
  models/timeslice-class.ts
63
- models/to-grpc-customer-product-class.ts
64
65
  models/update-account-request-dto.ts
65
66
  models/update-customer-claim-request-dto.ts
66
67
  models/update-customer-request-dto.ts
package/README.md CHANGED
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
17
17
  Navigate to the folder of your consuming project and run one of the following commands:
18
18
 
19
19
  ```
20
- npm install @emilgroup/customer-sdk-node@1.9.0-beta.0 --save
20
+ npm install @emilgroup/customer-sdk-node@1.9.0 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/customer-sdk-node@1.9.0-beta.0
24
+ yarn add @emilgroup/customer-sdk-node@1.9.0
25
25
  ```
26
26
 
27
27
  And then you can import `CustomersApi`.
@@ -29,6 +29,8 @@ import { CreateCustomerRequestDto } from '../models';
29
29
  // @ts-ignore
30
30
  import { CreateCustomerResponseClass } from '../models';
31
31
  // @ts-ignore
32
+ import { CreatePresignedPostResponseClass } from '../models';
33
+ // @ts-ignore
32
34
  import { ForgotPasswordRequestDto } from '../models';
33
35
  // @ts-ignore
34
36
  import { GetCustomerDocumentDownloadUrlResponseClass } from '../models';
@@ -761,6 +763,42 @@ export const CustomersApiAxiosParamCreator = function (configuration?: Configura
761
763
  options: localVarRequestOptions,
762
764
  };
763
765
  },
766
+ /**
767
+ * API to upload and attach documents to an account.
768
+ * @summary Upload account documents
769
+ * @param {string} customerCode
770
+ * @param {*} [options] Override http request option.
771
+ * @throws {RequiredError}
772
+ */
773
+ uploadAccountDocuments: async (customerCode: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
774
+ // verify required parameter 'customerCode' is not null or undefined
775
+ assertParamExists('uploadAccountDocuments', 'customerCode', customerCode)
776
+ const localVarPath = `/v1/customers/{customerCode}/documents`
777
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
778
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
779
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
780
+ let baseOptions;
781
+ let baseAccessToken;
782
+ if (configuration) {
783
+ baseOptions = configuration.baseOptions;
784
+ baseAccessToken = configuration.accessToken;
785
+ }
786
+
787
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
788
+ const localVarHeaderParameter = {} as any;
789
+ const localVarQueryParameter = {} as any;
790
+
791
+
792
+
793
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
794
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
795
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
796
+
797
+ return {
798
+ url: toPathString(localVarUrlObj),
799
+ options: localVarRequestOptions,
800
+ };
801
+ },
764
802
  /**
765
803
  * Verify the invite sent to the customer via email.
766
804
  * @summary Verify customer\'s invite token
@@ -1040,6 +1078,17 @@ export const CustomersApiFp = function(configuration?: Configuration) {
1040
1078
  const localVarAxiosArgs = await localVarAxiosParamCreator.updateCustomer(customerCode, updateCustomerRequestDto, authorization, options);
1041
1079
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1042
1080
  },
1081
+ /**
1082
+ * API to upload and attach documents to an account.
1083
+ * @summary Upload account documents
1084
+ * @param {string} customerCode
1085
+ * @param {*} [options] Override http request option.
1086
+ * @throws {RequiredError}
1087
+ */
1088
+ async uploadAccountDocuments(customerCode: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePresignedPostResponseClass>> {
1089
+ const localVarAxiosArgs = await localVarAxiosParamCreator.uploadAccountDocuments(customerCode, options);
1090
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1091
+ },
1043
1092
  /**
1044
1093
  * Verify the invite sent to the customer via email.
1045
1094
  * @summary Verify customer\'s invite token
@@ -1248,6 +1297,16 @@ export const CustomersApiFactory = function (configuration?: Configuration, base
1248
1297
  updateCustomer(customerCode: string, updateCustomerRequestDto: UpdateCustomerRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateCustomerResponseClass> {
1249
1298
  return localVarFp.updateCustomer(customerCode, updateCustomerRequestDto, authorization, options).then((request) => request(axios, basePath));
1250
1299
  },
1300
+ /**
1301
+ * API to upload and attach documents to an account.
1302
+ * @summary Upload account documents
1303
+ * @param {string} customerCode
1304
+ * @param {*} [options] Override http request option.
1305
+ * @throws {RequiredError}
1306
+ */
1307
+ uploadAccountDocuments(customerCode: string, options?: any): AxiosPromise<CreatePresignedPostResponseClass> {
1308
+ return localVarFp.uploadAccountDocuments(customerCode, options).then((request) => request(axios, basePath));
1309
+ },
1251
1310
  /**
1252
1311
  * Verify the invite sent to the customer via email.
1253
1312
  * @summary Verify customer\'s invite token
@@ -1663,6 +1722,20 @@ export interface CustomersApiUpdateCustomerRequest {
1663
1722
  readonly authorization?: string
1664
1723
  }
1665
1724
 
1725
+ /**
1726
+ * Request parameters for uploadAccountDocuments operation in CustomersApi.
1727
+ * @export
1728
+ * @interface CustomersApiUploadAccountDocumentsRequest
1729
+ */
1730
+ export interface CustomersApiUploadAccountDocumentsRequest {
1731
+ /**
1732
+ *
1733
+ * @type {string}
1734
+ * @memberof CustomersApiUploadAccountDocuments
1735
+ */
1736
+ readonly customerCode: string
1737
+ }
1738
+
1666
1739
  /**
1667
1740
  * Request parameters for verifyInvite operation in CustomersApi.
1668
1741
  * @export
@@ -1878,6 +1951,18 @@ export class CustomersApi extends BaseAPI {
1878
1951
  return CustomersApiFp(this.configuration).updateCustomer(requestParameters.customerCode, requestParameters.updateCustomerRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1879
1952
  }
1880
1953
 
1954
+ /**
1955
+ * API to upload and attach documents to an account.
1956
+ * @summary Upload account documents
1957
+ * @param {CustomersApiUploadAccountDocumentsRequest} requestParameters Request parameters.
1958
+ * @param {*} [options] Override http request option.
1959
+ * @throws {RequiredError}
1960
+ * @memberof CustomersApi
1961
+ */
1962
+ public uploadAccountDocuments(requestParameters: CustomersApiUploadAccountDocumentsRequest, options?: AxiosRequestConfig) {
1963
+ return CustomersApiFp(this.configuration).uploadAccountDocuments(requestParameters.customerCode, options).then((request) => request(this.axios, this.basePath));
1964
+ }
1965
+
1881
1966
  /**
1882
1967
  * Verify the invite sent to the customer via email.
1883
1968
  * @summary Verify customer\'s invite token
@@ -48,10 +48,60 @@ const FormData = require('form-data');
48
48
  */
49
49
  export const PoliciesApiAxiosParamCreator = function (configuration?: Configuration) {
50
50
  return {
51
+ /**
52
+ * Get detailed policy that belongs to a customer; the details are filtered to return only the current version and the interval timeline that the provided date is included. If the date is not specified, the system will return the whole timeline.
53
+ * @summary Get current policy version details. Can be filtered by a specific date.
54
+ * @param {string} policyCode The policy code.
55
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
56
+ * @param {string} [timesliceDate] This date is used to filter data of the policy, to select the appropriate timeslice. If no date is specified, the system returns all the timeslices.
57
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
58
+ * @param {*} [options] Override http request option.
59
+ * @throws {RequiredError}
60
+ */
61
+ getCustomerPolicyDataByDate: async (policyCode: string, customerCode: string, timesliceDate?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
62
+ // verify required parameter 'policyCode' is not null or undefined
63
+ assertParamExists('getCustomerPolicyDataByDate', 'policyCode', policyCode)
64
+ // verify required parameter 'customerCode' is not null or undefined
65
+ assertParamExists('getCustomerPolicyDataByDate', 'customerCode', customerCode)
66
+ const localVarPath = `/v1/customers/{customerCode}/policies/{policyCode}/current-version`
67
+ .replace(`{${"policyCode"}}`, encodeURIComponent(String(policyCode)))
68
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
69
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
70
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
71
+ let baseOptions;
72
+ let baseAccessToken;
73
+ if (configuration) {
74
+ baseOptions = configuration.baseOptions;
75
+ baseAccessToken = configuration.accessToken;
76
+ }
77
+
78
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
79
+ const localVarHeaderParameter = {} as any;
80
+ const localVarQueryParameter = {} as any;
81
+
82
+ if (timesliceDate !== undefined) {
83
+ localVarQueryParameter['timesliceDate'] = timesliceDate;
84
+ }
85
+
86
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
87
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
88
+ }
89
+
90
+
91
+
92
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
93
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
94
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
95
+
96
+ return {
97
+ url: toPathString(localVarUrlObj),
98
+ options: localVarRequestOptions,
99
+ };
100
+ },
51
101
  /**
52
102
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
53
103
  * @summary Get policy details
54
- * @param {string} policyCode The code of the policy that the customer wants to fetch
104
+ * @param {string} policyCode The policy code.
55
105
  * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
56
106
  * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
57
107
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
@@ -372,10 +422,24 @@ export const PoliciesApiAxiosParamCreator = function (configuration?: Configurat
372
422
  export const PoliciesApiFp = function(configuration?: Configuration) {
373
423
  const localVarAxiosParamCreator = PoliciesApiAxiosParamCreator(configuration)
374
424
  return {
425
+ /**
426
+ * Get detailed policy that belongs to a customer; the details are filtered to return only the current version and the interval timeline that the provided date is included. If the date is not specified, the system will return the whole timeline.
427
+ * @summary Get current policy version details. Can be filtered by a specific date.
428
+ * @param {string} policyCode The policy code.
429
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
430
+ * @param {string} [timesliceDate] This date is used to filter data of the policy, to select the appropriate timeslice. If no date is specified, the system returns all the timeslices.
431
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
432
+ * @param {*} [options] Override http request option.
433
+ * @throws {RequiredError}
434
+ */
435
+ async getCustomerPolicyDataByDate(policyCode: string, customerCode: string, timesliceDate?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPolicyResponseClass>> {
436
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCustomerPolicyDataByDate(policyCode, customerCode, timesliceDate, authorization, options);
437
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
438
+ },
375
439
  /**
376
440
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
377
441
  * @summary Get policy details
378
- * @param {string} policyCode The code of the policy that the customer wants to fetch
442
+ * @param {string} policyCode The policy code.
379
443
  * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
380
444
  * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
381
445
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
@@ -468,10 +532,23 @@ export const PoliciesApiFp = function(configuration?: Configuration) {
468
532
  export const PoliciesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
469
533
  const localVarFp = PoliciesApiFp(configuration)
470
534
  return {
535
+ /**
536
+ * Get detailed policy that belongs to a customer; the details are filtered to return only the current version and the interval timeline that the provided date is included. If the date is not specified, the system will return the whole timeline.
537
+ * @summary Get current policy version details. Can be filtered by a specific date.
538
+ * @param {string} policyCode The policy code.
539
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
540
+ * @param {string} [timesliceDate] This date is used to filter data of the policy, to select the appropriate timeslice. If no date is specified, the system returns all the timeslices.
541
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
542
+ * @param {*} [options] Override http request option.
543
+ * @throws {RequiredError}
544
+ */
545
+ getCustomerPolicyDataByDate(policyCode: string, customerCode: string, timesliceDate?: string, authorization?: string, options?: any): AxiosPromise<GetPolicyResponseClass> {
546
+ return localVarFp.getCustomerPolicyDataByDate(policyCode, customerCode, timesliceDate, authorization, options).then((request) => request(axios, basePath));
547
+ },
471
548
  /**
472
549
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
473
550
  * @summary Get policy details
474
- * @param {string} policyCode The code of the policy that the customer wants to fetch
551
+ * @param {string} policyCode The policy code.
475
552
  * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
476
553
  * @param {string} [expand] Fields to expand response by - [versions, premiumItems]
477
554
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
@@ -551,6 +628,41 @@ export const PoliciesApiFactory = function (configuration?: Configuration, baseP
551
628
  };
552
629
  };
553
630
 
631
+ /**
632
+ * Request parameters for getCustomerPolicyDataByDate operation in PoliciesApi.
633
+ * @export
634
+ * @interface PoliciesApiGetCustomerPolicyDataByDateRequest
635
+ */
636
+ export interface PoliciesApiGetCustomerPolicyDataByDateRequest {
637
+ /**
638
+ * The policy code.
639
+ * @type {string}
640
+ * @memberof PoliciesApiGetCustomerPolicyDataByDate
641
+ */
642
+ readonly policyCode: string
643
+
644
+ /**
645
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
646
+ * @type {string}
647
+ * @memberof PoliciesApiGetCustomerPolicyDataByDate
648
+ */
649
+ readonly customerCode: string
650
+
651
+ /**
652
+ * This date is used to filter data of the policy, to select the appropriate timeslice. If no date is specified, the system returns all the timeslices.
653
+ * @type {string}
654
+ * @memberof PoliciesApiGetCustomerPolicyDataByDate
655
+ */
656
+ readonly timesliceDate?: string
657
+
658
+ /**
659
+ * Bearer Token: provided by the login endpoint under the name accessToken.
660
+ * @type {string}
661
+ * @memberof PoliciesApiGetCustomerPolicyDataByDate
662
+ */
663
+ readonly authorization?: string
664
+ }
665
+
554
666
  /**
555
667
  * Request parameters for getPolicy operation in PoliciesApi.
556
668
  * @export
@@ -558,7 +670,7 @@ export const PoliciesApiFactory = function (configuration?: Configuration, baseP
558
670
  */
559
671
  export interface PoliciesApiGetPolicyRequest {
560
672
  /**
561
- * The code of the policy that the customer wants to fetch
673
+ * The policy code.
562
674
  * @type {string}
563
675
  * @memberof PoliciesApiGetPolicy
564
676
  */
@@ -782,6 +894,18 @@ export interface PoliciesApiWithdrawCustomerPolicyRequest {
782
894
  * @extends {BaseAPI}
783
895
  */
784
896
  export class PoliciesApi extends BaseAPI {
897
+ /**
898
+ * Get detailed policy that belongs to a customer; the details are filtered to return only the current version and the interval timeline that the provided date is included. If the date is not specified, the system will return the whole timeline.
899
+ * @summary Get current policy version details. Can be filtered by a specific date.
900
+ * @param {PoliciesApiGetCustomerPolicyDataByDateRequest} requestParameters Request parameters.
901
+ * @param {*} [options] Override http request option.
902
+ * @throws {RequiredError}
903
+ * @memberof PoliciesApi
904
+ */
905
+ public getCustomerPolicyDataByDate(requestParameters: PoliciesApiGetCustomerPolicyDataByDateRequest, options?: AxiosRequestConfig) {
906
+ return PoliciesApiFp(this.configuration).getCustomerPolicyDataByDate(requestParameters.policyCode, requestParameters.customerCode, requestParameters.timesliceDate, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
907
+ }
908
+
785
909
  /**
786
910
  * Get detailed policy that belongs to a customer; the details can be expanded using expand query parameter.
787
911
  * @summary Get policy details