@emilgroup/customer-sdk-node 1.6.1 → 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.
Files changed (204) hide show
  1. package/.openapi-generator/FILES +18 -0
  2. package/README.md +2 -2
  3. package/api/claims-api.ts +557 -0
  4. package/api/customers-api.ts +305 -684
  5. package/api/policies-api.ts +980 -0
  6. package/api/products-api.ts +357 -0
  7. package/api.ts +7 -1
  8. package/base.ts +24 -32
  9. package/common.ts +2 -1
  10. package/configuration.ts +1 -1
  11. package/dist/api/claims-api.d.ts +327 -0
  12. package/dist/api/claims-api.js +508 -0
  13. package/dist/api/customers-api.d.ts +213 -443
  14. package/dist/api/customers-api.js +232 -475
  15. package/dist/api/policies-api.d.ts +578 -0
  16. package/dist/api/policies-api.js +808 -0
  17. package/dist/api/products-api.d.ts +215 -0
  18. package/dist/api/products-api.js +341 -0
  19. package/dist/api.d.ts +4 -1
  20. package/dist/api.js +4 -1
  21. package/dist/base.d.ts +2 -3
  22. package/dist/base.js +20 -21
  23. package/dist/common.d.ts +1 -1
  24. package/dist/common.js +2 -2
  25. package/dist/configuration.d.ts +1 -1
  26. package/dist/configuration.js +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/models/account-class.d.ts +1 -1
  30. package/dist/models/account-class.js +1 -1
  31. package/dist/models/account-policy-class.d.ts +1 -1
  32. package/dist/models/account-policy-class.js +1 -1
  33. package/dist/models/authentication-result-class.d.ts +1 -1
  34. package/dist/models/authentication-result-class.js +1 -1
  35. package/dist/models/complete-braintree-payment-setup-request-dto.d.ts +48 -0
  36. package/dist/models/complete-braintree-payment-setup-request-dto.js +15 -0
  37. package/dist/models/complete-payment-setup-psp-request.d.ts +32 -0
  38. package/dist/models/complete-payment-setup-psp-request.js +15 -0
  39. package/dist/models/complete-payment-setup-response-class.d.ts +24 -0
  40. package/dist/models/complete-payment-setup-response-class.js +15 -0
  41. package/dist/models/complete-stripe-payment-setup-request-dto.d.ts +60 -0
  42. package/dist/models/complete-stripe-payment-setup-request-dto.js +15 -0
  43. package/dist/models/create-account-request-dto.d.ts +96 -0
  44. package/dist/models/create-account-request-dto.js +21 -0
  45. package/dist/models/create-customer-claim-request-dto.d.ts +108 -0
  46. package/dist/models/create-customer-claim-request-dto.js +15 -0
  47. package/dist/models/create-customer-request-dto.d.ts +8 -1
  48. package/dist/models/create-customer-request-dto.js +1 -1
  49. package/dist/models/create-customer-response-class.d.ts +1 -1
  50. package/dist/models/create-customer-response-class.js +1 -1
  51. package/dist/models/create-presigned-post-response-class.d.ts +30 -0
  52. package/dist/models/create-presigned-post-response-class.js +15 -0
  53. package/dist/models/customer-class.d.ts +8 -2
  54. package/dist/models/customer-class.js +1 -1
  55. package/dist/models/customer-document-class.d.ts +2 -2
  56. package/dist/models/customer-document-class.js +1 -1
  57. package/dist/models/customer-product-class.d.ts +54 -0
  58. package/dist/models/customer-product-class.js +15 -0
  59. package/dist/models/forgot-password-request-dto.d.ts +1 -1
  60. package/dist/models/forgot-password-request-dto.js +1 -1
  61. package/dist/models/get-customer-document-download-url-response-class.d.ts +1 -1
  62. package/dist/models/get-customer-document-download-url-response-class.js +1 -1
  63. package/dist/models/get-customer-response-class.d.ts +1 -1
  64. package/dist/models/get-customer-response-class.js +1 -1
  65. package/dist/models/get-policy-response-class.d.ts +1 -1
  66. package/dist/models/get-policy-response-class.js +1 -1
  67. package/dist/models/get-product-response-class.d.ts +25 -0
  68. package/dist/models/get-product-response-class.js +15 -0
  69. package/dist/models/index.d.ts +15 -0
  70. package/dist/models/index.js +15 -0
  71. package/dist/models/initiate-auth-request-dto.d.ts +1 -1
  72. package/dist/models/initiate-auth-request-dto.js +1 -1
  73. package/dist/models/initiate-auth-response-class.d.ts +1 -1
  74. package/dist/models/initiate-auth-response-class.js +1 -1
  75. package/dist/models/initiate-braintree-payment-setup-response-class.d.ts +24 -0
  76. package/dist/models/initiate-braintree-payment-setup-response-class.js +15 -0
  77. package/dist/models/initiate-payment-setup-response-class.d.ts +32 -0
  78. package/dist/models/initiate-payment-setup-response-class.js +15 -0
  79. package/dist/models/initiate-stripe-payment-setup-response-class.d.ts +30 -0
  80. package/dist/models/initiate-stripe-payment-setup-response-class.js +15 -0
  81. package/dist/models/invite-by-customer-request-dto.d.ts +1 -1
  82. package/dist/models/invite-by-customer-request-dto.js +1 -1
  83. package/dist/models/invite-by-customer-response-class.d.ts +1 -1
  84. package/dist/models/invite-by-customer-response-class.js +1 -1
  85. package/dist/models/invite-by-tenant-response-class.d.ts +1 -1
  86. package/dist/models/invite-by-tenant-response-class.js +1 -1
  87. package/dist/models/invite-class.d.ts +1 -1
  88. package/dist/models/invite-class.js +1 -1
  89. package/dist/models/invoice-class.d.ts +3 -3
  90. package/dist/models/invoice-class.js +1 -1
  91. package/dist/models/list-documents-response-class.d.ts +1 -1
  92. package/dist/models/list-documents-response-class.js +1 -1
  93. package/dist/models/list-invoices-response-class.d.ts +1 -1
  94. package/dist/models/list-invoices-response-class.js +1 -1
  95. package/dist/models/list-policies-response-class.d.ts +5 -5
  96. package/dist/models/list-policies-response-class.js +1 -1
  97. package/dist/models/policy-class.d.ts +14 -1
  98. package/dist/models/policy-class.js +1 -1
  99. package/dist/models/policy-object-class.d.ts +1 -1
  100. package/dist/models/policy-object-class.js +1 -1
  101. package/dist/models/policy-premium-class.d.ts +1 -1
  102. package/dist/models/policy-premium-class.js +1 -1
  103. package/dist/models/policy-premium-item-class.d.ts +1 -1
  104. package/dist/models/policy-premium-item-class.js +1 -1
  105. package/dist/models/policy-version-class.d.ts +1 -1
  106. package/dist/models/policy-version-class.js +1 -1
  107. package/dist/models/refresh-token-dto.d.ts +1 -1
  108. package/dist/models/refresh-token-dto.js +1 -1
  109. package/dist/models/request-policy-update-request-dto.d.ts +1 -1
  110. package/dist/models/request-policy-update-request-dto.js +1 -1
  111. package/dist/models/request-policy-update-response-class.d.ts +1 -1
  112. package/dist/models/request-policy-update-response-class.js +1 -1
  113. package/dist/models/reset-password-by-customer-request-dto.d.ts +1 -1
  114. package/dist/models/reset-password-by-customer-request-dto.js +1 -1
  115. package/dist/models/respond-to-auth-challenge-class.d.ts +1 -1
  116. package/dist/models/respond-to-auth-challenge-class.js +1 -1
  117. package/dist/models/respond-to-auth-challenge-request-dto.d.ts +1 -1
  118. package/dist/models/respond-to-auth-challenge-request-dto.js +1 -1
  119. package/dist/models/shared-customer-policy-object-request-dto.d.ts +1 -1
  120. package/dist/models/shared-customer-policy-object-request-dto.js +1 -1
  121. package/dist/models/shared-invoice-item-class.d.ts +1 -1
  122. package/dist/models/shared-invoice-item-class.js +1 -1
  123. package/dist/models/terminate-customer-policy-request-dto.d.ts +1 -1
  124. package/dist/models/terminate-customer-policy-request-dto.js +1 -1
  125. package/dist/models/terminate-customer-policy-response-class.d.ts +1 -1
  126. package/dist/models/terminate-customer-policy-response-class.js +1 -1
  127. package/dist/models/timeslice-class.d.ts +1 -1
  128. package/dist/models/timeslice-class.js +1 -1
  129. package/dist/models/update-account-request-dto.d.ts +2 -2
  130. package/dist/models/update-account-request-dto.js +1 -1
  131. package/dist/models/update-customer-claim-request-dto.d.ts +120 -0
  132. package/dist/models/update-customer-claim-request-dto.js +15 -0
  133. package/dist/models/update-customer-request-dto.d.ts +1 -1
  134. package/dist/models/update-customer-request-dto.js +1 -1
  135. package/dist/models/update-customer-response-class.d.ts +1 -1
  136. package/dist/models/update-customer-response-class.js +1 -1
  137. package/dist/models/upload-customer-claim-documents-request-dto.d.ts +36 -0
  138. package/dist/models/upload-customer-claim-documents-request-dto.js +15 -0
  139. package/dist/models/upload-customer-policy-documents-request-dto.d.ts +47 -0
  140. package/dist/models/upload-customer-policy-documents-request-dto.js +20 -0
  141. package/dist/models/verify-customer-invite-response-class.d.ts +1 -1
  142. package/dist/models/verify-customer-invite-response-class.js +1 -1
  143. package/dist/models/withdraw-customer-policy-response-class.d.ts +1 -1
  144. package/dist/models/withdraw-customer-policy-response-class.js +1 -1
  145. package/index.ts +1 -1
  146. package/models/account-class.ts +1 -1
  147. package/models/account-policy-class.ts +1 -1
  148. package/models/authentication-result-class.ts +1 -1
  149. package/models/complete-braintree-payment-setup-request-dto.ts +54 -0
  150. package/models/complete-payment-setup-psp-request.ts +38 -0
  151. package/models/complete-payment-setup-response-class.ts +30 -0
  152. package/models/complete-stripe-payment-setup-request-dto.ts +66 -0
  153. package/models/create-account-request-dto.ts +105 -0
  154. package/models/create-customer-claim-request-dto.ts +114 -0
  155. package/models/create-customer-request-dto.ts +8 -1
  156. package/models/create-customer-response-class.ts +1 -1
  157. package/models/create-presigned-post-response-class.ts +36 -0
  158. package/models/customer-class.ts +8 -2
  159. package/models/customer-document-class.ts +1 -1
  160. package/models/customer-product-class.ts +60 -0
  161. package/models/forgot-password-request-dto.ts +1 -1
  162. package/models/get-customer-document-download-url-response-class.ts +1 -1
  163. package/models/get-customer-response-class.ts +1 -1
  164. package/models/get-policy-response-class.ts +1 -1
  165. package/models/get-product-response-class.ts +31 -0
  166. package/models/index.ts +15 -0
  167. package/models/initiate-auth-request-dto.ts +1 -1
  168. package/models/initiate-auth-response-class.ts +1 -1
  169. package/models/initiate-braintree-payment-setup-response-class.ts +30 -0
  170. package/models/initiate-payment-setup-response-class.ts +38 -0
  171. package/models/initiate-stripe-payment-setup-response-class.ts +36 -0
  172. package/models/invite-by-customer-request-dto.ts +1 -1
  173. package/models/invite-by-customer-response-class.ts +1 -1
  174. package/models/invite-by-tenant-response-class.ts +1 -1
  175. package/models/invite-class.ts +1 -1
  176. package/models/invoice-class.ts +1 -1
  177. package/models/list-documents-response-class.ts +1 -1
  178. package/models/list-invoices-response-class.ts +1 -1
  179. package/models/list-policies-response-class.ts +5 -5
  180. package/models/policy-class.ts +14 -1
  181. package/models/policy-object-class.ts +1 -1
  182. package/models/policy-premium-class.ts +1 -1
  183. package/models/policy-premium-item-class.ts +1 -1
  184. package/models/policy-version-class.ts +1 -1
  185. package/models/refresh-token-dto.ts +1 -1
  186. package/models/request-policy-update-request-dto.ts +1 -1
  187. package/models/request-policy-update-response-class.ts +1 -1
  188. package/models/reset-password-by-customer-request-dto.ts +1 -1
  189. package/models/respond-to-auth-challenge-class.ts +1 -1
  190. package/models/respond-to-auth-challenge-request-dto.ts +1 -1
  191. package/models/shared-customer-policy-object-request-dto.ts +1 -1
  192. package/models/shared-invoice-item-class.ts +1 -1
  193. package/models/terminate-customer-policy-request-dto.ts +1 -1
  194. package/models/terminate-customer-policy-response-class.ts +1 -1
  195. package/models/timeslice-class.ts +1 -1
  196. package/models/update-account-request-dto.ts +1 -1
  197. package/models/update-customer-claim-request-dto.ts +126 -0
  198. package/models/update-customer-request-dto.ts +1 -1
  199. package/models/update-customer-response-class.ts +1 -1
  200. package/models/upload-customer-claim-documents-request-dto.ts +42 -0
  201. package/models/upload-customer-policy-documents-request-dto.ts +56 -0
  202. package/models/verify-customer-invite-response-class.ts +1 -1
  203. package/models/withdraw-customer-policy-response-class.ts +1 -1
  204. package/package.json +2 -3
@@ -0,0 +1,357 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL CustomerService
5
+ * The EMIL CustomerService API description
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ * Contact: kontakt@emil.de
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
17
+ import { Configuration } from '../configuration';
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
+ // @ts-ignore
22
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
+ // @ts-ignore
24
+ import { GetProductResponseClass } from '../models';
25
+ // @ts-ignore
26
+ import { ListPoliciesResponseClass } from '../models';
27
+ // URLSearchParams not necessarily used
28
+ // @ts-ignore
29
+ import { URL, URLSearchParams } from 'url';
30
+ const FormData = require('form-data');
31
+ /**
32
+ * ProductsApi - axios parameter creator
33
+ * @export
34
+ */
35
+ export const ProductsApiAxiosParamCreator = function (configuration?: Configuration) {
36
+ return {
37
+ /**
38
+ * Get detailed product that a customer can insure; the details can be expanded using expand query parameter.
39
+ * @summary Get product details
40
+ * @param {string} productCode The product code.
41
+ * @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
42
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
43
+ * @param {*} [options] Override http request option.
44
+ * @throws {RequiredError}
45
+ */
46
+ getProduct: async (productCode: string, customerCode: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
47
+ // verify required parameter 'productCode' is not null or undefined
48
+ assertParamExists('getProduct', 'productCode', productCode)
49
+ // verify required parameter 'customerCode' is not null or undefined
50
+ assertParamExists('getProduct', 'customerCode', customerCode)
51
+ const localVarPath = `/v1/customers/{customerCode}/products/{productCode}`
52
+ .replace(`{${"productCode"}}`, encodeURIComponent(String(productCode)))
53
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
54
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
55
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
56
+ let baseOptions;
57
+ let baseAccessToken;
58
+ if (configuration) {
59
+ baseOptions = configuration.baseOptions;
60
+ baseAccessToken = configuration.accessToken;
61
+ }
62
+
63
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
64
+ const localVarHeaderParameter = {} as any;
65
+ const localVarQueryParameter = {} as any;
66
+
67
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
68
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
69
+ }
70
+
71
+
72
+
73
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
74
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
75
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
76
+
77
+ return {
78
+ url: toPathString(localVarUrlObj),
79
+ options: localVarRequestOptions,
80
+ };
81
+ },
82
+ /**
83
+ * List all the products that a customer can insure, the products can be filtered by product code, product number.
84
+ * @summary List products available to insure for a customer
85
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
86
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
87
+ * @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.
88
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
89
+ * @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.
90
+ * @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.
91
+ * @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.
92
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
93
+ * @param {*} [options] Override http request option.
94
+ * @throws {RequiredError}
95
+ */
96
+ listProducts: async (customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
97
+ // verify required parameter 'customerCode' is not null or undefined
98
+ assertParamExists('listProducts', 'customerCode', customerCode)
99
+ const localVarPath = `/v1/customers/{customerCode}/products`
100
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
101
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
102
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
103
+ let baseOptions;
104
+ let baseAccessToken;
105
+ if (configuration) {
106
+ baseOptions = configuration.baseOptions;
107
+ baseAccessToken = configuration.accessToken;
108
+ }
109
+
110
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
111
+ const localVarHeaderParameter = {} as any;
112
+ const localVarQueryParameter = {} as any;
113
+
114
+ if (pageSize !== undefined) {
115
+ localVarQueryParameter['pageSize'] = pageSize;
116
+ }
117
+
118
+ if (pageToken !== undefined) {
119
+ localVarQueryParameter['pageToken'] = pageToken;
120
+ }
121
+
122
+ if (filter !== undefined) {
123
+ localVarQueryParameter['filter'] = filter;
124
+ }
125
+
126
+ if (search !== undefined) {
127
+ localVarQueryParameter['search'] = search;
128
+ }
129
+
130
+ if (order !== undefined) {
131
+ localVarQueryParameter['order'] = order;
132
+ }
133
+
134
+ if (expand !== undefined) {
135
+ localVarQueryParameter['expand'] = expand;
136
+ }
137
+
138
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
139
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
140
+ }
141
+
142
+
143
+
144
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
145
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
146
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
147
+
148
+ return {
149
+ url: toPathString(localVarUrlObj),
150
+ options: localVarRequestOptions,
151
+ };
152
+ },
153
+ }
154
+ };
155
+
156
+ /**
157
+ * ProductsApi - functional programming interface
158
+ * @export
159
+ */
160
+ export const ProductsApiFp = function(configuration?: Configuration) {
161
+ const localVarAxiosParamCreator = ProductsApiAxiosParamCreator(configuration)
162
+ return {
163
+ /**
164
+ * Get detailed product that a customer can insure; the details can be expanded using expand query parameter.
165
+ * @summary Get product details
166
+ * @param {string} productCode The product code.
167
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
168
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
169
+ * @param {*} [options] Override http request option.
170
+ * @throws {RequiredError}
171
+ */
172
+ async getProduct(productCode: string, customerCode: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductResponseClass>> {
173
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getProduct(productCode, customerCode, authorization, options);
174
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
175
+ },
176
+ /**
177
+ * List all the products that a customer can insure, the products can be filtered by product code, product number.
178
+ * @summary List products available to insure for a customer
179
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
180
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
181
+ * @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.
182
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
183
+ * @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.
184
+ * @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.
185
+ * @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.
186
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
187
+ * @param {*} [options] Override http request option.
188
+ * @throws {RequiredError}
189
+ */
190
+ async listProducts(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesResponseClass>> {
191
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listProducts(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options);
192
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
193
+ },
194
+ }
195
+ };
196
+
197
+ /**
198
+ * ProductsApi - factory interface
199
+ * @export
200
+ */
201
+ export const ProductsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
202
+ const localVarFp = ProductsApiFp(configuration)
203
+ return {
204
+ /**
205
+ * Get detailed product that a customer can insure; the details can be expanded using expand query parameter.
206
+ * @summary Get product details
207
+ * @param {string} productCode The product code.
208
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
209
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
210
+ * @param {*} [options] Override http request option.
211
+ * @throws {RequiredError}
212
+ */
213
+ getProduct(productCode: string, customerCode: string, authorization?: string, options?: any): AxiosPromise<GetProductResponseClass> {
214
+ return localVarFp.getProduct(productCode, customerCode, authorization, options).then((request) => request(axios, basePath));
215
+ },
216
+ /**
217
+ * List all the products that a customer can insure, the products can be filtered by product code, product number.
218
+ * @summary List products available to insure for a customer
219
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
220
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
221
+ * @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.
222
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
223
+ * @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.
224
+ * @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.
225
+ * @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.
226
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
227
+ * @param {*} [options] Override http request option.
228
+ * @throws {RequiredError}
229
+ */
230
+ listProducts(customerCode: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, authorization?: string, options?: any): AxiosPromise<ListPoliciesResponseClass> {
231
+ return localVarFp.listProducts(customerCode, pageSize, pageToken, filter, search, order, expand, authorization, options).then((request) => request(axios, basePath));
232
+ },
233
+ };
234
+ };
235
+
236
+ /**
237
+ * Request parameters for getProduct operation in ProductsApi.
238
+ * @export
239
+ * @interface ProductsApiGetProductRequest
240
+ */
241
+ export interface ProductsApiGetProductRequest {
242
+ /**
243
+ * The product code.
244
+ * @type {string}
245
+ * @memberof ProductsApiGetProduct
246
+ */
247
+ readonly productCode: string
248
+
249
+ /**
250
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
251
+ * @type {string}
252
+ * @memberof ProductsApiGetProduct
253
+ */
254
+ readonly customerCode: string
255
+
256
+ /**
257
+ * Bearer Token: provided by the login endpoint under the name accessToken.
258
+ * @type {string}
259
+ * @memberof ProductsApiGetProduct
260
+ */
261
+ readonly authorization?: string
262
+ }
263
+
264
+ /**
265
+ * Request parameters for listProducts operation in ProductsApi.
266
+ * @export
267
+ * @interface ProductsApiListProductsRequest
268
+ */
269
+ export interface ProductsApiListProductsRequest {
270
+ /**
271
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
272
+ * @type {string}
273
+ * @memberof ProductsApiListProducts
274
+ */
275
+ readonly customerCode: string
276
+
277
+ /**
278
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
279
+ * @type {any}
280
+ * @memberof ProductsApiListProducts
281
+ */
282
+ readonly pageSize?: any
283
+
284
+ /**
285
+ * 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.
286
+ * @type {any}
287
+ * @memberof ProductsApiListProducts
288
+ */
289
+ readonly pageToken?: any
290
+
291
+ /**
292
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
293
+ * @type {any}
294
+ * @memberof ProductsApiListProducts
295
+ */
296
+ readonly filter?: any
297
+
298
+ /**
299
+ * 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.
300
+ * @type {any}
301
+ * @memberof ProductsApiListProducts
302
+ */
303
+ readonly search?: any
304
+
305
+ /**
306
+ * 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.
307
+ * @type {any}
308
+ * @memberof ProductsApiListProducts
309
+ */
310
+ readonly order?: any
311
+
312
+ /**
313
+ * 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.
314
+ * @type {any}
315
+ * @memberof ProductsApiListProducts
316
+ */
317
+ readonly expand?: any
318
+
319
+ /**
320
+ * Bearer Token: provided by the login endpoint under the name accessToken.
321
+ * @type {string}
322
+ * @memberof ProductsApiListProducts
323
+ */
324
+ readonly authorization?: string
325
+ }
326
+
327
+ /**
328
+ * ProductsApi - object-oriented interface
329
+ * @export
330
+ * @class ProductsApi
331
+ * @extends {BaseAPI}
332
+ */
333
+ export class ProductsApi extends BaseAPI {
334
+ /**
335
+ * Get detailed product that a customer can insure; the details can be expanded using expand query parameter.
336
+ * @summary Get product details
337
+ * @param {ProductsApiGetProductRequest} requestParameters Request parameters.
338
+ * @param {*} [options] Override http request option.
339
+ * @throws {RequiredError}
340
+ * @memberof ProductsApi
341
+ */
342
+ public getProduct(requestParameters: ProductsApiGetProductRequest, options?: AxiosRequestConfig) {
343
+ return ProductsApiFp(this.configuration).getProduct(requestParameters.productCode, requestParameters.customerCode, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
344
+ }
345
+
346
+ /**
347
+ * List all the products that a customer can insure, the products can be filtered by product code, product number.
348
+ * @summary List products available to insure for a customer
349
+ * @param {ProductsApiListProductsRequest} requestParameters Request parameters.
350
+ * @param {*} [options] Override http request option.
351
+ * @throws {RequiredError}
352
+ * @memberof ProductsApi
353
+ */
354
+ public listProducts(requestParameters: ProductsApiListProductsRequest, options?: AxiosRequestConfig) {
355
+ return ProductsApiFp(this.configuration).listProducts(requestParameters.customerCode, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
356
+ }
357
+ }
package/api.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * The EMIL CustomerService API description
6
6
  *
7
7
  * The version of the OpenAPI document: 1.0
8
- *
8
+ * Contact: kontakt@emil.de
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
11
  * https://openapi-generator.tech
@@ -24,10 +24,16 @@ import FormData from 'form-data'
24
24
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
25
25
  // @ts-ignore
26
26
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
27
+ import { ClaimsApi } from './api';
27
28
  import { CustomersApi } from './api';
29
+ import { PoliciesApi } from './api';
30
+ import { ProductsApi } from './api';
28
31
 
29
32
 
33
+ export * from './api/claims-api';
30
34
  export * from './api/customers-api';
35
+ export * from './api/policies-api';
36
+ export * from './api/products-api';
31
37
 
32
38
 
33
39
  export enum Environment {
package/base.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * The EMIL CustomerService API description
6
6
  *
7
7
  * The version of the OpenAPI document: 1.0
8
- *
8
+ * Contact: kontakt@emil.de
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
11
  * https://openapi-generator.tech
@@ -43,7 +43,6 @@ export const COLLECTION_FORMATS = {
43
43
  export interface LoginClass {
44
44
  accessToken: string;
45
45
  permissions: Array<string>;
46
- newPasswordRequired: boolean;
47
46
  }
48
47
 
49
48
  export enum Environment {
@@ -51,6 +50,13 @@ export enum Environment {
51
50
  Test = 'https://apiv2-test.emil.de',
52
51
  }
53
52
 
53
+ let _retry_count = 0
54
+ let _retry = null
55
+
56
+ export function resetRetry() {
57
+ _retry_count = 0
58
+ }
59
+
54
60
  /**
55
61
  *
56
62
  * @export
@@ -70,7 +76,6 @@ const NETWORK_ERROR_MESSAGE = "Network Error";
70
76
  */
71
77
  export class BaseAPI {
72
78
  protected configuration: Configuration | undefined;
73
- private lastRequestConfig?: AxiosRequestConfig;
74
79
  private username?: string;
75
80
  private password?: string;
76
81
  private isCustomerToken = false;
@@ -245,6 +250,7 @@ export class BaseAPI {
245
250
  data: { username: username },
246
251
  withCredentials: true,
247
252
  };
253
+
248
254
  const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
249
255
 
250
256
  return accessToken;
@@ -268,7 +274,7 @@ export class BaseAPI {
268
274
  withCredentials: true,
269
275
  };
270
276
 
271
- const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
277
+ const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
272
278
 
273
279
  return accessToken;
274
280
  }
@@ -284,13 +290,6 @@ export class BaseAPI {
284
290
  }
285
291
 
286
292
  private attachInterceptor(axios: AxiosInstance) {
287
- axios.interceptors.request.use((config) => {
288
- if (config.url?.indexOf('refresh-token') === -1) {
289
- this.lastRequestConfig = config;
290
- }
291
-
292
- return config;
293
- });
294
293
  axios.interceptors.response.use(
295
294
  (res) => {
296
295
  return res;
@@ -310,13 +309,9 @@ export class BaseAPI {
310
309
  }
311
310
  const accessToken = `Bearer ${tokenString}`;
312
311
 
313
- const localVarHeaderParameter = {} as any;
314
- localVarHeaderParameter['Authorization'] = accessToken;
312
+ delete originalConfig.headers['Authorization']
315
313
 
316
- originalConfig.headers = {
317
- ...originalConfig.headers,
318
- ...localVarHeaderParameter,
319
- };
314
+ originalConfig.headers['Authorization'] = accessToken;
320
315
 
321
316
  this.configuration.accessToken = accessToken;
322
317
 
@@ -331,7 +326,12 @@ export class BaseAPI {
331
326
  if (err.response.status === 403 && err.response.data) {
332
327
  return Promise.reject(err.response.data);
333
328
  }
334
- } else if (err.message === NETWORK_ERROR_MESSAGE && !originalConfig._retry) {
329
+ } else if(err.message === NETWORK_ERROR_MESSAGE
330
+ && err.isAxiosError
331
+ && originalConfig.headers.hasOwnProperty('Authorization')
332
+ && _retry_count < 4
333
+ ){
334
+ _retry_count++;
335
335
  try {
336
336
  let tokenString: string;
337
337
  if (this.isCustomerToken) {
@@ -341,23 +341,14 @@ export class BaseAPI {
341
341
  }
342
342
  const accessToken = `Bearer ${tokenString}`;
343
343
 
344
- const localVarHeaderParameter = {} as any;
345
- localVarHeaderParameter['Authorization'] = accessToken;
346
-
347
- this.lastRequestConfig.headers = {
348
- ...originalConfig.headers,
349
- ...localVarHeaderParameter,
350
- };
351
-
352
- originalConfig = {
353
- ...this.lastRequestConfig,
354
- }
355
-
356
- originalConfig._retry = true;
344
+ _retry = true;
345
+ originalConfig.headers['Authorization'] = accessToken;
357
346
 
358
347
  this.configuration.accessToken = accessToken;
359
348
 
360
- return axios(originalConfig);
349
+ return axios.request({
350
+ ...originalConfig,
351
+ });
361
352
  } catch (_error) {
362
353
  if (_error.response && _error.response.data) {
363
354
  return Promise.reject(_error.response.data);
@@ -383,3 +374,4 @@ export class RequiredError extends Error {
383
374
  super(msg);
384
375
  }
385
376
  }
377
+
package/common.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * The EMIL CustomerService API description
6
6
  *
7
7
  * The version of the OpenAPI document: 1.0
8
- *
8
+ * Contact: kontakt@emil.de
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
11
  * https://openapi-generator.tech
@@ -137,3 +137,4 @@ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxi
137
137
  return axios.request<T, R>(axiosRequestArgs);
138
138
  };
139
139
  }
140
+
package/configuration.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * The EMIL CustomerService API description
6
6
  *
7
7
  * The version of the OpenAPI document: 1.0
8
- *
8
+ * Contact: kontakt@emil.de
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
11
  * https://openapi-generator.tech