@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
@@ -7,11 +7,11 @@ import { RequestOptions } from '../internal/request-options';
7
7
  import { path } from '../internal/utils/path';
8
8
 
9
9
  /**
10
- * Payment and transaction operations
10
+ * Transaction activity and history operations
11
11
  */
12
12
  export class Transactions extends APIResource {
13
13
  /**
14
- * List transactions visible to the authenticated party and its delegated agents.
14
+ * List transactions visible to your party.
15
15
  */
16
16
  list(
17
17
  params: TransactionListParams | null | undefined = {},
@@ -32,7 +32,7 @@ export class Transactions extends APIResource {
32
32
  }
33
33
 
34
34
  /**
35
- * Get a single transaction visible to the authenticated party.
35
+ * Get a single transaction visible to your party.
36
36
  */
37
37
  get(
38
38
  transactionID: string,
@@ -85,24 +85,11 @@ export namespace TransactionListResponse {
85
85
  * Resource attributes
86
86
  */
87
87
  export interface Attributes {
88
- /**
89
- * Agent that initiated this transaction. Null when initiated by a human user.
90
- */
91
- agentId: string | null;
92
-
93
88
  /**
94
89
  * Amount in cents
95
90
  */
96
91
  amount: number;
97
92
 
98
- /**
99
- * Classification from the authenticated party's perspective. Derived from
100
- * transactionType + direction: "sent"/"received" for wallet-to-wallet payments
101
- * (OUTBOUND/INBOUND), "deposit"/"withdrawal" for external transfers
102
- * (INBOUND/OUTBOUND).
103
- */
104
- category: 'sent' | 'received' | 'deposit' | 'withdrawal';
105
-
106
93
  /**
107
94
  * When this transaction was created
108
95
  */
@@ -113,11 +100,6 @@ export namespace TransactionListResponse {
113
100
  */
114
101
  currency: string;
115
102
 
116
- /**
117
- * Customer name if delegated
118
- */
119
- customerName: string | null;
120
-
121
103
  /**
122
104
  * Payment description
123
105
  */
@@ -129,34 +111,10 @@ export namespace TransactionListResponse {
129
111
  direction: 'INBOUND' | 'OUTBOUND';
130
112
 
131
113
  /**
132
- * Active dispute ID when a dispute has been filed for this transaction
133
- */
134
- disputeId: string | null;
135
-
136
- /**
137
- * Pending escalation ID when this transaction requires approval
138
- */
139
- escalationId: string | null;
140
-
141
- /**
142
- * Display name of the user or agent that initiated this transaction
143
- */
144
- initiatorName: string | null;
145
-
146
- /**
147
- * True if this is a delegated customer payment
114
+ * Projected funds-available time for transfers. Null when no projection exists and
115
+ * null for payments.
148
116
  */
149
- isDelegated: boolean;
150
-
151
- /**
152
- * Recipient display name
153
- */
154
- recipientName: string | null;
155
-
156
- /**
157
- * Sender display name
158
- */
159
- senderName: string | null;
117
+ expectedAvailableAt: string | null;
160
118
 
161
119
  /**
162
120
  * Transaction status
@@ -184,19 +142,21 @@ export namespace TransactionListResponse {
184
142
  destinationParty: Relationships.DestinationParty;
185
143
 
186
144
  /**
187
- * Destination wallet
145
+ * Source party
188
146
  */
189
- destinationWallet: Relationships.DestinationWallet;
147
+ sourceParty: Relationships.SourceParty;
190
148
 
191
149
  /**
192
- * Source party
150
+ * Payment that produced this transaction. Present only when the authenticated
151
+ * caller can access the payment resource.
193
152
  */
194
- sourceParty: Relationships.SourceParty;
153
+ payment?: Relationships.Payment;
195
154
 
196
155
  /**
197
- * Source wallet
156
+ * Transfer that produced this transaction. Present only when the authenticated
157
+ * caller can access the transfer resource.
198
158
  */
199
- sourceWallet: Relationships.SourceWallet;
159
+ transfer?: Relationships.Transfer;
200
160
  }
201
161
 
202
162
  export namespace Relationships {
@@ -225,16 +185,16 @@ export namespace TransactionListResponse {
225
185
  }
226
186
 
227
187
  /**
228
- * Destination wallet
188
+ * Source party
229
189
  */
230
- export interface DestinationWallet {
190
+ export interface SourceParty {
231
191
  /**
232
192
  * Related resource identifier
233
193
  */
234
- data: DestinationWallet.Data | null;
194
+ data: SourceParty.Data | null;
235
195
  }
236
196
 
237
- export namespace DestinationWallet {
197
+ export namespace SourceParty {
238
198
  /**
239
199
  * Related resource identifier
240
200
  */
@@ -249,16 +209,17 @@ export namespace TransactionListResponse {
249
209
  }
250
210
 
251
211
  /**
252
- * Source party
212
+ * Payment that produced this transaction. Present only when the authenticated
213
+ * caller can access the payment resource.
253
214
  */
254
- export interface SourceParty {
215
+ export interface Payment {
255
216
  /**
256
217
  * Related resource identifier
257
218
  */
258
- data: SourceParty.Data | null;
219
+ data: Payment.Data;
259
220
  }
260
221
 
261
- export namespace SourceParty {
222
+ export namespace Payment {
262
223
  /**
263
224
  * Related resource identifier
264
225
  */
@@ -273,16 +234,17 @@ export namespace TransactionListResponse {
273
234
  }
274
235
 
275
236
  /**
276
- * Source wallet
237
+ * Transfer that produced this transaction. Present only when the authenticated
238
+ * caller can access the transfer resource.
277
239
  */
278
- export interface SourceWallet {
240
+ export interface Transfer {
279
241
  /**
280
242
  * Related resource identifier
281
243
  */
282
- data: SourceWallet.Data | null;
244
+ data: Transfer.Data;
283
245
  }
284
246
 
285
- export namespace SourceWallet {
247
+ export namespace Transfer {
286
248
  /**
287
249
  * Related resource identifier
288
250
  */
@@ -340,24 +302,11 @@ export namespace TransactionGetResponse {
340
302
  * Resource attributes
341
303
  */
342
304
  export interface Attributes {
343
- /**
344
- * Agent that initiated this transaction. Null when initiated by a human user.
345
- */
346
- agentId: string | null;
347
-
348
305
  /**
349
306
  * Amount in cents
350
307
  */
351
308
  amount: number;
352
309
 
353
- /**
354
- * Classification from the authenticated party's perspective. Derived from
355
- * transactionType + direction: "sent"/"received" for wallet-to-wallet payments
356
- * (OUTBOUND/INBOUND), "deposit"/"withdrawal" for external transfers
357
- * (INBOUND/OUTBOUND).
358
- */
359
- category: 'sent' | 'received' | 'deposit' | 'withdrawal';
360
-
361
310
  /**
362
311
  * When this transaction was created
363
312
  */
@@ -368,11 +317,6 @@ export namespace TransactionGetResponse {
368
317
  */
369
318
  currency: string;
370
319
 
371
- /**
372
- * Customer name if delegated
373
- */
374
- customerName: string | null;
375
-
376
320
  /**
377
321
  * Payment description
378
322
  */
@@ -384,34 +328,10 @@ export namespace TransactionGetResponse {
384
328
  direction: 'INBOUND' | 'OUTBOUND';
385
329
 
386
330
  /**
387
- * Active dispute ID when a dispute has been filed for this transaction
388
- */
389
- disputeId: string | null;
390
-
391
- /**
392
- * Pending escalation ID when this transaction requires approval
393
- */
394
- escalationId: string | null;
395
-
396
- /**
397
- * Display name of the user or agent that initiated this transaction
398
- */
399
- initiatorName: string | null;
400
-
401
- /**
402
- * True if this is a delegated customer payment
331
+ * Projected funds-available time for transfers. Null when no projection exists and
332
+ * null for payments.
403
333
  */
404
- isDelegated: boolean;
405
-
406
- /**
407
- * Recipient display name
408
- */
409
- recipientName: string | null;
410
-
411
- /**
412
- * Sender display name
413
- */
414
- senderName: string | null;
334
+ expectedAvailableAt: string | null;
415
335
 
416
336
  /**
417
337
  * Transaction status
@@ -439,19 +359,21 @@ export namespace TransactionGetResponse {
439
359
  destinationParty: Relationships.DestinationParty;
440
360
 
441
361
  /**
442
- * Destination wallet
362
+ * Source party
443
363
  */
444
- destinationWallet: Relationships.DestinationWallet;
364
+ sourceParty: Relationships.SourceParty;
445
365
 
446
366
  /**
447
- * Source party
367
+ * Payment that produced this transaction. Present only when the authenticated
368
+ * caller can access the payment resource.
448
369
  */
449
- sourceParty: Relationships.SourceParty;
370
+ payment?: Relationships.Payment;
450
371
 
451
372
  /**
452
- * Source wallet
373
+ * Transfer that produced this transaction. Present only when the authenticated
374
+ * caller can access the transfer resource.
453
375
  */
454
- sourceWallet: Relationships.SourceWallet;
376
+ transfer?: Relationships.Transfer;
455
377
  }
456
378
 
457
379
  export namespace Relationships {
@@ -480,16 +402,16 @@ export namespace TransactionGetResponse {
480
402
  }
481
403
 
482
404
  /**
483
- * Destination wallet
405
+ * Source party
484
406
  */
485
- export interface DestinationWallet {
407
+ export interface SourceParty {
486
408
  /**
487
409
  * Related resource identifier
488
410
  */
489
- data: DestinationWallet.Data | null;
411
+ data: SourceParty.Data | null;
490
412
  }
491
413
 
492
- export namespace DestinationWallet {
414
+ export namespace SourceParty {
493
415
  /**
494
416
  * Related resource identifier
495
417
  */
@@ -504,16 +426,17 @@ export namespace TransactionGetResponse {
504
426
  }
505
427
 
506
428
  /**
507
- * Source party
429
+ * Payment that produced this transaction. Present only when the authenticated
430
+ * caller can access the payment resource.
508
431
  */
509
- export interface SourceParty {
432
+ export interface Payment {
510
433
  /**
511
434
  * Related resource identifier
512
435
  */
513
- data: SourceParty.Data | null;
436
+ data: Payment.Data;
514
437
  }
515
438
 
516
- export namespace SourceParty {
439
+ export namespace Payment {
517
440
  /**
518
441
  * Related resource identifier
519
442
  */
@@ -528,16 +451,17 @@ export namespace TransactionGetResponse {
528
451
  }
529
452
 
530
453
  /**
531
- * Source wallet
454
+ * Transfer that produced this transaction. Present only when the authenticated
455
+ * caller can access the transfer resource.
532
456
  */
533
- export interface SourceWallet {
457
+ export interface Transfer {
534
458
  /**
535
459
  * Related resource identifier
536
460
  */
537
- data: SourceWallet.Data | null;
461
+ data: Transfer.Data;
538
462
  }
539
463
 
540
- export namespace SourceWallet {
464
+ export namespace Transfer {
541
465
  /**
542
466
  * Related resource identifier
543
467
  */