tapimo 0.1.0 → 0.2.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 (385) hide show
  1. package/README.md +28 -15
  2. package/dist/ApiKey.d.ts +3 -1
  3. package/dist/ApiKey.d.ts.map +1 -1
  4. package/dist/ApiKey.js +1 -0
  5. package/dist/ApiKey.js.map +1 -1
  6. package/dist/ApiKeys.d.ts +71 -3
  7. package/dist/ApiKeys.d.ts.map +1 -1
  8. package/dist/ApiKeys.js +117 -1
  9. package/dist/ApiKeys.js.map +1 -1
  10. package/dist/App.d.ts +7139 -4197
  11. package/dist/App.d.ts.map +1 -1
  12. package/dist/App.js +133 -329
  13. package/dist/App.js.map +1 -1
  14. package/dist/Scope.d.ts +11 -4
  15. package/dist/Scope.d.ts.map +1 -1
  16. package/dist/Scope.js +12 -4
  17. package/dist/Scope.js.map +1 -1
  18. package/dist/Webhooks.d.ts +2 -2
  19. package/dist/Webhooks.d.ts.map +1 -1
  20. package/dist/Webhooks.js +2 -2
  21. package/dist/Webhooks.js.map +1 -1
  22. package/dist/admin/App.d.ts +126 -53
  23. package/dist/admin/App.d.ts.map +1 -1
  24. package/dist/admin/apps/api-keys.d.ts +104 -6
  25. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  26. package/dist/admin/apps/api-keys.js +67 -0
  27. package/dist/admin/apps/api-keys.js.map +1 -1
  28. package/dist/admin/apps/scopes.d.ts +4 -1
  29. package/dist/admin/apps/scopes.d.ts.map +1 -1
  30. package/dist/admin/apps/verified-tokens.d.ts +115 -115
  31. package/dist/admin/apps/verified-tokens.js +1 -1
  32. package/dist/admin/apps/verified-tokens.js.map +1 -1
  33. package/dist/admin/ui.generated.d.ts +1 -1
  34. package/dist/admin/ui.generated.js +1 -1
  35. package/dist/apps/data/App.d.ts +19176 -0
  36. package/dist/apps/data/App.d.ts.map +1 -0
  37. package/dist/apps/data/App.js +236 -0
  38. package/dist/apps/data/App.js.map +1 -0
  39. package/dist/apps/data/index.d.ts +3 -0
  40. package/dist/apps/data/index.d.ts.map +1 -0
  41. package/dist/apps/data/index.js +3 -0
  42. package/dist/apps/data/index.js.map +1 -0
  43. package/dist/apps/{activities.d.ts → data/routes/activities.d.ts} +32 -32
  44. package/dist/apps/{activities.d.ts.map → data/routes/activities.d.ts.map} +1 -1
  45. package/dist/apps/{activities.js → data/routes/activities.js} +13 -13
  46. package/dist/apps/data/routes/activities.js.map +1 -0
  47. package/dist/apps/{addresses.d.ts → data/routes/addresses.d.ts} +22 -22
  48. package/dist/apps/{addresses.d.ts.map → data/routes/addresses.d.ts.map} +1 -1
  49. package/dist/apps/{addresses.js → data/routes/addresses.js} +5 -5
  50. package/dist/apps/data/routes/addresses.js.map +1 -0
  51. package/dist/apps/{balances.d.ts → data/routes/balances.d.ts} +49 -49
  52. package/dist/apps/data/routes/balances.d.ts.map +1 -0
  53. package/dist/apps/{balances.js → data/routes/balances.js} +42 -11
  54. package/dist/apps/data/routes/balances.js.map +1 -0
  55. package/dist/apps/{blocks.d.ts → data/routes/blocks.d.ts} +47 -47
  56. package/dist/apps/data/routes/blocks.d.ts.map +1 -0
  57. package/dist/apps/{blocks.js → data/routes/blocks.js} +13 -13
  58. package/dist/apps/data/routes/blocks.js.map +1 -0
  59. package/dist/apps/{coingecko.d.ts → data/routes/coingecko.d.ts} +183 -183
  60. package/dist/apps/data/routes/coingecko.d.ts.map +1 -0
  61. package/dist/apps/{coingecko.js → data/routes/coingecko.js} +13 -13
  62. package/dist/apps/data/routes/coingecko.js.map +1 -0
  63. package/dist/apps/{exchanges.d.ts → data/routes/exchanges.d.ts} +460 -460
  64. package/dist/apps/data/routes/exchanges.d.ts.map +1 -0
  65. package/dist/apps/{exchanges.js → data/routes/exchanges.js} +19 -19
  66. package/dist/apps/data/routes/exchanges.js.map +1 -0
  67. package/dist/apps/{fee-amm.d.ts → data/routes/fee-amm.d.ts} +94 -94
  68. package/dist/apps/data/routes/fee-amm.d.ts.map +1 -0
  69. package/dist/apps/{fee-amm.js → data/routes/fee-amm.js} +17 -17
  70. package/dist/apps/data/routes/fee-amm.js.map +1 -0
  71. package/dist/apps/{indexer.d.ts → data/routes/indexer.d.ts} +4 -4
  72. package/dist/apps/data/routes/indexer.d.ts.map +1 -0
  73. package/dist/apps/{indexer.js → data/routes/indexer.js} +13 -9
  74. package/dist/apps/data/routes/indexer.js.map +1 -0
  75. package/dist/apps/{receipts.d.ts → data/routes/receipts.d.ts} +49 -49
  76. package/dist/apps/data/routes/receipts.d.ts.map +1 -0
  77. package/dist/apps/{receipts.js → data/routes/receipts.js} +12 -12
  78. package/dist/apps/data/routes/receipts.js.map +1 -0
  79. package/dist/apps/{rpc.d.ts → data/routes/rpc.d.ts} +4 -4
  80. package/dist/apps/data/routes/rpc.d.ts.map +1 -0
  81. package/dist/apps/{rpc.js → data/routes/rpc.js} +6 -6
  82. package/dist/apps/data/routes/rpc.js.map +1 -0
  83. package/dist/apps/{tokenlist.d.ts → data/routes/tokenlist.d.ts} +4 -4
  84. package/dist/apps/data/routes/tokenlist.d.ts.map +1 -0
  85. package/dist/apps/{tokenlist.js → data/routes/tokenlist.js} +8 -8
  86. package/dist/apps/data/routes/tokenlist.js.map +1 -0
  87. package/dist/apps/{tokens.d.ts → data/routes/tokens.d.ts} +468 -468
  88. package/dist/apps/data/routes/tokens.d.ts.map +1 -0
  89. package/dist/apps/{tokens.js → data/routes/tokens.js} +19 -19
  90. package/dist/apps/data/routes/tokens.js.map +1 -0
  91. package/dist/apps/{transactions.d.ts → data/routes/transactions.d.ts} +304 -304
  92. package/dist/apps/data/routes/transactions.d.ts.map +1 -0
  93. package/dist/apps/{transactions.js → data/routes/transactions.js} +13 -13
  94. package/dist/apps/data/routes/transactions.js.map +1 -0
  95. package/dist/apps/{transfers.d.ts → data/routes/transfers.d.ts} +6 -6
  96. package/dist/apps/data/routes/transfers.d.ts.map +1 -0
  97. package/dist/apps/{transfers.js → data/routes/transfers.js} +13 -13
  98. package/dist/apps/data/routes/transfers.js.map +1 -0
  99. package/dist/apps/{verified-tokens.d.ts → data/routes/verified-tokens.d.ts} +42 -42
  100. package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -0
  101. package/dist/apps/{verified-tokens.js → data/routes/verified-tokens.js} +9 -9
  102. package/dist/apps/data/routes/verified-tokens.js.map +1 -0
  103. package/dist/apps/{webhooks.d.ts → data/routes/webhooks.d.ts} +62 -62
  104. package/dist/apps/{webhooks.d.ts.map → data/routes/webhooks.d.ts.map} +1 -1
  105. package/dist/apps/{webhooks.js → data/routes/webhooks.js} +30 -26
  106. package/dist/apps/data/routes/webhooks.js.map +1 -0
  107. package/dist/apps/docs/App.d.ts +27 -0
  108. package/dist/apps/docs/App.d.ts.map +1 -0
  109. package/dist/apps/docs/App.js +122 -0
  110. package/dist/apps/docs/App.js.map +1 -0
  111. package/dist/{internal/OpenApi.fonts.d.ts → apps/docs/fonts.d.ts} +1 -1
  112. package/dist/apps/docs/fonts.d.ts.map +1 -0
  113. package/dist/{internal/OpenApi.fonts.js → apps/docs/fonts.js} +1 -1
  114. package/dist/apps/docs/fonts.js.map +1 -0
  115. package/dist/apps/docs/index.d.ts +2 -0
  116. package/dist/apps/docs/index.d.ts.map +1 -0
  117. package/dist/apps/docs/index.js +2 -0
  118. package/dist/apps/docs/index.js.map +1 -0
  119. package/dist/{internal/OpenApi.logo.d.ts → apps/docs/logo.d.ts} +1 -1
  120. package/dist/apps/docs/logo.d.ts.map +1 -0
  121. package/dist/{internal/OpenApi.logo.js → apps/docs/logo.js} +1 -1
  122. package/dist/apps/docs/logo.js.map +1 -0
  123. package/dist/apps/index.d.ts +4 -0
  124. package/dist/apps/index.d.ts.map +1 -0
  125. package/dist/apps/index.js +4 -0
  126. package/dist/apps/index.js.map +1 -0
  127. package/dist/apps/metadata.d.ts +7 -0
  128. package/dist/apps/metadata.d.ts.map +1 -0
  129. package/dist/apps/metadata.js +15 -0
  130. package/dist/apps/metadata.js.map +1 -0
  131. package/dist/apps/platform/App.d.ts +2985 -0
  132. package/dist/apps/platform/App.d.ts.map +1 -0
  133. package/dist/apps/platform/App.js +74 -0
  134. package/dist/apps/platform/App.js.map +1 -0
  135. package/dist/apps/platform/index.d.ts +2 -0
  136. package/dist/apps/platform/index.d.ts.map +1 -0
  137. package/dist/apps/platform/index.js +2 -0
  138. package/dist/apps/platform/index.js.map +1 -0
  139. package/dist/apps/platform/routes/api-keys.d.ts +681 -0
  140. package/dist/apps/platform/routes/api-keys.d.ts.map +1 -0
  141. package/dist/apps/platform/routes/api-keys.js +328 -0
  142. package/dist/apps/platform/routes/api-keys.js.map +1 -0
  143. package/dist/apps/platform/routes/invitations.d.ts +733 -0
  144. package/dist/apps/platform/routes/invitations.d.ts.map +1 -0
  145. package/dist/apps/platform/routes/invitations.js +413 -0
  146. package/dist/apps/platform/routes/invitations.js.map +1 -0
  147. package/dist/apps/platform/routes/me.d.ts +95 -0
  148. package/dist/apps/platform/routes/me.d.ts.map +1 -0
  149. package/dist/apps/platform/routes/me.js +81 -0
  150. package/dist/apps/platform/routes/me.js.map +1 -0
  151. package/dist/apps/platform/routes/members.d.ts +554 -0
  152. package/dist/apps/platform/routes/members.d.ts.map +1 -0
  153. package/dist/apps/platform/routes/members.js +251 -0
  154. package/dist/apps/platform/routes/members.js.map +1 -0
  155. package/dist/apps/platform/routes/orgs.d.ts +582 -0
  156. package/dist/apps/platform/routes/orgs.d.ts.map +1 -0
  157. package/dist/apps/platform/routes/orgs.js +265 -0
  158. package/dist/apps/platform/routes/orgs.js.map +1 -0
  159. package/dist/apps/platform/routes/projects.d.ts +740 -0
  160. package/dist/apps/platform/routes/projects.d.ts.map +1 -0
  161. package/dist/apps/platform/routes/projects.js +286 -0
  162. package/dist/apps/platform/routes/projects.js.map +1 -0
  163. package/dist/apps/relay/App.d.ts +41 -0
  164. package/dist/apps/relay/App.d.ts.map +1 -0
  165. package/dist/apps/relay/App.js +103 -0
  166. package/dist/apps/relay/App.js.map +1 -0
  167. package/dist/apps/relay/Sponsorships.d.ts +107 -0
  168. package/dist/apps/relay/Sponsorships.d.ts.map +1 -0
  169. package/dist/apps/relay/Sponsorships.js +193 -0
  170. package/dist/apps/relay/Sponsorships.js.map +1 -0
  171. package/dist/apps/relay/index.d.ts +3 -0
  172. package/dist/apps/relay/index.d.ts.map +1 -0
  173. package/dist/apps/relay/index.js +3 -0
  174. package/dist/apps/relay/index.js.map +1 -0
  175. package/dist/cli/Cli.d.ts +1 -1
  176. package/dist/cli/Cli.js +1 -1
  177. package/dist/cli/commands/admin.d.ts +1 -1
  178. package/dist/cli/commands/admin.js +2 -2
  179. package/dist/cli/commands/admin.js.map +1 -1
  180. package/dist/db/Db.d.ts +10 -0
  181. package/dist/db/Db.d.ts.map +1 -1
  182. package/dist/db/Db.js +128 -0
  183. package/dist/db/Db.js.map +1 -1
  184. package/dist/db/Schema.d.ts +80 -0
  185. package/dist/db/Schema.d.ts.map +1 -1
  186. package/dist/db/Schema.js +99 -0
  187. package/dist/db/Schema.js.map +1 -1
  188. package/dist/db/tables/invitations.d.ts +84 -0
  189. package/dist/db/tables/invitations.d.ts.map +1 -0
  190. package/dist/db/tables/invitations.js +165 -0
  191. package/dist/db/tables/invitations.js.map +1 -0
  192. package/dist/db/tables/memberships.d.ts +108 -0
  193. package/dist/db/tables/memberships.d.ts.map +1 -0
  194. package/dist/db/tables/memberships.js +153 -0
  195. package/dist/db/tables/memberships.js.map +1 -0
  196. package/dist/db/tables/organizations.d.ts +44 -0
  197. package/dist/db/tables/organizations.d.ts.map +1 -1
  198. package/dist/db/tables/organizations.js +89 -0
  199. package/dist/db/tables/organizations.js.map +1 -1
  200. package/dist/db/tables/projects.d.ts +65 -0
  201. package/dist/db/tables/projects.d.ts.map +1 -0
  202. package/dist/db/tables/projects.js +75 -0
  203. package/dist/db/tables/projects.js.map +1 -0
  204. package/dist/db/tables/sponsoredTransactions.d.ts +120 -0
  205. package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -0
  206. package/dist/db/tables/sponsoredTransactions.js +161 -0
  207. package/dist/db/tables/sponsoredTransactions.js.map +1 -0
  208. package/dist/db/tables/users.d.ts +48 -0
  209. package/dist/db/tables/users.d.ts.map +1 -0
  210. package/dist/db/tables/users.js +65 -0
  211. package/dist/db/tables/users.js.map +1 -0
  212. package/dist/handlers/internal/executionError.d.ts.map +1 -1
  213. package/dist/handlers/internal/executionError.js +2 -0
  214. package/dist/handlers/internal/executionError.js.map +1 -1
  215. package/dist/handlers/internal/multisig.d.ts +2 -6
  216. package/dist/handlers/internal/multisig.d.ts.map +1 -1
  217. package/dist/handlers/internal/multisig.js +11 -36
  218. package/dist/handlers/internal/multisig.js.map +1 -1
  219. package/dist/handlers/internal/sponsorship.d.ts +32 -2
  220. package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
  221. package/dist/handlers/internal/sponsorship.js +34 -9
  222. package/dist/handlers/internal/sponsorship.js.map +1 -1
  223. package/dist/handlers/relay.d.ts +6 -2
  224. package/dist/handlers/relay.d.ts.map +1 -1
  225. package/dist/handlers/relay.js +16 -2
  226. package/dist/handlers/relay.js.map +1 -1
  227. package/dist/internal/Auth.d.ts +208 -6
  228. package/dist/internal/Auth.d.ts.map +1 -1
  229. package/dist/internal/Auth.js +500 -21
  230. package/dist/internal/Auth.js.map +1 -1
  231. package/dist/internal/Log.d.ts +7 -3
  232. package/dist/internal/Log.d.ts.map +1 -1
  233. package/dist/internal/Log.js +4 -0
  234. package/dist/internal/Log.js.map +1 -1
  235. package/dist/internal/OpenApi.d.ts +0 -19
  236. package/dist/internal/OpenApi.d.ts.map +1 -1
  237. package/dist/internal/OpenApi.js +0 -57
  238. package/dist/internal/OpenApi.js.map +1 -1
  239. package/dist/internal/Store.d.ts +7 -1
  240. package/dist/internal/Store.d.ts.map +1 -1
  241. package/dist/internal/Store.js +16 -2
  242. package/dist/internal/Store.js.map +1 -1
  243. package/dist/internal/Viem.d.ts +84 -0
  244. package/dist/internal/Viem.d.ts.map +1 -1
  245. package/dist/internal/Webhooks.d.ts +1 -1
  246. package/dist/internal/Webhooks.d.ts.map +1 -1
  247. package/package.json +31 -5
  248. package/src/ApiKey.ts +1 -0
  249. package/src/ApiKeys.test.ts +104 -1
  250. package/src/ApiKeys.ts +154 -1
  251. package/src/App.test.ts +11187 -179
  252. package/src/App.ts +200 -420
  253. package/src/Client.test-d.ts +306 -15
  254. package/src/Scope.ts +13 -4
  255. package/src/Webhooks.ts +2 -2
  256. package/src/admin/apps/api-keys.test.ts +51 -0
  257. package/src/admin/apps/api-keys.ts +84 -0
  258. package/src/admin/apps/scopes.test.ts +5 -1
  259. package/src/admin/apps/verified-tokens.ts +1 -1
  260. package/src/admin/ui.generated.ts +1 -1
  261. package/src/apps/composition.test.ts +66 -0
  262. package/src/apps/data/App.ts +295 -0
  263. package/src/apps/data/index.ts +2 -0
  264. package/src/apps/{activities.test.ts → data/routes/activities.test.ts} +3 -3
  265. package/src/apps/{activities.ts → data/routes/activities.ts} +15 -15
  266. package/src/apps/{addresses.ts → data/routes/addresses.ts} +6 -6
  267. package/src/apps/{balances.test.ts → data/routes/balances.test.ts} +2 -2
  268. package/src/apps/{balances.ts → data/routes/balances.ts} +46 -12
  269. package/src/apps/{blocks.test.ts → data/routes/blocks.test.ts} +3 -3
  270. package/src/apps/{blocks.ts → data/routes/blocks.ts} +14 -14
  271. package/src/apps/{coingecko.test.ts → data/routes/coingecko.test.ts} +2 -2
  272. package/src/apps/{coingecko.ts → data/routes/coingecko.ts} +14 -14
  273. package/src/apps/{exchanges.test.ts → data/routes/exchanges.test.ts} +1 -1
  274. package/src/apps/{exchanges.ts → data/routes/exchanges.ts} +20 -20
  275. package/src/apps/{fee-amm.test.ts → data/routes/fee-amm.test.ts} +3 -3
  276. package/src/apps/{fee-amm.ts → data/routes/fee-amm.ts} +18 -18
  277. package/src/apps/{indexer.test.ts → data/routes/indexer.test.ts} +26 -5
  278. package/src/apps/{indexer.ts → data/routes/indexer.ts} +13 -10
  279. package/src/apps/{receipts.test.ts → data/routes/receipts.test.ts} +3 -3
  280. package/src/apps/{receipts.ts → data/routes/receipts.ts} +13 -13
  281. package/src/apps/{rpc.test.ts → data/routes/rpc.test.ts} +44 -5
  282. package/src/apps/{rpc.ts → data/routes/rpc.ts} +7 -7
  283. package/src/apps/{tokenlist.test.ts → data/routes/tokenlist.test.ts} +3 -3
  284. package/src/apps/{tokenlist.ts → data/routes/tokenlist.ts} +9 -9
  285. package/src/apps/{tokens.test.ts → data/routes/tokens.test.ts} +2 -2
  286. package/src/apps/{tokens.ts → data/routes/tokens.ts} +20 -20
  287. package/src/apps/{transactions.test.ts → data/routes/transactions.test.ts} +3 -3
  288. package/src/apps/{transactions.ts → data/routes/transactions.ts} +15 -15
  289. package/src/apps/{transfers.test.ts → data/routes/transfers.test.ts} +2 -2
  290. package/src/apps/{transfers.ts → data/routes/transfers.ts} +15 -15
  291. package/src/apps/{verified-tokens.test.ts → data/routes/verified-tokens.test.ts} +3 -3
  292. package/src/apps/{verified-tokens.ts → data/routes/verified-tokens.ts} +10 -10
  293. package/src/apps/{webhooks.test.ts → data/routes/webhooks.test.ts} +6 -6
  294. package/src/apps/{webhooks.ts → data/routes/webhooks.ts} +39 -35
  295. package/src/apps/docs/App.ts +136 -0
  296. package/src/apps/docs/index.ts +1 -0
  297. package/src/apps/index.ts +3 -0
  298. package/src/apps/metadata.ts +23 -0
  299. package/src/apps/platform/App.ts +130 -0
  300. package/src/apps/platform/index.ts +1 -0
  301. package/src/apps/platform/routes/api-keys.test.ts +330 -0
  302. package/src/apps/platform/routes/api-keys.ts +427 -0
  303. package/src/apps/platform/routes/invitations.test.ts +361 -0
  304. package/src/apps/platform/routes/invitations.ts +519 -0
  305. package/src/apps/platform/routes/me.test.ts +121 -0
  306. package/src/apps/platform/routes/me.ts +106 -0
  307. package/src/apps/platform/routes/members.test.ts +195 -0
  308. package/src/apps/platform/routes/members.ts +313 -0
  309. package/src/apps/platform/routes/orgs.test.ts +313 -0
  310. package/src/apps/platform/routes/orgs.ts +343 -0
  311. package/src/apps/platform/routes/projects.test.ts +181 -0
  312. package/src/apps/platform/routes/projects.ts +367 -0
  313. package/src/apps/relay/App.test.ts +484 -0
  314. package/src/apps/relay/App.ts +128 -0
  315. package/src/apps/relay/Sponsorships.test.ts +375 -0
  316. package/src/apps/relay/Sponsorships.ts +305 -0
  317. package/src/apps/relay/index.ts +2 -0
  318. package/src/cli/Cli.ts +1 -1
  319. package/src/cli/commands/admin.ts +2 -2
  320. package/src/db/Db.ts +159 -0
  321. package/src/db/Schema.ts +137 -0
  322. package/src/db/tables/invitations.ts +198 -0
  323. package/src/db/tables/memberships.ts +208 -0
  324. package/src/db/tables/organizations.test.ts +37 -1
  325. package/src/db/tables/organizations.ts +105 -0
  326. package/src/db/tables/projects.ts +107 -0
  327. package/src/db/tables/sponsoredTransactions.test.ts +218 -0
  328. package/src/db/tables/sponsoredTransactions.ts +236 -0
  329. package/src/db/tables/users.ts +85 -0
  330. package/src/handlers/internal/executionError.ts +2 -0
  331. package/src/handlers/internal/multisig.test.ts +84 -10
  332. package/src/handlers/internal/multisig.ts +15 -50
  333. package/src/handlers/internal/sponsorship.ts +74 -15
  334. package/src/handlers/{internal/relay.localnet.test.ts → relay.test.ts} +2 -2
  335. package/src/handlers/relay.ts +23 -5
  336. package/src/internal/Auth.test.ts +316 -0
  337. package/src/internal/Auth.ts +691 -25
  338. package/src/internal/Cursor.test.ts +3 -2
  339. package/src/internal/Log.test.ts +1 -1
  340. package/src/internal/Log.ts +11 -3
  341. package/src/internal/MetricSink.ts +1 -1
  342. package/src/internal/OpenApi.ts +0 -59
  343. package/src/internal/Store.test.ts +52 -0
  344. package/src/internal/Store.ts +24 -5
  345. package/src/internal/Tidx.local.test.ts +1 -1
  346. package/src/internal/VerifiedTokens.test.ts +1 -1
  347. package/src/internal/WebhookDestination.test.ts +1 -1
  348. package/src/internal/Webhooks.test.ts +4 -4
  349. package/src/internal/Webhooks.ts +1 -1
  350. package/dist/apps/activities.js.map +0 -1
  351. package/dist/apps/addresses.js.map +0 -1
  352. package/dist/apps/balances.d.ts.map +0 -1
  353. package/dist/apps/balances.js.map +0 -1
  354. package/dist/apps/blocks.d.ts.map +0 -1
  355. package/dist/apps/blocks.js.map +0 -1
  356. package/dist/apps/coingecko.d.ts.map +0 -1
  357. package/dist/apps/coingecko.js.map +0 -1
  358. package/dist/apps/exchanges.d.ts.map +0 -1
  359. package/dist/apps/exchanges.js.map +0 -1
  360. package/dist/apps/fee-amm.d.ts.map +0 -1
  361. package/dist/apps/fee-amm.js.map +0 -1
  362. package/dist/apps/indexer.d.ts.map +0 -1
  363. package/dist/apps/indexer.js.map +0 -1
  364. package/dist/apps/receipts.d.ts.map +0 -1
  365. package/dist/apps/receipts.js.map +0 -1
  366. package/dist/apps/rpc.d.ts.map +0 -1
  367. package/dist/apps/rpc.js.map +0 -1
  368. package/dist/apps/tokenlist.d.ts.map +0 -1
  369. package/dist/apps/tokenlist.js.map +0 -1
  370. package/dist/apps/tokens.d.ts.map +0 -1
  371. package/dist/apps/tokens.js.map +0 -1
  372. package/dist/apps/transactions.d.ts.map +0 -1
  373. package/dist/apps/transactions.js.map +0 -1
  374. package/dist/apps/transfers.d.ts.map +0 -1
  375. package/dist/apps/transfers.js.map +0 -1
  376. package/dist/apps/verified-tokens.d.ts.map +0 -1
  377. package/dist/apps/verified-tokens.js.map +0 -1
  378. package/dist/apps/webhooks.js.map +0 -1
  379. package/dist/internal/OpenApi.fonts.d.ts.map +0 -1
  380. package/dist/internal/OpenApi.fonts.js.map +0 -1
  381. package/dist/internal/OpenApi.logo.d.ts.map +0 -1
  382. package/dist/internal/OpenApi.logo.js.map +0 -1
  383. package/src/handlers/internal/multisig.localnet.test.ts +0 -146
  384. /package/src/{internal/OpenApi.fonts.ts → apps/docs/fonts.ts} +0 -0
  385. /package/src/{internal/OpenApi.logo.ts → apps/docs/logo.ts} +0 -0
@@ -2,19 +2,19 @@ import { Hono, type Context } from 'hono'
2
2
  import { Hex } from 'ox'
3
3
  import * as z from 'zod/mini'
4
4
 
5
- import type * as App from '../App.js'
6
- import * as Auth from '../internal/Auth.js'
7
- import * as Cache from '../internal/Cache.js'
8
- import * as Cursor from '../internal/Cursor.js'
9
- import * as OpenApi from '../internal/OpenApi.js'
10
- import * as Response from '../internal/Response.js'
11
- import * as Schema from '../internal/Schema.js'
12
- import * as Store from '../internal/Store.js'
13
- import type * as Tidx from '../internal/Tidx.js'
14
- import * as Timing from '../internal/Timing.js'
15
- import * as Ttl from '../internal/Ttl.js'
16
- import * as Value from '../internal/Value.js'
17
- import * as VerifiedTokens from '../internal/VerifiedTokens.js'
5
+ import type * as App from '../../../App.js'
6
+ import * as Auth from '../../../internal/Auth.js'
7
+ import * as Cache from '../../../internal/Cache.js'
8
+ import * as Cursor from '../../../internal/Cursor.js'
9
+ import * as OpenApi from '../../../internal/OpenApi.js'
10
+ import * as Response from '../../../internal/Response.js'
11
+ import * as Schema from '../../../internal/Schema.js'
12
+ import * as Store from '../../../internal/Store.js'
13
+ import type * as Tidx from '../../../internal/Tidx.js'
14
+ import * as Timing from '../../../internal/Timing.js'
15
+ import * as Ttl from '../../../internal/Ttl.js'
16
+ import * as Value from '../../../internal/Value.js'
17
+ import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
18
18
  import * as Receipts from './receipts.js'
19
19
  import * as Tokens from './tokens.js'
20
20
 
@@ -595,7 +595,7 @@ export namespace schema {
595
595
  export function transactions() {
596
596
  return new Hono<App.Environment>()
597
597
  .get(
598
- '/',
598
+ '/v1/transactions',
599
599
  Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
600
600
  OpenApi.validate('query', schema.getTransactions.Query, {
601
601
  code: 'query_invalid',
@@ -692,7 +692,7 @@ export function transactions() {
692
692
  },
693
693
  )
694
694
  .get(
695
- '/:transactionHash',
695
+ '/v1/transactions/:transactionHash',
696
696
  Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
697
697
  OpenApi.validate('param', schema.getTransaction.Params, {
698
698
  code: 'transaction_invalid',
@@ -1,8 +1,8 @@
1
1
  import type * as z from 'zod/mini'
2
2
  import { Schema } from 'tapimo'
3
3
 
4
- import * as TestApp from '../../test/App.js'
5
- import * as Runtime from '../../test/runtime.js'
4
+ import * as TestApp from '../../../../test/App.js'
5
+ import * as Runtime from '../../../../test/runtime.js'
6
6
  import * as Transfers from './transfers.js'
7
7
 
8
8
  describe('GET /transfers', () => {
@@ -3,20 +3,20 @@ import { Address, Hex } from 'ox'
3
3
  import { Addresses } from 'viem/tempo'
4
4
  import * as z from 'zod/mini'
5
5
 
6
- import type * as App from '../App.js'
7
- import * as Auth from '../internal/Auth.js'
8
- import * as Cache from '../internal/Cache.js'
9
- import * as Cursor from '../internal/Cursor.js'
10
- import * as Mpp from '../internal/Mpp.js'
11
- import * as OpenApi from '../internal/OpenApi.js'
12
- import * as Response from '../internal/Response.js'
13
- import * as Schema from '../internal/Schema.js'
14
- import * as Store from '../internal/Store.js'
15
- import type * as Tidx from '../internal/Tidx.js'
16
- import * as Timing from '../internal/Timing.js'
17
- import * as Ttl from '../internal/Ttl.js'
18
- import * as Value from '../internal/Value.js'
19
- import * as VerifiedTokens from '../internal/VerifiedTokens.js'
6
+ import type * as App from '../../../App.js'
7
+ import * as Auth from '../../../internal/Auth.js'
8
+ import * as Cache from '../../../internal/Cache.js'
9
+ import * as Cursor from '../../../internal/Cursor.js'
10
+ import * as Mpp from '../../../internal/Mpp.js'
11
+ import * as OpenApi from '../../../internal/OpenApi.js'
12
+ import * as Response from '../../../internal/Response.js'
13
+ import * as Schema from '../../../internal/Schema.js'
14
+ import * as Store from '../../../internal/Store.js'
15
+ import type * as Tidx from '../../../internal/Tidx.js'
16
+ import * as Timing from '../../../internal/Timing.js'
17
+ import * as Ttl from '../../../internal/Ttl.js'
18
+ import * as Value from '../../../internal/Value.js'
19
+ import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
20
20
  import * as Tokens from './tokens.js'
21
21
 
22
22
  // TIP-20 tokens emit the standard ERC-20 Transfer event. Supplying the
@@ -285,7 +285,7 @@ export namespace schema {
285
285
  /** Creates transfer handlers. */
286
286
  export function transfers() {
287
287
  return new Hono<App.Environment>().get(
288
- '/',
288
+ '/v1/transfers',
289
289
  Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
290
290
  OpenApi.validate('query', schema.getTransfers.Query, {
291
291
  code: 'query_invalid',
@@ -1,6 +1,6 @@
1
- import * as TestApp from '../../test/App.js'
2
- import * as Runtime from '../../test/runtime.js'
3
- import * as VerifiedTokens from '../internal/VerifiedTokens.js'
1
+ import * as TestApp from '../../../../test/App.js'
2
+ import * as Runtime from '../../../../test/runtime.js'
3
+ import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
4
4
  import * as Verified from './verified-tokens.js'
5
5
 
6
6
  /** Reader key for the data routes. */
@@ -1,13 +1,13 @@
1
1
  import { type Context, Hono } from 'hono'
2
2
  import * as z from 'zod/mini'
3
3
 
4
- import type * as App from '../App.js'
5
- import * as Auth from '../internal/Auth.js'
6
- import * as Cache from '../internal/Cache.js'
7
- import * as OpenApi from '../internal/OpenApi.js'
8
- import * as Response from '../internal/Response.js'
9
- import * as Schema from '../internal/Schema.js'
10
- import * as VerifiedTokens from '../internal/VerifiedTokens.js'
4
+ import type * as App from '../../../App.js'
5
+ import * as Auth from '../../../internal/Auth.js'
6
+ import * as Cache from '../../../internal/Cache.js'
7
+ import * as OpenApi from '../../../internal/OpenApi.js'
8
+ import * as Response from '../../../internal/Response.js'
9
+ import * as Schema from '../../../internal/Schema.js'
10
+ import * as VerifiedTokens from '../../../internal/VerifiedTokens.js'
11
11
 
12
12
  /** Zod schemas owned by the verified-tokens resource. */
13
13
  export namespace schema {
@@ -138,7 +138,7 @@ export namespace schema {
138
138
  export function verifiedTokens() {
139
139
  return new Hono<App.Environment>()
140
140
  .get(
141
- '/',
141
+ '/v1/verified-tokens',
142
142
  Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
143
143
  OpenApi.validate('query', schema.listVerifiedTokens.Query, {
144
144
  code: 'query_invalid',
@@ -183,7 +183,7 @@ export function verifiedTokens() {
183
183
  },
184
184
  )
185
185
  .get(
186
- '/currencies',
186
+ '/v1/verified-tokens/currencies',
187
187
  Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
188
188
  OpenApi.validate('query', schema.getVerifiedTokenCurrencies.Query, {
189
189
  code: 'query_invalid',
@@ -230,7 +230,7 @@ export function verifiedTokens() {
230
230
  },
231
231
  )
232
232
  .get(
233
- '/:address',
233
+ '/v1/verified-tokens/:address',
234
234
  Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
235
235
  OpenApi.validate('param', schema.Params, {
236
236
  code: 'address_invalid',
@@ -1,11 +1,11 @@
1
1
  import { type Db, Webhooks as Core } from 'tapimo'
2
2
 
3
- import * as Tidx from '../internal/Tidx.js'
4
- import * as Viem from '../internal/Viem.js'
5
- import * as TestApp from '../../test/App.js'
6
- import * as Mppx from '../../test/Mppx.js'
7
- import * as Runtime from '../../test/runtime.js'
8
- import * as Tempo from '../../test/Tempo.js'
3
+ import * as Tidx from '../../../internal/Tidx.js'
4
+ import * as Viem from '../../../internal/Viem.js'
5
+ import * as TestApp from '../../../../test/App.js'
6
+ import * as Mppx from '../../../../test/Mppx.js'
7
+ import * as Runtime from '../../../../test/runtime.js'
8
+ import * as Tempo from '../../../../test/Tempo.js'
9
9
  import * as Webhooks from './webhooks.js'
10
10
 
11
11
  /** API key with both webhook scopes, owned by `org_test`. */
@@ -2,20 +2,20 @@ import { type Context, Hono } from 'hono'
2
2
  import { type AbiEvent, parseAbiItem } from 'viem'
3
3
  import * as z from 'zod/mini'
4
4
 
5
- import type * as App from '../App.js'
6
- import * as Auth from '../internal/Auth.js'
7
- import * as Cache from '../internal/Cache.js'
8
- import * as Cursor from '../internal/Cursor.js'
9
- import * as Db from '../db/Db.js'
10
- import * as OpenApi from '../internal/OpenApi.js'
11
- import * as Response from '../internal/Response.js'
12
- import * as Schema from '../internal/Schema.js'
13
- import * as Store from '../internal/Store.js'
14
- import type * as Tidx from '../internal/Tidx.js'
15
- import * as Ttl from '../internal/Ttl.js'
16
- import * as Value from '../internal/Value.js'
17
- import type * as Viem from '../internal/Viem.js'
18
- import * as Webhooks from '../internal/Webhooks.js'
5
+ import type * as App from '../../../App.js'
6
+ import * as Auth from '../../../internal/Auth.js'
7
+ import * as Cache from '../../../internal/Cache.js'
8
+ import * as Cursor from '../../../internal/Cursor.js'
9
+ import * as Db from '../../../db/Db.js'
10
+ import * as OpenApi from '../../../internal/OpenApi.js'
11
+ import * as Response from '../../../internal/Response.js'
12
+ import * as Schema from '../../../internal/Schema.js'
13
+ import * as Store from '../../../internal/Store.js'
14
+ import type * as Tidx from '../../../internal/Tidx.js'
15
+ import * as Ttl from '../../../internal/Ttl.js'
16
+ import * as Value from '../../../internal/Value.js'
17
+ import type * as Viem from '../../../internal/Viem.js'
18
+ import * as Webhooks from '../../../internal/Webhooks.js'
19
19
  import * as Receipts from './receipts.js'
20
20
  import * as Transactions from './transactions.js'
21
21
  import * as Transfers from './transfers.js'
@@ -378,7 +378,7 @@ export namespace schema {
378
378
  .record(z.string(), z.unknown())
379
379
  .check(
380
380
  z.describe(
381
- 'Match decoded event arguments by name (indexed or non-indexed). Requires `signature`. Each value is an exact value or an operator object.',
381
+ 'Match decoded event arguments by name (indexed or non-indexed). Requires `signature`. Each value is an exact value or a super admin object.',
382
382
  ),
383
383
  z.meta({ examples: [{ to: '0x9e39034aae71fb89f66061a2602eb6efec271754' }] }),
384
384
  ),
@@ -1225,21 +1225,25 @@ export namespace schema {
1225
1225
  */
1226
1226
  export function webhooks(options: webhooks.Options = {}) {
1227
1227
  const hidden = !options.enabled
1228
- return (
1229
- new Hono<App.Environment>()
1230
- .use('*', async (c, next) => {
1231
- // Gate the whole resource on a configured state store. Without it the
1232
- // outbound-HTTP surface is disabled (read-only deployment).
1233
- if (!c.get('webhook')) return notEnabled(c) as never
1228
+ // Gate the whole resource on a configured state store. Without it the
1229
+ // outbound-HTTP surface is disabled (read-only deployment).
1230
+ const gate = async (c: Context<App.Environment>, next: () => Promise<void>) => {
1231
+ if (!c.get('webhook')) return notEnabled(c) as never
1234
1232
 
1235
- await next()
1233
+ await next()
1236
1234
 
1237
- // Subscriptions are principal-scoped, mutating, and stateful: never cache.
1238
- if (!c.res.headers.has('Cache-Control')) c.res.headers.set('Cache-Control', 'no-store')
1239
- return
1240
- })
1235
+ // Subscriptions are principal-scoped, mutating, and stateful: never cache.
1236
+ if (!c.res.headers.has('Cache-Control')) c.res.headers.set('Cache-Control', 'no-store')
1237
+ return
1238
+ }
1239
+ return (
1240
+ new Hono<App.Environment>()
1241
+ // `/v1/webhooks/*` does not match the collection root, so it gets its
1242
+ // own registration.
1243
+ .use('/v1/webhooks', gate)
1244
+ .use('/v1/webhooks/*', gate)
1241
1245
  .get(
1242
- '/event-types',
1246
+ '/v1/webhooks/event-types',
1243
1247
  Auth.policy({ apiKey: { scopes: ['data:read'] }, mpp: true, public: true }),
1244
1248
  OpenApi.describeRoute({
1245
1249
  description: 'See which onchain event types Tempo can POST to your webhook URL.',
@@ -1275,7 +1279,7 @@ export function webhooks(options: webhooks.Options = {}) {
1275
1279
  },
1276
1280
  )
1277
1281
  .post(
1278
- '/',
1282
+ '/v1/webhooks',
1279
1283
  Auth.policy({ apiKey: { scopes: ['webhooks:write'] } }),
1280
1284
  OpenApi.validate('json', schema.createWebhook.Body, {
1281
1285
  code: 'body_invalid',
@@ -1338,7 +1342,7 @@ export function webhooks(options: webhooks.Options = {}) {
1338
1342
  },
1339
1343
  )
1340
1344
  .get(
1341
- '/',
1345
+ '/v1/webhooks',
1342
1346
  Auth.policy({ apiKey: { scopes: ['webhooks:read'] } }),
1343
1347
  OpenApi.validate('query', schema.listWebhooks.Query, {
1344
1348
  code: 'query_invalid',
@@ -1412,7 +1416,7 @@ export function webhooks(options: webhooks.Options = {}) {
1412
1416
  // constraint, this API-key-only route's policy would be collected for the
1413
1417
  // event-types request and override its (intentionally public) access.
1414
1418
  .get(
1415
- '/:id{wh_[A-Za-z0-9_-]+}',
1419
+ '/v1/webhooks/:id{wh_[A-Za-z0-9_-]+}',
1416
1420
  Auth.policy({ apiKey: { scopes: ['webhooks:read'] } }),
1417
1421
  OpenApi.validate('param', schema.getWebhook.Params, {
1418
1422
  code: 'param_invalid',
@@ -1464,7 +1468,7 @@ export function webhooks(options: webhooks.Options = {}) {
1464
1468
  },
1465
1469
  )
1466
1470
  .get(
1467
- '/:id{wh_[A-Za-z0-9_-]+}/deliveries',
1471
+ '/v1/webhooks/:id{wh_[A-Za-z0-9_-]+}/deliveries',
1468
1472
  Auth.policy({ apiKey: { scopes: ['webhooks:read'] } }),
1469
1473
  OpenApi.validate('param', schema.listWebhookDeliveries.Params, {
1470
1474
  code: 'param_invalid',
@@ -1555,7 +1559,7 @@ export function webhooks(options: webhooks.Options = {}) {
1555
1559
  },
1556
1560
  )
1557
1561
  .post(
1558
- '/:id{wh_[A-Za-z0-9_-]+}/ping',
1562
+ '/v1/webhooks/:id{wh_[A-Za-z0-9_-]+}/ping',
1559
1563
  Auth.policy({ apiKey: { scopes: ['webhooks:write'] } }),
1560
1564
  OpenApi.validate('param', schema.pingWebhook.Params, {
1561
1565
  code: 'param_invalid',
@@ -1620,7 +1624,7 @@ export function webhooks(options: webhooks.Options = {}) {
1620
1624
  },
1621
1625
  )
1622
1626
  .post(
1623
- '/:id{wh_[A-Za-z0-9_-]+}/deliveries/:deliveryId/retry',
1627
+ '/v1/webhooks/:id{wh_[A-Za-z0-9_-]+}/deliveries/:deliveryId/retry',
1624
1628
  Auth.policy({ apiKey: { scopes: ['webhooks:write'] } }),
1625
1629
  OpenApi.validate('param', schema.retryWebhookDelivery.Params, {
1626
1630
  code: 'param_invalid',
@@ -1691,7 +1695,7 @@ export function webhooks(options: webhooks.Options = {}) {
1691
1695
  },
1692
1696
  )
1693
1697
  .patch(
1694
- '/:id{wh_[A-Za-z0-9_-]+}',
1698
+ '/v1/webhooks/:id{wh_[A-Za-z0-9_-]+}',
1695
1699
  Auth.policy({ apiKey: { scopes: ['webhooks:write'] } }),
1696
1700
  OpenApi.validate('param', schema.updateWebhook.Params, {
1697
1701
  code: 'param_invalid',
@@ -1763,7 +1767,7 @@ export function webhooks(options: webhooks.Options = {}) {
1763
1767
  },
1764
1768
  )
1765
1769
  .delete(
1766
- '/:id{wh_[A-Za-z0-9_-]+}',
1770
+ '/v1/webhooks/:id{wh_[A-Za-z0-9_-]+}',
1767
1771
  Auth.policy({ apiKey: { scopes: ['webhooks:write'] } }),
1768
1772
  OpenApi.validate('param', schema.deleteWebhook.Params, {
1769
1773
  code: 'param_invalid',
@@ -0,0 +1,136 @@
1
+ import { Hono } from 'hono'
2
+ import { Handler as vocs_Handler } from 'vocs/server'
3
+
4
+ import type * as App from '../../App.js'
5
+ import * as Metadata from '../metadata.js'
6
+ import openrpcSpec from '../../openrpc.json' with { type: 'json' }
7
+ import { pilatFontFaces } from './fonts.js'
8
+ import { logoUrl } from './logo.js'
9
+
10
+ /**
11
+ * The docs route group: the Vocs API reference served at the app root.
12
+ *
13
+ * ```ts
14
+ * import { docs } from 'tapimo/docs'
15
+ * App.create(options).route('/', data()).route('/', platform()).route('/', docs())
16
+ * ```
17
+ *
18
+ * The group registers no routes itself: it carries a reference factory (via
19
+ * {@link Metadata}) that `App.create` mounts on finalize, after every group and
20
+ * the OpenAPI/OpenRPC documents — so the reference always renders the full
21
+ * composed surface and its catch-all stays behind API routes, wherever the
22
+ * group sits in the composition chain.
23
+ *
24
+ * Lives in the `tapimo/docs` subpath (never re-exported from `tapimo/apps`) so
25
+ * the Vocs renderer and its multi-MB icon/font data are bundled only by
26
+ * deployments that actually serve docs.
27
+ */
28
+ export function docs(options: docs.Options = {}) {
29
+ return Metadata.attach(new Hono<App.Environment>(), {
30
+ docs: ({ spec }) =>
31
+ vocs_Handler.openApi(
32
+ {
33
+ // Inline the OpenRPC doc so vocs expands it without a self-subrequest
34
+ // (see `inlineOpenrpc`); the public `/openapi.json` keeps the URL ref.
35
+ spec: () => spec().then(inlineOpenrpc),
36
+ sidebar: { collapsed: true },
37
+ vocs: { logoUrl, title: 'Tempo API Reference', ...options },
38
+ },
39
+ { css, fallback: 'next' },
40
+ ),
41
+ })
42
+ }
43
+
44
+ export declare namespace docs {
45
+ /** Vocs API reference options (theme, top navigation, logo, socials, …). */
46
+ type Options = NonNullable<Parameters<typeof vocs_Handler.openApi>[0]['vocs']>
47
+ }
48
+
49
+ /**
50
+ * Custom CSS injected into the standalone reference's shell `<head>` (via
51
+ * `Handler.openApi(_, { css })`), after the Vocs design-system styles so it
52
+ * overrides them:
53
+ *
54
+ * - Page/surface backgrounds use Tempo's near-black dark palette and pure-white
55
+ * light palette via `light-dark(<light>, <dark>)`.
56
+ * - The dark border color is darkened (the light theme keeps its default).
57
+ * - Every corner is squared. The universal `!important` rule beats hard-coded
58
+ * `border-radius` values and inline styles (e.g. the Scalar playground), which
59
+ * overriding the radius scale variables alone would miss.
60
+ * - The default sans/body font is Pilat (Vocs reads `--vocs-font-family`); the
61
+ * webfont is embedded via {@link pilatFontFaces}. Body stays at the default
62
+ * weight (400); headings are pinned to 500, which renders Pilat Demi (the
63
+ * family has no 500 cut, so Demi covers the 500-600 range — see
64
+ * {@link pilatFontFaces}).
65
+ */
66
+ const css = `${pilatFontFaces}
67
+
68
+ :root {
69
+ --vocs-font-family: "Pilat", Arial, Helvetica, sans-serif;
70
+ --vocs-background-color-primary: light-dark(#fafafa, #0a0a0a);
71
+ --vocs-background-color-surface: light-dark(#fff, #121212);
72
+ }
73
+
74
+ :is(h1, h2, h3, h4, h5, h6)[data-v] {
75
+ font-weight: 500;
76
+ }
77
+
78
+ /* Nudge the header logo a touch larger than the default max-h-7 (1.75rem). */
79
+ [data-v-logo-image] {
80
+ max-height: 2rem;
81
+ }
82
+
83
+ /* Sidebar leaf items render Regular (the nav's 450 default otherwise resolves to
84
+ * Demi via the 500-600 range). Group labels ([data-v-sidebar-section-header])
85
+ * keep their heavier weight. */
86
+ [data-v-sidebar-item] {
87
+ font-weight: 400;
88
+ }
89
+
90
+ [data-vocs-theme='dark'] {
91
+ --vocs-color-gray4: oklch(20% 0 0);
92
+ --vocs-color-gray5: oklch(0.23 0 0);
93
+ --vocs-border-color-primary: oklch(0.25 0 0);
94
+ --vocs-border-color-secondary: oklch(0.25 0 0);
95
+ }
96
+
97
+ *,
98
+ *::before,
99
+ *::after {
100
+ border-radius: 0 !important;
101
+ }`
102
+
103
+ /**
104
+ * Returns a shallow copy of `spec` with the JSON-RPC passthrough operation's
105
+ * `x-openrpc` replaced by the inline OpenRPC document, for the docs handler.
106
+ *
107
+ * Vocs expands `x-openrpc` at request time. A URL reference (as kept in the
108
+ * public `/openapi.json` by `App.create`'s `applyOpenrpcLink`) would make the
109
+ * docs worker fetch its own `/openrpc.json` — a self-subrequest that is
110
+ * unreliable on Cloudflare Workers and silently falls back to a single,
111
+ * unexpanded operation. Inlining the committed artifact keeps expansion
112
+ * deterministic across local and deployed environments, without bloating the
113
+ * public spec. Only the affected path/op are cloned; the rest of the (large)
114
+ * document is shared by reference.
115
+ */
116
+ function inlineOpenrpc<spec extends { paths: Record<string, unknown> }>(spec: spec): spec {
117
+ const paths: Record<string, unknown> = {}
118
+ for (const [pathname, item] of Object.entries(spec.paths)) {
119
+ let next = item
120
+ if (isRecord(item))
121
+ for (const [method, op] of Object.entries(item))
122
+ if (isRpcOperation(op)) next = { ...item, [method]: { ...op, 'x-openrpc': openrpcSpec } }
123
+ paths[pathname] = next
124
+ }
125
+ return { ...spec, paths }
126
+ }
127
+
128
+ // The JSON-RPC passthrough's operation id, set by its route definition and
129
+ // targeted by `App.create`'s `applyOpenrpcLink`.
130
+ function isRpcOperation(op: unknown): op is Record<string, unknown> {
131
+ return isRecord(op) && op['operationId'] === 'rpcRequest'
132
+ }
133
+
134
+ function isRecord(value: unknown): value is Record<string, unknown> {
135
+ return !!value && typeof value === 'object' && !Array.isArray(value)
136
+ }
@@ -0,0 +1 @@
1
+ export { docs } from './App.js'
@@ -0,0 +1,3 @@
1
+ export { data } from './data/index.js'
2
+ export { platform } from './platform/index.js'
3
+ export { relay } from './relay/index.js'
@@ -0,0 +1,23 @@
1
+ import type { Hono } from 'hono'
2
+
3
+ import type * as App from '../App.js'
4
+
5
+ // Hono's `.route()` drops sub-app metadata, so a group's OpenAPI metadata can't
6
+ // ride the instance through it. Each group attaches its metadata here and
7
+ // `App.create` reads it back on mount. The `WeakMap` keeps the association off
8
+ // the app's type, so `testClient`/`hc` inference is untouched.
9
+ const registry = new WeakMap<Hono<any, any>, App.create.Metadata>()
10
+
11
+ /** Attaches a group's OpenAPI metadata to its app instance for `create` to collect on mount. */
12
+ export function attach<const app extends Hono<any, any>>(
13
+ app: app,
14
+ metadata: App.create.Metadata,
15
+ ): app {
16
+ registry.set(app, metadata)
17
+ return app
18
+ }
19
+
20
+ /** Reads the OpenAPI metadata attached to an app instance, if any. */
21
+ export function read(app: Hono<any, any>): App.create.Metadata | undefined {
22
+ return registry.get(app)
23
+ }
@@ -0,0 +1,130 @@
1
+ import { Hono } from 'hono'
2
+
3
+ import type * as App from '../../App.js'
4
+ import * as Metadata from '../metadata.js'
5
+
6
+ import { apiKeys } from './routes/api-keys.js'
7
+ import { invitations } from './routes/invitations.js'
8
+ import { me } from './routes/me.js'
9
+ import { members } from './routes/members.js'
10
+ import { orgs } from './routes/orgs.js'
11
+ import { projects } from './routes/projects.js'
12
+
13
+ /**
14
+ * Minimal transactional email sender. Cloudflare deployments wrap the Email
15
+ * Service binding (`{ from, send: (m) => env.EMAIL.send(m) }`); other hosts
16
+ * pass any compatible sender. Dispatch is always best-effort.
17
+ */
18
+ export type Email = {
19
+ /** Console URL embedded in email links (e.g. sign-in URLs). Defaults to the hosted console; self-hosts point it at their own. */
20
+ consoleUrl?: string | undefined
21
+ /** Sender address for platform emails (e.g. `noreply@tempo.xyz`). */
22
+ from: string
23
+ /** Sends one message. */
24
+ send: (message: Email.Message) => Promise<unknown>
25
+ }
26
+
27
+ export declare namespace Email {
28
+ /** One transactional message. */
29
+ type Message = {
30
+ /** Sender address. */
31
+ from: string
32
+ /** HTML body. */
33
+ html?: string | undefined
34
+ /** Subject line. */
35
+ subject: string
36
+ /** Plain-text body. */
37
+ text: string
38
+ /** Recipient address. */
39
+ to: string
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Request environment for platform routes: the shared app environment plus the
45
+ * `email` sender this group publishes on context. Owned here, not in core
46
+ * `App.Environment`, since email is a platform concern.
47
+ */
48
+ export type Environment = {
49
+ Variables: App.Environment['Variables'] & {
50
+ /** Transactional email sender for platform emails; undefined when dispatch is disabled. */
51
+ email: Email | undefined
52
+ }
53
+ }
54
+
55
+ /**
56
+ * The tenant-platform route group: the current user, orgs, projects, members,
57
+ * invitations, and API-key management. Every route reads its dependencies from
58
+ * request context set by {@link App.create}.
59
+ *
60
+ * The session-auth surface (`/v1/auth/siwe` + `session` capability) is owned by
61
+ * {@link App.create}, so platform routes gate on a session without owning it.
62
+ *
63
+ * ```ts
64
+ * App.create(options).route('/', platform())
65
+ * ```
66
+ */
67
+ export function platform(options: platform.Options = {}) {
68
+ const app = new Hono<Environment>()
69
+ // Publish the transactional email sender for this group's handlers
70
+ // (invitations read it off context); undefined disables dispatch.
71
+ .use('*', async (c, next) => {
72
+ c.set('email', options.email)
73
+ await next()
74
+ })
75
+ .route('/', apiKeys({ enabled: options.apiKeys !== false }))
76
+ .route('/', invitations())
77
+ .route('/', me())
78
+ .route('/', members())
79
+ .route('/', orgs())
80
+ .route('/', projects())
81
+ return Metadata.attach(app, openapi)
82
+ }
83
+
84
+ export declare namespace platform {
85
+ /** Options for the platform route group. */
86
+ type Options = {
87
+ /** Expose the API-key management routes in the OpenAPI document. @default true */
88
+ apiKeys?: boolean | undefined
89
+ /** Transactional email sender for platform emails (e.g. invitations); omit to disable dispatch — notified flows still work in-product. */
90
+ email?: Email | undefined
91
+ }
92
+ }
93
+
94
+ /**
95
+ * The OpenAPI metadata this group owns: platform operation tags and the
96
+ * `session` security scheme. Tagged onto the {@link platform} instance so
97
+ * `App.create` collects it.
98
+ */
99
+ const openapi = {
100
+ securitySchemes: {
101
+ session: {
102
+ description: 'Cookie session established by sign-in (`POST /v1/auth/siwe`). Clients may also send the session token as `Authorization: Bearer <token>`.', // prettier-ignore
103
+ in: 'cookie',
104
+ name: 'accounts_auth',
105
+ type: 'apiKey',
106
+ },
107
+ },
108
+ tags: [
109
+ { name: 'API Keys', description: 'Credentials for accessing the Tempo API.' },
110
+ { name: 'Invitations', description: 'Pending organization invitations.' },
111
+ { name: 'Members', description: 'Organization team membership.' },
112
+ { name: 'Organizations', description: 'Teams that own application workspaces and members.' },
113
+ { name: 'Projects', description: 'Application workspaces within an organization.' },
114
+ { name: 'Users', description: 'Users on the Tempo Platform.' },
115
+ ],
116
+ 'x-tagGroups': [
117
+ {
118
+ name: 'Platform API',
119
+ tags: [
120
+ 'API Keys',
121
+ 'Authentication',
122
+ 'Invitations',
123
+ 'Members',
124
+ 'Organizations',
125
+ 'Projects',
126
+ 'Users',
127
+ ],
128
+ },
129
+ ],
130
+ } satisfies App.create.Metadata
@@ -0,0 +1 @@
1
+ export { platform } from './App.js'