@finverse/sdk-typescript 0.0.42 → 0.0.45

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}
@@ -1007,6 +1013,12 @@ export interface GetPaymentResponse {
1007
1013
  * @memberof GetPaymentResponse
1008
1014
  */
1009
1015
  type?: GetPaymentResponseTypeEnum;
1016
+ /**
1017
+ * Timestamp in ISO format (YYYY-MM-DDTHH:MM:SS.SSSZ)
1018
+ * @type {string}
1019
+ * @memberof GetPaymentResponse
1020
+ */
1021
+ last_update?: string;
1010
1022
  /**
1011
1023
  * Possible values - CREATED, AUTHORIZED, SUBMITTED, EXECUTED, FAILED, REJECTED, CANCELLED.
1012
1024
  * @type {string}
@@ -3028,10 +3040,11 @@ export declare const CustomerApiAxiosParamCreator: (configuration?: Configuratio
3028
3040
  /**
3029
3041
  * CREATE Mandate
3030
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.
3031
3044
  * @param {*} [options] Override http request option.
3032
3045
  * @throws {RequiredError}
3033
3046
  */
3034
- createMandate: (createMandateRequest: CreateMandateRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3047
+ createMandate: (createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3035
3048
  /**
3036
3049
  * Create new Payment
3037
3050
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3122,10 +3135,11 @@ export declare const CustomerApiFp: (configuration?: Configuration) => {
3122
3135
  /**
3123
3136
  * CREATE Mandate
3124
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.
3125
3139
  * @param {*} [options] Override http request option.
3126
3140
  * @throws {RequiredError}
3127
3141
  */
3128
- 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>>;
3129
3143
  /**
3130
3144
  * Create new Payment
3131
3145
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3216,10 +3230,11 @@ export declare const CustomerApiFactory: (configuration?: Configuration, basePat
3216
3230
  /**
3217
3231
  * CREATE Mandate
3218
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.
3219
3234
  * @param {*} [options] Override http request option.
3220
3235
  * @throws {RequiredError}
3221
3236
  */
3222
- createMandate(createMandateRequest: CreateMandateRequest, options?: any): AxiosPromise<CreateMandateResponse>;
3237
+ createMandate(createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: any): AxiosPromise<CreateMandateResponse>;
3223
3238
  /**
3224
3239
  * Create new Payment
3225
3240
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3311,11 +3326,12 @@ export interface CustomerApiInterface {
3311
3326
  /**
3312
3327
  * CREATE Mandate
3313
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.
3314
3330
  * @param {*} [options] Override http request option.
3315
3331
  * @throws {RequiredError}
3316
3332
  * @memberof CustomerApiInterface
3317
3333
  */
3318
- createMandate(createMandateRequest: CreateMandateRequest, options?: AxiosRequestConfig): AxiosPromise<CreateMandateResponse>;
3334
+ createMandate(createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: AxiosRequestConfig): AxiosPromise<CreateMandateResponse>;
3319
3335
  /**
3320
3336
  * Create new Payment
3321
3337
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
@@ -3419,11 +3435,12 @@ export declare class CustomerApi extends BaseAPI implements CustomerApiInterface
3419
3435
  /**
3420
3436
  * CREATE Mandate
3421
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.
3422
3439
  * @param {*} [options] Override http request option.
3423
3440
  * @throws {RequiredError}
3424
3441
  * @memberof CustomerApi
3425
3442
  */
3426
- createMandate(createMandateRequest: CreateMandateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateMandateResponse>>;
3443
+ createMandate(createMandateRequest: CreateMandateRequest, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateMandateResponse>>;
3427
3444
  /**
3428
3445
  * Create new Payment
3429
3446
  * @param {CreatePaymentRequest} createPaymentRequest request body for creating payment
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
  /**
@@ -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.42",
3
+ "version": "0.0.45",
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;