@emilgroup/public-api-sdk-node 1.30.0 → 1.32.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 +8 -16
  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 +2 -4
  11. package/dist/base.js +20 -27
  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-node@1.30.0 --save
20
+ npm install @emilgroup/public-api-sdk-node@1.32.0 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/public-api-sdk-node@1.30.0
24
+ yarn add @emilgroup/public-api-sdk-node@1.32.0
25
25
  ```
26
26
 
27
27
  And then you can import `PublicApi`.
package/api/leads-api.ts CHANGED
@@ -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
- const localVarPath = `/publicapi/v1/leads/initiate`;
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;
@@ -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
  /**
@@ -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}
@@ -776,8 +789,8 @@ export class LeadsApi extends BaseAPI {
776
789
  * @throws {RequiredError}
777
790
  * @memberof LeadsApi
778
791
  */
779
- public initiateLead(requestParameters: LeadsApiInitiateLeadRequest = {}, options?: AxiosRequestConfig) {
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
- const localVarPath = `/publicapi/v1/payment-setup/get-psp-config`;
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 = {}, options?: AxiosRequestConfig) {
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: Array<string>;
44
+ permissions: string;
45
45
  }
46
46
 
47
47
  export enum Environment {
@@ -79,7 +79,6 @@ export class BaseAPI {
79
79
  protected configuration: Configuration;
80
80
  private username?: string;
81
81
  private password?: string;
82
- private permissions: Array<string> = [];
83
82
 
84
83
  constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
85
84
  if (configuration) {
@@ -150,10 +149,6 @@ export class BaseAPI {
150
149
  this.configuration.basePath = env;
151
150
  }
152
151
 
153
- getPermissions(): Array<string> {
154
- return this.permissions;
155
- }
156
-
157
152
  async authorize(username: string, password: string): Promise<void> {
158
153
  const options: AxiosRequestConfig = {
159
154
  method: 'POST',
@@ -168,21 +163,20 @@ export class BaseAPI {
168
163
 
169
164
  const response = await globalAxios.request<LoginClass>(options);
170
165
 
171
- const { data: { accessToken, permissions } } = response;
166
+ const { data: { accessToken } } = response;
172
167
  this.configuration.username = username;
173
168
  this.configuration.accessToken = `Bearer ${accessToken}`;
174
- this.permissions = permissions;
175
169
 
176
170
  const refreshToken = this.extractRefreshToken(response)
177
171
  this.configuration.refreshToken = refreshToken;
178
172
  }
179
173
 
180
- async refreshTokenInternal(): Promise<LoginClass> {
174
+ async refreshTokenInternal(): Promise<string> {
181
175
  const { username, refreshToken } = this.configuration;
182
176
 
183
177
 
184
178
  if (!username || !refreshToken) {
185
- throw new Error('Failed to refresh token.');
179
+ return '';
186
180
  }
187
181
 
188
182
  const options: AxiosRequestConfig = {
@@ -196,9 +190,9 @@ export class BaseAPI {
196
190
  withCredentials: true,
197
191
  };
198
192
 
199
- const response = await globalAxios.request<LoginClass>(options);
193
+ const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
200
194
 
201
- return response.data;
195
+ return accessToken;
202
196
  }
203
197
 
204
198
  private extractRefreshToken(response: AxiosResponse): string {
@@ -227,9 +221,8 @@ export class BaseAPI {
227
221
  if (err.response.status === 401 && !originalConfig._retry) {
228
222
  originalConfig._retry = true;
229
223
  try {
230
- const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
224
+ const tokenString = await this.refreshTokenInternal();
231
225
  const accessToken = `Bearer ${tokenString}`;
232
- this.permissions = permissions;
233
226
 
234
227
  originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
235
228
 
@@ -253,9 +246,8 @@ export class BaseAPI {
253
246
  ){
254
247
  _retry_count++;
255
248
  try {
256
- const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
249
+ const tokenString = await this.refreshTokenInternal();
257
250
  const accessToken = `Bearer ${tokenString}`;
258
- this.permissions = permissions;
259
251
 
260
252
  _retry = true;
261
253
  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
@@ -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
- localVarPath = "/publicapi/v1/leads/initiate";
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;
@@ -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)];
@@ -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.
@@ -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
- if (requestParameters === void 0) { requestParameters = {}; }
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.
@@ -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
@@ -152,19 +152,23 @@ var PaymentsSetupApiAxiosParamCreator = function (configuration) {
152
152
  /**
153
153
  * This will send the customer the public key to load the payment form and complete the payment setup.
154
154
  * @summary Get public key and psp
155
+ * @param {string} productSlug
155
156
  * @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.
156
157
  * @param {string} [authorization] Bearer Token
157
158
  * @param {*} [options] Override http request option.
158
159
  * @throws {RequiredError}
159
160
  */
160
- getPublicPSPConfig: function (idempotencyKey, authorization, options) {
161
+ getPublicPSPConfig: function (productSlug, idempotencyKey, authorization, options) {
161
162
  if (options === void 0) { options = {}; }
162
163
  return __awaiter(_this, void 0, void 0, function () {
163
164
  var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
164
165
  return __generator(this, function (_a) {
165
166
  switch (_a.label) {
166
167
  case 0:
167
- localVarPath = "/publicapi/v1/payment-setup/get-psp-config";
168
+ // verify required parameter 'productSlug' is not null or undefined
169
+ (0, common_1.assertParamExists)('getPublicPSPConfig', 'productSlug', productSlug);
170
+ localVarPath = "/publicapi/v1/payment-setup/get-psp-config/{productSlug}"
171
+ .replace("{".concat("productSlug", "}"), encodeURIComponent(String(productSlug)));
168
172
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
169
173
  if (configuration) {
170
174
  baseOptions = configuration.baseOptions;
@@ -285,17 +289,18 @@ var PaymentsSetupApiFp = function (configuration) {
285
289
  /**
286
290
  * This will send the customer the public key to load the payment form and complete the payment setup.
287
291
  * @summary Get public key and psp
292
+ * @param {string} productSlug
288
293
  * @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.
289
294
  * @param {string} [authorization] Bearer Token
290
295
  * @param {*} [options] Override http request option.
291
296
  * @throws {RequiredError}
292
297
  */
293
- getPublicPSPConfig: function (idempotencyKey, authorization, options) {
298
+ getPublicPSPConfig: function (productSlug, idempotencyKey, authorization, options) {
294
299
  return __awaiter(this, void 0, void 0, function () {
295
300
  var localVarAxiosArgs;
296
301
  return __generator(this, function (_a) {
297
302
  switch (_a.label) {
298
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getPublicPSPConfig(idempotencyKey, authorization, options)];
303
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options)];
299
304
  case 1:
300
305
  localVarAxiosArgs = _a.sent();
301
306
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -350,13 +355,14 @@ var PaymentsSetupApiFactory = function (configuration, basePath, axios) {
350
355
  /**
351
356
  * This will send the customer the public key to load the payment form and complete the payment setup.
352
357
  * @summary Get public key and psp
358
+ * @param {string} productSlug
353
359
  * @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.
354
360
  * @param {string} [authorization] Bearer Token
355
361
  * @param {*} [options] Override http request option.
356
362
  * @throws {RequiredError}
357
363
  */
358
- getPublicPSPConfig: function (idempotencyKey, authorization, options) {
359
- return localVarFp.getPublicPSPConfig(idempotencyKey, authorization, options).then(function (request) { return request(axios, basePath); });
364
+ getPublicPSPConfig: function (productSlug, idempotencyKey, authorization, options) {
365
+ return localVarFp.getPublicPSPConfig(productSlug, idempotencyKey, authorization, options).then(function (request) { return request(axios, basePath); });
360
366
  },
361
367
  /**
362
368
  * 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.
@@ -406,8 +412,7 @@ var PaymentsSetupApi = /** @class */ (function (_super) {
406
412
  */
407
413
  PaymentsSetupApi.prototype.getPublicPSPConfig = function (requestParameters, options) {
408
414
  var _this = this;
409
- if (requestParameters === void 0) { requestParameters = {}; }
410
- return (0, exports.PaymentsSetupApiFp)(this.configuration).getPublicPSPConfig(requestParameters.idempotencyKey, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
415
+ return (0, exports.PaymentsSetupApiFp)(this.configuration).getPublicPSPConfig(requestParameters.productSlug, requestParameters.idempotencyKey, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
411
416
  };
412
417
  /**
413
418
  * 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",
@@ -53,16 +53,14 @@ export declare class BaseAPI {
53
53
  protected configuration: Configuration;
54
54
  private username?;
55
55
  private password?;
56
- private permissions;
57
56
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
58
57
  initialize(env?: Environment): Promise<void>;
59
58
  private loadCredentials;
60
59
  private readConfigFile;
61
60
  private readEnvVariables;
62
61
  selectEnvironment(env: Environment): void;
63
- getPermissions(): Array<string>;
64
62
  authorize(username: string, password: string): Promise<void>;
65
- refreshTokenInternal(): Promise<LoginClass>;
63
+ refreshTokenInternal(): Promise<string>;
66
64
  private extractRefreshToken;
67
65
  getConfiguration(): Configuration;
68
66
  private attachInterceptor;