tapimo 0.0.2 → 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.
- package/README.md +38 -16
- package/dist/ApiKey.d.ts +14 -11
- package/dist/ApiKey.d.ts.map +1 -1
- package/dist/ApiKey.js +11 -12
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +207 -0
- package/dist/ApiKeys.d.ts.map +1 -0
- package/dist/ApiKeys.js +282 -0
- package/dist/ApiKeys.js.map +1 -0
- package/dist/App.d.ts +6771 -3819
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +145 -317
- package/dist/App.js.map +1 -1
- package/dist/Handler.d.ts +86 -0
- package/dist/Handler.d.ts.map +1 -0
- package/dist/Handler.js +83 -0
- package/dist/Handler.js.map +1 -0
- package/dist/Scope.d.ts +14 -4
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +16 -4
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.d.ts +5 -7
- package/dist/Webhooks.d.ts.map +1 -1
- package/dist/Webhooks.js +11 -4
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/Access.d.ts +1 -3
- package/dist/admin/Access.d.ts.map +1 -1
- package/dist/admin/Access.js +1 -3
- package/dist/admin/Access.js.map +1 -1
- package/dist/admin/App.d.ts +167 -205
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/App.js +2 -4
- package/dist/admin/App.js.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +105 -5
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +75 -9
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/scopes.d.ts +6 -0
- package/dist/admin/apps/scopes.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +35 -149
- package/dist/admin/apps/verified-tokens.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.js +18 -39
- package/dist/admin/apps/verified-tokens.js.map +1 -1
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.js +1 -1
- package/dist/apps/data/App.d.ts +19176 -0
- package/dist/apps/data/App.d.ts.map +1 -0
- package/dist/apps/data/App.js +236 -0
- package/dist/apps/data/App.js.map +1 -0
- package/dist/apps/data/index.d.ts +3 -0
- package/dist/apps/data/index.d.ts.map +1 -0
- package/dist/apps/data/index.js +3 -0
- package/dist/apps/data/index.js.map +1 -0
- package/dist/apps/{activities.d.ts → data/routes/activities.d.ts} +32 -32
- package/dist/apps/{activities.d.ts.map → data/routes/activities.d.ts.map} +1 -1
- package/dist/apps/{activities.js → data/routes/activities.js} +13 -13
- package/dist/apps/data/routes/activities.js.map +1 -0
- package/dist/apps/{addresses.d.ts → data/routes/addresses.d.ts} +22 -22
- package/dist/apps/{addresses.d.ts.map → data/routes/addresses.d.ts.map} +1 -1
- package/dist/apps/{addresses.js → data/routes/addresses.js} +5 -5
- package/dist/apps/data/routes/addresses.js.map +1 -0
- package/dist/apps/{balances.d.ts → data/routes/balances.d.ts} +49 -49
- package/dist/apps/data/routes/balances.d.ts.map +1 -0
- package/dist/apps/{balances.js → data/routes/balances.js} +42 -11
- package/dist/apps/data/routes/balances.js.map +1 -0
- package/dist/apps/{blocks.d.ts → data/routes/blocks.d.ts} +47 -47
- package/dist/apps/data/routes/blocks.d.ts.map +1 -0
- package/dist/apps/{blocks.js → data/routes/blocks.js} +13 -13
- package/dist/apps/data/routes/blocks.js.map +1 -0
- package/dist/apps/{coingecko.d.ts → data/routes/coingecko.d.ts} +183 -183
- package/dist/apps/data/routes/coingecko.d.ts.map +1 -0
- package/dist/apps/{coingecko.js → data/routes/coingecko.js} +13 -13
- package/dist/apps/data/routes/coingecko.js.map +1 -0
- package/dist/apps/{exchanges.d.ts → data/routes/exchanges.d.ts} +460 -460
- package/dist/apps/data/routes/exchanges.d.ts.map +1 -0
- package/dist/apps/{exchanges.js → data/routes/exchanges.js} +19 -19
- package/dist/apps/data/routes/exchanges.js.map +1 -0
- package/dist/apps/{fee-amm.d.ts → data/routes/fee-amm.d.ts} +94 -94
- package/dist/apps/data/routes/fee-amm.d.ts.map +1 -0
- package/dist/apps/{fee-amm.js → data/routes/fee-amm.js} +17 -17
- package/dist/apps/data/routes/fee-amm.js.map +1 -0
- package/dist/apps/{indexer.d.ts → data/routes/indexer.d.ts} +4 -4
- package/dist/apps/data/routes/indexer.d.ts.map +1 -0
- package/dist/apps/{indexer.js → data/routes/indexer.js} +13 -9
- package/dist/apps/data/routes/indexer.js.map +1 -0
- package/dist/apps/{receipts.d.ts → data/routes/receipts.d.ts} +6 -6
- package/dist/apps/data/routes/receipts.d.ts.map +1 -0
- package/dist/apps/{receipts.js → data/routes/receipts.js} +12 -12
- package/dist/apps/data/routes/receipts.js.map +1 -0
- package/dist/apps/{rpc.d.ts → data/routes/rpc.d.ts} +4 -4
- package/dist/apps/data/routes/rpc.d.ts.map +1 -0
- package/dist/apps/{rpc.js → data/routes/rpc.js} +6 -6
- package/dist/apps/data/routes/rpc.js.map +1 -0
- package/dist/apps/{tokenlist.d.ts → data/routes/tokenlist.d.ts} +4 -4
- package/dist/apps/data/routes/tokenlist.d.ts.map +1 -0
- package/dist/apps/{tokenlist.js → data/routes/tokenlist.js} +8 -8
- package/dist/apps/data/routes/tokenlist.js.map +1 -0
- package/dist/apps/{tokens.d.ts → data/routes/tokens.d.ts} +11 -11
- package/dist/apps/data/routes/tokens.d.ts.map +1 -0
- package/dist/apps/{tokens.js → data/routes/tokens.js} +19 -19
- package/dist/apps/data/routes/tokens.js.map +1 -0
- package/dist/apps/{transactions.d.ts → data/routes/transactions.d.ts} +288 -288
- package/dist/apps/data/routes/transactions.d.ts.map +1 -0
- package/dist/apps/{transactions.js → data/routes/transactions.js} +13 -13
- package/dist/apps/data/routes/transactions.js.map +1 -0
- package/dist/apps/{transfers.d.ts → data/routes/transfers.d.ts} +35 -35
- package/dist/apps/data/routes/transfers.d.ts.map +1 -0
- package/dist/apps/{transfers.js → data/routes/transfers.js} +13 -13
- package/dist/apps/data/routes/transfers.js.map +1 -0
- package/dist/apps/{verified-tokens.d.ts → data/routes/verified-tokens.d.ts} +42 -42
- package/dist/apps/data/routes/verified-tokens.d.ts.map +1 -0
- package/dist/apps/{verified-tokens.js → data/routes/verified-tokens.js} +9 -9
- package/dist/apps/data/routes/verified-tokens.js.map +1 -0
- package/dist/apps/{webhooks.d.ts → data/routes/webhooks.d.ts} +66 -63
- package/dist/apps/{webhooks.d.ts.map → data/routes/webhooks.d.ts.map} +1 -1
- package/dist/apps/{webhooks.js → data/routes/webhooks.js} +67 -59
- package/dist/apps/data/routes/webhooks.js.map +1 -0
- package/dist/apps/docs/App.d.ts +27 -0
- package/dist/apps/docs/App.d.ts.map +1 -0
- package/dist/apps/docs/App.js +122 -0
- package/dist/apps/docs/App.js.map +1 -0
- package/dist/{internal/OpenApi.fonts.d.ts → apps/docs/fonts.d.ts} +1 -1
- package/dist/apps/docs/fonts.d.ts.map +1 -0
- package/dist/{internal/OpenApi.fonts.js → apps/docs/fonts.js} +1 -1
- package/dist/apps/docs/fonts.js.map +1 -0
- package/dist/apps/docs/index.d.ts +2 -0
- package/dist/apps/docs/index.d.ts.map +1 -0
- package/dist/apps/docs/index.js +2 -0
- package/dist/apps/docs/index.js.map +1 -0
- package/dist/{internal/OpenApi.logo.d.ts → apps/docs/logo.d.ts} +1 -1
- package/dist/apps/docs/logo.d.ts.map +1 -0
- package/dist/{internal/OpenApi.logo.js → apps/docs/logo.js} +1 -1
- package/dist/apps/docs/logo.js.map +1 -0
- package/dist/apps/index.d.ts +4 -0
- package/dist/apps/index.d.ts.map +1 -0
- package/dist/apps/index.js +4 -0
- package/dist/apps/index.js.map +1 -0
- package/dist/apps/metadata.d.ts +7 -0
- package/dist/apps/metadata.d.ts.map +1 -0
- package/dist/apps/metadata.js +15 -0
- package/dist/apps/metadata.js.map +1 -0
- package/dist/apps/platform/App.d.ts +2985 -0
- package/dist/apps/platform/App.d.ts.map +1 -0
- package/dist/apps/platform/App.js +74 -0
- package/dist/apps/platform/App.js.map +1 -0
- package/dist/apps/platform/index.d.ts +2 -0
- package/dist/apps/platform/index.d.ts.map +1 -0
- package/dist/apps/platform/index.js +2 -0
- package/dist/apps/platform/index.js.map +1 -0
- package/dist/apps/platform/routes/api-keys.d.ts +681 -0
- package/dist/apps/platform/routes/api-keys.d.ts.map +1 -0
- package/dist/apps/platform/routes/api-keys.js +328 -0
- package/dist/apps/platform/routes/api-keys.js.map +1 -0
- package/dist/apps/platform/routes/invitations.d.ts +733 -0
- package/dist/apps/platform/routes/invitations.d.ts.map +1 -0
- package/dist/apps/platform/routes/invitations.js +413 -0
- package/dist/apps/platform/routes/invitations.js.map +1 -0
- package/dist/apps/platform/routes/me.d.ts +95 -0
- package/dist/apps/platform/routes/me.d.ts.map +1 -0
- package/dist/apps/platform/routes/me.js +81 -0
- package/dist/apps/platform/routes/me.js.map +1 -0
- package/dist/apps/platform/routes/members.d.ts +554 -0
- package/dist/apps/platform/routes/members.d.ts.map +1 -0
- package/dist/apps/platform/routes/members.js +251 -0
- package/dist/apps/platform/routes/members.js.map +1 -0
- package/dist/apps/platform/routes/orgs.d.ts +582 -0
- package/dist/apps/platform/routes/orgs.d.ts.map +1 -0
- package/dist/apps/platform/routes/orgs.js +265 -0
- package/dist/apps/platform/routes/orgs.js.map +1 -0
- package/dist/apps/platform/routes/projects.d.ts +740 -0
- package/dist/apps/platform/routes/projects.d.ts.map +1 -0
- package/dist/apps/platform/routes/projects.js +286 -0
- package/dist/apps/platform/routes/projects.js.map +1 -0
- package/dist/apps/relay/App.d.ts +41 -0
- package/dist/apps/relay/App.d.ts.map +1 -0
- package/dist/apps/relay/App.js +103 -0
- package/dist/apps/relay/App.js.map +1 -0
- package/dist/apps/relay/Sponsorships.d.ts +107 -0
- package/dist/apps/relay/Sponsorships.d.ts.map +1 -0
- package/dist/apps/relay/Sponsorships.js +193 -0
- package/dist/apps/relay/Sponsorships.js.map +1 -0
- package/dist/apps/relay/index.d.ts +3 -0
- package/dist/apps/relay/index.d.ts.map +1 -0
- package/dist/apps/relay/index.js +3 -0
- package/dist/apps/relay/index.js.map +1 -0
- package/dist/{Cli.d.ts → cli/Cli.d.ts} +13 -2
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +19 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +4 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin.d.ts +15 -0
- package/dist/cli/commands/admin.d.ts.map +1 -0
- package/dist/cli/commands/admin.js +60 -0
- package/dist/cli/commands/admin.js.map +1 -0
- package/dist/cloudflare.d.ts +7 -0
- package/dist/cloudflare.d.ts.map +1 -1
- package/dist/cloudflare.js +9 -0
- package/dist/cloudflare.js.map +1 -1
- package/dist/db/Db.d.ts +113 -0
- package/dist/db/Db.d.ts.map +1 -0
- package/dist/db/Db.js +402 -0
- package/dist/db/Db.js.map +1 -0
- package/dist/db/Schema.d.ts +168 -0
- package/dist/db/Schema.d.ts.map +1 -0
- package/dist/db/Schema.js +229 -0
- package/dist/db/Schema.js.map +1 -0
- package/dist/db/tables/invitations.d.ts +84 -0
- package/dist/db/tables/invitations.d.ts.map +1 -0
- package/dist/db/tables/invitations.js +165 -0
- package/dist/db/tables/invitations.js.map +1 -0
- package/dist/db/tables/memberships.d.ts +108 -0
- package/dist/db/tables/memberships.d.ts.map +1 -0
- package/dist/db/tables/memberships.js +153 -0
- package/dist/db/tables/memberships.js.map +1 -0
- package/dist/db/tables/organizations.d.ts +123 -0
- package/dist/db/tables/organizations.d.ts.map +1 -0
- package/dist/db/tables/organizations.js +170 -0
- package/dist/db/tables/organizations.js.map +1 -0
- package/dist/db/tables/projects.d.ts +65 -0
- package/dist/db/tables/projects.d.ts.map +1 -0
- package/dist/db/tables/projects.js +75 -0
- package/dist/db/tables/projects.js.map +1 -0
- package/dist/db/tables/sponsoredTransactions.d.ts +120 -0
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -0
- package/dist/db/tables/sponsoredTransactions.js +161 -0
- package/dist/db/tables/sponsoredTransactions.js.map +1 -0
- package/dist/db/tables/users.d.ts +48 -0
- package/dist/db/tables/users.d.ts.map +1 -0
- package/dist/db/tables/users.js +65 -0
- package/dist/db/tables/users.js.map +1 -0
- package/dist/db/tables/verifiedTokens.d.ts +53 -0
- package/dist/db/tables/verifiedTokens.d.ts.map +1 -0
- package/dist/db/tables/verifiedTokens.js +74 -0
- package/dist/db/tables/verifiedTokens.js.map +1 -0
- package/dist/db/tables/webhookDeliveries.d.ts +71 -0
- package/dist/db/tables/webhookDeliveries.d.ts.map +1 -0
- package/dist/db/tables/webhookDeliveries.js +119 -0
- package/dist/db/tables/webhookDeliveries.js.map +1 -0
- package/dist/db/tables/webhookSubscriptions.d.ts +158 -0
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -0
- package/dist/db/tables/webhookSubscriptions.js +272 -0
- package/dist/db/tables/webhookSubscriptions.js.map +1 -0
- package/dist/handlers/internal/executionError.d.ts +25 -0
- package/dist/handlers/internal/executionError.d.ts.map +1 -0
- package/dist/handlers/internal/executionError.js +186 -0
- package/dist/handlers/internal/executionError.js.map +1 -0
- package/dist/handlers/internal/multisig.d.ts +233 -0
- package/dist/handlers/internal/multisig.d.ts.map +1 -0
- package/dist/handlers/internal/multisig.js +542 -0
- package/dist/handlers/internal/multisig.js.map +1 -0
- package/dist/handlers/internal/requestListener.d.ts +124 -0
- package/dist/handlers/internal/requestListener.d.ts.map +1 -0
- package/dist/handlers/internal/requestListener.js +173 -0
- package/dist/handlers/internal/requestListener.js.map +1 -0
- package/dist/handlers/internal/sponsorship.d.ts +113 -0
- package/dist/handlers/internal/sponsorship.d.ts.map +1 -0
- package/dist/handlers/internal/sponsorship.js +128 -0
- package/dist/handlers/internal/sponsorship.js.map +1 -0
- package/dist/handlers/internal/types.d.ts +284 -0
- package/dist/handlers/internal/types.d.ts.map +1 -0
- package/dist/handlers/internal/types.js +2 -0
- package/dist/handlers/internal/types.js.map +1 -0
- package/dist/handlers/internal/utils.d.ts +34 -0
- package/dist/handlers/internal/utils.d.ts.map +1 -0
- package/dist/handlers/internal/utils.js +131 -0
- package/dist/handlers/internal/utils.js.map +1 -0
- package/dist/handlers/relay.d.ts +123 -0
- package/dist/handlers/relay.d.ts.map +1 -0
- package/dist/handlers/relay.js +1278 -0
- package/dist/handlers/relay.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/Auth.d.ts +224 -16
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +572 -33
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/Log.d.ts +7 -3
- package/dist/internal/Log.d.ts.map +1 -1
- package/dist/internal/Log.js +4 -0
- package/dist/internal/Log.js.map +1 -1
- package/dist/internal/OpenApi.d.ts +0 -19
- package/dist/internal/OpenApi.d.ts.map +1 -1
- package/dist/internal/OpenApi.js +0 -57
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/RpcSchema.d.ts +10 -0
- package/dist/internal/RpcSchema.d.ts.map +1 -0
- package/dist/internal/RpcSchema.js +2 -0
- package/dist/internal/RpcSchema.js.map +1 -0
- package/dist/internal/Store.d.ts +49 -4
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +81 -5
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/VerifiedTokens.d.ts +15 -34
- package/dist/internal/VerifiedTokens.d.ts.map +1 -1
- package/dist/internal/VerifiedTokens.js +115 -159
- package/dist/internal/VerifiedTokens.js.map +1 -1
- package/dist/internal/Viem.d.ts +84 -0
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Webhooks.d.ts +50 -36
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +92 -205
- package/dist/internal/Webhooks.js.map +1 -1
- package/package.json +37 -6
- package/src/ApiKey.test.ts +3 -3
- package/src/ApiKey.ts +11 -12
- package/src/ApiKeys.test.ts +278 -0
- package/src/ApiKeys.ts +358 -0
- package/src/App.test-d.ts +1 -1
- package/src/App.test.ts +40508 -19083
- package/src/App.ts +239 -416
- package/src/Client.test-d.ts +307 -16
- package/src/Handler.ts +154 -0
- package/src/Scope.ts +17 -4
- package/src/Webhooks.test.ts +8 -7
- package/src/Webhooks.ts +13 -7
- package/src/admin/Access.ts +1 -3
- package/src/admin/App.ts +19 -24
- package/src/admin/apps/api-keys.test.ts +70 -18
- package/src/admin/apps/api-keys.ts +92 -9
- package/src/admin/apps/scopes.test.ts +8 -0
- package/src/admin/apps/verified-tokens.test.ts +3 -30
- package/src/admin/apps/verified-tokens.ts +18 -37
- package/src/admin/ui.generated.ts +1 -1
- package/src/apps/composition.test.ts +66 -0
- package/src/apps/data/App.ts +295 -0
- package/src/apps/data/index.ts +2 -0
- package/src/apps/{activities.test.ts → data/routes/activities.test.ts} +3 -3
- package/src/apps/{activities.ts → data/routes/activities.ts} +15 -15
- package/src/apps/{addresses.ts → data/routes/addresses.ts} +6 -6
- package/src/apps/{balances.test.ts → data/routes/balances.test.ts} +6 -5
- package/src/apps/{balances.ts → data/routes/balances.ts} +46 -12
- package/src/apps/{blocks.test.ts → data/routes/blocks.test.ts} +4 -4
- package/src/apps/{blocks.ts → data/routes/blocks.ts} +14 -14
- package/src/apps/{coingecko.test.ts → data/routes/coingecko.test.ts} +2 -2
- package/src/apps/{coingecko.ts → data/routes/coingecko.ts} +14 -14
- package/src/apps/{exchanges.test.ts → data/routes/exchanges.test.ts} +2 -2
- package/src/apps/{exchanges.ts → data/routes/exchanges.ts} +20 -20
- package/src/apps/{fee-amm.test.ts → data/routes/fee-amm.test.ts} +3 -3
- package/src/apps/{fee-amm.ts → data/routes/fee-amm.ts} +18 -18
- package/src/apps/{indexer.test.ts → data/routes/indexer.test.ts} +27 -6
- package/src/apps/{indexer.ts → data/routes/indexer.ts} +13 -10
- package/src/apps/{receipts.test.ts → data/routes/receipts.test.ts} +4 -4
- package/src/apps/{receipts.ts → data/routes/receipts.ts} +13 -13
- package/src/apps/{rpc.test.ts → data/routes/rpc.test.ts} +142 -13
- package/src/apps/{rpc.ts → data/routes/rpc.ts} +7 -7
- package/src/apps/{tokenlist.test.ts → data/routes/tokenlist.test.ts} +8 -10
- package/src/apps/{tokenlist.ts → data/routes/tokenlist.ts} +9 -9
- package/src/apps/{tokens.test.ts → data/routes/tokens.test.ts} +6 -5
- package/src/apps/{tokens.ts → data/routes/tokens.ts} +20 -20
- package/src/apps/{transactions.test.ts → data/routes/transactions.test.ts} +4 -4
- package/src/apps/{transactions.ts → data/routes/transactions.ts} +15 -15
- package/src/apps/{transfers.test.ts → data/routes/transfers.test.ts} +3 -3
- package/src/apps/{transfers.ts → data/routes/transfers.ts} +15 -15
- package/src/apps/{verified-tokens.test.ts → data/routes/verified-tokens.test.ts} +27 -15
- package/src/apps/{verified-tokens.ts → data/routes/verified-tokens.ts} +10 -10
- package/src/apps/{webhooks.test.ts → data/routes/webhooks.test.ts} +137 -150
- package/src/apps/{webhooks.ts → data/routes/webhooks.ts} +83 -81
- package/src/apps/docs/App.ts +136 -0
- package/src/apps/docs/index.ts +1 -0
- package/src/apps/index.ts +3 -0
- package/src/apps/metadata.ts +23 -0
- package/src/apps/platform/App.ts +130 -0
- package/src/apps/platform/index.ts +1 -0
- package/src/apps/platform/routes/api-keys.test.ts +330 -0
- package/src/apps/platform/routes/api-keys.ts +427 -0
- package/src/apps/platform/routes/invitations.test.ts +361 -0
- package/src/apps/platform/routes/invitations.ts +519 -0
- package/src/apps/platform/routes/me.test.ts +121 -0
- package/src/apps/platform/routes/me.ts +106 -0
- package/src/apps/platform/routes/members.test.ts +195 -0
- package/src/apps/platform/routes/members.ts +313 -0
- package/src/apps/platform/routes/orgs.test.ts +313 -0
- package/src/apps/platform/routes/orgs.ts +343 -0
- package/src/apps/platform/routes/projects.test.ts +181 -0
- package/src/apps/platform/routes/projects.ts +367 -0
- package/src/apps/relay/App.test.ts +484 -0
- package/src/apps/relay/App.ts +128 -0
- package/src/apps/relay/Sponsorships.test.ts +375 -0
- package/src/apps/relay/Sponsorships.ts +305 -0
- package/src/apps/relay/index.ts +2 -0
- package/src/{Cli.test.ts → cli/Cli.test.ts} +10 -9
- package/src/{Cli.ts → cli/Cli.ts} +16 -9
- package/src/cli/bin.ts +4 -0
- package/src/cli/commands/admin.test.ts +71 -0
- package/src/cli/commands/admin.ts +60 -0
- package/src/cloudflare.ts +10 -0
- package/src/db/Db.test.ts +84 -0
- package/src/db/Db.ts +542 -0
- package/src/db/Schema.ts +301 -0
- package/src/db/tables/invitations.ts +198 -0
- package/src/db/tables/memberships.ts +208 -0
- package/src/db/tables/organizations.test.ts +160 -0
- package/src/db/tables/organizations.ts +232 -0
- package/src/db/tables/projects.ts +107 -0
- package/src/db/tables/sponsoredTransactions.test.ts +218 -0
- package/src/db/tables/sponsoredTransactions.ts +236 -0
- package/src/db/tables/users.ts +85 -0
- package/src/db/tables/verifiedTokens.ts +111 -0
- package/src/db/tables/webhookDeliveries.ts +159 -0
- package/src/db/tables/webhookSubscriptions.ts +358 -0
- package/src/handlers/internal/executionError.ts +207 -0
- package/src/handlers/internal/multisig.test.ts +818 -0
- package/src/handlers/internal/multisig.ts +823 -0
- package/src/handlers/internal/requestListener.ts +273 -0
- package/src/handlers/internal/sponsorship.ts +245 -0
- package/src/handlers/internal/types.ts +378 -0
- package/src/handlers/internal/utils.ts +153 -0
- package/src/handlers/relay.test.ts +2035 -0
- package/src/handlers/relay.ts +1623 -0
- package/src/index.ts +4 -2
- package/src/internal/Auth.test.ts +337 -21
- package/src/internal/Auth.ts +783 -44
- package/src/internal/Cursor.test.ts +3 -2
- package/src/internal/Log.test.ts +1 -1
- package/src/internal/Log.ts +11 -3
- package/src/internal/MetricSink.ts +1 -1
- package/src/internal/OpenApi.ts +0 -59
- package/src/internal/RateLimit.test.ts +1 -1
- package/src/internal/RpcSchema.ts +10 -0
- package/src/internal/Store.test.ts +150 -10
- package/src/internal/Store.ts +136 -11
- package/src/internal/Tidx.local.test.ts +1 -1
- package/src/internal/VerifiedTokens.test.ts +99 -115
- package/src/internal/VerifiedTokens.ts +123 -175
- package/src/internal/WebhookDestination.test.ts +1 -1
- package/src/internal/Webhooks.test.ts +111 -111
- package/src/internal/Webhooks.ts +103 -221
- package/dist/ApiKeySource.d.ts +0 -166
- package/dist/ApiKeySource.d.ts.map +0 -1
- package/dist/ApiKeySource.js +0 -234
- package/dist/ApiKeySource.js.map +0 -1
- package/dist/Cli.d.ts.map +0 -1
- package/dist/Cli.js +0 -13
- package/dist/Cli.js.map +0 -1
- package/dist/apps/activities.js.map +0 -1
- package/dist/apps/addresses.js.map +0 -1
- package/dist/apps/balances.d.ts.map +0 -1
- package/dist/apps/balances.js.map +0 -1
- package/dist/apps/blocks.d.ts.map +0 -1
- package/dist/apps/blocks.js.map +0 -1
- package/dist/apps/coingecko.d.ts.map +0 -1
- package/dist/apps/coingecko.js.map +0 -1
- package/dist/apps/exchanges.d.ts.map +0 -1
- package/dist/apps/exchanges.js.map +0 -1
- package/dist/apps/fee-amm.d.ts.map +0 -1
- package/dist/apps/fee-amm.js.map +0 -1
- package/dist/apps/indexer.d.ts.map +0 -1
- package/dist/apps/indexer.js.map +0 -1
- package/dist/apps/receipts.d.ts.map +0 -1
- package/dist/apps/receipts.js.map +0 -1
- package/dist/apps/rpc.d.ts.map +0 -1
- package/dist/apps/rpc.js.map +0 -1
- package/dist/apps/tokenlist.d.ts.map +0 -1
- package/dist/apps/tokenlist.js.map +0 -1
- package/dist/apps/tokens.d.ts.map +0 -1
- package/dist/apps/tokens.js.map +0 -1
- package/dist/apps/transactions.d.ts.map +0 -1
- package/dist/apps/transactions.js.map +0 -1
- package/dist/apps/transfers.d.ts.map +0 -1
- package/dist/apps/transfers.js.map +0 -1
- package/dist/apps/verified-tokens.d.ts.map +0 -1
- package/dist/apps/verified-tokens.js.map +0 -1
- package/dist/apps/webhooks.js.map +0 -1
- package/dist/internal/OpenApi.fonts.d.ts.map +0 -1
- package/dist/internal/OpenApi.fonts.js.map +0 -1
- package/dist/internal/OpenApi.logo.d.ts.map +0 -1
- package/dist/internal/OpenApi.logo.js.map +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000000.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
- package/seeds/31318/verified-tokens.json +0 -30
- package/seeds/4217/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
- package/seeds/4217/icons/0x20c000000000000000000000048c8f36df1c9a4a.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000000520792dcccccccc.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000000a6da882d075a4c3.svg +0 -4
- package/seeds/4217/icons/0x20c000000000000000000000111111111e910f0f.svg +0 -30
- package/seeds/4217/icons/0x20c00000000000000000000014f22ca97301eb73.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000001621e21f71cf12fb.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000002f52d5cc21a3207b.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000003158081efd85bfc2.svg +0 -11
- package/seeds/4217/icons/0x20c0000000000000000000003554d28269e0f3c2.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000383a23bacb546ab9.svg +0 -1
- package/seeds/4217/icons/0x20c00000000000000000000042109aef2f8b28e1.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000005c0bac7cef389a11.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000006fd9a167923ba194.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000007f7ba549dd0251b9.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000008191667423f70e67.svg +0 -5
- package/seeds/4217/icons/0x20c0000000000000000000008ee4fcff88888888.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000009a4a4b17e0dc6651.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000ab02d39df30bd17e.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000ae247a1130450f09.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000aeed2ec36a54d0e5.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000b9537d11c60e8b50.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000bd95bfb69fbe6ce3.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000c412ec89d0c08be5.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000f047dd7018e50367.png +0 -0
- package/seeds/4217/verified-tokens.json +0 -177
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000009e8d7eb59b783726.svg +0 -1
- package/seeds/42431/icons/0x20c000000000000000000000d72572838bbee59c.svg +0 -1
- package/seeds/42431/verified-tokens.json +0 -44
- package/seeds/openrpc/README.md +0 -27
- package/seeds/openrpc/execution-apis.json +0 -8989
- package/src/ApiKeySource.test-d.ts +0 -11
- package/src/ApiKeySource.test.ts +0 -295
- package/src/ApiKeySource.ts +0 -303
- /package/src/{internal/OpenApi.fonts.ts → apps/docs/fonts.ts} +0 -0
- /package/src/{internal/OpenApi.logo.ts → apps/docs/logo.ts} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/** Maps a stored row to the domain delivery (null columns → absent fields). */
|
|
2
|
+
export function toDelivery(row) {
|
|
3
|
+
return {
|
|
4
|
+
attempt: row.attempt,
|
|
5
|
+
createdAt: row.createdAt,
|
|
6
|
+
envelope: row.envelope,
|
|
7
|
+
...(row.error === null ? {} : { error: row.error }),
|
|
8
|
+
eventId: row.eventId,
|
|
9
|
+
id: row.id,
|
|
10
|
+
requestUrl: row.requestUrl,
|
|
11
|
+
...(row.responseMs === null ? {} : { responseMs: row.responseMs }),
|
|
12
|
+
...(row.responseStatus === null ? {} : { responseStatus: row.responseStatus }),
|
|
13
|
+
status: row.status,
|
|
14
|
+
subscriptionId: row.subscriptionId,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Inserts a delivery row from its domain value.
|
|
19
|
+
*
|
|
20
|
+
* @param db - The database.
|
|
21
|
+
* @param delivery - The delivery to insert.
|
|
22
|
+
* @param expiresAt - Retention deadline (ISO); the row is invisible past it.
|
|
23
|
+
*/
|
|
24
|
+
export async function insert(db, delivery, expiresAt) {
|
|
25
|
+
await db.kysely
|
|
26
|
+
.insertInto('webhook_deliveries')
|
|
27
|
+
.values({
|
|
28
|
+
attempt: delivery.attempt,
|
|
29
|
+
createdAt: delivery.createdAt,
|
|
30
|
+
envelope: delivery.envelope,
|
|
31
|
+
error: delivery.error ?? null,
|
|
32
|
+
eventId: delivery.eventId,
|
|
33
|
+
expiresAt,
|
|
34
|
+
id: delivery.id,
|
|
35
|
+
requestUrl: delivery.requestUrl,
|
|
36
|
+
responseMs: delivery.responseMs ?? null,
|
|
37
|
+
responseStatus: delivery.responseStatus ?? null,
|
|
38
|
+
status: delivery.status,
|
|
39
|
+
subscriptionId: delivery.subscriptionId,
|
|
40
|
+
})
|
|
41
|
+
.execute();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Lists a subscription's unexpired deliveries, newest first, with keyset
|
|
45
|
+
* paging (`id < cursor` — ids embed a zero-padded timestamp, so lexical order
|
|
46
|
+
* is chronological).
|
|
47
|
+
*
|
|
48
|
+
* @param db - The database.
|
|
49
|
+
* @param subscriptionId - The owning subscription id (`wh_…`).
|
|
50
|
+
* @param options - Paging options plus the retention timestamp.
|
|
51
|
+
* @returns The deliveries.
|
|
52
|
+
*/
|
|
53
|
+
export async function list(db, subscriptionId, options) {
|
|
54
|
+
let query = db.kysely
|
|
55
|
+
.selectFrom('webhook_deliveries')
|
|
56
|
+
.selectAll()
|
|
57
|
+
.where('subscriptionId', '=', subscriptionId)
|
|
58
|
+
.where('expiresAt', '>', options.now)
|
|
59
|
+
.orderBy('id', 'desc');
|
|
60
|
+
if (options.cursor)
|
|
61
|
+
query = query.where('id', '<', options.cursor);
|
|
62
|
+
if (options.offset)
|
|
63
|
+
query = query.offset(options.offset);
|
|
64
|
+
if (options.limit !== undefined)
|
|
65
|
+
query = query.limit(options.limit);
|
|
66
|
+
return (await query.execute()).map(toDelivery);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Counts a subscription's unexpired deliveries.
|
|
70
|
+
*
|
|
71
|
+
* @param db - The database.
|
|
72
|
+
* @param subscriptionId - The owning subscription id (`wh_…`).
|
|
73
|
+
* @param now - ISO timestamp retention is evaluated against.
|
|
74
|
+
* @returns The count.
|
|
75
|
+
*/
|
|
76
|
+
export async function count(db, subscriptionId, now) {
|
|
77
|
+
const row = await db.kysely
|
|
78
|
+
.selectFrom('webhook_deliveries')
|
|
79
|
+
.select((eb) => eb.fn.countAll().as('count'))
|
|
80
|
+
.where('subscriptionId', '=', subscriptionId)
|
|
81
|
+
.where('expiresAt', '>', now)
|
|
82
|
+
.executeTakeFirstOrThrow();
|
|
83
|
+
return Number(row.count);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Reads a single unexpired delivery scoped to its subscription.
|
|
87
|
+
*
|
|
88
|
+
* @param db - The database.
|
|
89
|
+
* @param subscriptionId - The owning subscription id (`wh_…`).
|
|
90
|
+
* @param deliveryId - The delivery id (`whd_…`).
|
|
91
|
+
* @param now - ISO timestamp retention is evaluated against.
|
|
92
|
+
* @returns The delivery, or `null` when absent.
|
|
93
|
+
*/
|
|
94
|
+
export async function get(db, subscriptionId, deliveryId, now) {
|
|
95
|
+
const row = await db.kysely
|
|
96
|
+
.selectFrom('webhook_deliveries')
|
|
97
|
+
.selectAll()
|
|
98
|
+
.where('subscriptionId', '=', subscriptionId)
|
|
99
|
+
.where('id', '=', deliveryId)
|
|
100
|
+
.where('expiresAt', '>', now)
|
|
101
|
+
.executeTakeFirst();
|
|
102
|
+
return row ? toDelivery(row) : null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Deletes deliveries past their retention deadline. Called best-effort from
|
|
106
|
+
* the poller tick.
|
|
107
|
+
*
|
|
108
|
+
* @param db - The database.
|
|
109
|
+
* @param now - ISO timestamp retention is evaluated against.
|
|
110
|
+
* @returns The number of rows deleted.
|
|
111
|
+
*/
|
|
112
|
+
export async function pruneExpired(db, now) {
|
|
113
|
+
const result = await db.kysely
|
|
114
|
+
.deleteFrom('webhook_deliveries')
|
|
115
|
+
.where('expiresAt', '<=', now)
|
|
116
|
+
.executeTakeFirst();
|
|
117
|
+
return Number(result.numDeletedRows);
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=webhookDeliveries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookDeliveries.js","sourceRoot":"","sources":["../../../src/db/tables/webhookDeliveries.ts"],"names":[],"mappings":"AAYA,+EAA+E;AAC/E,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;QACnD,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,UAAU,EAAE,GAAG,CAAC,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GAAW;IAEX,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM;SACxB,UAAU,CAAC,oBAAoB,CAAC;SAChC,SAAS,EAAE;SACX,KAAK,CAAC,gBAAgB,EAAE,GAAG,EAAE,cAAc,CAAC;SAC5C,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,UAAU,CAAC;SAC5B,KAAK,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC;SAC5B,gBAAgB,EAAE,CAAA;IACrB,OAAO,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACrC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAS,EAAE,GAAW;IACvD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM;SAC3B,UAAU,CAAC,oBAAoB,CAAC;SAChC,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,GAAG,CAAC;SAC7B,gBAAgB,EAAE,CAAA;IACrB,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;AACtC,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { Selectable } from 'kysely';
|
|
2
|
+
import type * as Webhooks from '../../internal/Webhooks.js';
|
|
3
|
+
import type * as Db from '../Db.js';
|
|
4
|
+
import type * as db_Schema from '../Schema.js';
|
|
5
|
+
/** Columns of the `webhook_subscriptions` table, derived from `Schema.WebhookSubscription`. */
|
|
6
|
+
export type Table = db_Schema.WebhookSubscription;
|
|
7
|
+
/** A stored webhook-subscription row. */
|
|
8
|
+
export type Record = Selectable<Table>;
|
|
9
|
+
/** Maps an owner union to its stored `ownerId` column value. */
|
|
10
|
+
export declare function ownerId(owner: Webhooks.Owner): string;
|
|
11
|
+
/** Maps a stored row to the domain subscription (null columns → absent fields). */
|
|
12
|
+
export declare function toSubscription(row: Record): Webhooks.Subscription;
|
|
13
|
+
/**
|
|
14
|
+
* Inserts a subscription row from its domain value.
|
|
15
|
+
*
|
|
16
|
+
* @param db - The database.
|
|
17
|
+
* @param subscription - The subscription to insert.
|
|
18
|
+
*/
|
|
19
|
+
export declare function insert(db: Db.Db, subscription: Webhooks.Subscription): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Reads an owner's subscription by id; expired rows never match (query-time
|
|
22
|
+
* expiry, same read semantics as the old store TTL).
|
|
23
|
+
*
|
|
24
|
+
* @param db - The database.
|
|
25
|
+
* @param owner - The authenticated owner.
|
|
26
|
+
* @param id - The subscription id (`wh_…`).
|
|
27
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
28
|
+
* @returns The subscription, or `null` when absent (or not the owner's).
|
|
29
|
+
*/
|
|
30
|
+
export declare function get(db: Db.Db, owner: Webhooks.Owner, id: string, now: string): Promise<Webhooks.Subscription | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Lists an owner's live subscriptions, newest first, with keyset paging
|
|
33
|
+
* (`id < cursor` — ids embed a zero-padded timestamp, so lexical order is
|
|
34
|
+
* chronological).
|
|
35
|
+
*
|
|
36
|
+
* @param db - The database.
|
|
37
|
+
* @param owner - The authenticated owner.
|
|
38
|
+
* @param options - Paging options plus the expiry timestamp.
|
|
39
|
+
* @returns The subscriptions.
|
|
40
|
+
*/
|
|
41
|
+
export declare function list(db: Db.Db, owner: Webhooks.Owner, options: list.Options): Promise<Webhooks.Subscription[]>;
|
|
42
|
+
export declare namespace list {
|
|
43
|
+
/** Options for {@link list}. */
|
|
44
|
+
type Options = {
|
|
45
|
+
/** Return subscriptions older than this id (keyset paging, newest first). */
|
|
46
|
+
cursor?: string | undefined;
|
|
47
|
+
/** Maximum subscriptions to return. */
|
|
48
|
+
limit?: number | undefined;
|
|
49
|
+
/** ISO timestamp expiry is evaluated against. */
|
|
50
|
+
now: string;
|
|
51
|
+
/** Rows to skip from the head (positional pagination; exclusive with `cursor`). */
|
|
52
|
+
offset?: number | undefined;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Counts an owner's live subscriptions.
|
|
57
|
+
*
|
|
58
|
+
* @param db - The database.
|
|
59
|
+
* @param owner - The authenticated owner.
|
|
60
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
61
|
+
* @returns The count.
|
|
62
|
+
*/
|
|
63
|
+
export declare function count(db: Db.Db, owner: Webhooks.Owner, now: string): Promise<number>;
|
|
64
|
+
/**
|
|
65
|
+
* Applies a column patch to a subscription. Only the provided columns are
|
|
66
|
+
* written; `context: null` clears the stored context.
|
|
67
|
+
*
|
|
68
|
+
* @param db - The database.
|
|
69
|
+
* @param id - The subscription id (`wh_…`).
|
|
70
|
+
* @param set - The columns to write.
|
|
71
|
+
* @returns The updated row's subscription, or `undefined` when absent.
|
|
72
|
+
*/
|
|
73
|
+
export declare function update(db: Db.Db, id: string, set: update.Set): Promise<Webhooks.Subscription | undefined>;
|
|
74
|
+
export declare namespace update {
|
|
75
|
+
/** Columns writable by a subscription patch. */
|
|
76
|
+
type Set = {
|
|
77
|
+
/** New human context; null clears it. */
|
|
78
|
+
context?: Webhooks.Context | null | undefined;
|
|
79
|
+
/** New delivery destination. */
|
|
80
|
+
destination?: Webhooks.Destination | undefined;
|
|
81
|
+
/** New filter predicates. */
|
|
82
|
+
filters?: Webhooks.Subscription['filters'] | undefined;
|
|
83
|
+
/** New lifecycle status. */
|
|
84
|
+
status?: Webhooks.Status | undefined;
|
|
85
|
+
/** Mutation timestamp (ISO). */
|
|
86
|
+
updatedAt: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Deletes an owner's live subscription; delivery rows cascade via the FK.
|
|
91
|
+
*
|
|
92
|
+
* @param db - The database.
|
|
93
|
+
* @param owner - The authenticated owner.
|
|
94
|
+
* @param id - The subscription id (`wh_…`).
|
|
95
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
96
|
+
* @returns Whether a row was deleted.
|
|
97
|
+
*/
|
|
98
|
+
export declare function remove(db: Db.Db, owner: Webhooks.Owner, id: string, now: string): Promise<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* Lists live `active` subscriptions for a `(chainId, eventType)` stream — the
|
|
101
|
+
* poller's per-stream lookup, served by the partial status index.
|
|
102
|
+
*
|
|
103
|
+
* @param db - The database.
|
|
104
|
+
* @param chainId - Chain the stream belongs to.
|
|
105
|
+
* @param eventType - Event type of the stream.
|
|
106
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
107
|
+
* @returns The subscriptions, in id (chronological) order.
|
|
108
|
+
*/
|
|
109
|
+
export declare function listActive(db: Db.Db, chainId: number, eventType: Webhooks.EventType, now: string): Promise<Webhooks.Subscription[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Reads a subscription's poller cursor.
|
|
112
|
+
*
|
|
113
|
+
* @param db - The database.
|
|
114
|
+
* @param id - The subscription id (`wh_…`).
|
|
115
|
+
* @returns The cursor, or `null` when unset (or the row is absent).
|
|
116
|
+
*/
|
|
117
|
+
export declare function getCursor(db: Db.Db, id: string): Promise<string | null>;
|
|
118
|
+
/**
|
|
119
|
+
* Writes a subscription's poller cursor. Deliberately does not touch
|
|
120
|
+
* `updatedAt` — the cursor advances every tick and is not a user mutation.
|
|
121
|
+
*
|
|
122
|
+
* @param db - The database.
|
|
123
|
+
* @param id - The subscription id (`wh_…`).
|
|
124
|
+
* @param cursor - The keyset cursor to store.
|
|
125
|
+
*/
|
|
126
|
+
export declare function setCursor(db: Db.Db, id: string, cursor: string): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Records a successful delivery: resets the consecutive-failure counter and
|
|
129
|
+
* stamps `lastDeliveryAt`.
|
|
130
|
+
*
|
|
131
|
+
* @param db - The database.
|
|
132
|
+
* @param id - The subscription id (`wh_…`).
|
|
133
|
+
* @param now - Delivery timestamp (ISO).
|
|
134
|
+
* @returns The updated subscription, or `undefined` when the row is absent.
|
|
135
|
+
*/
|
|
136
|
+
export declare function recordSuccess(db: Db.Db, id: string, now: string): Promise<Webhooks.Subscription | undefined>;
|
|
137
|
+
/**
|
|
138
|
+
* Records a failed delivery: atomically increments the consecutive-failure
|
|
139
|
+
* counter and disables the subscription once it reaches `maxFailures` (raw
|
|
140
|
+
* fragments use storage column names — they bypass the camelCase mapping).
|
|
141
|
+
*
|
|
142
|
+
* @param db - The database.
|
|
143
|
+
* @param id - The subscription id (`wh_…`).
|
|
144
|
+
* @param maxFailures - Consecutive failures before auto-disabling.
|
|
145
|
+
* @param now - Failure timestamp (ISO).
|
|
146
|
+
* @returns The updated subscription, or `undefined` when the row is absent.
|
|
147
|
+
*/
|
|
148
|
+
export declare function recordFailure(db: Db.Db, id: string, maxFailures: number, now: string): Promise<Webhooks.Subscription | undefined>;
|
|
149
|
+
/**
|
|
150
|
+
* Deletes expired subscriptions (their delivery rows cascade). Called
|
|
151
|
+
* best-effort from the poller tick.
|
|
152
|
+
*
|
|
153
|
+
* @param db - The database.
|
|
154
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
155
|
+
* @returns The number of rows deleted.
|
|
156
|
+
*/
|
|
157
|
+
export declare function pruneExpired(db: Db.Db, now: string): Promise<number>;
|
|
158
|
+
//# sourceMappingURL=webhookSubscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookSubscriptions.d.ts","sourceRoot":"","sources":["../../../src/db/tables/webhookSubscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,QAAQ,CAAA;AAG3D,OAAO,KAAK,KAAK,QAAQ,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,KAAK,SAAS,MAAM,cAAc,CAAA;AAE9C,+FAA+F;AAC/F,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,mBAAmB,CAAA;AAEjD,yCAAyC;AACzC,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,KAA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AAC,MAAM,GAAG,IAAI,CAAC,CAO7E;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpF;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,EAAE,CAAC,EAAE,EACT,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,QAAQ,CAAC,YAAY,GAAG,SAAS,CAAC,CAQ5C;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,EAAE,EAAE,EAAE,CAAC,EAAE,EACT,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,QAAQ,CAAC,YAAY,GAAG,SAAS,CAAC,CAY5C;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO1E"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { sql } from 'kysely';
|
|
2
|
+
/** Maps an owner union to its stored `ownerId` column value. */
|
|
3
|
+
export function ownerId(owner) {
|
|
4
|
+
return owner.type === 'api_key' ? owner.orgId : owner.payer;
|
|
5
|
+
}
|
|
6
|
+
/** Maps a stored row to the domain subscription (null columns → absent fields). */
|
|
7
|
+
export function toSubscription(row) {
|
|
8
|
+
return {
|
|
9
|
+
chainId: row.chainId,
|
|
10
|
+
...(row.context === null ? {} : { context: row.context }),
|
|
11
|
+
createdAt: row.createdAt,
|
|
12
|
+
destination: row.destination,
|
|
13
|
+
eventType: row.eventType,
|
|
14
|
+
...(row.expiresAt === null ? {} : { expiresAt: row.expiresAt }),
|
|
15
|
+
failureCount: row.failureCount,
|
|
16
|
+
filters: row.filters,
|
|
17
|
+
id: row.id,
|
|
18
|
+
...(row.lastDeliveryAt === null ? {} : { lastDeliveryAt: row.lastDeliveryAt }),
|
|
19
|
+
owner: row.ownerType === 'api_key'
|
|
20
|
+
? { orgId: row.ownerId, type: 'api_key' }
|
|
21
|
+
: { payer: row.ownerId, type: 'mpp' },
|
|
22
|
+
secret: row.secret,
|
|
23
|
+
status: row.status,
|
|
24
|
+
updatedAt: row.updatedAt,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Inserts a subscription row from its domain value.
|
|
29
|
+
*
|
|
30
|
+
* @param db - The database.
|
|
31
|
+
* @param subscription - The subscription to insert.
|
|
32
|
+
*/
|
|
33
|
+
export async function insert(db, subscription) {
|
|
34
|
+
await db.kysely
|
|
35
|
+
.insertInto('webhook_subscriptions')
|
|
36
|
+
.values({
|
|
37
|
+
chainId: subscription.chainId,
|
|
38
|
+
context: subscription.context ?? null,
|
|
39
|
+
createdAt: subscription.createdAt,
|
|
40
|
+
destination: subscription.destination,
|
|
41
|
+
eventType: subscription.eventType,
|
|
42
|
+
expiresAt: subscription.expiresAt ?? null,
|
|
43
|
+
failureCount: subscription.failureCount,
|
|
44
|
+
filters: subscription.filters,
|
|
45
|
+
id: subscription.id,
|
|
46
|
+
lastDeliveryAt: subscription.lastDeliveryAt ?? null,
|
|
47
|
+
ownerId: ownerId(subscription.owner),
|
|
48
|
+
ownerType: subscription.owner.type,
|
|
49
|
+
pollerCursor: null,
|
|
50
|
+
secret: subscription.secret,
|
|
51
|
+
status: subscription.status,
|
|
52
|
+
updatedAt: subscription.updatedAt,
|
|
53
|
+
})
|
|
54
|
+
.execute();
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Reads an owner's subscription by id; expired rows never match (query-time
|
|
58
|
+
* expiry, same read semantics as the old store TTL).
|
|
59
|
+
*
|
|
60
|
+
* @param db - The database.
|
|
61
|
+
* @param owner - The authenticated owner.
|
|
62
|
+
* @param id - The subscription id (`wh_…`).
|
|
63
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
64
|
+
* @returns The subscription, or `null` when absent (or not the owner's).
|
|
65
|
+
*/
|
|
66
|
+
export async function get(db, owner, id, now) {
|
|
67
|
+
const row = await db.kysely
|
|
68
|
+
.selectFrom('webhook_subscriptions')
|
|
69
|
+
.selectAll()
|
|
70
|
+
.where('id', '=', id)
|
|
71
|
+
.where('ownerType', '=', owner.type)
|
|
72
|
+
.where('ownerId', '=', ownerId(owner))
|
|
73
|
+
.where(live(now))
|
|
74
|
+
.executeTakeFirst();
|
|
75
|
+
return row ? toSubscription(row) : null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Lists an owner's live subscriptions, newest first, with keyset paging
|
|
79
|
+
* (`id < cursor` — ids embed a zero-padded timestamp, so lexical order is
|
|
80
|
+
* chronological).
|
|
81
|
+
*
|
|
82
|
+
* @param db - The database.
|
|
83
|
+
* @param owner - The authenticated owner.
|
|
84
|
+
* @param options - Paging options plus the expiry timestamp.
|
|
85
|
+
* @returns The subscriptions.
|
|
86
|
+
*/
|
|
87
|
+
export async function list(db, owner, options) {
|
|
88
|
+
let query = db.kysely
|
|
89
|
+
.selectFrom('webhook_subscriptions')
|
|
90
|
+
.selectAll()
|
|
91
|
+
.where('ownerType', '=', owner.type)
|
|
92
|
+
.where('ownerId', '=', ownerId(owner))
|
|
93
|
+
.where(live(options.now))
|
|
94
|
+
.orderBy('id', 'desc');
|
|
95
|
+
if (options.cursor)
|
|
96
|
+
query = query.where('id', '<', options.cursor);
|
|
97
|
+
if (options.offset)
|
|
98
|
+
query = query.offset(options.offset);
|
|
99
|
+
if (options.limit !== undefined)
|
|
100
|
+
query = query.limit(options.limit);
|
|
101
|
+
return (await query.execute()).map(toSubscription);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Counts an owner's live subscriptions.
|
|
105
|
+
*
|
|
106
|
+
* @param db - The database.
|
|
107
|
+
* @param owner - The authenticated owner.
|
|
108
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
109
|
+
* @returns The count.
|
|
110
|
+
*/
|
|
111
|
+
export async function count(db, owner, now) {
|
|
112
|
+
const row = await db.kysely
|
|
113
|
+
.selectFrom('webhook_subscriptions')
|
|
114
|
+
.select((eb) => eb.fn.countAll().as('count'))
|
|
115
|
+
.where('ownerType', '=', owner.type)
|
|
116
|
+
.where('ownerId', '=', ownerId(owner))
|
|
117
|
+
.where(live(now))
|
|
118
|
+
.executeTakeFirstOrThrow();
|
|
119
|
+
return Number(row.count);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Applies a column patch to a subscription. Only the provided columns are
|
|
123
|
+
* written; `context: null` clears the stored context.
|
|
124
|
+
*
|
|
125
|
+
* @param db - The database.
|
|
126
|
+
* @param id - The subscription id (`wh_…`).
|
|
127
|
+
* @param set - The columns to write.
|
|
128
|
+
* @returns The updated row's subscription, or `undefined` when absent.
|
|
129
|
+
*/
|
|
130
|
+
export async function update(db, id, set) {
|
|
131
|
+
const row = await db.kysely
|
|
132
|
+
.updateTable('webhook_subscriptions')
|
|
133
|
+
.set(set)
|
|
134
|
+
.where('id', '=', id)
|
|
135
|
+
.returningAll()
|
|
136
|
+
.executeTakeFirst();
|
|
137
|
+
return row ? toSubscription(row) : undefined;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Deletes an owner's live subscription; delivery rows cascade via the FK.
|
|
141
|
+
*
|
|
142
|
+
* @param db - The database.
|
|
143
|
+
* @param owner - The authenticated owner.
|
|
144
|
+
* @param id - The subscription id (`wh_…`).
|
|
145
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
146
|
+
* @returns Whether a row was deleted.
|
|
147
|
+
*/
|
|
148
|
+
export async function remove(db, owner, id, now) {
|
|
149
|
+
const result = await db.kysely
|
|
150
|
+
.deleteFrom('webhook_subscriptions')
|
|
151
|
+
.where('id', '=', id)
|
|
152
|
+
.where('ownerType', '=', owner.type)
|
|
153
|
+
.where('ownerId', '=', ownerId(owner))
|
|
154
|
+
.where(live(now))
|
|
155
|
+
.executeTakeFirst();
|
|
156
|
+
return result.numDeletedRows > 0n;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Lists live `active` subscriptions for a `(chainId, eventType)` stream — the
|
|
160
|
+
* poller's per-stream lookup, served by the partial status index.
|
|
161
|
+
*
|
|
162
|
+
* @param db - The database.
|
|
163
|
+
* @param chainId - Chain the stream belongs to.
|
|
164
|
+
* @param eventType - Event type of the stream.
|
|
165
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
166
|
+
* @returns The subscriptions, in id (chronological) order.
|
|
167
|
+
*/
|
|
168
|
+
export async function listActive(db, chainId, eventType, now) {
|
|
169
|
+
const rows = await db.kysely
|
|
170
|
+
.selectFrom('webhook_subscriptions')
|
|
171
|
+
.selectAll()
|
|
172
|
+
.where('chainId', '=', chainId)
|
|
173
|
+
.where('eventType', '=', eventType)
|
|
174
|
+
.where('status', '=', 'active')
|
|
175
|
+
.where(live(now))
|
|
176
|
+
.orderBy('id')
|
|
177
|
+
.execute();
|
|
178
|
+
return rows.map(toSubscription);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Reads a subscription's poller cursor.
|
|
182
|
+
*
|
|
183
|
+
* @param db - The database.
|
|
184
|
+
* @param id - The subscription id (`wh_…`).
|
|
185
|
+
* @returns The cursor, or `null` when unset (or the row is absent).
|
|
186
|
+
*/
|
|
187
|
+
export async function getCursor(db, id) {
|
|
188
|
+
const row = await db.kysely
|
|
189
|
+
.selectFrom('webhook_subscriptions')
|
|
190
|
+
.select('pollerCursor')
|
|
191
|
+
.where('id', '=', id)
|
|
192
|
+
.executeTakeFirst();
|
|
193
|
+
return row?.pollerCursor ?? null;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Writes a subscription's poller cursor. Deliberately does not touch
|
|
197
|
+
* `updatedAt` — the cursor advances every tick and is not a user mutation.
|
|
198
|
+
*
|
|
199
|
+
* @param db - The database.
|
|
200
|
+
* @param id - The subscription id (`wh_…`).
|
|
201
|
+
* @param cursor - The keyset cursor to store.
|
|
202
|
+
*/
|
|
203
|
+
export async function setCursor(db, id, cursor) {
|
|
204
|
+
await db.kysely
|
|
205
|
+
.updateTable('webhook_subscriptions')
|
|
206
|
+
.set({ pollerCursor: cursor })
|
|
207
|
+
.where('id', '=', id)
|
|
208
|
+
.execute();
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Records a successful delivery: resets the consecutive-failure counter and
|
|
212
|
+
* stamps `lastDeliveryAt`.
|
|
213
|
+
*
|
|
214
|
+
* @param db - The database.
|
|
215
|
+
* @param id - The subscription id (`wh_…`).
|
|
216
|
+
* @param now - Delivery timestamp (ISO).
|
|
217
|
+
* @returns The updated subscription, or `undefined` when the row is absent.
|
|
218
|
+
*/
|
|
219
|
+
export async function recordSuccess(db, id, now) {
|
|
220
|
+
const row = await db.kysely
|
|
221
|
+
.updateTable('webhook_subscriptions')
|
|
222
|
+
.set({ failureCount: 0, lastDeliveryAt: now, updatedAt: now })
|
|
223
|
+
.where('id', '=', id)
|
|
224
|
+
.returningAll()
|
|
225
|
+
.executeTakeFirst();
|
|
226
|
+
return row ? toSubscription(row) : undefined;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Records a failed delivery: atomically increments the consecutive-failure
|
|
230
|
+
* counter and disables the subscription once it reaches `maxFailures` (raw
|
|
231
|
+
* fragments use storage column names — they bypass the camelCase mapping).
|
|
232
|
+
*
|
|
233
|
+
* @param db - The database.
|
|
234
|
+
* @param id - The subscription id (`wh_…`).
|
|
235
|
+
* @param maxFailures - Consecutive failures before auto-disabling.
|
|
236
|
+
* @param now - Failure timestamp (ISO).
|
|
237
|
+
* @returns The updated subscription, or `undefined` when the row is absent.
|
|
238
|
+
*/
|
|
239
|
+
export async function recordFailure(db, id, maxFailures, now) {
|
|
240
|
+
const row = await db.kysely
|
|
241
|
+
.updateTable('webhook_subscriptions')
|
|
242
|
+
.set({
|
|
243
|
+
failureCount: sql `failure_count + 1`,
|
|
244
|
+
status: sql `CASE WHEN failure_count + 1 >= ${maxFailures} THEN 'disabled' ELSE status END`,
|
|
245
|
+
updatedAt: now,
|
|
246
|
+
})
|
|
247
|
+
.where('id', '=', id)
|
|
248
|
+
.returningAll()
|
|
249
|
+
.executeTakeFirst();
|
|
250
|
+
return row ? toSubscription(row) : undefined;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Deletes expired subscriptions (their delivery rows cascade). Called
|
|
254
|
+
* best-effort from the poller tick.
|
|
255
|
+
*
|
|
256
|
+
* @param db - The database.
|
|
257
|
+
* @param now - ISO timestamp expiry is evaluated against.
|
|
258
|
+
* @returns The number of rows deleted.
|
|
259
|
+
*/
|
|
260
|
+
export async function pruneExpired(db, now) {
|
|
261
|
+
const result = await db.kysely
|
|
262
|
+
.deleteFrom('webhook_subscriptions')
|
|
263
|
+
.where('expiresAt', 'is not', null)
|
|
264
|
+
.where('expiresAt', '<=', now)
|
|
265
|
+
.executeTakeFirst();
|
|
266
|
+
return Number(result.numDeletedRows);
|
|
267
|
+
}
|
|
268
|
+
/** Live-row predicate: no expiry, or expiry strictly in the future. */
|
|
269
|
+
function live(now) {
|
|
270
|
+
return (eb) => eb.or([eb('expiresAt', 'is', null), eb('expiresAt', '>', now)]);
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=webhookSubscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookSubscriptions.js","sourceRoot":"","sources":["../../../src/db/tables/webhookSubscriptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAY5B,gEAAgE;AAChE,MAAM,UAAU,OAAO,CAAC,KAAqB;IAC3C,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC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AAC;AAED,uEAAuE;AACvE,SAAS,IAAI,CAAC,GAAW;IACvB,OAAO,CAAC,EAA2D,EAAE,EAAE,CACrE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type DecodeErrorResultReturnType, type Hex } from 'viem';
|
|
2
|
+
import { Abis } from 'viem/tempo';
|
|
3
|
+
import type { OneOf, UnionOmit } from './types.js';
|
|
4
|
+
type AllAbis = typeof Abis.abis;
|
|
5
|
+
type AbiErrorName = Extract<AllAbis[number], {
|
|
6
|
+
type: 'error';
|
|
7
|
+
}>['name'];
|
|
8
|
+
/** Decoded execution error from a Tempo precompile revert. */
|
|
9
|
+
export type ExecutionError = OneOf<(DecodeErrorResultReturnType<AllAbis> & {
|
|
10
|
+
data: Hex;
|
|
11
|
+
message: string;
|
|
12
|
+
}) | {
|
|
13
|
+
errorName: 'unknown';
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
/** RPC-serialized execution error (bigints and numbers as hex). */
|
|
17
|
+
export type Rpc = UnionOmit<ExecutionError, 'args'>;
|
|
18
|
+
/** Human-readable messages keyed by ABI error name. */
|
|
19
|
+
export declare const messages: Record<AbiErrorName, string>;
|
|
20
|
+
/** Parse a viem error into a structured execution error. */
|
|
21
|
+
export declare function parse(error: Error): ExecutionError;
|
|
22
|
+
/** Serializes an ExecutionError for RPC transport (bigints/numbers → hex). */
|
|
23
|
+
export declare function serialize(preimage: ExecutionError): Rpc;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=executionError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executionError.d.ts","sourceRoot":"","sources":["../../../src/handlers/internal/executionError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,GAAG,EAAqB,MAAM,MAAM,CAAA;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAElD,KAAK,OAAO,GAAG,OAAO,IAAI,CAAC,IAAI,CAAA;AAC/B,KAAK,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvE,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG,KAAK,CAC9B,CAAC,2BAA2B,CAAC,OAAO,CAAC,GAAG;IACtC,IAAI,EAAE,GAAG,CAAA;IACT,OAAO,EAAE,MAAM,CAAA;CAChB,CAAC,GACF;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAC5C,CAAA;AAED,mEAAmE;AACnE,MAAM,MAAM,GAAG,GAAG,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AAEnD,uDAAuD;AACvD,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAoHjD,CAAA;AAWD,4DAA4D;AAC5D,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CA+BlD;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,GAAG,CAQvD"}
|