@emilgroup/customer-sdk-node 1.13.1 → 1.14.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 (61) hide show
  1. package/.openapi-generator/FILES +16 -0
  2. package/README.md +2 -2
  3. package/api/leads-api.ts +632 -0
  4. package/api.ts +2 -0
  5. package/base.ts +1 -1
  6. package/dist/api/leads-api.d.ts +365 -0
  7. package/dist/api/leads-api.js +571 -0
  8. package/dist/api.d.ts +1 -0
  9. package/dist/api.js +1 -0
  10. package/dist/base.js +1 -1
  11. package/dist/models/create-account-request-dto.d.ts +7 -1
  12. package/dist/models/create-bank-account-request-dto.d.ts +30 -0
  13. package/dist/models/create-bank-account-request-dto.js +15 -0
  14. package/dist/models/create-lead-request-dto.d.ts +76 -0
  15. package/dist/models/create-lead-request-dto.js +15 -0
  16. package/dist/models/create-lead-response-class.d.ts +25 -0
  17. package/dist/models/create-lead-response-class.js +15 -0
  18. package/dist/models/create-policy-request-dto.d.ts +56 -0
  19. package/dist/models/create-policy-request-dto.js +15 -0
  20. package/dist/models/get-lead-response-class.d.ts +25 -0
  21. package/dist/models/get-lead-response-class.js +15 -0
  22. package/dist/models/index.d.ts +15 -0
  23. package/dist/models/index.js +15 -0
  24. package/dist/models/lead-bank-account-class.d.ts +30 -0
  25. package/dist/models/lead-bank-account-class.js +15 -0
  26. package/dist/models/lead-class.d.ts +101 -0
  27. package/dist/models/lead-class.js +15 -0
  28. package/dist/models/list-leads-response-class.d.ts +31 -0
  29. package/dist/models/list-leads-response-class.js +15 -0
  30. package/dist/models/policy-object-dto.d.ts +30 -0
  31. package/dist/models/policy-object-dto.js +15 -0
  32. package/dist/models/premium-override-dto.d.ts +54 -0
  33. package/dist/models/premium-override-dto.js +26 -0
  34. package/dist/models/premium-override-request-class.d.ts +25 -0
  35. package/dist/models/premium-override-request-class.js +15 -0
  36. package/dist/models/premium-override-request-dto.d.ts +25 -0
  37. package/dist/models/premium-override-request-dto.js +15 -0
  38. package/dist/models/update-lead-request-dto.d.ts +37 -0
  39. package/dist/models/update-lead-request-dto.js +15 -0
  40. package/dist/models/update-lead-response-class.d.ts +25 -0
  41. package/dist/models/update-lead-response-class.js +15 -0
  42. package/dist/models/uploaded-document-dto.d.ts +24 -0
  43. package/dist/models/uploaded-document-dto.js +15 -0
  44. package/models/create-account-request-dto.ts +7 -1
  45. package/models/create-bank-account-request-dto.ts +36 -0
  46. package/models/create-lead-request-dto.ts +82 -0
  47. package/models/create-lead-response-class.ts +31 -0
  48. package/models/create-policy-request-dto.ts +62 -0
  49. package/models/get-lead-response-class.ts +31 -0
  50. package/models/index.ts +15 -0
  51. package/models/lead-bank-account-class.ts +36 -0
  52. package/models/lead-class.ts +107 -0
  53. package/models/list-leads-response-class.ts +37 -0
  54. package/models/policy-object-dto.ts +36 -0
  55. package/models/premium-override-dto.ts +64 -0
  56. package/models/premium-override-request-class.ts +31 -0
  57. package/models/premium-override-request-dto.ts +31 -0
  58. package/models/update-lead-request-dto.ts +43 -0
  59. package/models/update-lead-response-class.ts +31 -0
  60. package/models/uploaded-document-dto.ts +30 -0
  61. package/package.json +1 -1
@@ -0,0 +1,632 @@
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 { CreateLeadRequestDto } from '../models';
25
+ // @ts-ignore
26
+ import { CreateLeadResponseClass } from '../models';
27
+ // @ts-ignore
28
+ import { GetLeadResponseClass } from '../models';
29
+ // @ts-ignore
30
+ import { ListLeadsResponseClass } from '../models';
31
+ // @ts-ignore
32
+ import { UpdateLeadRequestDto } from '../models';
33
+ // @ts-ignore
34
+ import { UpdateLeadResponseClass } from '../models';
35
+ // URLSearchParams not necessarily used
36
+ // @ts-ignore
37
+ import { URL, URLSearchParams } from 'url';
38
+ const FormData = require('form-data');
39
+ /**
40
+ * LeadsApi - axios parameter creator
41
+ * @export
42
+ */
43
+ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration) {
44
+ return {
45
+ /**
46
+ * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information.
47
+ * @summary Create the lead
48
+ * @param {string} customerCode The customer code or \"me\" for the currently logged in customer.
49
+ * @param {CreateLeadRequestDto} createLeadRequestDto
50
+ * @param {string} [authorization] Bearer Token
51
+ * @param {*} [options] Override http request option.
52
+ * @throws {RequiredError}
53
+ */
54
+ createLead: async (customerCode: string, createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
55
+ // verify required parameter 'customerCode' is not null or undefined
56
+ assertParamExists('createLead', 'customerCode', customerCode)
57
+ // verify required parameter 'createLeadRequestDto' is not null or undefined
58
+ assertParamExists('createLead', 'createLeadRequestDto', createLeadRequestDto)
59
+ const localVarPath = `/v1/customers/{customerCode}/leads`
60
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
61
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
62
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
63
+ let baseOptions;
64
+ let baseAccessToken;
65
+ if (configuration) {
66
+ baseOptions = configuration.baseOptions;
67
+ baseAccessToken = configuration.accessToken;
68
+ }
69
+
70
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
71
+ const localVarHeaderParameter = {} as any;
72
+ const localVarQueryParameter = {} as any;
73
+
74
+ // authentication bearer required
75
+ // http bearer authentication required
76
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
77
+
78
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
79
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
80
+ }
81
+
82
+
83
+
84
+ localVarHeaderParameter['Content-Type'] = 'application/json';
85
+
86
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
87
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
88
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
89
+ localVarRequestOptions.data = serializeDataIfNeeded(createLeadRequestDto, localVarRequestOptions, configuration)
90
+
91
+ return {
92
+ url: toPathString(localVarUrlObj),
93
+ options: localVarRequestOptions,
94
+ };
95
+ },
96
+ /**
97
+ * 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.
98
+ * @summary Retrieve the lead
99
+ * @param {string} code Unique identifier for the object.
100
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
101
+ * @param {string} [authorization] Bearer Token
102
+ * @param {string} [expand]
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ getLead: async (code: string, customerCode: string, authorization?: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
107
+ // verify required parameter 'code' is not null or undefined
108
+ assertParamExists('getLead', 'code', code)
109
+ // verify required parameter 'customerCode' is not null or undefined
110
+ assertParamExists('getLead', 'customerCode', customerCode)
111
+ const localVarPath = `/v1/customers/{customerCode}/leads/{code}`
112
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)))
113
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
114
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
115
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
116
+ let baseOptions;
117
+ let baseAccessToken;
118
+ if (configuration) {
119
+ baseOptions = configuration.baseOptions;
120
+ baseAccessToken = configuration.accessToken;
121
+ }
122
+
123
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
124
+ const localVarHeaderParameter = {} as any;
125
+ const localVarQueryParameter = {} as any;
126
+
127
+ // authentication bearer required
128
+ // http bearer authentication required
129
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
130
+
131
+ if (expand !== undefined) {
132
+ localVarQueryParameter['expand'] = expand;
133
+ }
134
+
135
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
136
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
137
+ }
138
+
139
+
140
+
141
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
142
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
143
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
144
+
145
+ return {
146
+ url: toPathString(localVarUrlObj),
147
+ options: localVarRequestOptions,
148
+ };
149
+ },
150
+ /**
151
+ * Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
152
+ * @summary List leads
153
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
154
+ * @param {string} [authorization] Bearer Token
155
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
156
+ * @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.
157
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
158
+ * @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.
159
+ * @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.
160
+ * @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.
161
+ * @param {*} [options] Override http request option.
162
+ * @throws {RequiredError}
163
+ */
164
+ listLeads: async (customerCode: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
165
+ // verify required parameter 'customerCode' is not null or undefined
166
+ assertParamExists('listLeads', 'customerCode', customerCode)
167
+ const localVarPath = `/v1/customers/{customerCode}/leads`
168
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
169
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
170
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
171
+ let baseOptions;
172
+ let baseAccessToken;
173
+ if (configuration) {
174
+ baseOptions = configuration.baseOptions;
175
+ baseAccessToken = configuration.accessToken;
176
+ }
177
+
178
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
179
+ const localVarHeaderParameter = {} as any;
180
+ const localVarQueryParameter = {} as any;
181
+
182
+ // authentication bearer required
183
+ // http bearer authentication required
184
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
185
+
186
+ if (pageSize !== undefined) {
187
+ localVarQueryParameter['pageSize'] = pageSize;
188
+ }
189
+
190
+ if (pageToken !== undefined) {
191
+ localVarQueryParameter['pageToken'] = pageToken;
192
+ }
193
+
194
+ if (filter !== undefined) {
195
+ localVarQueryParameter['filter'] = filter;
196
+ }
197
+
198
+ if (search !== undefined) {
199
+ localVarQueryParameter['search'] = search;
200
+ }
201
+
202
+ if (order !== undefined) {
203
+ localVarQueryParameter['order'] = order;
204
+ }
205
+
206
+ if (expand !== undefined) {
207
+ localVarQueryParameter['expand'] = expand;
208
+ }
209
+
210
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
211
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
212
+ }
213
+
214
+
215
+
216
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
217
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
218
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
219
+
220
+ return {
221
+ url: toPathString(localVarUrlObj),
222
+ options: localVarRequestOptions,
223
+ };
224
+ },
225
+ /**
226
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
227
+ * @summary Update the lead
228
+ * @param {string} code Unique identifier for the object.
229
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
230
+ * @param {UpdateLeadRequestDto} updateLeadRequestDto
231
+ * @param {string} [authorization] Bearer Token
232
+ * @param {*} [options] Override http request option.
233
+ * @throws {RequiredError}
234
+ */
235
+ updateLead: async (code: string, customerCode: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
236
+ // verify required parameter 'code' is not null or undefined
237
+ assertParamExists('updateLead', 'code', code)
238
+ // verify required parameter 'customerCode' is not null or undefined
239
+ assertParamExists('updateLead', 'customerCode', customerCode)
240
+ // verify required parameter 'updateLeadRequestDto' is not null or undefined
241
+ assertParamExists('updateLead', 'updateLeadRequestDto', updateLeadRequestDto)
242
+ const localVarPath = `/v1/customers/{customerCode}/leads/{code}`
243
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)))
244
+ .replace(`{${"customerCode"}}`, encodeURIComponent(String(customerCode)));
245
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
246
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
247
+ let baseOptions;
248
+ let baseAccessToken;
249
+ if (configuration) {
250
+ baseOptions = configuration.baseOptions;
251
+ baseAccessToken = configuration.accessToken;
252
+ }
253
+
254
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
255
+ const localVarHeaderParameter = {} as any;
256
+ const localVarQueryParameter = {} as any;
257
+
258
+ // authentication bearer required
259
+ // http bearer authentication required
260
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
261
+
262
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
263
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
264
+ }
265
+
266
+
267
+
268
+ localVarHeaderParameter['Content-Type'] = 'application/json';
269
+
270
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
271
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
272
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
273
+ localVarRequestOptions.data = serializeDataIfNeeded(updateLeadRequestDto, localVarRequestOptions, configuration)
274
+
275
+ return {
276
+ url: toPathString(localVarUrlObj),
277
+ options: localVarRequestOptions,
278
+ };
279
+ },
280
+ }
281
+ };
282
+
283
+ /**
284
+ * LeadsApi - functional programming interface
285
+ * @export
286
+ */
287
+ export const LeadsApiFp = function(configuration?: Configuration) {
288
+ const localVarAxiosParamCreator = LeadsApiAxiosParamCreator(configuration)
289
+ return {
290
+ /**
291
+ * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information.
292
+ * @summary Create the lead
293
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
294
+ * @param {CreateLeadRequestDto} createLeadRequestDto
295
+ * @param {string} [authorization] Bearer Token
296
+ * @param {*} [options] Override http request option.
297
+ * @throws {RequiredError}
298
+ */
299
+ async createLead(customerCode: string, createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateLeadResponseClass>> {
300
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createLead(customerCode, createLeadRequestDto, authorization, options);
301
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
302
+ },
303
+ /**
304
+ * 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.
305
+ * @summary Retrieve the lead
306
+ * @param {string} code Unique identifier for the object.
307
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
308
+ * @param {string} [authorization] Bearer Token
309
+ * @param {string} [expand]
310
+ * @param {*} [options] Override http request option.
311
+ * @throws {RequiredError}
312
+ */
313
+ async getLead(code: string, customerCode: string, authorization?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetLeadResponseClass>> {
314
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getLead(code, customerCode, authorization, expand, options);
315
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
316
+ },
317
+ /**
318
+ * Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
319
+ * @summary List leads
320
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
321
+ * @param {string} [authorization] Bearer Token
322
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
323
+ * @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.
324
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
325
+ * @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.
326
+ * @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.
327
+ * @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.
328
+ * @param {*} [options] Override http request option.
329
+ * @throws {RequiredError}
330
+ */
331
+ async listLeads(customerCode: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListLeadsResponseClass>> {
332
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listLeads(customerCode, authorization, pageSize, pageToken, filter, search, order, expand, options);
333
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
334
+ },
335
+ /**
336
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
337
+ * @summary Update the lead
338
+ * @param {string} code Unique identifier for the object.
339
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
340
+ * @param {UpdateLeadRequestDto} updateLeadRequestDto
341
+ * @param {string} [authorization] Bearer Token
342
+ * @param {*} [options] Override http request option.
343
+ * @throws {RequiredError}
344
+ */
345
+ async updateLead(code: string, customerCode: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateLeadResponseClass>> {
346
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateLead(code, customerCode, updateLeadRequestDto, authorization, options);
347
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
348
+ },
349
+ }
350
+ };
351
+
352
+ /**
353
+ * LeadsApi - factory interface
354
+ * @export
355
+ */
356
+ export const LeadsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
357
+ const localVarFp = LeadsApiFp(configuration)
358
+ return {
359
+ /**
360
+ * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information.
361
+ * @summary Create the lead
362
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
363
+ * @param {CreateLeadRequestDto} createLeadRequestDto
364
+ * @param {string} [authorization] Bearer Token
365
+ * @param {*} [options] Override http request option.
366
+ * @throws {RequiredError}
367
+ */
368
+ createLead(customerCode: string, createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise<CreateLeadResponseClass> {
369
+ return localVarFp.createLead(customerCode, createLeadRequestDto, authorization, options).then((request) => request(axios, basePath));
370
+ },
371
+ /**
372
+ * 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.
373
+ * @summary Retrieve the lead
374
+ * @param {string} code Unique identifier for the object.
375
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
376
+ * @param {string} [authorization] Bearer Token
377
+ * @param {string} [expand]
378
+ * @param {*} [options] Override http request option.
379
+ * @throws {RequiredError}
380
+ */
381
+ getLead(code: string, customerCode: string, authorization?: string, expand?: string, options?: any): AxiosPromise<GetLeadResponseClass> {
382
+ return localVarFp.getLead(code, customerCode, authorization, expand, options).then((request) => request(axios, basePath));
383
+ },
384
+ /**
385
+ * Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
386
+ * @summary List leads
387
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
388
+ * @param {string} [authorization] Bearer Token
389
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
390
+ * @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.
391
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
392
+ * @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.
393
+ * @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.
394
+ * @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.
395
+ * @param {*} [options] Override http request option.
396
+ * @throws {RequiredError}
397
+ */
398
+ listLeads(customerCode: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListLeadsResponseClass> {
399
+ return localVarFp.listLeads(customerCode, authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
400
+ },
401
+ /**
402
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
403
+ * @summary Update the lead
404
+ * @param {string} code Unique identifier for the object.
405
+ * @param {string} customerCode The customer code or \&quot;me\&quot; for the currently logged in customer.
406
+ * @param {UpdateLeadRequestDto} updateLeadRequestDto
407
+ * @param {string} [authorization] Bearer Token
408
+ * @param {*} [options] Override http request option.
409
+ * @throws {RequiredError}
410
+ */
411
+ updateLead(code: string, customerCode: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateLeadResponseClass> {
412
+ return localVarFp.updateLead(code, customerCode, updateLeadRequestDto, authorization, options).then((request) => request(axios, basePath));
413
+ },
414
+ };
415
+ };
416
+
417
+ /**
418
+ * Request parameters for createLead operation in LeadsApi.
419
+ * @export
420
+ * @interface LeadsApiCreateLeadRequest
421
+ */
422
+ export interface LeadsApiCreateLeadRequest {
423
+ /**
424
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
425
+ * @type {string}
426
+ * @memberof LeadsApiCreateLead
427
+ */
428
+ readonly customerCode: string
429
+
430
+ /**
431
+ *
432
+ * @type {CreateLeadRequestDto}
433
+ * @memberof LeadsApiCreateLead
434
+ */
435
+ readonly createLeadRequestDto: CreateLeadRequestDto
436
+
437
+ /**
438
+ * Bearer Token
439
+ * @type {string}
440
+ * @memberof LeadsApiCreateLead
441
+ */
442
+ readonly authorization?: string
443
+ }
444
+
445
+ /**
446
+ * Request parameters for getLead operation in LeadsApi.
447
+ * @export
448
+ * @interface LeadsApiGetLeadRequest
449
+ */
450
+ export interface LeadsApiGetLeadRequest {
451
+ /**
452
+ * Unique identifier for the object.
453
+ * @type {string}
454
+ * @memberof LeadsApiGetLead
455
+ */
456
+ readonly code: string
457
+
458
+ /**
459
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
460
+ * @type {string}
461
+ * @memberof LeadsApiGetLead
462
+ */
463
+ readonly customerCode: string
464
+
465
+ /**
466
+ * Bearer Token
467
+ * @type {string}
468
+ * @memberof LeadsApiGetLead
469
+ */
470
+ readonly authorization?: string
471
+
472
+ /**
473
+ *
474
+ * @type {string}
475
+ * @memberof LeadsApiGetLead
476
+ */
477
+ readonly expand?: string
478
+ }
479
+
480
+ /**
481
+ * Request parameters for listLeads operation in LeadsApi.
482
+ * @export
483
+ * @interface LeadsApiListLeadsRequest
484
+ */
485
+ export interface LeadsApiListLeadsRequest {
486
+ /**
487
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
488
+ * @type {string}
489
+ * @memberof LeadsApiListLeads
490
+ */
491
+ readonly customerCode: string
492
+
493
+ /**
494
+ * Bearer Token
495
+ * @type {string}
496
+ * @memberof LeadsApiListLeads
497
+ */
498
+ readonly authorization?: string
499
+
500
+ /**
501
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
502
+ * @type {any}
503
+ * @memberof LeadsApiListLeads
504
+ */
505
+ readonly pageSize?: any
506
+
507
+ /**
508
+ * 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.
509
+ * @type {any}
510
+ * @memberof LeadsApiListLeads
511
+ */
512
+ readonly pageToken?: any
513
+
514
+ /**
515
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
516
+ * @type {any}
517
+ * @memberof LeadsApiListLeads
518
+ */
519
+ readonly filter?: any
520
+
521
+ /**
522
+ * 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.
523
+ * @type {any}
524
+ * @memberof LeadsApiListLeads
525
+ */
526
+ readonly search?: any
527
+
528
+ /**
529
+ * 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.
530
+ * @type {any}
531
+ * @memberof LeadsApiListLeads
532
+ */
533
+ readonly order?: any
534
+
535
+ /**
536
+ * 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.
537
+ * @type {any}
538
+ * @memberof LeadsApiListLeads
539
+ */
540
+ readonly expand?: any
541
+ }
542
+
543
+ /**
544
+ * Request parameters for updateLead operation in LeadsApi.
545
+ * @export
546
+ * @interface LeadsApiUpdateLeadRequest
547
+ */
548
+ export interface LeadsApiUpdateLeadRequest {
549
+ /**
550
+ * Unique identifier for the object.
551
+ * @type {string}
552
+ * @memberof LeadsApiUpdateLead
553
+ */
554
+ readonly code: string
555
+
556
+ /**
557
+ * The customer code or \&quot;me\&quot; for the currently logged in customer.
558
+ * @type {string}
559
+ * @memberof LeadsApiUpdateLead
560
+ */
561
+ readonly customerCode: string
562
+
563
+ /**
564
+ *
565
+ * @type {UpdateLeadRequestDto}
566
+ * @memberof LeadsApiUpdateLead
567
+ */
568
+ readonly updateLeadRequestDto: UpdateLeadRequestDto
569
+
570
+ /**
571
+ * Bearer Token
572
+ * @type {string}
573
+ * @memberof LeadsApiUpdateLead
574
+ */
575
+ readonly authorization?: string
576
+ }
577
+
578
+ /**
579
+ * LeadsApi - object-oriented interface
580
+ * @export
581
+ * @class LeadsApi
582
+ * @extends {BaseAPI}
583
+ */
584
+ export class LeadsApi extends BaseAPI {
585
+ /**
586
+ * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information.
587
+ * @summary Create the lead
588
+ * @param {LeadsApiCreateLeadRequest} requestParameters Request parameters.
589
+ * @param {*} [options] Override http request option.
590
+ * @throws {RequiredError}
591
+ * @memberof LeadsApi
592
+ */
593
+ public createLead(requestParameters: LeadsApiCreateLeadRequest, options?: AxiosRequestConfig) {
594
+ return LeadsApiFp(this.configuration).createLead(requestParameters.customerCode, requestParameters.createLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
595
+ }
596
+
597
+ /**
598
+ * 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.
599
+ * @summary Retrieve the lead
600
+ * @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
601
+ * @param {*} [options] Override http request option.
602
+ * @throws {RequiredError}
603
+ * @memberof LeadsApi
604
+ */
605
+ public getLead(requestParameters: LeadsApiGetLeadRequest, options?: AxiosRequestConfig) {
606
+ return LeadsApiFp(this.configuration).getLead(requestParameters.code, requestParameters.customerCode, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
607
+ }
608
+
609
+ /**
610
+ * Returns a list of leads you have previously created. The leads are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
611
+ * @summary List leads
612
+ * @param {LeadsApiListLeadsRequest} requestParameters Request parameters.
613
+ * @param {*} [options] Override http request option.
614
+ * @throws {RequiredError}
615
+ * @memberof LeadsApi
616
+ */
617
+ public listLeads(requestParameters: LeadsApiListLeadsRequest, options?: AxiosRequestConfig) {
618
+ return LeadsApiFp(this.configuration).listLeads(requestParameters.customerCode, requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
619
+ }
620
+
621
+ /**
622
+ * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
623
+ * @summary Update the lead
624
+ * @param {LeadsApiUpdateLeadRequest} requestParameters Request parameters.
625
+ * @param {*} [options] Override http request option.
626
+ * @throws {RequiredError}
627
+ * @memberof LeadsApi
628
+ */
629
+ public updateLead(requestParameters: LeadsApiUpdateLeadRequest, options?: AxiosRequestConfig) {
630
+ return LeadsApiFp(this.configuration).updateLead(requestParameters.code, requestParameters.customerCode, requestParameters.updateLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
631
+ }
632
+ }
package/api.ts CHANGED
@@ -30,6 +30,7 @@ import { CustomersApi } from './api';
30
30
  import { DocumentsApi } from './api';
31
31
  import { InvitesApi } from './api';
32
32
  import { InvoicesApi } from './api';
33
+ import { LeadsApi } from './api';
33
34
  import { PaymentsApi } from './api';
34
35
  import { PoliciesApi } from './api';
35
36
  import { ProductsApi } from './api';
@@ -41,6 +42,7 @@ export * from './api/customers-api';
41
42
  export * from './api/documents-api';
42
43
  export * from './api/invites-api';
43
44
  export * from './api/invoices-api';
45
+ export * from './api/leads-api';
44
46
  export * from './api/payments-api';
45
47
  export * from './api/policies-api';
46
48
  export * from './api/products-api';
package/base.ts CHANGED
@@ -22,7 +22,7 @@ import * as fs from 'fs';
22
22
  import * as path from 'path';
23
23
  import * as os from 'os';
24
24
 
25
- export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
25
+ export const BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
26
26
  const CONFIG_DIRECTORY = '.emil';
27
27
  const CONFIG_FILENAME = 'credentials';
28
28
  const KEY_USERNAME = 'emil_username';