@naturalpay/sdk 0.2.1 → 0.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 +42 -0
- package/README.md +2 -2
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +37 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +37 -13
- package/client.d.ts.map +1 -1
- package/client.js +30 -6
- package/client.js.map +1 -1
- package/client.mjs +31 -7
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts.map +1 -1
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/index.d.mts +2 -2
- package/internal/qs/index.d.mts.map +1 -1
- package/internal/qs/index.d.ts +2 -2
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/index.mjs.map +1 -1
- package/internal/qs/stringify.d.mts.map +1 -1
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/utils.d.mts.map +1 -1
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +4 -4
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +4 -4
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/lib/envelope.d.mts.map +1 -1
- package/lib/envelope.d.ts.map +1 -1
- package/lib/envelope.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/agents.d.mts +4 -153
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +4 -153
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +5 -5
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +5 -5
- package/resources/agents.mjs.map +1 -1
- package/resources/api-keys.d.mts +16 -2
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +16 -2
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +7 -4
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +7 -4
- package/resources/api-keys.mjs.map +1 -1
- package/resources/counterparties.d.mts +5 -55
- package/resources/counterparties.d.mts.map +1 -1
- package/resources/counterparties.d.ts +5 -55
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/counterparties.js +1 -3
- package/resources/counterparties.js.map +1 -1
- package/resources/counterparties.mjs +1 -3
- package/resources/counterparties.mjs.map +1 -1
- package/resources/customers.d.mts.map +1 -1
- package/resources/customers.d.ts.map +1 -1
- package/resources/customers.mjs.map +1 -1
- package/resources/delegations.d.mts.map +1 -1
- package/resources/delegations.d.ts.map +1 -1
- package/resources/delegations.mjs.map +1 -1
- package/resources/escalations.d.mts +1124 -0
- package/resources/escalations.d.mts.map +1 -0
- package/resources/escalations.d.ts +1124 -0
- package/resources/escalations.d.ts.map +1 -0
- package/resources/escalations.js +110 -0
- package/resources/escalations.js.map +1 -0
- package/resources/escalations.mjs +106 -0
- package/resources/escalations.mjs.map +1 -0
- package/resources/external-accounts.d.mts +239 -0
- package/resources/external-accounts.d.mts.map +1 -0
- package/resources/external-accounts.d.ts +239 -0
- package/resources/external-accounts.d.ts.map +1 -0
- package/resources/external-accounts.js +47 -0
- package/resources/external-accounts.js.map +1 -0
- package/resources/external-accounts.mjs +43 -0
- package/resources/external-accounts.mjs.map +1 -0
- package/resources/index.d.mts +8 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invitations.d.mts +17 -8
- package/resources/invitations.d.mts.map +1 -1
- package/resources/invitations.d.ts +17 -8
- package/resources/invitations.d.ts.map +1 -1
- package/resources/invitations.js +7 -5
- package/resources/invitations.js.map +1 -1
- package/resources/invitations.mjs +7 -5
- package/resources/invitations.mjs.map +1 -1
- package/resources/parties.d.mts +55 -28
- package/resources/parties.d.mts.map +1 -1
- package/resources/parties.d.ts +55 -28
- package/resources/parties.d.ts.map +1 -1
- package/resources/parties.js +30 -4
- package/resources/parties.js.map +1 -1
- package/resources/parties.mjs +30 -4
- package/resources/parties.mjs.map +1 -1
- package/resources/payment-requests.d.mts +751 -39
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +751 -39
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +82 -2
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +82 -2
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/payments.d.mts +390 -24
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +390 -24
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +53 -3
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +53 -3
- package/resources/payments.mjs.map +1 -1
- package/resources/transactions.d.mts +53 -113
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +53 -113
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +3 -3
- package/resources/transactions.mjs +3 -3
- package/resources/transactions.mjs.map +1 -1
- package/resources/transfers.d.mts +1030 -0
- package/resources/transfers.d.mts.map +1 -0
- package/resources/transfers.d.ts +1030 -0
- package/resources/transfers.d.ts.map +1 -0
- package/resources/transfers.js +114 -0
- package/resources/transfers.js.map +1 -0
- package/resources/transfers.mjs +110 -0
- package/resources/transfers.mjs.map +1 -0
- package/resources/wallet.d.mts +117 -437
- package/resources/wallet.d.mts.map +1 -1
- package/resources/wallet.d.ts +117 -437
- package/resources/wallet.d.ts.map +1 -1
- package/resources/wallet.js +9 -122
- package/resources/wallet.js.map +1 -1
- package/resources/wallet.mjs +9 -122
- package/resources/wallet.mjs.map +1 -1
- package/resources/webhooks.d.mts +775 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +775 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +163 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +159 -0
- package/resources/webhooks.mjs.map +1 -0
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +156 -32
- package/src/resources/agents.ts +5 -185
- package/src/resources/api-keys.ts +26 -4
- package/src/resources/counterparties.ts +5 -64
- package/src/resources/escalations.ts +1422 -0
- package/src/resources/external-accounts.ts +324 -0
- package/src/resources/index.ts +65 -13
- package/src/resources/invitations.ts +27 -11
- package/src/resources/parties.ts +88 -33
- package/src/resources/payment-requests.ts +945 -44
- package/src/resources/payments.ts +518 -23
- package/src/resources/transactions.ts +53 -129
- package/src/resources/transfers.ts +1338 -0
- package/src/resources/wallet.ts +133 -597
- package/src/resources/webhooks.ts +1232 -0
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Linked external bank accounts
|
|
11
|
+
*/
|
|
12
|
+
export class ExternalAccounts extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* List linked external accounts with cursor pagination.
|
|
15
|
+
*/
|
|
16
|
+
list(
|
|
17
|
+
params: ExternalAccountListParams | null | undefined = {},
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): APIPromise<ExternalAccountListResponse> {
|
|
20
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
21
|
+
return this._client.get('/external-accounts', {
|
|
22
|
+
query,
|
|
23
|
+
...options,
|
|
24
|
+
headers: buildHeaders([
|
|
25
|
+
{
|
|
26
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
27
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
28
|
+
},
|
|
29
|
+
options?.headers,
|
|
30
|
+
]),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Remove (unlink) a bank account.
|
|
36
|
+
*/
|
|
37
|
+
remove(
|
|
38
|
+
externalAccountID: string,
|
|
39
|
+
params: ExternalAccountRemoveParams | null | undefined = {},
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<ExternalAccountRemoveResponse> {
|
|
42
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
|
|
43
|
+
return this._client.delete(path`/external-accounts/${externalAccountID}`, {
|
|
44
|
+
...options,
|
|
45
|
+
headers: buildHeaders([
|
|
46
|
+
{
|
|
47
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
48
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
49
|
+
},
|
|
50
|
+
options?.headers,
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ExternalAccountListResponse {
|
|
57
|
+
data: Array<ExternalAccountListResponse.Data>;
|
|
58
|
+
|
|
59
|
+
meta: ExternalAccountListResponse.Meta;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export namespace ExternalAccountListResponse {
|
|
63
|
+
export interface Data {
|
|
64
|
+
/**
|
|
65
|
+
* Resource ID
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Resource attributes
|
|
71
|
+
*/
|
|
72
|
+
attributes: Data.Attributes;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Resource relationships
|
|
76
|
+
*/
|
|
77
|
+
relationships: Data.Relationships;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Resource type
|
|
81
|
+
*/
|
|
82
|
+
type: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export namespace Data {
|
|
86
|
+
/**
|
|
87
|
+
* Resource attributes
|
|
88
|
+
*/
|
|
89
|
+
export interface Attributes {
|
|
90
|
+
/**
|
|
91
|
+
* Account display name
|
|
92
|
+
*/
|
|
93
|
+
accountName: string | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Account type (checking, savings)
|
|
97
|
+
*/
|
|
98
|
+
accountType: 'checking' | 'savings' | 'unknown' | null;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Bank institution name
|
|
102
|
+
*/
|
|
103
|
+
bankName: string | null;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* When the external account was linked
|
|
107
|
+
*/
|
|
108
|
+
createdAt: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Last 4 digits of account
|
|
112
|
+
*/
|
|
113
|
+
lastFour: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Status (pending, active, disabled)
|
|
117
|
+
*/
|
|
118
|
+
status: 'pending' | 'new' | 'active' | 'disabled' | 'deleted' | 'unknown';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Resource relationships
|
|
123
|
+
*/
|
|
124
|
+
export interface Relationships {
|
|
125
|
+
/**
|
|
126
|
+
* Party that owns the external account
|
|
127
|
+
*/
|
|
128
|
+
party: Relationships.Party;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export namespace Relationships {
|
|
132
|
+
/**
|
|
133
|
+
* Party that owns the external account
|
|
134
|
+
*/
|
|
135
|
+
export interface Party {
|
|
136
|
+
/**
|
|
137
|
+
* Related resource identifier
|
|
138
|
+
*/
|
|
139
|
+
data: Party.Data;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export namespace Party {
|
|
143
|
+
/**
|
|
144
|
+
* Related resource identifier
|
|
145
|
+
*/
|
|
146
|
+
export interface Data {
|
|
147
|
+
id: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Resource type
|
|
151
|
+
*/
|
|
152
|
+
type: string;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface Meta {
|
|
159
|
+
pagination: Meta.Pagination;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export namespace Meta {
|
|
163
|
+
export interface Pagination {
|
|
164
|
+
hasMore: boolean;
|
|
165
|
+
|
|
166
|
+
nextCursor: string | null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface ExternalAccountRemoveResponse {
|
|
172
|
+
data: ExternalAccountRemoveResponse.Data;
|
|
173
|
+
|
|
174
|
+
meta: ExternalAccountRemoveResponse.Meta;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export namespace ExternalAccountRemoveResponse {
|
|
178
|
+
export interface Data {
|
|
179
|
+
/**
|
|
180
|
+
* Resource ID
|
|
181
|
+
*/
|
|
182
|
+
id: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Resource attributes
|
|
186
|
+
*/
|
|
187
|
+
attributes: Data.Attributes;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Resource relationships
|
|
191
|
+
*/
|
|
192
|
+
relationships: Data.Relationships;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Resource type
|
|
196
|
+
*/
|
|
197
|
+
type: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export namespace Data {
|
|
201
|
+
/**
|
|
202
|
+
* Resource attributes
|
|
203
|
+
*/
|
|
204
|
+
export interface Attributes {
|
|
205
|
+
/**
|
|
206
|
+
* Account display name
|
|
207
|
+
*/
|
|
208
|
+
accountName: string | null;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Account type (checking, savings)
|
|
212
|
+
*/
|
|
213
|
+
accountType: 'checking' | 'savings' | 'unknown' | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Bank institution name
|
|
217
|
+
*/
|
|
218
|
+
bankName: string | null;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* When the external account was linked
|
|
222
|
+
*/
|
|
223
|
+
createdAt: string;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Last 4 digits of account
|
|
227
|
+
*/
|
|
228
|
+
lastFour: string;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Status (pending, active, disabled)
|
|
232
|
+
*/
|
|
233
|
+
status: 'pending' | 'new' | 'active' | 'disabled' | 'deleted' | 'unknown';
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Resource relationships
|
|
238
|
+
*/
|
|
239
|
+
export interface Relationships {
|
|
240
|
+
/**
|
|
241
|
+
* Party that owns the external account
|
|
242
|
+
*/
|
|
243
|
+
party: Relationships.Party;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export namespace Relationships {
|
|
247
|
+
/**
|
|
248
|
+
* Party that owns the external account
|
|
249
|
+
*/
|
|
250
|
+
export interface Party {
|
|
251
|
+
/**
|
|
252
|
+
* Related resource identifier
|
|
253
|
+
*/
|
|
254
|
+
data: Party.Data;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export namespace Party {
|
|
258
|
+
/**
|
|
259
|
+
* Related resource identifier
|
|
260
|
+
*/
|
|
261
|
+
export interface Data {
|
|
262
|
+
id: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Resource type
|
|
266
|
+
*/
|
|
267
|
+
type: string;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface Meta {
|
|
274
|
+
/**
|
|
275
|
+
* Indicates the resource was deleted
|
|
276
|
+
*/
|
|
277
|
+
deleted: true;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface ExternalAccountListParams {
|
|
282
|
+
/**
|
|
283
|
+
* Query param
|
|
284
|
+
*/
|
|
285
|
+
cursor?: string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Query param
|
|
289
|
+
*/
|
|
290
|
+
limit?: number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
294
|
+
*/
|
|
295
|
+
'X-Agent-ID'?: string;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
299
|
+
* for agent observability.
|
|
300
|
+
*/
|
|
301
|
+
'X-Instance-ID'?: string;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface ExternalAccountRemoveParams {
|
|
305
|
+
/**
|
|
306
|
+
* Agent ID (agt_xxx) identifying which agent is making the request.
|
|
307
|
+
*/
|
|
308
|
+
'X-Agent-ID'?: string;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Required when X-Agent-ID is present. Session or conversation ID for agent
|
|
312
|
+
* observability.
|
|
313
|
+
*/
|
|
314
|
+
'X-Instance-ID'?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export declare namespace ExternalAccounts {
|
|
318
|
+
export {
|
|
319
|
+
type ExternalAccountListResponse as ExternalAccountListResponse,
|
|
320
|
+
type ExternalAccountRemoveResponse as ExternalAccountRemoveResponse,
|
|
321
|
+
type ExternalAccountListParams as ExternalAccountListParams,
|
|
322
|
+
type ExternalAccountRemoveParams as ExternalAccountRemoveParams,
|
|
323
|
+
};
|
|
324
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -43,6 +43,24 @@ export {
|
|
|
43
43
|
type DelegationGetAgentDelegationParams,
|
|
44
44
|
type DelegationListAgentDelegationsParams,
|
|
45
45
|
} from './delegations';
|
|
46
|
+
export {
|
|
47
|
+
Escalations,
|
|
48
|
+
type EscalationListResponse,
|
|
49
|
+
type EscalationApproveResponse,
|
|
50
|
+
type EscalationDenyResponse,
|
|
51
|
+
type EscalationGetResponse,
|
|
52
|
+
type EscalationListParams,
|
|
53
|
+
type EscalationApproveParams,
|
|
54
|
+
type EscalationDenyParams,
|
|
55
|
+
type EscalationGetParams,
|
|
56
|
+
} from './escalations';
|
|
57
|
+
export {
|
|
58
|
+
ExternalAccounts,
|
|
59
|
+
type ExternalAccountListResponse,
|
|
60
|
+
type ExternalAccountRemoveResponse,
|
|
61
|
+
type ExternalAccountListParams,
|
|
62
|
+
type ExternalAccountRemoveParams,
|
|
63
|
+
} from './external-accounts';
|
|
46
64
|
export {
|
|
47
65
|
Invitations,
|
|
48
66
|
type InvitationCreateResponse,
|
|
@@ -57,20 +75,36 @@ export {
|
|
|
57
75
|
type PartyUpdateResponse,
|
|
58
76
|
type PartyGetResponse,
|
|
59
77
|
type PartyListMembersResponse,
|
|
78
|
+
type PartyRemoveMemberResponse,
|
|
60
79
|
type PartyUpdateParams,
|
|
61
80
|
type PartyGetParams,
|
|
62
81
|
type PartyListMembersParams,
|
|
82
|
+
type PartyRemoveMemberParams,
|
|
63
83
|
} from './parties';
|
|
64
84
|
export {
|
|
65
85
|
PaymentRequests,
|
|
66
86
|
type PaymentRequestCreateResponse,
|
|
67
87
|
type PaymentRequestListResponse,
|
|
88
|
+
type PaymentRequestDeclineResponse,
|
|
89
|
+
type PaymentRequestFulfillResponse,
|
|
68
90
|
type PaymentRequestGetResponse,
|
|
91
|
+
type PaymentRequestListIncomingResponse,
|
|
69
92
|
type PaymentRequestCreateParams,
|
|
70
93
|
type PaymentRequestListParams,
|
|
94
|
+
type PaymentRequestDeclineParams,
|
|
95
|
+
type PaymentRequestFulfillParams,
|
|
71
96
|
type PaymentRequestGetParams,
|
|
97
|
+
type PaymentRequestListIncomingParams,
|
|
72
98
|
} from './payment-requests';
|
|
73
|
-
export {
|
|
99
|
+
export {
|
|
100
|
+
Payments,
|
|
101
|
+
type PaymentCreateResponse,
|
|
102
|
+
type PaymentListResponse,
|
|
103
|
+
type PaymentGetResponse,
|
|
104
|
+
type PaymentCreateParams,
|
|
105
|
+
type PaymentListParams,
|
|
106
|
+
type PaymentGetParams,
|
|
107
|
+
} from './payments';
|
|
74
108
|
export {
|
|
75
109
|
Transactions,
|
|
76
110
|
type TransactionListResponse,
|
|
@@ -78,18 +112,36 @@ export {
|
|
|
78
112
|
type TransactionListParams,
|
|
79
113
|
type TransactionGetParams,
|
|
80
114
|
} from './transactions';
|
|
115
|
+
export {
|
|
116
|
+
Transfers,
|
|
117
|
+
type TransferListResponse,
|
|
118
|
+
type TransferGetResponse,
|
|
119
|
+
type TransferInitiateDepositResponse,
|
|
120
|
+
type TransferInitiateWithdrawalResponse,
|
|
121
|
+
type TransferListParams,
|
|
122
|
+
type TransferGetParams,
|
|
123
|
+
type TransferInitiateDepositParams,
|
|
124
|
+
type TransferInitiateWithdrawalParams,
|
|
125
|
+
} from './transfers';
|
|
81
126
|
export {
|
|
82
127
|
Wallet,
|
|
83
|
-
type
|
|
84
|
-
type
|
|
85
|
-
type
|
|
86
|
-
type
|
|
87
|
-
type WalletListPaymentInstrumentsResponse,
|
|
88
|
-
type WalletRemovePaymentInstrumentResponse,
|
|
89
|
-
type WalletGetBalanceParams,
|
|
90
|
-
type WalletGetDepositInstructionsParams,
|
|
91
|
-
type WalletInitiateDepositParams,
|
|
92
|
-
type WalletInitiateWithdrawalParams,
|
|
93
|
-
type WalletListPaymentInstrumentsParams,
|
|
94
|
-
type WalletRemovePaymentInstrumentParams,
|
|
128
|
+
type WalletListResponse,
|
|
129
|
+
type WalletGetResponse,
|
|
130
|
+
type WalletListParams,
|
|
131
|
+
type WalletGetParams,
|
|
95
132
|
} from './wallet';
|
|
133
|
+
export {
|
|
134
|
+
Webhooks,
|
|
135
|
+
type WebhookCreateResponse,
|
|
136
|
+
type WebhookUpdateResponse,
|
|
137
|
+
type WebhookListResponse,
|
|
138
|
+
type WebhookGetResponse,
|
|
139
|
+
type WebhookRemoveResponse,
|
|
140
|
+
type WebhookRotateSecretResponse,
|
|
141
|
+
type WebhookCreateParams,
|
|
142
|
+
type WebhookUpdateParams,
|
|
143
|
+
type WebhookListParams,
|
|
144
|
+
type WebhookGetParams,
|
|
145
|
+
type WebhookRemoveParams,
|
|
146
|
+
type WebhookRotateSecretParams,
|
|
147
|
+
} from './webhooks';
|
|
@@ -11,13 +11,13 @@ import { path } from '../internal/utils/path';
|
|
|
11
11
|
*/
|
|
12
12
|
export class Invitations extends APIResource {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Send invitations to join your party.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
18
18
|
* const invitation = await client.invitations.create({
|
|
19
19
|
* invitations: [
|
|
20
|
-
* { email: 'dev@stainless.com', role: '
|
|
20
|
+
* { email: 'dev@stainless.com', role: 'ADMIN' },
|
|
21
21
|
* ],
|
|
22
22
|
* });
|
|
23
23
|
* ```
|
|
@@ -70,19 +70,25 @@ export class Invitations extends APIResource {
|
|
|
70
70
|
* ```ts
|
|
71
71
|
* const response = await client.invitations.revoke(
|
|
72
72
|
* 'invitationId',
|
|
73
|
+
* { 'Idempotency-Key': 'Idempotency-Key' },
|
|
73
74
|
* );
|
|
74
75
|
* ```
|
|
75
76
|
*/
|
|
76
77
|
revoke(
|
|
77
78
|
invitationID: string,
|
|
78
|
-
params: InvitationRevokeParams
|
|
79
|
+
params: InvitationRevokeParams,
|
|
79
80
|
options?: RequestOptions,
|
|
80
81
|
): APIPromise<InvitationRevokeResponse> {
|
|
81
|
-
const {
|
|
82
|
-
|
|
82
|
+
const {
|
|
83
|
+
'Idempotency-Key': idempotencyKey,
|
|
84
|
+
'X-Agent-ID': xAgentID,
|
|
85
|
+
'X-Instance-ID': xInstanceID,
|
|
86
|
+
} = params;
|
|
87
|
+
return this._client.delete(path`/party-invitations/${invitationID}`, {
|
|
83
88
|
...options,
|
|
84
89
|
headers: buildHeaders([
|
|
85
90
|
{
|
|
91
|
+
'Idempotency-Key': idempotencyKey,
|
|
86
92
|
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
87
93
|
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
88
94
|
},
|
|
@@ -263,6 +269,8 @@ export namespace InvitationListResponse {
|
|
|
263
269
|
|
|
264
270
|
export interface InvitationRevokeResponse {
|
|
265
271
|
data: InvitationRevokeResponse.Data;
|
|
272
|
+
|
|
273
|
+
meta: InvitationRevokeResponse.Meta;
|
|
266
274
|
}
|
|
267
275
|
|
|
268
276
|
export namespace InvitationRevokeResponse {
|
|
@@ -319,6 +327,13 @@ export namespace InvitationRevokeResponse {
|
|
|
319
327
|
status: 'PENDING' | 'ACCEPTED' | 'REVOKED';
|
|
320
328
|
}
|
|
321
329
|
}
|
|
330
|
+
|
|
331
|
+
export interface Meta {
|
|
332
|
+
/**
|
|
333
|
+
* Indicates the resource was deleted
|
|
334
|
+
*/
|
|
335
|
+
deleted: true;
|
|
336
|
+
}
|
|
322
337
|
}
|
|
323
338
|
|
|
324
339
|
export interface InvitationCreateParams {
|
|
@@ -327,11 +342,6 @@ export interface InvitationCreateParams {
|
|
|
327
342
|
*/
|
|
328
343
|
invitations: Array<InvitationCreateParams.Invitation>;
|
|
329
344
|
|
|
330
|
-
/**
|
|
331
|
-
* Body param: Days until invitation expires (1-30)
|
|
332
|
-
*/
|
|
333
|
-
expiresInDays?: number;
|
|
334
|
-
|
|
335
345
|
/**
|
|
336
346
|
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
337
347
|
*/
|
|
@@ -357,7 +367,7 @@ export namespace InvitationCreateParams {
|
|
|
357
367
|
/**
|
|
358
368
|
* Role to assign on acceptance
|
|
359
369
|
*/
|
|
360
|
-
role: '
|
|
370
|
+
role: 'ADMIN' | 'MEMBER' | 'VIEWER';
|
|
361
371
|
}
|
|
362
372
|
}
|
|
363
373
|
|
|
@@ -390,6 +400,12 @@ export interface InvitationListParams {
|
|
|
390
400
|
}
|
|
391
401
|
|
|
392
402
|
export interface InvitationRevokeParams {
|
|
403
|
+
/**
|
|
404
|
+
* Unique key for idempotent request handling. If a request with the same key was
|
|
405
|
+
* already processed, the original response is returned.
|
|
406
|
+
*/
|
|
407
|
+
'Idempotency-Key': string;
|
|
408
|
+
|
|
393
409
|
/**
|
|
394
410
|
* Agent ID (agt_xxx) identifying which agent is making the request.
|
|
395
411
|
*/
|