@finverse/sdk-typescript 0.0.43 → 0.0.46

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
@@ -159,7 +159,8 @@ console.log("statements: " + statementsResp.statements)
159
159
  const statementId = statements.data.statements[0].id;
160
160
 
161
161
  // Can download statement from here
162
- const satementLink = await new LoginIdentityApi(configuration).getStatementLink(statementId);
162
+ const statementResp = await new LoginIdentityApi(configuration).getStatement(statementId, true, {responseType: "arraybuffer"});
163
+ writeFileSync("statement.pdf", Buffer.from(statementResp.data));
163
164
  ```
164
165
 
165
166
  ## Getting started (Payment flow)
package/dist/api.d.ts CHANGED
@@ -97,6 +97,12 @@ export interface Account {
97
97
  * @memberof Account
98
98
  */
99
99
  account_sub_type?: string;
100
+ /**
101
+ *
102
+ * @type {string}
103
+ * @memberof Account
104
+ */
105
+ account_number_masked?: string;
100
106
  /**
101
107
  *
102
108
  * @type {string}
@@ -3034,10 +3040,11 @@ export declare const CustomerApiAxiosParamCreator: (configuration?: Configuratio
3034
3040
  /**
3035
3041
  * CREATE Mandate
3036
3042
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
3043
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
3037
3044
  * @param {*} [options] Override http request option.
3038
3045
  * @throws {RequiredError}
3039
3046
  */
3040
- createMandate: (createMandateRequest: CreateMandateRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3047
+ createMandate: (createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3041
3048
  /**
3042
3049
  * Create new Payment
3043
3050
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3128,10 +3135,11 @@ export declare const CustomerApiFp: (configuration?: Configuration) => {
3128
3135
  /**
3129
3136
  * CREATE Mandate
3130
3137
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
3138
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
3131
3139
  * @param {*} [options] Override http request option.
3132
3140
  * @throws {RequiredError}
3133
3141
  */
3134
- createMandate(createMandateRequest: CreateMandateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateMandateResponse>>;
3142
+ createMandate(createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateMandateResponse>>;
3135
3143
  /**
3136
3144
  * Create new Payment
3137
3145
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3222,10 +3230,11 @@ export declare const CustomerApiFactory: (configuration?: Configuration, basePat
3222
3230
  /**
3223
3231
  * CREATE Mandate
3224
3232
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
3233
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
3225
3234
  * @param {*} [options] Override http request option.
3226
3235
  * @throws {RequiredError}
3227
3236
  */
3228
- createMandate(createMandateRequest: CreateMandateRequest, options?: any): AxiosPromise<CreateMandateResponse>;
3237
+ createMandate(createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: any): AxiosPromise<CreateMandateResponse>;
3229
3238
  /**
3230
3239
  * Create new Payment
3231
3240
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3317,11 +3326,12 @@ export interface CustomerApiInterface {
3317
3326
  /**
3318
3327
  * CREATE Mandate
3319
3328
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
3329
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
3320
3330
  * @param {*} [options] Override http request option.
3321
3331
  * @throws {RequiredError}
3322
3332
  * @memberof CustomerApiInterface
3323
3333
  */
3324
- createMandate(createMandateRequest: CreateMandateRequest, options?: AxiosRequestConfig): AxiosPromise<CreateMandateResponse>;
3334
+ createMandate(createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: AxiosRequestConfig): AxiosPromise<CreateMandateResponse>;
3325
3335
  /**
3326
3336
  * Create new Payment
3327
3337
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3425,11 +3435,12 @@ export declare class CustomerApi extends BaseAPI implements CustomerApiInterface
3425
3435
  /**
3426
3436
  * CREATE Mandate
3427
3437
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
3438
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
3428
3439
  * @param {*} [options] Override http request option.
3429
3440
  * @throws {RequiredError}
3430
3441
  * @memberof CustomerApi
3431
3442
  */
3432
- createMandate(createMandateRequest: CreateMandateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateMandateResponse>>;
3443
+ createMandate(createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateMandateResponse>>;
3433
3444
  /**
3434
3445
  * Create new Payment
3435
3446
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3838,13 +3849,6 @@ export declare const LoginIdentityApiAxiosParamCreator: (configuration?: Configu
3838
3849
  * @throws {RequiredError}
3839
3850
  */
3840
3851
  getStatement: (statementId: string, redirect?: boolean, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3841
- /**
3842
- * (Deprecated) Get statement link for download
3843
- * @param {string} statementId The statement id
3844
- * @param {*} [options] Override http request option.
3845
- * @throws {RequiredError}
3846
- */
3847
- getStatementLink: (statementId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3848
3852
  /**
3849
3853
  * Get list of available statements
3850
3854
  * @param {*} [options] Override http request option.
@@ -3953,13 +3957,6 @@ export declare const LoginIdentityApiFp: (configuration?: Configuration) => {
3953
3957
  * @throws {RequiredError}
3954
3958
  */
3955
3959
  getStatement(statementId: string, redirect?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetStatementLinkResponse>>;
3956
- /**
3957
- * (Deprecated) Get statement link for download
3958
- * @param {string} statementId The statement id
3959
- * @param {*} [options] Override http request option.
3960
- * @throws {RequiredError}
3961
- */
3962
- getStatementLink(statementId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetStatementLinkResponse>>;
3963
3960
  /**
3964
3961
  * Get list of available statements
3965
3962
  * @param {*} [options] Override http request option.
@@ -4068,13 +4065,6 @@ export declare const LoginIdentityApiFactory: (configuration?: Configuration, ba
4068
4065
  * @throws {RequiredError}
4069
4066
  */
4070
4067
  getStatement(statementId: string, redirect?: boolean, options?: any): AxiosPromise<GetStatementLinkResponse>;
4071
- /**
4072
- * (Deprecated) Get statement link for download
4073
- * @param {string} statementId The statement id
4074
- * @param {*} [options] Override http request option.
4075
- * @throws {RequiredError}
4076
- */
4077
- getStatementLink(statementId: string, options?: any): AxiosPromise<GetStatementLinkResponse>;
4078
4068
  /**
4079
4069
  * Get list of available statements
4080
4070
  * @param {*} [options] Override http request option.
@@ -4194,14 +4184,6 @@ export interface LoginIdentityApiInterface {
4194
4184
  * @memberof LoginIdentityApiInterface
4195
4185
  */
4196
4186
  getStatement(statementId: string, redirect?: boolean, options?: AxiosRequestConfig): AxiosPromise<GetStatementLinkResponse>;
4197
- /**
4198
- * (Deprecated) Get statement link for download
4199
- * @param {string} statementId The statement id
4200
- * @param {*} [options] Override http request option.
4201
- * @throws {RequiredError}
4202
- * @memberof LoginIdentityApiInterface
4203
- */
4204
- getStatementLink(statementId: string, options?: AxiosRequestConfig): AxiosPromise<GetStatementLinkResponse>;
4205
4187
  /**
4206
4188
  * Get list of available statements
4207
4189
  * @param {*} [options] Override http request option.
@@ -4327,14 +4309,6 @@ export declare class LoginIdentityApi extends BaseAPI implements LoginIdentityAp
4327
4309
  * @memberof LoginIdentityApi
4328
4310
  */
4329
4311
  getStatement(statementId: string, redirect?: boolean, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetStatementLinkResponse>>;
4330
- /**
4331
- * (Deprecated) Get statement link for download
4332
- * @param {string} statementId The statement id
4333
- * @param {*} [options] Override http request option.
4334
- * @throws {RequiredError}
4335
- * @memberof LoginIdentityApi
4336
- */
4337
- getStatementLink(statementId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetStatementLinkResponse>>;
4338
4312
  /**
4339
4313
  * Get list of available statements
4340
4314
  * @param {*} [options] Override http request option.
package/dist/api.js CHANGED
@@ -92,10 +92,11 @@ exports.CustomerApiAxiosParamCreator = function (configuration) {
92
92
  /**
93
93
  * CREATE Mandate
94
94
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
95
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
95
96
  * @param {*} [options] Override http request option.
96
97
  * @throws {RequiredError}
97
98
  */
98
- createMandate: (createMandateRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
99
+ createMandate: (createMandateRequest, idempotencyKey, options = {}) => __awaiter(this, void 0, void 0, function* () {
99
100
  // verify required parameter 'createMandateRequest' is not null or undefined
100
101
  common_1.assertParamExists('createMandate', 'createMandateRequest', createMandateRequest);
101
102
  const localVarPath = `/mandates`;
@@ -111,6 +112,9 @@ exports.CustomerApiAxiosParamCreator = function (configuration) {
111
112
  // authentication Oauth2 required
112
113
  // oauth required
113
114
  yield common_1.setOAuthToObject(localVarHeaderParameter, 'Oauth2', [], configuration);
115
+ if (idempotencyKey !== undefined && idempotencyKey !== null) {
116
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
117
+ }
114
118
  localVarHeaderParameter['Content-Type'] = 'application/json';
115
119
  common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
116
120
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -488,12 +492,13 @@ exports.CustomerApiFp = function (configuration) {
488
492
  /**
489
493
  * CREATE Mandate
490
494
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
495
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
491
496
  * @param {*} [options] Override http request option.
492
497
  * @throws {RequiredError}
493
498
  */
494
- createMandate(createMandateRequest, options) {
499
+ createMandate(createMandateRequest, idempotencyKey, options) {
495
500
  return __awaiter(this, void 0, void 0, function* () {
496
- const localVarAxiosArgs = yield localVarAxiosParamCreator.createMandate(createMandateRequest, options);
501
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createMandate(createMandateRequest, idempotencyKey, options);
497
502
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
498
503
  });
499
504
  },
@@ -645,11 +650,14 @@ exports.CustomerApiFactory = function (configuration, basePath, axios) {
645
650
  /**
646
651
  * CREATE Mandate
647
652
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
653
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
648
654
  * @param {*} [options] Override http request option.
649
655
  * @throws {RequiredError}
650
656
  */
651
- createMandate(createMandateRequest, options) {
652
- return localVarFp.createMandate(createMandateRequest, options).then((request) => request(axios, basePath));
657
+ createMandate(createMandateRequest, idempotencyKey, options) {
658
+ return localVarFp
659
+ .createMandate(createMandateRequest, idempotencyKey, options)
660
+ .then((request) => request(axios, basePath));
653
661
  },
654
662
  /**
655
663
  * Create new Payment
@@ -774,13 +782,14 @@ class CustomerApi extends base_1.BaseAPI {
774
782
  /**
775
783
  * CREATE Mandate
776
784
  * @param {CreateMandateRequest} createMandateRequest request body for creating mandate
785
+ * @param {string} [idempotencyKey] A random key provided by the customer, per unique payment. If missing we will generate a random one. The purpose for the Idempotency key is to allow safe retrying without the operation being performed multiple times.
777
786
  * @param {*} [options] Override http request option.
778
787
  * @throws {RequiredError}
779
788
  * @memberof CustomerApi
780
789
  */
781
- createMandate(createMandateRequest, options) {
790
+ createMandate(createMandateRequest, idempotencyKey, options) {
782
791
  return exports.CustomerApiFp(this.configuration)
783
- .createMandate(createMandateRequest, options)
792
+ .createMandate(createMandateRequest, idempotencyKey, options)
784
793
  .then((request) => request(this.axios, this.basePath));
785
794
  }
786
795
  /**
@@ -1629,36 +1638,6 @@ exports.LoginIdentityApiAxiosParamCreator = function (configuration) {
1629
1638
  options: localVarRequestOptions,
1630
1639
  };
1631
1640
  }),
1632
- /**
1633
- * (Deprecated) Get statement link for download
1634
- * @param {string} statementId The statement id
1635
- * @param {*} [options] Override http request option.
1636
- * @throws {RequiredError}
1637
- */
1638
- getStatementLink: (statementId, options = {}) => __awaiter(this, void 0, void 0, function* () {
1639
- // verify required parameter 'statementId' is not null or undefined
1640
- common_1.assertParamExists('getStatementLink', 'statementId', statementId);
1641
- const localVarPath = `/statement_links/{statementId}`.replace(`{${'statementId'}}`, encodeURIComponent(String(statementId)));
1642
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1643
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1644
- let baseOptions;
1645
- if (configuration) {
1646
- baseOptions = configuration.baseOptions;
1647
- }
1648
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1649
- const localVarHeaderParameter = {};
1650
- const localVarQueryParameter = {};
1651
- // authentication Oauth2 required
1652
- // oauth required
1653
- yield common_1.setOAuthToObject(localVarHeaderParameter, 'Oauth2', [], configuration);
1654
- common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
1655
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1656
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1657
- return {
1658
- url: common_1.toPathString(localVarUrlObj),
1659
- options: localVarRequestOptions,
1660
- };
1661
- }),
1662
1641
  /**
1663
1642
  * Get list of available statements
1664
1643
  * @param {*} [options] Override http request option.
@@ -1939,18 +1918,6 @@ exports.LoginIdentityApiFp = function (configuration) {
1939
1918
  return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1940
1919
  });
1941
1920
  },
1942
- /**
1943
- * (Deprecated) Get statement link for download
1944
- * @param {string} statementId The statement id
1945
- * @param {*} [options] Override http request option.
1946
- * @throws {RequiredError}
1947
- */
1948
- getStatementLink(statementId, options) {
1949
- return __awaiter(this, void 0, void 0, function* () {
1950
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getStatementLink(statementId, options);
1951
- return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1952
- });
1953
- },
1954
1921
  /**
1955
1922
  * Get list of available statements
1956
1923
  * @param {*} [options] Override http request option.
@@ -2107,15 +2074,6 @@ exports.LoginIdentityApiFactory = function (configuration, basePath, axios) {
2107
2074
  getStatement(statementId, redirect, options) {
2108
2075
  return localVarFp.getStatement(statementId, redirect, options).then((request) => request(axios, basePath));
2109
2076
  },
2110
- /**
2111
- * (Deprecated) Get statement link for download
2112
- * @param {string} statementId The statement id
2113
- * @param {*} [options] Override http request option.
2114
- * @throws {RequiredError}
2115
- */
2116
- getStatementLink(statementId, options) {
2117
- return localVarFp.getStatementLink(statementId, options).then((request) => request(axios, basePath));
2118
- },
2119
2077
  /**
2120
2078
  * Get list of available statements
2121
2079
  * @param {*} [options] Override http request option.
@@ -2291,18 +2249,6 @@ class LoginIdentityApi extends base_1.BaseAPI {
2291
2249
  .getStatement(statementId, redirect, options)
2292
2250
  .then((request) => request(this.axios, this.basePath));
2293
2251
  }
2294
- /**
2295
- * (Deprecated) Get statement link for download
2296
- * @param {string} statementId The statement id
2297
- * @param {*} [options] Override http request option.
2298
- * @throws {RequiredError}
2299
- * @memberof LoginIdentityApi
2300
- */
2301
- getStatementLink(statementId, options) {
2302
- return exports.LoginIdentityApiFp(this.configuration)
2303
- .getStatementLink(statementId, options)
2304
- .then((request) => request(this.axios, this.basePath));
2305
- }
2306
2252
  /**
2307
2253
  * Get list of available statements
2308
2254
  * @param {*} [options] Override http request option.
@@ -1,2 +1,3 @@
1
1
  import { GetStatementsResponse } from '../../api';
2
2
  export declare function getStatements(): GetStatementsResponse;
3
+ export declare function getStatementAsBuffer(): ArrayBuffer;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStatements = void 0;
3
+ exports.getStatementAsBuffer = exports.getStatements = void 0;
4
4
  const account_1 = require("./account");
5
5
  function getStatements() {
6
6
  const accountData = account_1.getAccounts();
@@ -18,3 +18,7 @@ function getStatements() {
18
18
  };
19
19
  }
20
20
  exports.getStatements = getStatements;
21
+ function getStatementAsBuffer() {
22
+ return new TextEncoder().encode("this is statement");
23
+ }
24
+ exports.getStatementAsBuffer = getStatementAsBuffer;
@@ -16,7 +16,6 @@ const __1 = require("..");
16
16
  const api_1 = require("../api");
17
17
  const loginIdentityToken_1 = require("./responses/loginIdentityToken");
18
18
  const statement_1 = require("./responses/statement");
19
- const statementLink_1 = require("./responses/statementLink");
20
19
  const chai_1 = require("chai");
21
20
  describe('Statements', function () {
22
21
  let mock;
@@ -33,9 +32,9 @@ describe('Statements', function () {
33
32
  // Get link to statement
34
33
  // Assuming there is only one statement
35
34
  const statementId = gotStatements.data.statements[0].id;
36
- mock.onGet(`${config_1.config.apiHost}/statement_links/${statementId}`).reply(200, statementLink_1.getStatementLinkByStatementId());
37
- const gotStatementLink = yield new api_1.LoginIdentityApi(configuration).getStatementLink(statementId);
38
- chai_1.expect(gotStatementLink.data.statement_links).to.be.ok;
35
+ mock.onGet(`${config_1.config.apiHost}/statements/${statementId}`).reply(200, statement_1.getStatementAsBuffer());
36
+ const gotStatementLink = yield new api_1.LoginIdentityApi(configuration).getStatement(statementId);
37
+ chai_1.expect(gotStatementLink.data).to.be.ok;
39
38
  });
40
39
  });
41
40
  after(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finverse/sdk-typescript",
3
- "version": "0.0.43",
3
+ "version": "0.0.46",
4
4
  "description": "OpenAPI client for @finverse/sdk-typescript",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "axios-mock-adapter": "^1.21.1",
28
28
  "chai": "^4.3.6",
29
29
  "mocha": "^10.0.0",
30
- "ts-node": "^10.8.1",
30
+ "ts-node": "^10.8.2",
31
31
  "typescript": "^3.6.4"
32
32
  },
33
33
  "files": [
@@ -1,2 +0,0 @@
1
- import { GetStatementLinkResponse } from '../../api';
2
- export declare function getStatementLinkByStatementId(): GetStatementLinkResponse;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStatementLinkByStatementId = void 0;
4
- function getStatementLinkByStatementId() {
5
- return {
6
- statement_links: [
7
- {
8
- url: 'dummyUrl',
9
- statement_id: '01F11PRDNQQV3HE6K57BVPEH09',
10
- expiry: 'time',
11
- },
12
- ],
13
- };
14
- }
15
- exports.getStatementLinkByStatementId = getStatementLinkByStatementId;