@emilgroup/insurance-sdk 1.0.3 → 1.2.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 (40) hide show
  1. package/.openapi-generator/FILES +3 -1
  2. package/README.md +2 -2
  3. package/api/insured-object-types-api.ts +0 -4
  4. package/api/insured-objects-api.ts +0 -4
  5. package/api/leads-api.ts +249 -18
  6. package/api/policies-api.ts +0 -4
  7. package/api/products-api.ts +2 -6
  8. package/api.ts +0 -4
  9. package/base.ts +12 -5
  10. package/common.ts +0 -2
  11. package/dist/api/insured-object-types-api.js +1 -5
  12. package/dist/api/insured-objects-api.js +3 -7
  13. package/dist/api/leads-api.d.ts +138 -9
  14. package/dist/api/leads-api.js +212 -17
  15. package/dist/api/policies-api.js +4 -8
  16. package/dist/api/products-api.js +25 -29
  17. package/dist/base.d.ts +2 -1
  18. package/dist/base.js +10 -4
  19. package/dist/common.d.ts +0 -1
  20. package/dist/common.js +1 -2
  21. package/dist/models/create-account-request-dto.d.ts +1 -1
  22. package/dist/models/create-bank-account-request-dto.d.ts +1 -1
  23. package/dist/models/create-dummy-policy-request-dto.d.ts +31 -0
  24. package/dist/models/{shared-create-lead-request-dto.js → create-dummy-policy-request-dto.js} +0 -0
  25. package/dist/models/create-lead-request-dto.d.ts +23 -10
  26. package/dist/models/create-lead-request-dto.js +7 -0
  27. package/dist/models/grpc-create-policy-request-dto.d.ts +37 -0
  28. package/dist/models/grpc-create-policy-request-dto.js +15 -0
  29. package/dist/models/index.d.ts +3 -1
  30. package/dist/models/index.js +3 -1
  31. package/dist/models/{shared-create-lead-request-dto.d.ts → update-lead-request-dto.d.ts} +26 -13
  32. package/dist/models/update-lead-request-dto.js +22 -0
  33. package/models/create-account-request-dto.ts +1 -1
  34. package/models/create-bank-account-request-dto.ts +1 -1
  35. package/models/create-dummy-policy-request-dto.ts +37 -0
  36. package/models/create-lead-request-dto.ts +26 -10
  37. package/models/grpc-create-policy-request-dto.ts +43 -0
  38. package/models/index.ts +3 -1
  39. package/models/{shared-create-lead-request-dto.ts → update-lead-request-dto.ts} +29 -13
  40. package/package.json +2 -4
@@ -19,6 +19,7 @@ models/create-account-request-dto.ts
19
19
  models/create-bank-account-request-dto.ts
20
20
  models/create-claim-request-dto.ts
21
21
  models/create-custom-application-request-dto.ts
22
+ models/create-dummy-policy-request-dto.ts
22
23
  models/create-insured-object-request-dto.ts
23
24
  models/create-insured-object-response-class.ts
24
25
  models/create-lead-request-dto.ts
@@ -50,6 +51,7 @@ models/get-product-version-response-class.ts
50
51
  models/grouped-product-factor-class.ts
51
52
  models/grouped-product-factor-value-class.ts
52
53
  models/grouped-product-factors-response-class.ts
54
+ models/grpc-create-policy-request-dto.ts
53
55
  models/index.ts
54
56
  models/insured-object-class.ts
55
57
  models/insured-object-type-class.ts
@@ -74,11 +76,11 @@ models/product-factor-class.ts
74
76
  models/product-factor-value-class.ts
75
77
  models/product-field-class.ts
76
78
  models/product-version-class.ts
77
- models/shared-create-lead-request-dto.ts
78
79
  models/store-product-factors-request-dto.ts
79
80
  models/store-product-factors-response-class.ts
80
81
  models/timeslice-class.ts
81
82
  models/update-insured-object-request-dto.ts
83
+ models/update-lead-request-dto.ts
82
84
  models/update-policy-request-dto.ts
83
85
  models/update-policy-response-class.ts
84
86
  models/update-premium-formula-request-dto.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @emilgroup/insurance-sdk@1.0.3
1
+ ## @emilgroup/insurance-sdk@1.2.0
2
2
 
3
3
  This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -22,7 +22,7 @@ It can be used in both TypeScript and JavaScript. In TypeScript, the definition
22
22
  navigate to the folder of your consuming project and run one of the following commands.
23
23
 
24
24
  ```
25
- npm install @emilgroup/insurance-sdk@1.0.3 --save
25
+ npm install @emilgroup/insurance-sdk@1.2.0 --save
26
26
  ```
27
27
  And then you can import `PoliciesApi`.
28
28
 
@@ -22,10 +22,6 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
22
22
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
23
  // @ts-ignore
24
24
  import { ListInsuredObjectTypesResponseClass } from '../models';
25
- // URLSearchParams not necessarily used
26
- // @ts-ignore
27
- import { URL, URLSearchParams } from 'url';
28
- const FormData = require('form-data');
29
25
  /**
30
26
  * InsuredObjectTypesApi - axios parameter creator
31
27
  * @export
@@ -28,10 +28,6 @@ import { CreateInsuredObjectResponseClass } from '../models';
28
28
  import { GetInsuredObjectResponseClass } from '../models';
29
29
  // @ts-ignore
30
30
  import { ListInsuredObjectsResponseClass } from '../models';
31
- // URLSearchParams not necessarily used
32
- // @ts-ignore
33
- import { URL, URLSearchParams } from 'url';
34
- const FormData = require('form-data');
35
31
  /**
36
32
  * InsuredObjectsApi - axios parameter creator
37
33
  * @export
package/api/leads-api.ts CHANGED
@@ -21,11 +21,9 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
21
21
  // @ts-ignore
22
22
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
23
  // @ts-ignore
24
- import { SharedCreateLeadRequestDto } from '../models';
25
- // URLSearchParams not necessarily used
24
+ import { CreateLeadRequestDto } from '../models';
26
25
  // @ts-ignore
27
- import { URL, URLSearchParams } from 'url';
28
- const FormData = require('form-data');
26
+ import { UpdateLeadRequestDto } from '../models';
29
27
  /**
30
28
  * LeadsApi - axios parameter creator
31
29
  * @export
@@ -35,14 +33,14 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration
35
33
  /**
36
34
  * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information.
37
35
  * @summary Create the lead
38
- * @param {SharedCreateLeadRequestDto} sharedCreateLeadRequestDto
36
+ * @param {CreateLeadRequestDto} createLeadRequestDto
39
37
  * @param {string} [authorization] Bearer Token
40
38
  * @param {*} [options] Override http request option.
41
39
  * @throws {RequiredError}
42
40
  */
43
- createLead: async (sharedCreateLeadRequestDto: SharedCreateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
44
- // verify required parameter 'sharedCreateLeadRequestDto' is not null or undefined
45
- assertParamExists('createLead', 'sharedCreateLeadRequestDto', sharedCreateLeadRequestDto)
41
+ createLead: async (createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
42
+ // verify required parameter 'createLeadRequestDto' is not null or undefined
43
+ assertParamExists('createLead', 'createLeadRequestDto', createLeadRequestDto)
46
44
  const localVarPath = `/insuranceservice/v1/leads`;
47
45
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
48
46
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -72,7 +70,110 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration
72
70
  setSearchParams(localVarUrlObj, localVarQueryParameter);
73
71
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
74
72
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
75
- localVarRequestOptions.data = serializeDataIfNeeded(sharedCreateLeadRequestDto, localVarRequestOptions, configuration)
73
+ localVarRequestOptions.data = serializeDataIfNeeded(createLeadRequestDto, localVarRequestOptions, configuration)
74
+
75
+ return {
76
+ url: toPathString(localVarUrlObj),
77
+ options: localVarRequestOptions,
78
+ };
79
+ },
80
+ /**
81
+ * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
82
+ * @summary Retrieve the lead
83
+ * @param {string} code Unique identifier for the object.
84
+ * @param {string} expand
85
+ * @param {string} [authorization] Bearer Token
86
+ * @param {*} [options] Override http request option.
87
+ * @throws {RequiredError}
88
+ */
89
+ getLead: async (code: string, expand: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
90
+ // verify required parameter 'code' is not null or undefined
91
+ assertParamExists('getLead', 'code', code)
92
+ // verify required parameter 'expand' is not null or undefined
93
+ assertParamExists('getLead', 'expand', expand)
94
+ const localVarPath = `/insuranceservice/v1/leads/{code}`
95
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
96
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
97
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
98
+ let baseOptions;
99
+ let baseAccessToken;
100
+ if (configuration) {
101
+ baseOptions = configuration.baseOptions;
102
+ baseAccessToken = configuration.accessToken;
103
+ }
104
+
105
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
106
+ const localVarHeaderParameter = {} as any;
107
+ const localVarQueryParameter = {} as any;
108
+
109
+ // authentication bearer required
110
+ // http bearer authentication required
111
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
112
+
113
+ if (expand !== undefined) {
114
+ localVarQueryParameter['expand'] = expand;
115
+ }
116
+
117
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
118
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
119
+ }
120
+
121
+
122
+
123
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
124
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
125
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
126
+
127
+ return {
128
+ url: toPathString(localVarUrlObj),
129
+ options: localVarRequestOptions,
130
+ };
131
+ },
132
+ /**
133
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
134
+ * @summary Update the lead
135
+ * @param {string} code Unique identifier for the object.
136
+ * @param {UpdateLeadRequestDto} updateLeadRequestDto
137
+ * @param {string} [authorization] Bearer Token
138
+ * @param {*} [options] Override http request option.
139
+ * @throws {RequiredError}
140
+ */
141
+ updateLead: async (code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
142
+ // verify required parameter 'code' is not null or undefined
143
+ assertParamExists('updateLead', 'code', code)
144
+ // verify required parameter 'updateLeadRequestDto' is not null or undefined
145
+ assertParamExists('updateLead', 'updateLeadRequestDto', updateLeadRequestDto)
146
+ const localVarPath = `/insuranceservice/v1/leads/{code}`
147
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
148
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
149
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
150
+ let baseOptions;
151
+ let baseAccessToken;
152
+ if (configuration) {
153
+ baseOptions = configuration.baseOptions;
154
+ baseAccessToken = configuration.accessToken;
155
+ }
156
+
157
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
158
+ const localVarHeaderParameter = {} as any;
159
+ const localVarQueryParameter = {} as any;
160
+
161
+ // authentication bearer required
162
+ // http bearer authentication required
163
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
164
+
165
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
166
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
167
+ }
168
+
169
+
170
+
171
+ localVarHeaderParameter['Content-Type'] = 'application/json';
172
+
173
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
174
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
175
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
176
+ localVarRequestOptions.data = serializeDataIfNeeded(updateLeadRequestDto, localVarRequestOptions, configuration)
76
177
 
77
178
  return {
78
179
  url: toPathString(localVarUrlObj),
@@ -92,13 +193,39 @@ export const LeadsApiFp = function(configuration?: Configuration) {
92
193
  /**
93
194
  * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information.
94
195
  * @summary Create the lead
95
- * @param {SharedCreateLeadRequestDto} sharedCreateLeadRequestDto
196
+ * @param {CreateLeadRequestDto} createLeadRequestDto
96
197
  * @param {string} [authorization] Bearer Token
97
198
  * @param {*} [options] Override http request option.
98
199
  * @throws {RequiredError}
99
200
  */
100
- async createLead(sharedCreateLeadRequestDto: SharedCreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
101
- const localVarAxiosArgs = await localVarAxiosParamCreator.createLead(sharedCreateLeadRequestDto, authorization, options);
201
+ async createLead(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
202
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createLead(createLeadRequestDto, authorization, options);
203
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
204
+ },
205
+ /**
206
+ * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
207
+ * @summary Retrieve the lead
208
+ * @param {string} code Unique identifier for the object.
209
+ * @param {string} expand
210
+ * @param {string} [authorization] Bearer Token
211
+ * @param {*} [options] Override http request option.
212
+ * @throws {RequiredError}
213
+ */
214
+ async getLead(code: string, expand: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
215
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getLead(code, expand, authorization, options);
216
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
217
+ },
218
+ /**
219
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
220
+ * @summary Update the lead
221
+ * @param {string} code Unique identifier for the object.
222
+ * @param {UpdateLeadRequestDto} updateLeadRequestDto
223
+ * @param {string} [authorization] Bearer Token
224
+ * @param {*} [options] Override http request option.
225
+ * @throws {RequiredError}
226
+ */
227
+ async updateLead(code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
228
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateLead(code, updateLeadRequestDto, authorization, options);
102
229
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
103
230
  },
104
231
  }
@@ -114,13 +241,37 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath
114
241
  /**
115
242
  * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information.
116
243
  * @summary Create the lead
117
- * @param {SharedCreateLeadRequestDto} sharedCreateLeadRequestDto
244
+ * @param {CreateLeadRequestDto} createLeadRequestDto
245
+ * @param {string} [authorization] Bearer Token
246
+ * @param {*} [options] Override http request option.
247
+ * @throws {RequiredError}
248
+ */
249
+ createLead(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise<object> {
250
+ return localVarFp.createLead(createLeadRequestDto, authorization, options).then((request) => request(axios, basePath));
251
+ },
252
+ /**
253
+ * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
254
+ * @summary Retrieve the lead
255
+ * @param {string} code Unique identifier for the object.
256
+ * @param {string} expand
118
257
  * @param {string} [authorization] Bearer Token
119
258
  * @param {*} [options] Override http request option.
120
259
  * @throws {RequiredError}
121
260
  */
122
- createLead(sharedCreateLeadRequestDto: SharedCreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise<object> {
123
- return localVarFp.createLead(sharedCreateLeadRequestDto, authorization, options).then((request) => request(axios, basePath));
261
+ getLead(code: string, expand: string, authorization?: string, options?: any): AxiosPromise<object> {
262
+ return localVarFp.getLead(code, expand, authorization, options).then((request) => request(axios, basePath));
263
+ },
264
+ /**
265
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
266
+ * @summary Update the lead
267
+ * @param {string} code Unique identifier for the object.
268
+ * @param {UpdateLeadRequestDto} updateLeadRequestDto
269
+ * @param {string} [authorization] Bearer Token
270
+ * @param {*} [options] Override http request option.
271
+ * @throws {RequiredError}
272
+ */
273
+ updateLead(code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: any): AxiosPromise<object> {
274
+ return localVarFp.updateLead(code, updateLeadRequestDto, authorization, options).then((request) => request(axios, basePath));
124
275
  },
125
276
  };
126
277
  };
@@ -133,10 +284,10 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath
133
284
  export interface LeadsApiCreateLeadRequest {
134
285
  /**
135
286
  *
136
- * @type {SharedCreateLeadRequestDto}
287
+ * @type {CreateLeadRequestDto}
137
288
  * @memberof LeadsApiCreateLead
138
289
  */
139
- readonly sharedCreateLeadRequestDto: SharedCreateLeadRequestDto
290
+ readonly createLeadRequestDto: CreateLeadRequestDto
140
291
 
141
292
  /**
142
293
  * Bearer Token
@@ -146,6 +297,62 @@ export interface LeadsApiCreateLeadRequest {
146
297
  readonly authorization?: string
147
298
  }
148
299
 
300
+ /**
301
+ * Request parameters for getLead operation in LeadsApi.
302
+ * @export
303
+ * @interface LeadsApiGetLeadRequest
304
+ */
305
+ export interface LeadsApiGetLeadRequest {
306
+ /**
307
+ * Unique identifier for the object.
308
+ * @type {string}
309
+ * @memberof LeadsApiGetLead
310
+ */
311
+ readonly code: string
312
+
313
+ /**
314
+ *
315
+ * @type {string}
316
+ * @memberof LeadsApiGetLead
317
+ */
318
+ readonly expand: string
319
+
320
+ /**
321
+ * Bearer Token
322
+ * @type {string}
323
+ * @memberof LeadsApiGetLead
324
+ */
325
+ readonly authorization?: string
326
+ }
327
+
328
+ /**
329
+ * Request parameters for updateLead operation in LeadsApi.
330
+ * @export
331
+ * @interface LeadsApiUpdateLeadRequest
332
+ */
333
+ export interface LeadsApiUpdateLeadRequest {
334
+ /**
335
+ * Unique identifier for the object.
336
+ * @type {string}
337
+ * @memberof LeadsApiUpdateLead
338
+ */
339
+ readonly code: string
340
+
341
+ /**
342
+ *
343
+ * @type {UpdateLeadRequestDto}
344
+ * @memberof LeadsApiUpdateLead
345
+ */
346
+ readonly updateLeadRequestDto: UpdateLeadRequestDto
347
+
348
+ /**
349
+ * Bearer Token
350
+ * @type {string}
351
+ * @memberof LeadsApiUpdateLead
352
+ */
353
+ readonly authorization?: string
354
+ }
355
+
149
356
  /**
150
357
  * LeadsApi - object-oriented interface
151
358
  * @export
@@ -162,6 +369,30 @@ export class LeadsApi extends BaseAPI {
162
369
  * @memberof LeadsApi
163
370
  */
164
371
  public createLead(requestParameters: LeadsApiCreateLeadRequest, options?: AxiosRequestConfig) {
165
- return LeadsApiFp(this.configuration).createLead(requestParameters.sharedCreateLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
372
+ return LeadsApiFp(this.configuration).createLead(requestParameters.createLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
373
+ }
374
+
375
+ /**
376
+ * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information.
377
+ * @summary Retrieve the lead
378
+ * @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
379
+ * @param {*} [options] Override http request option.
380
+ * @throws {RequiredError}
381
+ * @memberof LeadsApi
382
+ */
383
+ public getLead(requestParameters: LeadsApiGetLeadRequest, options?: AxiosRequestConfig) {
384
+ return LeadsApiFp(this.configuration).getLead(requestParameters.code, requestParameters.expand, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
385
+ }
386
+
387
+ /**
388
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
389
+ * @summary Update the lead
390
+ * @param {LeadsApiUpdateLeadRequest} requestParameters Request parameters.
391
+ * @param {*} [options] Override http request option.
392
+ * @throws {RequiredError}
393
+ * @memberof LeadsApi
394
+ */
395
+ public updateLead(requestParameters: LeadsApiUpdateLeadRequest, options?: AxiosRequestConfig) {
396
+ return LeadsApiFp(this.configuration).updateLead(requestParameters.code, requestParameters.updateLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
166
397
  }
167
398
  }
@@ -32,10 +32,6 @@ import { ListPoliciesResponseClass } from '../models';
32
32
  import { UpdatePolicyRequestDto } from '../models';
33
33
  // @ts-ignore
34
34
  import { UpdatePolicyResponseClass } from '../models';
35
- // URLSearchParams not necessarily used
36
- // @ts-ignore
37
- import { URL, URLSearchParams } from 'url';
38
- const FormData = require('form-data');
39
35
  /**
40
36
  * PoliciesApi - axios parameter creator
41
37
  * @export
@@ -74,10 +74,6 @@ import { UpdateProductResponseClass } from '../models';
74
74
  import { UpdateProductVersionRequestDto } from '../models';
75
75
  // @ts-ignore
76
76
  import { UpdateProductVersionResponseClass } from '../models';
77
- // URLSearchParams not necessarily used
78
- // @ts-ignore
79
- import { URL, URLSearchParams } from 'url';
80
- const FormData = require('form-data');
81
77
  /**
82
78
  * ProductsApi - axios parameter creator
83
79
  * @export
@@ -1090,7 +1086,7 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
1090
1086
  }
1091
1087
 
1092
1088
 
1093
- localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
1089
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data; boundary=' + localVarFormParams.getBoundary();
1094
1090
 
1095
1091
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1096
1092
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1344,7 +1340,7 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
1344
1340
  }
1345
1341
 
1346
1342
 
1347
- localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
1343
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data; boundary=' + localVarFormParams.getBoundary();
1348
1344
 
1349
1345
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1350
1346
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
package/api.ts CHANGED
@@ -15,10 +15,6 @@
15
15
 
16
16
  import { Configuration } from './configuration';
17
17
  import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
18
- // URLSearchParams not necessarily used
19
- // @ts-ignore
20
- import { URL, URLSearchParams } from 'url';
21
- import FormData from 'form-data'
22
18
  // Some imports not used depending on template conditions
23
19
  // @ts-ignore
24
20
  import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
package/base.ts CHANGED
@@ -18,7 +18,7 @@ import { Configuration } from "./configuration";
18
18
  // @ts-ignore
19
19
  import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
20
20
 
21
- export const BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
21
+ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
22
22
 
23
23
  /**
24
24
  *
@@ -58,7 +58,7 @@ export interface RequestArgs {
58
58
  * @class BaseAPI
59
59
  */
60
60
  export class BaseAPI {
61
- protected configuration: Configuration | undefined;
61
+ protected configuration: Configuration;
62
62
 
63
63
  constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
64
64
  if (configuration) {
@@ -111,6 +111,10 @@ export class BaseAPI {
111
111
  );
112
112
  }
113
113
 
114
+ getConfiguration(): Configuration {
115
+ return this.configuration;
116
+ }
117
+
114
118
  selectEnvironment(env: Environment) {
115
119
  this.configuration.basePath = env;
116
120
  }
@@ -118,9 +122,12 @@ export class BaseAPI {
118
122
  async authorize(username: string, password: string): Promise<void> {
119
123
  const options: AxiosRequestConfig = {
120
124
  method: 'POST',
121
- url: `${Environment.Test}/authservice/v1/login`,
125
+ url: `${this.configuration.basePath}/authservice/v1/login`,
122
126
  headers: {'Content-Type': 'application/json'},
123
- data: {username, password, newPassword: null},
127
+ data: {
128
+ username,
129
+ password,
130
+ },
124
131
  withCredentials: true,
125
132
  };
126
133
 
@@ -143,7 +150,7 @@ export class BaseAPI {
143
150
 
144
151
  const options: AxiosRequestConfig = {
145
152
  method: 'POST',
146
- url: `${Environment.Test}/authservice/v1/refresh-token`,
153
+ url: `${this.configuration.basePath}/authservice/v1/refresh-token`,
147
154
  headers: {
148
155
  'Content-Type': 'application/json',
149
156
  Cookie: refreshToken,
package/common.ts CHANGED
@@ -16,8 +16,6 @@
16
16
  import { Configuration } from "./configuration";
17
17
  import { RequiredError, RequestArgs } from "./base";
18
18
  import { AxiosInstance, AxiosResponse } from 'axios';
19
- import { URL, URLSearchParams } from 'url';
20
-
21
19
  /**
22
20
  *
23
21
  * @export
@@ -85,10 +85,6 @@ var axios_1 = __importDefault(require("axios"));
85
85
  var common_1 = require("../common");
86
86
  // @ts-ignore
87
87
  var base_1 = require("../base");
88
- // URLSearchParams not necessarily used
89
- // @ts-ignore
90
- var url_1 = require("url");
91
- var FormData = require('form-data');
92
88
  /**
93
89
  * InsuredObjectTypesApi - axios parameter creator
94
90
  * @export
@@ -117,7 +113,7 @@ var InsuredObjectTypesApiAxiosParamCreator = function (configuration) {
117
113
  switch (_a.label) {
118
114
  case 0:
119
115
  localVarPath = "/insuranceservice/v1/insured-object-types";
120
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
116
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
121
117
  if (configuration) {
122
118
  baseOptions = configuration.baseOptions;
123
119
  baseAccessToken = configuration.accessToken;
@@ -85,10 +85,6 @@ var axios_1 = __importDefault(require("axios"));
85
85
  var common_1 = require("../common");
86
86
  // @ts-ignore
87
87
  var base_1 = require("../base");
88
- // URLSearchParams not necessarily used
89
- // @ts-ignore
90
- var url_1 = require("url");
91
- var FormData = require('form-data');
92
88
  /**
93
89
  * InsuredObjectsApi - axios parameter creator
94
90
  * @export
@@ -114,7 +110,7 @@ var InsuredObjectsApiAxiosParamCreator = function (configuration) {
114
110
  // verify required parameter 'createInsuredObjectRequestDto' is not null or undefined
115
111
  (0, common_1.assertParamExists)('createInsuredObject', 'createInsuredObjectRequestDto', createInsuredObjectRequestDto);
116
112
  localVarPath = "/insuranceservice/v1/insured-objects";
117
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
113
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
118
114
  if (configuration) {
119
115
  baseOptions = configuration.baseOptions;
120
116
  baseAccessToken = configuration.accessToken;
@@ -164,7 +160,7 @@ var InsuredObjectsApiAxiosParamCreator = function (configuration) {
164
160
  (0, common_1.assertParamExists)('getInsuredObject', 'id', id);
165
161
  localVarPath = "/insuranceservice/v1/insured-objects/{id}"
166
162
  .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
167
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
163
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
168
164
  if (configuration) {
169
165
  baseOptions = configuration.baseOptions;
170
166
  baseAccessToken = configuration.accessToken;
@@ -214,7 +210,7 @@ var InsuredObjectsApiAxiosParamCreator = function (configuration) {
214
210
  switch (_a.label) {
215
211
  case 0:
216
212
  localVarPath = "/insuranceservice/v1/insured-objects";
217
- localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
213
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
218
214
  if (configuration) {
219
215
  baseOptions = configuration.baseOptions;
220
216
  baseAccessToken = configuration.accessToken;