@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
package/src/client.ts CHANGED
@@ -61,6 +61,24 @@ import {
61
61
  DelegationListAgentDelegationsResponse,
62
62
  Delegations,
63
63
  } from './resources/delegations';
64
+ import {
65
+ EscalationApproveParams,
66
+ EscalationApproveResponse,
67
+ EscalationDenyParams,
68
+ EscalationDenyResponse,
69
+ EscalationGetParams,
70
+ EscalationGetResponse,
71
+ EscalationListParams,
72
+ EscalationListResponse,
73
+ Escalations,
74
+ } from './resources/escalations';
75
+ import {
76
+ ExternalAccountListParams,
77
+ ExternalAccountListResponse,
78
+ ExternalAccountRemoveParams,
79
+ ExternalAccountRemoveResponse,
80
+ ExternalAccounts,
81
+ } from './resources/external-accounts';
64
82
  import {
65
83
  InvitationCreateParams,
66
84
  InvitationCreateResponse,
@@ -76,19 +94,35 @@ import {
76
94
  PartyGetResponse,
77
95
  PartyListMembersParams,
78
96
  PartyListMembersResponse,
97
+ PartyRemoveMemberParams,
98
+ PartyRemoveMemberResponse,
79
99
  PartyUpdateParams,
80
100
  PartyUpdateResponse,
81
101
  } from './resources/parties';
82
102
  import {
83
103
  PaymentRequestCreateParams,
84
104
  PaymentRequestCreateResponse,
105
+ PaymentRequestDeclineParams,
106
+ PaymentRequestDeclineResponse,
107
+ PaymentRequestFulfillParams,
108
+ PaymentRequestFulfillResponse,
85
109
  PaymentRequestGetParams,
86
110
  PaymentRequestGetResponse,
111
+ PaymentRequestListIncomingParams,
112
+ PaymentRequestListIncomingResponse,
87
113
  PaymentRequestListParams,
88
114
  PaymentRequestListResponse,
89
115
  PaymentRequests,
90
116
  } from './resources/payment-requests';
91
- import { PaymentCreateParams, PaymentCreateResponse, Payments } from './resources/payments';
117
+ import {
118
+ PaymentCreateParams,
119
+ PaymentCreateResponse,
120
+ PaymentGetParams,
121
+ PaymentGetResponse,
122
+ PaymentListParams,
123
+ PaymentListResponse,
124
+ Payments,
125
+ } from './resources/payments';
92
126
  import {
93
127
  TransactionGetParams,
94
128
  TransactionGetResponse,
@@ -96,21 +130,39 @@ import {
96
130
  TransactionListResponse,
97
131
  Transactions,
98
132
  } from './resources/transactions';
133
+ import {
134
+ TransferGetParams,
135
+ TransferGetResponse,
136
+ TransferInitiateDepositParams,
137
+ TransferInitiateDepositResponse,
138
+ TransferInitiateWithdrawalParams,
139
+ TransferInitiateWithdrawalResponse,
140
+ TransferListParams,
141
+ TransferListResponse,
142
+ Transfers,
143
+ } from './resources/transfers';
99
144
  import {
100
145
  Wallet,
101
- WalletGetBalanceParams,
102
- WalletGetBalanceResponse,
103
- WalletGetDepositInstructionsParams,
104
- WalletGetDepositInstructionsResponse,
105
- WalletInitiateDepositParams,
106
- WalletInitiateDepositResponse,
107
- WalletInitiateWithdrawalParams,
108
- WalletInitiateWithdrawalResponse,
109
- WalletListPaymentInstrumentsParams,
110
- WalletListPaymentInstrumentsResponse,
111
- WalletRemovePaymentInstrumentParams,
112
- WalletRemovePaymentInstrumentResponse,
146
+ WalletGetParams,
147
+ WalletGetResponse,
148
+ WalletListParams,
149
+ WalletListResponse,
113
150
  } from './resources/wallet';
151
+ import {
152
+ WebhookCreateParams,
153
+ WebhookCreateResponse,
154
+ WebhookGetParams,
155
+ WebhookGetResponse,
156
+ WebhookListParams,
157
+ WebhookListResponse,
158
+ WebhookRemoveParams,
159
+ WebhookRemoveResponse,
160
+ WebhookRotateSecretParams,
161
+ WebhookRotateSecretResponse,
162
+ WebhookUpdateParams,
163
+ WebhookUpdateResponse,
164
+ Webhooks,
165
+ } from './resources/webhooks';
114
166
  import { type Fetch } from './internal/builtin-types';
115
167
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
116
168
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -132,7 +184,7 @@ type Environment = keyof typeof environments;
132
184
 
133
185
  export interface ClientOptions {
134
186
  /**
135
- * Defaults to process.env['NATURALPAY_API_KEY'].
187
+ * Defaults to process.env['NATURAL_API_KEY'].
136
188
  */
137
189
  apiKey?: string | undefined;
138
190
 
@@ -235,7 +287,7 @@ export class Natural {
235
287
  /**
236
288
  * API Client for interfacing with the Naturalpay API.
237
289
  *
238
- * @param {string | undefined} [opts.apiKey=process.env['NATURALPAY_API_KEY'] ?? undefined]
290
+ * @param {string | undefined} [opts.apiKey=process.env['NATURAL_API_KEY'] ?? undefined]
239
291
  * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
240
292
  * @param {string} [opts.baseURL=process.env['NATURALPAY_BASE_URL'] ?? https://api.natural.co] - Override the default base URL for the API.
241
293
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
@@ -247,12 +299,12 @@ export class Natural {
247
299
  */
248
300
  constructor({
249
301
  baseURL = readEnv('NATURALPAY_BASE_URL'),
250
- apiKey = readEnv('NATURALPAY_API_KEY'),
302
+ apiKey = readEnv('NATURAL_API_KEY'),
251
303
  ...opts
252
304
  }: ClientOptions = {}) {
253
305
  if (apiKey === undefined) {
254
306
  throw new Errors.NaturalError(
255
- "The NATURALPAY_API_KEY environment variable is missing or empty; either provide it, or instantiate the Natural client with an apiKey option, like new Natural({ apiKey: 'My API Key' }).",
307
+ "The NATURAL_API_KEY environment variable is missing or empty; either provide it, or instantiate the Natural client with an apiKey option, like new Natural({ apiKey: 'My API Key' }).",
256
308
  );
257
309
  }
258
310
 
@@ -878,17 +930,33 @@ export class Natural {
878
930
  */
879
931
  paymentRequests: API.PaymentRequests = new API.PaymentRequests(this);
880
932
  /**
881
- * Payment and transaction operations
933
+ * Payment operations
882
934
  */
883
935
  payments: API.Payments = new API.Payments(this);
884
936
  /**
885
- * Payment and transaction operations
937
+ * Transaction activity and history operations
886
938
  */
887
939
  transactions: API.Transactions = new API.Transactions(this);
888
940
  /**
889
- * Wallet balance, deposits, withdrawals, and external funding sources
941
+ * Payment approval escalation operations
942
+ */
943
+ escalations: API.Escalations = new API.Escalations(this);
944
+ /**
945
+ * Deposit and withdrawal operations
946
+ */
947
+ transfers: API.Transfers = new API.Transfers(this);
948
+ /**
949
+ * Webhook endpoint management
950
+ */
951
+ webhooks: API.Webhooks = new API.Webhooks(this);
952
+ /**
953
+ * Wallet balance, deposits, withdrawals, and external accounts
890
954
  */
891
955
  wallet: API.Wallet = new API.Wallet(this);
956
+ /**
957
+ * Linked external bank accounts
958
+ */
959
+ externalAccounts: API.ExternalAccounts = new API.ExternalAccounts(this);
892
960
  }
893
961
 
894
962
  Natural.Agents = Agents;
@@ -901,7 +969,11 @@ Natural.Parties = Parties;
901
969
  Natural.PaymentRequests = PaymentRequests;
902
970
  Natural.Payments = Payments;
903
971
  Natural.Transactions = Transactions;
972
+ Natural.Escalations = Escalations;
973
+ Natural.Transfers = Transfers;
974
+ Natural.Webhooks = Webhooks;
904
975
  Natural.Wallet = Wallet;
976
+ Natural.ExternalAccounts = ExternalAccounts;
905
977
 
906
978
  export declare namespace Natural {
907
979
  export type RequestOptions = Opts.RequestOptions;
@@ -973,25 +1045,37 @@ export declare namespace Natural {
973
1045
  type PartyUpdateResponse as PartyUpdateResponse,
974
1046
  type PartyGetResponse as PartyGetResponse,
975
1047
  type PartyListMembersResponse as PartyListMembersResponse,
1048
+ type PartyRemoveMemberResponse as PartyRemoveMemberResponse,
976
1049
  type PartyUpdateParams as PartyUpdateParams,
977
1050
  type PartyGetParams as PartyGetParams,
978
1051
  type PartyListMembersParams as PartyListMembersParams,
1052
+ type PartyRemoveMemberParams as PartyRemoveMemberParams,
979
1053
  };
980
1054
 
981
1055
  export {
982
1056
  PaymentRequests as PaymentRequests,
983
1057
  type PaymentRequestCreateResponse as PaymentRequestCreateResponse,
984
1058
  type PaymentRequestListResponse as PaymentRequestListResponse,
1059
+ type PaymentRequestDeclineResponse as PaymentRequestDeclineResponse,
1060
+ type PaymentRequestFulfillResponse as PaymentRequestFulfillResponse,
985
1061
  type PaymentRequestGetResponse as PaymentRequestGetResponse,
1062
+ type PaymentRequestListIncomingResponse as PaymentRequestListIncomingResponse,
986
1063
  type PaymentRequestCreateParams as PaymentRequestCreateParams,
987
1064
  type PaymentRequestListParams as PaymentRequestListParams,
1065
+ type PaymentRequestDeclineParams as PaymentRequestDeclineParams,
1066
+ type PaymentRequestFulfillParams as PaymentRequestFulfillParams,
988
1067
  type PaymentRequestGetParams as PaymentRequestGetParams,
1068
+ type PaymentRequestListIncomingParams as PaymentRequestListIncomingParams,
989
1069
  };
990
1070
 
991
1071
  export {
992
1072
  Payments as Payments,
993
1073
  type PaymentCreateResponse as PaymentCreateResponse,
1074
+ type PaymentListResponse as PaymentListResponse,
1075
+ type PaymentGetResponse as PaymentGetResponse,
994
1076
  type PaymentCreateParams as PaymentCreateParams,
1077
+ type PaymentListParams as PaymentListParams,
1078
+ type PaymentGetParams as PaymentGetParams,
995
1079
  };
996
1080
 
997
1081
  export {
@@ -1002,19 +1086,59 @@ export declare namespace Natural {
1002
1086
  type TransactionGetParams as TransactionGetParams,
1003
1087
  };
1004
1088
 
1089
+ export {
1090
+ Escalations as Escalations,
1091
+ type EscalationListResponse as EscalationListResponse,
1092
+ type EscalationApproveResponse as EscalationApproveResponse,
1093
+ type EscalationDenyResponse as EscalationDenyResponse,
1094
+ type EscalationGetResponse as EscalationGetResponse,
1095
+ type EscalationListParams as EscalationListParams,
1096
+ type EscalationApproveParams as EscalationApproveParams,
1097
+ type EscalationDenyParams as EscalationDenyParams,
1098
+ type EscalationGetParams as EscalationGetParams,
1099
+ };
1100
+
1101
+ export {
1102
+ Transfers as Transfers,
1103
+ type TransferListResponse as TransferListResponse,
1104
+ type TransferGetResponse as TransferGetResponse,
1105
+ type TransferInitiateDepositResponse as TransferInitiateDepositResponse,
1106
+ type TransferInitiateWithdrawalResponse as TransferInitiateWithdrawalResponse,
1107
+ type TransferListParams as TransferListParams,
1108
+ type TransferGetParams as TransferGetParams,
1109
+ type TransferInitiateDepositParams as TransferInitiateDepositParams,
1110
+ type TransferInitiateWithdrawalParams as TransferInitiateWithdrawalParams,
1111
+ };
1112
+
1113
+ export {
1114
+ Webhooks as Webhooks,
1115
+ type WebhookCreateResponse as WebhookCreateResponse,
1116
+ type WebhookUpdateResponse as WebhookUpdateResponse,
1117
+ type WebhookListResponse as WebhookListResponse,
1118
+ type WebhookGetResponse as WebhookGetResponse,
1119
+ type WebhookRemoveResponse as WebhookRemoveResponse,
1120
+ type WebhookRotateSecretResponse as WebhookRotateSecretResponse,
1121
+ type WebhookCreateParams as WebhookCreateParams,
1122
+ type WebhookUpdateParams as WebhookUpdateParams,
1123
+ type WebhookListParams as WebhookListParams,
1124
+ type WebhookGetParams as WebhookGetParams,
1125
+ type WebhookRemoveParams as WebhookRemoveParams,
1126
+ type WebhookRotateSecretParams as WebhookRotateSecretParams,
1127
+ };
1128
+
1005
1129
  export {
1006
1130
  Wallet as Wallet,
1007
- type WalletGetBalanceResponse as WalletGetBalanceResponse,
1008
- type WalletGetDepositInstructionsResponse as WalletGetDepositInstructionsResponse,
1009
- type WalletInitiateDepositResponse as WalletInitiateDepositResponse,
1010
- type WalletInitiateWithdrawalResponse as WalletInitiateWithdrawalResponse,
1011
- type WalletListPaymentInstrumentsResponse as WalletListPaymentInstrumentsResponse,
1012
- type WalletRemovePaymentInstrumentResponse as WalletRemovePaymentInstrumentResponse,
1013
- type WalletGetBalanceParams as WalletGetBalanceParams,
1014
- type WalletGetDepositInstructionsParams as WalletGetDepositInstructionsParams,
1015
- type WalletInitiateDepositParams as WalletInitiateDepositParams,
1016
- type WalletInitiateWithdrawalParams as WalletInitiateWithdrawalParams,
1017
- type WalletListPaymentInstrumentsParams as WalletListPaymentInstrumentsParams,
1018
- type WalletRemovePaymentInstrumentParams as WalletRemovePaymentInstrumentParams,
1131
+ type WalletListResponse as WalletListResponse,
1132
+ type WalletGetResponse as WalletGetResponse,
1133
+ type WalletListParams as WalletListParams,
1134
+ type WalletGetParams as WalletGetParams,
1135
+ };
1136
+
1137
+ export {
1138
+ ExternalAccounts as ExternalAccounts,
1139
+ type ExternalAccountListResponse as ExternalAccountListResponse,
1140
+ type ExternalAccountRemoveResponse as ExternalAccountRemoveResponse,
1141
+ type ExternalAccountListParams as ExternalAccountListParams,
1142
+ type ExternalAccountRemoveParams as ExternalAccountRemoveParams,
1019
1143
  };
1020
1144
  }
@@ -11,7 +11,7 @@ import { path } from '../internal/utils/path';
11
11
  */
12
12
  export class Agents extends APIResource {
13
13
  /**
14
- * Create a new agent for the authenticated party.
14
+ * Create a new agent for your party.
15
15
  *
16
16
  * @example
17
17
  * ```ts
@@ -43,7 +43,7 @@ export class Agents extends APIResource {
43
43
  }
44
44
 
45
45
  /**
46
- * Update an existing agent's mutable fields or revoke it.
46
+ * Update an existing agent's mutable fields.
47
47
  *
48
48
  * @example
49
49
  * ```ts
@@ -64,7 +64,7 @@ export class Agents extends APIResource {
64
64
  'X-Instance-ID': xInstanceID,
65
65
  ...body
66
66
  } = params;
67
- return this._client.put(path`/agents/${agentID}`, {
67
+ return this._client.patch(path`/agents/${agentID}`, {
68
68
  body,
69
69
  ...options,
70
70
  headers: buildHeaders([
@@ -79,7 +79,7 @@ export class Agents extends APIResource {
79
79
  }
80
80
 
81
81
  /**
82
- * List agents for the authenticated user's party.
82
+ * List agents in your party.
83
83
  *
84
84
  * @example
85
85
  * ```ts
@@ -202,7 +202,7 @@ export class Agents extends APIResource {
202
202
  }
203
203
 
204
204
  /**
205
- * Delete an agent and clean up its delegations and policies.
205
+ * Revoke an agent.
206
206
  *
207
207
  * @example
208
208
  * ```ts
@@ -294,25 +294,10 @@ export namespace AgentCreateResponse {
294
294
  */
295
295
  name: string;
296
296
 
297
- /**
298
- * Observability stats (null when unavailable)
299
- */
300
- observability: Attributes.Observability | null;
301
-
302
297
  /**
303
298
  * Agent status
304
299
  */
305
300
  status: 'ACTIVE' | 'REVOKED';
306
-
307
- /**
308
- * When this agent was last updated
309
- */
310
- updatedAt: string | null;
311
-
312
- /**
313
- * User who last updated this agent (usr\_\*)
314
- */
315
- updatedBy: string | null;
316
301
  }
317
302
 
318
303
  export namespace Attributes {
@@ -326,26 +311,6 @@ export namespace AgentCreateResponse {
326
311
  */
327
312
  perTransaction?: number | null;
328
313
  }
329
-
330
- /**
331
- * Observability stats (null when unavailable)
332
- */
333
- export interface Observability {
334
- /**
335
- * Errors in last 24h
336
- */
337
- errorCount: number;
338
-
339
- /**
340
- * Last activity timestamp
341
- */
342
- lastActiveAt: string | null;
343
-
344
- /**
345
- * Requests in last 24h
346
- */
347
- requestCount: number;
348
- }
349
314
  }
350
315
 
351
316
  /**
@@ -444,25 +409,10 @@ export namespace AgentUpdateResponse {
444
409
  */
445
410
  name: string;
446
411
 
447
- /**
448
- * Observability stats (null when unavailable)
449
- */
450
- observability: Attributes.Observability | null;
451
-
452
412
  /**
453
413
  * Agent status
454
414
  */
455
415
  status: 'ACTIVE' | 'REVOKED';
456
-
457
- /**
458
- * When this agent was last updated
459
- */
460
- updatedAt: string | null;
461
-
462
- /**
463
- * User who last updated this agent (usr\_\*)
464
- */
465
- updatedBy: string | null;
466
416
  }
467
417
 
468
418
  export namespace Attributes {
@@ -476,26 +426,6 @@ export namespace AgentUpdateResponse {
476
426
  */
477
427
  perTransaction?: number | null;
478
428
  }
479
-
480
- /**
481
- * Observability stats (null when unavailable)
482
- */
483
- export interface Observability {
484
- /**
485
- * Errors in last 24h
486
- */
487
- errorCount: number;
488
-
489
- /**
490
- * Last activity timestamp
491
- */
492
- lastActiveAt: string | null;
493
-
494
- /**
495
- * Requests in last 24h
496
- */
497
- requestCount: number;
498
- }
499
429
  }
500
430
 
501
431
  /**
@@ -596,25 +526,10 @@ export namespace AgentListResponse {
596
526
  */
597
527
  name: string;
598
528
 
599
- /**
600
- * Observability stats (null when unavailable)
601
- */
602
- observability: Attributes.Observability | null;
603
-
604
529
  /**
605
530
  * Agent status
606
531
  */
607
532
  status: 'ACTIVE' | 'REVOKED';
608
-
609
- /**
610
- * When this agent was last updated
611
- */
612
- updatedAt: string | null;
613
-
614
- /**
615
- * User who last updated this agent (usr\_\*)
616
- */
617
- updatedBy: string | null;
618
533
  }
619
534
 
620
535
  export namespace Attributes {
@@ -628,26 +543,6 @@ export namespace AgentListResponse {
628
543
  */
629
544
  perTransaction?: number | null;
630
545
  }
631
-
632
- /**
633
- * Observability stats (null when unavailable)
634
- */
635
- export interface Observability {
636
- /**
637
- * Errors in last 24h
638
- */
639
- errorCount: number;
640
-
641
- /**
642
- * Last activity timestamp
643
- */
644
- lastActiveAt: string | null;
645
-
646
- /**
647
- * Requests in last 24h
648
- */
649
- requestCount: number;
650
- }
651
546
  }
652
547
 
653
548
  /**
@@ -1014,25 +909,10 @@ export namespace AgentGetResponse {
1014
909
  */
1015
910
  name: string;
1016
911
 
1017
- /**
1018
- * Observability stats (null when unavailable)
1019
- */
1020
- observability: Attributes.Observability | null;
1021
-
1022
912
  /**
1023
913
  * Agent status
1024
914
  */
1025
915
  status: 'ACTIVE' | 'REVOKED';
1026
-
1027
- /**
1028
- * When this agent was last updated
1029
- */
1030
- updatedAt: string | null;
1031
-
1032
- /**
1033
- * User who last updated this agent (usr\_\*)
1034
- */
1035
- updatedBy: string | null;
1036
916
  }
1037
917
 
1038
918
  export namespace Attributes {
@@ -1046,26 +926,6 @@ export namespace AgentGetResponse {
1046
926
  */
1047
927
  perTransaction?: number | null;
1048
928
  }
1049
-
1050
- /**
1051
- * Observability stats (null when unavailable)
1052
- */
1053
- export interface Observability {
1054
- /**
1055
- * Errors in last 24h
1056
- */
1057
- errorCount: number;
1058
-
1059
- /**
1060
- * Last activity timestamp
1061
- */
1062
- lastActiveAt: string | null;
1063
-
1064
- /**
1065
- * Requests in last 24h
1066
- */
1067
- requestCount: number;
1068
- }
1069
929
  }
1070
930
 
1071
931
  /**
@@ -1417,25 +1277,10 @@ export namespace AgentRemoveResponse {
1417
1277
  */
1418
1278
  name: string;
1419
1279
 
1420
- /**
1421
- * Observability stats (null when unavailable)
1422
- */
1423
- observability: Attributes.Observability | null;
1424
-
1425
1280
  /**
1426
1281
  * Agent status
1427
1282
  */
1428
1283
  status: 'ACTIVE' | 'REVOKED';
1429
-
1430
- /**
1431
- * When this agent was last updated
1432
- */
1433
- updatedAt: string | null;
1434
-
1435
- /**
1436
- * User who last updated this agent (usr\_\*)
1437
- */
1438
- updatedBy: string | null;
1439
1284
  }
1440
1285
 
1441
1286
  export namespace Attributes {
@@ -1449,26 +1294,6 @@ export namespace AgentRemoveResponse {
1449
1294
  */
1450
1295
  perTransaction?: number | null;
1451
1296
  }
1452
-
1453
- /**
1454
- * Observability stats (null when unavailable)
1455
- */
1456
- export interface Observability {
1457
- /**
1458
- * Errors in last 24h
1459
- */
1460
- errorCount: number;
1461
-
1462
- /**
1463
- * Last activity timestamp
1464
- */
1465
- lastActiveAt: string | null;
1466
-
1467
- /**
1468
- * Requests in last 24h
1469
- */
1470
- requestCount: number;
1471
- }
1472
1297
  }
1473
1298
 
1474
1299
  /**
@@ -1585,11 +1410,6 @@ export interface AgentUpdateParams {
1585
1410
  */
1586
1411
  name?: string | null;
1587
1412
 
1588
- /**
1589
- * Body param: Updated status
1590
- */
1591
- status?: 'ACTIVE' | 'REVOKED' | null;
1592
-
1593
1413
  /**
1594
1414
  * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1595
1415
  */
@@ -90,19 +90,26 @@ export class APIKeys extends APIResource {
90
90
  *
91
91
  * @example
92
92
  * ```ts
93
- * const response = await client.apiKeys.revoke('keyId');
93
+ * const response = await client.apiKeys.revoke('keyId', {
94
+ * 'Idempotency-Key': 'Idempotency-Key',
95
+ * });
94
96
  * ```
95
97
  */
96
98
  revoke(
97
99
  keyID: string,
98
- params: APIKeyRevokeParams | null | undefined = {},
100
+ params: APIKeyRevokeParams,
99
101
  options?: RequestOptions,
100
102
  ): APIPromise<APIKeyRevokeResponse> {
101
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
102
- return this._client.put(path`/api-keys/${keyID}/revoke`, {
103
+ const {
104
+ 'Idempotency-Key': idempotencyKey,
105
+ 'X-Agent-ID': xAgentID,
106
+ 'X-Instance-ID': xInstanceID,
107
+ } = params;
108
+ return this._client.delete(path`/api-keys/${keyID}`, {
103
109
  ...options,
104
110
  headers: buildHeaders([
105
111
  {
112
+ 'Idempotency-Key': idempotencyKey,
106
113
  ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
107
114
  ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
108
115
  },
@@ -499,6 +506,8 @@ export namespace APIKeyGetResponse {
499
506
 
500
507
  export interface APIKeyRevokeResponse {
501
508
  data: APIKeyRevokeResponse.Data;
509
+
510
+ meta: APIKeyRevokeResponse.Meta;
502
511
  }
503
512
 
504
513
  export namespace APIKeyRevokeResponse {
@@ -617,6 +626,13 @@ export namespace APIKeyRevokeResponse {
617
626
  }
618
627
  }
619
628
  }
629
+
630
+ export interface Meta {
631
+ /**
632
+ * Indicates the resource was deleted
633
+ */
634
+ deleted: true;
635
+ }
620
636
  }
621
637
 
622
638
  export interface APIKeyCreateParams {
@@ -717,6 +733,12 @@ export interface APIKeyGetParams {
717
733
  }
718
734
 
719
735
  export interface APIKeyRevokeParams {
736
+ /**
737
+ * Unique key for idempotent request handling. If a request with the same key was
738
+ * already processed, the original response is returned.
739
+ */
740
+ 'Idempotency-Key': string;
741
+
720
742
  /**
721
743
  * Agent ID (agt_xxx) identifying which agent is making the request.
722
744
  */