@emilgroup/public-api-sdk-node 1.29.0 → 1.31.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 +2 -2
- package/api/booking-funnels-api.ts +4 -4
- package/api/leads-api.ts +25 -12
- package/api/payments-setup-api.ts +21 -8
- package/base.ts +16 -8
- package/dist/api/booking-funnels-api.d.ts +4 -4
- package/dist/api/booking-funnels-api.js +4 -4
- package/dist/api/leads-api.d.ts +17 -8
- package/dist/api/leads-api.js +17 -12
- package/dist/api/payments-setup-api.d.ts +13 -4
- package/dist/api/payments-setup-api.js +13 -8
- package/dist/base.d.ts +4 -2
- package/dist/base.js +26 -20
- package/dist/models/complete-payment-setup-request-dto.d.ts +6 -0
- 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/initiate-payment-setup-request-dto.d.ts +6 -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/dist/models/partner-class.d.ts +1 -1
- package/dist/models/update-lead-request-dto.d.ts +7 -0
- package/models/complete-payment-setup-request-dto.ts +6 -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/initiate-payment-setup-request-dto.ts +6 -0
- package/models/link-lead-partner-request-dto.ts +42 -0
- package/models/partner-class.ts +1 -1
- package/models/update-lead-request-dto.ts +7 -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.31.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.31.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `PublicApi`.
|
|
@@ -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/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
|
|
@@ -233,12 +233,16 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
233
233
|
/**
|
|
234
234
|
* This will initiate a lead code.
|
|
235
235
|
* @summary Initiate a lead code
|
|
236
|
+
* @param {string} productSlug
|
|
236
237
|
* @param {string} [authorization] Bearer Token
|
|
237
238
|
* @param {*} [options] Override http request option.
|
|
238
239
|
* @throws {RequiredError}
|
|
239
240
|
*/
|
|
240
|
-
initiateLead: async (authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
241
|
-
|
|
241
|
+
initiateLead: async (productSlug: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
242
|
+
// verify required parameter 'productSlug' is not null or undefined
|
|
243
|
+
assertParamExists('initiateLead', 'productSlug', productSlug)
|
|
244
|
+
const localVarPath = `/publicapi/v1/leads/initiate/{productSlug}`
|
|
245
|
+
.replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
|
|
242
246
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
243
247
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
244
248
|
let baseOptions;
|
|
@@ -420,7 +424,7 @@ export const LeadsApiFp = function(configuration?: Configuration) {
|
|
|
420
424
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
421
425
|
},
|
|
422
426
|
/**
|
|
423
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
427
|
+
* 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
428
|
* @summary Retrieve the lead
|
|
425
429
|
* @param {string} code Unique identifier for the object.
|
|
426
430
|
* @param {string} [authorization] Bearer Token
|
|
@@ -434,12 +438,13 @@ export const LeadsApiFp = function(configuration?: Configuration) {
|
|
|
434
438
|
/**
|
|
435
439
|
* This will initiate a lead code.
|
|
436
440
|
* @summary Initiate a lead code
|
|
441
|
+
* @param {string} productSlug
|
|
437
442
|
* @param {string} [authorization] Bearer Token
|
|
438
443
|
* @param {*} [options] Override http request option.
|
|
439
444
|
* @throws {RequiredError}
|
|
440
445
|
*/
|
|
441
|
-
async initiateLead(authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateLeadResponseClass>> {
|
|
442
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.initiateLead(authorization, options);
|
|
446
|
+
async initiateLead(productSlug: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateLeadResponseClass>> {
|
|
447
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.initiateLead(productSlug, authorization, options);
|
|
443
448
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
444
449
|
},
|
|
445
450
|
/**
|
|
@@ -512,7 +517,7 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath
|
|
|
512
517
|
return localVarFp.createLeadSync(createLeadRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
513
518
|
},
|
|
514
519
|
/**
|
|
515
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
520
|
+
* 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
521
|
* @summary Retrieve the lead
|
|
517
522
|
* @param {string} code Unique identifier for the object.
|
|
518
523
|
* @param {string} [authorization] Bearer Token
|
|
@@ -525,12 +530,13 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath
|
|
|
525
530
|
/**
|
|
526
531
|
* This will initiate a lead code.
|
|
527
532
|
* @summary Initiate a lead code
|
|
533
|
+
* @param {string} productSlug
|
|
528
534
|
* @param {string} [authorization] Bearer Token
|
|
529
535
|
* @param {*} [options] Override http request option.
|
|
530
536
|
* @throws {RequiredError}
|
|
531
537
|
*/
|
|
532
|
-
initiateLead(authorization?: string, options?: any): AxiosPromise<InitiateLeadResponseClass> {
|
|
533
|
-
return localVarFp.initiateLead(authorization, options).then((request) => request(axios, basePath));
|
|
538
|
+
initiateLead(productSlug: string, authorization?: string, options?: any): AxiosPromise<InitiateLeadResponseClass> {
|
|
539
|
+
return localVarFp.initiateLead(productSlug, authorization, options).then((request) => request(axios, basePath));
|
|
534
540
|
},
|
|
535
541
|
/**
|
|
536
542
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
@@ -649,6 +655,13 @@ export interface LeadsApiGetLeadRequest {
|
|
|
649
655
|
* @interface LeadsApiInitiateLeadRequest
|
|
650
656
|
*/
|
|
651
657
|
export interface LeadsApiInitiateLeadRequest {
|
|
658
|
+
/**
|
|
659
|
+
*
|
|
660
|
+
* @type {string}
|
|
661
|
+
* @memberof LeadsApiInitiateLead
|
|
662
|
+
*/
|
|
663
|
+
readonly productSlug: string
|
|
664
|
+
|
|
652
665
|
/**
|
|
653
666
|
* Bearer Token
|
|
654
667
|
* @type {string}
|
|
@@ -757,7 +770,7 @@ export class LeadsApi extends BaseAPI {
|
|
|
757
770
|
}
|
|
758
771
|
|
|
759
772
|
/**
|
|
760
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
773
|
+
* 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
774
|
* @summary Retrieve the lead
|
|
762
775
|
* @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
|
|
763
776
|
* @param {*} [options] Override http request option.
|
|
@@ -776,8 +789,8 @@ export class LeadsApi extends BaseAPI {
|
|
|
776
789
|
* @throws {RequiredError}
|
|
777
790
|
* @memberof LeadsApi
|
|
778
791
|
*/
|
|
779
|
-
public initiateLead(requestParameters: LeadsApiInitiateLeadRequest
|
|
780
|
-
return LeadsApiFp(this.configuration).initiateLead(requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
792
|
+
public initiateLead(requestParameters: LeadsApiInitiateLeadRequest, options?: AxiosRequestConfig) {
|
|
793
|
+
return LeadsApiFp(this.configuration).initiateLead(requestParameters.productSlug, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
781
794
|
}
|
|
782
795
|
|
|
783
796
|
/**
|
|
@@ -95,13 +95,17 @@ export const PaymentsSetupApiAxiosParamCreator = function (configuration?: Confi
|
|
|
95
95
|
/**
|
|
96
96
|
* This will send the customer the public key to load the payment form and complete the payment setup.
|
|
97
97
|
* @summary Get public key and psp
|
|
98
|
+
* @param {string} productSlug
|
|
98
99
|
* @param {string} [idempotencyKey] An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. Idempotency keys can be up to 255 characters long.
|
|
99
100
|
* @param {string} [authorization] Bearer Token
|
|
100
101
|
* @param {*} [options] Override http request option.
|
|
101
102
|
* @throws {RequiredError}
|
|
102
103
|
*/
|
|
103
|
-
getPublicPSPConfig: async (idempotencyKey?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
104
|
-
|
|
104
|
+
getPublicPSPConfig: async (productSlug: string, idempotencyKey?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
105
|
+
// verify required parameter 'productSlug' is not null or undefined
|
|
106
|
+
assertParamExists('getPublicPSPConfig', 'productSlug', productSlug)
|
|
107
|
+
const localVarPath = `/publicapi/v1/payment-setup/get-psp-config/{productSlug}`
|
|
108
|
+
.replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
|
|
105
109
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
106
110
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
107
111
|
let baseOptions;
|
|
@@ -216,13 +220,14 @@ export const PaymentsSetupApiFp = function(configuration?: Configuration) {
|
|
|
216
220
|
/**
|
|
217
221
|
* This will send the customer the public key to load the payment form and complete the payment setup.
|
|
218
222
|
* @summary Get public key and psp
|
|
223
|
+
* @param {string} productSlug
|
|
219
224
|
* @param {string} [idempotencyKey] An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. Idempotency keys can be up to 255 characters long.
|
|
220
225
|
* @param {string} [authorization] Bearer Token
|
|
221
226
|
* @param {*} [options] Override http request option.
|
|
222
227
|
* @throws {RequiredError}
|
|
223
228
|
*/
|
|
224
|
-
async getPublicPSPConfig(idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPublicPspSettingsResponseClass>> {
|
|
225
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicPSPConfig(idempotencyKey, authorization, options);
|
|
229
|
+
async getPublicPSPConfig(productSlug: string, idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPublicPspSettingsResponseClass>> {
|
|
230
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options);
|
|
226
231
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
227
232
|
},
|
|
228
233
|
/**
|
|
@@ -263,13 +268,14 @@ export const PaymentsSetupApiFactory = function (configuration?: Configuration,
|
|
|
263
268
|
/**
|
|
264
269
|
* This will send the customer the public key to load the payment form and complete the payment setup.
|
|
265
270
|
* @summary Get public key and psp
|
|
271
|
+
* @param {string} productSlug
|
|
266
272
|
* @param {string} [idempotencyKey] An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. Idempotency keys can be up to 255 characters long.
|
|
267
273
|
* @param {string} [authorization] Bearer Token
|
|
268
274
|
* @param {*} [options] Override http request option.
|
|
269
275
|
* @throws {RequiredError}
|
|
270
276
|
*/
|
|
271
|
-
getPublicPSPConfig(idempotencyKey?: string, authorization?: string, options?: any): AxiosPromise<GetPublicPspSettingsResponseClass> {
|
|
272
|
-
return localVarFp.getPublicPSPConfig(idempotencyKey, authorization, options).then((request) => request(axios, basePath));
|
|
277
|
+
getPublicPSPConfig(productSlug: string, idempotencyKey?: string, authorization?: string, options?: any): AxiosPromise<GetPublicPspSettingsResponseClass> {
|
|
278
|
+
return localVarFp.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options).then((request) => request(axios, basePath));
|
|
273
279
|
},
|
|
274
280
|
/**
|
|
275
281
|
* This will Initiate an account inside the payment service providers and they will generate a secret token which is allow user add its payment information.
|
|
@@ -320,6 +326,13 @@ export interface PaymentsSetupApiCompletePaymentSetupRequest {
|
|
|
320
326
|
* @interface PaymentsSetupApiGetPublicPSPConfigRequest
|
|
321
327
|
*/
|
|
322
328
|
export interface PaymentsSetupApiGetPublicPSPConfigRequest {
|
|
329
|
+
/**
|
|
330
|
+
*
|
|
331
|
+
* @type {string}
|
|
332
|
+
* @memberof PaymentsSetupApiGetPublicPSPConfig
|
|
333
|
+
*/
|
|
334
|
+
readonly productSlug: string
|
|
335
|
+
|
|
323
336
|
/**
|
|
324
337
|
* An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. Idempotency keys can be up to 255 characters long.
|
|
325
338
|
* @type {string}
|
|
@@ -390,8 +403,8 @@ export class PaymentsSetupApi extends BaseAPI {
|
|
|
390
403
|
* @throws {RequiredError}
|
|
391
404
|
* @memberof PaymentsSetupApi
|
|
392
405
|
*/
|
|
393
|
-
public getPublicPSPConfig(requestParameters: PaymentsSetupApiGetPublicPSPConfigRequest
|
|
394
|
-
return PaymentsSetupApiFp(this.configuration).getPublicPSPConfig(requestParameters.idempotencyKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
406
|
+
public getPublicPSPConfig(requestParameters: PaymentsSetupApiGetPublicPSPConfigRequest, options?: AxiosRequestConfig) {
|
|
407
|
+
return PaymentsSetupApiFp(this.configuration).getPublicPSPConfig(requestParameters.productSlug, requestParameters.idempotencyKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
395
408
|
}
|
|
396
409
|
|
|
397
410
|
/**
|
package/base.ts
CHANGED
|
@@ -41,7 +41,7 @@ export const COLLECTION_FORMATS = {
|
|
|
41
41
|
|
|
42
42
|
export interface LoginClass {
|
|
43
43
|
accessToken: string;
|
|
44
|
-
permissions:
|
|
44
|
+
permissions: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export enum Environment {
|
|
@@ -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?: 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.split(',');
|
|
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.
|
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
|
|
@@ -63,11 +63,12 @@ export declare const LeadsApiAxiosParamCreator: (configuration?: Configuration)
|
|
|
63
63
|
/**
|
|
64
64
|
* This will initiate a lead code.
|
|
65
65
|
* @summary Initiate a lead code
|
|
66
|
+
* @param {string} productSlug
|
|
66
67
|
* @param {string} [authorization] Bearer Token
|
|
67
68
|
* @param {*} [options] Override http request option.
|
|
68
69
|
* @throws {RequiredError}
|
|
69
70
|
*/
|
|
70
|
-
initiateLead: (authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
71
|
+
initiateLead: (productSlug: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
71
72
|
/**
|
|
72
73
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
73
74
|
* @summary Update the lead
|
|
@@ -122,7 +123,7 @@ export declare const LeadsApiFp: (configuration?: Configuration) => {
|
|
|
122
123
|
*/
|
|
123
124
|
createLeadSync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateLeadResponseClass>>;
|
|
124
125
|
/**
|
|
125
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
126
|
+
* 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
127
|
* @summary Retrieve the lead
|
|
127
128
|
* @param {string} code Unique identifier for the object.
|
|
128
129
|
* @param {string} [authorization] Bearer Token
|
|
@@ -133,11 +134,12 @@ export declare const LeadsApiFp: (configuration?: Configuration) => {
|
|
|
133
134
|
/**
|
|
134
135
|
* This will initiate a lead code.
|
|
135
136
|
* @summary Initiate a lead code
|
|
137
|
+
* @param {string} productSlug
|
|
136
138
|
* @param {string} [authorization] Bearer Token
|
|
137
139
|
* @param {*} [options] Override http request option.
|
|
138
140
|
* @throws {RequiredError}
|
|
139
141
|
*/
|
|
140
|
-
initiateLead(authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateLeadResponseClass>>;
|
|
142
|
+
initiateLead(productSlug: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateLeadResponseClass>>;
|
|
141
143
|
/**
|
|
142
144
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
143
145
|
* @summary Update the lead
|
|
@@ -192,7 +194,7 @@ export declare const LeadsApiFactory: (configuration?: Configuration, basePath?:
|
|
|
192
194
|
*/
|
|
193
195
|
createLeadSync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise<CreateLeadResponseClass>;
|
|
194
196
|
/**
|
|
195
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
197
|
+
* 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
198
|
* @summary Retrieve the lead
|
|
197
199
|
* @param {string} code Unique identifier for the object.
|
|
198
200
|
* @param {string} [authorization] Bearer Token
|
|
@@ -203,11 +205,12 @@ export declare const LeadsApiFactory: (configuration?: Configuration, basePath?:
|
|
|
203
205
|
/**
|
|
204
206
|
* This will initiate a lead code.
|
|
205
207
|
* @summary Initiate a lead code
|
|
208
|
+
* @param {string} productSlug
|
|
206
209
|
* @param {string} [authorization] Bearer Token
|
|
207
210
|
* @param {*} [options] Override http request option.
|
|
208
211
|
* @throws {RequiredError}
|
|
209
212
|
*/
|
|
210
|
-
initiateLead(authorization?: string, options?: any): AxiosPromise<InitiateLeadResponseClass>;
|
|
213
|
+
initiateLead(productSlug: string, authorization?: string, options?: any): AxiosPromise<InitiateLeadResponseClass>;
|
|
211
214
|
/**
|
|
212
215
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
213
216
|
* @summary Update the lead
|
|
@@ -311,6 +314,12 @@ export interface LeadsApiGetLeadRequest {
|
|
|
311
314
|
* @interface LeadsApiInitiateLeadRequest
|
|
312
315
|
*/
|
|
313
316
|
export interface LeadsApiInitiateLeadRequest {
|
|
317
|
+
/**
|
|
318
|
+
*
|
|
319
|
+
* @type {string}
|
|
320
|
+
* @memberof LeadsApiInitiateLead
|
|
321
|
+
*/
|
|
322
|
+
readonly productSlug: string;
|
|
314
323
|
/**
|
|
315
324
|
* Bearer Token
|
|
316
325
|
* @type {string}
|
|
@@ -403,7 +412,7 @@ export declare class LeadsApi extends BaseAPI {
|
|
|
403
412
|
*/
|
|
404
413
|
createLeadSync(requestParameters: LeadsApiCreateLeadSyncRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateLeadResponseClass, any>>;
|
|
405
414
|
/**
|
|
406
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
415
|
+
* 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
416
|
* @summary Retrieve the lead
|
|
408
417
|
* @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
|
|
409
418
|
* @param {*} [options] Override http request option.
|
|
@@ -419,7 +428,7 @@ export declare class LeadsApi extends BaseAPI {
|
|
|
419
428
|
* @throws {RequiredError}
|
|
420
429
|
* @memberof LeadsApi
|
|
421
430
|
*/
|
|
422
|
-
initiateLead(requestParameters
|
|
431
|
+
initiateLead(requestParameters: LeadsApiInitiateLeadRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InitiateLeadResponseClass, any>>;
|
|
423
432
|
/**
|
|
424
433
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
425
434
|
* @summary Update the lead
|
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
|
|
@@ -294,18 +294,22 @@ var LeadsApiAxiosParamCreator = function (configuration) {
|
|
|
294
294
|
/**
|
|
295
295
|
* This will initiate a lead code.
|
|
296
296
|
* @summary Initiate a lead code
|
|
297
|
+
* @param {string} productSlug
|
|
297
298
|
* @param {string} [authorization] Bearer Token
|
|
298
299
|
* @param {*} [options] Override http request option.
|
|
299
300
|
* @throws {RequiredError}
|
|
300
301
|
*/
|
|
301
|
-
initiateLead: function (authorization, options) {
|
|
302
|
+
initiateLead: function (productSlug, authorization, options) {
|
|
302
303
|
if (options === void 0) { options = {}; }
|
|
303
304
|
return __awaiter(_this, void 0, void 0, function () {
|
|
304
305
|
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
305
306
|
return __generator(this, function (_a) {
|
|
306
307
|
switch (_a.label) {
|
|
307
308
|
case 0:
|
|
308
|
-
|
|
309
|
+
// verify required parameter 'productSlug' is not null or undefined
|
|
310
|
+
(0, common_1.assertParamExists)('initiateLead', 'productSlug', productSlug);
|
|
311
|
+
localVarPath = "/publicapi/v1/leads/initiate/{productSlug}"
|
|
312
|
+
.replace("{".concat("productSlug", "}"), encodeURIComponent(String(productSlug)));
|
|
309
313
|
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
310
314
|
if (configuration) {
|
|
311
315
|
baseOptions = configuration.baseOptions;
|
|
@@ -515,7 +519,7 @@ var LeadsApiFp = function (configuration) {
|
|
|
515
519
|
});
|
|
516
520
|
},
|
|
517
521
|
/**
|
|
518
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
522
|
+
* 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
523
|
* @summary Retrieve the lead
|
|
520
524
|
* @param {string} code Unique identifier for the object.
|
|
521
525
|
* @param {string} [authorization] Bearer Token
|
|
@@ -538,16 +542,17 @@ var LeadsApiFp = function (configuration) {
|
|
|
538
542
|
/**
|
|
539
543
|
* This will initiate a lead code.
|
|
540
544
|
* @summary Initiate a lead code
|
|
545
|
+
* @param {string} productSlug
|
|
541
546
|
* @param {string} [authorization] Bearer Token
|
|
542
547
|
* @param {*} [options] Override http request option.
|
|
543
548
|
* @throws {RequiredError}
|
|
544
549
|
*/
|
|
545
|
-
initiateLead: function (authorization, options) {
|
|
550
|
+
initiateLead: function (productSlug, authorization, options) {
|
|
546
551
|
return __awaiter(this, void 0, void 0, function () {
|
|
547
552
|
var localVarAxiosArgs;
|
|
548
553
|
return __generator(this, function (_a) {
|
|
549
554
|
switch (_a.label) {
|
|
550
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.initiateLead(authorization, options)];
|
|
555
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.initiateLead(productSlug, authorization, options)];
|
|
551
556
|
case 1:
|
|
552
557
|
localVarAxiosArgs = _a.sent();
|
|
553
558
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -643,7 +648,7 @@ var LeadsApiFactory = function (configuration, basePath, axios) {
|
|
|
643
648
|
return localVarFp.createLeadSync(createLeadRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
644
649
|
},
|
|
645
650
|
/**
|
|
646
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
651
|
+
* 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
652
|
* @summary Retrieve the lead
|
|
648
653
|
* @param {string} code Unique identifier for the object.
|
|
649
654
|
* @param {string} [authorization] Bearer Token
|
|
@@ -656,12 +661,13 @@ var LeadsApiFactory = function (configuration, basePath, axios) {
|
|
|
656
661
|
/**
|
|
657
662
|
* This will initiate a lead code.
|
|
658
663
|
* @summary Initiate a lead code
|
|
664
|
+
* @param {string} productSlug
|
|
659
665
|
* @param {string} [authorization] Bearer Token
|
|
660
666
|
* @param {*} [options] Override http request option.
|
|
661
667
|
* @throws {RequiredError}
|
|
662
668
|
*/
|
|
663
|
-
initiateLead: function (authorization, options) {
|
|
664
|
-
return localVarFp.initiateLead(authorization, options).then(function (request) { return request(axios, basePath); });
|
|
669
|
+
initiateLead: function (productSlug, authorization, options) {
|
|
670
|
+
return localVarFp.initiateLead(productSlug, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
665
671
|
},
|
|
666
672
|
/**
|
|
667
673
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
@@ -738,7 +744,7 @@ var LeadsApi = /** @class */ (function (_super) {
|
|
|
738
744
|
return (0, exports.LeadsApiFp)(this.configuration).createLeadSync(requestParameters.createLeadRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
739
745
|
};
|
|
740
746
|
/**
|
|
741
|
-
* Retrieves the details of the lead that was previously created. Supply the unique lead code
|
|
747
|
+
* 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
748
|
* @summary Retrieve the lead
|
|
743
749
|
* @param {LeadsApiGetLeadRequest} requestParameters Request parameters.
|
|
744
750
|
* @param {*} [options] Override http request option.
|
|
@@ -759,8 +765,7 @@ var LeadsApi = /** @class */ (function (_super) {
|
|
|
759
765
|
*/
|
|
760
766
|
LeadsApi.prototype.initiateLead = function (requestParameters, options) {
|
|
761
767
|
var _this = this;
|
|
762
|
-
|
|
763
|
-
return (0, exports.LeadsApiFp)(this.configuration).initiateLead(requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
768
|
+
return (0, exports.LeadsApiFp)(this.configuration).initiateLead(requestParameters.productSlug, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
764
769
|
};
|
|
765
770
|
/**
|
|
766
771
|
* Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|