@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
@@ -13,11 +13,6 @@ export class Wallet extends APIResource {
13
13
  /**
14
14
  * List wallets for the authenticated party, including balance and ACH deposit
15
15
  * instructions when available. Currently returns at most one wallet.
16
- *
17
- * @example
18
- * ```ts
19
- * const wallets = await client.wallet.list();
20
- * ```
21
16
  */
22
17
  list(
23
18
  params: WalletListParams | null | undefined = {},
@@ -39,13 +34,6 @@ export class Wallet extends APIResource {
39
34
  /**
40
35
  * Get a wallet visible to the authenticated party, including balance and ACH
41
36
  * deposit instructions when available.
42
- *
43
- * @example
44
- * ```ts
45
- * const wallet = await client.wallet.get(
46
- * 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
47
- * );
48
- * ```
49
37
  */
50
38
  get(
51
39
  walletID: string,
@@ -64,78 +52,6 @@ export class Wallet extends APIResource {
64
52
  ]),
65
53
  });
66
54
  }
67
-
68
- /**
69
- * Initiate a wallet deposit.
70
- *
71
- * @example
72
- * ```ts
73
- * const response = await client.wallet.initiateDeposit({
74
- * amount: 1,
75
- * externalAccountId: 'ea_ecc2efdd09bd231a9ad9bd2aada37aa7',
76
- * 'Idempotency-Key': 'Idempotency-Key',
77
- * });
78
- * ```
79
- */
80
- initiateDeposit(
81
- params: WalletInitiateDepositParams,
82
- options?: RequestOptions,
83
- ): APIPromise<WalletInitiateDepositResponse> {
84
- const {
85
- 'Idempotency-Key': idempotencyKey,
86
- 'X-Agent-ID': xAgentID,
87
- 'X-Instance-ID': xInstanceID,
88
- ...body
89
- } = params;
90
- return this._client.post('/wallet/deposit', {
91
- body,
92
- ...options,
93
- headers: buildHeaders([
94
- {
95
- 'Idempotency-Key': idempotencyKey,
96
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
97
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
98
- },
99
- options?.headers,
100
- ]),
101
- });
102
- }
103
-
104
- /**
105
- * Initiate a wallet withdrawal.
106
- *
107
- * @example
108
- * ```ts
109
- * const response = await client.wallet.initiateWithdrawal({
110
- * amount: 1,
111
- * externalAccountId: 'ea_ecc2efdd09bd231a9ad9bd2aada37aa7',
112
- * 'Idempotency-Key': 'Idempotency-Key',
113
- * });
114
- * ```
115
- */
116
- initiateWithdrawal(
117
- params: WalletInitiateWithdrawalParams,
118
- options?: RequestOptions,
119
- ): APIPromise<WalletInitiateWithdrawalResponse> {
120
- const {
121
- 'Idempotency-Key': idempotencyKey,
122
- 'X-Agent-ID': xAgentID,
123
- 'X-Instance-ID': xInstanceID,
124
- ...body
125
- } = params;
126
- return this._client.post('/wallet/withdraw', {
127
- body,
128
- ...options,
129
- headers: buildHeaders([
130
- {
131
- 'Idempotency-Key': idempotencyKey,
132
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
133
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
134
- },
135
- options?.headers,
136
- ]),
137
- });
138
- }
139
55
  }
140
56
 
141
57
  export interface WalletListResponse {
@@ -448,108 +364,6 @@ export namespace WalletGetResponse {
448
364
  }
449
365
  }
450
366
 
451
- export interface WalletInitiateDepositResponse {
452
- data: WalletInitiateDepositResponse.Data;
453
- }
454
-
455
- export namespace WalletInitiateDepositResponse {
456
- export interface Data {
457
- /**
458
- * Transaction handle (txn_xxx). Empty when the operation failed before a
459
- * transaction was created.
460
- */
461
- id: string;
462
-
463
- /**
464
- * Resource attributes
465
- */
466
- attributes: Data.Attributes;
467
-
468
- /**
469
- * Resource type
470
- */
471
- type: string;
472
- }
473
-
474
- export namespace Data {
475
- /**
476
- * Resource attributes
477
- */
478
- export interface Attributes {
479
- /**
480
- * Amount in cents
481
- */
482
- amount: number;
483
-
484
- /**
485
- * Currency code
486
- */
487
- currency: string;
488
-
489
- /**
490
- * Estimated settlement time
491
- */
492
- estimatedSettlement: string | null;
493
-
494
- /**
495
- * Operation status
496
- */
497
- status: 'PROCESSING' | 'IN_REVIEW' | 'AWAITING_APPROVAL' | 'COMPLETED' | 'FAILED' | 'RETURNED';
498
- }
499
- }
500
- }
501
-
502
- export interface WalletInitiateWithdrawalResponse {
503
- data: WalletInitiateWithdrawalResponse.Data;
504
- }
505
-
506
- export namespace WalletInitiateWithdrawalResponse {
507
- export interface Data {
508
- /**
509
- * Transaction handle (txn_xxx). Empty when the operation failed before a
510
- * transaction was created.
511
- */
512
- id: string;
513
-
514
- /**
515
- * Resource attributes
516
- */
517
- attributes: Data.Attributes;
518
-
519
- /**
520
- * Resource type
521
- */
522
- type: string;
523
- }
524
-
525
- export namespace Data {
526
- /**
527
- * Resource attributes
528
- */
529
- export interface Attributes {
530
- /**
531
- * Amount in cents
532
- */
533
- amount: number;
534
-
535
- /**
536
- * Currency code
537
- */
538
- currency: string;
539
-
540
- /**
541
- * Estimated settlement time
542
- */
543
- estimatedSettlement: string | null;
544
-
545
- /**
546
- * Operation status
547
- */
548
- status: 'PROCESSING' | 'IN_REVIEW' | 'AWAITING_APPROVAL' | 'COMPLETED' | 'FAILED' | 'RETURNED';
549
- }
550
- }
551
- }
552
-
553
367
  export interface WalletListParams {
554
368
  /**
555
369
  * Agent ID (agt_xxx) identifying which agent is making the request.
@@ -576,93 +390,11 @@ export interface WalletGetParams {
576
390
  'X-Instance-ID'?: string;
577
391
  }
578
392
 
579
- export interface WalletInitiateDepositParams {
580
- /**
581
- * Body param: Amount in cents
582
- */
583
- amount: number;
584
-
585
- /**
586
- * Body param: External account ID (ea\_\*)
587
- */
588
- externalAccountId: string;
589
-
590
- /**
591
- * Header param: Unique key for idempotent request handling. If a request with the
592
- * same key was already processed, the original response is returned.
593
- */
594
- 'Idempotency-Key': string;
595
-
596
- /**
597
- * Body param: Currency code
598
- */
599
- currency?: string;
600
-
601
- /**
602
- * Body param: Deposit description
603
- */
604
- description?: string;
605
-
606
- /**
607
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
608
- */
609
- 'X-Agent-ID'?: string;
610
-
611
- /**
612
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
613
- * for agent observability.
614
- */
615
- 'X-Instance-ID'?: string;
616
- }
617
-
618
- export interface WalletInitiateWithdrawalParams {
619
- /**
620
- * Body param: Amount in cents
621
- */
622
- amount: number;
623
-
624
- /**
625
- * Body param: External account ID (ea\_\*)
626
- */
627
- externalAccountId: string;
628
-
629
- /**
630
- * Header param: Unique key for idempotent request handling. If a request with the
631
- * same key was already processed, the original response is returned.
632
- */
633
- 'Idempotency-Key': string;
634
-
635
- /**
636
- * Body param: Currency code
637
- */
638
- currency?: string;
639
-
640
- /**
641
- * Body param: Withdrawal description
642
- */
643
- description?: string;
644
-
645
- /**
646
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
647
- */
648
- 'X-Agent-ID'?: string;
649
-
650
- /**
651
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
652
- * for agent observability.
653
- */
654
- 'X-Instance-ID'?: string;
655
- }
656
-
657
393
  export declare namespace Wallet {
658
394
  export {
659
395
  type WalletListResponse as WalletListResponse,
660
396
  type WalletGetResponse as WalletGetResponse,
661
- type WalletInitiateDepositResponse as WalletInitiateDepositResponse,
662
- type WalletInitiateWithdrawalResponse as WalletInitiateWithdrawalResponse,
663
397
  type WalletListParams as WalletListParams,
664
398
  type WalletGetParams as WalletGetParams,
665
- type WalletInitiateDepositParams as WalletInitiateDepositParams,
666
- type WalletInitiateWithdrawalParams as WalletInitiateWithdrawalParams,
667
399
  };
668
400
  }
@@ -277,6 +277,7 @@ export namespace WebhookCreateResponse {
277
277
  | 'payment_request.completed'
278
278
  | 'payment_request.failed'
279
279
  | 'payment_request.returned'
280
+ | 'payment_request.incoming'
280
281
  >;
281
282
 
282
283
  /**
@@ -416,6 +417,7 @@ export namespace WebhookUpdateResponse {
416
417
  | 'payment_request.completed'
417
418
  | 'payment_request.failed'
418
419
  | 'payment_request.returned'
420
+ | 'payment_request.incoming'
419
421
  >;
420
422
 
421
423
  /**
@@ -552,6 +554,7 @@ export namespace WebhookListResponse {
552
554
  | 'payment_request.completed'
553
555
  | 'payment_request.failed'
554
556
  | 'payment_request.returned'
557
+ | 'payment_request.incoming'
555
558
  >;
556
559
 
557
560
  /**
@@ -698,6 +701,7 @@ export namespace WebhookGetResponse {
698
701
  | 'payment_request.completed'
699
702
  | 'payment_request.failed'
700
703
  | 'payment_request.returned'
704
+ | 'payment_request.incoming'
701
705
  >;
702
706
 
703
707
  /**
@@ -834,6 +838,7 @@ export namespace WebhookRemoveResponse {
834
838
  | 'payment_request.completed'
835
839
  | 'payment_request.failed'
836
840
  | 'payment_request.returned'
841
+ | 'payment_request.incoming'
837
842
  >;
838
843
 
839
844
  /**
@@ -1015,6 +1020,7 @@ export interface WebhookCreateParams {
1015
1020
  | 'payment_request.completed'
1016
1021
  | 'payment_request.failed'
1017
1022
  | 'payment_request.returned'
1023
+ | 'payment_request.incoming'
1018
1024
  >;
1019
1025
 
1020
1026
  /**
@@ -1093,6 +1099,7 @@ export interface WebhookUpdateParams {
1093
1099
  | 'payment_request.completed'
1094
1100
  | 'payment_request.failed'
1095
1101
  | 'payment_request.returned'
1102
+ | 'payment_request.incoming'
1096
1103
  >;
1097
1104
 
1098
1105
  /**
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.0";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.3.0";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.3.0'; // x-release-please-version
4
+ exports.VERSION = '0.4.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map