@emilgroup/public-api-sdk-node 1.28.0 → 1.30.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.
- package/.openapi-generator/FILES +1 -0
- package/README.md +18 -2
- package/api/booking-funnels-api.ts +4 -4
- package/api/documents-api.ts +20 -6
- package/api/leads-api.ts +4 -4
- package/base.ts +15 -7
- package/dist/api/booking-funnels-api.d.ts +4 -4
- package/dist/api/booking-funnels-api.js +4 -4
- package/dist/api/documents-api.d.ts +12 -3
- package/dist/api/documents-api.js +12 -6
- package/dist/api/leads-api.d.ts +4 -4
- package/dist/api/leads-api.js +4 -4
- package/dist/base.d.ts +3 -1
- package/dist/base.js +27 -20
- package/dist/models/create-estimated-invoice-response-class.d.ts +7 -1
- package/dist/models/create-lead-request-dto.d.ts +6 -11
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/link-lead-partner-request-dto.d.ts +36 -0
- package/dist/models/link-lead-partner-request-dto.js +15 -0
- package/models/create-estimated-invoice-response-class.ts +7 -1
- package/models/create-lead-request-dto.ts +6 -11
- package/models/index.ts +1 -0
- package/models/link-lead-partner-request-dto.ts +42 -0
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -71,6 +71,7 @@ models/lead-bank-account-class.ts
|
|
|
71
71
|
models/lead-class.ts
|
|
72
72
|
models/lead-policy-class.ts
|
|
73
73
|
models/lead-policy-object-class.ts
|
|
74
|
+
models/link-lead-partner-request-dto.ts
|
|
74
75
|
models/list-documents-response-class.ts
|
|
75
76
|
models/list-product-documents-response-class.ts
|
|
76
77
|
models/list-products-response-class.ts
|
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/public-api-sdk-node@1.
|
|
20
|
+
npm install @emilgroup/public-api-sdk-node@1.30.0 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/public-api-sdk-node@1.
|
|
24
|
+
yarn add @emilgroup/public-api-sdk-node@1.30.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `PublicApi`.
|
|
@@ -47,6 +47,22 @@ export EMIL_USERNAME=XXXXX@XXXX.XXX
|
|
|
47
47
|
export EMIL_PASSWORD=XXXXXXXXXXXXXX
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
## Base path
|
|
51
|
+
|
|
52
|
+
To select the basic path for using the API, we can use two approaches. The first is to use one of the predefined environments, and the second is to specify the domain as a string.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { PublicApi, Environment } from '@emilgroup/public-api-sdk-node'
|
|
56
|
+
|
|
57
|
+
const publicApi = new PublicApi();
|
|
58
|
+
|
|
59
|
+
// Allows you to simply choose environment. It will usually be Environment.Production.
|
|
60
|
+
publicApi.selectEnvironment(Environment.Production);
|
|
61
|
+
|
|
62
|
+
// For advanced users, use the custom baseUrl of the website you need to connect to.
|
|
63
|
+
publicApi.selectBasePath('https://my-custom-domain.com');
|
|
64
|
+
```
|
|
65
|
+
|
|
50
66
|
## Example
|
|
51
67
|
|
|
52
68
|
Here is a basic functionning example:
|
|
@@ -33,7 +33,7 @@ const FormData = require('form-data');
|
|
|
33
33
|
export const BookingFunnelsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
34
34
|
return {
|
|
35
35
|
/**
|
|
36
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
36
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
37
37
|
* @summary Retrieve the booking funnel
|
|
38
38
|
* @param {string} code Unique identifier for the object.
|
|
39
39
|
* @param {string} [authorization] Bearer Token
|
|
@@ -88,7 +88,7 @@ export const BookingFunnelsApiFp = function(configuration?: Configuration) {
|
|
|
88
88
|
const localVarAxiosParamCreator = BookingFunnelsApiAxiosParamCreator(configuration)
|
|
89
89
|
return {
|
|
90
90
|
/**
|
|
91
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
91
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
92
92
|
* @summary Retrieve the booking funnel
|
|
93
93
|
* @param {string} code Unique identifier for the object.
|
|
94
94
|
* @param {string} [authorization] Bearer Token
|
|
@@ -110,7 +110,7 @@ export const BookingFunnelsApiFactory = function (configuration?: Configuration,
|
|
|
110
110
|
const localVarFp = BookingFunnelsApiFp(configuration)
|
|
111
111
|
return {
|
|
112
112
|
/**
|
|
113
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
113
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
114
114
|
* @summary Retrieve the booking funnel
|
|
115
115
|
* @param {string} code Unique identifier for the object.
|
|
116
116
|
* @param {string} [authorization] Bearer Token
|
|
@@ -152,7 +152,7 @@ export interface BookingFunnelsApiGetBookingFunnelRequest {
|
|
|
152
152
|
*/
|
|
153
153
|
export class BookingFunnelsApi extends BaseAPI {
|
|
154
154
|
/**
|
|
155
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
155
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
156
156
|
* @summary Retrieve the booking funnel
|
|
157
157
|
* @param {BookingFunnelsApiGetBookingFunnelRequest} requestParameters Request parameters.
|
|
158
158
|
* @param {*} [options] Override http request option.
|
package/api/documents-api.ts
CHANGED
|
@@ -189,10 +189,11 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
189
189
|
* @param {string} productCode
|
|
190
190
|
* @param {string} code
|
|
191
191
|
* @param {string} [authorization] Bearer Token
|
|
192
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
192
193
|
* @param {*} [options] Override http request option.
|
|
193
194
|
* @throws {RequiredError}
|
|
194
195
|
*/
|
|
195
|
-
downloadProductDocumentUrl: async (productCode: string, code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
196
|
+
downloadProductDocumentUrl: async (productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
196
197
|
// verify required parameter 'productCode' is not null or undefined
|
|
197
198
|
assertParamExists('downloadProductDocumentUrl', 'productCode', productCode)
|
|
198
199
|
// verify required parameter 'code' is not null or undefined
|
|
@@ -217,6 +218,10 @@ export const DocumentsApiAxiosParamCreator = function (configuration?: Configura
|
|
|
217
218
|
// http bearer authentication required
|
|
218
219
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
219
220
|
|
|
221
|
+
if (contentDisposition !== undefined) {
|
|
222
|
+
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
223
|
+
}
|
|
224
|
+
|
|
220
225
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
221
226
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
222
227
|
}
|
|
@@ -480,11 +485,12 @@ export const DocumentsApiFp = function(configuration?: Configuration) {
|
|
|
480
485
|
* @param {string} productCode
|
|
481
486
|
* @param {string} code
|
|
482
487
|
* @param {string} [authorization] Bearer Token
|
|
488
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
483
489
|
* @param {*} [options] Override http request option.
|
|
484
490
|
* @throws {RequiredError}
|
|
485
491
|
*/
|
|
486
|
-
async downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>> {
|
|
487
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, options);
|
|
492
|
+
async downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>> {
|
|
493
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options);
|
|
488
494
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
489
495
|
},
|
|
490
496
|
/**
|
|
@@ -584,11 +590,12 @@ export const DocumentsApiFactory = function (configuration?: Configuration, base
|
|
|
584
590
|
* @param {string} productCode
|
|
585
591
|
* @param {string} code
|
|
586
592
|
* @param {string} [authorization] Bearer Token
|
|
593
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
587
594
|
* @param {*} [options] Override http request option.
|
|
588
595
|
* @throws {RequiredError}
|
|
589
596
|
*/
|
|
590
|
-
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass> {
|
|
591
|
-
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, options).then((request) => request(axios, basePath));
|
|
597
|
+
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass> {
|
|
598
|
+
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options).then((request) => request(axios, basePath));
|
|
592
599
|
},
|
|
593
600
|
/**
|
|
594
601
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
@@ -733,6 +740,13 @@ export interface DocumentsApiDownloadProductDocumentUrlRequest {
|
|
|
733
740
|
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
734
741
|
*/
|
|
735
742
|
readonly authorization?: string
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Content disposition override. Default will be depending on the document type.
|
|
746
|
+
* @type {'attachment' | 'inline'}
|
|
747
|
+
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
748
|
+
*/
|
|
749
|
+
readonly contentDisposition?: 'attachment' | 'inline'
|
|
736
750
|
}
|
|
737
751
|
|
|
738
752
|
/**
|
|
@@ -927,7 +941,7 @@ export class DocumentsApi extends BaseAPI {
|
|
|
927
941
|
* @memberof DocumentsApi
|
|
928
942
|
*/
|
|
929
943
|
public downloadProductDocumentUrl(requestParameters: DocumentsApiDownloadProductDocumentUrlRequest, options?: AxiosRequestConfig) {
|
|
930
|
-
return DocumentsApiFp(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
944
|
+
return DocumentsApiFp(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, options).then((request) => request(this.axios, this.basePath));
|
|
931
945
|
}
|
|
932
946
|
|
|
933
947
|
/**
|
package/api/leads-api.ts
CHANGED
|
@@ -186,7 +186,7 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
186
186
|
};
|
|
187
187
|
},
|
|
188
188
|
/**
|
|
189
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
189
|
+
* 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.
|
|
190
190
|
* @summary Retrieve the lead
|
|
191
191
|
* @param {string} code Unique identifier for the object.
|
|
192
192
|
* @param {string} [authorization] Bearer Token
|
|
@@ -420,7 +420,7 @@ export const LeadsApiFp = function(configuration?: Configuration) {
|
|
|
420
420
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
421
421
|
},
|
|
422
422
|
/**
|
|
423
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
423
|
+
* 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.
|
|
424
424
|
* @summary Retrieve the lead
|
|
425
425
|
* @param {string} code Unique identifier for the object.
|
|
426
426
|
* @param {string} [authorization] Bearer Token
|
|
@@ -512,7 +512,7 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath
|
|
|
512
512
|
return localVarFp.createLeadSync(createLeadRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
513
513
|
},
|
|
514
514
|
/**
|
|
515
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
515
|
+
* 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.
|
|
516
516
|
* @summary Retrieve the lead
|
|
517
517
|
* @param {string} code Unique identifier for the object.
|
|
518
518
|
* @param {string} [authorization] Bearer Token
|
|
@@ -757,7 +757,7 @@ export class LeadsApi extends BaseAPI {
|
|
|
757
757
|
}
|
|
758
758
|
|
|
759
759
|
/**
|
|
760
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
760
|
+
* 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.
|
|
761
761
|
* @summary Retrieve the lead
|
|
762
762
|
* @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
|
|
763
763
|
* @param {*} [options] Override http request option.
|
package/base.ts
CHANGED
|
@@ -79,6 +79,7 @@ export class BaseAPI {
|
|
|
79
79
|
protected configuration: Configuration;
|
|
80
80
|
private username?: string;
|
|
81
81
|
private password?: string;
|
|
82
|
+
private permissions: Array<string> = [];
|
|
82
83
|
|
|
83
84
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
84
85
|
if (configuration) {
|
|
@@ -149,6 +150,10 @@ export class BaseAPI {
|
|
|
149
150
|
this.configuration.basePath = env;
|
|
150
151
|
}
|
|
151
152
|
|
|
153
|
+
getPermissions(): Array<string> {
|
|
154
|
+
return this.permissions;
|
|
155
|
+
}
|
|
156
|
+
|
|
152
157
|
async authorize(username: string, password: string): Promise<void> {
|
|
153
158
|
const options: AxiosRequestConfig = {
|
|
154
159
|
method: 'POST',
|
|
@@ -163,20 +168,21 @@ export class BaseAPI {
|
|
|
163
168
|
|
|
164
169
|
const response = await globalAxios.request<LoginClass>(options);
|
|
165
170
|
|
|
166
|
-
const { data: { accessToken } } = response;
|
|
171
|
+
const { data: { accessToken, permissions } } = response;
|
|
167
172
|
this.configuration.username = username;
|
|
168
173
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
174
|
+
this.permissions = permissions;
|
|
169
175
|
|
|
170
176
|
const refreshToken = this.extractRefreshToken(response)
|
|
171
177
|
this.configuration.refreshToken = refreshToken;
|
|
172
178
|
}
|
|
173
179
|
|
|
174
|
-
async refreshTokenInternal(): Promise<
|
|
180
|
+
async refreshTokenInternal(): Promise<LoginClass> {
|
|
175
181
|
const { username, refreshToken } = this.configuration;
|
|
176
182
|
|
|
177
183
|
|
|
178
184
|
if (!username || !refreshToken) {
|
|
179
|
-
|
|
185
|
+
throw new Error('Failed to refresh token.');
|
|
180
186
|
}
|
|
181
187
|
|
|
182
188
|
const options: AxiosRequestConfig = {
|
|
@@ -190,9 +196,9 @@ export class BaseAPI {
|
|
|
190
196
|
withCredentials: true,
|
|
191
197
|
};
|
|
192
198
|
|
|
193
|
-
const
|
|
199
|
+
const response = await globalAxios.request<LoginClass>(options);
|
|
194
200
|
|
|
195
|
-
return
|
|
201
|
+
return response.data;
|
|
196
202
|
}
|
|
197
203
|
|
|
198
204
|
private extractRefreshToken(response: AxiosResponse): string {
|
|
@@ -221,8 +227,9 @@ export class BaseAPI {
|
|
|
221
227
|
if (err.response.status === 401 && !originalConfig._retry) {
|
|
222
228
|
originalConfig._retry = true;
|
|
223
229
|
try {
|
|
224
|
-
const tokenString = await this.refreshTokenInternal();
|
|
230
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
225
231
|
const accessToken = `Bearer ${tokenString}`;
|
|
232
|
+
this.permissions = permissions;
|
|
226
233
|
|
|
227
234
|
originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
|
|
228
235
|
|
|
@@ -246,8 +253,9 @@ export class BaseAPI {
|
|
|
246
253
|
){
|
|
247
254
|
_retry_count++;
|
|
248
255
|
try {
|
|
249
|
-
const tokenString = await this.refreshTokenInternal();
|
|
256
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
250
257
|
const accessToken = `Bearer ${tokenString}`;
|
|
258
|
+
this.permissions = permissions;
|
|
251
259
|
|
|
252
260
|
_retry = true;
|
|
253
261
|
originalConfig.headers['Authorization'] = accessToken;
|
|
@@ -19,7 +19,7 @@ import { GetBookingFunnelResponseClass } from '../models';
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const BookingFunnelsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
21
21
|
/**
|
|
22
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
22
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
23
23
|
* @summary Retrieve the booking funnel
|
|
24
24
|
* @param {string} code Unique identifier for the object.
|
|
25
25
|
* @param {string} [authorization] Bearer Token
|
|
@@ -34,7 +34,7 @@ export declare const BookingFunnelsApiAxiosParamCreator: (configuration?: Config
|
|
|
34
34
|
*/
|
|
35
35
|
export declare const BookingFunnelsApiFp: (configuration?: Configuration) => {
|
|
36
36
|
/**
|
|
37
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
37
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
38
38
|
* @summary Retrieve the booking funnel
|
|
39
39
|
* @param {string} code Unique identifier for the object.
|
|
40
40
|
* @param {string} [authorization] Bearer Token
|
|
@@ -49,7 +49,7 @@ export declare const BookingFunnelsApiFp: (configuration?: Configuration) => {
|
|
|
49
49
|
*/
|
|
50
50
|
export declare const BookingFunnelsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
51
51
|
/**
|
|
52
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
52
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
53
53
|
* @summary Retrieve the booking funnel
|
|
54
54
|
* @param {string} code Unique identifier for the object.
|
|
55
55
|
* @param {string} [authorization] Bearer Token
|
|
@@ -85,7 +85,7 @@ export interface BookingFunnelsApiGetBookingFunnelRequest {
|
|
|
85
85
|
*/
|
|
86
86
|
export declare class BookingFunnelsApi extends BaseAPI {
|
|
87
87
|
/**
|
|
88
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
88
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
89
89
|
* @summary Retrieve the booking funnel
|
|
90
90
|
* @param {BookingFunnelsApiGetBookingFunnelRequest} requestParameters Request parameters.
|
|
91
91
|
* @param {*} [options] Override http request option.
|
|
@@ -97,7 +97,7 @@ var BookingFunnelsApiAxiosParamCreator = function (configuration) {
|
|
|
97
97
|
var _this = this;
|
|
98
98
|
return {
|
|
99
99
|
/**
|
|
100
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
100
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
101
101
|
* @summary Retrieve the booking funnel
|
|
102
102
|
* @param {string} code Unique identifier for the object.
|
|
103
103
|
* @param {string} [authorization] Bearer Token
|
|
@@ -155,7 +155,7 @@ var BookingFunnelsApiFp = function (configuration) {
|
|
|
155
155
|
var localVarAxiosParamCreator = (0, exports.BookingFunnelsApiAxiosParamCreator)(configuration);
|
|
156
156
|
return {
|
|
157
157
|
/**
|
|
158
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
158
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
159
159
|
* @summary Retrieve the booking funnel
|
|
160
160
|
* @param {string} code Unique identifier for the object.
|
|
161
161
|
* @param {string} [authorization] Bearer Token
|
|
@@ -186,7 +186,7 @@ var BookingFunnelsApiFactory = function (configuration, basePath, axios) {
|
|
|
186
186
|
var localVarFp = (0, exports.BookingFunnelsApiFp)(configuration);
|
|
187
187
|
return {
|
|
188
188
|
/**
|
|
189
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
189
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
190
190
|
* @summary Retrieve the booking funnel
|
|
191
191
|
* @param {string} code Unique identifier for the object.
|
|
192
192
|
* @param {string} [authorization] Bearer Token
|
|
@@ -211,7 +211,7 @@ var BookingFunnelsApi = /** @class */ (function (_super) {
|
|
|
211
211
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
|
-
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code
|
|
214
|
+
* Retrieves the details of the booking funnel that was previously created. Supply the unique booking funnel code that was returned when you created it and Emil Api will return the corresponding booking funnel information.
|
|
215
215
|
* @summary Retrieve the booking funnel
|
|
216
216
|
* @param {BookingFunnelsApiGetBookingFunnelRequest} requestParameters Request parameters.
|
|
217
217
|
* @param {*} [options] Override http request option.
|
|
@@ -57,10 +57,11 @@ export declare const DocumentsApiAxiosParamCreator: (configuration?: Configurati
|
|
|
57
57
|
* @param {string} productCode
|
|
58
58
|
* @param {string} code
|
|
59
59
|
* @param {string} [authorization] Bearer Token
|
|
60
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
60
61
|
* @param {*} [options] Override http request option.
|
|
61
62
|
* @throws {RequiredError}
|
|
62
63
|
*/
|
|
63
|
-
downloadProductDocumentUrl: (productCode: string, code: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
64
|
+
downloadProductDocumentUrl: (productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
64
65
|
/**
|
|
65
66
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
66
67
|
* @summary List documents
|
|
@@ -139,10 +140,11 @@ export declare const DocumentsApiFp: (configuration?: Configuration) => {
|
|
|
139
140
|
* @param {string} productCode
|
|
140
141
|
* @param {string} code
|
|
141
142
|
* @param {string} [authorization] Bearer Token
|
|
143
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
142
144
|
* @param {*} [options] Override http request option.
|
|
143
145
|
* @throws {RequiredError}
|
|
144
146
|
*/
|
|
145
|
-
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>>;
|
|
147
|
+
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetProductDocumentDownloadUrlResponseClass>>;
|
|
146
148
|
/**
|
|
147
149
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
148
150
|
* @summary List documents
|
|
@@ -221,10 +223,11 @@ export declare const DocumentsApiFactory: (configuration?: Configuration, basePa
|
|
|
221
223
|
* @param {string} productCode
|
|
222
224
|
* @param {string} code
|
|
223
225
|
* @param {string} [authorization] Bearer Token
|
|
226
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
224
227
|
* @param {*} [options] Override http request option.
|
|
225
228
|
* @throws {RequiredError}
|
|
226
229
|
*/
|
|
227
|
-
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass>;
|
|
230
|
+
downloadProductDocumentUrl(productCode: string, code: string, authorization?: string, contentDisposition?: 'attachment' | 'inline', options?: any): AxiosPromise<GetProductDocumentDownloadUrlResponseClass>;
|
|
228
231
|
/**
|
|
229
232
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
230
233
|
* @summary List documents
|
|
@@ -351,6 +354,12 @@ export interface DocumentsApiDownloadProductDocumentUrlRequest {
|
|
|
351
354
|
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
352
355
|
*/
|
|
353
356
|
readonly authorization?: string;
|
|
357
|
+
/**
|
|
358
|
+
* Content disposition override. Default will be depending on the document type.
|
|
359
|
+
* @type {'attachment' | 'inline'}
|
|
360
|
+
* @memberof DocumentsApiDownloadProductDocumentUrl
|
|
361
|
+
*/
|
|
362
|
+
readonly contentDisposition?: 'attachment' | 'inline';
|
|
354
363
|
}
|
|
355
364
|
/**
|
|
356
365
|
* Request parameters for listDocuments operation in DocumentsApi.
|
|
@@ -251,10 +251,11 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
251
251
|
* @param {string} productCode
|
|
252
252
|
* @param {string} code
|
|
253
253
|
* @param {string} [authorization] Bearer Token
|
|
254
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
254
255
|
* @param {*} [options] Override http request option.
|
|
255
256
|
* @throws {RequiredError}
|
|
256
257
|
*/
|
|
257
|
-
downloadProductDocumentUrl: function (productCode, code, authorization, options) {
|
|
258
|
+
downloadProductDocumentUrl: function (productCode, code, authorization, contentDisposition, options) {
|
|
258
259
|
if (options === void 0) { options = {}; }
|
|
259
260
|
return __awaiter(_this, void 0, void 0, function () {
|
|
260
261
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -283,6 +284,9 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
283
284
|
// authentication bearer required
|
|
284
285
|
// http bearer authentication required
|
|
285
286
|
_a.sent();
|
|
287
|
+
if (contentDisposition !== undefined) {
|
|
288
|
+
localVarQueryParameter['contentDisposition'] = contentDisposition;
|
|
289
|
+
}
|
|
286
290
|
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
287
291
|
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
288
292
|
}
|
|
@@ -568,15 +572,16 @@ var DocumentsApiFp = function (configuration) {
|
|
|
568
572
|
* @param {string} productCode
|
|
569
573
|
* @param {string} code
|
|
570
574
|
* @param {string} [authorization] Bearer Token
|
|
575
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
571
576
|
* @param {*} [options] Override http request option.
|
|
572
577
|
* @throws {RequiredError}
|
|
573
578
|
*/
|
|
574
|
-
downloadProductDocumentUrl: function (productCode, code, authorization, options) {
|
|
579
|
+
downloadProductDocumentUrl: function (productCode, code, authorization, contentDisposition, options) {
|
|
575
580
|
return __awaiter(this, void 0, void 0, function () {
|
|
576
581
|
var localVarAxiosArgs;
|
|
577
582
|
return __generator(this, function (_a) {
|
|
578
583
|
switch (_a.label) {
|
|
579
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, options)];
|
|
584
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options)];
|
|
580
585
|
case 1:
|
|
581
586
|
localVarAxiosArgs = _a.sent();
|
|
582
587
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -708,11 +713,12 @@ var DocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
708
713
|
* @param {string} productCode
|
|
709
714
|
* @param {string} code
|
|
710
715
|
* @param {string} [authorization] Bearer Token
|
|
716
|
+
* @param {'attachment' | 'inline'} [contentDisposition] Content disposition override. Default will be depending on the document type.
|
|
711
717
|
* @param {*} [options] Override http request option.
|
|
712
718
|
* @throws {RequiredError}
|
|
713
719
|
*/
|
|
714
|
-
downloadProductDocumentUrl: function (productCode, code, authorization, options) {
|
|
715
|
-
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
720
|
+
downloadProductDocumentUrl: function (productCode, code, authorization, contentDisposition, options) {
|
|
721
|
+
return localVarFp.downloadProductDocumentUrl(productCode, code, authorization, contentDisposition, options).then(function (request) { return request(axios, basePath); });
|
|
716
722
|
},
|
|
717
723
|
/**
|
|
718
724
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
@@ -818,7 +824,7 @@ var DocumentsApi = /** @class */ (function (_super) {
|
|
|
818
824
|
*/
|
|
819
825
|
DocumentsApi.prototype.downloadProductDocumentUrl = function (requestParameters, options) {
|
|
820
826
|
var _this = this;
|
|
821
|
-
return (0, exports.DocumentsApiFp)(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
827
|
+
return (0, exports.DocumentsApiFp)(this.configuration).downloadProductDocumentUrl(requestParameters.productCode, requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
822
828
|
};
|
|
823
829
|
/**
|
|
824
830
|
* Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
package/dist/api/leads-api.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare const LeadsApiAxiosParamCreator: (configuration?: Configuration)
|
|
|
52
52
|
*/
|
|
53
53
|
createLeadSync: (createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
54
54
|
/**
|
|
55
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
55
|
+
* 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.
|
|
56
56
|
* @summary Retrieve the lead
|
|
57
57
|
* @param {string} code Unique identifier for the object.
|
|
58
58
|
* @param {string} [authorization] Bearer Token
|
|
@@ -122,7 +122,7 @@ export declare const LeadsApiFp: (configuration?: Configuration) => {
|
|
|
122
122
|
*/
|
|
123
123
|
createLeadSync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateLeadResponseClass>>;
|
|
124
124
|
/**
|
|
125
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
125
|
+
* 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.
|
|
126
126
|
* @summary Retrieve the lead
|
|
127
127
|
* @param {string} code Unique identifier for the object.
|
|
128
128
|
* @param {string} [authorization] Bearer Token
|
|
@@ -192,7 +192,7 @@ export declare const LeadsApiFactory: (configuration?: Configuration, basePath?:
|
|
|
192
192
|
*/
|
|
193
193
|
createLeadSync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise<CreateLeadResponseClass>;
|
|
194
194
|
/**
|
|
195
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
195
|
+
* 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.
|
|
196
196
|
* @summary Retrieve the lead
|
|
197
197
|
* @param {string} code Unique identifier for the object.
|
|
198
198
|
* @param {string} [authorization] Bearer Token
|
|
@@ -403,7 +403,7 @@ export declare class LeadsApi extends BaseAPI {
|
|
|
403
403
|
*/
|
|
404
404
|
createLeadSync(requestParameters: LeadsApiCreateLeadSyncRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateLeadResponseClass, any>>;
|
|
405
405
|
/**
|
|
406
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
406
|
+
* 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.
|
|
407
407
|
* @summary Retrieve the lead
|
|
408
408
|
* @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
|
|
409
409
|
* @param {*} [options] Override http request option.
|
package/dist/api/leads-api.js
CHANGED
|
@@ -244,7 +244,7 @@ var LeadsApiAxiosParamCreator = function (configuration) {
|
|
|
244
244
|
});
|
|
245
245
|
},
|
|
246
246
|
/**
|
|
247
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
247
|
+
* 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.
|
|
248
248
|
* @summary Retrieve the lead
|
|
249
249
|
* @param {string} code Unique identifier for the object.
|
|
250
250
|
* @param {string} [authorization] Bearer Token
|
|
@@ -515,7 +515,7 @@ var LeadsApiFp = function (configuration) {
|
|
|
515
515
|
});
|
|
516
516
|
},
|
|
517
517
|
/**
|
|
518
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
518
|
+
* 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.
|
|
519
519
|
* @summary Retrieve the lead
|
|
520
520
|
* @param {string} code Unique identifier for the object.
|
|
521
521
|
* @param {string} [authorization] Bearer Token
|
|
@@ -643,7 +643,7 @@ var LeadsApiFactory = function (configuration, basePath, axios) {
|
|
|
643
643
|
return localVarFp.createLeadSync(createLeadRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
644
644
|
},
|
|
645
645
|
/**
|
|
646
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
646
|
+
* 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.
|
|
647
647
|
* @summary Retrieve the lead
|
|
648
648
|
* @param {string} code Unique identifier for the object.
|
|
649
649
|
* @param {string} [authorization] Bearer Token
|
|
@@ -738,7 +738,7 @@ var LeadsApi = /** @class */ (function (_super) {
|
|
|
738
738
|
return (0, exports.LeadsApiFp)(this.configuration).createLeadSync(requestParameters.createLeadRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
739
739
|
};
|
|
740
740
|
/**
|
|
741
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
741
|
+
* 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.
|
|
742
742
|
* @summary Retrieve the lead
|
|
743
743
|
* @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
|
|
744
744
|
* @param {*} [options] Override http request option.
|
package/dist/base.d.ts
CHANGED
|
@@ -53,14 +53,16 @@ export declare class BaseAPI {
|
|
|
53
53
|
protected configuration: Configuration;
|
|
54
54
|
private username?;
|
|
55
55
|
private password?;
|
|
56
|
+
private permissions;
|
|
56
57
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
57
58
|
initialize(env?: Environment): Promise<void>;
|
|
58
59
|
private loadCredentials;
|
|
59
60
|
private readConfigFile;
|
|
60
61
|
private readEnvVariables;
|
|
61
62
|
selectEnvironment(env: Environment): void;
|
|
63
|
+
getPermissions(): Array<string>;
|
|
62
64
|
authorize(username: string, password: string): Promise<void>;
|
|
63
|
-
refreshTokenInternal(): Promise<
|
|
65
|
+
refreshTokenInternal(): Promise<LoginClass>;
|
|
64
66
|
private extractRefreshToken;
|
|
65
67
|
getConfiguration(): Configuration;
|
|
66
68
|
private attachInterceptor;
|
package/dist/base.js
CHANGED
|
@@ -150,6 +150,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
150
150
|
if (axios === void 0) { axios = axios_1.default; }
|
|
151
151
|
this.basePath = basePath;
|
|
152
152
|
this.axios = axios;
|
|
153
|
+
this.permissions = [];
|
|
153
154
|
if (configuration) {
|
|
154
155
|
this.configuration = configuration;
|
|
155
156
|
this.basePath = configuration.basePath || this.basePath;
|
|
@@ -242,11 +243,14 @@ var BaseAPI = /** @class */ (function () {
|
|
|
242
243
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
243
244
|
this.configuration.basePath = env;
|
|
244
245
|
};
|
|
246
|
+
BaseAPI.prototype.getPermissions = function () {
|
|
247
|
+
return this.permissions;
|
|
248
|
+
};
|
|
245
249
|
BaseAPI.prototype.authorize = function (username, password) {
|
|
246
250
|
return __awaiter(this, void 0, void 0, function () {
|
|
247
|
-
var options, response, accessToken, refreshToken;
|
|
248
|
-
return __generator(this, function (
|
|
249
|
-
switch (
|
|
251
|
+
var options, response, _a, accessToken, permissions, refreshToken;
|
|
252
|
+
return __generator(this, function (_b) {
|
|
253
|
+
switch (_b.label) {
|
|
250
254
|
case 0:
|
|
251
255
|
options = {
|
|
252
256
|
method: 'POST',
|
|
@@ -260,10 +264,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
260
264
|
};
|
|
261
265
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
262
266
|
case 1:
|
|
263
|
-
response =
|
|
264
|
-
|
|
267
|
+
response = _b.sent();
|
|
268
|
+
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
265
269
|
this.configuration.username = username;
|
|
266
270
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
271
|
+
this.permissions = permissions;
|
|
267
272
|
refreshToken = this.extractRefreshToken(response);
|
|
268
273
|
this.configuration.refreshToken = refreshToken;
|
|
269
274
|
return [2 /*return*/];
|
|
@@ -273,13 +278,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
273
278
|
};
|
|
274
279
|
BaseAPI.prototype.refreshTokenInternal = function () {
|
|
275
280
|
return __awaiter(this, void 0, void 0, function () {
|
|
276
|
-
var _a, username, refreshToken, options,
|
|
281
|
+
var _a, username, refreshToken, options, response;
|
|
277
282
|
return __generator(this, function (_b) {
|
|
278
283
|
switch (_b.label) {
|
|
279
284
|
case 0:
|
|
280
285
|
_a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
|
|
281
286
|
if (!username || !refreshToken) {
|
|
282
|
-
|
|
287
|
+
throw new Error('Failed to refresh token.');
|
|
283
288
|
}
|
|
284
289
|
options = {
|
|
285
290
|
method: 'POST',
|
|
@@ -293,8 +298,8 @@ var BaseAPI = /** @class */ (function () {
|
|
|
293
298
|
};
|
|
294
299
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
295
300
|
case 1:
|
|
296
|
-
|
|
297
|
-
return [2 /*return*/,
|
|
301
|
+
response = _b.sent();
|
|
302
|
+
return [2 /*return*/, response.data];
|
|
298
303
|
}
|
|
299
304
|
});
|
|
300
305
|
});
|
|
@@ -314,26 +319,27 @@ var BaseAPI = /** @class */ (function () {
|
|
|
314
319
|
axios.interceptors.response.use(function (res) {
|
|
315
320
|
return res;
|
|
316
321
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
317
|
-
var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
|
|
318
|
-
return __generator(this, function (
|
|
319
|
-
switch (
|
|
322
|
+
var originalConfig, _a, tokenString, permissions, accessToken, _error_1, _b, tokenString, permissions, accessToken, _error_2;
|
|
323
|
+
return __generator(this, function (_c) {
|
|
324
|
+
switch (_c.label) {
|
|
320
325
|
case 0:
|
|
321
326
|
originalConfig = err.config;
|
|
322
327
|
if (!err.response) return [3 /*break*/, 5];
|
|
323
328
|
if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
|
|
324
329
|
originalConfig._retry = true;
|
|
325
|
-
|
|
330
|
+
_c.label = 1;
|
|
326
331
|
case 1:
|
|
327
|
-
|
|
332
|
+
_c.trys.push([1, 3, , 4]);
|
|
328
333
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
329
334
|
case 2:
|
|
330
|
-
|
|
335
|
+
_a = _c.sent(), tokenString = _a.accessToken, permissions = _a.permissions;
|
|
331
336
|
accessToken = "Bearer ".concat(tokenString);
|
|
337
|
+
this.permissions = permissions;
|
|
332
338
|
originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
|
|
333
339
|
this.configuration.accessToken = accessToken;
|
|
334
340
|
return [2 /*return*/, axios.request(originalConfig)];
|
|
335
341
|
case 3:
|
|
336
|
-
_error_1 =
|
|
342
|
+
_error_1 = _c.sent();
|
|
337
343
|
if (_error_1.response && _error_1.response.data) {
|
|
338
344
|
return [2 /*return*/, Promise.reject(_error_1.response.data)];
|
|
339
345
|
}
|
|
@@ -349,19 +355,20 @@ var BaseAPI = /** @class */ (function () {
|
|
|
349
355
|
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
350
356
|
&& _retry_count < 4)) return [3 /*break*/, 9];
|
|
351
357
|
_retry_count++;
|
|
352
|
-
|
|
358
|
+
_c.label = 6;
|
|
353
359
|
case 6:
|
|
354
|
-
|
|
360
|
+
_c.trys.push([6, 8, , 9]);
|
|
355
361
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
356
362
|
case 7:
|
|
357
|
-
|
|
363
|
+
_b = _c.sent(), tokenString = _b.accessToken, permissions = _b.permissions;
|
|
358
364
|
accessToken = "Bearer ".concat(tokenString);
|
|
365
|
+
this.permissions = permissions;
|
|
359
366
|
_retry = true;
|
|
360
367
|
originalConfig.headers['Authorization'] = accessToken;
|
|
361
368
|
this.configuration.accessToken = accessToken;
|
|
362
369
|
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
363
370
|
case 8:
|
|
364
|
-
_error_2 =
|
|
371
|
+
_error_2 = _c.sent();
|
|
365
372
|
if (_error_2.response && _error_2.response.data) {
|
|
366
373
|
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
367
374
|
}
|
|
@@ -18,11 +18,17 @@ import { InvoiceClass } from './invoice-class';
|
|
|
18
18
|
*/
|
|
19
19
|
export interface CreateEstimatedInvoiceResponseClass {
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* The estimated invoice response based on the current policy data. This includes the calculated invoice for the specified billing period (e.g., monthly, quarterly) as defined by the policy. The invoice contains details such as gross amount, net amount, tax amount, and other invoice-related data for the specific period the invoice is generated for.
|
|
22
22
|
* @type {InvoiceClass}
|
|
23
23
|
* @memberof CreateEstimatedInvoiceResponseClass
|
|
24
24
|
*/
|
|
25
25
|
'invoice'?: InvoiceClass;
|
|
26
|
+
/**
|
|
27
|
+
* The estimated yearly invoice response. This represents the invoice recalculated to a yearly format, standardizing the invoice values regardless of the billing frequency defined by the policy (e.g., monthly, quarterly, etc.). This yearly invoice gives an overview of the total cost for the entire year, including recalculated gross amount, net amount, tax amount, and other related invoice data, ensuring that all charges are displayed on a yearly basis. Note: If the original invoice is already set to a yearly billing frequency, the \'yearlyInvoice\' will be identical to the \'invoice\'.
|
|
28
|
+
* @type {InvoiceClass}
|
|
29
|
+
* @memberof CreateEstimatedInvoiceResponseClass
|
|
30
|
+
*/
|
|
31
|
+
'yearlyInvoice'?: InvoiceClass;
|
|
26
32
|
/**
|
|
27
33
|
* In some cases, custom premium calculation needs to be used. In that case, a custom object is returned. It can hold up any kind of information. For more information, check the general documentation.
|
|
28
34
|
* @type {object}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { CreateAccountRequestDto } from './create-account-request-dto';
|
|
13
13
|
import { CreateBankAccountRequestDto } from './create-bank-account-request-dto';
|
|
14
14
|
import { CreatePaymentMethodRequestDto } from './create-payment-method-request-dto';
|
|
15
|
+
import { LinkLeadPartnerRequestDto } from './link-lead-partner-request-dto';
|
|
15
16
|
import { PolicyObjectRequestDto } from './policy-object-request-dto';
|
|
16
17
|
import { PremiumOverrideRequestDto } from './premium-override-request-dto';
|
|
17
18
|
import { UploadedDocumentDto } from './uploaded-document-dto';
|
|
@@ -89,10 +90,10 @@ export interface CreateLeadRequestDto {
|
|
|
89
90
|
'status'?: string;
|
|
90
91
|
/**
|
|
91
92
|
* Premium Override is utilized to override the premium calculation. The premium formulas will be disregarded when this object is present. The premium override content will be validated if the \'validate\' flag is set to true.
|
|
92
|
-
* @type {
|
|
93
|
+
* @type {PremiumOverrideRequestDto}
|
|
93
94
|
* @memberof CreateLeadRequestDto
|
|
94
95
|
*/
|
|
95
|
-
'premiumOverride'?:
|
|
96
|
+
'premiumOverride'?: PremiumOverrideRequestDto;
|
|
96
97
|
/**
|
|
97
98
|
* Payment method, used to for payment method support, such as SEPA, invoice, etc. The payment method content will be validated if the \'validate\' flag is set to true.
|
|
98
99
|
* @type {CreatePaymentMethodRequestDto}
|
|
@@ -106,15 +107,9 @@ export interface CreateLeadRequestDto {
|
|
|
106
107
|
*/
|
|
107
108
|
'validate'?: boolean;
|
|
108
109
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @type {
|
|
111
|
-
* @memberof CreateLeadRequestDto
|
|
112
|
-
*/
|
|
113
|
-
'partnerCode'?: string;
|
|
114
|
-
/**
|
|
115
|
-
* An optional partner role code to establish a link between a lead and a partner. It must be sent together with the partner code. It will be validated regardless of the value of the \'validate\' flag.
|
|
116
|
-
* @type {string}
|
|
110
|
+
* Optional partner object contains necessary information to link a partner to the policy. The partner content will be validated if the \'validate\' flag is set to true.
|
|
111
|
+
* @type {LinkLeadPartnerRequestDto}
|
|
117
112
|
* @memberof CreateLeadRequestDto
|
|
118
113
|
*/
|
|
119
|
-
'
|
|
114
|
+
'partner'?: LinkLeadPartnerRequestDto;
|
|
120
115
|
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export * from './lead-bank-account-class';
|
|
|
51
51
|
export * from './lead-class';
|
|
52
52
|
export * from './lead-policy-class';
|
|
53
53
|
export * from './lead-policy-object-class';
|
|
54
|
+
export * from './link-lead-partner-request-dto';
|
|
54
55
|
export * from './list-documents-response-class';
|
|
55
56
|
export * from './list-product-documents-response-class';
|
|
56
57
|
export * from './list-products-response-class';
|
package/dist/models/index.js
CHANGED
|
@@ -67,6 +67,7 @@ __exportStar(require("./lead-bank-account-class"), exports);
|
|
|
67
67
|
__exportStar(require("./lead-class"), exports);
|
|
68
68
|
__exportStar(require("./lead-policy-class"), exports);
|
|
69
69
|
__exportStar(require("./lead-policy-object-class"), exports);
|
|
70
|
+
__exportStar(require("./link-lead-partner-request-dto"), exports);
|
|
70
71
|
__exportStar(require("./list-documents-response-class"), exports);
|
|
71
72
|
__exportStar(require("./list-product-documents-response-class"), exports);
|
|
72
73
|
__exportStar(require("./list-products-response-class"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emil PublicAPI
|
|
3
|
+
* The Emil Public API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface LinkLeadPartnerRequestDto
|
|
16
|
+
*/
|
|
17
|
+
export interface LinkLeadPartnerRequestDto {
|
|
18
|
+
/**
|
|
19
|
+
* The code of the partner with which the lead will be linked.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
22
|
+
*/
|
|
23
|
+
'partnerCode': string;
|
|
24
|
+
/**
|
|
25
|
+
* The code of role that the partner will have in the established link between the lead and the partner.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
28
|
+
*/
|
|
29
|
+
'partnerRoleCode': string;
|
|
30
|
+
/**
|
|
31
|
+
* The date of the start of linking with a partner.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
34
|
+
*/
|
|
35
|
+
'startDate': string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Emil PublicAPI
|
|
6
|
+
* The Emil Public API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -23,11 +23,17 @@ import { InvoiceClass } from './invoice-class';
|
|
|
23
23
|
*/
|
|
24
24
|
export interface CreateEstimatedInvoiceResponseClass {
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* The estimated invoice response based on the current policy data. This includes the calculated invoice for the specified billing period (e.g., monthly, quarterly) as defined by the policy. The invoice contains details such as gross amount, net amount, tax amount, and other invoice-related data for the specific period the invoice is generated for.
|
|
27
27
|
* @type {InvoiceClass}
|
|
28
28
|
* @memberof CreateEstimatedInvoiceResponseClass
|
|
29
29
|
*/
|
|
30
30
|
'invoice'?: InvoiceClass;
|
|
31
|
+
/**
|
|
32
|
+
* The estimated yearly invoice response. This represents the invoice recalculated to a yearly format, standardizing the invoice values regardless of the billing frequency defined by the policy (e.g., monthly, quarterly, etc.). This yearly invoice gives an overview of the total cost for the entire year, including recalculated gross amount, net amount, tax amount, and other related invoice data, ensuring that all charges are displayed on a yearly basis. Note: If the original invoice is already set to a yearly billing frequency, the \'yearlyInvoice\' will be identical to the \'invoice\'.
|
|
33
|
+
* @type {InvoiceClass}
|
|
34
|
+
* @memberof CreateEstimatedInvoiceResponseClass
|
|
35
|
+
*/
|
|
36
|
+
'yearlyInvoice'?: InvoiceClass;
|
|
31
37
|
/**
|
|
32
38
|
* In some cases, custom premium calculation needs to be used. In that case, a custom object is returned. It can hold up any kind of information. For more information, check the general documentation.
|
|
33
39
|
* @type {object}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { CreateAccountRequestDto } from './create-account-request-dto';
|
|
17
17
|
import { CreateBankAccountRequestDto } from './create-bank-account-request-dto';
|
|
18
18
|
import { CreatePaymentMethodRequestDto } from './create-payment-method-request-dto';
|
|
19
|
+
import { LinkLeadPartnerRequestDto } from './link-lead-partner-request-dto';
|
|
19
20
|
import { PolicyObjectRequestDto } from './policy-object-request-dto';
|
|
20
21
|
import { PremiumOverrideRequestDto } from './premium-override-request-dto';
|
|
21
22
|
import { UploadedDocumentDto } from './uploaded-document-dto';
|
|
@@ -94,10 +95,10 @@ export interface CreateLeadRequestDto {
|
|
|
94
95
|
'status'?: string;
|
|
95
96
|
/**
|
|
96
97
|
* Premium Override is utilized to override the premium calculation. The premium formulas will be disregarded when this object is present. The premium override content will be validated if the \'validate\' flag is set to true.
|
|
97
|
-
* @type {
|
|
98
|
+
* @type {PremiumOverrideRequestDto}
|
|
98
99
|
* @memberof CreateLeadRequestDto
|
|
99
100
|
*/
|
|
100
|
-
'premiumOverride'?:
|
|
101
|
+
'premiumOverride'?: PremiumOverrideRequestDto;
|
|
101
102
|
/**
|
|
102
103
|
* Payment method, used to for payment method support, such as SEPA, invoice, etc. The payment method content will be validated if the \'validate\' flag is set to true.
|
|
103
104
|
* @type {CreatePaymentMethodRequestDto}
|
|
@@ -111,16 +112,10 @@ export interface CreateLeadRequestDto {
|
|
|
111
112
|
*/
|
|
112
113
|
'validate'?: boolean;
|
|
113
114
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @type {
|
|
116
|
-
* @memberof CreateLeadRequestDto
|
|
117
|
-
*/
|
|
118
|
-
'partnerCode'?: string;
|
|
119
|
-
/**
|
|
120
|
-
* An optional partner role code to establish a link between a lead and a partner. It must be sent together with the partner code. It will be validated regardless of the value of the \'validate\' flag.
|
|
121
|
-
* @type {string}
|
|
115
|
+
* Optional partner object contains necessary information to link a partner to the policy. The partner content will be validated if the \'validate\' flag is set to true.
|
|
116
|
+
* @type {LinkLeadPartnerRequestDto}
|
|
122
117
|
* @memberof CreateLeadRequestDto
|
|
123
118
|
*/
|
|
124
|
-
'
|
|
119
|
+
'partner'?: LinkLeadPartnerRequestDto;
|
|
125
120
|
}
|
|
126
121
|
|
package/models/index.ts
CHANGED
|
@@ -51,6 +51,7 @@ export * from './lead-bank-account-class';
|
|
|
51
51
|
export * from './lead-class';
|
|
52
52
|
export * from './lead-policy-class';
|
|
53
53
|
export * from './lead-policy-object-class';
|
|
54
|
+
export * from './link-lead-partner-request-dto';
|
|
54
55
|
export * from './list-documents-response-class';
|
|
55
56
|
export * from './list-product-documents-response-class';
|
|
56
57
|
export * from './list-products-response-class';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Emil PublicAPI
|
|
5
|
+
* The Emil Public 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
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface LinkLeadPartnerRequestDto
|
|
21
|
+
*/
|
|
22
|
+
export interface LinkLeadPartnerRequestDto {
|
|
23
|
+
/**
|
|
24
|
+
* The code of the partner with which the lead will be linked.
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
27
|
+
*/
|
|
28
|
+
'partnerCode': string;
|
|
29
|
+
/**
|
|
30
|
+
* The code of role that the partner will have in the established link between the lead and the partner.
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
33
|
+
*/
|
|
34
|
+
'partnerRoleCode': string;
|
|
35
|
+
/**
|
|
36
|
+
* The date of the start of linking with a partner.
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof LinkLeadPartnerRequestDto
|
|
39
|
+
*/
|
|
40
|
+
'startDate': string;
|
|
41
|
+
}
|
|
42
|
+
|