tapimo 0.0.0 → 0.0.2
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.
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/ApiKey.d.ts +65 -0
- package/dist/ApiKey.d.ts.map +1 -0
- package/dist/ApiKey.js +105 -0
- package/dist/ApiKey.js.map +1 -0
- package/dist/ApiKeySource.d.ts +166 -0
- package/dist/ApiKeySource.d.ts.map +1 -0
- package/dist/ApiKeySource.js +234 -0
- package/dist/ApiKeySource.js.map +1 -0
- package/dist/App.d.ts +19317 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +612 -0
- package/dist/App.js.map +1 -0
- package/dist/Assets.d.ts +44 -0
- package/dist/Assets.d.ts.map +1 -0
- package/dist/Assets.js +23 -0
- package/dist/Assets.js.map +1 -0
- package/dist/Auth.d.ts +2 -0
- package/dist/Auth.d.ts.map +1 -0
- package/dist/Auth.js +2 -0
- package/dist/Auth.js.map +1 -0
- package/dist/Cli.d.ts +21 -0
- package/dist/Cli.d.ts.map +1 -0
- package/dist/Cli.js +13 -0
- package/dist/Cli.js.map +1 -0
- package/dist/Client.d.ts +20 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +24 -0
- package/dist/Client.js.map +1 -0
- package/dist/Metrics.d.ts +70 -0
- package/dist/Metrics.d.ts.map +1 -0
- package/dist/Metrics.js +91 -0
- package/dist/Metrics.js.map +1 -0
- package/dist/Scope.d.ts +35 -0
- package/dist/Scope.d.ts.map +1 -0
- package/dist/Scope.js +38 -0
- package/dist/Scope.js.map +1 -0
- package/dist/Webhooks.d.ts +79 -0
- package/dist/Webhooks.d.ts.map +1 -0
- package/dist/Webhooks.js +107 -0
- package/dist/Webhooks.js.map +1 -0
- package/dist/admin/Access.d.ts +41 -0
- package/dist/admin/Access.d.ts.map +1 -0
- package/dist/admin/Access.js +75 -0
- package/dist/admin/Access.js.map +1 -0
- package/dist/admin/App.d.ts +1221 -0
- package/dist/admin/App.d.ts.map +1 -0
- package/dist/admin/App.js +113 -0
- package/dist/admin/App.js.map +1 -0
- package/dist/admin/apps/api-keys.d.ts +209 -0
- package/dist/admin/apps/api-keys.d.ts.map +1 -0
- package/dist/admin/apps/api-keys.js +129 -0
- package/dist/admin/apps/api-keys.js.map +1 -0
- package/dist/admin/apps/scopes.d.ts +46 -0
- package/dist/admin/apps/scopes.d.ts.map +1 -0
- package/dist/admin/apps/scopes.js +41 -0
- package/dist/admin/apps/scopes.js.map +1 -0
- package/dist/admin/apps/verified-tokens.d.ts +1206 -0
- package/dist/admin/apps/verified-tokens.d.ts.map +1 -0
- package/dist/admin/apps/verified-tokens.js +485 -0
- package/dist/admin/apps/verified-tokens.js.map +1 -0
- package/dist/admin/index.d.ts +3 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/ui.generated.d.ts +11 -0
- package/dist/admin/ui.generated.d.ts.map +1 -0
- package/dist/admin/ui.generated.js +43 -0
- package/dist/admin/ui.generated.js.map +1 -0
- package/dist/apps/activities.d.ts +18725 -0
- package/dist/apps/activities.d.ts.map +1 -0
- package/dist/apps/activities.js +3138 -0
- package/dist/apps/activities.js.map +1 -0
- package/dist/apps/addresses.d.ts +3662 -0
- package/dist/apps/addresses.d.ts.map +1 -0
- package/dist/apps/addresses.js +22 -0
- package/dist/apps/addresses.js.map +1 -0
- package/dist/apps/balances.d.ts +342 -0
- package/dist/apps/balances.d.ts.map +1 -0
- package/dist/apps/balances.js +393 -0
- package/dist/apps/balances.js.map +1 -0
- package/dist/apps/blocks.d.ts +931 -0
- package/dist/apps/blocks.d.ts.map +1 -0
- package/dist/apps/blocks.js +689 -0
- package/dist/apps/blocks.js.map +1 -0
- package/dist/apps/coingecko.d.ts +1053 -0
- package/dist/apps/coingecko.d.ts.map +1 -0
- package/dist/apps/coingecko.js +1015 -0
- package/dist/apps/coingecko.js.map +1 -0
- package/dist/apps/exchanges.d.ts +3000 -0
- package/dist/apps/exchanges.d.ts.map +1 -0
- package/dist/apps/exchanges.js +3570 -0
- package/dist/apps/exchanges.js.map +1 -0
- package/dist/apps/fee-amm.d.ts +640 -0
- package/dist/apps/fee-amm.d.ts.map +1 -0
- package/dist/apps/fee-amm.js +815 -0
- package/dist/apps/fee-amm.js.map +1 -0
- package/dist/apps/indexer.d.ts +116 -0
- package/dist/apps/indexer.d.ts.map +1 -0
- package/dist/apps/indexer.js +270 -0
- package/dist/apps/indexer.js.map +1 -0
- package/dist/apps/receipts.d.ts +1438 -0
- package/dist/apps/receipts.d.ts.map +1 -0
- package/dist/apps/receipts.js +874 -0
- package/dist/apps/receipts.js.map +1 -0
- package/dist/apps/rpc.d.ts +173 -0
- package/dist/apps/rpc.d.ts.map +1 -0
- package/dist/apps/rpc.js +191 -0
- package/dist/apps/rpc.js.map +1 -0
- package/dist/apps/tokenlist.d.ts +192 -0
- package/dist/apps/tokenlist.d.ts.map +1 -0
- package/dist/apps/tokenlist.js +153 -0
- package/dist/apps/tokenlist.js.map +1 -0
- package/dist/apps/tokens.d.ts +2246 -0
- package/dist/apps/tokens.d.ts.map +1 -0
- package/dist/apps/tokens.js +1789 -0
- package/dist/apps/tokens.js.map +1 -0
- package/dist/apps/transactions.d.ts +2327 -0
- package/dist/apps/transactions.d.ts.map +1 -0
- package/dist/apps/transactions.js +975 -0
- package/dist/apps/transactions.js.map +1 -0
- package/dist/apps/transfers.d.ts +589 -0
- package/dist/apps/transfers.d.ts.map +1 -0
- package/dist/apps/transfers.js +769 -0
- package/dist/apps/transfers.js.map +1 -0
- package/dist/apps/verified-tokens.d.ts +544 -0
- package/dist/apps/verified-tokens.d.ts.map +1 -0
- package/dist/apps/verified-tokens.js +234 -0
- package/dist/apps/verified-tokens.js.map +1 -0
- package/dist/apps/webhooks.d.ts +7684 -0
- package/dist/apps/webhooks.d.ts.map +1 -0
- package/dist/apps/webhooks.js +2112 -0
- package/dist/apps/webhooks.js.map +1 -0
- package/dist/cloudflare.d.ts +32 -0
- package/dist/cloudflare.d.ts.map +1 -0
- package/dist/cloudflare.js +45 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Auth.d.ts +298 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +618 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Cache.d.ts +74 -0
- package/dist/internal/Cache.d.ts.map +1 -0
- package/dist/internal/Cache.js +215 -0
- package/dist/internal/Cache.js.map +1 -0
- package/dist/internal/Cursor.d.ts +79 -0
- package/dist/internal/Cursor.d.ts.map +1 -0
- package/dist/internal/Cursor.js +116 -0
- package/dist/internal/Cursor.js.map +1 -0
- package/dist/internal/EdgeCache.d.ts +59 -0
- package/dist/internal/EdgeCache.d.ts.map +1 -0
- package/dist/internal/EdgeCache.js +174 -0
- package/dist/internal/EdgeCache.js.map +1 -0
- package/dist/internal/Log.d.ts +104 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +118 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/MetricSink.d.ts +65 -0
- package/dist/internal/MetricSink.d.ts.map +1 -0
- package/dist/internal/MetricSink.js +146 -0
- package/dist/internal/MetricSink.js.map +1 -0
- package/dist/internal/Mpp.d.ts +71 -0
- package/dist/internal/Mpp.d.ts.map +1 -0
- package/dist/internal/Mpp.js +105 -0
- package/dist/internal/Mpp.js.map +1 -0
- package/dist/internal/OpenApi.d.ts +313 -0
- package/dist/internal/OpenApi.d.ts.map +1 -0
- package/dist/internal/OpenApi.fonts.d.ts +2 -0
- package/dist/internal/OpenApi.fonts.d.ts.map +1 -0
- package/dist/internal/OpenApi.fonts.js +39 -0
- package/dist/internal/OpenApi.fonts.js.map +1 -0
- package/dist/internal/OpenApi.js +335 -0
- package/dist/internal/OpenApi.js.map +1 -0
- package/dist/internal/OpenApi.logo.d.ts +6 -0
- package/dist/internal/OpenApi.logo.d.ts.map +1 -0
- package/dist/internal/OpenApi.logo.js +19 -0
- package/dist/internal/OpenApi.logo.js.map +1 -0
- package/dist/internal/Path.d.ts +5 -0
- package/dist/internal/Path.d.ts.map +1 -0
- package/dist/internal/Path.js +16 -0
- package/dist/internal/Path.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +60 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +48 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Response.d.ts +132 -0
- package/dist/internal/Response.d.ts.map +1 -0
- package/dist/internal/Response.js +72 -0
- package/dist/internal/Response.js.map +1 -0
- package/dist/internal/Schema.d.ts +257 -0
- package/dist/internal/Schema.d.ts.map +1 -0
- package/dist/internal/Schema.js +360 -0
- package/dist/internal/Schema.js.map +1 -0
- package/dist/internal/Store.d.ts +204 -0
- package/dist/internal/Store.d.ts.map +1 -0
- package/dist/internal/Store.js +291 -0
- package/dist/internal/Store.js.map +1 -0
- package/dist/internal/Tidx.d.ts +120 -0
- package/dist/internal/Tidx.d.ts.map +1 -0
- package/dist/internal/Tidx.js +156 -0
- package/dist/internal/Tidx.js.map +1 -0
- package/dist/internal/Timing.d.ts +22 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +32 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Ttl.d.ts +25 -0
- package/dist/internal/Ttl.d.ts.map +1 -0
- package/dist/internal/Ttl.js +49 -0
- package/dist/internal/Ttl.js.map +1 -0
- package/dist/internal/Value.d.ts +47 -0
- package/dist/internal/Value.d.ts.map +1 -0
- package/dist/internal/Value.js +122 -0
- package/dist/internal/Value.js.map +1 -0
- package/dist/internal/VerifiedTokens.d.ts +228 -0
- package/dist/internal/VerifiedTokens.d.ts.map +1 -0
- package/dist/internal/VerifiedTokens.js +450 -0
- package/dist/internal/VerifiedTokens.js.map +1 -0
- package/dist/internal/Viem.d.ts +2082 -0
- package/dist/internal/Viem.d.ts.map +1 -0
- package/dist/internal/Viem.js +63 -0
- package/dist/internal/Viem.js.map +1 -0
- package/dist/internal/WebhookDestination.d.ts +198 -0
- package/dist/internal/WebhookDestination.d.ts.map +1 -0
- package/dist/internal/WebhookDestination.js +170 -0
- package/dist/internal/WebhookDestination.js.map +1 -0
- package/dist/internal/Webhooks.d.ts +433 -0
- package/dist/internal/Webhooks.d.ts.map +1 -0
- package/dist/internal/Webhooks.js +489 -0
- package/dist/internal/Webhooks.js.map +1 -0
- package/dist/internal/webhookDestinations/betterStack.d.ts +26 -0
- package/dist/internal/webhookDestinations/betterStack.d.ts.map +1 -0
- package/dist/internal/webhookDestinations/betterStack.js +76 -0
- package/dist/internal/webhookDestinations/betterStack.js.map +1 -0
- package/dist/internal/webhookDestinations/slack.d.ts +59 -0
- package/dist/internal/webhookDestinations/slack.d.ts.map +1 -0
- package/dist/internal/webhookDestinations/slack.js +422 -0
- package/dist/internal/webhookDestinations/slack.js.map +1 -0
- package/dist/internal/webhookDestinations/url.d.ts +17 -0
- package/dist/internal/webhookDestinations/url.d.ts.map +1 -0
- package/dist/internal/webhookDestinations/url.js +130 -0
- package/dist/internal/webhookDestinations/url.js.map +1 -0
- package/dist/openrpc.json +5302 -0
- package/package.json +46 -4
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000000.svg +1 -0
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000001.svg +1 -0
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000002.svg +1 -0
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000003.svg +1 -0
- package/seeds/31318/verified-tokens.json +30 -0
- package/seeds/4217/icons/0x20c0000000000000000000000000000000000000.svg +25 -0
- package/seeds/4217/icons/0x20c000000000000000000000048c8f36df1c9a4a.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000000520792dcccccccc.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000000a6da882d075a4c3.svg +4 -0
- package/seeds/4217/icons/0x20c000000000000000000000111111111e910f0f.svg +30 -0
- package/seeds/4217/icons/0x20c00000000000000000000014f22ca97301eb73.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000001621e21f71cf12fb.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000002f52d5cc21a3207b.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000003158081efd85bfc2.svg +11 -0
- package/seeds/4217/icons/0x20c0000000000000000000003554d28269e0f3c2.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000383a23bacb546ab9.svg +1 -0
- package/seeds/4217/icons/0x20c00000000000000000000042109aef2f8b28e1.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000005c0bac7cef389a11.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000006fd9a167923ba194.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000007f7ba549dd0251b9.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000008191667423f70e67.svg +5 -0
- package/seeds/4217/icons/0x20c0000000000000000000008ee4fcff88888888.svg +1 -0
- package/seeds/4217/icons/0x20c0000000000000000000009a4a4b17e0dc6651.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000ab02d39df30bd17e.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000ae247a1130450f09.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000aeed2ec36a54d0e5.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000b9537d11c60e8b50.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000bd95bfb69fbe6ce3.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000c412ec89d0c08be5.svg +1 -0
- package/seeds/4217/icons/0x20c000000000000000000000f047dd7018e50367.png +0 -0
- package/seeds/4217/verified-tokens.json +177 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000000.svg +25 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000001.svg +1 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000002.svg +1 -0
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000003.svg +1 -0
- package/seeds/42431/icons/0x20c0000000000000000000009e8d7eb59b783726.svg +1 -0
- package/seeds/42431/icons/0x20c000000000000000000000d72572838bbee59c.svg +1 -0
- package/seeds/42431/verified-tokens.json +44 -0
- package/seeds/openrpc/README.md +27 -0
- package/seeds/openrpc/execution-apis.json +8989 -0
- package/src/ApiKey.test.ts +91 -0
- package/src/ApiKey.ts +122 -0
- package/src/ApiKeySource.test-d.ts +11 -0
- package/src/ApiKeySource.test.ts +295 -0
- package/src/ApiKeySource.ts +303 -0
- package/src/App.test-d.ts +38 -0
- package/src/App.test.ts +65927 -0
- package/src/App.ts +855 -0
- package/src/Assets.ts +58 -0
- package/src/Auth.ts +1 -0
- package/src/Cli.test.ts +81 -0
- package/src/Cli.ts +38 -0
- package/src/Client.test-d.ts +1438 -0
- package/src/Client.test.ts +134 -0
- package/src/Client.ts +45 -0
- package/src/Metrics.ts +154 -0
- package/src/Scope.ts +50 -0
- package/src/Webhooks.test.ts +49 -0
- package/src/Webhooks.ts +172 -0
- package/src/admin/Access.test.ts +130 -0
- package/src/admin/Access.ts +87 -0
- package/src/admin/App.test.ts +225 -0
- package/src/admin/App.ts +216 -0
- package/src/admin/apps/api-keys.test.ts +156 -0
- package/src/admin/apps/api-keys.ts +157 -0
- package/src/admin/apps/scopes.test.ts +52 -0
- package/src/admin/apps/scopes.ts +47 -0
- package/src/admin/apps/verified-tokens.test.ts +415 -0
- package/src/admin/apps/verified-tokens.ts +566 -0
- package/src/admin/index.ts +2 -0
- package/src/admin/ui/plugin.ts +135 -0
- package/src/admin/ui/src/components/Checkbox.tsx +22 -0
- package/src/admin/ui/src/components/Dialog.tsx +32 -0
- package/src/admin/ui/src/components/MobileProfile.tsx +31 -0
- package/src/admin/ui/src/components/Page.tsx +53 -0
- package/src/admin/ui/src/components/TempoLogo.tsx +37 -0
- package/src/admin/ui/src/fonts/Pilat-Demi.woff2 +0 -0
- package/src/admin/ui/src/fonts/Pilat-Regular.woff2 +0 -0
- package/src/admin/ui/src/lib/api-keys.ts +63 -0
- package/src/admin/ui/src/lib/client.ts +15 -0
- package/src/admin/ui/src/lib/config.ts +57 -0
- package/src/admin/ui/src/lib/query-client.ts +26 -0
- package/src/admin/ui/src/lib/scopes.ts +25 -0
- package/src/admin/ui/src/lib/verified-tokens.ts +89 -0
- package/src/admin/ui/src/lib/wagmi.ts +18 -0
- package/src/admin/ui/src/routeTree.gen.ts +104 -0
- package/src/admin/ui/src/router.tsx +25 -0
- package/src/admin/ui/src/routes/__root.tsx +219 -0
- package/src/admin/ui/src/routes/api-keys.tsx +329 -0
- package/src/admin/ui/src/routes/index.tsx +7 -0
- package/src/admin/ui/src/routes/verified-tokens.tsx +331 -0
- package/src/admin/ui/src/styles.css +20 -0
- package/src/admin/ui/tsconfig.json +16 -0
- package/src/admin/ui/vite.config.ts +29 -0
- package/src/admin/ui.generated.ts +60 -0
- package/src/apps/activities.test.ts +1020 -0
- package/src/apps/activities.ts +3934 -0
- package/src/apps/addresses.ts +24 -0
- package/src/apps/balances.test.ts +274 -0
- package/src/apps/balances.ts +533 -0
- package/src/apps/blocks.test.ts +385 -0
- package/src/apps/blocks.ts +896 -0
- package/src/apps/coingecko.test.ts +218 -0
- package/src/apps/coingecko.ts +1383 -0
- package/src/apps/exchanges.test.ts +958 -0
- package/src/apps/exchanges.ts +4773 -0
- package/src/apps/fee-amm.test.ts +321 -0
- package/src/apps/fee-amm.ts +1121 -0
- package/src/apps/indexer.test.ts +153 -0
- package/src/apps/indexer.ts +330 -0
- package/src/apps/receipts.test.ts +285 -0
- package/src/apps/receipts.ts +1193 -0
- package/src/apps/rpc.test.ts +302 -0
- package/src/apps/rpc.ts +222 -0
- package/src/apps/tokenlist.test.ts +80 -0
- package/src/apps/tokenlist.ts +207 -0
- package/src/apps/tokens.test.ts +1062 -0
- package/src/apps/tokens.ts +2292 -0
- package/src/apps/transactions.test.ts +408 -0
- package/src/apps/transactions.ts +1363 -0
- package/src/apps/transfers.test.ts +371 -0
- package/src/apps/transfers.ts +1116 -0
- package/src/apps/verified-tokens.test.ts +114 -0
- package/src/apps/verified-tokens.ts +295 -0
- package/src/apps/webhooks.test.ts +1937 -0
- package/src/apps/webhooks.ts +2926 -0
- package/src/cloudflare.ts +55 -0
- package/src/index.ts +15 -0
- package/src/internal/Auth.test.ts +980 -0
- package/src/internal/Auth.ts +1012 -0
- package/src/internal/Cache.test.ts +240 -0
- package/src/internal/Cache.ts +262 -0
- package/src/internal/Cursor.test.ts +100 -0
- package/src/internal/Cursor.ts +149 -0
- package/src/internal/EdgeCache.test.ts +234 -0
- package/src/internal/EdgeCache.ts +224 -0
- package/src/internal/Errors.ts +14 -0
- package/src/internal/Log.test.ts +244 -0
- package/src/internal/Log.ts +216 -0
- package/src/internal/MetricSink.ts +220 -0
- package/src/internal/Mpp.test.ts +64 -0
- package/src/internal/Mpp.ts +141 -0
- package/src/internal/OpenApi.fonts.ts +38 -0
- package/src/internal/OpenApi.logo.ts +18 -0
- package/src/internal/OpenApi.ts +488 -0
- package/src/internal/Path.test.ts +14 -0
- package/src/internal/Path.ts +15 -0
- package/src/internal/RateLimit.test.ts +93 -0
- package/src/internal/RateLimit.ts +93 -0
- package/src/internal/Response.ts +131 -0
- package/src/internal/Schema.test.ts +34 -0
- package/src/internal/Schema.ts +523 -0
- package/src/internal/Store.test.ts +545 -0
- package/src/internal/Store.ts +526 -0
- package/src/internal/Tidx.local.test.ts +33 -0
- package/src/internal/Tidx.test.ts +294 -0
- package/src/internal/Tidx.ts +238 -0
- package/src/internal/Timing.test.ts +22 -0
- package/src/internal/Timing.ts +62 -0
- package/src/internal/Ttl.test.ts +18 -0
- package/src/internal/Ttl.ts +59 -0
- package/src/internal/Value.ts +114 -0
- package/src/internal/VerifiedTokens.test.ts +333 -0
- package/src/internal/VerifiedTokens.ts +645 -0
- package/src/internal/Viem.test.ts +115 -0
- package/src/internal/Viem.ts +165 -0
- package/src/internal/WebhookDestination.test.ts +648 -0
- package/src/internal/WebhookDestination.ts +331 -0
- package/src/internal/Webhooks.test.ts +668 -0
- package/src/internal/Webhooks.ts +940 -0
- package/src/internal/webhookDestinations/betterStack.ts +91 -0
- package/src/internal/webhookDestinations/slack.ts +496 -0
- package/src/internal/webhookDestinations/url.ts +128 -0
- package/src/openrpc.json +5302 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { resolver, validator } from 'hono-openapi';
|
|
2
|
+
import * as z from 'zod/mini';
|
|
3
|
+
import { pilatFontFaces } from './OpenApi.fonts.js';
|
|
4
|
+
import * as Response from './Response.js';
|
|
5
|
+
import * as Schema from './Schema.js';
|
|
6
|
+
/**
|
|
7
|
+
* `toJSONSchema` override that re-applies `examples` zod strips from
|
|
8
|
+
* pipe/default schemas in `io: 'input'` mode. zod intentionally drops
|
|
9
|
+
* `examples` (and `default`) from the input JSON Schema of a `ZodPipe`
|
|
10
|
+
* (e.g. `chainId`, `include`, boolean queries) and a `ZodDefault`, so an
|
|
11
|
+
* `examples` attached via `z.meta(...)` on those wrappers never reaches the
|
|
12
|
+
* generated parameter. This override runs after conversion and copies the
|
|
13
|
+
* registered `examples` back onto the node's JSON Schema, so every parameter
|
|
14
|
+
* surfaces its example regardless of the underlying schema shape.
|
|
15
|
+
*/
|
|
16
|
+
function recoverExamples(ctx) {
|
|
17
|
+
if (ctx.jsonSchema.examples !== undefined)
|
|
18
|
+
return;
|
|
19
|
+
const meta = z.globalRegistry.get(ctx.zodSchema);
|
|
20
|
+
if (meta?.examples === undefined)
|
|
21
|
+
return;
|
|
22
|
+
ctx.jsonSchema.examples = Array.isArray(meta.examples)
|
|
23
|
+
? meta.examples
|
|
24
|
+
: Object.values(meta.examples).map((e) => e.value);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Shared zod→JSON-Schema conversion options applied to every parameter and
|
|
28
|
+
* response schema. {@link recoverExamples} re-attaches `examples` that zod
|
|
29
|
+
* strips from pipe/default schemas (e.g. `Schema.Hex`, `Schema.Quantity`), so a
|
|
30
|
+
* field's `z.meta({ examples })` survives even on a branded pipe output — no
|
|
31
|
+
* per-field non-pipe schema is needed. Supplying our own `override` opts out of
|
|
32
|
+
* hono-openapi's default zod date override, so re-add its `unrepresentable:
|
|
33
|
+
* 'any'` to keep transform/pipe nodes (which have no JSON-Schema form) emitting
|
|
34
|
+
* `{}` instead of throwing.
|
|
35
|
+
*/
|
|
36
|
+
const schemaOptions = { options: { override: recoverExamples, unrepresentable: 'any' } };
|
|
37
|
+
// Re-export the upstream `hono-openapi` API surface used by the app so all
|
|
38
|
+
// callers go through this local `OpenApi` module. Forwarded as direct named
|
|
39
|
+
// re-exports because `uniqueSymbol` is a `unique symbol` whose identity is
|
|
40
|
+
// lost when copied through a `const` declaration.
|
|
41
|
+
export { describeRoute, resolver, uniqueSymbol, validator, } from 'hono-openapi';
|
|
42
|
+
// Theme-aware Tempo API wordmark for the docs header (`vocs.logoUrl`), inlined
|
|
43
|
+
// as SVG data URIs. See {@link file://./OpenApi.logo.ts}.
|
|
44
|
+
export { logoUrl } from './OpenApi.logo.js';
|
|
45
|
+
/**
|
|
46
|
+
* Custom CSS injected into the standalone reference's shell `<head>` (via
|
|
47
|
+
* `Handler.openApi(_, { css })`), after the Vocs design-system styles so it
|
|
48
|
+
* overrides them:
|
|
49
|
+
*
|
|
50
|
+
* - Page/surface backgrounds use Tempo's near-black dark palette and pure-white
|
|
51
|
+
* light palette via `light-dark(<light>, <dark>)`.
|
|
52
|
+
* - The dark border color is darkened (the light theme keeps its default).
|
|
53
|
+
* - Every corner is squared. The universal `!important` rule beats hard-coded
|
|
54
|
+
* `border-radius` values and inline styles (e.g. the Scalar playground), which
|
|
55
|
+
* overriding the radius scale variables alone would miss.
|
|
56
|
+
* - The default sans/body font is Pilat (Vocs reads `--vocs-font-family`); the
|
|
57
|
+
* webfont is embedded via {@link pilatFontFaces}. Body stays at the default
|
|
58
|
+
* weight (400); headings are pinned to 500, which renders Pilat Demi (the
|
|
59
|
+
* family has no 500 cut, so Demi covers the 500-600 range — see
|
|
60
|
+
* {@link pilatFontFaces}).
|
|
61
|
+
*/
|
|
62
|
+
export const css = `${pilatFontFaces}
|
|
63
|
+
|
|
64
|
+
:root {
|
|
65
|
+
--vocs-font-family: "Pilat", Arial, Helvetica, sans-serif;
|
|
66
|
+
--vocs-background-color-primary: light-dark(#fafafa, #0a0a0a);
|
|
67
|
+
--vocs-background-color-surface: light-dark(#fff, #121212);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:is(h1, h2, h3, h4, h5, h6)[data-v] {
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Nudge the header logo a touch larger than the default max-h-7 (1.75rem). */
|
|
75
|
+
[data-v-logo-image] {
|
|
76
|
+
max-height: 2rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Sidebar leaf items render Regular (the nav's 450 default otherwise resolves to
|
|
80
|
+
* Demi via the 500-600 range). Group labels ([data-v-sidebar-section-header])
|
|
81
|
+
* keep their heavier weight. */
|
|
82
|
+
[data-v-sidebar-item] {
|
|
83
|
+
font-weight: 400;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[data-vocs-theme='dark'] {
|
|
87
|
+
--vocs-color-gray4: oklch(20% 0 0);
|
|
88
|
+
--vocs-color-gray5: oklch(0.23 0 0);
|
|
89
|
+
--vocs-border-color-primary: oklch(0.25 0 0);
|
|
90
|
+
--vocs-border-color-secondary: oklch(0.25 0 0);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
*,
|
|
94
|
+
*::before,
|
|
95
|
+
*::after {
|
|
96
|
+
border-radius: 0 !important;
|
|
97
|
+
}`;
|
|
98
|
+
/**
|
|
99
|
+
* Standard machine-readable `error.code` values per status, shared API-wide.
|
|
100
|
+
* The reference enumerates `error.code` to these so generated clients narrow it
|
|
101
|
+
* to a literal union instead of an open `string`. 400 and 404 vary per
|
|
102
|
+
* operation; the values here are the API-wide supersets, narrowable per route
|
|
103
|
+
* via the `codes` override in {@link responses.Options}.
|
|
104
|
+
*/
|
|
105
|
+
export const errorCodes = {
|
|
106
|
+
400: [
|
|
107
|
+
'query_invalid',
|
|
108
|
+
'param_invalid',
|
|
109
|
+
'body_invalid',
|
|
110
|
+
'address_invalid',
|
|
111
|
+
'token_invalid',
|
|
112
|
+
'symbol_invalid',
|
|
113
|
+
'pair_invalid',
|
|
114
|
+
'pair_id_invalid',
|
|
115
|
+
'transaction_invalid',
|
|
116
|
+
'order_invalid',
|
|
117
|
+
'block_invalid',
|
|
118
|
+
'chain_id_invalid',
|
|
119
|
+
'chain_id_unsupported',
|
|
120
|
+
'url_invalid',
|
|
121
|
+
'api_key_malformed',
|
|
122
|
+
],
|
|
123
|
+
401: ['api_key_missing', 'api_key_invalid', 'unauthorized'],
|
|
124
|
+
403: ['api_key_forbidden', 'limit_exceeded'],
|
|
125
|
+
404: [
|
|
126
|
+
'not_found',
|
|
127
|
+
'token_not_found',
|
|
128
|
+
'token_logo_not_found',
|
|
129
|
+
'block_not_found',
|
|
130
|
+
'transaction_not_found',
|
|
131
|
+
'receipt_not_found',
|
|
132
|
+
'order_not_found',
|
|
133
|
+
'pair_not_found',
|
|
134
|
+
'verified_token_not_found',
|
|
135
|
+
'webhook_not_found',
|
|
136
|
+
'delivery_not_found',
|
|
137
|
+
'webhooks_not_enabled',
|
|
138
|
+
],
|
|
139
|
+
429: ['rate_limit_exceeded', 'payment_required'],
|
|
140
|
+
500: ['internal_error'],
|
|
141
|
+
502: ['upstream_error'],
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Reusable response-header definitions, registered under `components.headers`
|
|
145
|
+
* (see `App.ts`) and `$ref`-erenced from 200/429 responses. The rate-limit
|
|
146
|
+
* headers reflect the quota the request consumed; they are absent on edge-cache
|
|
147
|
+
* hits (served before metering) and on `402` payment challenges (owned by mppx,
|
|
148
|
+
* which sets `WWW-Authenticate`/`Payment-Receipt` instead).
|
|
149
|
+
*/
|
|
150
|
+
export const headerComponents = {
|
|
151
|
+
RateLimitLimit: {
|
|
152
|
+
description: 'How many requests you may make in the current time window. Not sent on cached responses or `402` payment challenges.', // prettier-ignore
|
|
153
|
+
schema: { type: 'integer' },
|
|
154
|
+
},
|
|
155
|
+
RateLimitRemaining: {
|
|
156
|
+
description: 'How many requests you have left in the current window before you are rate-limited. Not sent on cached responses or `402` payment challenges.', // prettier-ignore
|
|
157
|
+
schema: { type: 'integer' },
|
|
158
|
+
},
|
|
159
|
+
RateLimitReset: {
|
|
160
|
+
description: 'When the current window resets, as a Unix timestamp in seconds. Not sent on cached responses or `402` payment challenges.', // prettier-ignore
|
|
161
|
+
schema: { type: 'integer' },
|
|
162
|
+
},
|
|
163
|
+
RateLimitScope: {
|
|
164
|
+
description: 'Which quota this request counted against (e.g. `data:read`). Not sent on cached responses or `402` payment challenges.', // prettier-ignore
|
|
165
|
+
schema: { type: 'string' },
|
|
166
|
+
},
|
|
167
|
+
RetryAfter: {
|
|
168
|
+
description: 'How many seconds to wait before trying again. Sent with `429` (rate-limited) responses.',
|
|
169
|
+
schema: { type: 'integer' },
|
|
170
|
+
},
|
|
171
|
+
TempoRequestId: {
|
|
172
|
+
description: 'A unique id for this request, returned on every response (and as `requestId` in error bodies). Include it when contacting support so we can find your request.', // prettier-ignore
|
|
173
|
+
schema: { type: 'string' },
|
|
174
|
+
},
|
|
175
|
+
WwwAuthenticate: {
|
|
176
|
+
description: 'On a `402` response, the payment challenge to satisfy. Use it to build the `Authorization: Payment` credential and retry the request.', // prettier-ignore
|
|
177
|
+
schema: { type: 'string' },
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
const headerRef = (name) => ({
|
|
181
|
+
$ref: `#/components/headers/${name}`,
|
|
182
|
+
});
|
|
183
|
+
/** Response headers attached to metered success (2xx) responses. */
|
|
184
|
+
export const successHeaders = {
|
|
185
|
+
'RateLimit-Limit': headerRef('RateLimitLimit'),
|
|
186
|
+
'RateLimit-Remaining': headerRef('RateLimitRemaining'),
|
|
187
|
+
'RateLimit-Reset': headerRef('RateLimitReset'),
|
|
188
|
+
'RateLimit-Scope': headerRef('RateLimitScope'),
|
|
189
|
+
'tempo-request-id': headerRef('TempoRequestId'),
|
|
190
|
+
};
|
|
191
|
+
/** Response headers attached to `429` rate-limit responses. */
|
|
192
|
+
export const rateLimitHeaders = {
|
|
193
|
+
...successHeaders,
|
|
194
|
+
'Retry-After': headerRef('RetryAfter'),
|
|
195
|
+
};
|
|
196
|
+
/** Representative `requestId` used in error-body examples. */
|
|
197
|
+
const exampleRequestId = '0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9';
|
|
198
|
+
/** Builds the `application/json` content for a standard error response: the enumerated-code envelope plus an example body. */
|
|
199
|
+
function errorContent(codes, message) {
|
|
200
|
+
return {
|
|
201
|
+
'application/json': {
|
|
202
|
+
schema: resolver(Schema.errorResponse(codes), schemaOptions),
|
|
203
|
+
example: { error: { code: codes?.[0] ?? 'error', message }, requestId: exampleRequestId },
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* `402` payment-challenge response, injected per operation for MPP-enabled
|
|
209
|
+
* routes during spec generation (see `App.create`). The challenge is
|
|
210
|
+
* protocol-native (owned by mppx) rather than the JSON error envelope, so it
|
|
211
|
+
* declares no JSON body — only the `WWW-Authenticate` header.
|
|
212
|
+
*/
|
|
213
|
+
export const paymentChallenge = {
|
|
214
|
+
description: 'Payment required. This endpoint accepts MPP payment, and the request either exceeded free quota or needs a paid request credential. The challenge is protocol-native (handled by mppx), not the JSON error envelope: read the `WWW-Authenticate` header and retry with `Authorization: Payment <credential>`. A successful paid response carries `Payment-Receipt`.',
|
|
215
|
+
headers: { 'WWW-Authenticate': headerRef('WwwAuthenticate') },
|
|
216
|
+
};
|
|
217
|
+
/** Shared `429` rate-limit response, registered as `components.responses.RateLimited`. */
|
|
218
|
+
const rateLimitedResponse = {
|
|
219
|
+
content: errorContent(errorCodes[429], 'Rate limit exceeded.'),
|
|
220
|
+
description: 'Rate limit exceeded. On endpoints that accept MPP, over-quota unpaid requests return `402 Payment Required` instead.',
|
|
221
|
+
headers: { ...rateLimitHeaders },
|
|
222
|
+
};
|
|
223
|
+
/** Shared `500` internal-error response, registered as `components.responses.InternalError`. */
|
|
224
|
+
const serverErrorResponse = {
|
|
225
|
+
content: errorContent(errorCodes[500], 'Internal server error.'),
|
|
226
|
+
description: 'Internal server error.',
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Reusable responses registered under `components.responses` (see `App.create`)
|
|
230
|
+
* and `$ref`-erenced from operations, so the uniform `402`/`429`/`500` responses
|
|
231
|
+
* are defined once instead of inlined on every operation.
|
|
232
|
+
*/
|
|
233
|
+
export const responseComponents = {
|
|
234
|
+
InternalError: serverErrorResponse,
|
|
235
|
+
PaymentRequired: paymentChallenge,
|
|
236
|
+
RateLimited: rateLimitedResponse,
|
|
237
|
+
};
|
|
238
|
+
const responseRef = (name) => ({
|
|
239
|
+
$ref: `#/components/responses/${name}`,
|
|
240
|
+
});
|
|
241
|
+
/** `$ref` to the shared `402` payment-challenge response. */
|
|
242
|
+
export const paymentChallengeRef = responseRef('PaymentRequired');
|
|
243
|
+
/**
|
|
244
|
+
* Builds a single standard JSON error response with `error.code` enumerated for
|
|
245
|
+
* the status. For routes whose custom `responses` map can't go through
|
|
246
|
+
* {@link responses} — non-JSON success bodies (e.g. image, SSE) or proxy routes
|
|
247
|
+
* with upstream-shaped error bodies. `429`/`500` resolve to the shared
|
|
248
|
+
* `components.responses` entries.
|
|
249
|
+
*/
|
|
250
|
+
export function standardError(status, description, codes) {
|
|
251
|
+
if (status === 429)
|
|
252
|
+
return responseRef('RateLimited');
|
|
253
|
+
if (status === 500)
|
|
254
|
+
return responseRef('InternalError');
|
|
255
|
+
return { content: errorContent(codes ?? errorCodes[status], description), description };
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Builds an OpenAPI `responses` map with the API's standard error responses
|
|
259
|
+
* pre-filled, plus the success response (with rate-limit headers):
|
|
260
|
+
*
|
|
261
|
+
* - `400` invalid request, `401` missing/invalid key, `429` rate limited,
|
|
262
|
+
* `500` internal error, and `502` upstream failure on every operation;
|
|
263
|
+
* - `403`/`404`/`409`/`412`/`413`/`415` only when an `errors` entry is set.
|
|
264
|
+
*
|
|
265
|
+
* `error.code` is enumerated per status from {@link errorCodes}; narrow 400/404
|
|
266
|
+
* to a route's exact codes by passing `{ description, codes }` for that status.
|
|
267
|
+
* `429`/`500` `$ref` the shared {@link responseComponents}. `402` is not emitted
|
|
268
|
+
* here — it is injected per operation from the route's MPP policy during spec
|
|
269
|
+
* generation (see `App.ts`).
|
|
270
|
+
*/
|
|
271
|
+
export function responses(options) {
|
|
272
|
+
const { errors, success } = options;
|
|
273
|
+
const error = (status, fallback) => {
|
|
274
|
+
const override = errors?.[status];
|
|
275
|
+
const description = typeof override === 'string' ? override : (override?.description ?? fallback);
|
|
276
|
+
const codes = (typeof override === 'object' ? override.codes : undefined) ??
|
|
277
|
+
errorCodes[status];
|
|
278
|
+
return { content: errorContent(codes, description), description };
|
|
279
|
+
};
|
|
280
|
+
return {
|
|
281
|
+
200: {
|
|
282
|
+
content: {
|
|
283
|
+
'application/json': {
|
|
284
|
+
schema: resolver(success.schema, schemaOptions),
|
|
285
|
+
...(success.example === undefined ? {} : { example: success.example }),
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
description: success.description,
|
|
289
|
+
headers: { ...successHeaders },
|
|
290
|
+
},
|
|
291
|
+
400: error(400, 'Invalid request.'),
|
|
292
|
+
401: error(401, 'Missing or invalid API key.'),
|
|
293
|
+
...(errors?.[403] && { 403: error(403, 'Forbidden.') }),
|
|
294
|
+
...(errors?.[404] && { 404: error(404, 'Not found.') }),
|
|
295
|
+
...(errors?.[409] && { 409: error(409, 'Conflict.') }),
|
|
296
|
+
...(errors?.[412] && { 412: error(412, 'Precondition failed.') }),
|
|
297
|
+
...(errors?.[413] && { 413: error(413, 'Payload too large.') }),
|
|
298
|
+
...(errors?.[415] && { 415: error(415, 'Unsupported media type.') }),
|
|
299
|
+
429: responseRef('RateLimited'),
|
|
300
|
+
500: responseRef('InternalError'),
|
|
301
|
+
502: error(502, 'Upstream data failure.'),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Always false at runtime, but typed as `boolean` so route handlers can include
|
|
306
|
+
* a never-reached validation-error branch in Hono's inferred response union.
|
|
307
|
+
*/
|
|
308
|
+
export const narrowValidation = false;
|
|
309
|
+
/** Typed validation error response for Hono client inference. Never reached at runtime. */
|
|
310
|
+
export function validationError(c, options) {
|
|
311
|
+
return Response.error(c, { code: options.code, message: options.message, status: 400 });
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Wrapper around `hono-openapi`'s `validator` that returns the API's standard
|
|
315
|
+
* 400 error envelope (with structured validation details) when parsing fails.
|
|
316
|
+
*
|
|
317
|
+
* Use this for every route validator instead of repeating the `result.success`
|
|
318
|
+
* ceremony per route.
|
|
319
|
+
*/
|
|
320
|
+
export function validate(target, schema, options) {
|
|
321
|
+
return validator(target, schema, (result, c) => {
|
|
322
|
+
if (result.success)
|
|
323
|
+
return undefined;
|
|
324
|
+
return Response.error(c, {
|
|
325
|
+
code: options.code,
|
|
326
|
+
details: Response.validationDetails(result.error),
|
|
327
|
+
message: options.message,
|
|
328
|
+
status: 400,
|
|
329
|
+
});
|
|
330
|
+
},
|
|
331
|
+
// Recover `examples` zod strips from pipe/default input schemas, so every
|
|
332
|
+
// generated parameter surfaces the example attached via `z.meta(...)`.
|
|
333
|
+
schemaOptions);
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=OpenApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApi.js","sourceRoot":"","sources":["../../src/internal/OpenApi.ts"],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F,CAAC;AAYD;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAItB,MAAc,EACd,MAAc,EACd,OAAyB;IAEzB,OAAO,SAAS,CACd,MAAM,EACN,MAAM,EACN,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACZ,IAAI,MAAM,CAAC,OAAO;YAAE,OAAO,SAAS,CAAA;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;YACvB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC;YACjD,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE,GAAG;SACZ,CAAC,CAAA;IACJ,CAAC;IACD,0EAA0E;IAC1E,uEAAuE;IACvE,aAAa,CACL,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApi.logo.d.ts","sourceRoot":"","sources":["../../src/internal/OpenApi.logo.ts"],"names":[],"mappings":"AAgBA,2EAA2E;AAC3E,eAAO,MAAM,OAAO;IAAK,IAAI;IAAiB,KAAK;CAAkB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Tempo API wordmark logos for the docs header, theme-aware. `dark` (white
|
|
2
|
+
// text) renders in dark mode, `light` (black text) in light mode. Inlined as
|
|
3
|
+
// SVG data URIs so the standalone reference needs no external asset hosting.
|
|
4
|
+
//
|
|
5
|
+
// THIS FILE IS GENERATED (extracted from the Website 2.0 assets).
|
|
6
|
+
const dark = `<svg width="626" height="181" viewBox="0 0 626 181" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
|
+
<path d="M45.4158 136H18.9697L43.4807 61.1767H12.1324L18.9697 39.2458H106.306L99.4692 61.1767H69.7979L45.4158 136ZM143.83 136H81.1333L112.611 39.2458H175.049L169.115 57.6936H132.865L126.285 78.4635H161.375L155.44 96.6533H120.222L113.643 117.552H149.635L143.83 136ZM172.207 136H151.179L182.786 39.2458H217.875L216.714 91.4931L250.901 39.2458H289.344L257.867 136H231.55L252.449 70.9812H252.062L209.103 136H193.493L194.138 70.2071H193.88L172.207 136ZM318.946 57.1776L308.755 88.3969H311.593C318.043 88.3969 323.418 86.8919 327.718 83.8817C332.019 80.7856 334.814 76.3994 336.104 70.7231C337.222 65.8209 336.62 62.3378 334.298 60.2737C331.976 58.2096 328.105 57.1776 322.687 57.1776H318.946ZM293.403 136H266.957L298.434 39.2458H330.557C337.953 39.2458 344.317 40.4498 349.649 42.8579C355.068 45.18 359.024 48.5342 361.518 52.9204C364.098 57.2206 364.958 62.2518 364.098 68.014C362.98 75.5824 360.056 82.2477 355.326 88.0099C350.595 93.7722 344.446 98.2444 336.878 101.426C329.396 104.523 321.01 106.071 311.722 106.071H303.078L293.403 136ZM427.133 129.808C418.361 134.968 409.03 137.548 399.139 137.548H398.881C390.109 137.548 382.712 135.613 376.692 131.743C370.758 127.787 366.501 122.454 363.921 115.746C361.427 109.038 360.825 101.685 362.115 93.6862C363.749 83.6237 367.49 74.3353 373.338 65.8209C379.186 57.3066 386.497 50.5123 395.269 45.438C404.041 40.3638 413.416 37.8267 423.392 37.8267H423.65C432.767 37.8267 440.292 39.7618 446.226 43.632C452.247 47.5021 456.418 52.7914 458.74 59.4997C461.148 66.1219 461.664 73.5613 460.288 81.8176C458.654 91.5361 454.913 100.695 449.064 109.296C443.216 117.81 435.906 124.648 427.133 129.808ZM390.625 113.166C392.947 117.552 396.989 119.745 402.751 119.745H403.009C407.74 119.745 412.126 117.982 416.168 114.456C420.296 110.844 423.779 106.028 426.617 100.007C429.542 93.9872 431.692 87.2789 433.068 79.8825C434.358 72.6582 433.842 66.853 431.52 62.4668C429.198 57.9946 425.198 55.7585 419.522 55.7585H419.264C414.878 55.7585 410.621 57.5646 406.493 61.1767C402.45 64.7889 398.924 69.6481 395.914 75.7544C392.904 81.8606 390.711 88.4829 389.335 95.6212C387.959 102.846 388.389 108.694 390.625 113.166Z" fill="white"/>
|
|
8
|
+
<rect x="498" y="51" width="128" height="78" fill="#2B2B2B"/>
|
|
9
|
+
<path d="M509.595 111L522.555 68.4H529.515L542.475 111H536.955L526.035 73.08L515.115 111H509.595ZM516.135 98.88L517.935 93.84H534.135L535.935 98.88H516.135ZM549.412 111V68.4H562.372C565.332 68.4 567.912 68.92 570.112 69.96C572.312 71 574.012 72.5 575.212 74.46C576.412 76.38 577.012 78.7 577.012 81.42C577.012 84.14 576.412 86.48 575.212 88.44C574.012 90.36 572.312 91.84 570.112 92.88C567.912 93.92 565.332 94.44 562.372 94.44H554.572V111H549.412ZM554.572 89.4H561.772C565.132 89.4 567.612 88.72 569.212 87.36C570.812 85.96 571.612 83.98 571.612 81.42C571.612 78.82 570.812 76.84 569.212 75.48C567.612 74.12 565.132 73.44 561.772 73.44H554.572V89.4ZM584.788 111V105.96H595.408V73.44H584.788V68.4H611.188V73.44H600.568V105.96H611.188V111H584.788Z" fill="#B2B2B2"/>
|
|
10
|
+
</svg>`;
|
|
11
|
+
const light = `<svg width="626" height="181" viewBox="0 0 626 181" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<path d="M45.4158 136H18.9697L43.4807 61.1767H12.1324L18.9697 39.2458H106.306L99.4692 61.1767H69.7979L45.4158 136ZM143.83 136H81.1333L112.611 39.2458H175.049L169.115 57.6936H132.865L126.285 78.4635H161.375L155.44 96.6533H120.222L113.643 117.552H149.635L143.83 136ZM172.207 136H151.179L182.786 39.2458H217.875L216.714 91.4931L250.901 39.2458H289.344L257.867 136H231.55L252.449 70.9812H252.062L209.103 136H193.493L194.138 70.2071H193.88L172.207 136ZM318.946 57.1776L308.755 88.3969H311.593C318.043 88.3969 323.418 86.8919 327.718 83.8817C332.019 80.7856 334.814 76.3994 336.104 70.7231C337.222 65.8209 336.62 62.3378 334.298 60.2737C331.976 58.2096 328.105 57.1776 322.687 57.1776H318.946ZM293.403 136H266.957L298.434 39.2458H330.557C337.953 39.2458 344.317 40.4498 349.649 42.8579C355.068 45.18 359.024 48.5342 361.518 52.9204C364.098 57.2206 364.958 62.2518 364.098 68.014C362.98 75.5824 360.056 82.2477 355.326 88.0099C350.595 93.7722 344.446 98.2444 336.878 101.426C329.396 104.523 321.01 106.071 311.722 106.071H303.078L293.403 136ZM427.133 129.808C418.361 134.968 409.03 137.548 399.139 137.548H398.881C390.109 137.548 382.712 135.613 376.692 131.743C370.758 127.787 366.501 122.454 363.921 115.746C361.427 109.038 360.825 101.685 362.115 93.6862C363.749 83.6237 367.49 74.3353 373.338 65.8209C379.186 57.3066 386.497 50.5123 395.269 45.438C404.041 40.3638 413.416 37.8267 423.392 37.8267H423.65C432.767 37.8267 440.292 39.7618 446.226 43.632C452.247 47.5021 456.418 52.7914 458.74 59.4997C461.148 66.1219 461.664 73.5613 460.288 81.8176C458.654 91.5361 454.913 100.695 449.064 109.296C443.216 117.81 435.906 124.648 427.133 129.808ZM390.625 113.166C392.947 117.552 396.989 119.745 402.751 119.745H403.009C407.74 119.745 412.126 117.982 416.168 114.456C420.296 110.844 423.779 106.028 426.617 100.007C429.542 93.9872 431.692 87.2789 433.068 79.8825C434.358 72.6582 433.842 66.853 431.52 62.4668C429.198 57.9946 425.198 55.7585 419.522 55.7585H419.264C414.878 55.7585 410.621 57.5646 406.493 61.1767C402.45 64.7889 398.924 69.6481 395.914 75.7544C392.904 81.8606 390.711 88.4829 389.335 95.6212C387.959 102.846 388.389 108.694 390.625 113.166Z" fill="black"/>
|
|
13
|
+
<rect x="498" y="51" width="128" height="78" fill="#EDEDED"/>
|
|
14
|
+
<path d="M509.595 111L522.555 68.4H529.515L542.475 111H536.955L526.035 73.08L515.115 111H509.595ZM516.135 98.88L517.935 93.84H534.135L535.935 98.88H516.135ZM549.412 111V68.4H562.372C565.332 68.4 567.912 68.92 570.112 69.96C572.312 71 574.012 72.5 575.212 74.46C576.412 76.38 577.012 78.7 577.012 81.42C577.012 84.14 576.412 86.48 575.212 88.44C574.012 90.36 572.312 91.84 570.112 92.88C567.912 93.92 565.332 94.44 562.372 94.44H554.572V111H549.412ZM554.572 89.4H561.772C565.132 89.4 567.612 88.72 569.212 87.36C570.812 85.96 571.612 83.98 571.612 81.42C571.612 78.82 570.812 76.84 569.212 75.48C567.612 74.12 565.132 73.44 561.772 73.44H554.572V89.4ZM584.788 111V105.96H595.408V73.44H584.788V68.4H611.188V73.44H600.568V105.96H611.188V111H584.788Z" fill="#707070"/>
|
|
15
|
+
</svg>`;
|
|
16
|
+
const dataUri = (svg) => `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
17
|
+
/** Theme-aware Tempo API wordmark for the docs header (`vocs.logoUrl`). */
|
|
18
|
+
export const logoUrl = { dark: dataUri(dark), light: dataUri(light) };
|
|
19
|
+
//# sourceMappingURL=OpenApi.logo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApi.logo.js","sourceRoot":"","sources":["../../src/internal/OpenApi.logo.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,EAAE;AACF,kEAAkE;AAClE,MAAM,IAAI,GAAG;;;;OAIN,CAAA;AACP,MAAM,KAAK,GAAG;;;;OAIP,CAAA;AACP,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,sBAAsB,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAA;AAChF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Normalizes a route prefix to a leading slash with no trailing slash. */
|
|
2
|
+
export declare function normalize(path: string): string;
|
|
3
|
+
/** Joins URL path segments into one normalized absolute path. */
|
|
4
|
+
export declare function join(...segments: string[]): string;
|
|
5
|
+
//# sourceMappingURL=Path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/internal/Path.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,UAIrC;AAED,iEAAiE;AACjE,wBAAgB,IAAI,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,UAMzC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Normalizes a route prefix to a leading slash with no trailing slash. */
|
|
2
|
+
export function normalize(path) {
|
|
3
|
+
const normalized = path.startsWith('/') ? path : `/${path}`;
|
|
4
|
+
if (normalized.length > 1 && normalized.endsWith('/'))
|
|
5
|
+
return normalized.slice(0, -1);
|
|
6
|
+
return normalized;
|
|
7
|
+
}
|
|
8
|
+
/** Joins URL path segments into one normalized absolute path. */
|
|
9
|
+
export function join(...segments) {
|
|
10
|
+
const path = segments
|
|
11
|
+
.flatMap((segment) => segment.split('/'))
|
|
12
|
+
.filter(Boolean)
|
|
13
|
+
.join('/');
|
|
14
|
+
return path ? `/${path}` : '/';
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../src/internal/Path.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAA;IAC3D,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACrF,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,IAAI,CAAC,GAAG,QAAkB;IACxC,MAAM,IAAI,GAAG,QAAQ;SAClB,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACxC,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;AAChC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import * as Store from './Store.js';
|
|
3
|
+
/** Zod schemas owned by the rate-limit module. */
|
|
4
|
+
export declare namespace schema {
|
|
5
|
+
/** A rate-limit policy; the source of truth for {@link Limit}. */
|
|
6
|
+
const Limit: z.ZodMiniObject<{
|
|
7
|
+
perMinute: z.ZodMiniNumber<number>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
}
|
|
10
|
+
/** Rate-limit policy. */
|
|
11
|
+
export type Limit = z.output<typeof schema.Limit>;
|
|
12
|
+
/** Result returned by a rate-limit store. */
|
|
13
|
+
export type Result = {
|
|
14
|
+
/** Whether the request is within quota. */
|
|
15
|
+
allowed: boolean;
|
|
16
|
+
/** Limit applied to the request. */
|
|
17
|
+
limit: number;
|
|
18
|
+
/** Requests remaining in the active window. */
|
|
19
|
+
remaining: number;
|
|
20
|
+
/** Reset timestamp in Unix seconds. */
|
|
21
|
+
reset: number;
|
|
22
|
+
};
|
|
23
|
+
/** Rate-limit store. */
|
|
24
|
+
export type RateLimitStore = {
|
|
25
|
+
/** Consumes one request from the active quota window. */
|
|
26
|
+
consume(options: RateLimitStore.ConsumeOptions): Promise<Result>;
|
|
27
|
+
};
|
|
28
|
+
export declare namespace RateLimitStore {
|
|
29
|
+
/** Options for consuming one request from a rate-limit store. */
|
|
30
|
+
type ConsumeOptions = {
|
|
31
|
+
/** Quota key. */
|
|
32
|
+
key: string;
|
|
33
|
+
/** Rate-limit policy. */
|
|
34
|
+
limit: Limit;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a fixed-window rate-limit store over a counter {@link Store.Store}.
|
|
39
|
+
*
|
|
40
|
+
* Each consume is a single `Store.increment`, so a backend with a native
|
|
41
|
+
* counter (e.g. a Durable Object) is one atomic round trip; backends without
|
|
42
|
+
* one fall back to get + put, acceptable for dev/in-process stores only.
|
|
43
|
+
* The storage key is stable per quota key — the
|
|
44
|
+
* window lives in the TTL: the counter expires exactly at the end of the
|
|
45
|
+
* current minute, so the next window's first hit restarts at 1 and idle keys
|
|
46
|
+
* hold no storage. The sub-minute TTL rules out Cloudflare KV as a backend,
|
|
47
|
+
* which is unsuitable for enforced counters anyway.
|
|
48
|
+
*/
|
|
49
|
+
export declare function memory(options?: memory.Options): RateLimitStore;
|
|
50
|
+
export declare namespace memory {
|
|
51
|
+
/** Options for creating an in-memory fixed-window rate-limit store. */
|
|
52
|
+
type Options = {
|
|
53
|
+
/** Store used to persist counters. */
|
|
54
|
+
store?: Store.Store | undefined;
|
|
55
|
+
/** Clock used to calculate fixed windows. */
|
|
56
|
+
now?: (() => Date) | undefined;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export { type RateLimitStore as Store };
|
|
60
|
+
//# sourceMappingURL=RateLimit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimit.d.ts","sourceRoot":"","sources":["../../src/internal/RateLimit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,kDAAkD;AAClD,yBAAiB,MAAM,CAAC;IACtB,kEAAkE;IAC3D,MAAM,KAAK;;qBAIhB,CAAA;CACH;AAED,yBAAyB;AACzB,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;AAEjD,6CAA6C;AAC7C,MAAM,MAAM,MAAM,GAAG;IACnB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAA;IAChB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAwB;AACxB,MAAM,MAAM,cAAc,GAAG;IAC3B,yDAAyD;IACzD,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CACjE,CAAA;AAED,yBAAiB,cAAc,CAAC;IAC9B,iEAAiE;IACjE,KAAY,cAAc,GAAG;QAC3B,iBAAiB;QACjB,GAAG,EAAE,MAAM,CAAA;QACX,yBAAyB;QACzB,KAAK,EAAE,KAAK,CAAA;KACb,CAAA;CACF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,OAAO,GAAE,MAAM,CAAC,OAAY,GAAG,cAAc,CAuBnE;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,uEAAuE;IACvE,KAAK,OAAO,GAAG;QACb,sCAAsC;QACtC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,SAAS,CAAA;QAC/B,6CAA6C;QAC7C,GAAG,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;KAC/B,CAAA;CACF;AAED,OAAO,EAAE,KAAK,cAAc,IAAI,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import * as Store from './Store.js';
|
|
3
|
+
/** Zod schemas owned by the rate-limit module. */
|
|
4
|
+
export var schema;
|
|
5
|
+
(function (schema) {
|
|
6
|
+
/** A rate-limit policy; the source of truth for {@link Limit}. */
|
|
7
|
+
schema.Limit = z.object({
|
|
8
|
+
perMinute: z
|
|
9
|
+
.number()
|
|
10
|
+
.check(z.int(), z.nonnegative(), z.describe('Number of requests allowed per minute.')),
|
|
11
|
+
});
|
|
12
|
+
})(schema || (schema = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Creates a fixed-window rate-limit store over a counter {@link Store.Store}.
|
|
15
|
+
*
|
|
16
|
+
* Each consume is a single `Store.increment`, so a backend with a native
|
|
17
|
+
* counter (e.g. a Durable Object) is one atomic round trip; backends without
|
|
18
|
+
* one fall back to get + put, acceptable for dev/in-process stores only.
|
|
19
|
+
* The storage key is stable per quota key — the
|
|
20
|
+
* window lives in the TTL: the counter expires exactly at the end of the
|
|
21
|
+
* current minute, so the next window's first hit restarts at 1 and idle keys
|
|
22
|
+
* hold no storage. The sub-minute TTL rules out Cloudflare KV as a backend,
|
|
23
|
+
* which is unsuitable for enforced counters anyway.
|
|
24
|
+
*/
|
|
25
|
+
export function memory(options = {}) {
|
|
26
|
+
const store = options.store ?? Store.memory();
|
|
27
|
+
const now = options.now ?? (() => new Date());
|
|
28
|
+
return {
|
|
29
|
+
async consume(options) {
|
|
30
|
+
const time = now().getTime();
|
|
31
|
+
const bucket = Math.floor(time / 60_000);
|
|
32
|
+
// Every increment within a window recomputes the TTL against the same
|
|
33
|
+
// window end, so the counter's absolute expiry never moves under load.
|
|
34
|
+
const count = await Store.increment(store, `ratelimit:${options.key}`, {
|
|
35
|
+
ttl: (bucket + 1) * 60_000 - time,
|
|
36
|
+
});
|
|
37
|
+
const limit = options.limit.perMinute;
|
|
38
|
+
return {
|
|
39
|
+
allowed: count <= limit,
|
|
40
|
+
limit,
|
|
41
|
+
remaining: Math.max(limit - count, 0),
|
|
42
|
+
reset: Math.ceil(((bucket + 1) * 60_000) / 1_000),
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=RateLimit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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