@emilgroup/payment-sdk-node 1.21.1-beta.0 → 1.21.1-beta.1

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/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/payment-sdk-node@1.21.1-beta.0 --save
20
+ npm install @emilgroup/payment-sdk-node@1.21.1-beta.1 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/payment-sdk-node@1.21.1-beta.0
24
+ yarn add @emilgroup/payment-sdk-node@1.21.1-beta.1
25
25
  ```
26
26
 
27
27
  And then you can import `PaymentsApi`.
@@ -248,7 +248,7 @@ export const BankAccountsApiAxiosParamCreator = function (configuration?: Config
248
248
  };
249
249
  },
250
250
  /**
251
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
251
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
252
252
  * @summary Set primary bank account
253
253
  * @param {string} code Code of the bank account to set primary
254
254
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -412,7 +412,7 @@ export const BankAccountsApiFp = function(configuration?: Configuration) {
412
412
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
413
413
  },
414
414
  /**
415
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
415
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
416
416
  * @summary Set primary bank account
417
417
  * @param {string} code Code of the bank account to set primary
418
418
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -496,7 +496,7 @@ export const BankAccountsApiFactory = function (configuration?: Configuration, b
496
496
  return localVarFp.listBankAccounts(authorization, filter, filters, order, expand, options).then((request) => request(axios, basePath));
497
497
  },
498
498
  /**
499
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
499
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
500
500
  * @summary Set primary bank account
501
501
  * @param {string} code Code of the bank account to set primary
502
502
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -746,7 +746,7 @@ export class BankAccountsApi extends BaseAPI {
746
746
  }
747
747
 
748
748
  /**
749
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
749
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
750
750
  * @summary Set primary bank account
751
751
  * @param {BankAccountsApiSetPrimaryBankAccountRequest} requestParameters Request parameters.
752
752
  * @param {*} [options] Override http request option.
@@ -95,7 +95,7 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
95
95
  };
96
96
  },
97
97
  /**
98
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
98
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
99
99
  * @summary Create the bank transactions
100
100
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.<br/> Allowed Content Types: text/plain, application/octet-stream
101
101
  * @param {string} [authorization] Bearer Token
@@ -265,7 +265,7 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
265
265
  };
266
266
  },
267
267
  /**
268
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
268
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
269
269
  * @summary Unlink bank transaction
270
270
  * @param {string} code Code of the bank transaction to unlink
271
271
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -339,7 +339,7 @@ export const BankTransactionApiFp = function(configuration?: Configuration) {
339
339
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
340
340
  },
341
341
  /**
342
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
342
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
343
343
  * @summary Create the bank transactions
344
344
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.<br/> Allowed Content Types: text/plain, application/octet-stream
345
345
  * @param {string} [authorization] Bearer Token
@@ -380,7 +380,7 @@ export const BankTransactionApiFp = function(configuration?: Configuration) {
380
380
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
381
381
  },
382
382
  /**
383
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
383
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
384
384
  * @summary Unlink bank transaction
385
385
  * @param {string} code Code of the bank transaction to unlink
386
386
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -415,7 +415,7 @@ export const BankTransactionApiFactory = function (configuration?: Configuration
415
415
  return localVarFp.getBankTransaction(code, authorization, expand, options).then((request) => request(axios, basePath));
416
416
  },
417
417
  /**
418
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
418
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
419
419
  * @summary Create the bank transactions
420
420
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.<br/> Allowed Content Types: text/plain, application/octet-stream
421
421
  * @param {string} [authorization] Bearer Token
@@ -453,7 +453,7 @@ export const BankTransactionApiFactory = function (configuration?: Configuration
453
453
  return localVarFp.listBankTransactions(authorization, filter, filters, search, order, expand, options).then((request) => request(axios, basePath));
454
454
  },
455
455
  /**
456
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
456
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
457
457
  * @summary Unlink bank transaction
458
458
  * @param {string} code Code of the bank transaction to unlink
459
459
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -641,7 +641,7 @@ export class BankTransactionApi extends BaseAPI {
641
641
  }
642
642
 
643
643
  /**
644
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
644
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
645
645
  * @summary Create the bank transactions
646
646
  * @param {BankTransactionApiImportBankTransactionsRequest} requestParameters Request parameters.
647
647
  * @param {*} [options] Override http request option.
@@ -677,7 +677,7 @@ export class BankTransactionApi extends BaseAPI {
677
677
  }
678
678
 
679
679
  /**
680
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
680
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
681
681
  * @summary Unlink bank transaction
682
682
  * @param {BankTransactionApiUnlinkBankTransactionRequest} requestParameters Request parameters.
683
683
  * @param {*} [options] Override http request option.
package/base.ts CHANGED
@@ -225,7 +225,7 @@ export class BaseAPI {
225
225
  const tokenString = await this.refreshTokenInternal();
226
226
  const accessToken = `Bearer ${tokenString}`;
227
227
 
228
- originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
228
+ originalConfig.headers['Authorization'] = accessToken;
229
229
 
230
230
  this.configuration.accessToken = accessToken;
231
231
 
package/common.ts CHANGED
@@ -66,7 +66,7 @@ export const setBearerAuthToObject = async function (object: any, configuration?
66
66
  const accessToken = typeof configuration.accessToken === 'function'
67
67
  ? await configuration.accessToken()
68
68
  : await configuration.accessToken;
69
- object["Authorization"] = "Bearer " + accessToken;
69
+ object["Authorization"] = configuration.getBearerToken(accessToken);
70
70
  }
71
71
  }
72
72
 
@@ -79,7 +79,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
79
79
  const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
80
80
  ? await configuration.accessToken(name, scopes)
81
81
  : await configuration.accessToken;
82
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
82
+ object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
83
83
  }
84
84
  }
85
85
 
package/configuration.ts CHANGED
@@ -106,4 +106,13 @@ export class Configuration {
106
106
  const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
107
107
  return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
108
108
  }
109
+
110
+ /**
111
+ * Returns "Bearer" token.
112
+ * @param token - access token.
113
+ * @return Bearer token.
114
+ */
115
+ public getBearerToken(token?: string): string {
116
+ return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
117
+ }
109
118
  }
@@ -65,7 +65,7 @@ export declare const BankAccountsApiAxiosParamCreator: (configuration?: Configur
65
65
  */
66
66
  listBankAccounts: (authorization?: string, filter?: string, filters?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
67
67
  /**
68
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
68
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
69
69
  * @summary Set primary bank account
70
70
  * @param {string} code Code of the bank account to set primary
71
71
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -131,7 +131,7 @@ export declare const BankAccountsApiFp: (configuration?: Configuration) => {
131
131
  */
132
132
  listBankAccounts(authorization?: string, filter?: string, filters?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListBankAccountsResponseClass>>;
133
133
  /**
134
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
134
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
135
135
  * @summary Set primary bank account
136
136
  * @param {string} code Code of the bank account to set primary
137
137
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -197,7 +197,7 @@ export declare const BankAccountsApiFactory: (configuration?: Configuration, bas
197
197
  */
198
198
  listBankAccounts(authorization?: string, filter?: string, filters?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListBankAccountsResponseClass>;
199
199
  /**
200
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
200
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
201
201
  * @summary Set primary bank account
202
202
  * @param {string} code Code of the bank account to set primary
203
203
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -411,7 +411,7 @@ export declare class BankAccountsApi extends BaseAPI {
411
411
  */
412
412
  listBankAccounts(requestParameters?: BankAccountsApiListBankAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListBankAccountsResponseClass, any>>;
413
413
  /**
414
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
414
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
415
415
  * @summary Set primary bank account
416
416
  * @param {BankAccountsApiSetPrimaryBankAccountRequest} requestParameters Request parameters.
417
417
  * @param {*} [options] Override http request option.
@@ -306,7 +306,7 @@ var BankAccountsApiAxiosParamCreator = function (configuration) {
306
306
  });
307
307
  },
308
308
  /**
309
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
309
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
310
310
  * @summary Set primary bank account
311
311
  * @param {string} code Code of the bank account to set primary
312
312
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -510,7 +510,7 @@ var BankAccountsApiFp = function (configuration) {
510
510
  });
511
511
  },
512
512
  /**
513
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
513
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
514
514
  * @summary Set primary bank account
515
515
  * @param {string} code Code of the bank account to set primary
516
516
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -612,7 +612,7 @@ var BankAccountsApiFactory = function (configuration, basePath, axios) {
612
612
  return localVarFp.listBankAccounts(authorization, filter, filters, order, expand, options).then(function (request) { return request(axios, basePath); });
613
613
  },
614
614
  /**
615
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
615
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
616
616
  * @summary Set primary bank account
617
617
  * @param {string} code Code of the bank account to set primary
618
618
  * @param {SetPrimaryBankAccountRequestDtoRest} setPrimaryBankAccountRequestDtoRest
@@ -699,7 +699,7 @@ var BankAccountsApi = /** @class */ (function (_super) {
699
699
  return (0, exports.BankAccountsApiFp)(this.configuration).listBankAccounts(requestParameters.authorization, requestParameters.filter, requestParameters.filters, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
700
700
  };
701
701
  /**
702
- * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.create\"
702
+ * Set the primary bank account for the specified partner/account **Required Permissions** \"payment-management.bank-accounts.update\"
703
703
  * @summary Set primary bank account
704
704
  * @param {BankAccountsApiSetPrimaryBankAccountRequest} requestParameters Request parameters.
705
705
  * @param {*} [options] Override http request option.
@@ -35,7 +35,7 @@ export declare const BankTransactionApiAxiosParamCreator: (configuration?: Confi
35
35
  */
36
36
  getBankTransaction: (code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
37
37
  /**
38
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
38
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
39
39
  * @summary Create the bank transactions
40
40
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.&lt;br/&gt; Allowed Content Types: text/plain, application/octet-stream
41
41
  * @param {string} [authorization] Bearer Token
@@ -67,7 +67,7 @@ export declare const BankTransactionApiAxiosParamCreator: (configuration?: Confi
67
67
  */
68
68
  listBankTransactions: (authorization?: string, filter?: string, filters?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
69
69
  /**
70
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
70
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
71
71
  * @summary Unlink bank transaction
72
72
  * @param {string} code Code of the bank transaction to unlink
73
73
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -93,7 +93,7 @@ export declare const BankTransactionApiFp: (configuration?: Configuration) => {
93
93
  */
94
94
  getBankTransaction(code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetBankTransactionsResponseClass>>;
95
95
  /**
96
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
96
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
97
97
  * @summary Create the bank transactions
98
98
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.&lt;br/&gt; Allowed Content Types: text/plain, application/octet-stream
99
99
  * @param {string} [authorization] Bearer Token
@@ -125,7 +125,7 @@ export declare const BankTransactionApiFp: (configuration?: Configuration) => {
125
125
  */
126
126
  listBankTransactions(authorization?: string, filter?: string, filters?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListBankTransactionsResponseClass>>;
127
127
  /**
128
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
128
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
129
129
  * @summary Unlink bank transaction
130
130
  * @param {string} code Code of the bank transaction to unlink
131
131
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -151,7 +151,7 @@ export declare const BankTransactionApiFactory: (configuration?: Configuration,
151
151
  */
152
152
  getBankTransaction(code: string, authorization?: string, expand?: string, options?: any): AxiosPromise<GetBankTransactionsResponseClass>;
153
153
  /**
154
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
154
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
155
155
  * @summary Create the bank transactions
156
156
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.&lt;br/&gt; Allowed Content Types: text/plain, application/octet-stream
157
157
  * @param {string} [authorization] Bearer Token
@@ -183,7 +183,7 @@ export declare const BankTransactionApiFactory: (configuration?: Configuration,
183
183
  */
184
184
  listBankTransactions(authorization?: string, filter?: string, filters?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListBankTransactionsResponseClass>;
185
185
  /**
186
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
186
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
187
187
  * @summary Unlink bank transaction
188
188
  * @param {string} code Code of the bank transaction to unlink
189
189
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -347,7 +347,7 @@ export declare class BankTransactionApi extends BaseAPI {
347
347
  */
348
348
  getBankTransaction(requestParameters: BankTransactionApiGetBankTransactionRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetBankTransactionsResponseClass, any>>;
349
349
  /**
350
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
350
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
351
351
  * @summary Create the bank transactions
352
352
  * @param {BankTransactionApiImportBankTransactionsRequest} requestParameters Request parameters.
353
353
  * @param {*} [options] Override http request option.
@@ -374,7 +374,7 @@ export declare class BankTransactionApi extends BaseAPI {
374
374
  */
375
375
  listBankTransactions(requestParameters?: BankTransactionApiListBankTransactionsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListBankTransactionsResponseClass, any>>;
376
376
  /**
377
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
377
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
378
378
  * @summary Unlink bank transaction
379
379
  * @param {BankTransactionApiUnlinkBankTransactionRequest} requestParameters Request parameters.
380
380
  * @param {*} [options] Override http request option.
@@ -149,7 +149,7 @@ var BankTransactionApiAxiosParamCreator = function (configuration) {
149
149
  });
150
150
  },
151
151
  /**
152
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
152
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
153
153
  * @summary Create the bank transactions
154
154
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.&lt;br/&gt; Allowed Content Types: text/plain, application/octet-stream
155
155
  * @param {string} [authorization] Bearer Token
@@ -319,7 +319,7 @@ var BankTransactionApiAxiosParamCreator = function (configuration) {
319
319
  });
320
320
  },
321
321
  /**
322
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
322
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
323
323
  * @summary Unlink bank transaction
324
324
  * @param {string} code Code of the bank transaction to unlink
325
325
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -404,7 +404,7 @@ var BankTransactionApiFp = function (configuration) {
404
404
  });
405
405
  },
406
406
  /**
407
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
407
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
408
408
  * @summary Create the bank transactions
409
409
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.&lt;br/&gt; Allowed Content Types: text/plain, application/octet-stream
410
410
  * @param {string} [authorization] Bearer Token
@@ -472,7 +472,7 @@ var BankTransactionApiFp = function (configuration) {
472
472
  });
473
473
  },
474
474
  /**
475
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
475
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
476
476
  * @summary Unlink bank transaction
477
477
  * @param {string} code Code of the bank transaction to unlink
478
478
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -516,7 +516,7 @@ var BankTransactionApiFactory = function (configuration, basePath, axios) {
516
516
  return localVarFp.getBankTransaction(code, authorization, expand, options).then(function (request) { return request(axios, basePath); });
517
517
  },
518
518
  /**
519
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
519
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
520
520
  * @summary Create the bank transactions
521
521
  * @param {any} file Swift MT940 file to import bank transactions from. Extension must be .txt or .sta.&lt;br/&gt; Allowed Content Types: text/plain, application/octet-stream
522
522
  * @param {string} [authorization] Bearer Token
@@ -554,7 +554,7 @@ var BankTransactionApiFactory = function (configuration, basePath, axios) {
554
554
  return localVarFp.listBankTransactions(authorization, filter, filters, search, order, expand, options).then(function (request) { return request(axios, basePath); });
555
555
  },
556
556
  /**
557
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
557
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
558
558
  * @summary Unlink bank transaction
559
559
  * @param {string} code Code of the bank transaction to unlink
560
560
  * @param {UnlinkBankTransactionRequestDtoRest} unlinkBankTransactionRequestDtoRest
@@ -592,7 +592,7 @@ var BankTransactionApi = /** @class */ (function (_super) {
592
592
  return (0, exports.BankTransactionApiFp)(this.configuration).getBankTransaction(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
593
593
  };
594
594
  /**
595
- * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.create\"
595
+ * This will import bank transactions from a swift MT940 file **Required Permissions** \"payment-management.bank-accounts.view\"
596
596
  * @summary Create the bank transactions
597
597
  * @param {BankTransactionApiImportBankTransactionsRequest} requestParameters Request parameters.
598
598
  * @param {*} [options] Override http request option.
@@ -629,7 +629,7 @@ var BankTransactionApi = /** @class */ (function (_super) {
629
629
  return (0, exports.BankTransactionApiFp)(this.configuration).listBankTransactions(requestParameters.authorization, requestParameters.filter, requestParameters.filters, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
630
630
  };
631
631
  /**
632
- * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.delete\", \"payment-management.bank-accounts.update\"
632
+ * Unlinks an already linked bank transaction **Required Permissions** \"payment-management.bank-accounts.update\"
633
633
  * @summary Unlink bank transaction
634
634
  * @param {BankTransactionApiUnlinkBankTransactionRequest} requestParameters Request parameters.
635
635
  * @param {*} [options] Override http request option.
package/dist/base.js CHANGED
@@ -330,7 +330,7 @@ var BaseAPI = /** @class */ (function () {
330
330
  case 2:
331
331
  tokenString = _a.sent();
332
332
  accessToken = "Bearer ".concat(tokenString);
333
- originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
333
+ originalConfig.headers['Authorization'] = accessToken;
334
334
  this.configuration.accessToken = accessToken;
335
335
  return [2 /*return*/, axios.request(originalConfig)];
336
336
  case 3:
package/dist/common.js CHANGED
@@ -141,7 +141,7 @@ var setBearerAuthToObject = function (object, configuration) {
141
141
  _b.label = 4;
142
142
  case 4:
143
143
  accessToken = _a;
144
- object["Authorization"] = "Bearer " + accessToken;
144
+ object["Authorization"] = configuration.getBearerToken(accessToken);
145
145
  _b.label = 5;
146
146
  case 5: return [2 /*return*/];
147
147
  }
@@ -171,7 +171,7 @@ var setOAuthToObject = function (object, name, scopes, configuration) {
171
171
  _b.label = 4;
172
172
  case 4:
173
173
  localVarAccessTokenValue = _a;
174
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
174
+ object["Authorization"] = configuration.getBearerToken(localVarAccessTokenValue);
175
175
  _b.label = 5;
176
176
  case 5: return [2 /*return*/];
177
177
  }
@@ -87,4 +87,10 @@ export declare class Configuration {
87
87
  * @return True if the given MIME is JSON, false otherwise.
88
88
  */
89
89
  isJsonMime(mime: string): boolean;
90
+ /**
91
+ * Returns "Bearer" token.
92
+ * @param token - access token.
93
+ * @return Bearer token.
94
+ */
95
+ getBearerToken(token?: string): string;
90
96
  }
@@ -39,6 +39,14 @@ var Configuration = /** @class */ (function () {
39
39
  var jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
40
40
  return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
41
41
  };
42
+ /**
43
+ * Returns "Bearer" token.
44
+ * @param token - access token.
45
+ * @return Bearer token.
46
+ */
47
+ Configuration.prototype.getBearerToken = function (token) {
48
+ return ('' + token).startsWith("Bearer") ? token : "Bearer " + token;
49
+ };
42
50
  return Configuration;
43
51
  }());
44
52
  exports.Configuration = Configuration;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emilgroup/payment-sdk-node",
3
- "version": "1.21.1-beta.0",
3
+ "version": "1.21.1-beta.1",
4
4
  "description": "OpenAPI client for @emilgroup/payment-sdk-node",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [