alchemy 0.24.1 → 0.26.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 +7 -0
- package/lib/ai/astro-file.d.ts.map +1 -1
- package/lib/ai/astro-file.js +2 -1
- package/lib/ai/astro-file.js.map +1 -1
- package/lib/ai/client.d.ts.map +1 -1
- package/lib/ai/client.js +3 -2
- package/lib/ai/client.js.map +1 -1
- package/lib/alchemy.d.ts +7 -0
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +19 -3
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +63 -5
- package/lib/apply.js.map +1 -1
- package/lib/aws/control/client.js +5 -4
- package/lib/aws/control/client.js.map +1 -1
- package/lib/aws/control/properties.d.ts +6 -0
- package/lib/aws/control/properties.d.ts.map +1 -1
- package/lib/aws/control/properties.js +48 -0
- package/lib/aws/control/properties.js.map +1 -1
- package/lib/aws/control/resource.d.ts.map +1 -1
- package/lib/aws/control/resource.js +5 -3
- package/lib/aws/control/resource.js.map +1 -1
- package/lib/aws/control/types.d.ts +3969 -4862
- package/lib/aws/control/types.d.ts.map +1 -1
- package/lib/aws/control/types.js.map +1 -1
- package/lib/aws/function.d.ts.map +1 -1
- package/lib/aws/function.js +9 -8
- package/lib/aws/function.js.map +1 -1
- package/lib/aws/oidc/oidc-provider.d.ts.map +1 -1
- package/lib/aws/oidc/oidc-provider.js +3 -2
- package/lib/aws/oidc/oidc-provider.js.map +1 -1
- package/lib/aws/queue.d.ts.map +1 -1
- package/lib/aws/queue.js +3 -2
- package/lib/aws/queue.js.map +1 -1
- package/lib/aws/role.d.ts.map +1 -1
- package/lib/aws/role.js +3 -1
- package/lib/aws/role.js.map +1 -1
- package/lib/aws/ssm-parameter.d.ts.map +1 -1
- package/lib/aws/ssm-parameter.js +2 -1
- package/lib/aws/ssm-parameter.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js +3 -2
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
- package/lib/cloudflare/ai-gateway.js +4 -3
- package/lib/cloudflare/ai-gateway.js.map +1 -1
- package/lib/cloudflare/ai.d.ts +21 -0
- package/lib/cloudflare/ai.d.ts.map +1 -1
- package/lib/cloudflare/ai.js +21 -0
- package/lib/cloudflare/ai.js.map +1 -1
- package/lib/cloudflare/api-error.d.ts +0 -9
- package/lib/cloudflare/api-error.d.ts.map +1 -1
- package/lib/cloudflare/api-error.js +24 -0
- package/lib/cloudflare/api-error.js.map +1 -1
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +5 -4
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/assets.d.ts.map +1 -1
- package/lib/cloudflare/assets.js +26 -6
- package/lib/cloudflare/assets.js.map +1 -1
- package/lib/cloudflare/astro.d.ts +63 -0
- package/lib/cloudflare/astro.d.ts.map +1 -0
- package/lib/cloudflare/astro.js +133 -0
- package/lib/cloudflare/astro.js.map +1 -0
- package/lib/cloudflare/auth.d.ts.map +1 -1
- package/lib/cloudflare/auth.js +3 -2
- package/lib/cloudflare/auth.js.map +1 -1
- package/lib/cloudflare/bindings.d.ts +23 -2
- package/lib/cloudflare/bindings.d.ts.map +1 -1
- package/lib/cloudflare/bindings.js.map +1 -1
- package/lib/cloudflare/bound.d.ts +7 -1
- package/lib/cloudflare/bound.d.ts.map +1 -1
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +12 -8
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -1
- package/lib/cloudflare/bundle/bundle-worker.js +2 -1
- package/lib/cloudflare/bundle/bundle-worker.js.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.js +2 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -1
- package/lib/cloudflare/custom-domain.d.ts.map +1 -1
- package/lib/cloudflare/custom-domain.js +10 -9
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +11 -10
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/d1-export.d.ts.map +1 -1
- package/lib/cloudflare/d1-export.js +2 -1
- package/lib/cloudflare/d1-export.js.map +1 -1
- package/lib/cloudflare/d1-import.d.ts.map +1 -1
- package/lib/cloudflare/d1-import.js +2 -1
- package/lib/cloudflare/d1-import.js.map +1 -1
- package/lib/cloudflare/d1-migrations.d.ts.map +1 -1
- package/lib/cloudflare/d1-migrations.js +2 -1
- package/lib/cloudflare/d1-migrations.js.map +1 -1
- package/lib/cloudflare/dns-records.d.ts.map +1 -1
- package/lib/cloudflare/dns-records.js +5 -4
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/do-state-store/worker.d.ts.map +1 -1
- package/lib/cloudflare/do-state-store/worker.js +4 -0
- package/lib/cloudflare/do-state-store/worker.js.map +1 -1
- package/lib/cloudflare/email-address.d.ts +79 -0
- package/lib/cloudflare/email-address.d.ts.map +1 -0
- package/lib/cloudflare/email-address.js +112 -0
- package/lib/cloudflare/email-address.js.map +1 -0
- package/lib/cloudflare/email-catch-all.d.ts +123 -0
- package/lib/cloudflare/email-catch-all.d.ts.map +1 -0
- package/lib/cloudflare/email-catch-all.js +124 -0
- package/lib/cloudflare/email-catch-all.js.map +1 -0
- package/lib/cloudflare/email-routing.d.ts +89 -0
- package/lib/cloudflare/email-routing.d.ts.map +1 -0
- package/lib/cloudflare/email-routing.js +120 -0
- package/lib/cloudflare/email-routing.js.map +1 -0
- package/lib/cloudflare/email-rule.d.ts +196 -0
- package/lib/cloudflare/email-rule.d.ts.map +1 -0
- package/lib/cloudflare/email-rule.js +153 -0
- package/lib/cloudflare/email-rule.js.map +1 -0
- package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
- package/lib/cloudflare/hyperdrive.js +5 -4
- package/lib/cloudflare/hyperdrive.js.map +1 -1
- package/lib/cloudflare/images.d.ts +60 -0
- package/lib/cloudflare/images.d.ts.map +1 -0
- package/lib/cloudflare/images.js +60 -0
- package/lib/cloudflare/images.js.map +1 -0
- package/lib/cloudflare/index.d.ts +9 -0
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +9 -0
- package/lib/cloudflare/index.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js +2 -1
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +7 -0
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +28 -2
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +2 -1
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/queue.d.ts.map +1 -1
- package/lib/cloudflare/queue.js +0 -8
- package/lib/cloudflare/queue.js.map +1 -1
- package/lib/cloudflare/route.d.ts +26 -1
- package/lib/cloudflare/route.d.ts.map +1 -1
- package/lib/cloudflare/route.js +84 -16
- package/lib/cloudflare/route.js.map +1 -1
- package/lib/cloudflare/secret.d.ts +137 -0
- package/lib/cloudflare/secret.d.ts.map +1 -0
- package/lib/cloudflare/secret.js +122 -0
- package/lib/cloudflare/secret.js.map +1 -0
- package/lib/cloudflare/secrets-store.d.ts +145 -0
- package/lib/cloudflare/secrets-store.d.ts.map +1 -0
- package/lib/cloudflare/secrets-store.js +213 -0
- package/lib/cloudflare/secrets-store.js.map +1 -0
- package/lib/cloudflare/sveltekit.d.ts +49 -0
- package/lib/cloudflare/sveltekit.d.ts.map +1 -0
- package/lib/cloudflare/sveltekit.js +56 -0
- package/lib/cloudflare/sveltekit.js.map +1 -0
- package/lib/cloudflare/user.d.ts.map +1 -1
- package/lib/cloudflare/user.js +2 -1
- package/lib/cloudflare/user.js.map +1 -1
- package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-index.js +6 -5
- package/lib/cloudflare/vectorize-index.js.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.js +2 -1
- package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +7 -2
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-assets.d.ts +18 -0
- package/lib/cloudflare/worker-assets.d.ts.map +1 -1
- package/lib/cloudflare/worker-assets.js +61 -57
- package/lib/cloudflare/worker-assets.js.map +1 -1
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
- package/lib/cloudflare/worker-metadata.js +16 -1
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +31 -1
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +34 -8
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +14 -0
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +23 -0
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/cloudflare/zone.d.ts +30 -2
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +57 -3
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/destroy.d.ts.map +1 -1
- package/lib/destroy.js +30 -13
- package/lib/destroy.js.map +1 -1
- package/lib/dns/godaddy.d.ts.map +1 -1
- package/lib/dns/godaddy.js +3 -2
- package/lib/dns/godaddy.js.map +1 -1
- package/lib/dns/import-dns.d.ts.map +1 -1
- package/lib/dns/import-dns.js +2 -1
- package/lib/dns/import-dns.js.map +1 -1
- package/lib/esbuild/bundle.d.ts +1 -1
- package/lib/esbuild/bundle.d.ts.map +1 -1
- package/lib/esbuild/bundle.js +2 -1
- package/lib/esbuild/bundle.js.map +1 -1
- package/lib/fs/copy-file.d.ts.map +1 -1
- package/lib/fs/copy-file.js +2 -1
- package/lib/fs/copy-file.js.map +1 -1
- package/lib/fs/file.d.ts.map +1 -1
- package/lib/fs/file.js +2 -1
- package/lib/fs/file.js.map +1 -1
- package/lib/github/client.d.ts.map +1 -1
- package/lib/github/client.js +11 -10
- package/lib/github/client.js.map +1 -1
- package/lib/github/repository-environment.d.ts.map +1 -1
- package/lib/github/repository-environment.js +5 -4
- package/lib/github/repository-environment.js.map +1 -1
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js +7 -6
- package/lib/github/secret.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/neon/project.d.ts.map +1 -1
- package/lib/neon/project.js +3 -2
- package/lib/neon/project.js.map +1 -1
- package/lib/planetscale/api.d.ts +53 -0
- package/lib/planetscale/api.d.ts.map +1 -0
- package/lib/planetscale/api.js +84 -0
- package/lib/planetscale/api.js.map +1 -0
- package/lib/planetscale/branch.d.ts +129 -0
- package/lib/planetscale/branch.d.ts.map +1 -0
- package/lib/planetscale/branch.js +161 -0
- package/lib/planetscale/branch.js.map +1 -0
- package/lib/planetscale/database.d.ts +143 -0
- package/lib/planetscale/database.d.ts.map +1 -0
- package/lib/planetscale/database.js +184 -0
- package/lib/planetscale/database.js.map +1 -0
- package/lib/planetscale/index.d.ts +5 -0
- package/lib/planetscale/index.d.ts.map +1 -0
- package/lib/planetscale/index.js +5 -0
- package/lib/planetscale/index.js.map +1 -0
- package/lib/planetscale/utils.d.ts +15 -0
- package/lib/planetscale/utils.d.ts.map +1 -0
- package/lib/planetscale/utils.js +95 -0
- package/lib/planetscale/utils.js.map +1 -0
- package/lib/resource.js +7 -1
- package/lib/resource.js.map +1 -1
- package/lib/runtime/plugin.d.ts.map +1 -1
- package/lib/runtime/plugin.js +2 -1
- package/lib/runtime/plugin.js.map +1 -1
- package/lib/scope.d.ts +13 -2
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +53 -10
- package/lib/scope.js.map +1 -1
- package/lib/sentry/client-key.d.ts.map +1 -1
- package/lib/sentry/client-key.js +5 -4
- package/lib/sentry/client-key.js.map +1 -1
- package/lib/sentry/project.d.ts.map +1 -1
- package/lib/sentry/project.js +5 -4
- package/lib/sentry/project.js.map +1 -1
- package/lib/sentry/team.d.ts.map +1 -1
- package/lib/sentry/team.js +5 -4
- package/lib/sentry/team.js.map +1 -1
- package/lib/stripe/card.d.ts.map +1 -1
- package/lib/stripe/card.js +2 -1
- package/lib/stripe/card.js.map +1 -1
- package/lib/stripe/client.d.ts.map +1 -1
- package/lib/stripe/client.js +3 -2
- package/lib/stripe/client.js.map +1 -1
- package/lib/stripe/coupon.d.ts.map +1 -1
- package/lib/stripe/coupon.js +2 -1
- package/lib/stripe/coupon.js.map +1 -1
- package/lib/stripe/customer.d.ts.map +1 -1
- package/lib/stripe/customer.js +2 -1
- package/lib/stripe/customer.js.map +1 -1
- package/lib/stripe/entitlements-feature.d.ts.map +1 -1
- package/lib/stripe/entitlements-feature.js +2 -1
- package/lib/stripe/entitlements-feature.js.map +1 -1
- package/lib/stripe/file.d.ts.map +1 -1
- package/lib/stripe/file.js +2 -1
- package/lib/stripe/file.js.map +1 -1
- package/lib/stripe/meter.d.ts.map +1 -1
- package/lib/stripe/meter.js +4 -2
- package/lib/stripe/meter.js.map +1 -1
- package/lib/stripe/portal-configuration.d.ts.map +1 -1
- package/lib/stripe/portal-configuration.js +2 -1
- package/lib/stripe/portal-configuration.js.map +1 -1
- package/lib/stripe/price.d.ts.map +1 -1
- package/lib/stripe/price.js +2 -1
- package/lib/stripe/price.js.map +1 -1
- package/lib/stripe/product-feature.d.ts.map +1 -1
- package/lib/stripe/product-feature.js +2 -1
- package/lib/stripe/product-feature.js.map +1 -1
- package/lib/stripe/product.d.ts.map +1 -1
- package/lib/stripe/product.js +2 -1
- package/lib/stripe/product.js.map +1 -1
- package/lib/stripe/promotion-code.d.ts.map +1 -1
- package/lib/stripe/promotion-code.js +2 -1
- package/lib/stripe/promotion-code.js.map +1 -1
- package/lib/stripe/shipping-rate.d.ts.map +1 -1
- package/lib/stripe/shipping-rate.js +2 -1
- package/lib/stripe/shipping-rate.js.map +1 -1
- package/lib/stripe/tax-rate.d.ts.map +1 -1
- package/lib/stripe/tax-rate.js +2 -1
- package/lib/stripe/tax-rate.js.map +1 -1
- package/lib/stripe/webhook.d.ts.map +1 -1
- package/lib/stripe/webhook.js +3 -2
- package/lib/stripe/webhook.js.map +1 -1
- package/lib/test/bun.d.ts.map +1 -1
- package/lib/test/bun.js +6 -1
- package/lib/test/bun.js.map +1 -1
- package/lib/test/prune.js +7 -1
- package/lib/test/prune.js.map +1 -1
- package/lib/test/vitest.d.ts.map +1 -1
- package/lib/test/vitest.js +2 -0
- package/lib/test/vitest.js.map +1 -1
- package/lib/upstash/redis.d.ts.map +1 -1
- package/lib/upstash/redis.js +2 -1
- package/lib/upstash/redis.js.map +1 -1
- package/lib/util/async-queue.d.ts +35 -0
- package/lib/util/async-queue.d.ts.map +1 -0
- package/lib/util/async-queue.js +87 -0
- package/lib/util/async-queue.js.map +1 -0
- package/lib/util/cli.d.ts +37 -0
- package/lib/util/cli.d.ts.map +1 -0
- package/lib/util/cli.js +90 -0
- package/lib/util/cli.js.map +1 -0
- package/lib/util/ignore-matcher.d.ts +94 -0
- package/lib/util/ignore-matcher.d.ts.map +1 -0
- package/lib/util/ignore-matcher.js +616 -0
- package/lib/util/ignore-matcher.js.map +1 -0
- package/lib/util/logger.d.ts +3 -0
- package/lib/util/logger.d.ts.map +1 -0
- package/lib/util/logger.js +15 -0
- package/lib/util/logger.js.map +1 -0
- package/lib/util/retry.d.ts.map +1 -1
- package/lib/util/retry.js +0 -1
- package/lib/util/retry.js.map +1 -1
- package/lib/util/safe-fetch.d.ts.map +1 -1
- package/lib/util/safe-fetch.js +2 -1
- package/lib/util/safe-fetch.js.map +1 -1
- package/lib/util/telemetry/client.d.ts +32 -0
- package/lib/util/telemetry/client.d.ts.map +1 -0
- package/lib/util/telemetry/client.js +94 -0
- package/lib/util/telemetry/client.js.map +1 -0
- package/lib/util/telemetry/constants.d.ts +4 -0
- package/lib/util/telemetry/constants.d.ts.map +1 -0
- package/lib/util/telemetry/constants.js +8 -0
- package/lib/util/telemetry/constants.js.map +1 -0
- package/lib/util/telemetry/context.d.ts +15 -0
- package/lib/util/telemetry/context.d.ts.map +1 -0
- package/lib/util/telemetry/context.js +128 -0
- package/lib/util/telemetry/context.js.map +1 -0
- package/lib/util/telemetry/index.d.ts +3 -0
- package/lib/util/telemetry/index.d.ts.map +1 -0
- package/lib/util/telemetry/index.js +3 -0
- package/lib/util/telemetry/index.js.map +1 -0
- package/lib/util/telemetry/types.d.ts +59 -0
- package/lib/util/telemetry/types.d.ts.map +1 -0
- package/lib/util/telemetry/types.js +1 -0
- package/lib/util/telemetry/types.js.map +1 -0
- package/lib/util/xdg-paths.d.ts +9 -0
- package/lib/util/xdg-paths.d.ts.map +1 -0
- package/lib/util/xdg-paths.js +41 -0
- package/lib/util/xdg-paths.js.map +1 -0
- package/lib/vercel/project.d.ts.map +1 -1
- package/lib/vercel/project.js +2 -1
- package/lib/vercel/project.js.map +1 -1
- package/lib/web/astro.d.ts.map +1 -1
- package/lib/web/astro.js +2 -1
- package/lib/web/astro.js.map +1 -1
- package/lib/web/shadcn.d.ts.map +1 -1
- package/lib/web/shadcn.js +2 -1
- package/lib/web/shadcn.js.map +1 -1
- package/lib/web/vite.d.ts.map +1 -1
- package/lib/web/vite.js +3 -2
- package/lib/web/vite.js.map +1 -1
- package/lib/web/vitepress/dependencies.d.ts.map +1 -1
- package/lib/web/vitepress/dependencies.js +2 -1
- package/lib/web/vitepress/dependencies.js.map +1 -1
- package/lib/web/vitepress/vitepress.d.ts.map +1 -1
- package/lib/web/vitepress/vitepress.js +2 -1
- package/lib/web/vitepress/vitepress.js.map +1 -1
- package/package.json +7 -5
- package/src/ai/astro-file.ts +2 -1
- package/src/ai/client.ts +3 -2
- package/src/alchemy.ts +28 -3
- package/src/apply.ts +66 -5
- package/src/aws/control/client.ts +5 -5
- package/src/aws/control/properties.ts +48 -0
- package/src/aws/control/resource.ts +5 -3
- package/src/aws/control/types.ts +3988 -6301
- package/src/aws/function.ts +9 -8
- package/src/aws/oidc/oidc-provider.ts +3 -2
- package/src/aws/queue.ts +3 -2
- package/src/aws/role.ts +3 -1
- package/src/aws/ssm-parameter.ts +2 -1
- package/src/cloudflare/account-api-token.ts +3 -2
- package/src/cloudflare/ai-gateway.ts +4 -3
- package/src/cloudflare/ai.ts +21 -0
- package/src/cloudflare/api-error.ts +36 -0
- package/src/cloudflare/api.ts +9 -4
- package/src/cloudflare/assets.ts +30 -6
- package/src/cloudflare/astro.ts +176 -0
- package/src/cloudflare/auth.ts +3 -2
- package/src/cloudflare/bindings.ts +27 -0
- package/src/cloudflare/bound.ts +31 -17
- package/src/cloudflare/bucket.ts +15 -8
- package/src/cloudflare/bundle/bundle-worker.ts +2 -1
- package/src/cloudflare/bundle/nodejs-compat-mode.ts +2 -1
- package/src/cloudflare/custom-domain.ts +10 -9
- package/src/cloudflare/d1-database.ts +11 -10
- package/src/cloudflare/d1-export.ts +2 -1
- package/src/cloudflare/d1-import.ts +2 -1
- package/src/cloudflare/d1-migrations.ts +2 -1
- package/src/cloudflare/dns-records.ts +5 -4
- package/src/cloudflare/do-state-store/worker.ts +4 -0
- package/src/cloudflare/email-address.ts +203 -0
- package/src/cloudflare/email-catch-all.ts +248 -0
- package/src/cloudflare/email-routing.ts +230 -0
- package/src/cloudflare/email-rule.ts +322 -0
- package/src/cloudflare/hyperdrive.ts +5 -4
- package/src/cloudflare/images.ts +59 -0
- package/src/cloudflare/index.ts +9 -0
- package/src/cloudflare/kv-namespace.ts +2 -1
- package/src/cloudflare/pipeline.ts +38 -2
- package/src/cloudflare/queue-consumer.ts +2 -1
- package/src/cloudflare/queue.ts +0 -12
- package/src/cloudflare/route.ts +118 -18
- package/src/cloudflare/secret.ts +253 -0
- package/src/cloudflare/secrets-store.ts +420 -0
- package/src/cloudflare/sveltekit.ts +72 -0
- package/src/cloudflare/user.ts +2 -1
- package/src/cloudflare/vectorize-index.ts +6 -5
- package/src/cloudflare/vectorize-metadata-index.ts +2 -1
- package/src/cloudflare/website.ts +76 -66
- package/src/cloudflare/worker-assets.ts +95 -77
- package/src/cloudflare/worker-metadata.ts +14 -1
- package/src/cloudflare/worker.ts +76 -9
- package/src/cloudflare/wrangler.json.ts +42 -0
- package/src/cloudflare/zone.ts +79 -5
- package/src/destroy.ts +35 -17
- package/src/dns/godaddy.ts +3 -2
- package/src/dns/import-dns.ts +2 -1
- package/src/esbuild/bundle.ts +2 -1
- package/src/fs/copy-file.ts +2 -1
- package/src/fs/file.ts +3 -1
- package/src/github/client.ts +11 -10
- package/src/github/repository-environment.ts +5 -4
- package/src/github/secret.ts +7 -6
- package/src/index.ts +2 -1
- package/src/neon/project.ts +3 -2
- package/src/planetscale/api.ts +115 -0
- package/src/planetscale/branch.ts +352 -0
- package/src/planetscale/database.ts +394 -0
- package/src/planetscale/index.ts +4 -0
- package/src/planetscale/utils.ts +189 -0
- package/src/resource.ts +7 -1
- package/src/runtime/plugin.ts +2 -1
- package/src/scope.ts +64 -13
- package/src/sentry/client-key.ts +5 -4
- package/src/sentry/project.ts +5 -4
- package/src/sentry/team.ts +5 -4
- package/src/stripe/card.ts +2 -1
- package/src/stripe/client.ts +3 -2
- package/src/stripe/coupon.ts +2 -1
- package/src/stripe/customer.ts +2 -1
- package/src/stripe/entitlements-feature.ts +2 -1
- package/src/stripe/file.ts +2 -1
- package/src/stripe/meter.ts +4 -2
- package/src/stripe/portal-configuration.ts +2 -1
- package/src/stripe/price.ts +2 -1
- package/src/stripe/product-feature.ts +2 -1
- package/src/stripe/product.ts +2 -1
- package/src/stripe/promotion-code.ts +2 -1
- package/src/stripe/shipping-rate.ts +2 -1
- package/src/stripe/tax-rate.ts +2 -1
- package/src/stripe/webhook.ts +3 -2
- package/src/test/bun.ts +6 -1
- package/src/test/prune.ts +7 -1
- package/src/test/vitest.ts +2 -0
- package/src/upstash/redis.ts +2 -1
- package/src/util/async-queue.ts +97 -0
- package/src/util/cli.tsx +221 -0
- package/src/util/ignore-matcher.ts +873 -0
- package/src/util/logger.ts +17 -0
- package/src/util/retry.ts +0 -1
- package/src/util/safe-fetch.ts +2 -1
- package/src/util/telemetry/client.ts +127 -0
- package/src/util/telemetry/constants.ts +13 -0
- package/src/util/telemetry/context.ts +154 -0
- package/src/util/telemetry/index.ts +2 -0
- package/src/util/telemetry/types.ts +83 -0
- package/src/util/xdg-paths.ts +48 -0
- package/src/vercel/project.ts +2 -1
- package/src/web/astro.ts +2 -1
- package/src/web/shadcn.ts +2 -1
- package/src/web/vite.ts +3 -2
- package/src/web/vitepress/dependencies.ts +2 -1
- package/src/web/vitepress/vitepress.ts +2 -1
package/src/scope.ts
CHANGED
|
@@ -4,8 +4,14 @@ import { destroyAll } from "./destroy.ts";
|
|
|
4
4
|
import { FileSystemStateStore } from "./fs/file-system-state-store.ts";
|
|
5
5
|
import { ResourceID, type PendingResource } from "./resource.ts";
|
|
6
6
|
import type { StateStore, StateStoreType } from "./state.ts";
|
|
7
|
+
import {
|
|
8
|
+
createDummyLogger,
|
|
9
|
+
createLoggerInstance,
|
|
10
|
+
type LoggerApi,
|
|
11
|
+
} from "./util/cli.tsx";
|
|
12
|
+
import type { ITelemetryClient } from "./util/telemetry/client.ts";
|
|
7
13
|
|
|
8
|
-
export
|
|
14
|
+
export interface ScopeOptions {
|
|
9
15
|
appName?: string;
|
|
10
16
|
stage?: string;
|
|
11
17
|
parent?: Scope;
|
|
@@ -14,7 +20,8 @@ export type ScopeOptions = {
|
|
|
14
20
|
stateStore?: StateStoreType;
|
|
15
21
|
quiet?: boolean;
|
|
16
22
|
phase?: Phase;
|
|
17
|
-
|
|
23
|
+
telemetryClient?: ITelemetryClient;
|
|
24
|
+
}
|
|
18
25
|
|
|
19
26
|
// TODO: support browser
|
|
20
27
|
const DEFAULT_STAGE = process.env.ALCHEMY_STAGE ?? process.env.USER ?? "dev";
|
|
@@ -26,7 +33,14 @@ export class Scope {
|
|
|
26
33
|
public static globals: Scope[] = [];
|
|
27
34
|
|
|
28
35
|
public static get(): Scope | undefined {
|
|
29
|
-
|
|
36
|
+
const scope = Scope.storage.getStore();
|
|
37
|
+
if (!scope) {
|
|
38
|
+
if (Scope.globals.length > 0) {
|
|
39
|
+
return Scope.globals[Scope.globals.length - 1];
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return scope;
|
|
30
44
|
}
|
|
31
45
|
|
|
32
46
|
public static get root(): Scope {
|
|
@@ -35,12 +49,7 @@ export class Scope {
|
|
|
35
49
|
|
|
36
50
|
public static get current(): Scope {
|
|
37
51
|
const scope = Scope.get();
|
|
38
|
-
if (!scope)
|
|
39
|
-
if (Scope.globals.length > 0) {
|
|
40
|
-
return Scope.globals[Scope.globals.length - 1];
|
|
41
|
-
}
|
|
42
|
-
throw new Error("Not running within an Alchemy Scope");
|
|
43
|
-
}
|
|
52
|
+
if (!scope) throw new Error("Not running within an Alchemy Scope");
|
|
44
53
|
return scope;
|
|
45
54
|
}
|
|
46
55
|
|
|
@@ -55,9 +64,12 @@ export class Scope {
|
|
|
55
64
|
public readonly stateStore: StateStoreType;
|
|
56
65
|
public readonly quiet: boolean;
|
|
57
66
|
public readonly phase: Phase;
|
|
67
|
+
public readonly logger: LoggerApi;
|
|
68
|
+
public readonly telemetryClient: ITelemetryClient;
|
|
58
69
|
|
|
59
70
|
private isErrored = false;
|
|
60
71
|
private finalized = false;
|
|
72
|
+
private startedAt = performance.now();
|
|
61
73
|
|
|
62
74
|
private deferred: (() => Promise<any>)[] = [];
|
|
63
75
|
|
|
@@ -83,11 +95,24 @@ export class Scope {
|
|
|
83
95
|
}
|
|
84
96
|
this.phase = phase;
|
|
85
97
|
|
|
98
|
+
this.logger = this.quiet
|
|
99
|
+
? createDummyLogger()
|
|
100
|
+
: createLoggerInstance({
|
|
101
|
+
phase: this.phase,
|
|
102
|
+
stage: this.stage,
|
|
103
|
+
appName: this.appName ?? "",
|
|
104
|
+
});
|
|
105
|
+
|
|
86
106
|
this.stateStore =
|
|
87
107
|
options.stateStore ??
|
|
88
108
|
this.parent?.stateStore ??
|
|
89
109
|
((scope) => new FileSystemStateStore(scope));
|
|
90
110
|
this.state = this.stateStore(this);
|
|
111
|
+
if (!options.telemetryClient && !this.parent?.telemetryClient) {
|
|
112
|
+
throw new Error("Telemetry client is required");
|
|
113
|
+
}
|
|
114
|
+
this.telemetryClient =
|
|
115
|
+
options.telemetryClient ?? this.parent?.telemetryClient!;
|
|
91
116
|
}
|
|
92
117
|
|
|
93
118
|
public get root(): Scope {
|
|
@@ -119,12 +144,12 @@ export class Scope {
|
|
|
119
144
|
}
|
|
120
145
|
|
|
121
146
|
public fail() {
|
|
122
|
-
|
|
147
|
+
this.logger.error("Scope failed", this.chain.join("/"));
|
|
123
148
|
this.isErrored = true;
|
|
124
149
|
}
|
|
125
150
|
|
|
126
151
|
public async init() {
|
|
127
|
-
await this.state.init?.();
|
|
152
|
+
await Promise.all([this.state.init?.(), this.telemetryClient.ready]);
|
|
128
153
|
}
|
|
129
154
|
|
|
130
155
|
public async deinit() {
|
|
@@ -144,8 +169,23 @@ export class Scope {
|
|
|
144
169
|
return this.finalize();
|
|
145
170
|
}
|
|
146
171
|
|
|
172
|
+
/**
|
|
173
|
+
* The telemetry client for the root scope.
|
|
174
|
+
* This is used so that app-level hooks are only called once.
|
|
175
|
+
*/
|
|
176
|
+
private get rootTelemetryClient(): ITelemetryClient | null {
|
|
177
|
+
if (!this.parent) {
|
|
178
|
+
return this.telemetryClient;
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
147
183
|
public async finalize() {
|
|
148
184
|
if (this.phase === "read") {
|
|
185
|
+
this.rootTelemetryClient?.record({
|
|
186
|
+
event: "app.success",
|
|
187
|
+
elapsed: performance.now() - this.startedAt,
|
|
188
|
+
});
|
|
149
189
|
return;
|
|
150
190
|
}
|
|
151
191
|
if (this.finalized) {
|
|
@@ -155,7 +195,7 @@ export class Scope {
|
|
|
155
195
|
const last = Scope.globals.pop();
|
|
156
196
|
if (last !== this) {
|
|
157
197
|
throw new Error(
|
|
158
|
-
"Running in AsyncLocaStorage.enterWith
|
|
198
|
+
"Running in AsyncLocaStorage.enterWith emulation mode and attempted to finalize a global Scope that wasn't top of the stack",
|
|
159
199
|
);
|
|
160
200
|
}
|
|
161
201
|
}
|
|
@@ -176,9 +216,20 @@ export class Scope {
|
|
|
176
216
|
quiet: this.quiet,
|
|
177
217
|
strategy: "sequential",
|
|
178
218
|
});
|
|
219
|
+
this.rootTelemetryClient?.record({
|
|
220
|
+
event: "app.success",
|
|
221
|
+
elapsed: performance.now() - this.startedAt,
|
|
222
|
+
});
|
|
179
223
|
} else {
|
|
180
|
-
|
|
224
|
+
this.logger.warn("Scope is in error, skipping finalize");
|
|
225
|
+
this.rootTelemetryClient?.record({
|
|
226
|
+
event: "app.error",
|
|
227
|
+
error: new Error("Scope failed"),
|
|
228
|
+
elapsed: performance.now() - this.startedAt,
|
|
229
|
+
});
|
|
181
230
|
}
|
|
231
|
+
|
|
232
|
+
await this.rootTelemetryClient?.finalize();
|
|
182
233
|
}
|
|
183
234
|
|
|
184
235
|
/**
|
package/src/sentry/client-key.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Context } from "../context.ts";
|
|
2
2
|
import { Resource } from "../resource.ts";
|
|
3
3
|
import type { Secret } from "../secret.ts";
|
|
4
|
+
import { logger } from "../util/logger.ts";
|
|
4
5
|
import { SentryApi } from "./api.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -191,11 +192,11 @@ export const ClientKey = Resource(
|
|
|
191
192
|
`/projects/${props.organization}/${props.project}/keys/${this.output.id}/`,
|
|
192
193
|
);
|
|
193
194
|
if (!response.ok && response.status !== 404) {
|
|
194
|
-
|
|
195
|
+
logger.error("Error deleting client key:", response.statusText);
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
} catch (error) {
|
|
198
|
-
|
|
199
|
+
logger.error("Error deleting client key:", error);
|
|
199
200
|
}
|
|
200
201
|
return this.destroy();
|
|
201
202
|
} else {
|
|
@@ -221,7 +222,7 @@ export const ClientKey = Resource(
|
|
|
221
222
|
error.message.includes("already exists") &&
|
|
222
223
|
props.name
|
|
223
224
|
) {
|
|
224
|
-
|
|
225
|
+
logger.log(
|
|
225
226
|
`Client key '${props.name}' already exists, adopting it`,
|
|
226
227
|
);
|
|
227
228
|
// Find the existing key by name
|
|
@@ -268,7 +269,7 @@ export const ClientKey = Resource(
|
|
|
268
269
|
dynamicSdkLoaderOptions: data.dynamicSdkLoaderOptions,
|
|
269
270
|
});
|
|
270
271
|
} catch (error) {
|
|
271
|
-
|
|
272
|
+
logger.error("Error creating/updating client key:", error);
|
|
272
273
|
throw error;
|
|
273
274
|
}
|
|
274
275
|
}
|
package/src/sentry/project.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Context } from "../context.ts";
|
|
2
2
|
import { Resource } from "../resource.ts";
|
|
3
3
|
import type { Secret } from "../secret.ts";
|
|
4
|
+
import { logger } from "../util/logger.ts";
|
|
4
5
|
import { SentryApi } from "./api.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -293,11 +294,11 @@ export const Project = Resource(
|
|
|
293
294
|
`/projects/${props.organization}/${this.output.slug || this.output.id}/`,
|
|
294
295
|
);
|
|
295
296
|
if (!response.ok && response.status !== 404) {
|
|
296
|
-
|
|
297
|
+
logger.error("Error deleting project:", response.statusText);
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
300
|
} catch (error) {
|
|
300
|
-
|
|
301
|
+
logger.error("Error deleting project:", error);
|
|
301
302
|
}
|
|
302
303
|
return this.destroy();
|
|
303
304
|
} else {
|
|
@@ -322,7 +323,7 @@ export const Project = Resource(
|
|
|
322
323
|
error instanceof Error &&
|
|
323
324
|
error.message.includes("already exists")
|
|
324
325
|
) {
|
|
325
|
-
|
|
326
|
+
logger.log(
|
|
326
327
|
`Project '${props.slug || props.name}' already exists, adopting it`,
|
|
327
328
|
);
|
|
328
329
|
// Find the existing project by slug
|
|
@@ -391,7 +392,7 @@ export const Project = Resource(
|
|
|
391
392
|
latestDeploys: data.latestDeploys,
|
|
392
393
|
});
|
|
393
394
|
} catch (error) {
|
|
394
|
-
|
|
395
|
+
logger.error("Error creating/updating project:", error);
|
|
395
396
|
throw error;
|
|
396
397
|
}
|
|
397
398
|
}
|
package/src/sentry/team.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Context } from "../context.ts";
|
|
2
2
|
import { Resource } from "../resource.ts";
|
|
3
3
|
import type { Secret } from "../secret.ts";
|
|
4
|
+
import { logger } from "../util/logger.ts";
|
|
4
5
|
import { SentryApi } from "./api.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -138,11 +139,11 @@ export const Team = Resource(
|
|
|
138
139
|
`/teams/${props.organization}/${this.output.slug || this.output.id}/`,
|
|
139
140
|
);
|
|
140
141
|
if (!response.ok && response.status !== 404) {
|
|
141
|
-
|
|
142
|
+
logger.error("Error deleting team:", response.statusText);
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
} catch (error) {
|
|
145
|
-
|
|
146
|
+
logger.error("Error deleting team:", error);
|
|
146
147
|
}
|
|
147
148
|
return this.destroy();
|
|
148
149
|
} else {
|
|
@@ -167,7 +168,7 @@ export const Team = Resource(
|
|
|
167
168
|
error instanceof Error &&
|
|
168
169
|
error.message.includes("already exists")
|
|
169
170
|
) {
|
|
170
|
-
|
|
171
|
+
logger.log(
|
|
171
172
|
`Team '${props.slug || props.name}' already exists, adopting it`,
|
|
172
173
|
);
|
|
173
174
|
// Find the existing team by slug
|
|
@@ -209,7 +210,7 @@ export const Team = Resource(
|
|
|
209
210
|
avatar: data.avatar,
|
|
210
211
|
});
|
|
211
212
|
} catch (error) {
|
|
212
|
-
|
|
213
|
+
logger.error("Error creating/updating team:", error);
|
|
213
214
|
throw error;
|
|
214
215
|
}
|
|
215
216
|
}
|
package/src/stripe/card.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -313,7 +314,7 @@ export const Card = Resource(
|
|
|
313
314
|
tokenizationMethod: card.tokenization_method || undefined,
|
|
314
315
|
});
|
|
315
316
|
} catch (error) {
|
|
316
|
-
|
|
317
|
+
logger.error("Error creating/updating card:", error);
|
|
317
318
|
throw error;
|
|
318
319
|
}
|
|
319
320
|
},
|
package/src/stripe/client.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Stripe from "stripe";
|
|
2
2
|
import type { Secret } from "../secret.ts";
|
|
3
3
|
import { withExponentialBackoff } from "../util/retry.ts";
|
|
4
|
+
import { logger } from "../util/logger.ts";
|
|
4
5
|
|
|
5
6
|
export interface StripeClientOptions {
|
|
6
7
|
apiKey?: Secret | string;
|
|
@@ -34,13 +35,13 @@ export function handleStripeDeleteError(
|
|
|
34
35
|
resourceId?: string,
|
|
35
36
|
): void {
|
|
36
37
|
if (error?.code === "resource_missing" || error?.status === 404) {
|
|
37
|
-
|
|
38
|
+
logger.log(
|
|
38
39
|
`${resourceType} ${resourceId || "unknown"} not found during deletion (already deleted)`,
|
|
39
40
|
);
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
logger.error(
|
|
44
45
|
`Error deleting ${resourceType} ${resourceId || "unknown"}:`,
|
|
45
46
|
error,
|
|
46
47
|
);
|
package/src/stripe/coupon.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -273,7 +274,7 @@ export const Coupon = Resource(
|
|
|
273
274
|
livemode: coupon.livemode,
|
|
274
275
|
});
|
|
275
276
|
} catch (error) {
|
|
276
|
-
|
|
277
|
+
logger.error("Error creating/updating coupon:", error);
|
|
277
278
|
throw error;
|
|
278
279
|
}
|
|
279
280
|
},
|
package/src/stripe/customer.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import { createStripeClient, handleStripeDeleteError } from "./client.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -521,7 +522,7 @@ export const Customer = Resource(
|
|
|
521
522
|
taxIds: customer.tax_ids || undefined,
|
|
522
523
|
});
|
|
523
524
|
} catch (error) {
|
|
524
|
-
|
|
525
|
+
logger.error("Error creating/updating customer:", error);
|
|
525
526
|
throw error;
|
|
526
527
|
}
|
|
527
528
|
},
|
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import { createStripeClient, isStripeConflictError } from "./client.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -162,7 +163,7 @@ export const EntitlementsFeature = Resource(
|
|
|
162
163
|
livemode: feature.livemode,
|
|
163
164
|
});
|
|
164
165
|
} catch (error) {
|
|
165
|
-
|
|
166
|
+
logger.error("Error creating/updating entitlements feature:", error);
|
|
166
167
|
throw error;
|
|
167
168
|
}
|
|
168
169
|
},
|
package/src/stripe/file.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import { createStripeClient, isStripeConflictError } from "./client.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -212,7 +213,7 @@ export const File = Resource(
|
|
|
212
213
|
livemode: true,
|
|
213
214
|
});
|
|
214
215
|
} catch (error) {
|
|
215
|
-
|
|
216
|
+
logger.error("Error creating/retrieving file:", error);
|
|
216
217
|
throw error;
|
|
217
218
|
}
|
|
218
219
|
},
|
package/src/stripe/meter.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import { createStripeClient, isStripeConflictError } from "./client.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -274,7 +275,7 @@ export const Meter = Resource(
|
|
|
274
275
|
props.status === "active" &&
|
|
275
276
|
existingStripeMeter.status === "inactive"
|
|
276
277
|
) {
|
|
277
|
-
|
|
278
|
+
logger.log(`Reactivating Stripe Meter ${currentOutputId}.`);
|
|
278
279
|
stripeAPIResponse =
|
|
279
280
|
await stripe.billing.meters.reactivate(currentOutputId);
|
|
280
281
|
} else {
|
|
@@ -301,6 +302,7 @@ export const Meter = Resource(
|
|
|
301
302
|
try {
|
|
302
303
|
stripeAPIResponse = await stripe.billing.meters.create(createParams);
|
|
303
304
|
} catch (error) {
|
|
305
|
+
logger.warn("Error creating/updating meter:", error);
|
|
304
306
|
if (isStripeConflictError(error) && props.adopt) {
|
|
305
307
|
throw new Error(
|
|
306
308
|
"Meter adoption is not supported - meters cannot be uniquely identified for adoption",
|
|
@@ -319,7 +321,7 @@ export const Meter = Resource(
|
|
|
319
321
|
stripeAPIResponse.id,
|
|
320
322
|
);
|
|
321
323
|
} else if (props.status && props.status !== stripeAPIResponse.status) {
|
|
322
|
-
|
|
324
|
+
logger.warn(
|
|
323
325
|
`Meter ${stripeAPIResponse.id} created with status ${stripeAPIResponse.status} but requested ${props.status}. Ensure this is intended.`,
|
|
324
326
|
);
|
|
325
327
|
}
|
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -602,7 +603,7 @@ export const PortalConfiguration = Resource(
|
|
|
602
603
|
updated: configuration.updated,
|
|
603
604
|
});
|
|
604
605
|
} catch (error) {
|
|
605
|
-
|
|
606
|
+
logger.error("Error creating/updating portal configuration:", error);
|
|
606
607
|
throw error;
|
|
607
608
|
}
|
|
608
609
|
},
|
package/src/stripe/price.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import { createStripeClient, handleStripeDeleteError } from "./client.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -329,7 +330,7 @@ export const Price = Resource(
|
|
|
329
330
|
lookupKey: price.lookup_key || undefined,
|
|
330
331
|
});
|
|
331
332
|
} catch (error) {
|
|
332
|
-
|
|
333
|
+
logger.error("Error creating/updating price:", error);
|
|
333
334
|
throw error;
|
|
334
335
|
}
|
|
335
336
|
},
|
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -143,7 +144,7 @@ export const ProductFeature = Resource(
|
|
|
143
144
|
livemode: productFeature.livemode,
|
|
144
145
|
});
|
|
145
146
|
} catch (error) {
|
|
146
|
-
|
|
147
|
+
logger.error("Error creating product feature:", error);
|
|
147
148
|
throw error;
|
|
148
149
|
}
|
|
149
150
|
},
|
package/src/stripe/product.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import { createStripeClient, handleStripeDeleteError } from "./client.ts";
|
|
6
7
|
|
|
7
8
|
type ProductType = Stripe.Product.Type;
|
|
@@ -251,7 +252,7 @@ export const Product = Resource(
|
|
|
251
252
|
packageDimensions: product.package_dimensions || undefined,
|
|
252
253
|
});
|
|
253
254
|
} catch (error) {
|
|
254
|
-
|
|
255
|
+
logger.error("Error creating/updating product:", error);
|
|
255
256
|
throw error;
|
|
256
257
|
}
|
|
257
258
|
},
|
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -261,7 +262,7 @@ export const PromotionCode = Resource(
|
|
|
261
262
|
timesRedeemed: promotionCode.times_redeemed,
|
|
262
263
|
});
|
|
263
264
|
} catch (error) {
|
|
264
|
-
|
|
265
|
+
logger.error("Error creating/updating promotion code:", error);
|
|
265
266
|
throw error;
|
|
266
267
|
}
|
|
267
268
|
},
|
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -355,7 +356,7 @@ export const ShippingRate = Resource(
|
|
|
355
356
|
livemode: shippingRate.livemode,
|
|
356
357
|
});
|
|
357
358
|
} catch (error) {
|
|
358
|
-
|
|
359
|
+
logger.error("Error creating/updating shipping rate:", error);
|
|
359
360
|
throw error;
|
|
360
361
|
}
|
|
361
362
|
},
|
package/src/stripe/tax-rate.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -211,7 +212,7 @@ export const TaxRate = Resource(
|
|
|
211
212
|
livemode: taxRate.livemode,
|
|
212
213
|
});
|
|
213
214
|
} catch (error) {
|
|
214
|
-
|
|
215
|
+
logger.error("Error creating/updating tax rate:", error);
|
|
215
216
|
throw error;
|
|
216
217
|
}
|
|
217
218
|
},
|
package/src/stripe/webhook.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type Stripe from "stripe";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import {
|
|
6
7
|
createStripeClient,
|
|
7
8
|
handleStripeDeleteError,
|
|
@@ -251,7 +252,7 @@ export const WebhookEndpoint = Resource(
|
|
|
251
252
|
// For connect parameter, need to handle it separately if it exists
|
|
252
253
|
if (props.connect !== undefined) {
|
|
253
254
|
// Note: connect is specified at creation time and cannot be updated
|
|
254
|
-
|
|
255
|
+
logger.log(
|
|
255
256
|
"Note: 'connect' parameter will be applied at creation time only",
|
|
256
257
|
);
|
|
257
258
|
}
|
|
@@ -282,7 +283,7 @@ export const WebhookEndpoint = Resource(
|
|
|
282
283
|
status: webhook.status,
|
|
283
284
|
});
|
|
284
285
|
} catch (error) {
|
|
285
|
-
|
|
286
|
+
logger.error("Error creating/updating webhook:", error);
|
|
286
287
|
throw error;
|
|
287
288
|
}
|
|
288
289
|
},
|
package/src/test/bun.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { alchemy } from "../alchemy.ts";
|
|
|
6
6
|
import { DOStateStore } from "../cloudflare/index.ts";
|
|
7
7
|
import { Scope } from "../scope.ts";
|
|
8
8
|
import type { StateStoreType } from "../state.ts";
|
|
9
|
+
import { NoopTelemetryClient } from "../util/telemetry/index.ts";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Extend the Alchemy interface to include test functionality
|
|
@@ -116,7 +117,9 @@ type test = {
|
|
|
116
117
|
* ```
|
|
117
118
|
*/
|
|
118
119
|
export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
119
|
-
defaultOptions = defaultOptions ?? {
|
|
120
|
+
defaultOptions = defaultOptions ?? {
|
|
121
|
+
quiet: true,
|
|
122
|
+
};
|
|
120
123
|
if (
|
|
121
124
|
defaultOptions.stateStore === undefined &&
|
|
122
125
|
// process.env.CI &&
|
|
@@ -134,6 +137,7 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
134
137
|
// parent: globalTestScope,
|
|
135
138
|
stateStore: defaultOptions?.stateStore,
|
|
136
139
|
phase: "up",
|
|
140
|
+
telemetryClient: new NoopTelemetryClient(),
|
|
137
141
|
});
|
|
138
142
|
|
|
139
143
|
test.beforeAll = (fn: (scope: Scope) => Promise<void>) => {
|
|
@@ -177,6 +181,7 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
177
181
|
...spread(defaultOptions),
|
|
178
182
|
...spread(_options),
|
|
179
183
|
};
|
|
184
|
+
console.log("options", options);
|
|
180
185
|
|
|
181
186
|
const fn = typeof args[1] === "function" ? args[1] : args[2]!;
|
|
182
187
|
|
package/src/test/prune.ts
CHANGED
|
@@ -156,7 +156,13 @@ async function getDependencies(testFile: string): Promise<Set<string>> {
|
|
|
156
156
|
format: "esm",
|
|
157
157
|
bundle: true,
|
|
158
158
|
metafile: true,
|
|
159
|
-
external: [
|
|
159
|
+
external: [
|
|
160
|
+
"@cloudflare/workers-types",
|
|
161
|
+
"bun:test",
|
|
162
|
+
"vitest",
|
|
163
|
+
"@swc/*",
|
|
164
|
+
"react-devtools-core",
|
|
165
|
+
],
|
|
160
166
|
logLevel: "error",
|
|
161
167
|
});
|
|
162
168
|
|
package/src/test/vitest.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { alchemy } from "../alchemy.ts";
|
|
|
4
4
|
import { DOStateStore } from "../cloudflare/index.ts";
|
|
5
5
|
import { Scope } from "../scope.ts";
|
|
6
6
|
import type { StateStoreType } from "../state.ts";
|
|
7
|
+
import { NoopTelemetryClient } from "../util/telemetry/client.ts";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Extend the Alchemy interface to include test functionality
|
|
@@ -133,6 +134,7 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
133
134
|
scopeName: `${defaultOptions.prefix ? `${defaultOptions.prefix}-` : ""}${path.basename(meta.filename)}`,
|
|
134
135
|
stateStore: defaultOptions?.stateStore,
|
|
135
136
|
phase: "up",
|
|
137
|
+
telemetryClient: new NoopTelemetryClient(),
|
|
136
138
|
});
|
|
137
139
|
|
|
138
140
|
test.beforeAll = (fn: (scope: Scope) => Promise<void>) => {
|
package/src/upstash/redis.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { alchemy } from "../alchemy.ts";
|
|
|
2
2
|
import type { Context } from "../context.ts";
|
|
3
3
|
import { Resource } from "../resource.ts";
|
|
4
4
|
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { logger } from "../util/logger.ts";
|
|
5
6
|
import { UpstashApi } from "./api.ts";
|
|
6
7
|
import { UpstashError } from "./error.ts";
|
|
7
8
|
|
|
@@ -366,7 +367,7 @@ export async function setRedisEviction(
|
|
|
366
367
|
);
|
|
367
368
|
|
|
368
369
|
if (!response.ok) {
|
|
369
|
-
|
|
370
|
+
logger.warn(
|
|
370
371
|
`API error updating eviction (status: ${response.status}): ${response.statusText}. (Eviction may already be set)`,
|
|
371
372
|
);
|
|
372
373
|
}
|