@mft/moneyhub-api-client 5.3.0 → 5.4.0
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/CHANGELOG.md +7 -0
- package/dist/index.d.ts +129 -129
- package/dist/request.d.ts +6 -1
- package/dist/request.d.ts.map +1 -1
- package/dist/request.js +9 -2
- package/dist/request.js.map +1 -1
- package/dist/requests/accounts.d.ts.map +1 -1
- package/dist/requests/accounts.js +36 -18
- package/dist/requests/accounts.js.map +1 -1
- package/dist/requests/affordability.d.ts +4 -4
- package/dist/requests/affordability.d.ts.map +1 -1
- package/dist/requests/affordability.js +6 -3
- package/dist/requests/affordability.js.map +1 -1
- package/dist/requests/auth-requests.d.ts.map +1 -1
- package/dist/requests/auth-requests.js +8 -4
- package/dist/requests/auth-requests.js.map +1 -1
- package/dist/requests/beneficiaries.d.ts.map +1 -1
- package/dist/requests/beneficiaries.js +8 -6
- package/dist/requests/beneficiaries.js.map +1 -1
- package/dist/requests/categories.d.ts.map +1 -1
- package/dist/requests/categories.js +12 -6
- package/dist/requests/categories.js.map +1 -1
- package/dist/requests/index.d.ts +129 -129
- package/dist/requests/payees.d.ts.map +1 -1
- package/dist/requests/payees.js +6 -3
- package/dist/requests/payees.js.map +1 -1
- package/dist/requests/payments.d.ts.map +1 -1
- package/dist/requests/payments.js +6 -4
- package/dist/requests/payments.js.map +1 -1
- package/dist/requests/projects.d.ts.map +1 -1
- package/dist/requests/projects.js +10 -5
- package/dist/requests/projects.js.map +1 -1
- package/dist/requests/recurring-payments.d.ts.map +1 -1
- package/dist/requests/recurring-payments.js +8 -4
- package/dist/requests/recurring-payments.js.map +1 -1
- package/dist/requests/regular-transactions.d.ts.map +1 -1
- package/dist/requests/regular-transactions.js +2 -1
- package/dist/requests/regular-transactions.js.map +1 -1
- package/dist/requests/rental-records.d.ts.map +1 -1
- package/dist/requests/rental-records.js +6 -3
- package/dist/requests/rental-records.js.map +1 -1
- package/dist/requests/savings-goals.d.ts.map +1 -1
- package/dist/requests/savings-goals.js +10 -5
- package/dist/requests/savings-goals.js.map +1 -1
- package/dist/requests/spending-analysis.d.ts.map +1 -1
- package/dist/requests/spending-analysis.js +2 -1
- package/dist/requests/spending-analysis.js.map +1 -1
- package/dist/requests/spending-goals.d.ts.map +1 -1
- package/dist/requests/spending-goals.js +10 -5
- package/dist/requests/spending-goals.js.map +1 -1
- package/dist/requests/standing-orders.d.ts.map +1 -1
- package/dist/requests/standing-orders.js +4 -2
- package/dist/requests/standing-orders.js.map +1 -1
- package/dist/requests/sync.d.ts.map +1 -1
- package/dist/requests/sync.js +2 -1
- package/dist/requests/sync.js.map +1 -1
- package/dist/requests/tax.d.ts.map +1 -1
- package/dist/requests/tax.js +2 -1
- package/dist/requests/tax.js.map +1 -1
- package/dist/requests/transaction-files.d.ts.map +1 -1
- package/dist/requests/transaction-files.js +8 -4
- package/dist/requests/transaction-files.js.map +1 -1
- package/dist/requests/transaction-splits.d.ts.map +1 -1
- package/dist/requests/transaction-splits.js +8 -4
- package/dist/requests/transaction-splits.js.map +1 -1
- package/dist/requests/transactions.d.ts.map +1 -1
- package/dist/requests/transactions.js +12 -6
- package/dist/requests/transactions.js.map +1 -1
- package/dist/requests/types/accounts.d.ts +35 -35
- package/dist/requests/types/accounts.d.ts.map +1 -1
- package/dist/requests/types/auth-requests.d.ts +5 -5
- package/dist/requests/types/auth-requests.d.ts.map +1 -1
- package/dist/requests/types/beneficiaries.d.ts +9 -9
- package/dist/requests/types/beneficiaries.d.ts.map +1 -1
- package/dist/requests/types/categories.d.ts +11 -11
- package/dist/requests/types/categories.d.ts.map +1 -1
- package/dist/requests/types/payees.d.ts +4 -4
- package/dist/requests/types/payees.d.ts.map +1 -1
- package/dist/requests/types/payments.d.ts +4 -4
- package/dist/requests/types/payments.d.ts.map +1 -1
- package/dist/requests/types/projects.d.ts +6 -6
- package/dist/requests/types/projects.d.ts.map +1 -1
- package/dist/requests/types/recurring-payments.d.ts +5 -5
- package/dist/requests/types/recurring-payments.d.ts.map +1 -1
- package/dist/requests/types/regular-transactions.d.ts +3 -3
- package/dist/requests/types/regular-transactions.d.ts.map +1 -1
- package/dist/requests/types/rental-records.d.ts +4 -4
- package/dist/requests/types/rental-records.d.ts.map +1 -1
- package/dist/requests/types/savings-goals.d.ts +6 -6
- package/dist/requests/types/savings-goals.d.ts.map +1 -1
- package/dist/requests/types/spending-analysis.d.ts +3 -3
- package/dist/requests/types/spending-analysis.d.ts.map +1 -1
- package/dist/requests/types/spending-goals.d.ts +6 -6
- package/dist/requests/types/spending-goals.d.ts.map +1 -1
- package/dist/requests/types/standing-orders.d.ts +3 -3
- package/dist/requests/types/standing-orders.d.ts.map +1 -1
- package/dist/requests/types/sync.d.ts +3 -3
- package/dist/requests/types/sync.d.ts.map +1 -1
- package/dist/requests/types/tax.d.ts +3 -3
- package/dist/requests/types/tax.d.ts.map +1 -1
- package/dist/requests/types/transaction-files.d.ts +9 -9
- package/dist/requests/types/transaction-files.d.ts.map +1 -1
- package/dist/requests/types/transaction-splits.d.ts +6 -6
- package/dist/requests/types/transaction-splits.d.ts.map +1 -1
- package/dist/requests/types/transactions.d.ts +9 -9
- package/dist/requests/types/transactions.d.ts.map +1 -1
- package/dist/requests/types/users-and-connections.d.ts +12 -12
- package/dist/requests/types/users-and-connections.d.ts.map +1 -1
- package/dist/requests/users-and-connections.d.ts.map +1 -1
- package/dist/requests/users-and-connections.js +22 -11
- package/dist/requests/users-and-connections.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +11 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -7,40 +7,40 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
7
7
|
generators: typeof generators;
|
|
8
8
|
registerUser: ({ clientUserId, }: {
|
|
9
9
|
clientUserId: string;
|
|
10
|
-
}) => Promise<Users.User>;
|
|
11
|
-
getUsers: (params?: import("./request").SearchParams | undefined) => Promise<import("./request").ApiResponse<Users.User[]>>;
|
|
12
|
-
getSCIMUsers: (params?: import("./request").SearchParams | undefined) => Promise<import("./request").ApiResponse<any>>;
|
|
10
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<Users.User>;
|
|
11
|
+
getUsers: (params?: import("./request").SearchParams | undefined, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Users.User[]>>;
|
|
12
|
+
getSCIMUsers: (params?: import("./request").SearchParams | undefined, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<any>>;
|
|
13
13
|
getUser: ({ userId, }: {
|
|
14
14
|
userId: string;
|
|
15
|
-
}) => Promise<Users.User>;
|
|
15
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<Users.User>;
|
|
16
16
|
getUserConnections: ({ userId, }: {
|
|
17
17
|
userId: string;
|
|
18
|
-
}) => Promise<import("./request").ApiResponse<import("./schema/connection").UserConnection[]>>;
|
|
18
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<import("./schema/connection").UserConnection[]>>;
|
|
19
19
|
deleteUserConnection: ({ userId, connectionId, }: {
|
|
20
20
|
userId: string;
|
|
21
21
|
connectionId: string;
|
|
22
|
-
}) => Promise<number>;
|
|
22
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
23
23
|
deleteUser: ({ userId, }: {
|
|
24
24
|
userId: string;
|
|
25
|
-
}) => Promise<number>;
|
|
25
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
26
26
|
getConnectionSyncs: ({ userId, connectionId, params, }: {
|
|
27
27
|
userId: string;
|
|
28
28
|
connectionId: string;
|
|
29
29
|
params?: import("./request").SearchParams | undefined;
|
|
30
|
-
}) => Promise<import("./request").ApiResponse<Syncs.ConnectionSync[]>>;
|
|
30
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Syncs.ConnectionSync[]>>;
|
|
31
31
|
getUserSyncs: ({ userId, params, }: {
|
|
32
32
|
userId: string;
|
|
33
33
|
params?: import("./request").SearchParams | undefined;
|
|
34
|
-
}) => Promise<import("./request").ApiResponse<Syncs.ConnectionSync[]>>;
|
|
34
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Syncs.ConnectionSync[]>>;
|
|
35
35
|
getSync: ({ userId, syncId, }: {
|
|
36
36
|
userId: string;
|
|
37
37
|
syncId: string;
|
|
38
|
-
}) => Promise<import("./request").ApiResponse<Syncs.ConnectionSync>>;
|
|
38
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Syncs.ConnectionSync>>;
|
|
39
39
|
updateUserConnection: ({ userId, connectionId, expiresAt, }: {
|
|
40
40
|
userId: string;
|
|
41
41
|
connectionId: string;
|
|
42
42
|
expiresAt: string;
|
|
43
|
-
}) => Promise<number>;
|
|
43
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
44
44
|
getGlobalCounterparties: (params?: Counterparties.GlobalCounterpartiesSearchParams | undefined) => Promise<import("./request").ApiResponse<Counterparties.GlobalCounterparty[]>>;
|
|
45
45
|
listConnections: (query?: {
|
|
46
46
|
clientId?: string | undefined;
|
|
@@ -59,93 +59,93 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
59
59
|
} | undefined) => Promise<import("./schema/connection").WellKnownConnection[]>;
|
|
60
60
|
getOpenIdConfig: () => Promise<unknown>;
|
|
61
61
|
getTransactions: ({ userId, params, }: {
|
|
62
|
-
userId
|
|
62
|
+
userId?: string | undefined;
|
|
63
63
|
params?: Transactions.TransactionSearchParams | undefined;
|
|
64
|
-
}) => Promise<import("./request").ApiResponse<Transactions.Transaction[]>>;
|
|
64
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.Transaction[]>>;
|
|
65
65
|
getTransaction: ({ userId, transactionId, }: {
|
|
66
|
-
userId
|
|
66
|
+
userId?: string | undefined;
|
|
67
67
|
transactionId: string;
|
|
68
|
-
}) => Promise<import("./request").ApiResponse<Transactions.Transaction>>;
|
|
68
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.Transaction>>;
|
|
69
69
|
addTransaction: ({ userId, transaction, }: {
|
|
70
70
|
userId: string;
|
|
71
71
|
transaction: Transactions.TransactionPost;
|
|
72
|
-
}) => Promise<import("./request").ApiResponse<Transactions.Transaction>>;
|
|
72
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.Transaction>>;
|
|
73
73
|
addTransactions: ({ userId, transactions, params, }: {
|
|
74
74
|
userId: string;
|
|
75
75
|
transactions: Transactions.TransactionPost[];
|
|
76
76
|
params?: {
|
|
77
77
|
categorise?: boolean | undefined;
|
|
78
78
|
} | undefined;
|
|
79
|
-
}) => Promise<import("./request").ApiResponse<{
|
|
79
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<{
|
|
80
80
|
id: string;
|
|
81
81
|
}[]>>;
|
|
82
82
|
updateTransaction: ({ userId, transactionId, transaction, }: {
|
|
83
83
|
userId: string;
|
|
84
84
|
transactionId: string;
|
|
85
85
|
transaction: Partial<Transactions.TransactionPost>;
|
|
86
|
-
}) => Promise<import("./request").ApiResponse<Transactions.Transaction>>;
|
|
86
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.Transaction>>;
|
|
87
87
|
deleteTransaction: ({ userId, transactionId, }: {
|
|
88
88
|
userId: string;
|
|
89
89
|
transactionId: string;
|
|
90
|
-
}) => Promise<import("./request").ApiResponse<number>>;
|
|
90
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<number>>;
|
|
91
91
|
splitTransaction: ({ userId, transactionId, splits, }: {
|
|
92
92
|
userId: string;
|
|
93
93
|
transactionId: string;
|
|
94
94
|
splits: Transactions.TransactionSplitPost[];
|
|
95
|
-
}) => Promise<import("./request").ApiResponse<Transactions.TransactionSplit[]>>;
|
|
95
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.TransactionSplit[]>>;
|
|
96
96
|
getTransactionSplits: ({ userId, transactionId, }: {
|
|
97
|
-
userId
|
|
97
|
+
userId?: string | undefined;
|
|
98
98
|
transactionId: string;
|
|
99
|
-
}) => Promise<import("./request").ApiResponse<Transactions.TransactionSplit[]>>;
|
|
99
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.TransactionSplit[]>>;
|
|
100
100
|
patchTransactionSplit: ({ userId, transactionId, splitId, split, }: {
|
|
101
101
|
userId: string;
|
|
102
102
|
transactionId: string;
|
|
103
103
|
splitId: string;
|
|
104
104
|
split: Transactions.TransactionSplitPatch;
|
|
105
|
-
}) => Promise<import("./request").ApiResponse<Transactions.TransactionSplit[]>>;
|
|
105
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.TransactionSplit[]>>;
|
|
106
106
|
deleteTransactionSplits: ({ userId, transactionId, }: {
|
|
107
107
|
userId: string;
|
|
108
108
|
transactionId: string;
|
|
109
|
-
}) => Promise<number>;
|
|
109
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
110
110
|
addFileToTransaction: ({ userId, transactionId, fileData, fileName, }: {
|
|
111
|
-
userId
|
|
111
|
+
userId?: string | undefined;
|
|
112
112
|
transactionId: string;
|
|
113
113
|
fileName: string;
|
|
114
114
|
fileData: any;
|
|
115
|
-
}) => Promise<import("./request").ApiResponse<Transactions.TransactionFile>>;
|
|
115
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.TransactionFile>>;
|
|
116
116
|
getTransactionFiles: ({ userId, transactionId, }: {
|
|
117
|
-
userId
|
|
117
|
+
userId?: string | undefined;
|
|
118
118
|
transactionId: string;
|
|
119
|
-
}) => Promise<import("./request").ApiResponse<Transactions.TransactionFile[]>>;
|
|
119
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.TransactionFile[]>>;
|
|
120
120
|
getTransactionFile: ({ userId, transactionId, fileId, }: {
|
|
121
|
-
userId
|
|
121
|
+
userId?: string | undefined;
|
|
122
122
|
transactionId: string;
|
|
123
123
|
fileId: string;
|
|
124
|
-
}) => Promise<import("./request").ApiResponse<Transactions.TransactionFile>>;
|
|
124
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.TransactionFile>>;
|
|
125
125
|
deleteTransactionFile: ({ userId, transactionId, fileId, }: {
|
|
126
|
-
userId
|
|
126
|
+
userId?: string | undefined;
|
|
127
127
|
transactionId: string;
|
|
128
128
|
fileId: string;
|
|
129
|
-
}) => Promise<number>;
|
|
129
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
130
130
|
getTaxReturn: ({ userId, params, }: {
|
|
131
|
-
userId
|
|
131
|
+
userId?: string | undefined;
|
|
132
132
|
params?: Taxes.TaxSearchParams | undefined;
|
|
133
|
-
}) => Promise<import("./request").ApiResponse<Taxes.Tax>>;
|
|
133
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Taxes.Tax>>;
|
|
134
134
|
syncUserConnection: ({ userId, connectionId, customerIpAddress, customerLastLoggedTime, }: {
|
|
135
|
-
userId
|
|
135
|
+
userId?: string | undefined;
|
|
136
136
|
connectionId: string;
|
|
137
137
|
customerIpAddress?: string | undefined;
|
|
138
138
|
customerLastLoggedTime?: string | undefined;
|
|
139
|
-
}) => Promise<import("./request").ApiResponse<Syncs.SyncResponse>>;
|
|
139
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Syncs.SyncResponse>>;
|
|
140
140
|
getStandingOrder: ({ id }: {
|
|
141
141
|
id: string;
|
|
142
|
-
}) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrderRequest>>;
|
|
143
|
-
getStandingOrders: (params?: StandingOrders.StandingOrderSearchParams | undefined) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrderRequest[]>>;
|
|
144
|
-
getSpendingGoals: (params: import("./request").SearchParams, userId: string) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal[]>>;
|
|
142
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrderRequest>>;
|
|
143
|
+
getStandingOrders: (params?: StandingOrders.StandingOrderSearchParams | undefined, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrderRequest[]>>;
|
|
144
|
+
getSpendingGoals: (params: import("./request").SearchParams, userId: string, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal[]>>;
|
|
145
145
|
getSpendingGoal: ({ goalId, userId, }: {
|
|
146
146
|
goalId: string;
|
|
147
147
|
userId: string;
|
|
148
|
-
}) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal>>;
|
|
148
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal>>;
|
|
149
149
|
createSpendingGoal: ({ categoryId, periodType, periodStart, amount, userId, }: {
|
|
150
150
|
categoryId: string;
|
|
151
151
|
periodType?: ("monthly" | "annual") | undefined;
|
|
@@ -154,7 +154,7 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
154
154
|
value: number;
|
|
155
155
|
};
|
|
156
156
|
userId: string;
|
|
157
|
-
}) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal>>;
|
|
157
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal>>;
|
|
158
158
|
updateSpendingGoal: ({ goalId, categoryId, amount, userId, }: {
|
|
159
159
|
goalId: string;
|
|
160
160
|
categoryId?: string | undefined;
|
|
@@ -162,13 +162,13 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
162
162
|
value: number;
|
|
163
163
|
} | undefined;
|
|
164
164
|
userId: string;
|
|
165
|
-
}) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal>>;
|
|
165
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SpendingGoals.SpendingGoal>>;
|
|
166
166
|
deleteSpendingGoal: ({ goalId, userId, }: {
|
|
167
167
|
goalId: string;
|
|
168
168
|
userId: string;
|
|
169
|
-
}) => Promise<number>;
|
|
169
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
170
170
|
getSpendingAnalysis: ({ userId, dates, accountIds, categoryIds, projectIds, }: {
|
|
171
|
-
userId
|
|
171
|
+
userId?: string | undefined;
|
|
172
172
|
dates: {
|
|
173
173
|
name: string;
|
|
174
174
|
from: string;
|
|
@@ -177,12 +177,12 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
177
177
|
accountIds?: string[] | undefined;
|
|
178
178
|
categoryIds?: string[] | undefined;
|
|
179
179
|
projectIds?: string[] | undefined;
|
|
180
|
-
}) => Promise<import("./request").ApiResponse<SpendingAnalysis.SpendingAnalysis>>;
|
|
181
|
-
getSavingsGoals: (params: import("./request").SearchParams, userId: string) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal[]>>;
|
|
180
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SpendingAnalysis.SpendingAnalysis>>;
|
|
181
|
+
getSavingsGoals: (params: import("./request").SearchParams, userId: string, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal[]>>;
|
|
182
182
|
getSavingsGoal: ({ goalId, userId, }: {
|
|
183
183
|
goalId: string;
|
|
184
184
|
userId: string;
|
|
185
|
-
}) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal>>;
|
|
185
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal>>;
|
|
186
186
|
createSavingsGoal: ({ name, imageUrl, notes, accounts, amount, userId, }: {
|
|
187
187
|
name: string;
|
|
188
188
|
imageUrl?: string | undefined;
|
|
@@ -195,7 +195,7 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
195
195
|
currency?: string | undefined;
|
|
196
196
|
};
|
|
197
197
|
userId: string;
|
|
198
|
-
}) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal>>;
|
|
198
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal>>;
|
|
199
199
|
updateSavingsGoal: ({ goalId, name, amount, imageUrl, notes, accounts, userId, }: {
|
|
200
200
|
goalId: string;
|
|
201
201
|
name?: string | undefined;
|
|
@@ -208,125 +208,125 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
208
208
|
value: number;
|
|
209
209
|
} | undefined;
|
|
210
210
|
userId: string;
|
|
211
|
-
}) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal>>;
|
|
211
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<SavingsGoals.SavingsGoal>>;
|
|
212
212
|
deleteSavingsGoal: ({ goalId, userId, }: {
|
|
213
213
|
goalId: string;
|
|
214
214
|
userId: string;
|
|
215
|
-
}) => Promise<number>;
|
|
215
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
216
216
|
getRentalRecords: ({ userId, }: {
|
|
217
217
|
userId: string;
|
|
218
|
-
}) => Promise<import("./request").ApiResponse<RentalRecords.RentalRecord[]>>;
|
|
218
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<RentalRecords.RentalRecord[]>>;
|
|
219
219
|
createRentalRecord: ({ userId, rentalData, }: {
|
|
220
220
|
userId: string;
|
|
221
221
|
rentalData: RentalRecords.RentalRecordPost;
|
|
222
|
-
}) => Promise<import("./request").ApiResponse<RentalRecords.RentalRecord>>;
|
|
222
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<RentalRecords.RentalRecord>>;
|
|
223
223
|
deleteRentalRecord: ({ userId, rentalId, }: {
|
|
224
224
|
userId: string;
|
|
225
225
|
rentalId: string;
|
|
226
|
-
}) => Promise<number>;
|
|
226
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
227
227
|
getRegularTransactions: ({ userId, params, }: {
|
|
228
|
-
userId
|
|
228
|
+
userId?: string | undefined;
|
|
229
229
|
params?: RegularTransactions.RegularTransactionSearchParams | undefined;
|
|
230
|
-
}) => Promise<import("./request").ApiResponse<RegularTransactions.RegularTransaction[]>>;
|
|
231
|
-
getRecurringPayments: (params?: Payments.RecurringPaymentSearchParams | undefined) => Promise<import("./request").ApiResponse<Payments.RecurringPaymentRequest[]>>;
|
|
230
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<RegularTransactions.RegularTransaction[]>>;
|
|
231
|
+
getRecurringPayments: (params?: Payments.RecurringPaymentSearchParams | undefined, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payments.RecurringPaymentRequest[]>>;
|
|
232
232
|
getRecurringPayment: ({ recurringPaymentId, }: {
|
|
233
233
|
recurringPaymentId: string;
|
|
234
|
-
}) => Promise<import("./request").ApiResponse<Payments.RecurringPaymentRequest>>;
|
|
234
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payments.RecurringPaymentRequest>>;
|
|
235
235
|
makeRecurringPayment: ({ recurringPaymentId, payment, }: {
|
|
236
236
|
recurringPaymentId: string;
|
|
237
237
|
payment: Payments.PaymentsClaims;
|
|
238
|
-
}) => Promise<import("./request").ApiResponse<Payments.RecurringPaymentRequest>>;
|
|
238
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payments.RecurringPaymentRequest>>;
|
|
239
239
|
revokeRecurringPayment: ({ recurringPaymentId, }: {
|
|
240
240
|
recurringPaymentId: string;
|
|
241
|
-
}) => Promise<number>;
|
|
241
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
242
242
|
getProjects: ({ userId, params, }: {
|
|
243
243
|
userId: string;
|
|
244
244
|
params?: import("./request").SearchParams | undefined;
|
|
245
|
-
}) => Promise<import("./request").ApiResponse<Projects.Project[]>>;
|
|
245
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Projects.Project[]>>;
|
|
246
246
|
getProject: ({ userId, projectId, }: {
|
|
247
247
|
userId: string;
|
|
248
248
|
projectId: string;
|
|
249
|
-
}) => Promise<import("./request").ApiResponse<Projects.Project>>;
|
|
249
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Projects.Project>>;
|
|
250
250
|
addProject: ({ userId, project, }: {
|
|
251
251
|
userId: string;
|
|
252
252
|
project: Projects.ProjectPost;
|
|
253
|
-
}) => Promise<import("./request").ApiResponse<Projects.Project>>;
|
|
253
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Projects.Project>>;
|
|
254
254
|
updateProject: ({ userId, projectId, project, }: {
|
|
255
255
|
userId: string;
|
|
256
256
|
projectId: string;
|
|
257
257
|
project: Projects.ProjectPatch;
|
|
258
|
-
}) => Promise<import("./request").ApiResponse<Projects.Project>>;
|
|
258
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Projects.Project>>;
|
|
259
259
|
deleteProject: ({ userId, projectId, }: {
|
|
260
260
|
userId: string;
|
|
261
261
|
projectId: string;
|
|
262
|
-
}) => Promise<number>;
|
|
262
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
263
263
|
getPayment: ({ id }: {
|
|
264
264
|
id: string;
|
|
265
|
-
}) => Promise<import("./request").ApiResponse<Payments.Payment>>;
|
|
266
|
-
getPayments: (params?: Payments.PaymentSearchParams | undefined) => Promise<import("./request").ApiResponse<Payments.Payment[]>>;
|
|
265
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payments.Payment>>;
|
|
266
|
+
getPayments: (params?: Payments.PaymentSearchParams | undefined, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payments.Payment[]>>;
|
|
267
267
|
getPaymentFromIDToken: ({ idToken }: {
|
|
268
268
|
idToken: string;
|
|
269
|
-
}) => Promise<import("./request").ApiResponse<Payments.Payment>>;
|
|
269
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payments.Payment>>;
|
|
270
270
|
addPayee: ({ accountNumber, sortCode, name, externalId, userId, }: {
|
|
271
271
|
accountNumber: string;
|
|
272
272
|
sortCode: string;
|
|
273
273
|
name: string;
|
|
274
274
|
externalId?: string | undefined;
|
|
275
275
|
userId?: string | undefined;
|
|
276
|
-
}) => Promise<import("./request").ApiResponse<Payees.Payee>>;
|
|
277
|
-
getPayees: (params?: Payees.PayeesSearchParams | undefined) => Promise<import("./request").ApiResponse<Payees.Payee[]>>;
|
|
276
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payees.Payee>>;
|
|
277
|
+
getPayees: (params?: Payees.PayeesSearchParams | undefined, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payees.Payee[]>>;
|
|
278
278
|
getPayee: ({ id }: {
|
|
279
279
|
id: string;
|
|
280
|
-
}) => Promise<import("./request").ApiResponse<Payees.Payee>>;
|
|
280
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Payees.Payee>>;
|
|
281
281
|
getCategories: ({ userId, params, }: {
|
|
282
|
-
userId
|
|
282
|
+
userId?: string | undefined;
|
|
283
283
|
params?: (import("./request").SearchParams & {
|
|
284
284
|
type?: Categories.CategoryType | undefined;
|
|
285
285
|
}) | undefined;
|
|
286
|
-
}) => Promise<import("./request").ApiResponse<Categories.Category[]>>;
|
|
286
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Categories.Category[]>>;
|
|
287
287
|
getStandardCategories: ({ params, }: {
|
|
288
288
|
params?: (import("./request").SearchParams & {
|
|
289
289
|
type?: Categories.CategoryType | undefined;
|
|
290
290
|
}) | undefined;
|
|
291
|
-
}) => Promise<import("./request").ApiResponse<Categories.Category[]>>;
|
|
291
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Categories.Category[]>>;
|
|
292
292
|
getCategory: ({ userId, categoryId, params, }: {
|
|
293
|
-
userId
|
|
293
|
+
userId?: string | undefined;
|
|
294
294
|
categoryId: string;
|
|
295
295
|
params?: {
|
|
296
296
|
type?: Categories.CategoryType | undefined;
|
|
297
297
|
} | undefined;
|
|
298
|
-
}) => Promise<import("./request").ApiResponse<Categories.Category>>;
|
|
298
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Categories.Category>>;
|
|
299
299
|
getCategoryGroups: ({ userId, params, }: {
|
|
300
|
-
userId
|
|
300
|
+
userId?: string | undefined;
|
|
301
301
|
params?: {
|
|
302
302
|
type?: Categories.CategoryType | undefined;
|
|
303
303
|
} | undefined;
|
|
304
|
-
}) => Promise<import("./request").ApiResponse<Categories.CategoryGroup[]>>;
|
|
304
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Categories.CategoryGroup[]>>;
|
|
305
305
|
getStandardCategoryGroups: ({ params, }: {
|
|
306
306
|
params?: {
|
|
307
307
|
type?: Categories.CategoryType | undefined;
|
|
308
308
|
} | undefined;
|
|
309
|
-
}) => Promise<import("./request").ApiResponse<Categories.CategoryGroup[]>>;
|
|
309
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Categories.CategoryGroup[]>>;
|
|
310
310
|
createCustomCategory: ({ userId, category, }: {
|
|
311
|
-
userId
|
|
311
|
+
userId?: string | undefined;
|
|
312
312
|
category: Categories.CategoryPost;
|
|
313
|
-
}) => Promise<import("./request").ApiResponse<Categories.Category>>;
|
|
313
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Categories.Category>>;
|
|
314
314
|
getBeneficiary: ({ id, userId, }: {
|
|
315
315
|
id: string;
|
|
316
|
-
userId
|
|
317
|
-
}) => Promise<import("./request").ApiResponse<Beneficiaries.Beneficiary>>;
|
|
316
|
+
userId?: string | undefined;
|
|
317
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Beneficiaries.Beneficiary>>;
|
|
318
318
|
getBeneficiaryWithDetail: ({ id, userId, }: {
|
|
319
319
|
id: string;
|
|
320
|
-
userId
|
|
321
|
-
}) => Promise<import("./request").ApiResponse<Beneficiaries.BeneficiaryWithDetails>>;
|
|
320
|
+
userId?: string | undefined;
|
|
321
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Beneficiaries.BeneficiaryWithDetails>>;
|
|
322
322
|
getBeneficiaries: ({ params, userId, }: {
|
|
323
323
|
params?: import("./request").SearchParams | undefined;
|
|
324
|
-
userId
|
|
325
|
-
}) => Promise<import("./request").ApiResponse<Beneficiaries.Beneficiary[]>>;
|
|
324
|
+
userId?: string | undefined;
|
|
325
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Beneficiaries.Beneficiary[]>>;
|
|
326
326
|
getBeneficiariesWithDetail: ({ params, userId, }: {
|
|
327
327
|
params?: import("./request").SearchParams | undefined;
|
|
328
|
-
userId
|
|
329
|
-
}) => Promise<import("./request").ApiResponse<Beneficiaries.BeneficiaryWithDetails[]>>;
|
|
328
|
+
userId?: string | undefined;
|
|
329
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Beneficiaries.BeneficiaryWithDetails[]>>;
|
|
330
330
|
createAuthRequest: ({ redirectUri, userId, scope, connectionId, payment, standingOrder, recurringPayment, reversePayment, categorisationType, benefitsCheck, counterpartiesCheck, permissions, expirationDateTime, transactionsFromDateTime, sync, }: {
|
|
331
331
|
redirectUri?: string | undefined;
|
|
332
332
|
userId?: string | undefined;
|
|
@@ -345,101 +345,101 @@ declare const _Moneyhub: (apiClientConfig: ApiClientConfig) => Promise<{
|
|
|
345
345
|
sync?: {
|
|
346
346
|
enableAsync?: boolean | undefined;
|
|
347
347
|
} | undefined;
|
|
348
|
-
}) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest>>;
|
|
348
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest>>;
|
|
349
349
|
completeAuthRequest: ({ id, authParams, }: {
|
|
350
350
|
id: string;
|
|
351
351
|
authParams: AuthRequests.AuthParams;
|
|
352
|
-
}) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest>>;
|
|
353
|
-
getAllAuthRequests: (params?: import("./request").SearchParams | undefined) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest[]>>;
|
|
352
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest>>;
|
|
353
|
+
getAllAuthRequests: (params?: import("./request").SearchParams | undefined, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest[]>>;
|
|
354
354
|
getAuthRequest: ({ id }: {
|
|
355
355
|
id: string;
|
|
356
|
-
}) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest>>;
|
|
356
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<AuthRequests.AuthRequest>>;
|
|
357
357
|
createAffordability: ({ userId }: {
|
|
358
358
|
userId: string;
|
|
359
|
-
}) => Promise<import("./request").ApiResponse<Affordability.Affordability>>;
|
|
359
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Affordability.Affordability>>;
|
|
360
360
|
getAffordability: ({ userId, id }: {
|
|
361
361
|
userId: string;
|
|
362
362
|
id: string;
|
|
363
|
-
}) => Promise<import("./request").ApiResponse<Affordability.Affordability>>;
|
|
363
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Affordability.Affordability>>;
|
|
364
364
|
getAllAffordability: ({ userId, ...query }: {
|
|
365
365
|
userId: string;
|
|
366
|
-
} & import("./request").SearchParams) => Promise<import("./request").ApiResponse<Affordability.AffordabilityMetadata[]>>;
|
|
367
|
-
getAccounts: ({ userId }: {
|
|
368
|
-
userId
|
|
366
|
+
} & import("./request").SearchParams, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Affordability.AffordabilityMetadata[]>>;
|
|
367
|
+
getAccounts: ({ userId, params }: {
|
|
368
|
+
userId?: string | undefined;
|
|
369
369
|
params?: import("./request").SearchParams | undefined;
|
|
370
|
-
}) => Promise<import("./request").ApiResponse<Accounts.Account[]>>;
|
|
370
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.Account[]>>;
|
|
371
371
|
getAccountsWithDetails: ({ userId, }: {
|
|
372
|
-
userId
|
|
372
|
+
userId?: string | undefined;
|
|
373
373
|
params?: import("./request").SearchParams | undefined;
|
|
374
|
-
}) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails[]>>;
|
|
375
|
-
getAccountsList: ({ userId }: {
|
|
376
|
-
userId
|
|
374
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails[]>>;
|
|
375
|
+
getAccountsList: ({ userId, params }: {
|
|
376
|
+
userId?: string | undefined;
|
|
377
377
|
params?: import("./request").SearchParams | undefined;
|
|
378
|
-
}) => Promise<import("./request").ApiResponse<Accounts.Account[]>>;
|
|
378
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.Account[]>>;
|
|
379
379
|
getAccountsListWithDetails: ({ userId, }: {
|
|
380
|
-
userId
|
|
380
|
+
userId?: string | undefined;
|
|
381
381
|
params?: import("./request").SearchParams | undefined;
|
|
382
|
-
}) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails[]>>;
|
|
382
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails[]>>;
|
|
383
383
|
getAccount: ({ userId, accountId }: {
|
|
384
|
-
userId
|
|
384
|
+
userId?: string | undefined;
|
|
385
385
|
accountId: string;
|
|
386
|
-
}) => Promise<import("./request").ApiResponse<Accounts.Account>>;
|
|
386
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.Account>>;
|
|
387
387
|
getAccountBalances: ({ userId, accountId, }: {
|
|
388
|
-
userId
|
|
388
|
+
userId?: string | undefined;
|
|
389
389
|
accountId: string;
|
|
390
|
-
}) => Promise<import("./request").ApiResponse<Balances.Balance[]>>;
|
|
390
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Balances.Balance[]>>;
|
|
391
391
|
getAccountWithDetails: ({ userId, accountId, }: {
|
|
392
|
-
userId
|
|
392
|
+
userId?: string | undefined;
|
|
393
393
|
accountId: string;
|
|
394
|
-
}) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails>>;
|
|
394
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails>>;
|
|
395
395
|
getAccountHoldings: ({ userId, accountId, }: {
|
|
396
|
-
userId
|
|
396
|
+
userId?: string | undefined;
|
|
397
397
|
accountId: string;
|
|
398
|
-
}) => Promise<import("./request").ApiResponse<Holdings.HoldingsValuation[]>>;
|
|
398
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Holdings.HoldingsValuation[]>>;
|
|
399
399
|
getAccountHoldingsWithMatches: ({ userId, accountId, }: {
|
|
400
|
-
userId
|
|
400
|
+
userId?: string | undefined;
|
|
401
401
|
accountId: string;
|
|
402
|
-
}) => Promise<import("./request").ApiResponse<Holdings.HoldingWithMatches[]>>;
|
|
402
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Holdings.HoldingWithMatches[]>>;
|
|
403
403
|
getAccountCounterparties: ({ userId, accountId, }: {
|
|
404
|
-
userId
|
|
404
|
+
userId?: string | undefined;
|
|
405
405
|
accountId: string;
|
|
406
406
|
params?: import("./request").SearchParams | undefined;
|
|
407
|
-
}) => Promise<import("./request").ApiResponse<Counterparties.Counterparty[]>>;
|
|
407
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Counterparties.Counterparty[]>>;
|
|
408
408
|
getAccountRecurringTransactions: ({ userId, accountId, }: {
|
|
409
|
-
userId
|
|
409
|
+
userId?: string | undefined;
|
|
410
410
|
accountId: string;
|
|
411
|
-
}) => Promise<import("./request").ApiResponse<Transactions.RecurringTransactionEstimate[]>>;
|
|
411
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Transactions.RecurringTransactionEstimate[]>>;
|
|
412
412
|
getAccountStandingOrders: ({ userId, accountId, }: {
|
|
413
|
-
userId
|
|
413
|
+
userId?: string | undefined;
|
|
414
414
|
accountId: string;
|
|
415
|
-
}) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrder[]>>;
|
|
415
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrder[]>>;
|
|
416
416
|
createAccount: ({ userId, account }: {
|
|
417
417
|
userId: string;
|
|
418
418
|
account: Accounts.AccountPost;
|
|
419
|
-
}) => Promise<import("./request").ApiResponse<Accounts.Account>>;
|
|
419
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.Account>>;
|
|
420
420
|
deleteAccount: ({ userId, accountId }: {
|
|
421
421
|
userId: string;
|
|
422
422
|
accountId: string;
|
|
423
|
-
}) => Promise<number>;
|
|
423
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<number>;
|
|
424
424
|
getAccountHolding: ({ userId, accountId, holdingId, }: {
|
|
425
|
-
userId
|
|
425
|
+
userId?: string | undefined;
|
|
426
426
|
accountId: string;
|
|
427
427
|
holdingId: string;
|
|
428
|
-
}) => Promise<import("./request").ApiResponse<Holdings.HoldingWithMatchesAndHistory>>;
|
|
428
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Holdings.HoldingWithMatchesAndHistory>>;
|
|
429
429
|
getAccountStandingOrdersWithDetail: ({ userId, accountId, }: {
|
|
430
|
-
userId
|
|
430
|
+
userId?: string | undefined;
|
|
431
431
|
accountId: string;
|
|
432
|
-
}) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrderWithDetail[]>>;
|
|
432
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<StandingOrders.StandingOrderWithDetail[]>>;
|
|
433
433
|
addAccountBalance: ({ userId, accountId, balance }: {
|
|
434
434
|
userId: string;
|
|
435
435
|
accountId: string;
|
|
436
436
|
balance: Accounts.AccountBalancePost;
|
|
437
|
-
}) => Promise<import("./request").ApiResponse<Accounts.AccountBalancePost>>;
|
|
437
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.AccountBalancePost>>;
|
|
438
438
|
updateAccount: ({ userId, accountId, account }: {
|
|
439
439
|
userId: string;
|
|
440
440
|
accountId: string;
|
|
441
441
|
account: Accounts.AccountPatch;
|
|
442
|
-
}) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails>>;
|
|
442
|
+
}, options?: import("./request").ExtraOptions | undefined) => Promise<import("./request").ApiResponse<Accounts.AccountWithDetails>>;
|
|
443
443
|
exchangeCodeForTokensLegacy: ({ state, code, nonce, id_token, }: {
|
|
444
444
|
state: string;
|
|
445
445
|
code: string;
|
package/dist/request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Options } from "got";
|
|
1
|
+
import { Options, Headers } from "got";
|
|
2
2
|
import { Client } from "openid-client";
|
|
3
3
|
import type { ApiClientConfig } from "./schema/config";
|
|
4
4
|
interface RequestOptions extends Pick<Options, "method" | "headers" | "searchParams" | "json" | "form"> {
|
|
@@ -10,6 +10,7 @@ interface RequestOptions extends Pick<Options, "method" | "headers" | "searchPar
|
|
|
10
10
|
scope: string;
|
|
11
11
|
sub?: string;
|
|
12
12
|
};
|
|
13
|
+
options?: ExtraOptions;
|
|
13
14
|
}
|
|
14
15
|
interface Links {
|
|
15
16
|
next?: string;
|
|
@@ -33,6 +34,10 @@ export interface ApiResponse<T> {
|
|
|
33
34
|
links?: Links;
|
|
34
35
|
meta?: object;
|
|
35
36
|
}
|
|
37
|
+
export interface ExtraOptions {
|
|
38
|
+
token?: string;
|
|
39
|
+
headers?: Headers;
|
|
40
|
+
}
|
|
36
41
|
declare const _default: ({ client, options: { timeout }, }: {
|
|
37
42
|
client: Client;
|
|
38
43
|
options: {
|
package/dist/request.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAY,EAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,OAAY,EAAC,OAAO,EAAE,OAAO,EAA4B,MAAM,KAAK,CAAA;AACpE,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAA;AAIpC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAA;AAEpD,UAAU,cAAe,SAAQ,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;IACrG,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,EAAE,CAAC,EAAE;QACH,KAAK,EAAE,MAAM,CAAA;QACb,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAA;IACD,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB;AAED,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,oBAAY,OAAO,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AAE3E,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAA;IACP,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;;YA8BS,MAAM;;;;eAMT,MAAM,SACL,cAAc;AAXtB,wBAyDC"}
|
package/dist/request.js
CHANGED
|
@@ -48,19 +48,26 @@ const attachErrorDetails = (err) => {
|
|
|
48
48
|
throw err;
|
|
49
49
|
};
|
|
50
50
|
exports.default = ({ client, options: { timeout }, }) => async (url, opts = {}) => {
|
|
51
|
+
var _a, _b, _c;
|
|
51
52
|
const gotOpts = {
|
|
52
53
|
method: opts.method || "GET",
|
|
53
54
|
headers: opts.headers || {},
|
|
54
55
|
searchParams: query_string_1.default.stringify(opts.searchParams),
|
|
55
56
|
timeout,
|
|
56
57
|
};
|
|
57
|
-
if (opts.
|
|
58
|
+
if ((_a = opts.options) === null || _a === void 0 ? void 0 : _a.token) {
|
|
59
|
+
gotOpts.headers = R.assoc("Authorization", `Bearer ${opts.options.token}`, gotOpts.headers);
|
|
60
|
+
}
|
|
61
|
+
if ((_b = opts.options) === null || _b === void 0 ? void 0 : _b.headers) {
|
|
62
|
+
gotOpts.headers = R.mergeDeepRight(gotOpts.headers || {}, opts.options.headers);
|
|
63
|
+
}
|
|
64
|
+
if (!((_c = gotOpts.headers) === null || _c === void 0 ? void 0 : _c.Authorization) && opts.cc) {
|
|
58
65
|
const { access_token } = await client.grant({
|
|
59
66
|
grant_type: "client_credentials",
|
|
60
67
|
scope: opts.cc.scope,
|
|
61
68
|
sub: opts.cc.sub,
|
|
62
69
|
});
|
|
63
|
-
gotOpts.headers.Authorization
|
|
70
|
+
gotOpts.headers = R.assoc("Authorization", `Bearer ${access_token}`, gotOpts.headers);
|
|
64
71
|
}
|
|
65
72
|
if (opts.body) {
|
|
66
73
|
gotOpts.json = opts.body;
|