tapimo 0.10.2 → 0.12.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 (386) hide show
  1. package/dist/App.d.ts +4896 -2166
  2. package/dist/App.d.ts.map +1 -1
  3. package/dist/App.js +2 -2
  4. package/dist/App.js.map +1 -1
  5. package/dist/Assets.d.ts +15 -0
  6. package/dist/Assets.d.ts.map +1 -1
  7. package/dist/Assets.js +7 -0
  8. package/dist/Assets.js.map +1 -1
  9. package/dist/Webhooks.d.ts +0 -75
  10. package/dist/Webhooks.d.ts.map +1 -1
  11. package/dist/Webhooks.js +1 -143
  12. package/dist/Webhooks.js.map +1 -1
  13. package/dist/admin/App.d.ts +127 -78
  14. package/dist/admin/App.d.ts.map +1 -1
  15. package/dist/admin/apps/earn-vaults.d.ts +115 -1
  16. package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
  17. package/dist/admin/apps/earn-vaults.js +59 -6
  18. package/dist/admin/apps/earn-vaults.js.map +1 -1
  19. package/dist/admin/apps/organizations.d.ts +3 -3
  20. package/dist/admin/apps/organizations.d.ts.map +1 -1
  21. package/dist/admin/apps/organizations.js +4 -2
  22. package/dist/admin/apps/organizations.js.map +1 -1
  23. package/dist/admin/apps/verified-tokens.d.ts +83 -83
  24. package/dist/admin/ui.generated.d.ts +1 -1
  25. package/dist/admin/ui.generated.d.ts.map +1 -1
  26. package/dist/admin/ui.generated.js +151 -151
  27. package/dist/admin/ui.generated.js.map +1 -1
  28. package/dist/apps/data/App.d.ts +5924 -4310
  29. package/dist/apps/data/App.d.ts.map +1 -1
  30. package/dist/apps/data/App.js +61 -9
  31. package/dist/apps/data/App.js.map +1 -1
  32. package/dist/apps/data/ZoneSelection.d.ts +62 -0
  33. package/dist/apps/data/ZoneSelection.d.ts.map +1 -0
  34. package/dist/apps/data/ZoneSelection.js +44 -0
  35. package/dist/apps/data/ZoneSelection.js.map +1 -0
  36. package/dist/apps/data/routes/activities.d.ts +2368 -5
  37. package/dist/apps/data/routes/activities.d.ts.map +1 -1
  38. package/dist/apps/data/routes/activities.js +423 -114
  39. package/dist/apps/data/routes/activities.js.map +1 -1
  40. package/dist/apps/data/routes/addresses.d.ts +131 -0
  41. package/dist/apps/data/routes/addresses.d.ts.map +1 -1
  42. package/dist/apps/data/routes/balances.d.ts +25 -25
  43. package/dist/apps/data/routes/balances.js +1 -1
  44. package/dist/apps/data/routes/balances.js.map +1 -1
  45. package/dist/apps/data/routes/blocks.d.ts +1 -1
  46. package/dist/apps/data/routes/blocks.js +1 -1
  47. package/dist/apps/data/routes/blocks.js.map +1 -1
  48. package/dist/apps/data/routes/earn.d.ts +135 -10
  49. package/dist/apps/data/routes/earn.d.ts.map +1 -1
  50. package/dist/apps/data/routes/earn.js +157 -25
  51. package/dist/apps/data/routes/earn.js.map +1 -1
  52. package/dist/apps/data/routes/exchanges.d.ts +829 -123
  53. package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
  54. package/dist/apps/data/routes/exchanges.js +16 -13
  55. package/dist/apps/data/routes/exchanges.js.map +1 -1
  56. package/dist/apps/data/routes/fee-amm.d.ts +26 -26
  57. package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
  58. package/dist/apps/data/routes/fee-amm.js +9 -11
  59. package/dist/apps/data/routes/fee-amm.js.map +1 -1
  60. package/dist/apps/data/routes/receipts.d.ts +54 -54
  61. package/dist/apps/data/routes/receipts.js +1 -1
  62. package/dist/apps/data/routes/receipts.js.map +1 -1
  63. package/dist/apps/data/routes/rpc.js +24 -10
  64. package/dist/apps/data/routes/rpc.js.map +1 -1
  65. package/dist/apps/data/routes/tokenlist.d.ts +12 -12
  66. package/dist/apps/data/routes/tokenlist.d.ts.map +1 -1
  67. package/dist/apps/data/routes/tokenlist.js +16 -15
  68. package/dist/apps/data/routes/tokenlist.js.map +1 -1
  69. package/dist/apps/data/routes/tokens.d.ts +17 -3
  70. package/dist/apps/data/routes/tokens.d.ts.map +1 -1
  71. package/dist/apps/data/routes/tokens.js +34 -15
  72. package/dist/apps/data/routes/tokens.js.map +1 -1
  73. package/dist/apps/data/routes/transactions.d.ts +1 -1
  74. package/dist/apps/data/routes/transactions.js +1 -1
  75. package/dist/apps/data/routes/transactions.js.map +1 -1
  76. package/dist/apps/data/routes/transfers.d.ts +13 -13
  77. package/dist/apps/data/routes/transfers.d.ts.map +1 -1
  78. package/dist/apps/data/routes/transfers.js +7 -9
  79. package/dist/apps/data/routes/transfers.js.map +1 -1
  80. package/dist/apps/data/routes/valuation.d.ts +21 -21
  81. package/dist/apps/data/routes/verified-tokens.d.ts +5 -5
  82. package/dist/apps/data/routes/webhooks.d.ts +1011 -151
  83. package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
  84. package/dist/apps/data/routes/webhooks.js +126 -739
  85. package/dist/apps/data/routes/webhooks.js.map +1 -1
  86. package/dist/apps/data/routes/zones.d.ts +15 -15
  87. package/dist/apps/funding/App.d.ts +27 -27
  88. package/dist/apps/funding/routes/chains.d.ts.map +1 -1
  89. package/dist/apps/funding/routes/chains.js +5 -4
  90. package/dist/apps/funding/routes/chains.js.map +1 -1
  91. package/dist/apps/funding/routes/deposit-addresses.d.ts +18 -18
  92. package/dist/apps/funding/routes/deposit-addresses.d.ts.map +1 -1
  93. package/dist/apps/funding/routes/deposit-addresses.js +8 -8
  94. package/dist/apps/funding/routes/deposit-addresses.js.map +1 -1
  95. package/dist/apps/funding/routes/providers.d.ts.map +1 -1
  96. package/dist/apps/funding/routes/providers.js +3 -2
  97. package/dist/apps/funding/routes/providers.js.map +1 -1
  98. package/dist/apps/funding/routes/quotes.d.ts.map +1 -1
  99. package/dist/apps/funding/routes/quotes.js +2 -2
  100. package/dist/apps/funding/routes/quotes.js.map +1 -1
  101. package/dist/apps/funding/routes/transfers.d.ts +33 -33
  102. package/dist/apps/management/App.d.ts +1433 -322
  103. package/dist/apps/management/App.d.ts.map +1 -1
  104. package/dist/apps/management/Billing.d.ts.map +1 -1
  105. package/dist/apps/management/Billing.js +19 -6
  106. package/dist/apps/management/Billing.js.map +1 -1
  107. package/dist/apps/management/routes/api-keys.d.ts +154 -94
  108. package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
  109. package/dist/apps/management/routes/api-keys.js +76 -30
  110. package/dist/apps/management/routes/api-keys.js.map +1 -1
  111. package/dist/apps/management/routes/billing.d.ts +103 -30
  112. package/dist/apps/management/routes/billing.d.ts.map +1 -1
  113. package/dist/apps/management/routes/billing.js +91 -32
  114. package/dist/apps/management/routes/billing.js.map +1 -1
  115. package/dist/apps/management/routes/faucet.d.ts +12 -12
  116. package/dist/apps/management/routes/faucet.d.ts.map +1 -1
  117. package/dist/apps/management/routes/faucet.js +23 -12
  118. package/dist/apps/management/routes/faucet.js.map +1 -1
  119. package/dist/apps/management/routes/invitations.d.ts +46 -13
  120. package/dist/apps/management/routes/invitations.d.ts.map +1 -1
  121. package/dist/apps/management/routes/invitations.js +79 -29
  122. package/dist/apps/management/routes/invitations.js.map +1 -1
  123. package/dist/apps/management/routes/invite-links.d.ts +128 -83
  124. package/dist/apps/management/routes/invite-links.d.ts.map +1 -1
  125. package/dist/apps/management/routes/invite-links.js +100 -41
  126. package/dist/apps/management/routes/invite-links.js.map +1 -1
  127. package/dist/apps/management/routes/me.d.ts +5 -5
  128. package/dist/apps/management/routes/me.d.ts.map +1 -1
  129. package/dist/apps/management/routes/me.js +14 -10
  130. package/dist/apps/management/routes/me.js.map +1 -1
  131. package/dist/apps/management/routes/members.d.ts +68 -47
  132. package/dist/apps/management/routes/members.d.ts.map +1 -1
  133. package/dist/apps/management/routes/members.js +37 -18
  134. package/dist/apps/management/routes/members.js.map +1 -1
  135. package/dist/apps/management/routes/orgs.d.ts +48 -8
  136. package/dist/apps/management/routes/orgs.d.ts.map +1 -1
  137. package/dist/apps/management/routes/orgs.js +48 -19
  138. package/dist/apps/management/routes/orgs.js.map +1 -1
  139. package/dist/apps/management/routes/projects.d.ts +130 -68
  140. package/dist/apps/management/routes/projects.d.ts.map +1 -1
  141. package/dist/apps/management/routes/projects.js +72 -21
  142. package/dist/apps/management/routes/projects.js.map +1 -1
  143. package/dist/apps/management/routes/scopes.d.ts.map +1 -1
  144. package/dist/apps/management/routes/scopes.js +8 -5
  145. package/dist/apps/management/routes/scopes.js.map +1 -1
  146. package/dist/apps/management/routes/usage.d.ts +38 -38
  147. package/dist/apps/management/routes/usage.d.ts.map +1 -1
  148. package/dist/apps/management/routes/usage.js +41 -31
  149. package/dist/apps/management/routes/usage.js.map +1 -1
  150. package/dist/apps/management/routes/verified-token-requests.d.ts +34 -6
  151. package/dist/apps/management/routes/verified-token-requests.d.ts.map +1 -1
  152. package/dist/apps/management/routes/verified-token-requests.js +36 -17
  153. package/dist/apps/management/routes/verified-token-requests.js.map +1 -1
  154. package/dist/apps/management/routes/webhooks.d.ts +1186 -197
  155. package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
  156. package/dist/apps/management/routes/webhooks.js +106 -38
  157. package/dist/apps/management/routes/webhooks.js.map +1 -1
  158. package/dist/apps/mpp/internal/Adapter.d.ts +1 -1
  159. package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -1
  160. package/dist/apps/mpp/internal/Adapter.js +12 -0
  161. package/dist/apps/mpp/internal/Adapter.js.map +1 -1
  162. package/dist/db/Db.d.ts +2 -0
  163. package/dist/db/Db.d.ts.map +1 -1
  164. package/dist/db/Db.js +61 -0
  165. package/dist/db/Db.js.map +1 -1
  166. package/dist/db/Schema.d.ts +30 -2
  167. package/dist/db/Schema.d.ts.map +1 -1
  168. package/dist/db/Schema.js +28 -3
  169. package/dist/db/Schema.js.map +1 -1
  170. package/dist/db/tables/earnVaults.d.ts +5 -1
  171. package/dist/db/tables/earnVaults.d.ts.map +1 -1
  172. package/dist/db/tables/earnVaults.js +5 -0
  173. package/dist/db/tables/earnVaults.js.map +1 -1
  174. package/dist/db/tables/webhookDeliveries.d.ts.map +1 -1
  175. package/dist/db/tables/webhookDeliveries.js +10 -0
  176. package/dist/db/tables/webhookDeliveries.js.map +1 -1
  177. package/dist/db/tables/webhookQueueCompletions.d.ts +15 -0
  178. package/dist/db/tables/webhookQueueCompletions.d.ts.map +1 -0
  179. package/dist/db/tables/webhookQueueCompletions.js +32 -0
  180. package/dist/db/tables/webhookQueueCompletions.js.map +1 -0
  181. package/dist/db/tables/webhookQueueEvents.d.ts +16 -20
  182. package/dist/db/tables/webhookQueueEvents.d.ts.map +1 -1
  183. package/dist/db/tables/webhookQueueEvents.js +68 -43
  184. package/dist/db/tables/webhookQueueEvents.js.map +1 -1
  185. package/dist/db/tables/webhookSubscriptions.d.ts +47 -72
  186. package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
  187. package/dist/db/tables/webhookSubscriptions.js +92 -105
  188. package/dist/db/tables/webhookSubscriptions.js.map +1 -1
  189. package/dist/internal/Auth.d.ts +8 -1
  190. package/dist/internal/Auth.d.ts.map +1 -1
  191. package/dist/internal/Auth.js +13 -3
  192. package/dist/internal/Auth.js.map +1 -1
  193. package/dist/internal/Cache.d.ts.map +1 -1
  194. package/dist/internal/Cache.js +11 -7
  195. package/dist/internal/Cache.js.map +1 -1
  196. package/dist/internal/EarnVaults.d.ts +41 -2
  197. package/dist/internal/EarnVaults.d.ts.map +1 -1
  198. package/dist/internal/EarnVaults.js +167 -0
  199. package/dist/internal/EarnVaults.js.map +1 -1
  200. package/dist/internal/MetricSink.d.ts +35 -125
  201. package/dist/internal/MetricSink.d.ts.map +1 -1
  202. package/dist/internal/MetricSink.js +50 -121
  203. package/dist/internal/MetricSink.js.map +1 -1
  204. package/dist/internal/OpenApi.d.ts +26 -22
  205. package/dist/internal/OpenApi.d.ts.map +1 -1
  206. package/dist/internal/OpenApi.js +128 -39
  207. package/dist/internal/OpenApi.js.map +1 -1
  208. package/dist/internal/Response.d.ts +13 -8
  209. package/dist/internal/Response.d.ts.map +1 -1
  210. package/dist/internal/Response.js +16 -5
  211. package/dist/internal/Response.js.map +1 -1
  212. package/dist/internal/Schema.d.ts +8 -8
  213. package/dist/internal/Schema.d.ts.map +1 -1
  214. package/dist/internal/Schema.js +10 -9
  215. package/dist/internal/Schema.js.map +1 -1
  216. package/dist/internal/Store.d.ts +15 -6
  217. package/dist/internal/Store.d.ts.map +1 -1
  218. package/dist/internal/Store.js +45 -15
  219. package/dist/internal/Store.js.map +1 -1
  220. package/dist/internal/Tidx.d.ts +2 -0
  221. package/dist/internal/Tidx.d.ts.map +1 -1
  222. package/dist/internal/Tidx.js +16 -4
  223. package/dist/internal/Tidx.js.map +1 -1
  224. package/dist/internal/WebhookTransfer.d.ts +1 -55
  225. package/dist/internal/WebhookTransfer.d.ts.map +1 -1
  226. package/dist/internal/WebhookTransfer.js +1 -239
  227. package/dist/internal/WebhookTransfer.js.map +1 -1
  228. package/dist/internal/Webhooks.d.ts +112 -56
  229. package/dist/internal/Webhooks.d.ts.map +1 -1
  230. package/dist/internal/Webhooks.js +124 -93
  231. package/dist/internal/Webhooks.js.map +1 -1
  232. package/dist/internal/funding/Deposit.d.ts +2 -2
  233. package/dist/internal/funding/Deposit.d.ts.map +1 -1
  234. package/dist/internal/funding/Deposit.js +9 -8
  235. package/dist/internal/funding/Deposit.js.map +1 -1
  236. package/dist/internal/funding/DepositAddress.d.ts +4 -4
  237. package/dist/internal/funding/DepositAddress.d.ts.map +1 -1
  238. package/dist/internal/funding/DepositAddress.js +9 -8
  239. package/dist/internal/funding/DepositAddress.js.map +1 -1
  240. package/dist/internal/funding/DepositWebhook.d.ts +25 -0
  241. package/dist/internal/funding/DepositWebhook.d.ts.map +1 -0
  242. package/dist/internal/funding/DepositWebhook.js +74 -0
  243. package/dist/internal/funding/DepositWebhook.js.map +1 -0
  244. package/dist/internal/funding/Provider.d.ts.map +1 -1
  245. package/dist/internal/funding/Provider.js +13 -12
  246. package/dist/internal/funding/Provider.js.map +1 -1
  247. package/dist/internal/funding/Reconciliation.d.ts +6 -0
  248. package/dist/internal/funding/Reconciliation.d.ts.map +1 -1
  249. package/dist/internal/funding/Reconciliation.js +42 -10
  250. package/dist/internal/funding/Reconciliation.js.map +1 -1
  251. package/dist/internal/funding/index.d.ts +1 -0
  252. package/dist/internal/funding/index.d.ts.map +1 -1
  253. package/dist/internal/funding/index.js +1 -0
  254. package/dist/internal/funding/index.js.map +1 -1
  255. package/dist/internal/funding/providers/stargate.d.ts +19 -0
  256. package/dist/internal/funding/providers/stargate.d.ts.map +1 -0
  257. package/dist/internal/funding/providers/stargate.js +143 -0
  258. package/dist/internal/funding/providers/stargate.js.map +1 -0
  259. package/dist/internal/webhookDestinations/slack.d.ts.map +1 -1
  260. package/dist/internal/webhookDestinations/slack.js +16 -0
  261. package/dist/internal/webhookDestinations/slack.js.map +1 -1
  262. package/dist/providers/index.d.ts +7 -0
  263. package/dist/providers/index.d.ts.map +1 -1
  264. package/dist/providers/index.js +3 -0
  265. package/dist/providers/index.js.map +1 -1
  266. package/package.json +2 -2
  267. package/src/App.test.ts +48 -0
  268. package/src/App.ts +7 -2
  269. package/src/Assets.test.ts +18 -0
  270. package/src/Assets.ts +22 -0
  271. package/src/Client.test-d.ts +287 -17
  272. package/src/Webhooks.ts +1 -220
  273. package/src/admin/apps/earn-vaults.test.ts +143 -0
  274. package/src/admin/apps/earn-vaults.ts +83 -6
  275. package/src/admin/apps/organizations.ts +6 -2
  276. package/src/admin/ui/src/routes/api-keys.tsx +36 -0
  277. package/src/admin/ui.generated.ts +151 -189
  278. package/src/apps/data/App.test.ts +31 -0
  279. package/src/apps/data/App.ts +64 -10
  280. package/src/apps/data/ZoneSelection.test.ts +196 -0
  281. package/src/apps/data/ZoneSelection.ts +108 -0
  282. package/src/apps/data/routes/activities.test.ts +435 -12
  283. package/src/apps/data/routes/activities.ts +562 -125
  284. package/src/apps/data/routes/balances.ts +1 -1
  285. package/src/apps/data/routes/blocks.ts +1 -1
  286. package/src/apps/data/routes/earn.test.ts +183 -23
  287. package/src/apps/data/routes/earn.ts +225 -29
  288. package/src/apps/data/routes/earn.zone-access.test.ts +46 -0
  289. package/src/apps/data/routes/exchanges.test.ts +31 -1
  290. package/src/apps/data/routes/exchanges.ts +19 -15
  291. package/src/apps/data/routes/fee-amm.ts +18 -11
  292. package/src/apps/data/routes/receipts.ts +1 -1
  293. package/src/apps/data/routes/rpc.test.ts +75 -0
  294. package/src/apps/data/routes/rpc.ts +23 -9
  295. package/src/apps/data/routes/tokenlist.ts +21 -18
  296. package/src/apps/data/routes/tokens.test.ts +29 -0
  297. package/src/apps/data/routes/tokens.ts +38 -15
  298. package/src/apps/data/routes/transactions.ts +1 -1
  299. package/src/apps/data/routes/transfers.test.ts +3 -3
  300. package/src/apps/data/routes/transfers.ts +12 -9
  301. package/src/apps/data/routes/webhooks.test.ts +179 -1497
  302. package/src/apps/data/routes/webhooks.ts +156 -976
  303. package/src/apps/data/routes/zones.test.ts +19 -13
  304. package/src/apps/funding/routes/chains.test.ts +211 -7
  305. package/src/apps/funding/routes/chains.ts +19 -12
  306. package/src/apps/funding/routes/deposit-addresses.test.ts +394 -0
  307. package/src/apps/funding/routes/deposit-addresses.ts +84 -72
  308. package/src/apps/funding/routes/providers.ts +9 -5
  309. package/src/apps/funding/routes/quotes.test.ts +46 -0
  310. package/src/apps/funding/routes/quotes.ts +8 -5
  311. package/src/apps/funding/routes/transfers.test.ts +35 -32
  312. package/src/apps/management/Billing.test.ts +26 -0
  313. package/src/apps/management/Billing.ts +24 -7
  314. package/src/apps/management/routes/api-keys.test.ts +178 -0
  315. package/src/apps/management/routes/api-keys.ts +203 -144
  316. package/src/apps/management/routes/billing.test.ts +209 -0
  317. package/src/apps/management/routes/billing.ts +254 -177
  318. package/src/apps/management/routes/faucet.test.ts +39 -0
  319. package/src/apps/management/routes/faucet.ts +75 -41
  320. package/src/apps/management/routes/invitations.test.ts +216 -0
  321. package/src/apps/management/routes/invitations.ts +186 -109
  322. package/src/apps/management/routes/invite-links.test.ts +263 -1
  323. package/src/apps/management/routes/invite-links.ts +295 -214
  324. package/src/apps/management/routes/me.test.ts +49 -0
  325. package/src/apps/management/routes/me.ts +42 -32
  326. package/src/apps/management/routes/members.test.ts +124 -1
  327. package/src/apps/management/routes/members.ts +81 -51
  328. package/src/apps/management/routes/orgs.test.ts +176 -0
  329. package/src/apps/management/routes/orgs.ts +101 -59
  330. package/src/apps/management/routes/projects.test.ts +183 -0
  331. package/src/apps/management/routes/projects.ts +124 -60
  332. package/src/apps/management/routes/scopes.test.ts +44 -0
  333. package/src/apps/management/routes/scopes.ts +37 -28
  334. package/src/apps/management/routes/usage.test.ts +92 -0
  335. package/src/apps/management/routes/usage.ts +186 -151
  336. package/src/apps/management/routes/verified-token-requests.test.ts +114 -0
  337. package/src/apps/management/routes/verified-token-requests.ts +166 -133
  338. package/src/apps/management/routes/webhooks.test.ts +313 -1
  339. package/src/apps/management/routes/webhooks.ts +220 -71
  340. package/src/apps/mpp/internal/Adapter.ts +13 -1
  341. package/src/db/Db.test.ts +42 -5
  342. package/src/db/Db.ts +85 -0
  343. package/src/db/Schema.ts +41 -3
  344. package/src/db/tables/earnVaults.test.ts +22 -0
  345. package/src/db/tables/earnVaults.ts +11 -1
  346. package/src/db/tables/organizations.test.ts +5 -2
  347. package/src/db/tables/webhookDeliveries.ts +13 -0
  348. package/src/db/tables/webhookQueueCompletions.ts +55 -0
  349. package/src/db/tables/webhookQueueEvents.ts +97 -57
  350. package/src/db/tables/webhookSubscriptions.ts +134 -144
  351. package/src/internal/Auth.ts +23 -5
  352. package/src/internal/Cache.ts +14 -7
  353. package/src/internal/EarnVaults.capabilities.test.ts +33 -0
  354. package/src/internal/EarnVaults.test.ts +79 -0
  355. package/src/internal/EarnVaults.ts +277 -0
  356. package/src/internal/MetricSink.test.ts +41 -373
  357. package/src/internal/MetricSink.ts +92 -273
  358. package/src/internal/OpenApi.ts +165 -49
  359. package/src/internal/Response.test.ts +95 -0
  360. package/src/internal/Response.ts +40 -2
  361. package/src/internal/Schema.test.ts +34 -0
  362. package/src/internal/Schema.ts +20 -9
  363. package/src/internal/Store.test.ts +186 -0
  364. package/src/internal/Store.ts +57 -17
  365. package/src/internal/Tidx.test.ts +19 -0
  366. package/src/internal/Tidx.ts +16 -4
  367. package/src/internal/WebhookTransfer.ts +1 -351
  368. package/src/internal/Webhooks.test.ts +222 -145
  369. package/src/internal/Webhooks.ts +234 -135
  370. package/src/internal/funding/Deposit.ts +71 -64
  371. package/src/internal/funding/DepositAddress.ts +50 -43
  372. package/src/internal/funding/DepositWebhook.test.ts +131 -0
  373. package/src/internal/funding/DepositWebhook.ts +101 -0
  374. package/src/internal/funding/Provider.ts +164 -142
  375. package/src/internal/funding/Reconciliation.test.ts +14 -0
  376. package/src/internal/funding/Reconciliation.ts +161 -86
  377. package/src/internal/funding/index.test.ts +1 -0
  378. package/src/internal/funding/index.ts +1 -0
  379. package/src/internal/funding/providers/index.test.ts +185 -0
  380. package/src/internal/funding/providers/stargate.ts +184 -0
  381. package/src/internal/webhookDestinations/slack.ts +15 -0
  382. package/src/providers/index.test.ts +1 -0
  383. package/src/providers/index.ts +9 -0
  384. package/src/Webhooks.bench.ts +0 -714
  385. package/src/Webhooks.memory.bench.ts +0 -250
  386. package/src/Webhooks.test.ts +0 -146
@@ -23,44 +23,50 @@ export namespace schema {
23
23
  .check(z.describe('Role granted when the invitation is accepted.'), z.meta({ examples: ['member'] })) // prettier-ignore
24
24
 
25
25
  /** One pending invitation. */
26
- export const Invitation = Schema.describe(
27
- z.object({
28
- createdAt: z
29
- .string()
30
- .check(
31
- z.describe('When the invitation was created (ISO 8601).'),
32
- z.meta({ examples: ['2026-01-01T00:00:00.000Z'] }),
33
- ),
34
- email: z
35
- .string()
36
- .check(z.describe('Invitee email (lowercase).'), z.meta({ examples: ['dev@example.com'] })),
37
- expiresAt: z
38
- .string()
39
- .check(
40
- z.describe('When the invitation expires (ISO 8601).'),
41
- z.meta({ examples: ['2026-01-08T00:00:00.000Z'] }),
42
- ),
43
- id: z
44
- .string()
45
- .check(
46
- z.describe('Opaque invitation id (`inv_…`).'),
47
- z.meta({ examples: ['inv_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
48
- ),
49
- invitedBy: z
50
- .string()
51
- .check(
52
- z.describe('User or API key id that created the invitation.'),
53
- z.meta({ examples: ['usr_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
54
- ),
55
- orgId: z
56
- .string()
57
- .check(
58
- z.describe('Organization id (`org_…`) the invitation joins.'),
59
- z.meta({ examples: ['org_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
60
- ),
61
- role,
62
- }),
63
- 'One pending invitation.',
26
+ export const Invitation = OpenApi.component(
27
+ Schema.describe(
28
+ z.object({
29
+ createdAt: z.iso
30
+ .datetime()
31
+ .check(
32
+ z.describe('When the invitation was created (ISO 8601).'),
33
+ z.meta({ examples: ['2026-01-01T00:00:00.000Z'] }),
34
+ ),
35
+ email: z
36
+ .email()
37
+ .check(
38
+ z.describe('Invitee email (lowercase).'),
39
+ z.meta({ examples: ['dev@example.com'] }),
40
+ ),
41
+ expiresAt: z.iso
42
+ .datetime()
43
+ .check(
44
+ z.describe('When the invitation expires (ISO 8601).'),
45
+ z.meta({ examples: ['2026-01-08T00:00:00.000Z'] }),
46
+ ),
47
+ id: z
48
+ .string()
49
+ .check(
50
+ z.describe('Opaque invitation id (`inv_…`).'),
51
+ z.meta({ examples: ['inv_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
52
+ ),
53
+ invitedBy: z
54
+ .string()
55
+ .check(
56
+ z.describe('User or API key id that created the invitation.'),
57
+ z.meta({ examples: ['usr_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
58
+ ),
59
+ orgId: z
60
+ .string()
61
+ .check(
62
+ z.describe('Organization id (`org_…`) the invitation joins.'),
63
+ z.meta({ examples: ['org_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
64
+ ),
65
+ role,
66
+ }),
67
+ 'One pending invitation.',
68
+ ),
69
+ 'Invitation',
64
70
  )
65
71
 
66
72
  /** Path parameters addressing an organization's invitation collection. */
@@ -106,100 +112,128 @@ export namespace schema {
106
112
  .check(z.describe("Path parameters for one of the caller's invitations."))
107
113
 
108
114
  /** Request body creating an invitation. */
109
- export const InvitationBody = z
110
- .object({
111
- email: z
112
- .email()
113
- .check(z.describe('Invitee email.'), z.meta({ examples: ['dev@example.com'] })),
114
- role,
115
- })
116
- .check(z.describe('Fields for creating an invitation.'))
115
+ export const CreateInvitationRequest = OpenApi.component(
116
+ z
117
+ .object({
118
+ email: z
119
+ .email()
120
+ .check(z.describe('Invitee email.'), z.meta({ examples: ['dev@example.com'] })),
121
+ role,
122
+ })
123
+ .check(z.describe('Fields for creating an invitation.')),
124
+ 'CreateInvitationRequest',
125
+ )
117
126
 
118
127
  /** Schemas for the listInvitations / listMyInvitations operations. */
119
128
  export namespace listInvitations {
120
129
  /** Non-paginated list of pending invitations. */
121
- export const Response = Schema.describe(
122
- z.object({
123
- data: z.array(Invitation).check(z.describe('Pending invitations, newest first.')),
124
- }),
125
- 'A non-paginated list of pending invitations.',
130
+ export const Response = OpenApi.component(
131
+ Schema.describe(
132
+ z.object({
133
+ data: z
134
+ .array(Invitation)
135
+ .check(z.describe('Pending invitations, newest first.'), z.meta({ examples: [[]] })),
136
+ }),
137
+ 'A non-paginated list of pending invitations.',
138
+ ),
139
+ 'InvitationList',
126
140
  )
127
141
  }
128
142
 
129
143
  /** Schemas for the listMyInvitations operation. */
130
144
  export namespace listMyInvitations {
131
145
  /** A pending invitation addressed to the caller, with the inviting org's name. */
132
- export const Item = z.extend(Invitation, {
133
- orgName: z
134
- .string()
135
- .check(
136
- z.describe('Human-readable name of the inviting organization.'),
137
- z.meta({ examples: ['Acme, Inc.'] }),
138
- ),
139
- })
146
+ export const Item = OpenApi.component(
147
+ Schema.describe(
148
+ z.extend(Invitation, {
149
+ orgName: z
150
+ .string()
151
+ .check(
152
+ z.describe('Human-readable name of the inviting organization.'),
153
+ z.meta({ examples: ['Acme, Inc.'] }),
154
+ ),
155
+ }),
156
+ "One pending invitation addressed to the caller, with the inviting organization's name.",
157
+ ),
158
+ 'MyInvitation',
159
+ )
140
160
 
141
161
  /** Non-paginated list of the caller's pending invitations. */
142
- export const Response = Schema.describe(
143
- z.object({
144
- data: z.array(Item).check(z.describe('Pending invitations, newest first.')),
145
- }),
146
- "A non-paginated list of the caller's pending invitations.",
162
+ export const Response = OpenApi.component(
163
+ Schema.describe(
164
+ z.object({
165
+ data: z
166
+ .array(Item)
167
+ .check(z.describe('Pending invitations, newest first.'), z.meta({ examples: [[]] })),
168
+ }),
169
+ "A non-paginated list of the caller's pending invitations.",
170
+ ),
171
+ 'MyInvitationList',
147
172
  )
148
173
  }
149
174
 
150
175
  /** Schemas for the acceptInvitation operation. */
151
176
  export namespace acceptInvitation {
152
177
  /** The membership granted by accepting. */
153
- export const Response = Schema.describe(
154
- z.object({
155
- orgId: z
156
- .string()
157
- .check(
158
- z.describe('Organization id (`org_…`) joined.'),
159
- z.meta({ examples: ['org_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
160
- ),
161
- role: z
162
- .enum(Memberships.roles)
163
- .check(z.describe('Granted role.'), z.meta({ examples: ['member'] })),
164
- userId: z
165
- .string()
166
- .check(
167
- z.describe('Member user id (`usr_…`).'),
168
- z.meta({ examples: ['usr_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
169
- ),
170
- }),
171
- 'The membership granted by accepting.',
178
+ export const Response = OpenApi.component(
179
+ Schema.describe(
180
+ z.object({
181
+ orgId: z
182
+ .string()
183
+ .check(
184
+ z.describe('Organization id (`org_…`) joined.'),
185
+ z.meta({ examples: ['org_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
186
+ ),
187
+ role: z
188
+ .enum(Memberships.roles)
189
+ .check(z.describe('Granted role.'), z.meta({ examples: ['member'] })),
190
+ userId: z
191
+ .string()
192
+ .check(
193
+ z.describe('Member user id (`usr_…`).'),
194
+ z.meta({ examples: ['usr_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
195
+ ),
196
+ }),
197
+ 'The membership granted by accepting.',
198
+ ),
199
+ 'AcceptInvitationResponse',
172
200
  )
173
201
  }
174
202
 
175
203
  /** Schemas for the declineInvitation operation. */
176
204
  export namespace declineInvitation {
177
205
  /** Confirmation that the invitation was declined. */
178
- export const Response = z
179
- .object({
180
- id: z
181
- .string()
182
- .check(
183
- z.describe('ID of the invitation that was declined.'),
184
- z.meta({ examples: ['inv_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
185
- ),
186
- })
187
- .check(z.describe('Confirmation that the invitation was declined.'))
206
+ export const Response = OpenApi.component(
207
+ z
208
+ .object({
209
+ id: z
210
+ .string()
211
+ .check(
212
+ z.describe('ID of the invitation that was declined.'),
213
+ z.meta({ examples: ['inv_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
214
+ ),
215
+ })
216
+ .check(z.describe('Confirmation that the invitation was declined.')),
217
+ 'DeclineInvitationResponse',
218
+ )
188
219
  }
189
220
 
190
221
  /** Schemas for the revokeInvitation operation. */
191
222
  export namespace revokeInvitation {
192
223
  /** Confirmation that the invitation was revoked. */
193
- export const Response = z
194
- .object({
195
- id: z
196
- .string()
197
- .check(
198
- z.describe('ID of the invitation that was revoked.'),
199
- z.meta({ examples: ['inv_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
200
- ),
201
- })
202
- .check(z.describe('Confirmation that the invitation was revoked.'))
224
+ export const Response = OpenApi.component(
225
+ z
226
+ .object({
227
+ id: z
228
+ .string()
229
+ .check(
230
+ z.describe('ID of the invitation that was revoked.'),
231
+ z.meta({ examples: ['inv_1a2b3c4d5e6f7g8h9j0k1m2n'] }),
232
+ ),
233
+ })
234
+ .check(z.describe('Confirmation that the invitation was revoked.')),
235
+ 'RevokeInvitationResponse',
236
+ )
203
237
  }
204
238
  }
205
239
 
@@ -218,7 +252,7 @@ export function invitations() {
218
252
  code: 'param_invalid',
219
253
  message: 'Check the path parameters and try again.',
220
254
  }),
221
- OpenApi.validate('json', schema.InvitationBody, {
255
+ OpenApi.validate('json', schema.CreateInvitationRequest, {
222
256
  code: 'body_invalid',
223
257
  message: 'Check the request body and try again.',
224
258
  }),
@@ -226,7 +260,16 @@ export function invitations() {
226
260
  description: 'Invite an email to the organization with a role. The invitee accepts after signing in with that verified email.', // prettier-ignore
227
261
  operationId: 'createInvitation',
228
262
  responses: OpenApi.responses({
229
- errors: { 404: 'No accessible organization was found for this id.' },
263
+ errors: {
264
+ 400: {
265
+ codes: ['body_invalid', 'param_invalid'],
266
+ description: 'Malformed API key, invalid path, or invalid body.',
267
+ },
268
+ 404: {
269
+ codes: ['organization_not_found'],
270
+ description: 'No accessible organization was found for this id.',
271
+ },
272
+ },
230
273
  success: { description: 'The created invitation.', schema: schema.Invitation },
231
274
  }),
232
275
  summary: 'Create invitation',
@@ -235,6 +278,7 @@ export function invitations() {
235
278
  async (c) => {
236
279
  if (Auth.narrowAccess) return Auth.accessError(c)
237
280
  if (Auth.narrowScope) return Auth.ensureOrgError(c)
281
+ if (Auth.narrowOrgRole) return Auth.ensureOrgRoleError(c)
238
282
  if (OpenApi.narrowValidation)
239
283
  return OpenApi.validationError(c, {
240
284
  code: 'param_invalid',
@@ -290,7 +334,13 @@ export function invitations() {
290
334
  OpenApi.describeRoute({
291
335
  operationId: 'listInvitations',
292
336
  responses: OpenApi.responses({
293
- errors: { 404: 'No accessible organization was found for this id.' },
337
+ errors: {
338
+ 400: { codes: ['param_invalid'], description: 'Malformed API key or invalid path.' },
339
+ 404: {
340
+ codes: ['organization_not_found'],
341
+ description: 'No accessible organization was found for this id.',
342
+ },
343
+ },
294
344
  success: {
295
345
  description: 'Pending invitations, newest first.',
296
346
  schema: schema.listInvitations.Response,
@@ -302,6 +352,7 @@ export function invitations() {
302
352
  async (c) => {
303
353
  if (Auth.narrowAccess) return Auth.accessError(c)
304
354
  if (Auth.narrowScope) return Auth.ensureOrgError(c)
355
+ if (Auth.narrowOrgRole) return Auth.ensureOrgRoleError(c)
305
356
  if (OpenApi.narrowValidation)
306
357
  return OpenApi.validationError(c, {
307
358
  code: 'param_invalid',
@@ -333,7 +384,13 @@ export function invitations() {
333
384
  OpenApi.describeRoute({
334
385
  operationId: 'revokeInvitation',
335
386
  responses: OpenApi.responses({
336
- errors: { 404: 'No accessible pending invitation was found for this id.' },
387
+ errors: {
388
+ 400: { codes: ['param_invalid'], description: 'Malformed API key or invalid path.' },
389
+ 404: {
390
+ codes: ['invitation_not_found', 'organization_not_found'],
391
+ description: 'No accessible organization or pending invitation was found.',
392
+ },
393
+ },
337
394
  success: {
338
395
  description: 'Confirmation that the invitation was revoked.',
339
396
  schema: schema.revokeInvitation.Response,
@@ -345,6 +402,7 @@ export function invitations() {
345
402
  async (c) => {
346
403
  if (Auth.narrowAccess) return Auth.accessError(c)
347
404
  if (Auth.narrowScope) return Auth.ensureOrgError(c)
405
+ if (Auth.narrowOrgRole) return Auth.ensureOrgRoleError(c)
348
406
  if (OpenApi.narrowValidation)
349
407
  return OpenApi.validationError(c, {
350
408
  code: 'param_invalid',
@@ -375,6 +433,7 @@ export function invitations() {
375
433
  description: "Pending invitations addressed to the session's verified email.",
376
434
  operationId: 'listMyInvitations',
377
435
  responses: OpenApi.responses({
436
+ errors: { 400: { codes: [], description: 'Malformed API key.' } },
378
437
  success: {
379
438
  description: 'Pending invitations, newest first.',
380
439
  schema: schema.listMyInvitations.Response,
@@ -420,7 +479,16 @@ export function invitations() {
420
479
  description: "Accept an invitation addressed to the session's verified email, joining the organization with the invited role.", // prettier-ignore
421
480
  operationId: 'acceptInvitation',
422
481
  responses: OpenApi.responses({
423
- errors: { 404: 'No accessible pending invitation was found for this id.' },
482
+ errors: {
483
+ 400: {
484
+ codes: ['param_invalid'],
485
+ description: 'Malformed API key or invalid path.',
486
+ },
487
+ 404: {
488
+ codes: ['invitation_not_found'],
489
+ description: 'No accessible pending invitation was found for this id.',
490
+ },
491
+ },
424
492
  success: {
425
493
  description: 'The membership granted by accepting.',
426
494
  schema: schema.acceptInvitation.Response,
@@ -475,7 +543,16 @@ export function invitations() {
475
543
  description: "Decline an invitation addressed to the session's verified email. Declining settles the invitation; it can no longer be accepted.", // prettier-ignore
476
544
  operationId: 'declineInvitation',
477
545
  responses: OpenApi.responses({
478
- errors: { 404: 'No accessible pending invitation was found for this id.' },
546
+ errors: {
547
+ 400: {
548
+ codes: ['param_invalid'],
549
+ description: 'Malformed API key or invalid path.',
550
+ },
551
+ 404: {
552
+ codes: ['invitation_not_found'],
553
+ description: 'No accessible pending invitation was found for this id.',
554
+ },
555
+ },
479
556
  success: {
480
557
  description: 'Confirmation that the invitation was declined.',
481
558
  schema: schema.declineInvitation.Response,