@emilgroup/public-api-sdk 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.
Files changed (44) hide show
  1. package/.openapi-generator/FILES +5 -0
  2. package/README.md +2 -2
  3. package/api/leads-api.ts +21 -8
  4. package/api/payments-setup-api.ts +21 -8
  5. package/base.ts +21 -8
  6. package/dist/api/leads-api.d.ts +13 -4
  7. package/dist/api/leads-api.js +13 -8
  8. package/dist/api/payments-setup-api.d.ts +13 -4
  9. package/dist/api/payments-setup-api.js +13 -8
  10. package/dist/base.d.ts +1 -2
  11. package/dist/base.js +18 -7
  12. package/dist/models/card-details-dto.d.ts +42 -0
  13. package/dist/models/card-details-dto.js +15 -0
  14. package/dist/models/complete-adyen-payment-setup-request-dto.d.ts +80 -0
  15. package/dist/models/complete-adyen-payment-setup-request-dto.js +15 -0
  16. package/dist/models/complete-payment-setup-request-dto.d.ts +13 -0
  17. package/dist/models/index.d.ts +5 -0
  18. package/dist/models/index.js +5 -0
  19. package/dist/models/initiate-adyen-payment-setup-request-dto.d.ts +30 -0
  20. package/dist/models/initiate-adyen-payment-setup-request-dto.js +15 -0
  21. package/dist/models/initiate-adyen-payment-setup-response-class.d.ts +42 -0
  22. package/dist/models/initiate-adyen-payment-setup-response-class.js +15 -0
  23. package/dist/models/initiate-payment-setup-request-dto.d.ts +13 -0
  24. package/dist/models/initiate-payment-setup-response-class.d.ts +7 -0
  25. package/dist/models/link-lead-partner-request-dto.d.ts +2 -2
  26. package/dist/models/partner-class.d.ts +1 -1
  27. package/dist/models/payment-method-class.d.ts +24 -0
  28. package/dist/models/sepa-direct-dto.d.ts +24 -0
  29. package/dist/models/sepa-direct-dto.js +15 -0
  30. package/dist/models/update-lead-request-dto.d.ts +7 -0
  31. package/models/card-details-dto.ts +48 -0
  32. package/models/complete-adyen-payment-setup-request-dto.ts +86 -0
  33. package/models/complete-payment-setup-request-dto.ts +13 -0
  34. package/models/index.ts +5 -0
  35. package/models/initiate-adyen-payment-setup-request-dto.ts +36 -0
  36. package/models/initiate-adyen-payment-setup-response-class.ts +48 -0
  37. package/models/initiate-payment-setup-request-dto.ts +13 -0
  38. package/models/initiate-payment-setup-response-class.ts +7 -0
  39. package/models/link-lead-partner-request-dto.ts +2 -2
  40. package/models/partner-class.ts +1 -1
  41. package/models/payment-method-class.ts +24 -0
  42. package/models/sepa-direct-dto.ts +30 -0
  43. package/models/update-lead-request-dto.ts +7 -0
  44. package/package.json +1 -1
@@ -23,6 +23,8 @@ models/address-field-score-class.ts
23
23
  models/booking-funnel-class.ts
24
24
  models/calculate-product-fields-request-dto.ts
25
25
  models/calculate-product-fields-response-class.ts
26
+ models/card-details-dto.ts
27
+ models/complete-adyen-payment-setup-request-dto.ts
26
28
  models/complete-braintree-payment-setup-request-dto.ts
27
29
  models/complete-email-verification-dto.ts
28
30
  models/complete-email-verification-response-class.ts
@@ -50,6 +52,8 @@ models/get-lead-response-class.ts
50
52
  models/get-product-document-download-url-response-class.ts
51
53
  models/get-public-psp-settings-response-class.ts
52
54
  models/index.ts
55
+ models/initiate-adyen-payment-setup-request-dto.ts
56
+ models/initiate-adyen-payment-setup-response-class.ts
53
57
  models/initiate-braintree-payment-setup-request-dto.ts
54
58
  models/initiate-braintree-payment-setup-response-class.ts
55
59
  models/initiate-email-verification-dto.ts
@@ -91,6 +95,7 @@ models/product-field-class.ts
91
95
  models/product-version-class.ts
92
96
  models/send-notification-request-dto.ts
93
97
  models/send-notification-response-class.ts
98
+ models/sepa-direct-dto.ts
94
99
  models/sepa-dto.ts
95
100
  models/structured-address-class.ts
96
101
  models/suggested-address-details-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@1.28.0 --save
20
+ npm install @emilgroup/public-api-sdk@1.30.0 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/public-api-sdk@1.28.0
24
+ yarn add @emilgroup/public-api-sdk@1.30.0
25
25
  ```
26
26
 
27
27
  And then you can import `PublicApi`.
package/api/leads-api.ts CHANGED
@@ -229,12 +229,16 @@ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration
229
229
  /**
230
230
  * This will initiate a lead code.
231
231
  * @summary Initiate a lead code
232
+ * @param {string} productSlug
232
233
  * @param {string} [authorization] Bearer Token
233
234
  * @param {*} [options] Override http request option.
234
235
  * @throws {RequiredError}
235
236
  */
236
- initiateLead: async (authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
237
- const localVarPath = `/publicapi/v1/leads/initiate`;
237
+ initiateLead: async (productSlug: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
238
+ // verify required parameter 'productSlug' is not null or undefined
239
+ assertParamExists('initiateLead', 'productSlug', productSlug)
240
+ const localVarPath = `/publicapi/v1/leads/initiate/{productSlug}`
241
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
238
242
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
239
243
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
240
244
  let baseOptions;
@@ -430,12 +434,13 @@ export const LeadsApiFp = function(configuration?: Configuration) {
430
434
  /**
431
435
  * This will initiate a lead code.
432
436
  * @summary Initiate a lead code
437
+ * @param {string} productSlug
433
438
  * @param {string} [authorization] Bearer Token
434
439
  * @param {*} [options] Override http request option.
435
440
  * @throws {RequiredError}
436
441
  */
437
- async initiateLead(authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateLeadResponseClass>> {
438
- const localVarAxiosArgs = await localVarAxiosParamCreator.initiateLead(authorization, options);
442
+ async initiateLead(productSlug: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InitiateLeadResponseClass>> {
443
+ const localVarAxiosArgs = await localVarAxiosParamCreator.initiateLead(productSlug, authorization, options);
439
444
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
440
445
  },
441
446
  /**
@@ -521,12 +526,13 @@ export const LeadsApiFactory = function (configuration?: Configuration, basePath
521
526
  /**
522
527
  * This will initiate a lead code.
523
528
  * @summary Initiate a lead code
529
+ * @param {string} productSlug
524
530
  * @param {string} [authorization] Bearer Token
525
531
  * @param {*} [options] Override http request option.
526
532
  * @throws {RequiredError}
527
533
  */
528
- initiateLead(authorization?: string, options?: any): AxiosPromise<InitiateLeadResponseClass> {
529
- return localVarFp.initiateLead(authorization, options).then((request) => request(axios, basePath));
534
+ initiateLead(productSlug: string, authorization?: string, options?: any): AxiosPromise<InitiateLeadResponseClass> {
535
+ return localVarFp.initiateLead(productSlug, authorization, options).then((request) => request(axios, basePath));
530
536
  },
531
537
  /**
532
538
  * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
@@ -645,6 +651,13 @@ export interface LeadsApiGetLeadRequest {
645
651
  * @interface LeadsApiInitiateLeadRequest
646
652
  */
647
653
  export interface LeadsApiInitiateLeadRequest {
654
+ /**
655
+ *
656
+ * @type {string}
657
+ * @memberof LeadsApiInitiateLead
658
+ */
659
+ readonly productSlug: string
660
+
648
661
  /**
649
662
  * Bearer Token
650
663
  * @type {string}
@@ -772,8 +785,8 @@ export class LeadsApi extends BaseAPI {
772
785
  * @throws {RequiredError}
773
786
  * @memberof LeadsApi
774
787
  */
775
- public initiateLead(requestParameters: LeadsApiInitiateLeadRequest = {}, options?: AxiosRequestConfig) {
776
- return LeadsApiFp(this.configuration).initiateLead(requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
788
+ public initiateLead(requestParameters: LeadsApiInitiateLeadRequest, options?: AxiosRequestConfig) {
789
+ return LeadsApiFp(this.configuration).initiateLead(requestParameters.productSlug, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
777
790
  }
778
791
 
779
792
  /**
@@ -91,13 +91,17 @@ export const PaymentsSetupApiAxiosParamCreator = function (configuration?: Confi
91
91
  /**
92
92
  * This will send the customer the public key to load the payment form and complete the payment setup.
93
93
  * @summary Get public key and psp
94
+ * @param {string} productSlug
94
95
  * @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.
95
96
  * @param {string} [authorization] Bearer Token
96
97
  * @param {*} [options] Override http request option.
97
98
  * @throws {RequiredError}
98
99
  */
99
- getPublicPSPConfig: async (idempotencyKey?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
100
- const localVarPath = `/publicapi/v1/payment-setup/get-psp-config`;
100
+ getPublicPSPConfig: async (productSlug: string, idempotencyKey?: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
101
+ // verify required parameter 'productSlug' is not null or undefined
102
+ assertParamExists('getPublicPSPConfig', 'productSlug', productSlug)
103
+ const localVarPath = `/publicapi/v1/payment-setup/get-psp-config/{productSlug}`
104
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
101
105
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
102
106
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
103
107
  let baseOptions;
@@ -212,13 +216,14 @@ export const PaymentsSetupApiFp = function(configuration?: Configuration) {
212
216
  /**
213
217
  * This will send the customer the public key to load the payment form and complete the payment setup.
214
218
  * @summary Get public key and psp
219
+ * @param {string} productSlug
215
220
  * @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.
216
221
  * @param {string} [authorization] Bearer Token
217
222
  * @param {*} [options] Override http request option.
218
223
  * @throws {RequiredError}
219
224
  */
220
- async getPublicPSPConfig(idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPublicPspSettingsResponseClass>> {
221
- const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicPSPConfig(idempotencyKey, authorization, options);
225
+ async getPublicPSPConfig(productSlug: string, idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPublicPspSettingsResponseClass>> {
226
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options);
222
227
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
223
228
  },
224
229
  /**
@@ -259,13 +264,14 @@ export const PaymentsSetupApiFactory = function (configuration?: Configuration,
259
264
  /**
260
265
  * This will send the customer the public key to load the payment form and complete the payment setup.
261
266
  * @summary Get public key and psp
267
+ * @param {string} productSlug
262
268
  * @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.
263
269
  * @param {string} [authorization] Bearer Token
264
270
  * @param {*} [options] Override http request option.
265
271
  * @throws {RequiredError}
266
272
  */
267
- getPublicPSPConfig(idempotencyKey?: string, authorization?: string, options?: any): AxiosPromise<GetPublicPspSettingsResponseClass> {
268
- return localVarFp.getPublicPSPConfig(idempotencyKey, authorization, options).then((request) => request(axios, basePath));
273
+ getPublicPSPConfig(productSlug: string, idempotencyKey?: string, authorization?: string, options?: any): AxiosPromise<GetPublicPspSettingsResponseClass> {
274
+ return localVarFp.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options).then((request) => request(axios, basePath));
269
275
  },
270
276
  /**
271
277
  * 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.
@@ -316,6 +322,13 @@ export interface PaymentsSetupApiCompletePaymentSetupRequest {
316
322
  * @interface PaymentsSetupApiGetPublicPSPConfigRequest
317
323
  */
318
324
  export interface PaymentsSetupApiGetPublicPSPConfigRequest {
325
+ /**
326
+ *
327
+ * @type {string}
328
+ * @memberof PaymentsSetupApiGetPublicPSPConfig
329
+ */
330
+ readonly productSlug: string
331
+
319
332
  /**
320
333
  * 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.
321
334
  * @type {string}
@@ -386,8 +399,8 @@ export class PaymentsSetupApi extends BaseAPI {
386
399
  * @throws {RequiredError}
387
400
  * @memberof PaymentsSetupApi
388
401
  */
389
- public getPublicPSPConfig(requestParameters: PaymentsSetupApiGetPublicPSPConfigRequest = {}, options?: AxiosRequestConfig) {
390
- return PaymentsSetupApiFp(this.configuration).getPublicPSPConfig(requestParameters.idempotencyKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
402
+ public getPublicPSPConfig(requestParameters: PaymentsSetupApiGetPublicPSPConfigRequest, options?: AxiosRequestConfig) {
403
+ return PaymentsSetupApiFp(this.configuration).getPublicPSPConfig(requestParameters.productSlug, requestParameters.idempotencyKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
391
404
  }
392
405
 
393
406
  /**
package/base.ts CHANGED
@@ -34,7 +34,7 @@ export const COLLECTION_FORMATS = {
34
34
 
35
35
  export interface LoginClass {
36
36
  accessToken: string;
37
- permissions: Array<string>;
37
+ permissions: string;
38
38
  }
39
39
 
40
40
  export enum Environment {
@@ -64,6 +64,7 @@ export interface RequestArgs {
64
64
  interface TokenData {
65
65
  accessToken?: string;
66
66
  username?: string;
67
+ permissions?: string;
67
68
  }
68
69
 
69
70
  const NETWORK_ERROR_MESSAGE = "Network Error";
@@ -77,7 +78,6 @@ const TOKEN_DATA = 'APP_TOKEN';
77
78
  export class BaseAPI {
78
79
  protected configuration: Configuration | undefined;
79
80
  private tokenData?: TokenData;
80
- private permissions: Array<string> = [];
81
81
 
82
82
  constructor(configuration?: Configuration,
83
83
  protected basePath: string = BASE_PATH,
@@ -111,7 +111,11 @@ export class BaseAPI {
111
111
  }
112
112
 
113
113
  getPermissions(): Array<string> {
114
- return this.permissions;
114
+ if (!this.tokenData?.permissions) {
115
+ return [];
116
+ }
117
+
118
+ return this.tokenData.permissions.split(',');
115
119
  }
116
120
 
117
121
  async authorize(username: string, password: string): Promise<void> {
@@ -134,7 +138,7 @@ export class BaseAPI {
134
138
  this.configuration.accessToken = `Bearer ${accessToken}`;
135
139
  this.tokenData.username = username;
136
140
  this.tokenData.accessToken = accessToken;
137
- this.permissions = permissions;
141
+ this.tokenData.permissions = permissions;
138
142
 
139
143
  this.storeTokenData({
140
144
  ...this.tokenData
@@ -148,6 +152,16 @@ export class BaseAPI {
148
152
  throw new Error('Failed to refresh token.');
149
153
  }
150
154
 
155
+ const refreshTokenAxios = globalAxios.create()
156
+ refreshTokenAxios.interceptors.response.use(response => {
157
+ const { permissions } = response.data;
158
+
159
+ this.tokenData.permissions = permissions;
160
+ this.storeTokenData(this.tokenData);
161
+
162
+ return response;
163
+ })
164
+
151
165
  const options: AxiosRequestConfig = {
152
166
  method: 'POST',
153
167
  url: `${this.configuration.basePath}/authservice/v1/refresh-token`,
@@ -158,8 +172,7 @@ export class BaseAPI {
158
172
  withCredentials: true,
159
173
  };
160
174
 
161
- const response = await globalAxios.request<LoginClass>(options);
162
-
175
+ const response = await refreshTokenAxios.request<LoginClass>(options);
163
176
  return response.data;
164
177
  }
165
178
 
@@ -196,7 +209,7 @@ export class BaseAPI {
196
209
  try {
197
210
  const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
198
211
  const accessToken = `Bearer ${tokenString}`;
199
- this.permissions = permissions;
212
+ this.tokenData.permissions = permissions;
200
213
 
201
214
  delete originalConfig.headers['Authorization']
202
215
 
@@ -223,7 +236,7 @@ export class BaseAPI {
223
236
  try {
224
237
  const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
225
238
  const accessToken = `Bearer ${tokenString}`;
226
- this.permissions = permissions;
239
+ this.tokenData.permissions = permissions;
227
240
 
228
241
  _retry = true;
229
242
  originalConfig.headers['Authorization'] = accessToken;
@@ -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
@@ -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
@@ -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}
@@ -419,7 +428,7 @@ export declare class LeadsApi extends BaseAPI {
419
428
  * @throws {RequiredError}
420
429
  * @memberof LeadsApi
421
430
  */
422
- initiateLead(requestParameters?: LeadsApiInitiateLeadRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InitiateLeadResponseClass, any>>;
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
@@ -290,18 +290,22 @@ var LeadsApiAxiosParamCreator = function (configuration) {
290
290
  /**
291
291
  * This will initiate a lead code.
292
292
  * @summary Initiate a lead code
293
+ * @param {string} productSlug
293
294
  * @param {string} [authorization] Bearer Token
294
295
  * @param {*} [options] Override http request option.
295
296
  * @throws {RequiredError}
296
297
  */
297
- initiateLead: function (authorization, options) {
298
+ initiateLead: function (productSlug, authorization, options) {
298
299
  if (options === void 0) { options = {}; }
299
300
  return __awaiter(_this, void 0, void 0, function () {
300
301
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
301
302
  return __generator(this, function (_a) {
302
303
  switch (_a.label) {
303
304
  case 0:
304
- localVarPath = "/publicapi/v1/leads/initiate";
305
+ // verify required parameter 'productSlug' is not null or undefined
306
+ (0, common_1.assertParamExists)('initiateLead', 'productSlug', productSlug);
307
+ localVarPath = "/publicapi/v1/leads/initiate/{productSlug}"
308
+ .replace("{".concat("productSlug", "}"), encodeURIComponent(String(productSlug)));
305
309
  localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
306
310
  if (configuration) {
307
311
  baseOptions = configuration.baseOptions;
@@ -534,16 +538,17 @@ var LeadsApiFp = function (configuration) {
534
538
  /**
535
539
  * This will initiate a lead code.
536
540
  * @summary Initiate a lead code
541
+ * @param {string} productSlug
537
542
  * @param {string} [authorization] Bearer Token
538
543
  * @param {*} [options] Override http request option.
539
544
  * @throws {RequiredError}
540
545
  */
541
- initiateLead: function (authorization, options) {
546
+ initiateLead: function (productSlug, authorization, options) {
542
547
  return __awaiter(this, void 0, void 0, function () {
543
548
  var localVarAxiosArgs;
544
549
  return __generator(this, function (_a) {
545
550
  switch (_a.label) {
546
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.initiateLead(authorization, options)];
551
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.initiateLead(productSlug, authorization, options)];
547
552
  case 1:
548
553
  localVarAxiosArgs = _a.sent();
549
554
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -652,12 +657,13 @@ var LeadsApiFactory = function (configuration, basePath, axios) {
652
657
  /**
653
658
  * This will initiate a lead code.
654
659
  * @summary Initiate a lead code
660
+ * @param {string} productSlug
655
661
  * @param {string} [authorization] Bearer Token
656
662
  * @param {*} [options] Override http request option.
657
663
  * @throws {RequiredError}
658
664
  */
659
- initiateLead: function (authorization, options) {
660
- return localVarFp.initiateLead(authorization, options).then(function (request) { return request(axios, basePath); });
665
+ initiateLead: function (productSlug, authorization, options) {
666
+ return localVarFp.initiateLead(productSlug, authorization, options).then(function (request) { return request(axios, basePath); });
661
667
  },
662
668
  /**
663
669
  * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
@@ -755,8 +761,7 @@ var LeadsApi = /** @class */ (function (_super) {
755
761
  */
756
762
  LeadsApi.prototype.initiateLead = function (requestParameters, options) {
757
763
  var _this = this;
758
- if (requestParameters === void 0) { requestParameters = {}; }
759
- return (0, exports.LeadsApiFp)(this.configuration).initiateLead(requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
764
+ return (0, exports.LeadsApiFp)(this.configuration).initiateLead(requestParameters.productSlug, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
760
765
  };
761
766
  /**
762
767
  * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
@@ -35,12 +35,13 @@ export declare const PaymentsSetupApiAxiosParamCreator: (configuration?: Configu
35
35
  /**
36
36
  * This will send the customer the public key to load the payment form and complete the payment setup.
37
37
  * @summary Get public key and psp
38
+ * @param {string} productSlug
38
39
  * @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.
39
40
  * @param {string} [authorization] Bearer Token
40
41
  * @param {*} [options] Override http request option.
41
42
  * @throws {RequiredError}
42
43
  */
43
- getPublicPSPConfig: (idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
44
+ getPublicPSPConfig: (productSlug: string, idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
44
45
  /**
45
46
  * 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.
46
47
  * @summary Initiate a payment setup
@@ -70,12 +71,13 @@ export declare const PaymentsSetupApiFp: (configuration?: Configuration) => {
70
71
  /**
71
72
  * This will send the customer the public key to load the payment form and complete the payment setup.
72
73
  * @summary Get public key and psp
74
+ * @param {string} productSlug
73
75
  * @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.
74
76
  * @param {string} [authorization] Bearer Token
75
77
  * @param {*} [options] Override http request option.
76
78
  * @throws {RequiredError}
77
79
  */
78
- getPublicPSPConfig(idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPublicPspSettingsResponseClass>>;
80
+ getPublicPSPConfig(productSlug: string, idempotencyKey?: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPublicPspSettingsResponseClass>>;
79
81
  /**
80
82
  * 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.
81
83
  * @summary Initiate a payment setup
@@ -105,12 +107,13 @@ export declare const PaymentsSetupApiFactory: (configuration?: Configuration, ba
105
107
  /**
106
108
  * This will send the customer the public key to load the payment form and complete the payment setup.
107
109
  * @summary Get public key and psp
110
+ * @param {string} productSlug
108
111
  * @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.
109
112
  * @param {string} [authorization] Bearer Token
110
113
  * @param {*} [options] Override http request option.
111
114
  * @throws {RequiredError}
112
115
  */
113
- getPublicPSPConfig(idempotencyKey?: string, authorization?: string, options?: any): AxiosPromise<GetPublicPspSettingsResponseClass>;
116
+ getPublicPSPConfig(productSlug: string, idempotencyKey?: string, authorization?: string, options?: any): AxiosPromise<GetPublicPspSettingsResponseClass>;
114
117
  /**
115
118
  * 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.
116
119
  * @summary Initiate a payment setup
@@ -153,6 +156,12 @@ export interface PaymentsSetupApiCompletePaymentSetupRequest {
153
156
  * @interface PaymentsSetupApiGetPublicPSPConfigRequest
154
157
  */
155
158
  export interface PaymentsSetupApiGetPublicPSPConfigRequest {
159
+ /**
160
+ *
161
+ * @type {string}
162
+ * @memberof PaymentsSetupApiGetPublicPSPConfig
163
+ */
164
+ readonly productSlug: string;
156
165
  /**
157
166
  * 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.
158
167
  * @type {string}
@@ -215,7 +224,7 @@ export declare class PaymentsSetupApi extends BaseAPI {
215
224
  * @throws {RequiredError}
216
225
  * @memberof PaymentsSetupApi
217
226
  */
218
- getPublicPSPConfig(requestParameters?: PaymentsSetupApiGetPublicPSPConfigRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetPublicPspSettingsResponseClass, any>>;
227
+ getPublicPSPConfig(requestParameters: PaymentsSetupApiGetPublicPSPConfigRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetPublicPspSettingsResponseClass, any>>;
219
228
  /**
220
229
  * 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.
221
230
  * @summary Initiate a payment setup
@@ -148,19 +148,23 @@ var PaymentsSetupApiAxiosParamCreator = function (configuration) {
148
148
  /**
149
149
  * This will send the customer the public key to load the payment form and complete the payment setup.
150
150
  * @summary Get public key and psp
151
+ * @param {string} productSlug
151
152
  * @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.
152
153
  * @param {string} [authorization] Bearer Token
153
154
  * @param {*} [options] Override http request option.
154
155
  * @throws {RequiredError}
155
156
  */
156
- getPublicPSPConfig: function (idempotencyKey, authorization, options) {
157
+ getPublicPSPConfig: function (productSlug, idempotencyKey, authorization, options) {
157
158
  if (options === void 0) { options = {}; }
158
159
  return __awaiter(_this, void 0, void 0, function () {
159
160
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
160
161
  return __generator(this, function (_a) {
161
162
  switch (_a.label) {
162
163
  case 0:
163
- localVarPath = "/publicapi/v1/payment-setup/get-psp-config";
164
+ // verify required parameter 'productSlug' is not null or undefined
165
+ (0, common_1.assertParamExists)('getPublicPSPConfig', 'productSlug', productSlug);
166
+ localVarPath = "/publicapi/v1/payment-setup/get-psp-config/{productSlug}"
167
+ .replace("{".concat("productSlug", "}"), encodeURIComponent(String(productSlug)));
164
168
  localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
165
169
  if (configuration) {
166
170
  baseOptions = configuration.baseOptions;
@@ -281,17 +285,18 @@ var PaymentsSetupApiFp = function (configuration) {
281
285
  /**
282
286
  * This will send the customer the public key to load the payment form and complete the payment setup.
283
287
  * @summary Get public key and psp
288
+ * @param {string} productSlug
284
289
  * @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.
285
290
  * @param {string} [authorization] Bearer Token
286
291
  * @param {*} [options] Override http request option.
287
292
  * @throws {RequiredError}
288
293
  */
289
- getPublicPSPConfig: function (idempotencyKey, authorization, options) {
294
+ getPublicPSPConfig: function (productSlug, idempotencyKey, authorization, options) {
290
295
  return __awaiter(this, void 0, void 0, function () {
291
296
  var localVarAxiosArgs;
292
297
  return __generator(this, function (_a) {
293
298
  switch (_a.label) {
294
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getPublicPSPConfig(idempotencyKey, authorization, options)];
299
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options)];
295
300
  case 1:
296
301
  localVarAxiosArgs = _a.sent();
297
302
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -346,13 +351,14 @@ var PaymentsSetupApiFactory = function (configuration, basePath, axios) {
346
351
  /**
347
352
  * This will send the customer the public key to load the payment form and complete the payment setup.
348
353
  * @summary Get public key and psp
354
+ * @param {string} productSlug
349
355
  * @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.
350
356
  * @param {string} [authorization] Bearer Token
351
357
  * @param {*} [options] Override http request option.
352
358
  * @throws {RequiredError}
353
359
  */
354
- getPublicPSPConfig: function (idempotencyKey, authorization, options) {
355
- return localVarFp.getPublicPSPConfig(idempotencyKey, authorization, options).then(function (request) { return request(axios, basePath); });
360
+ getPublicPSPConfig: function (productSlug, idempotencyKey, authorization, options) {
361
+ return localVarFp.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options).then(function (request) { return request(axios, basePath); });
356
362
  },
357
363
  /**
358
364
  * 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.
@@ -402,8 +408,7 @@ var PaymentsSetupApi = /** @class */ (function (_super) {
402
408
  */
403
409
  PaymentsSetupApi.prototype.getPublicPSPConfig = function (requestParameters, options) {
404
410
  var _this = this;
405
- if (requestParameters === void 0) { requestParameters = {}; }
406
- return (0, exports.PaymentsSetupApiFp)(this.configuration).getPublicPSPConfig(requestParameters.idempotencyKey, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
411
+ return (0, exports.PaymentsSetupApiFp)(this.configuration).getPublicPSPConfig(requestParameters.productSlug, requestParameters.idempotencyKey, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
407
412
  };
408
413
  /**
409
414
  * 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.
package/dist/base.d.ts CHANGED
@@ -24,7 +24,7 @@ export declare const COLLECTION_FORMATS: {
24
24
  };
25
25
  export interface LoginClass {
26
26
  accessToken: string;
27
- permissions: Array<string>;
27
+ permissions: string;
28
28
  }
29
29
  export declare enum Environment {
30
30
  Production = "https://apiv2.emil.de",
@@ -52,7 +52,6 @@ export declare class BaseAPI {
52
52
  protected axios: AxiosInstance;
53
53
  protected configuration: Configuration | undefined;
54
54
  private tokenData?;
55
- private permissions;
56
55
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
57
56
  selectEnvironment(env: Environment): void;
58
57
  selectBasePath(path: string): void;