@naturalpay/sdk 0.3.0 → 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 (109) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/client.d.mts +22 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +22 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/api-keys.d.mts +16 -2
  12. package/resources/api-keys.d.mts.map +1 -1
  13. package/resources/api-keys.d.ts +16 -2
  14. package/resources/api-keys.d.ts.map +1 -1
  15. package/resources/api-keys.js +7 -4
  16. package/resources/api-keys.js.map +1 -1
  17. package/resources/api-keys.mjs +7 -4
  18. package/resources/api-keys.mjs.map +1 -1
  19. package/resources/escalations.d.mts +1124 -0
  20. package/resources/escalations.d.mts.map +1 -0
  21. package/resources/escalations.d.ts +1124 -0
  22. package/resources/escalations.d.ts.map +1 -0
  23. package/resources/escalations.js +110 -0
  24. package/resources/escalations.js.map +1 -0
  25. package/resources/escalations.mjs +106 -0
  26. package/resources/escalations.mjs.map +1 -0
  27. package/resources/index.d.mts +6 -4
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +6 -4
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +5 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +3 -1
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/invitations.d.mts +16 -7
  36. package/resources/invitations.d.mts.map +1 -1
  37. package/resources/invitations.d.ts +16 -7
  38. package/resources/invitations.d.ts.map +1 -1
  39. package/resources/invitations.js +6 -4
  40. package/resources/invitations.js.map +1 -1
  41. package/resources/invitations.mjs +6 -4
  42. package/resources/invitations.mjs.map +1 -1
  43. package/resources/parties.d.mts +53 -26
  44. package/resources/parties.d.mts.map +1 -1
  45. package/resources/parties.d.ts +53 -26
  46. package/resources/parties.d.ts.map +1 -1
  47. package/resources/parties.js +27 -1
  48. package/resources/parties.js.map +1 -1
  49. package/resources/parties.mjs +27 -1
  50. package/resources/parties.mjs.map +1 -1
  51. package/resources/payment-requests.d.mts +738 -33
  52. package/resources/payment-requests.d.mts.map +1 -1
  53. package/resources/payment-requests.d.ts +738 -33
  54. package/resources/payment-requests.d.ts.map +1 -1
  55. package/resources/payment-requests.js +82 -1
  56. package/resources/payment-requests.js.map +1 -1
  57. package/resources/payment-requests.mjs +82 -1
  58. package/resources/payment-requests.mjs.map +1 -1
  59. package/resources/payments.d.mts +390 -24
  60. package/resources/payments.d.mts.map +1 -1
  61. package/resources/payments.d.ts +390 -24
  62. package/resources/payments.d.ts.map +1 -1
  63. package/resources/payments.js +53 -3
  64. package/resources/payments.js.map +1 -1
  65. package/resources/payments.mjs +53 -3
  66. package/resources/payments.mjs.map +1 -1
  67. package/resources/transactions.d.mts +50 -118
  68. package/resources/transactions.d.mts.map +1 -1
  69. package/resources/transactions.d.ts +50 -118
  70. package/resources/transactions.d.ts.map +1 -1
  71. package/resources/transactions.js +2 -2
  72. package/resources/transactions.mjs +2 -2
  73. package/resources/transfers.d.mts +1030 -0
  74. package/resources/transfers.d.mts.map +1 -0
  75. package/resources/transfers.d.ts +1030 -0
  76. package/resources/transfers.d.ts.map +1 -0
  77. package/resources/transfers.js +114 -0
  78. package/resources/transfers.js.map +1 -0
  79. package/resources/transfers.mjs +110 -0
  80. package/resources/transfers.mjs.map +1 -0
  81. package/resources/wallet.d.mts +1 -189
  82. package/resources/wallet.d.mts.map +1 -1
  83. package/resources/wallet.d.ts +1 -189
  84. package/resources/wallet.d.ts.map +1 -1
  85. package/resources/wallet.js +0 -66
  86. package/resources/wallet.js.map +1 -1
  87. package/resources/wallet.mjs +0 -66
  88. package/resources/wallet.mjs.map +1 -1
  89. package/resources/webhooks.d.mts +7 -7
  90. package/resources/webhooks.d.mts.map +1 -1
  91. package/resources/webhooks.d.ts +7 -7
  92. package/resources/webhooks.d.ts.map +1 -1
  93. package/src/client.ts +87 -11
  94. package/src/resources/api-keys.ts +26 -4
  95. package/src/resources/escalations.ts +1422 -0
  96. package/src/resources/index.ts +39 -5
  97. package/src/resources/invitations.ts +26 -10
  98. package/src/resources/parties.ts +85 -30
  99. package/src/resources/payment-requests.ts +949 -58
  100. package/src/resources/payments.ts +518 -23
  101. package/src/resources/transactions.ts +50 -136
  102. package/src/resources/transfers.ts +1338 -0
  103. package/src/resources/wallet.ts +0 -268
  104. package/src/resources/webhooks.ts +7 -0
  105. package/src/version.ts +1 -1
  106. package/version.d.mts +1 -1
  107. package/version.d.ts +1 -1
  108. package/version.js +1 -1
  109. 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 your party and its delegated agents.
14
+ * List transactions visible to your party.
15
15
  */
16
16
  list(
17
17
  params: TransactionListParams | null | undefined = {},
@@ -85,23 +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 your party's perspective. Derived from transactionType +
100
- * direction: "sent"/"received" for wallet-to-wallet payments (OUTBOUND/INBOUND),
101
- * "deposit"/"withdrawal" for external transfers (INBOUND/OUTBOUND).
102
- */
103
- category: 'sent' | 'received' | 'deposit' | 'withdrawal';
104
-
105
93
  /**
106
94
  * When this transaction was created
107
95
  */
@@ -112,11 +100,6 @@ export namespace TransactionListResponse {
112
100
  */
113
101
  currency: string;
114
102
 
115
- /**
116
- * Customer name if delegated
117
- */
118
- customerName: string | null;
119
-
120
103
  /**
121
104
  * Payment description
122
105
  */
@@ -128,41 +111,11 @@ export namespace TransactionListResponse {
128
111
  direction: 'INBOUND' | 'OUTBOUND';
129
112
 
130
113
  /**
131
- * Active dispute ID when a dispute has been filed for this transaction
132
- */
133
- disputeId: string | null;
134
-
135
- /**
136
- * Pending escalation ID when this transaction requires approval
137
- */
138
- escalationId: string | null;
139
-
140
- /**
141
- * Projected funds-available time for transfers (deposits/withdrawals). Null when
142
- * no MMR settlement projection has arrived yet, and null for payments.
114
+ * Projected funds-available time for transfers. Null when no projection exists and
115
+ * null for payments.
143
116
  */
144
117
  expectedAvailableAt: string | null;
145
118
 
146
- /**
147
- * Display name of the user or agent that initiated this transaction
148
- */
149
- initiatorName: string | null;
150
-
151
- /**
152
- * True if this is a delegated customer payment
153
- */
154
- isDelegated: boolean;
155
-
156
- /**
157
- * Recipient display name
158
- */
159
- recipientName: string | null;
160
-
161
- /**
162
- * Sender display name
163
- */
164
- senderName: string | null;
165
-
166
119
  /**
167
120
  * Transaction status
168
121
  */
@@ -189,19 +142,21 @@ export namespace TransactionListResponse {
189
142
  destinationParty: Relationships.DestinationParty;
190
143
 
191
144
  /**
192
- * Destination wallet
145
+ * Source party
193
146
  */
194
- destinationWallet: Relationships.DestinationWallet;
147
+ sourceParty: Relationships.SourceParty;
195
148
 
196
149
  /**
197
- * Source party
150
+ * Payment that produced this transaction. Present only when the authenticated
151
+ * caller can access the payment resource.
198
152
  */
199
- sourceParty: Relationships.SourceParty;
153
+ payment?: Relationships.Payment;
200
154
 
201
155
  /**
202
- * Source wallet
156
+ * Transfer that produced this transaction. Present only when the authenticated
157
+ * caller can access the transfer resource.
203
158
  */
204
- sourceWallet: Relationships.SourceWallet;
159
+ transfer?: Relationships.Transfer;
205
160
  }
206
161
 
207
162
  export namespace Relationships {
@@ -230,16 +185,16 @@ export namespace TransactionListResponse {
230
185
  }
231
186
 
232
187
  /**
233
- * Destination wallet
188
+ * Source party
234
189
  */
235
- export interface DestinationWallet {
190
+ export interface SourceParty {
236
191
  /**
237
192
  * Related resource identifier
238
193
  */
239
- data: DestinationWallet.Data | null;
194
+ data: SourceParty.Data | null;
240
195
  }
241
196
 
242
- export namespace DestinationWallet {
197
+ export namespace SourceParty {
243
198
  /**
244
199
  * Related resource identifier
245
200
  */
@@ -254,16 +209,17 @@ export namespace TransactionListResponse {
254
209
  }
255
210
 
256
211
  /**
257
- * Source party
212
+ * Payment that produced this transaction. Present only when the authenticated
213
+ * caller can access the payment resource.
258
214
  */
259
- export interface SourceParty {
215
+ export interface Payment {
260
216
  /**
261
217
  * Related resource identifier
262
218
  */
263
- data: SourceParty.Data | null;
219
+ data: Payment.Data;
264
220
  }
265
221
 
266
- export namespace SourceParty {
222
+ export namespace Payment {
267
223
  /**
268
224
  * Related resource identifier
269
225
  */
@@ -278,16 +234,17 @@ export namespace TransactionListResponse {
278
234
  }
279
235
 
280
236
  /**
281
- * Source wallet
237
+ * Transfer that produced this transaction. Present only when the authenticated
238
+ * caller can access the transfer resource.
282
239
  */
283
- export interface SourceWallet {
240
+ export interface Transfer {
284
241
  /**
285
242
  * Related resource identifier
286
243
  */
287
- data: SourceWallet.Data | null;
244
+ data: Transfer.Data;
288
245
  }
289
246
 
290
- export namespace SourceWallet {
247
+ export namespace Transfer {
291
248
  /**
292
249
  * Related resource identifier
293
250
  */
@@ -345,23 +302,11 @@ export namespace TransactionGetResponse {
345
302
  * Resource attributes
346
303
  */
347
304
  export interface Attributes {
348
- /**
349
- * Agent that initiated this transaction. Null when initiated by a human user.
350
- */
351
- agentId: string | null;
352
-
353
305
  /**
354
306
  * Amount in cents
355
307
  */
356
308
  amount: number;
357
309
 
358
- /**
359
- * Classification from your party's perspective. Derived from transactionType +
360
- * direction: "sent"/"received" for wallet-to-wallet payments (OUTBOUND/INBOUND),
361
- * "deposit"/"withdrawal" for external transfers (INBOUND/OUTBOUND).
362
- */
363
- category: 'sent' | 'received' | 'deposit' | 'withdrawal';
364
-
365
310
  /**
366
311
  * When this transaction was created
367
312
  */
@@ -372,11 +317,6 @@ export namespace TransactionGetResponse {
372
317
  */
373
318
  currency: string;
374
319
 
375
- /**
376
- * Customer name if delegated
377
- */
378
- customerName: string | null;
379
-
380
320
  /**
381
321
  * Payment description
382
322
  */
@@ -388,41 +328,11 @@ export namespace TransactionGetResponse {
388
328
  direction: 'INBOUND' | 'OUTBOUND';
389
329
 
390
330
  /**
391
- * Active dispute ID when a dispute has been filed for this transaction
392
- */
393
- disputeId: string | null;
394
-
395
- /**
396
- * Pending escalation ID when this transaction requires approval
397
- */
398
- escalationId: string | null;
399
-
400
- /**
401
- * Projected funds-available time for transfers (deposits/withdrawals). Null when
402
- * no MMR settlement projection has arrived yet, and null for payments.
331
+ * Projected funds-available time for transfers. Null when no projection exists and
332
+ * null for payments.
403
333
  */
404
334
  expectedAvailableAt: string | null;
405
335
 
406
- /**
407
- * Display name of the user or agent that initiated this transaction
408
- */
409
- initiatorName: string | null;
410
-
411
- /**
412
- * True if this is a delegated customer payment
413
- */
414
- isDelegated: boolean;
415
-
416
- /**
417
- * Recipient display name
418
- */
419
- recipientName: string | null;
420
-
421
- /**
422
- * Sender display name
423
- */
424
- senderName: string | null;
425
-
426
336
  /**
427
337
  * Transaction status
428
338
  */
@@ -449,19 +359,21 @@ export namespace TransactionGetResponse {
449
359
  destinationParty: Relationships.DestinationParty;
450
360
 
451
361
  /**
452
- * Destination wallet
362
+ * Source party
453
363
  */
454
- destinationWallet: Relationships.DestinationWallet;
364
+ sourceParty: Relationships.SourceParty;
455
365
 
456
366
  /**
457
- * Source party
367
+ * Payment that produced this transaction. Present only when the authenticated
368
+ * caller can access the payment resource.
458
369
  */
459
- sourceParty: Relationships.SourceParty;
370
+ payment?: Relationships.Payment;
460
371
 
461
372
  /**
462
- * Source wallet
373
+ * Transfer that produced this transaction. Present only when the authenticated
374
+ * caller can access the transfer resource.
463
375
  */
464
- sourceWallet: Relationships.SourceWallet;
376
+ transfer?: Relationships.Transfer;
465
377
  }
466
378
 
467
379
  export namespace Relationships {
@@ -490,16 +402,16 @@ export namespace TransactionGetResponse {
490
402
  }
491
403
 
492
404
  /**
493
- * Destination wallet
405
+ * Source party
494
406
  */
495
- export interface DestinationWallet {
407
+ export interface SourceParty {
496
408
  /**
497
409
  * Related resource identifier
498
410
  */
499
- data: DestinationWallet.Data | null;
411
+ data: SourceParty.Data | null;
500
412
  }
501
413
 
502
- export namespace DestinationWallet {
414
+ export namespace SourceParty {
503
415
  /**
504
416
  * Related resource identifier
505
417
  */
@@ -514,16 +426,17 @@ export namespace TransactionGetResponse {
514
426
  }
515
427
 
516
428
  /**
517
- * Source party
429
+ * Payment that produced this transaction. Present only when the authenticated
430
+ * caller can access the payment resource.
518
431
  */
519
- export interface SourceParty {
432
+ export interface Payment {
520
433
  /**
521
434
  * Related resource identifier
522
435
  */
523
- data: SourceParty.Data | null;
436
+ data: Payment.Data;
524
437
  }
525
438
 
526
- export namespace SourceParty {
439
+ export namespace Payment {
527
440
  /**
528
441
  * Related resource identifier
529
442
  */
@@ -538,16 +451,17 @@ export namespace TransactionGetResponse {
538
451
  }
539
452
 
540
453
  /**
541
- * Source wallet
454
+ * Transfer that produced this transaction. Present only when the authenticated
455
+ * caller can access the transfer resource.
542
456
  */
543
- export interface SourceWallet {
457
+ export interface Transfer {
544
458
  /**
545
459
  * Related resource identifier
546
460
  */
547
- data: SourceWallet.Data | null;
461
+ data: Transfer.Data;
548
462
  }
549
463
 
550
- export namespace SourceWallet {
464
+ export namespace Transfer {
551
465
  /**
552
466
  * Related resource identifier
553
467
  */