@finverse/sdk-typescript 0.0.18 → 0.0.21
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/dist/api.d.ts +3925 -0
- package/dist/api.js +2349 -0
- package/dist/base.d.ts +55 -0
- package/dist/base.js +60 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +141 -0
- package/dist/configuration.d.ts +83 -0
- package/dist/configuration.js +42 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +27 -0
- package/dist/test/accounts.spec.d.ts +1 -0
- package/dist/test/accounts.spec.js +38 -0
- package/dist/test/authenticate.spec.d.ts +1 -0
- package/dist/test/authenticate.spec.js +46 -0
- package/dist/test/config.d.ts +10 -0
- package/dist/test/config.js +15 -0
- package/dist/test/link.spec.d.ts +1 -0
- package/dist/test/link.spec.js +75 -0
- package/dist/test/loginIdentity.spec.d.ts +1 -0
- package/dist/test/loginIdentity.spec.js +69 -0
- package/dist/test/responses/account.d.ts +2 -0
- package/dist/test/responses/account.js +104 -0
- package/dist/test/responses/accountNumber.d.ts +2 -0
- package/dist/test/responses/accountNumber.js +19 -0
- package/dist/test/responses/balanceHistory.d.ts +2 -0
- package/dist/test/responses/balanceHistory.js +21 -0
- package/dist/test/responses/customerToken.d.ts +5 -0
- package/dist/test/responses/customerToken.js +8 -0
- package/dist/test/responses/identity.d.ts +2 -0
- package/dist/test/responses/identity.js +54 -0
- package/dist/test/responses/linkToken.d.ts +6 -0
- package/dist/test/responses/linkToken.js +9 -0
- package/dist/test/responses/loginIdentity.d.ts +2 -0
- package/dist/test/responses/loginIdentity.js +85 -0
- package/dist/test/responses/loginIdentityHistory.d.ts +2 -0
- package/dist/test/responses/loginIdentityHistory.js +37 -0
- package/dist/test/responses/loginIdentityToken.d.ts +7 -0
- package/dist/test/responses/loginIdentityToken.js +10 -0
- package/dist/test/responses/statement.d.ts +2 -0
- package/dist/test/responses/statement.js +20 -0
- package/dist/test/responses/statementLink.d.ts +2 -0
- package/dist/test/responses/statementLink.js +15 -0
- package/dist/test/responses/transaction.d.ts +2 -0
- package/dist/test/responses/transaction.js +280 -0
- package/dist/test/statements.spec.d.ts +1 -0
- package/dist/test/statements.spec.js +44 -0
- package/dist/test/transactions.spec.d.ts +1 -0
- package/dist/test/transactions.spec.js +38 -0
- package/package.json +4 -3
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const axios_mock_adapter_1 = require("axios-mock-adapter");
|
|
13
|
+
const axios_1 = require("axios");
|
|
14
|
+
const config_1 = require("./config");
|
|
15
|
+
const __1 = require("..");
|
|
16
|
+
const api_1 = require("../api");
|
|
17
|
+
const linkToken_1 = require("./responses/linkToken");
|
|
18
|
+
const customerToken_1 = require("./responses/customerToken");
|
|
19
|
+
const loginIdentityToken_1 = require("./responses/loginIdentityToken");
|
|
20
|
+
const chai_1 = require("chai");
|
|
21
|
+
describe('Link', function () {
|
|
22
|
+
let mock;
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
25
|
+
});
|
|
26
|
+
it('Obtain link token and link url to launch Finverse Link UI', function () {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
// Variables
|
|
29
|
+
const url = `${config_1.config.apiHost}/link/token`;
|
|
30
|
+
const requestBody = {
|
|
31
|
+
client_id: config_1.config.clientId,
|
|
32
|
+
grant_type: config_1.grantType.CLIENT_CREDENTIALS,
|
|
33
|
+
user_id: 'userId',
|
|
34
|
+
redirect_uri: config_1.config.redirectURI,
|
|
35
|
+
state: 'state',
|
|
36
|
+
response_mode: 'form_post',
|
|
37
|
+
response_type: 'code',
|
|
38
|
+
link_mode: 'iframe',
|
|
39
|
+
};
|
|
40
|
+
// Mocking
|
|
41
|
+
mock.onPost(url, requestBody).reply(200, linkToken_1.linkToken);
|
|
42
|
+
// Make Request
|
|
43
|
+
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost, accessToken: customerToken_1.customerToken.access_token });
|
|
44
|
+
const got = yield new api_1.CustomerApi(configuration).generateLinkToken(requestBody);
|
|
45
|
+
// Expect
|
|
46
|
+
// The link url is used to initialize Finverse Link, when linking is finished, a cose is sent to the redirectUri
|
|
47
|
+
// This is used to exchange for loginIdentity Token
|
|
48
|
+
chai_1.expect(got.data.link_url).to.equal(linkToken_1.linkToken.link_url);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
it('Obtain login identity token', function () {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
// Variables
|
|
54
|
+
const url = `${config_1.config.apiHost}/auth/token`;
|
|
55
|
+
const requestBody = new URLSearchParams({
|
|
56
|
+
grant_type: config_1.grantType.AUTHORIZATION_CODE,
|
|
57
|
+
code: 'obtainAfterLink',
|
|
58
|
+
client_id: config_1.config.clientId,
|
|
59
|
+
redirect_uri: config_1.config.redirectURI,
|
|
60
|
+
});
|
|
61
|
+
// Mocking
|
|
62
|
+
// When Finverse link is done, obtain the code and use it to exchange for login identity access token
|
|
63
|
+
mock.onPost(url, requestBody.toString()).reply(200, loginIdentityToken_1.loginIdentityToken);
|
|
64
|
+
// Make Request
|
|
65
|
+
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost, accessToken: customerToken_1.customerToken.access_token });
|
|
66
|
+
const got = yield new api_1.LinkApi(configuration).token(config_1.grantType.AUTHORIZATION_CODE, 'obtainAfterLink', config_1.config.clientId, config_1.config.redirectURI);
|
|
67
|
+
// Expect
|
|
68
|
+
// The loginIdentityToken can be used to retrieve data
|
|
69
|
+
chai_1.expect(got.data.access_token).to.equal(loginIdentityToken_1.loginIdentityToken.access_token);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
afterEach(() => {
|
|
73
|
+
mock.restore();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const axios_mock_adapter_1 = require("axios-mock-adapter");
|
|
13
|
+
const axios_1 = require("axios");
|
|
14
|
+
const config_1 = require("./config");
|
|
15
|
+
const __1 = require("..");
|
|
16
|
+
const api_1 = require("../api");
|
|
17
|
+
const loginIdentity_1 = require("./responses/loginIdentity");
|
|
18
|
+
const loginIdentityToken_1 = require("./responses/loginIdentityToken");
|
|
19
|
+
const chai_1 = require("chai");
|
|
20
|
+
var FinalStatus;
|
|
21
|
+
(function (FinalStatus) {
|
|
22
|
+
FinalStatus["ERROR"] = "ERROR";
|
|
23
|
+
FinalStatus["DATA_RETRIEVAL_PARTIALLY_SUCCESSFUL"] = "DATA_RETRIEVAL_PARTIALLY_SUCCESSFUL";
|
|
24
|
+
FinalStatus["DATA_RETRIEVAL_COMPLETE"] = "DATA_RETRIEVAL_COMPLETE";
|
|
25
|
+
})(FinalStatus || (FinalStatus = {}));
|
|
26
|
+
describe('Login Identity', function () {
|
|
27
|
+
let mock;
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
30
|
+
mock.onGet(`${config_1.config.apiHost}/login_identity`).reply(200, loginIdentity_1.getLoginIdentity());
|
|
31
|
+
});
|
|
32
|
+
it('Obtain login identity', function () {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
// Make Request
|
|
35
|
+
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost, accessToken: loginIdentityToken_1.loginIdentityToken.access_token });
|
|
36
|
+
const got = yield new api_1.LoginIdentityApi(configuration).getLoginIdentity();
|
|
37
|
+
// Expect
|
|
38
|
+
// This is the institution information
|
|
39
|
+
chai_1.expect(got.data.institution).to.be.ok;
|
|
40
|
+
// This is the login identity events
|
|
41
|
+
chai_1.expect(got.data.login_identity).to.be.ok;
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
it('Poll login identity until ready', function () {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
// Make Request
|
|
47
|
+
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost, accessToken: loginIdentityToken_1.loginIdentityToken.access_token });
|
|
48
|
+
let got;
|
|
49
|
+
for (let i = 0; i < 20; i++) {
|
|
50
|
+
got = yield new api_1.LoginIdentityApi(configuration).getLoginIdentity();
|
|
51
|
+
const loginIdentityStatus = got.data.login_identity.status;
|
|
52
|
+
if (loginIdentityStatus === FinalStatus.ERROR ||
|
|
53
|
+
loginIdentityStatus === FinalStatus.DATA_RETRIEVAL_COMPLETE ||
|
|
54
|
+
loginIdentityStatus === FinalStatus.DATA_RETRIEVAL_PARTIALLY_SUCCESSFUL) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
yield new Promise((resolve) => setTimeout(resolve, 3000));
|
|
58
|
+
}
|
|
59
|
+
// Expect
|
|
60
|
+
// This is the institution information
|
|
61
|
+
chai_1.expect(got.data.institution).to.be.ok;
|
|
62
|
+
// This is the login identity events
|
|
63
|
+
chai_1.expect(got.data.login_identity).to.be.ok;
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
afterEach(() => {
|
|
67
|
+
mock.restore();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccounts = void 0;
|
|
4
|
+
function getAccounts() {
|
|
5
|
+
return {
|
|
6
|
+
accounts: [
|
|
7
|
+
{
|
|
8
|
+
account_currency: 'HKD',
|
|
9
|
+
account_id: '01F7MP3XTNX36K9N66JPKH131P',
|
|
10
|
+
account_name: 'HKD Checking',
|
|
11
|
+
balance: {
|
|
12
|
+
currency: 'HKD',
|
|
13
|
+
raw: '70013.12',
|
|
14
|
+
value: 70013.12,
|
|
15
|
+
},
|
|
16
|
+
created_at: '2021-06-08T02:09:42.000Z',
|
|
17
|
+
group_id: '5578758a56843bbe7104f0915f807eae4231aa0e5ce2bc0950c4fcb372b85948',
|
|
18
|
+
is_closed: false,
|
|
19
|
+
is_excluded: false,
|
|
20
|
+
is_parent: false,
|
|
21
|
+
statement_balance: {
|
|
22
|
+
currency: 'HKD',
|
|
23
|
+
raw: '70013.12',
|
|
24
|
+
value: 70013.12,
|
|
25
|
+
},
|
|
26
|
+
updated_at: '2021-06-08T02:09:42.000Z',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
account_currency: 'HKD',
|
|
30
|
+
account_id: '01F7MP3XTQ4Y8AFQ9KDFQXF14Y',
|
|
31
|
+
account_name: 'HKD Credit Card',
|
|
32
|
+
balance: {
|
|
33
|
+
currency: 'HKD',
|
|
34
|
+
raw: '-1833.22',
|
|
35
|
+
value: -1833.22,
|
|
36
|
+
},
|
|
37
|
+
created_at: '2021-06-08T02:09:42.000Z',
|
|
38
|
+
group_id: '4f776329e40d2aafaeb33415283aea9e0dae84467aeaa51c5030e4b0311b6040',
|
|
39
|
+
is_closed: false,
|
|
40
|
+
is_excluded: false,
|
|
41
|
+
is_parent: false,
|
|
42
|
+
statement_balance: {
|
|
43
|
+
currency: 'HKD',
|
|
44
|
+
raw: '-1833.22',
|
|
45
|
+
value: -1833.22,
|
|
46
|
+
},
|
|
47
|
+
updated_at: '2021-06-08T02:09:42.000Z',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
account_currency: 'USD',
|
|
51
|
+
account_id: '01F7MP3XTSBSTG6G68FESC66B1',
|
|
52
|
+
account_name: 'USD FX',
|
|
53
|
+
balance: {
|
|
54
|
+
currency: 'USD',
|
|
55
|
+
raw: '1923.22',
|
|
56
|
+
value: 1923.22,
|
|
57
|
+
},
|
|
58
|
+
created_at: '2021-06-08T02:09:42.000Z',
|
|
59
|
+
group_id: '582c1d9912586672ef9d028d7ed521ffedf9bb11d2392ddf1c2ec2e231c49ce5',
|
|
60
|
+
is_closed: false,
|
|
61
|
+
is_excluded: false,
|
|
62
|
+
is_parent: false,
|
|
63
|
+
statement_balance: {
|
|
64
|
+
currency: 'HKD',
|
|
65
|
+
raw: '15001.116',
|
|
66
|
+
value: 15001.116,
|
|
67
|
+
},
|
|
68
|
+
updated_at: '2021-06-08T02:09:42.000Z',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
account_currency: 'BTC',
|
|
72
|
+
account_id: '01F7MP3XTV38VSZMVF4C65NHT3',
|
|
73
|
+
account_name: 'Bitcoin',
|
|
74
|
+
balance: {
|
|
75
|
+
currency: 'BTC',
|
|
76
|
+
raw: '420.69',
|
|
77
|
+
value: 420.69,
|
|
78
|
+
},
|
|
79
|
+
created_at: '2021-06-08T02:09:42.000Z',
|
|
80
|
+
group_id: '582c1d9912586672ef9d028d7ed521ffedf9bb11d2392ddf1c2ec2e231c49ce5',
|
|
81
|
+
is_closed: false,
|
|
82
|
+
is_excluded: false,
|
|
83
|
+
is_parent: false,
|
|
84
|
+
statement_balance: {
|
|
85
|
+
currency: 'HKD',
|
|
86
|
+
raw: '106468292.05',
|
|
87
|
+
value: 106468292.05,
|
|
88
|
+
},
|
|
89
|
+
updated_at: '2021-06-08T02:09:42.000Z',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
institution: {
|
|
93
|
+
countries: ['HKG', 'SGP', 'PHL'],
|
|
94
|
+
institution_id: 'testbank',
|
|
95
|
+
institution_name: 'TestBank HK',
|
|
96
|
+
portal_name: 'Test Bank Personal Account',
|
|
97
|
+
},
|
|
98
|
+
login_identity: {
|
|
99
|
+
login_identity_id: '01F7MP3J3H485QSDQC0FS15KE7',
|
|
100
|
+
status: 'DATA_RETRIEVAL_COMPLETE',
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
exports.getAccounts = getAccounts;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccountNumber = void 0;
|
|
4
|
+
const account_1 = require("./account");
|
|
5
|
+
function getAccountNumber() {
|
|
6
|
+
var _a;
|
|
7
|
+
const accountData = account_1.getAccounts();
|
|
8
|
+
return {
|
|
9
|
+
account: (_a = accountData === null || accountData === void 0 ? void 0 : accountData.accounts) === null || _a === void 0 ? void 0 : _a[0],
|
|
10
|
+
account_number: {
|
|
11
|
+
raw: '123-456789-123',
|
|
12
|
+
number: '123456789123',
|
|
13
|
+
account_id: 'validId',
|
|
14
|
+
},
|
|
15
|
+
institution: accountData.institution,
|
|
16
|
+
login_identity: accountData.login_identity,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
exports.getAccountNumber = getAccountNumber;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBalanceHistory = void 0;
|
|
4
|
+
const account_1 = require("./account");
|
|
5
|
+
function getBalanceHistory() {
|
|
6
|
+
var _a;
|
|
7
|
+
const accountData = account_1.getAccounts();
|
|
8
|
+
return {
|
|
9
|
+
account: (_a = accountData === null || accountData === void 0 ? void 0 : accountData.accounts) === null || _a === void 0 ? void 0 : _a[0],
|
|
10
|
+
balance_history: [
|
|
11
|
+
{
|
|
12
|
+
amount: 69,
|
|
13
|
+
currency: 'HKD',
|
|
14
|
+
date: '2021-10-27',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
institution: accountData.institution,
|
|
18
|
+
login_identity: accountData.login_identity,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.getBalanceHistory = getBalanceHistory;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIdentity = void 0;
|
|
4
|
+
const account_1 = require("./account");
|
|
5
|
+
function getIdentity() {
|
|
6
|
+
const accountData = account_1.getAccounts();
|
|
7
|
+
return {
|
|
8
|
+
identity: {
|
|
9
|
+
addresses: [
|
|
10
|
+
{
|
|
11
|
+
account_ids: ['01FG0M305NNFND0ZK5EC6ARXQA', '01FG0M305QAAER7Z6XVZAEV4R9', '01FG0M305V0Z3MADJR00VFYDGG'],
|
|
12
|
+
raw: 'Some location',
|
|
13
|
+
source: 'ONLINE_BANKING',
|
|
14
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
emails: [
|
|
18
|
+
{
|
|
19
|
+
account_ids: ['01FG0M305NNFND0ZK5EC6ARXQA', '01FG0M305QAAER7Z6XVZAEV4R9', '01FG0M305V0Z3MADJR00VFYDGG'],
|
|
20
|
+
raw: 'john@company.com',
|
|
21
|
+
source: 'ONLINE_BANKING',
|
|
22
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
names: [
|
|
26
|
+
{
|
|
27
|
+
account_ids: ['01FG0M305NNFND0ZK5EC6ARXQA', '01FG0M305QAAER7Z6XVZAEV4R9', '01FG0M305V0Z3MADJR00VFYDGG'],
|
|
28
|
+
full_name: 'John Doe',
|
|
29
|
+
raw: 'John Doe',
|
|
30
|
+
source: 'ONLINE_BANKING',
|
|
31
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
account_ids: ['01FG0M30612SWYQFRD6A2581Z2'],
|
|
35
|
+
full_name: 'Joe',
|
|
36
|
+
raw: 'Joe',
|
|
37
|
+
source: 'ONLINE_BANKING',
|
|
38
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
phone_numbers: [
|
|
42
|
+
{
|
|
43
|
+
account_ids: ['01FG0M305NNFND0ZK5EC6ARXQA', '01FG0M305QAAER7Z6XVZAEV4R9', '01FG0M305V0Z3MADJR00VFYDGG'],
|
|
44
|
+
raw: '12345678',
|
|
45
|
+
source: 'ONLINE_BANKING',
|
|
46
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
institution: accountData.institution,
|
|
51
|
+
login_identity: accountData.login_identity,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
exports.getIdentity = getIdentity;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.linkToken = void 0;
|
|
4
|
+
exports.linkToken = {
|
|
5
|
+
access_token: 'link_token',
|
|
6
|
+
expires_in: 300,
|
|
7
|
+
link_url: 'https://link.sandbox.finverse.net/onboarding?token=link_token',
|
|
8
|
+
token_type: 'Bearer',
|
|
9
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLoginIdentity = void 0;
|
|
4
|
+
function getLoginIdentity() {
|
|
5
|
+
return {
|
|
6
|
+
institution: {
|
|
7
|
+
countries: ['HKG', 'SGP', 'PHL'],
|
|
8
|
+
institution_id: 'testbank',
|
|
9
|
+
institution_name: 'TestBank HK',
|
|
10
|
+
portal_name: 'Test Bank Personal Account',
|
|
11
|
+
},
|
|
12
|
+
login_identity: {
|
|
13
|
+
authentication_status: {
|
|
14
|
+
last_successful_update: '2021-12-03T02:08:23.087Z',
|
|
15
|
+
last_update: '2021-12-03T02:08:23.087Z',
|
|
16
|
+
status: 'AUTHENTICATED',
|
|
17
|
+
status_details: 'AUTHENTICATED',
|
|
18
|
+
},
|
|
19
|
+
billing_details: {
|
|
20
|
+
billed_products: null,
|
|
21
|
+
},
|
|
22
|
+
created_at: '2021-12-03T02:07:58.103Z',
|
|
23
|
+
customer_app_id: 'any_customer_app_id',
|
|
24
|
+
error: {},
|
|
25
|
+
first_success: '2021-12-03T02:07:58.103Z',
|
|
26
|
+
institution_id: 'testbank',
|
|
27
|
+
last_success: '2021-12-03T02:08:23.034Z',
|
|
28
|
+
login_identity_id: '01FNZ0RP2MWD0SNFBXT8VJ65PE',
|
|
29
|
+
login_methods_available: {},
|
|
30
|
+
permissions: null,
|
|
31
|
+
permissions_expiry_date: '2021-12-03T02:07:58.103Z',
|
|
32
|
+
permissions_grant_date: '2021-12-03T02:07:58.103Z',
|
|
33
|
+
product_status: {
|
|
34
|
+
account_numbers: {
|
|
35
|
+
last_successful_update: '2021-12-03T02:08:25.189Z',
|
|
36
|
+
last_update: '2021-12-03T02:08:25.189Z',
|
|
37
|
+
status: 'SUCCESS',
|
|
38
|
+
status_details: 'ACCOUNT_NUMBERS_RETRIEVED',
|
|
39
|
+
},
|
|
40
|
+
accounts: {
|
|
41
|
+
last_successful_update: '2021-12-03T02:08:25.050Z',
|
|
42
|
+
last_update: '2021-12-03T02:08:25.050Z',
|
|
43
|
+
status: 'SUCCESS',
|
|
44
|
+
status_details: 'ACCOUNTS_RETRIEVED',
|
|
45
|
+
},
|
|
46
|
+
balance_history: {
|
|
47
|
+
status: 'SUCCESS',
|
|
48
|
+
status_details: 'BALANCE_HISTORY_RETRIEVED',
|
|
49
|
+
},
|
|
50
|
+
historical_transactions: {
|
|
51
|
+
last_update: '2021-12-03T02:08:33.698Z',
|
|
52
|
+
status: 'SUCCESS',
|
|
53
|
+
status_details: 'HISTORICAL_TRANSACTIONS_RETRIEVED',
|
|
54
|
+
},
|
|
55
|
+
identity: {
|
|
56
|
+
last_successful_update: '2021-12-03T02:08:27.898Z',
|
|
57
|
+
last_update: '2021-12-03T02:08:27.898Z',
|
|
58
|
+
status: 'SUCCESS',
|
|
59
|
+
status_details: 'IDENTITY_RETRIEVED',
|
|
60
|
+
},
|
|
61
|
+
online_transactions: {
|
|
62
|
+
last_successful_update: '2021-12-03T02:08:26.790Z',
|
|
63
|
+
last_update: '2021-12-03T02:08:26.790Z',
|
|
64
|
+
status: 'SUCCESS',
|
|
65
|
+
status_details: 'ONLINE_TRANSACTIONS_RETRIEVED',
|
|
66
|
+
},
|
|
67
|
+
statements: {
|
|
68
|
+
last_successful_update: '2021-12-03T02:08:29.092Z',
|
|
69
|
+
last_update: '2021-12-03T02:08:29.092Z',
|
|
70
|
+
status: 'SUCCESS',
|
|
71
|
+
status_details: 'STATEMENTS_RETRIEVED',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
status: 'DATA_RETRIEVAL_COMPLETE',
|
|
75
|
+
status_details: {
|
|
76
|
+
event_date: '2021-12-03T02:08:33.794Z',
|
|
77
|
+
event_name: 'BALANCE_HISTORY_RETRIEVED',
|
|
78
|
+
},
|
|
79
|
+
updated_at: '2021-12-03T02:08:33.811Z',
|
|
80
|
+
user_id: '01FN8TJ92X38QF7B4N5HRP8X3K',
|
|
81
|
+
webhook: 'https://example.com/callback',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
exports.getLoginIdentity = getLoginIdentity;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLoginIdentityHistory = void 0;
|
|
4
|
+
function getLoginIdentityHistory() {
|
|
5
|
+
return {
|
|
6
|
+
login_identity: {
|
|
7
|
+
created_at: '2020-12-22T09:45:31.853Z',
|
|
8
|
+
customer_app_id: 'demo.finverse',
|
|
9
|
+
error: {
|
|
10
|
+
details: 'ERROR_UNKNOWN',
|
|
11
|
+
message: 'ERROR_UNKNOWN',
|
|
12
|
+
type: 'ERROR_UNKNOWN',
|
|
13
|
+
},
|
|
14
|
+
first_success: '2020-12-22T09:45:31.853Z',
|
|
15
|
+
institution_id: 'testbank',
|
|
16
|
+
last_success: '2020-12-22T09:45:37.388Z',
|
|
17
|
+
login_identity_id: '01ET4XDTEDK1EA13K1K11SWV0W',
|
|
18
|
+
permissions_expiry_date: '2020-12-22T09:45:31.853Z',
|
|
19
|
+
permissions_grant_date: '2020-12-22T09:45:31.853Z',
|
|
20
|
+
status: 'ERROR',
|
|
21
|
+
status_details: {
|
|
22
|
+
event_date: '2020-12-22T09:45:40.313Z',
|
|
23
|
+
event_name: 'RETRIEVE_DATA_FAILED',
|
|
24
|
+
},
|
|
25
|
+
updated_at: '2020-12-22T09:45:40.314Z',
|
|
26
|
+
user_id: '01ET23V6TPXNE00SDSCQGXM3XB',
|
|
27
|
+
webhook: 'https://example.com/callback',
|
|
28
|
+
},
|
|
29
|
+
status_history: [
|
|
30
|
+
{
|
|
31
|
+
event_name: 'event',
|
|
32
|
+
event_date: '2020-12-22T09:45:40.313Z',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.getLoginIdentityHistory = getLoginIdentityHistory;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loginIdentityToken = void 0;
|
|
4
|
+
exports.loginIdentityToken = {
|
|
5
|
+
access_token: 'login_identity_token',
|
|
6
|
+
expires_in: 3600,
|
|
7
|
+
login_identity_id: 'login_identity_id',
|
|
8
|
+
refresh_token: 'login_identity_refresh_token',
|
|
9
|
+
token_type: 'Bearer',
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStatements = void 0;
|
|
4
|
+
const account_1 = require("./account");
|
|
5
|
+
function getStatements() {
|
|
6
|
+
const accountData = account_1.getAccounts();
|
|
7
|
+
return {
|
|
8
|
+
statements: [
|
|
9
|
+
{
|
|
10
|
+
created_at: '2021-03-18T03:41:08.666Z',
|
|
11
|
+
date: '2020-09-01',
|
|
12
|
+
id: '01F11PRDNQQV3HE6K57BVPEH09',
|
|
13
|
+
name: 'Test Bank Statement',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
institution: accountData.institution,
|
|
17
|
+
login_identity: accountData.login_identity,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.getStatements = getStatements;
|
|
@@ -0,0 +1,15 @@
|
|
|
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;
|