@spritz-finance/service-client 0.2.6 → 0.2.8
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
declare enum BankAccountSubType {
|
|
2
|
+
export declare enum BankAccountSubType {
|
|
3
3
|
Business = "BUSINESS",
|
|
4
4
|
Checking = "CHECKING",
|
|
5
5
|
Savings = "SAVINGS"
|
|
@@ -14,7 +14,7 @@ export declare type CheckbookAccountInput = {
|
|
|
14
14
|
ownedByUser?: boolean;
|
|
15
15
|
type: BankAccountSubType;
|
|
16
16
|
};
|
|
17
|
-
interface PayableAccountBankAccount {
|
|
17
|
+
export interface PayableAccountBankAccount {
|
|
18
18
|
_id: string;
|
|
19
19
|
__t: string;
|
|
20
20
|
id: string;
|
|
@@ -28,20 +28,24 @@ interface PayableAccountBankAccount {
|
|
|
28
28
|
accountNumber: string;
|
|
29
29
|
bankAccountType: string;
|
|
30
30
|
bankAccountSubType: string;
|
|
31
|
+
createdAt: string;
|
|
31
32
|
holder: string;
|
|
32
33
|
email: string;
|
|
33
34
|
ownedByUser: boolean;
|
|
34
35
|
bankAccountDetails: {
|
|
35
36
|
routingNumber: string;
|
|
36
37
|
};
|
|
38
|
+
bankAccountFeatures: {
|
|
39
|
+
rtp?: boolean;
|
|
40
|
+
} | null;
|
|
37
41
|
}
|
|
38
42
|
export declare class PayableAccountsServiceClient {
|
|
39
43
|
client: AxiosInstance;
|
|
40
44
|
constructor();
|
|
41
45
|
getAccount(accountId: string): Promise<PayableAccountBankAccount>;
|
|
42
|
-
|
|
46
|
+
getAccountsForUser(userId: string): Promise<PayableAccountBankAccount[]>;
|
|
47
|
+
deleteAccount(accountId: string): Promise<PayableAccountBankAccount>;
|
|
43
48
|
renameAccount(accountId: string, name: String): Promise<PayableAccountBankAccount>;
|
|
44
49
|
getAccounts(accountIds: string[]): Promise<PayableAccountBankAccount[]>;
|
|
45
50
|
createFromCheckbook(input: CheckbookAccountInput): Promise<PayableAccountBankAccount>;
|
|
46
51
|
}
|
|
47
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayableAccountsServiceClient = void 0;
|
|
3
|
+
exports.PayableAccountsServiceClient = exports.BankAccountSubType = void 0;
|
|
4
4
|
const config_1 = require("./config");
|
|
5
5
|
const serviceClient_1 = require("./serviceClient");
|
|
6
6
|
var BankAccountSubType;
|
|
@@ -8,7 +8,7 @@ var BankAccountSubType;
|
|
|
8
8
|
BankAccountSubType["Business"] = "BUSINESS";
|
|
9
9
|
BankAccountSubType["Checking"] = "CHECKING";
|
|
10
10
|
BankAccountSubType["Savings"] = "SAVINGS";
|
|
11
|
-
})(BankAccountSubType || (BankAccountSubType = {}));
|
|
11
|
+
})(BankAccountSubType = exports.BankAccountSubType || (exports.BankAccountSubType = {}));
|
|
12
12
|
class PayableAccountsServiceClient {
|
|
13
13
|
constructor() {
|
|
14
14
|
this.client = (0, serviceClient_1.createServiceClient)({
|
|
@@ -20,6 +20,11 @@ class PayableAccountsServiceClient {
|
|
|
20
20
|
.get(`/payable-account/${accountId}`)
|
|
21
21
|
.then((res) => res.data);
|
|
22
22
|
}
|
|
23
|
+
async getAccountsForUser(userId) {
|
|
24
|
+
return this.client
|
|
25
|
+
.get(`/payable-accounts/user/${userId}`)
|
|
26
|
+
.then((res) => res.data);
|
|
27
|
+
}
|
|
23
28
|
async deleteAccount(accountId) {
|
|
24
29
|
return this.client
|
|
25
30
|
.delete(`/payable-account/${accountId}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spritz-finance/service-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Service client",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"coverageDirectory": "../coverage",
|
|
48
48
|
"testEnvironment": "node"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "98520f7628b574aa4e12b041dfb5ea0e925a7fff"
|
|
51
51
|
}
|