@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.
Files changed (234) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +2 -2
  3. package/api-promise.d.mts +1 -0
  4. package/api-promise.d.mts.map +1 -1
  5. package/api-promise.d.ts +1 -0
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.mjs +1 -0
  8. package/api-promise.mjs.map +1 -1
  9. package/client.d.mts +37 -13
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +37 -13
  12. package/client.d.ts.map +1 -1
  13. package/client.js +30 -6
  14. package/client.js.map +1 -1
  15. package/client.mjs +31 -7
  16. package/client.mjs.map +1 -1
  17. package/core/api-promise.d.mts.map +1 -1
  18. package/core/api-promise.d.ts.map +1 -1
  19. package/core/api-promise.mjs.map +1 -1
  20. package/core/error.mjs.map +1 -1
  21. package/core/resource.d.mts.map +1 -1
  22. package/core/resource.d.ts.map +1 -1
  23. package/core/uploads.d.mts.map +1 -1
  24. package/core/uploads.d.ts.map +1 -1
  25. package/core/uploads.mjs.map +1 -1
  26. package/error.d.mts +1 -0
  27. package/error.d.mts.map +1 -1
  28. package/error.d.ts +1 -0
  29. package/error.d.ts.map +1 -1
  30. package/error.mjs +1 -0
  31. package/error.mjs.map +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/detect-platform.mjs.map +1 -1
  36. package/internal/headers.mjs.map +1 -1
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts.map +1 -1
  39. package/internal/parse.mjs.map +1 -1
  40. package/internal/qs/formats.d.mts.map +1 -1
  41. package/internal/qs/formats.d.ts.map +1 -1
  42. package/internal/qs/index.d.mts +2 -2
  43. package/internal/qs/index.d.mts.map +1 -1
  44. package/internal/qs/index.d.ts +2 -2
  45. package/internal/qs/index.d.ts.map +1 -1
  46. package/internal/qs/index.mjs.map +1 -1
  47. package/internal/qs/stringify.d.mts.map +1 -1
  48. package/internal/qs/stringify.d.ts.map +1 -1
  49. package/internal/qs/stringify.mjs.map +1 -1
  50. package/internal/qs/utils.d.mts.map +1 -1
  51. package/internal/qs/utils.d.ts.map +1 -1
  52. package/internal/qs/utils.mjs.map +1 -1
  53. package/internal/request-options.d.mts.map +1 -1
  54. package/internal/request-options.d.ts.map +1 -1
  55. package/internal/shims.d.mts +6 -0
  56. package/internal/shims.d.mts.map +1 -1
  57. package/internal/shims.d.ts +6 -0
  58. package/internal/shims.d.ts.map +1 -1
  59. package/internal/to-file.d.mts.map +1 -1
  60. package/internal/to-file.d.ts.map +1 -1
  61. package/internal/to-file.mjs.map +1 -1
  62. package/internal/types.d.mts +4 -4
  63. package/internal/types.d.mts.map +1 -1
  64. package/internal/types.d.ts +4 -4
  65. package/internal/types.d.ts.map +1 -1
  66. package/internal/uploads.d.mts.map +1 -1
  67. package/internal/uploads.d.ts.map +1 -1
  68. package/internal/uploads.mjs.map +1 -1
  69. package/internal/utils/base64.mjs.map +1 -1
  70. package/internal/utils/log.d.mts.map +1 -1
  71. package/internal/utils/log.d.ts.map +1 -1
  72. package/internal/utils/log.mjs.map +1 -1
  73. package/internal/utils/path.mjs.map +1 -1
  74. package/internal/utils/query.mjs.map +1 -1
  75. package/internal/utils/values.mjs.map +1 -1
  76. package/internal/utils.d.mts.map +1 -1
  77. package/internal/utils.d.ts.map +1 -1
  78. package/internal/utils.mjs.map +1 -1
  79. package/lib/envelope.d.mts.map +1 -1
  80. package/lib/envelope.d.ts.map +1 -1
  81. package/lib/envelope.mjs.map +1 -1
  82. package/package.json +1 -1
  83. package/resource.d.mts +1 -0
  84. package/resource.d.mts.map +1 -1
  85. package/resource.d.ts +1 -0
  86. package/resource.d.ts.map +1 -1
  87. package/resource.mjs +1 -0
  88. package/resource.mjs.map +1 -1
  89. package/resources/agents.d.mts +4 -153
  90. package/resources/agents.d.mts.map +1 -1
  91. package/resources/agents.d.ts +4 -153
  92. package/resources/agents.d.ts.map +1 -1
  93. package/resources/agents.js +5 -5
  94. package/resources/agents.js.map +1 -1
  95. package/resources/agents.mjs +5 -5
  96. package/resources/agents.mjs.map +1 -1
  97. package/resources/api-keys.d.mts +16 -2
  98. package/resources/api-keys.d.mts.map +1 -1
  99. package/resources/api-keys.d.ts +16 -2
  100. package/resources/api-keys.d.ts.map +1 -1
  101. package/resources/api-keys.js +7 -4
  102. package/resources/api-keys.js.map +1 -1
  103. package/resources/api-keys.mjs +7 -4
  104. package/resources/api-keys.mjs.map +1 -1
  105. package/resources/counterparties.d.mts +5 -55
  106. package/resources/counterparties.d.mts.map +1 -1
  107. package/resources/counterparties.d.ts +5 -55
  108. package/resources/counterparties.d.ts.map +1 -1
  109. package/resources/counterparties.js +1 -3
  110. package/resources/counterparties.js.map +1 -1
  111. package/resources/counterparties.mjs +1 -3
  112. package/resources/counterparties.mjs.map +1 -1
  113. package/resources/customers.d.mts.map +1 -1
  114. package/resources/customers.d.ts.map +1 -1
  115. package/resources/customers.mjs.map +1 -1
  116. package/resources/delegations.d.mts.map +1 -1
  117. package/resources/delegations.d.ts.map +1 -1
  118. package/resources/delegations.mjs.map +1 -1
  119. package/resources/escalations.d.mts +1124 -0
  120. package/resources/escalations.d.mts.map +1 -0
  121. package/resources/escalations.d.ts +1124 -0
  122. package/resources/escalations.d.ts.map +1 -0
  123. package/resources/escalations.js +110 -0
  124. package/resources/escalations.js.map +1 -0
  125. package/resources/escalations.mjs +106 -0
  126. package/resources/escalations.mjs.map +1 -0
  127. package/resources/external-accounts.d.mts +239 -0
  128. package/resources/external-accounts.d.mts.map +1 -0
  129. package/resources/external-accounts.d.ts +239 -0
  130. package/resources/external-accounts.d.ts.map +1 -0
  131. package/resources/external-accounts.js +47 -0
  132. package/resources/external-accounts.js.map +1 -0
  133. package/resources/external-accounts.mjs +43 -0
  134. package/resources/external-accounts.mjs.map +1 -0
  135. package/resources/index.d.mts +8 -4
  136. package/resources/index.d.mts.map +1 -1
  137. package/resources/index.d.ts +8 -4
  138. package/resources/index.d.ts.map +1 -1
  139. package/resources/index.js +9 -1
  140. package/resources/index.js.map +1 -1
  141. package/resources/index.mjs +5 -1
  142. package/resources/index.mjs.map +1 -1
  143. package/resources/invitations.d.mts +17 -8
  144. package/resources/invitations.d.mts.map +1 -1
  145. package/resources/invitations.d.ts +17 -8
  146. package/resources/invitations.d.ts.map +1 -1
  147. package/resources/invitations.js +7 -5
  148. package/resources/invitations.js.map +1 -1
  149. package/resources/invitations.mjs +7 -5
  150. package/resources/invitations.mjs.map +1 -1
  151. package/resources/parties.d.mts +55 -28
  152. package/resources/parties.d.mts.map +1 -1
  153. package/resources/parties.d.ts +55 -28
  154. package/resources/parties.d.ts.map +1 -1
  155. package/resources/parties.js +30 -4
  156. package/resources/parties.js.map +1 -1
  157. package/resources/parties.mjs +30 -4
  158. package/resources/parties.mjs.map +1 -1
  159. package/resources/payment-requests.d.mts +751 -39
  160. package/resources/payment-requests.d.mts.map +1 -1
  161. package/resources/payment-requests.d.ts +751 -39
  162. package/resources/payment-requests.d.ts.map +1 -1
  163. package/resources/payment-requests.js +82 -2
  164. package/resources/payment-requests.js.map +1 -1
  165. package/resources/payment-requests.mjs +82 -2
  166. package/resources/payment-requests.mjs.map +1 -1
  167. package/resources/payments.d.mts +390 -24
  168. package/resources/payments.d.mts.map +1 -1
  169. package/resources/payments.d.ts +390 -24
  170. package/resources/payments.d.ts.map +1 -1
  171. package/resources/payments.js +53 -3
  172. package/resources/payments.js.map +1 -1
  173. package/resources/payments.mjs +53 -3
  174. package/resources/payments.mjs.map +1 -1
  175. package/resources/transactions.d.mts +53 -113
  176. package/resources/transactions.d.mts.map +1 -1
  177. package/resources/transactions.d.ts +53 -113
  178. package/resources/transactions.d.ts.map +1 -1
  179. package/resources/transactions.js +3 -3
  180. package/resources/transactions.mjs +3 -3
  181. package/resources/transactions.mjs.map +1 -1
  182. package/resources/transfers.d.mts +1030 -0
  183. package/resources/transfers.d.mts.map +1 -0
  184. package/resources/transfers.d.ts +1030 -0
  185. package/resources/transfers.d.ts.map +1 -0
  186. package/resources/transfers.js +114 -0
  187. package/resources/transfers.js.map +1 -0
  188. package/resources/transfers.mjs +110 -0
  189. package/resources/transfers.mjs.map +1 -0
  190. package/resources/wallet.d.mts +117 -437
  191. package/resources/wallet.d.mts.map +1 -1
  192. package/resources/wallet.d.ts +117 -437
  193. package/resources/wallet.d.ts.map +1 -1
  194. package/resources/wallet.js +9 -122
  195. package/resources/wallet.js.map +1 -1
  196. package/resources/wallet.mjs +9 -122
  197. package/resources/wallet.mjs.map +1 -1
  198. package/resources/webhooks.d.mts +775 -0
  199. package/resources/webhooks.d.mts.map +1 -0
  200. package/resources/webhooks.d.ts +775 -0
  201. package/resources/webhooks.d.ts.map +1 -0
  202. package/resources/webhooks.js +163 -0
  203. package/resources/webhooks.js.map +1 -0
  204. package/resources/webhooks.mjs +159 -0
  205. package/resources/webhooks.mjs.map +1 -0
  206. package/resources.d.mts.map +1 -1
  207. package/resources.d.ts.map +1 -1
  208. package/resources.mjs.map +1 -1
  209. package/src/client.ts +156 -32
  210. package/src/resources/agents.ts +5 -185
  211. package/src/resources/api-keys.ts +26 -4
  212. package/src/resources/counterparties.ts +5 -64
  213. package/src/resources/escalations.ts +1422 -0
  214. package/src/resources/external-accounts.ts +324 -0
  215. package/src/resources/index.ts +65 -13
  216. package/src/resources/invitations.ts +27 -11
  217. package/src/resources/parties.ts +88 -33
  218. package/src/resources/payment-requests.ts +945 -44
  219. package/src/resources/payments.ts +518 -23
  220. package/src/resources/transactions.ts +53 -129
  221. package/src/resources/transfers.ts +1338 -0
  222. package/src/resources/wallet.ts +133 -597
  223. package/src/resources/webhooks.ts +1232 -0
  224. package/src/version.ts +1 -1
  225. package/uploads.d.mts +1 -0
  226. package/uploads.d.mts.map +1 -1
  227. package/uploads.d.ts +1 -0
  228. package/uploads.d.ts.map +1 -1
  229. package/uploads.mjs +1 -0
  230. package/uploads.mjs.map +1 -1
  231. package/version.d.mts +1 -1
  232. package/version.d.ts +1 -1
  233. package/version.js +1 -1
  234. 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
+ }
@@ -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 { Payments, type PaymentCreateResponse, type PaymentCreateParams } from './payments';
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 WalletGetBalanceResponse,
84
- type WalletGetDepositInstructionsResponse,
85
- type WalletInitiateDepositResponse,
86
- type WalletInitiateWithdrawalResponse,
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
- * Create one or more invitations to join the authenticated user's party.
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: 'OWNER' },
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 | null | undefined = {},
79
+ params: InvitationRevokeParams,
79
80
  options?: RequestOptions,
80
81
  ): APIPromise<InvitationRevokeResponse> {
81
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
82
- return this._client.post(path`/party-invitations/${invitationID}/revoke`, {
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: 'OWNER' | 'ADMIN' | 'MEMBER' | 'VIEWER';
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
  */