@naturalpay/sdk 0.2.0 → 0.3.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 (507) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/LICENSE +7 -0
  3. package/README.md +340 -26
  4. package/api-promise.d.mts +3 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +3 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +3 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +267 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +267 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +560 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +556 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +3 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +3 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +3 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +75 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +75 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +26 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +26 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +87 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +81 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/query.d.mts +2 -0
  239. package/internal/utils/query.d.mts.map +1 -0
  240. package/internal/utils/query.d.ts +2 -0
  241. package/internal/utils/query.d.ts.map +1 -0
  242. package/internal/utils/query.js +10 -0
  243. package/internal/utils/query.js.map +1 -0
  244. package/internal/utils/query.mjs +6 -0
  245. package/internal/utils/query.mjs.map +1 -0
  246. package/internal/utils/sleep.d.mts +2 -0
  247. package/internal/utils/sleep.d.mts.map +1 -0
  248. package/internal/utils/sleep.d.ts +2 -0
  249. package/internal/utils/sleep.d.ts.map +1 -0
  250. package/internal/utils/sleep.js +7 -0
  251. package/internal/utils/sleep.js.map +1 -0
  252. package/internal/utils/sleep.mjs +3 -0
  253. package/internal/utils/sleep.mjs.map +1 -0
  254. package/internal/utils/uuid.d.mts +5 -0
  255. package/internal/utils/uuid.d.mts.map +1 -0
  256. package/internal/utils/uuid.d.ts +5 -0
  257. package/internal/utils/uuid.d.ts.map +1 -0
  258. package/internal/utils/uuid.js +19 -0
  259. package/internal/utils/uuid.js.map +1 -0
  260. package/internal/utils/uuid.mjs +15 -0
  261. package/internal/utils/uuid.mjs.map +1 -0
  262. package/internal/utils/values.d.mts +18 -0
  263. package/internal/utils/values.d.mts.map +1 -0
  264. package/internal/utils/values.d.ts +18 -0
  265. package/internal/utils/values.d.ts.map +1 -0
  266. package/internal/utils/values.js +112 -0
  267. package/internal/utils/values.js.map +1 -0
  268. package/internal/utils/values.mjs +94 -0
  269. package/internal/utils/values.mjs.map +1 -0
  270. package/internal/utils.d.mts +8 -0
  271. package/internal/utils.d.mts.map +1 -0
  272. package/internal/utils.d.ts +8 -0
  273. package/internal/utils.d.ts.map +1 -0
  274. package/internal/utils.js +12 -0
  275. package/internal/utils.js.map +1 -0
  276. package/internal/utils.mjs +9 -0
  277. package/internal/utils.mjs.map +1 -0
  278. package/lib/envelope.d.mts +4 -0
  279. package/lib/envelope.d.mts.map +1 -0
  280. package/lib/envelope.d.ts +4 -0
  281. package/lib/envelope.d.ts.map +1 -0
  282. package/lib/envelope.js +43 -0
  283. package/lib/envelope.js.map +1 -0
  284. package/lib/envelope.mjs +39 -0
  285. package/lib/envelope.mjs.map +1 -0
  286. package/package.json +142 -76
  287. package/resource.d.mts +3 -0
  288. package/resource.d.mts.map +1 -0
  289. package/resource.d.ts +3 -0
  290. package/resource.d.ts.map +1 -0
  291. package/resource.js +6 -0
  292. package/resource.js.map +1 -0
  293. package/resource.mjs +3 -0
  294. package/resource.mjs.map +1 -0
  295. package/resources/agents.d.mts +1243 -0
  296. package/resources/agents.d.mts.map +1 -0
  297. package/resources/agents.d.ts +1243 -0
  298. package/resources/agents.d.ts.map +1 -0
  299. package/resources/agents.js +192 -0
  300. package/resources/agents.js.map +1 -0
  301. package/resources/agents.mjs +188 -0
  302. package/resources/agents.mjs.map +1 -0
  303. package/resources/api-keys.d.mts +539 -0
  304. package/resources/api-keys.d.mts.map +1 -0
  305. package/resources/api-keys.d.ts +539 -0
  306. package/resources/api-keys.d.ts.map +1 -0
  307. package/resources/api-keys.js +100 -0
  308. package/resources/api-keys.js.map +1 -0
  309. package/resources/api-keys.mjs +96 -0
  310. package/resources/api-keys.mjs.map +1 -0
  311. package/resources/counterparties.d.mts +89 -0
  312. package/resources/counterparties.d.mts.map +1 -0
  313. package/resources/counterparties.d.ts +89 -0
  314. package/resources/counterparties.d.ts.map +1 -0
  315. package/resources/counterparties.js +30 -0
  316. package/resources/counterparties.js.map +1 -0
  317. package/resources/counterparties.mjs +26 -0
  318. package/resources/counterparties.mjs.map +1 -0
  319. package/resources/customers.d.mts +272 -0
  320. package/resources/customers.d.mts.map +1 -0
  321. package/resources/customers.d.ts +272 -0
  322. package/resources/customers.d.ts.map +1 -0
  323. package/resources/customers.js +48 -0
  324. package/resources/customers.js.map +1 -0
  325. package/resources/customers.mjs +44 -0
  326. package/resources/customers.mjs.map +1 -0
  327. package/resources/delegations.d.mts +458 -0
  328. package/resources/delegations.d.mts.map +1 -0
  329. package/resources/delegations.d.ts +458 -0
  330. package/resources/delegations.d.ts.map +1 -0
  331. package/resources/delegations.js +47 -0
  332. package/resources/delegations.js.map +1 -0
  333. package/resources/delegations.mjs +43 -0
  334. package/resources/delegations.mjs.map +1 -0
  335. package/resources/external-accounts.d.mts +239 -0
  336. package/resources/external-accounts.d.mts.map +1 -0
  337. package/resources/external-accounts.d.ts +239 -0
  338. package/resources/external-accounts.d.ts.map +1 -0
  339. package/resources/external-accounts.js +47 -0
  340. package/resources/external-accounts.js.map +1 -0
  341. package/resources/external-accounts.mjs +43 -0
  342. package/resources/external-accounts.mjs.map +1 -0
  343. package/resources/index.d.mts +14 -0
  344. package/resources/index.d.mts.map +1 -0
  345. package/resources/index.d.ts +14 -0
  346. package/resources/index.d.ts.map +1 -0
  347. package/resources/index.js +31 -0
  348. package/resources/index.js.map +1 -0
  349. package/resources/index.mjs +15 -0
  350. package/resources/index.mjs.map +1 -0
  351. package/resources/invitations.d.mts +304 -0
  352. package/resources/invitations.d.mts.map +1 -0
  353. package/resources/invitations.d.ts +304 -0
  354. package/resources/invitations.d.ts.map +1 -0
  355. package/resources/invitations.js +85 -0
  356. package/resources/invitations.js.map +1 -0
  357. package/resources/invitations.mjs +81 -0
  358. package/resources/invitations.mjs.map +1 -0
  359. package/resources/parties.d.mts +364 -0
  360. package/resources/parties.d.mts.map +1 -0
  361. package/resources/parties.d.ts +364 -0
  362. package/resources/parties.d.ts.map +1 -0
  363. package/resources/parties.js +78 -0
  364. package/resources/parties.js.map +1 -0
  365. package/resources/parties.mjs +74 -0
  366. package/resources/parties.mjs.map +1 -0
  367. package/resources/payment-requests.d.mts +449 -0
  368. package/resources/payment-requests.d.mts.map +1 -0
  369. package/resources/payment-requests.d.ts +449 -0
  370. package/resources/payment-requests.d.ts.map +1 -0
  371. package/resources/payment-requests.js +86 -0
  372. package/resources/payment-requests.js.map +1 -0
  373. package/resources/payment-requests.mjs +82 -0
  374. package/resources/payment-requests.mjs.map +1 -0
  375. package/resources/payments.d.mts +174 -0
  376. package/resources/payments.d.mts.map +1 -0
  377. package/resources/payments.d.ts +174 -0
  378. package/resources/payments.d.ts.map +1 -0
  379. package/resources/payments.js +40 -0
  380. package/resources/payments.js.map +1 -0
  381. package/resources/payments.mjs +36 -0
  382. package/resources/payments.mjs.map +1 -0
  383. package/resources/transactions.d.mts +486 -0
  384. package/resources/transactions.d.mts.map +1 -0
  385. package/resources/transactions.d.ts +486 -0
  386. package/resources/transactions.d.ts.map +1 -0
  387. package/resources/transactions.js +48 -0
  388. package/resources/transactions.js.map +1 -0
  389. package/resources/transactions.mjs +44 -0
  390. package/resources/transactions.mjs.map +1 -0
  391. package/resources/wallet.d.mts +496 -0
  392. package/resources/wallet.d.mts.map +1 -0
  393. package/resources/wallet.d.ts +496 -0
  394. package/resources/wallet.d.ts.map +1 -0
  395. package/resources/wallet.js +114 -0
  396. package/resources/wallet.js.map +1 -0
  397. package/resources/wallet.mjs +110 -0
  398. package/resources/wallet.mjs.map +1 -0
  399. package/resources/webhooks.d.mts +775 -0
  400. package/resources/webhooks.d.mts.map +1 -0
  401. package/resources/webhooks.d.ts +775 -0
  402. package/resources/webhooks.d.ts.map +1 -0
  403. package/resources/webhooks.js +163 -0
  404. package/resources/webhooks.js.map +1 -0
  405. package/resources/webhooks.mjs +159 -0
  406. package/resources/webhooks.mjs.map +1 -0
  407. package/resources.d.mts +2 -0
  408. package/resources.d.mts.map +1 -0
  409. package/resources.d.ts +2 -0
  410. package/resources.d.ts.map +1 -0
  411. package/resources.js +5 -0
  412. package/resources.js.map +1 -0
  413. package/resources.mjs +2 -0
  414. package/resources.mjs.map +1 -0
  415. package/src/api-promise.ts +2 -0
  416. package/src/client.ts +1068 -0
  417. package/src/core/README.md +3 -0
  418. package/src/core/api-promise.ts +92 -0
  419. package/src/core/error.ts +130 -0
  420. package/src/core/resource.ts +11 -0
  421. package/src/core/uploads.ts +2 -0
  422. package/src/error.ts +2 -0
  423. package/src/index.ts +22 -0
  424. package/src/internal/README.md +3 -0
  425. package/src/internal/builtin-types.ts +93 -0
  426. package/src/internal/detect-platform.ts +196 -0
  427. package/src/internal/errors.ts +33 -0
  428. package/src/internal/headers.ts +97 -0
  429. package/src/internal/parse.ts +56 -0
  430. package/src/internal/qs/LICENSE.md +13 -0
  431. package/src/internal/qs/README.md +3 -0
  432. package/src/internal/qs/formats.ts +10 -0
  433. package/src/internal/qs/index.ts +13 -0
  434. package/src/internal/qs/stringify.ts +385 -0
  435. package/src/internal/qs/types.ts +71 -0
  436. package/src/internal/qs/utils.ts +265 -0
  437. package/src/internal/request-options.ts +91 -0
  438. package/src/internal/shim-types.ts +26 -0
  439. package/src/internal/shims.ts +107 -0
  440. package/src/internal/to-file.ts +154 -0
  441. package/src/internal/types.ts +93 -0
  442. package/src/internal/uploads.ts +187 -0
  443. package/src/internal/utils/base64.ts +40 -0
  444. package/src/internal/utils/bytes.ts +32 -0
  445. package/src/internal/utils/env.ts +18 -0
  446. package/src/internal/utils/log.ts +128 -0
  447. package/src/internal/utils/path.ts +88 -0
  448. package/src/internal/utils/query.ts +7 -0
  449. package/src/internal/utils/sleep.ts +3 -0
  450. package/src/internal/utils/uuid.ts +17 -0
  451. package/src/internal/utils/values.ts +105 -0
  452. package/src/internal/utils.ts +9 -0
  453. package/src/lib/.keep +4 -0
  454. package/src/lib/envelope.ts +32 -0
  455. package/src/resource.ts +2 -0
  456. package/src/resources/agents.ts +1605 -0
  457. package/src/resources/api-keys.ts +743 -0
  458. package/src/resources/counterparties.ts +128 -0
  459. package/src/resources/customers.ts +365 -0
  460. package/src/resources/delegations.ts +580 -0
  461. package/src/resources/external-accounts.ts +324 -0
  462. package/src/resources/index.ts +113 -0
  463. package/src/resources/invitations.ts +414 -0
  464. package/src/resources/parties.ts +493 -0
  465. package/src/resources/payment-requests.ts +611 -0
  466. package/src/resources/payments.ts +228 -0
  467. package/src/resources/transactions.ts +620 -0
  468. package/src/resources/wallet.ts +668 -0
  469. package/src/resources/webhooks.ts +1225 -0
  470. package/src/resources.ts +1 -0
  471. package/src/tsconfig.json +11 -0
  472. package/src/uploads.ts +2 -0
  473. package/src/version.ts +1 -0
  474. package/uploads.d.mts +3 -0
  475. package/uploads.d.mts.map +1 -0
  476. package/uploads.d.ts +3 -0
  477. package/uploads.d.ts.map +1 -0
  478. package/uploads.js +6 -0
  479. package/uploads.js.map +1 -0
  480. package/uploads.mjs +3 -0
  481. package/uploads.mjs.map +1 -0
  482. package/version.d.mts +2 -0
  483. package/version.d.mts.map +1 -0
  484. package/version.d.ts +2 -0
  485. package/version.d.ts.map +1 -0
  486. package/version.js +5 -0
  487. package/version.js.map +1 -0
  488. package/version.mjs +2 -0
  489. package/version.mjs.map +1 -0
  490. package/dist/index.cjs +0 -1737
  491. package/dist/index.cjs.map +0 -1
  492. package/dist/index.d.cts +0 -929
  493. package/dist/index.d.ts +0 -929
  494. package/dist/index.js +0 -1705
  495. package/dist/index.js.map +0 -1
  496. package/dist/mcp/cli.cjs +0 -166
  497. package/dist/mcp/cli.cjs.map +0 -1
  498. package/dist/mcp/cli.d.cts +0 -1
  499. package/dist/mcp/cli.d.ts +0 -1
  500. package/dist/mcp/cli.js +0 -164
  501. package/dist/mcp/cli.js.map +0 -1
  502. package/dist/mcp/index.cjs +0 -8
  503. package/dist/mcp/index.cjs.map +0 -1
  504. package/dist/mcp/index.d.cts +0 -9
  505. package/dist/mcp/index.d.ts +0 -9
  506. package/dist/mcp/index.js +0 -6
  507. package/dist/mcp/index.js.map +0 -1
@@ -0,0 +1,1605 @@
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
+ * Agent management
11
+ */
12
+ export class Agents extends APIResource {
13
+ /**
14
+ * Create a new agent for your party.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const agent = await client.agents.create({
19
+ * name: 'x',
20
+ * 'Idempotency-Key': 'Idempotency-Key',
21
+ * });
22
+ * ```
23
+ */
24
+ create(params: AgentCreateParams, options?: RequestOptions): APIPromise<AgentCreateResponse> {
25
+ const {
26
+ 'Idempotency-Key': idempotencyKey,
27
+ 'X-Agent-ID': xAgentID,
28
+ 'X-Instance-ID': xInstanceID,
29
+ ...body
30
+ } = params;
31
+ return this._client.post('/agents', {
32
+ body,
33
+ ...options,
34
+ headers: buildHeaders([
35
+ {
36
+ 'Idempotency-Key': idempotencyKey,
37
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
38
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
39
+ },
40
+ options?.headers,
41
+ ]),
42
+ });
43
+ }
44
+
45
+ /**
46
+ * Update an existing agent's mutable fields.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const agent = await client.agents.update(
51
+ * 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
52
+ * { 'Idempotency-Key': 'Idempotency-Key' },
53
+ * );
54
+ * ```
55
+ */
56
+ update(
57
+ agentID: string,
58
+ params: AgentUpdateParams,
59
+ options?: RequestOptions,
60
+ ): APIPromise<AgentUpdateResponse> {
61
+ const {
62
+ 'Idempotency-Key': idempotencyKey,
63
+ 'X-Agent-ID': xAgentID,
64
+ 'X-Instance-ID': xInstanceID,
65
+ ...body
66
+ } = params;
67
+ return this._client.patch(path`/agents/${agentID}`, {
68
+ body,
69
+ ...options,
70
+ headers: buildHeaders([
71
+ {
72
+ 'Idempotency-Key': idempotencyKey,
73
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
74
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
75
+ },
76
+ options?.headers,
77
+ ]),
78
+ });
79
+ }
80
+
81
+ /**
82
+ * List agents in your party.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * const agents = await client.agents.list();
87
+ * ```
88
+ */
89
+ list(
90
+ params: AgentListParams | null | undefined = {},
91
+ options?: RequestOptions,
92
+ ): APIPromise<AgentListResponse> {
93
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
94
+ return this._client.get('/agents', {
95
+ query,
96
+ ...options,
97
+ headers: buildHeaders([
98
+ {
99
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
100
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
101
+ },
102
+ options?.headers,
103
+ ]),
104
+ });
105
+ }
106
+
107
+ /**
108
+ * Developer-only. Creates one invitation per agent and sends a single Resend email
109
+ * to the customer.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const response = await client.agents.createInvitations({
114
+ * agents: [
115
+ * {
116
+ * agentId: 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
117
+ * permissions: ['string'],
118
+ * },
119
+ * ],
120
+ * customerEmail: 'dev@stainless.com',
121
+ * 'Idempotency-Key': 'Idempotency-Key',
122
+ * });
123
+ * ```
124
+ */
125
+ createInvitations(
126
+ params: AgentCreateInvitationsParams,
127
+ options?: RequestOptions,
128
+ ): APIPromise<AgentCreateInvitationsResponse> {
129
+ const {
130
+ 'Idempotency-Key': idempotencyKey,
131
+ 'X-Agent-ID': xAgentID,
132
+ 'X-Instance-ID': xInstanceID,
133
+ ...body
134
+ } = params;
135
+ return this._client.post('/agents/invitations', {
136
+ body,
137
+ ...options,
138
+ headers: buildHeaders([
139
+ {
140
+ 'Idempotency-Key': idempotencyKey,
141
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
142
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
143
+ },
144
+ options?.headers,
145
+ ]),
146
+ });
147
+ }
148
+
149
+ /**
150
+ * Get agent details by its unique ID.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * const agent = await client.agents.get(
155
+ * 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
156
+ * );
157
+ * ```
158
+ */
159
+ get(
160
+ agentID: string,
161
+ params: AgentGetParams | null | undefined = {},
162
+ options?: RequestOptions,
163
+ ): APIPromise<AgentGetResponse> {
164
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
165
+ return this._client.get(path`/agents/${agentID}`, {
166
+ ...options,
167
+ headers: buildHeaders([
168
+ {
169
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
170
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
171
+ },
172
+ options?.headers,
173
+ ]),
174
+ });
175
+ }
176
+
177
+ /**
178
+ * List agent delegation invitations
179
+ *
180
+ * @example
181
+ * ```ts
182
+ * const response =
183
+ * await client.agents.listInvitationsForDeveloper();
184
+ * ```
185
+ */
186
+ listInvitationsForDeveloper(
187
+ params: AgentListInvitationsForDeveloperParams | null | undefined = {},
188
+ options?: RequestOptions,
189
+ ): APIPromise<AgentListInvitationsForDeveloperResponse> {
190
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
191
+ return this._client.get('/agents/invitations', {
192
+ query,
193
+ ...options,
194
+ headers: buildHeaders([
195
+ {
196
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
197
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
198
+ },
199
+ options?.headers,
200
+ ]),
201
+ });
202
+ }
203
+
204
+ /**
205
+ * Revoke an agent.
206
+ *
207
+ * @example
208
+ * ```ts
209
+ * const agent = await client.agents.remove(
210
+ * 'agt_ecc2efdd09bd231a9ad9bd2aada37aa7',
211
+ * { 'Idempotency-Key': 'Idempotency-Key' },
212
+ * );
213
+ * ```
214
+ */
215
+ remove(
216
+ agentID: string,
217
+ params: AgentRemoveParams,
218
+ options?: RequestOptions,
219
+ ): APIPromise<AgentRemoveResponse> {
220
+ const {
221
+ 'Idempotency-Key': idempotencyKey,
222
+ 'X-Agent-ID': xAgentID,
223
+ 'X-Instance-ID': xInstanceID,
224
+ } = params;
225
+ return this._client.delete(path`/agents/${agentID}`, {
226
+ ...options,
227
+ headers: buildHeaders([
228
+ {
229
+ 'Idempotency-Key': idempotencyKey,
230
+ ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
231
+ ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
232
+ },
233
+ options?.headers,
234
+ ]),
235
+ });
236
+ }
237
+ }
238
+
239
+ export interface AgentCreateResponse {
240
+ data: AgentCreateResponse.Data;
241
+ }
242
+
243
+ export namespace AgentCreateResponse {
244
+ export interface Data {
245
+ /**
246
+ * Resource ID
247
+ */
248
+ id: string;
249
+
250
+ /**
251
+ * Resource attributes
252
+ */
253
+ attributes: Data.Attributes;
254
+
255
+ /**
256
+ * Resource relationships
257
+ */
258
+ relationships: Data.Relationships;
259
+
260
+ /**
261
+ * Resource type
262
+ */
263
+ type: string;
264
+ }
265
+
266
+ export namespace Data {
267
+ /**
268
+ * Resource attributes
269
+ */
270
+ export interface Attributes {
271
+ /**
272
+ * When this agent was created
273
+ */
274
+ createdAt: string | null;
275
+
276
+ /**
277
+ * User who created this agent (usr\_\*)
278
+ */
279
+ createdBy: string | null;
280
+
281
+ /**
282
+ * Agent description
283
+ */
284
+ description: string | null;
285
+
286
+ /**
287
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
288
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
289
+ */
290
+ limits: Attributes.Limits | null;
291
+
292
+ /**
293
+ * Agent display name
294
+ */
295
+ name: string;
296
+
297
+ /**
298
+ * Agent status
299
+ */
300
+ status: 'ACTIVE' | 'REVOKED';
301
+ }
302
+
303
+ export namespace Attributes {
304
+ /**
305
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
306
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
307
+ */
308
+ export interface Limits {
309
+ /**
310
+ * Positive per-transaction limit in cents. null means no per-payment limit.
311
+ */
312
+ perTransaction?: number | null;
313
+ }
314
+ }
315
+
316
+ /**
317
+ * Resource relationships
318
+ */
319
+ export interface Relationships {
320
+ /**
321
+ * Party that owns the agent
322
+ */
323
+ party: Relationships.Party;
324
+ }
325
+
326
+ export namespace Relationships {
327
+ /**
328
+ * Party that owns the agent
329
+ */
330
+ export interface Party {
331
+ /**
332
+ * Related resource identifier
333
+ */
334
+ data: Party.Data;
335
+ }
336
+
337
+ export namespace Party {
338
+ /**
339
+ * Related resource identifier
340
+ */
341
+ export interface Data {
342
+ id: string;
343
+
344
+ /**
345
+ * Resource type
346
+ */
347
+ type: string;
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }
353
+
354
+ export interface AgentUpdateResponse {
355
+ data: AgentUpdateResponse.Data;
356
+ }
357
+
358
+ export namespace AgentUpdateResponse {
359
+ export interface Data {
360
+ /**
361
+ * Resource ID
362
+ */
363
+ id: string;
364
+
365
+ /**
366
+ * Resource attributes
367
+ */
368
+ attributes: Data.Attributes;
369
+
370
+ /**
371
+ * Resource relationships
372
+ */
373
+ relationships: Data.Relationships;
374
+
375
+ /**
376
+ * Resource type
377
+ */
378
+ type: string;
379
+ }
380
+
381
+ export namespace Data {
382
+ /**
383
+ * Resource attributes
384
+ */
385
+ export interface Attributes {
386
+ /**
387
+ * When this agent was created
388
+ */
389
+ createdAt: string | null;
390
+
391
+ /**
392
+ * User who created this agent (usr\_\*)
393
+ */
394
+ createdBy: string | null;
395
+
396
+ /**
397
+ * Agent description
398
+ */
399
+ description: string | null;
400
+
401
+ /**
402
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
403
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
404
+ */
405
+ limits: Attributes.Limits | null;
406
+
407
+ /**
408
+ * Agent display name
409
+ */
410
+ name: string;
411
+
412
+ /**
413
+ * Agent status
414
+ */
415
+ status: 'ACTIVE' | 'REVOKED';
416
+ }
417
+
418
+ export namespace Attributes {
419
+ /**
420
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
421
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
422
+ */
423
+ export interface Limits {
424
+ /**
425
+ * Positive per-transaction limit in cents. null means no per-payment limit.
426
+ */
427
+ perTransaction?: number | null;
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Resource relationships
433
+ */
434
+ export interface Relationships {
435
+ /**
436
+ * Party that owns the agent
437
+ */
438
+ party: Relationships.Party;
439
+ }
440
+
441
+ export namespace Relationships {
442
+ /**
443
+ * Party that owns the agent
444
+ */
445
+ export interface Party {
446
+ /**
447
+ * Related resource identifier
448
+ */
449
+ data: Party.Data;
450
+ }
451
+
452
+ export namespace Party {
453
+ /**
454
+ * Related resource identifier
455
+ */
456
+ export interface Data {
457
+ id: string;
458
+
459
+ /**
460
+ * Resource type
461
+ */
462
+ type: string;
463
+ }
464
+ }
465
+ }
466
+ }
467
+ }
468
+
469
+ export interface AgentListResponse {
470
+ data: Array<AgentListResponse.Data>;
471
+
472
+ meta: AgentListResponse.Meta;
473
+ }
474
+
475
+ export namespace AgentListResponse {
476
+ export interface Data {
477
+ /**
478
+ * Resource ID
479
+ */
480
+ id: string;
481
+
482
+ /**
483
+ * Resource attributes
484
+ */
485
+ attributes: Data.Attributes;
486
+
487
+ /**
488
+ * Resource relationships
489
+ */
490
+ relationships: Data.Relationships;
491
+
492
+ /**
493
+ * Resource type
494
+ */
495
+ type: string;
496
+ }
497
+
498
+ export namespace Data {
499
+ /**
500
+ * Resource attributes
501
+ */
502
+ export interface Attributes {
503
+ /**
504
+ * When this agent was created
505
+ */
506
+ createdAt: string | null;
507
+
508
+ /**
509
+ * User who created this agent (usr\_\*)
510
+ */
511
+ createdBy: string | null;
512
+
513
+ /**
514
+ * Agent description
515
+ */
516
+ description: string | null;
517
+
518
+ /**
519
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
520
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
521
+ */
522
+ limits: Attributes.Limits | null;
523
+
524
+ /**
525
+ * Agent display name
526
+ */
527
+ name: string;
528
+
529
+ /**
530
+ * Agent status
531
+ */
532
+ status: 'ACTIVE' | 'REVOKED';
533
+ }
534
+
535
+ export namespace Attributes {
536
+ /**
537
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
538
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
539
+ */
540
+ export interface Limits {
541
+ /**
542
+ * Positive per-transaction limit in cents. null means no per-payment limit.
543
+ */
544
+ perTransaction?: number | null;
545
+ }
546
+ }
547
+
548
+ /**
549
+ * Resource relationships
550
+ */
551
+ export interface Relationships {
552
+ /**
553
+ * Party that owns the agent
554
+ */
555
+ party: Relationships.Party;
556
+ }
557
+
558
+ export namespace Relationships {
559
+ /**
560
+ * Party that owns the agent
561
+ */
562
+ export interface Party {
563
+ /**
564
+ * Related resource identifier
565
+ */
566
+ data: Party.Data;
567
+ }
568
+
569
+ export namespace Party {
570
+ /**
571
+ * Related resource identifier
572
+ */
573
+ export interface Data {
574
+ id: string;
575
+
576
+ /**
577
+ * Resource type
578
+ */
579
+ type: string;
580
+ }
581
+ }
582
+ }
583
+ }
584
+
585
+ export interface Meta {
586
+ pagination: Meta.Pagination;
587
+ }
588
+
589
+ export namespace Meta {
590
+ export interface Pagination {
591
+ hasMore: boolean;
592
+
593
+ nextCursor: string | null;
594
+ }
595
+ }
596
+ }
597
+
598
+ export interface AgentCreateInvitationsResponse {
599
+ /**
600
+ * Successfully created invitation resources
601
+ */
602
+ data: Array<AgentCreateInvitationsResponse.Data>;
603
+
604
+ /**
605
+ * Batch invitation metadata
606
+ */
607
+ meta: AgentCreateInvitationsResponse.Meta;
608
+ }
609
+
610
+ export namespace AgentCreateInvitationsResponse {
611
+ export interface Data {
612
+ /**
613
+ * Invitation ID (adi\_\*)
614
+ */
615
+ id: string;
616
+
617
+ /**
618
+ * Resource attributes
619
+ */
620
+ attributes: Data.Attributes;
621
+
622
+ /**
623
+ * Related resource identifiers
624
+ */
625
+ relationships: Data.Relationships;
626
+
627
+ /**
628
+ * Resource type
629
+ */
630
+ type: string;
631
+ }
632
+
633
+ export namespace Data {
634
+ /**
635
+ * Resource attributes
636
+ */
637
+ export interface Attributes {
638
+ /**
639
+ * When this invitation was accepted
640
+ */
641
+ acceptedAt: string | null;
642
+
643
+ /**
644
+ * Display name of the agent being delegated
645
+ */
646
+ agentName: string;
647
+
648
+ /**
649
+ * Why the invitation was cancelled
650
+ */
651
+ cancelReason: 'AGENT_RETIRED' | 'DEVELOPER_RETIRED' | null;
652
+
653
+ /**
654
+ * When this invitation was created
655
+ */
656
+ createdAt: string;
657
+
658
+ /**
659
+ * When this invitation was declined
660
+ */
661
+ declinedAt: string | null;
662
+
663
+ /**
664
+ * Display name of the developer party
665
+ */
666
+ developerName: string;
667
+
668
+ /**
669
+ * Status after applying expiry and cancel-reason overlays
670
+ */
671
+ effectiveStatus: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
672
+
673
+ /**
674
+ * Customer email the invitation was sent to
675
+ */
676
+ email: string;
677
+
678
+ /**
679
+ * When this invitation expires
680
+ */
681
+ expiresAt: string;
682
+
683
+ /**
684
+ * Per-agent transaction limits
685
+ */
686
+ limits: Attributes.Limits | null;
687
+
688
+ /**
689
+ * Permissions the agent will hold on accept
690
+ */
691
+ permissions: Array<string>;
692
+
693
+ /**
694
+ * Raw persisted status
695
+ */
696
+ status: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
697
+
698
+ /**
699
+ * When this invitation was last updated
700
+ */
701
+ updatedAt: string;
702
+ }
703
+
704
+ export namespace Attributes {
705
+ /**
706
+ * Per-agent transaction limits
707
+ */
708
+ export interface Limits {
709
+ /**
710
+ * Per-transaction cap, integer cents (USD).
711
+ */
712
+ perTransaction?: number | null;
713
+ }
714
+ }
715
+
716
+ /**
717
+ * Related resource identifiers
718
+ */
719
+ export interface Relationships {
720
+ /**
721
+ * Agent being delegated
722
+ */
723
+ agent: Relationships.Agent;
724
+
725
+ /**
726
+ * Resulting agent delegation once accepted; currently null on public create/list
727
+ * responses
728
+ */
729
+ agentDelegation: Relationships.AgentDelegation;
730
+
731
+ /**
732
+ * Customer party the invitation was accepted on (null until accept)
733
+ */
734
+ customerParty: Relationships.CustomerParty;
735
+
736
+ /**
737
+ * Developer party that issued the invitation
738
+ */
739
+ developerParty: Relationships.DeveloperParty;
740
+ }
741
+
742
+ export namespace Relationships {
743
+ /**
744
+ * Agent being delegated
745
+ */
746
+ export interface Agent {
747
+ /**
748
+ * Related resource identifier
749
+ */
750
+ data: Agent.Data;
751
+ }
752
+
753
+ export namespace Agent {
754
+ /**
755
+ * Related resource identifier
756
+ */
757
+ export interface Data {
758
+ id: string;
759
+
760
+ /**
761
+ * Resource type
762
+ */
763
+ type: string;
764
+ }
765
+ }
766
+
767
+ /**
768
+ * Resulting agent delegation once accepted; currently null on public create/list
769
+ * responses
770
+ */
771
+ export interface AgentDelegation {
772
+ /**
773
+ * Related resource identifier
774
+ */
775
+ data: AgentDelegation.Data | null;
776
+ }
777
+
778
+ export namespace AgentDelegation {
779
+ /**
780
+ * Related resource identifier
781
+ */
782
+ export interface Data {
783
+ id: string;
784
+
785
+ /**
786
+ * Resource type
787
+ */
788
+ type: string;
789
+ }
790
+ }
791
+
792
+ /**
793
+ * Customer party the invitation was accepted on (null until accept)
794
+ */
795
+ export interface CustomerParty {
796
+ /**
797
+ * Related resource identifier
798
+ */
799
+ data: CustomerParty.Data | null;
800
+ }
801
+
802
+ export namespace CustomerParty {
803
+ /**
804
+ * Related resource identifier
805
+ */
806
+ export interface Data {
807
+ id: string;
808
+
809
+ /**
810
+ * Resource type
811
+ */
812
+ type: string;
813
+ }
814
+ }
815
+
816
+ /**
817
+ * Developer party that issued the invitation
818
+ */
819
+ export interface DeveloperParty {
820
+ /**
821
+ * Related resource identifier
822
+ */
823
+ data: DeveloperParty.Data;
824
+ }
825
+
826
+ export namespace DeveloperParty {
827
+ /**
828
+ * Related resource identifier
829
+ */
830
+ export interface Data {
831
+ id: string;
832
+
833
+ /**
834
+ * Resource type
835
+ */
836
+ type: string;
837
+ }
838
+ }
839
+ }
840
+ }
841
+
842
+ /**
843
+ * Batch invitation metadata
844
+ */
845
+ export interface Meta {
846
+ /**
847
+ * Invitation IDs whose welcome-email send failed. Invitations are still persisted;
848
+ * use the resend-email flow to retry.
849
+ */
850
+ emailFailures: Array<string>;
851
+ }
852
+ }
853
+
854
+ export interface AgentGetResponse {
855
+ data: AgentGetResponse.Data;
856
+ }
857
+
858
+ export namespace AgentGetResponse {
859
+ export interface Data {
860
+ /**
861
+ * Resource ID
862
+ */
863
+ id: string;
864
+
865
+ /**
866
+ * Resource attributes
867
+ */
868
+ attributes: Data.Attributes;
869
+
870
+ /**
871
+ * Resource relationships
872
+ */
873
+ relationships: Data.Relationships;
874
+
875
+ /**
876
+ * Resource type
877
+ */
878
+ type: string;
879
+ }
880
+
881
+ export namespace Data {
882
+ /**
883
+ * Resource attributes
884
+ */
885
+ export interface Attributes {
886
+ /**
887
+ * When this agent was created
888
+ */
889
+ createdAt: string | null;
890
+
891
+ /**
892
+ * User who created this agent (usr\_\*)
893
+ */
894
+ createdBy: string | null;
895
+
896
+ /**
897
+ * Agent description
898
+ */
899
+ description: string | null;
900
+
901
+ /**
902
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
903
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
904
+ */
905
+ limits: Attributes.Limits | null;
906
+
907
+ /**
908
+ * Agent display name
909
+ */
910
+ name: string;
911
+
912
+ /**
913
+ * Agent status
914
+ */
915
+ status: 'ACTIVE' | 'REVOKED';
916
+ }
917
+
918
+ export namespace Attributes {
919
+ /**
920
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
921
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
922
+ */
923
+ export interface Limits {
924
+ /**
925
+ * Positive per-transaction limit in cents. null means no per-payment limit.
926
+ */
927
+ perTransaction?: number | null;
928
+ }
929
+ }
930
+
931
+ /**
932
+ * Resource relationships
933
+ */
934
+ export interface Relationships {
935
+ /**
936
+ * Party that owns the agent
937
+ */
938
+ party: Relationships.Party;
939
+ }
940
+
941
+ export namespace Relationships {
942
+ /**
943
+ * Party that owns the agent
944
+ */
945
+ export interface Party {
946
+ /**
947
+ * Related resource identifier
948
+ */
949
+ data: Party.Data;
950
+ }
951
+
952
+ export namespace Party {
953
+ /**
954
+ * Related resource identifier
955
+ */
956
+ export interface Data {
957
+ id: string;
958
+
959
+ /**
960
+ * Resource type
961
+ */
962
+ type: string;
963
+ }
964
+ }
965
+ }
966
+ }
967
+ }
968
+
969
+ export interface AgentListInvitationsForDeveloperResponse {
970
+ data: Array<AgentListInvitationsForDeveloperResponse.Data>;
971
+
972
+ meta: AgentListInvitationsForDeveloperResponse.Meta;
973
+ }
974
+
975
+ export namespace AgentListInvitationsForDeveloperResponse {
976
+ export interface Data {
977
+ /**
978
+ * Invitation ID (adi\_\*)
979
+ */
980
+ id: string;
981
+
982
+ /**
983
+ * Resource attributes
984
+ */
985
+ attributes: Data.Attributes;
986
+
987
+ /**
988
+ * Related resource identifiers
989
+ */
990
+ relationships: Data.Relationships;
991
+
992
+ /**
993
+ * Resource type
994
+ */
995
+ type: string;
996
+ }
997
+
998
+ export namespace Data {
999
+ /**
1000
+ * Resource attributes
1001
+ */
1002
+ export interface Attributes {
1003
+ /**
1004
+ * When this invitation was accepted
1005
+ */
1006
+ acceptedAt: string | null;
1007
+
1008
+ /**
1009
+ * Display name of the agent being delegated
1010
+ */
1011
+ agentName: string;
1012
+
1013
+ /**
1014
+ * Why the invitation was cancelled
1015
+ */
1016
+ cancelReason: 'AGENT_RETIRED' | 'DEVELOPER_RETIRED' | null;
1017
+
1018
+ /**
1019
+ * When this invitation was created
1020
+ */
1021
+ createdAt: string;
1022
+
1023
+ /**
1024
+ * When this invitation was declined
1025
+ */
1026
+ declinedAt: string | null;
1027
+
1028
+ /**
1029
+ * Display name of the developer party
1030
+ */
1031
+ developerName: string;
1032
+
1033
+ /**
1034
+ * Status after applying expiry and cancel-reason overlays
1035
+ */
1036
+ effectiveStatus: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
1037
+
1038
+ /**
1039
+ * Customer email the invitation was sent to
1040
+ */
1041
+ email: string;
1042
+
1043
+ /**
1044
+ * When this invitation expires
1045
+ */
1046
+ expiresAt: string;
1047
+
1048
+ /**
1049
+ * Per-agent transaction limits
1050
+ */
1051
+ limits: Attributes.Limits | null;
1052
+
1053
+ /**
1054
+ * Permissions the agent will hold on accept
1055
+ */
1056
+ permissions: Array<string>;
1057
+
1058
+ /**
1059
+ * Raw persisted status
1060
+ */
1061
+ status: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED';
1062
+
1063
+ /**
1064
+ * When this invitation was last updated
1065
+ */
1066
+ updatedAt: string;
1067
+ }
1068
+
1069
+ export namespace Attributes {
1070
+ /**
1071
+ * Per-agent transaction limits
1072
+ */
1073
+ export interface Limits {
1074
+ /**
1075
+ * Per-transaction cap, integer cents (USD).
1076
+ */
1077
+ perTransaction?: number | null;
1078
+ }
1079
+ }
1080
+
1081
+ /**
1082
+ * Related resource identifiers
1083
+ */
1084
+ export interface Relationships {
1085
+ /**
1086
+ * Agent being delegated
1087
+ */
1088
+ agent: Relationships.Agent;
1089
+
1090
+ /**
1091
+ * Resulting agent delegation once accepted; currently null on public create/list
1092
+ * responses
1093
+ */
1094
+ agentDelegation: Relationships.AgentDelegation;
1095
+
1096
+ /**
1097
+ * Customer party the invitation was accepted on (null until accept)
1098
+ */
1099
+ customerParty: Relationships.CustomerParty;
1100
+
1101
+ /**
1102
+ * Developer party that issued the invitation
1103
+ */
1104
+ developerParty: Relationships.DeveloperParty;
1105
+ }
1106
+
1107
+ export namespace Relationships {
1108
+ /**
1109
+ * Agent being delegated
1110
+ */
1111
+ export interface Agent {
1112
+ /**
1113
+ * Related resource identifier
1114
+ */
1115
+ data: Agent.Data;
1116
+ }
1117
+
1118
+ export namespace Agent {
1119
+ /**
1120
+ * Related resource identifier
1121
+ */
1122
+ export interface Data {
1123
+ id: string;
1124
+
1125
+ /**
1126
+ * Resource type
1127
+ */
1128
+ type: string;
1129
+ }
1130
+ }
1131
+
1132
+ /**
1133
+ * Resulting agent delegation once accepted; currently null on public create/list
1134
+ * responses
1135
+ */
1136
+ export interface AgentDelegation {
1137
+ /**
1138
+ * Related resource identifier
1139
+ */
1140
+ data: AgentDelegation.Data | null;
1141
+ }
1142
+
1143
+ export namespace AgentDelegation {
1144
+ /**
1145
+ * Related resource identifier
1146
+ */
1147
+ export interface Data {
1148
+ id: string;
1149
+
1150
+ /**
1151
+ * Resource type
1152
+ */
1153
+ type: string;
1154
+ }
1155
+ }
1156
+
1157
+ /**
1158
+ * Customer party the invitation was accepted on (null until accept)
1159
+ */
1160
+ export interface CustomerParty {
1161
+ /**
1162
+ * Related resource identifier
1163
+ */
1164
+ data: CustomerParty.Data | null;
1165
+ }
1166
+
1167
+ export namespace CustomerParty {
1168
+ /**
1169
+ * Related resource identifier
1170
+ */
1171
+ export interface Data {
1172
+ id: string;
1173
+
1174
+ /**
1175
+ * Resource type
1176
+ */
1177
+ type: string;
1178
+ }
1179
+ }
1180
+
1181
+ /**
1182
+ * Developer party that issued the invitation
1183
+ */
1184
+ export interface DeveloperParty {
1185
+ /**
1186
+ * Related resource identifier
1187
+ */
1188
+ data: DeveloperParty.Data;
1189
+ }
1190
+
1191
+ export namespace DeveloperParty {
1192
+ /**
1193
+ * Related resource identifier
1194
+ */
1195
+ export interface Data {
1196
+ id: string;
1197
+
1198
+ /**
1199
+ * Resource type
1200
+ */
1201
+ type: string;
1202
+ }
1203
+ }
1204
+ }
1205
+ }
1206
+
1207
+ export interface Meta {
1208
+ pagination: Meta.Pagination;
1209
+ }
1210
+
1211
+ export namespace Meta {
1212
+ export interface Pagination {
1213
+ hasMore: boolean;
1214
+
1215
+ nextCursor: string | null;
1216
+ }
1217
+ }
1218
+ }
1219
+
1220
+ export interface AgentRemoveResponse {
1221
+ data: AgentRemoveResponse.Data;
1222
+
1223
+ meta: AgentRemoveResponse.Meta;
1224
+ }
1225
+
1226
+ export namespace AgentRemoveResponse {
1227
+ export interface Data {
1228
+ /**
1229
+ * Resource ID
1230
+ */
1231
+ id: string;
1232
+
1233
+ /**
1234
+ * Resource attributes
1235
+ */
1236
+ attributes: Data.Attributes;
1237
+
1238
+ /**
1239
+ * Resource relationships
1240
+ */
1241
+ relationships: Data.Relationships;
1242
+
1243
+ /**
1244
+ * Resource type
1245
+ */
1246
+ type: string;
1247
+ }
1248
+
1249
+ export namespace Data {
1250
+ /**
1251
+ * Resource attributes
1252
+ */
1253
+ export interface Attributes {
1254
+ /**
1255
+ * When this agent was created
1256
+ */
1257
+ createdAt: string | null;
1258
+
1259
+ /**
1260
+ * User who created this agent (usr\_\*)
1261
+ */
1262
+ createdBy: string | null;
1263
+
1264
+ /**
1265
+ * Agent description
1266
+ */
1267
+ description: string | null;
1268
+
1269
+ /**
1270
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
1271
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
1272
+ */
1273
+ limits: Attributes.Limits | null;
1274
+
1275
+ /**
1276
+ * Agent display name
1277
+ */
1278
+ name: string;
1279
+
1280
+ /**
1281
+ * Agent status
1282
+ */
1283
+ status: 'ACTIVE' | 'REVOKED';
1284
+ }
1285
+
1286
+ export namespace Attributes {
1287
+ /**
1288
+ * Per-transaction spend cap for actions this agent initiates on its owner's party.
1289
+ * null = no limit. Stored as Policy(scope=Agent(id)) in the policy service.
1290
+ */
1291
+ export interface Limits {
1292
+ /**
1293
+ * Positive per-transaction limit in cents. null means no per-payment limit.
1294
+ */
1295
+ perTransaction?: number | null;
1296
+ }
1297
+ }
1298
+
1299
+ /**
1300
+ * Resource relationships
1301
+ */
1302
+ export interface Relationships {
1303
+ /**
1304
+ * Party that owns the agent
1305
+ */
1306
+ party: Relationships.Party;
1307
+ }
1308
+
1309
+ export namespace Relationships {
1310
+ /**
1311
+ * Party that owns the agent
1312
+ */
1313
+ export interface Party {
1314
+ /**
1315
+ * Related resource identifier
1316
+ */
1317
+ data: Party.Data;
1318
+ }
1319
+
1320
+ export namespace Party {
1321
+ /**
1322
+ * Related resource identifier
1323
+ */
1324
+ export interface Data {
1325
+ id: string;
1326
+
1327
+ /**
1328
+ * Resource type
1329
+ */
1330
+ type: string;
1331
+ }
1332
+ }
1333
+ }
1334
+ }
1335
+
1336
+ export interface Meta {
1337
+ /**
1338
+ * Indicates the resource was deleted
1339
+ */
1340
+ deleted: true;
1341
+ }
1342
+ }
1343
+
1344
+ export interface AgentCreateParams {
1345
+ /**
1346
+ * Body param: Agent display name
1347
+ */
1348
+ name: string;
1349
+
1350
+ /**
1351
+ * Header param: Unique key for idempotent request handling. If a request with the
1352
+ * same key was already processed, the original response is returned.
1353
+ */
1354
+ 'Idempotency-Key': string;
1355
+
1356
+ /**
1357
+ * Body param: Agent description
1358
+ */
1359
+ description?: string;
1360
+
1361
+ /**
1362
+ * Body param: Optional per-transaction limit for the agent
1363
+ */
1364
+ limits?: AgentCreateParams.Limits;
1365
+
1366
+ /**
1367
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1368
+ */
1369
+ 'X-Agent-ID'?: string;
1370
+
1371
+ /**
1372
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1373
+ * for agent observability.
1374
+ */
1375
+ 'X-Instance-ID'?: string;
1376
+ }
1377
+
1378
+ export namespace AgentCreateParams {
1379
+ /**
1380
+ * Optional per-transaction limit for the agent
1381
+ */
1382
+ export interface Limits {
1383
+ /**
1384
+ * Positive per-transaction limit in cents. null means no per-payment limit.
1385
+ */
1386
+ perTransaction?: number | null;
1387
+ }
1388
+ }
1389
+
1390
+ export interface AgentUpdateParams {
1391
+ /**
1392
+ * Header param: Unique key for idempotent request handling. If a request with the
1393
+ * same key was already processed, the original response is returned.
1394
+ */
1395
+ 'Idempotency-Key': string;
1396
+
1397
+ /**
1398
+ * Body param: Updated description
1399
+ */
1400
+ description?: string | null;
1401
+
1402
+ /**
1403
+ * Body param: Per-transaction spend cap. null clears the limit; omitted leaves it
1404
+ * unchanged.
1405
+ */
1406
+ limits?: AgentUpdateParams.Limits | null;
1407
+
1408
+ /**
1409
+ * Body param: Updated name for the agent
1410
+ */
1411
+ name?: string | null;
1412
+
1413
+ /**
1414
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1415
+ */
1416
+ 'X-Agent-ID'?: string;
1417
+
1418
+ /**
1419
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1420
+ * for agent observability.
1421
+ */
1422
+ 'X-Instance-ID'?: string;
1423
+ }
1424
+
1425
+ export namespace AgentUpdateParams {
1426
+ /**
1427
+ * Per-transaction spend cap. null clears the limit; omitted leaves it unchanged.
1428
+ */
1429
+ export interface Limits {
1430
+ /**
1431
+ * Positive per-transaction limit in cents. null means no per-payment limit.
1432
+ */
1433
+ perTransaction?: number | null;
1434
+ }
1435
+ }
1436
+
1437
+ export interface AgentListParams {
1438
+ /**
1439
+ * Query param: Cursor for the next page
1440
+ */
1441
+ cursor?: string;
1442
+
1443
+ /**
1444
+ * Query param: Maximum number of agents to return
1445
+ */
1446
+ limit?: number;
1447
+
1448
+ /**
1449
+ * Query param: Filter by status
1450
+ */
1451
+ status?: 'ACTIVE' | 'REVOKED';
1452
+
1453
+ /**
1454
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1455
+ */
1456
+ 'X-Agent-ID'?: string;
1457
+
1458
+ /**
1459
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1460
+ * for agent observability.
1461
+ */
1462
+ 'X-Instance-ID'?: string;
1463
+ }
1464
+
1465
+ export interface AgentCreateInvitationsParams {
1466
+ /**
1467
+ * Body param: Per-agent delegation requests (1-50)
1468
+ */
1469
+ agents: Array<AgentCreateInvitationsParams.Agent>;
1470
+
1471
+ /**
1472
+ * Body param: Email address of the customer to invite
1473
+ */
1474
+ customerEmail: string;
1475
+
1476
+ /**
1477
+ * Header param: Unique key for idempotent request handling. If a request with the
1478
+ * same key was already processed, the original response is returned.
1479
+ */
1480
+ 'Idempotency-Key': string;
1481
+
1482
+ /**
1483
+ * Body param: Optional explicit expiry timestamp; server defaults to 7 days
1484
+ */
1485
+ expiresAt?: string;
1486
+
1487
+ /**
1488
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1489
+ */
1490
+ 'X-Agent-ID'?: string;
1491
+
1492
+ /**
1493
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1494
+ * for agent observability.
1495
+ */
1496
+ 'X-Instance-ID'?: string;
1497
+ }
1498
+
1499
+ export namespace AgentCreateInvitationsParams {
1500
+ export interface Agent {
1501
+ agentId: string;
1502
+
1503
+ permissions: Array<string>;
1504
+
1505
+ limits?: Agent.Limits;
1506
+ }
1507
+
1508
+ export namespace Agent {
1509
+ export interface Limits {
1510
+ /**
1511
+ * Per-transaction cap, integer cents (USD).
1512
+ */
1513
+ perTransaction?: number | null;
1514
+ }
1515
+ }
1516
+ }
1517
+
1518
+ export interface AgentGetParams {
1519
+ /**
1520
+ * Agent ID (agt_xxx) identifying which agent is making the request.
1521
+ */
1522
+ 'X-Agent-ID'?: string;
1523
+
1524
+ /**
1525
+ * Required when X-Agent-ID is present. Session or conversation ID for agent
1526
+ * observability.
1527
+ */
1528
+ 'X-Instance-ID'?: string;
1529
+ }
1530
+
1531
+ export interface AgentListInvitationsForDeveloperParams {
1532
+ /**
1533
+ * Query param
1534
+ */
1535
+ agentId?: string;
1536
+
1537
+ /**
1538
+ * Query param
1539
+ */
1540
+ cursor?: string;
1541
+
1542
+ /**
1543
+ * Query param
1544
+ */
1545
+ customerEmail?: string;
1546
+
1547
+ /**
1548
+ * Query param
1549
+ */
1550
+ limit?: number;
1551
+
1552
+ /**
1553
+ * Query param
1554
+ */
1555
+ status?: Array<'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' | 'CANCELLED'>;
1556
+
1557
+ /**
1558
+ * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1559
+ */
1560
+ 'X-Agent-ID'?: string;
1561
+
1562
+ /**
1563
+ * Header param: Required when X-Agent-ID is present. Session or conversation ID
1564
+ * for agent observability.
1565
+ */
1566
+ 'X-Instance-ID'?: string;
1567
+ }
1568
+
1569
+ export interface AgentRemoveParams {
1570
+ /**
1571
+ * Unique key for idempotent request handling. If a request with the same key was
1572
+ * already processed, the original response is returned.
1573
+ */
1574
+ 'Idempotency-Key': string;
1575
+
1576
+ /**
1577
+ * Agent ID (agt_xxx) identifying which agent is making the request.
1578
+ */
1579
+ 'X-Agent-ID'?: string;
1580
+
1581
+ /**
1582
+ * Required when X-Agent-ID is present. Session or conversation ID for agent
1583
+ * observability.
1584
+ */
1585
+ 'X-Instance-ID'?: string;
1586
+ }
1587
+
1588
+ export declare namespace Agents {
1589
+ export {
1590
+ type AgentCreateResponse as AgentCreateResponse,
1591
+ type AgentUpdateResponse as AgentUpdateResponse,
1592
+ type AgentListResponse as AgentListResponse,
1593
+ type AgentCreateInvitationsResponse as AgentCreateInvitationsResponse,
1594
+ type AgentGetResponse as AgentGetResponse,
1595
+ type AgentListInvitationsForDeveloperResponse as AgentListInvitationsForDeveloperResponse,
1596
+ type AgentRemoveResponse as AgentRemoveResponse,
1597
+ type AgentCreateParams as AgentCreateParams,
1598
+ type AgentUpdateParams as AgentUpdateParams,
1599
+ type AgentListParams as AgentListParams,
1600
+ type AgentCreateInvitationsParams as AgentCreateInvitationsParams,
1601
+ type AgentGetParams as AgentGetParams,
1602
+ type AgentListInvitationsForDeveloperParams as AgentListInvitationsForDeveloperParams,
1603
+ type AgentRemoveParams as AgentRemoveParams,
1604
+ };
1605
+ }