@spritz-finance/service-client 0.2.57 → 0.2.59
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,7 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { CheckbookCardResponse } from './liabilitiesServiceClient';
|
|
3
2
|
import { AccountProvider, AccountSyncStatus, BankAccount, Bill, BillType, PayableAccountInstitution as GraphInstitution, PayableAccountOriginator, PayableAccountType, VirtualCard } from './lib/graphClient/generated';
|
|
4
|
-
export {
|
|
3
|
+
export { AccountSyncStatus, PayableAccountOriginator, } from './lib/graphClient/generated';
|
|
5
4
|
export declare enum BankAccountSubType {
|
|
6
5
|
Business = "BUSINESS",
|
|
7
6
|
Checking = "CHECKING",
|
|
@@ -42,17 +41,6 @@ export declare type CheckbookAccountInput = {
|
|
|
42
41
|
ownedByUser?: boolean;
|
|
43
42
|
type: BankAccountSubType;
|
|
44
43
|
};
|
|
45
|
-
declare type VirtualCardDetails = {
|
|
46
|
-
number: string;
|
|
47
|
-
cvv: string;
|
|
48
|
-
expirationMonth: string;
|
|
49
|
-
expirationYear: string;
|
|
50
|
-
};
|
|
51
|
-
declare type ValidAddressDetails = {
|
|
52
|
-
address: string;
|
|
53
|
-
accountId: string;
|
|
54
|
-
userId: string;
|
|
55
|
-
};
|
|
56
44
|
declare type PayableAccountModelExtension = {
|
|
57
45
|
__t: PayableAccountType;
|
|
58
46
|
externalId?: string | null;
|
|
@@ -78,14 +66,7 @@ export declare class PayableAccountsServiceClient {
|
|
|
78
66
|
getAccount(accountId: string): Promise<BillModel | BankAcountModel | VirtualCardModel>;
|
|
79
67
|
getAccountByExternalId(externalId: string): Promise<BillModel | BankAcountModel | VirtualCardModel>;
|
|
80
68
|
getAccountsForUser(userId: string): Promise<PayableAccount[]>;
|
|
81
|
-
deleteAccount(accountId: string): Promise<BillModel | BankAcountModel | VirtualCardModel>;
|
|
82
|
-
renameAccount(accountId: string, name: String): Promise<BillModel | BankAcountModel | VirtualCardModel>;
|
|
83
69
|
getAccounts(accountIds: string[]): Promise<PayableAccount[]>;
|
|
84
|
-
getAccountInstitutions(institutionIds: string[]): Promise<PayableAccountInstitution[]>;
|
|
85
70
|
getAccountInstitution(institutionId: string): Promise<PayableAccountInstitution>;
|
|
86
|
-
createFromCheckbook(input: CheckbookAccountInput): Promise<BankAcountModel>;
|
|
87
|
-
createCardFromCheckbook(input: CheckbookCardResponse): Promise<VirtualCardModel>;
|
|
88
|
-
getVirtualCardDetails(accountId: string): Promise<VirtualCardDetails>;
|
|
89
71
|
upsertBillFromExternalAccount(input: ExternalBillInput): Promise<BillModel>;
|
|
90
|
-
getValidPaymentAddresses(input: string[]): Promise<ValidAddressDetails[]>;
|
|
91
72
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PayableAccountsServiceClient = exports.BankAccountSubType = exports.
|
|
3
|
+
exports.PayableAccountsServiceClient = exports.BankAccountSubType = exports.PayableAccountOriginator = exports.AccountSyncStatus = void 0;
|
|
4
4
|
const config_1 = require("./config");
|
|
5
5
|
const serviceClient_1 = require("./serviceClient");
|
|
6
6
|
var generated_1 = require("./lib/graphClient/generated");
|
|
7
|
-
Object.defineProperty(exports, "PayableAccountOriginator", { enumerable: true, get: function () { return generated_1.PayableAccountOriginator; } });
|
|
8
7
|
Object.defineProperty(exports, "AccountSyncStatus", { enumerable: true, get: function () { return generated_1.AccountSyncStatus; } });
|
|
8
|
+
Object.defineProperty(exports, "PayableAccountOriginator", { enumerable: true, get: function () { return generated_1.PayableAccountOriginator; } });
|
|
9
9
|
var BankAccountSubType;
|
|
10
10
|
(function (BankAccountSubType) {
|
|
11
11
|
BankAccountSubType["Business"] = "BUSINESS";
|
|
@@ -33,55 +33,20 @@ class PayableAccountsServiceClient {
|
|
|
33
33
|
.get(`/payable-accounts/user/${userId}`)
|
|
34
34
|
.then((res) => res.data);
|
|
35
35
|
}
|
|
36
|
-
async deleteAccount(accountId) {
|
|
37
|
-
return this.client
|
|
38
|
-
.delete(`/payable-account/id/${accountId}`)
|
|
39
|
-
.then((res) => res.data);
|
|
40
|
-
}
|
|
41
|
-
async renameAccount(accountId, name) {
|
|
42
|
-
return this.client
|
|
43
|
-
.put(`/payable-account/id/${accountId}`, { name })
|
|
44
|
-
.then((res) => res.data);
|
|
45
|
-
}
|
|
46
36
|
async getAccounts(accountIds) {
|
|
47
37
|
return this.client
|
|
48
38
|
.get(`/payable-accounts?accountIds=${accountIds.join(',')}`)
|
|
49
39
|
.then((res) => res.data);
|
|
50
40
|
}
|
|
51
|
-
async getAccountInstitutions(institutionIds) {
|
|
52
|
-
return this.client
|
|
53
|
-
.get(`/account-institutions?institutionIds=${institutionIds.join(',')}`)
|
|
54
|
-
.then((res) => res.data);
|
|
55
|
-
}
|
|
56
41
|
async getAccountInstitution(institutionId) {
|
|
57
42
|
return this.client
|
|
58
43
|
.get(`/account-institution/id/${institutionId}`)
|
|
59
44
|
.then((res) => res.data);
|
|
60
45
|
}
|
|
61
|
-
async createFromCheckbook(input) {
|
|
62
|
-
return this.client
|
|
63
|
-
.post(`/create-from-checkbook`, input)
|
|
64
|
-
.then((res) => res.data);
|
|
65
|
-
}
|
|
66
|
-
async createCardFromCheckbook(input) {
|
|
67
|
-
return this.client
|
|
68
|
-
.post(`/create-card-from-checkbook`, input)
|
|
69
|
-
.then((res) => res.data);
|
|
70
|
-
}
|
|
71
|
-
async getVirtualCardDetails(accountId) {
|
|
72
|
-
return this.client
|
|
73
|
-
.get(`/virtual-card/${accountId}/details`)
|
|
74
|
-
.then((res) => res.data);
|
|
75
|
-
}
|
|
76
46
|
async upsertBillFromExternalAccount(input) {
|
|
77
47
|
return this.client
|
|
78
48
|
.post(`/bills/upsert-external-account`, input)
|
|
79
49
|
.then((res) => res.data);
|
|
80
50
|
}
|
|
81
|
-
async getValidPaymentAddresses(input) {
|
|
82
|
-
return this.client
|
|
83
|
-
.post(`/payment-address/valid-addresses`, input)
|
|
84
|
-
.then((res) => res.data);
|
|
85
|
-
}
|
|
86
51
|
}
|
|
87
52
|
exports.PayableAccountsServiceClient = PayableAccountsServiceClient;
|