alchemy 0.25.0 → 0.26.1
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 +4 -3
- 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 +3 -2
- 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/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 +24 -2
- package/lib/cloudflare/bindings.d.ts.map +1 -1
- package/lib/cloudflare/bindings.js.map +1 -1
- package/lib/cloudflare/bound.d.ts +10 -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/dispatch-namespace.d.ts +94 -0
- package/lib/cloudflare/dispatch-namespace.d.ts.map +1 -0
- package/lib/cloudflare/dispatch-namespace.js +143 -0
- package/lib/cloudflare/dispatch-namespace.js.map +1 -0
- 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 +10 -0
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +10 -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 -67
- 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 +23 -1
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +43 -2
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +50 -11
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +21 -0
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +33 -0
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +4 -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 +10 -3
- 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 +6 -4
- 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 +4 -4
- package/src/aws/control/properties.ts +48 -0
- package/src/aws/control/resource.ts +3 -2
- 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/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 +29 -0
- package/src/cloudflare/bound.ts +38 -21
- 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/dispatch-namespace.ts +281 -0
- 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 +10 -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 -89
- package/src/cloudflare/worker-metadata.ts +20 -1
- package/src/cloudflare/worker.ts +116 -18
- package/src/cloudflare/wrangler.json.ts +63 -0
- package/src/cloudflare/zone.ts +4 -3
- 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 +14 -3
- 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
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { type CloudflareApiOptions } from "./api.ts";
|
|
4
|
+
import type { EmailAction, EmailMatcher } from "./email-rule.ts";
|
|
5
|
+
import type { Zone } from "./zone.ts";
|
|
6
|
+
/**
|
|
7
|
+
* Properties for configuring the catch-all email rule
|
|
8
|
+
*/
|
|
9
|
+
export interface EmailCatchAllProps extends CloudflareApiOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Zone ID or Zone resource where the catch-all rule will be configured
|
|
12
|
+
*/
|
|
13
|
+
zone: string | Zone;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the catch-all rule is enabled
|
|
16
|
+
*
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Name for the catch-all rule
|
|
22
|
+
*
|
|
23
|
+
* @default "Catch All"
|
|
24
|
+
*/
|
|
25
|
+
name?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Matchers for the catch-all rule (typically matches all emails)
|
|
28
|
+
* If not provided, defaults to matching all emails
|
|
29
|
+
*/
|
|
30
|
+
matchers?: EmailMatcher[];
|
|
31
|
+
/**
|
|
32
|
+
* Actions to take for emails that don't match other rules
|
|
33
|
+
*/
|
|
34
|
+
actions: EmailAction[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A catch-all email routing rule for a Cloudflare zone
|
|
38
|
+
*/
|
|
39
|
+
export interface EmailCatchAll extends Resource<"cloudflare::EmailCatchAll"> {
|
|
40
|
+
/**
|
|
41
|
+
* Zone ID where the catch-all rule is configured
|
|
42
|
+
*/
|
|
43
|
+
zoneId: string;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the catch-all rule is enabled
|
|
46
|
+
*/
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Rule name
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
/**
|
|
53
|
+
* Matchers for the catch-all rule
|
|
54
|
+
*/
|
|
55
|
+
matchers: EmailMatcher[];
|
|
56
|
+
/**
|
|
57
|
+
* Actions for the catch-all rule
|
|
58
|
+
*/
|
|
59
|
+
actions: EmailAction[];
|
|
60
|
+
/**
|
|
61
|
+
* Rule tag
|
|
62
|
+
*/
|
|
63
|
+
tag: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Configures a catch-all email routing rule that handles emails not matched by other rules.
|
|
67
|
+
* This rule is processed last and typically matches all emails that haven't been handled.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ## Forward all unmatched emails
|
|
71
|
+
*
|
|
72
|
+
* Set up a catch-all rule to forward any unmatched emails to an admin address.
|
|
73
|
+
*
|
|
74
|
+
* ```ts
|
|
75
|
+
* const catchAll = await EmailCatchAll("default-catchall", {
|
|
76
|
+
* zone: "example.com",
|
|
77
|
+
* enabled: true,
|
|
78
|
+
* actions: [
|
|
79
|
+
* {
|
|
80
|
+
* type: "forward",
|
|
81
|
+
* value: ["admin@company.com"]
|
|
82
|
+
* }
|
|
83
|
+
* ]
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ## Drop unmatched emails
|
|
89
|
+
*
|
|
90
|
+
* Configure catch-all to drop any emails that don't match specific rules.
|
|
91
|
+
*
|
|
92
|
+
* ```ts
|
|
93
|
+
* const catchAll = await EmailCatchAll("drop-catchall", {
|
|
94
|
+
* zone: "example.com",
|
|
95
|
+
* enabled: true,
|
|
96
|
+
* actions: [
|
|
97
|
+
* {
|
|
98
|
+
* type: "drop"
|
|
99
|
+
* }
|
|
100
|
+
* ]
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ## Process with Worker
|
|
106
|
+
*
|
|
107
|
+
* Use a Worker to handle all unmatched emails for custom processing.
|
|
108
|
+
*
|
|
109
|
+
* ```ts
|
|
110
|
+
* const catchAll = await EmailCatchAll("worker-catchall", {
|
|
111
|
+
* zone: "example.com",
|
|
112
|
+
* enabled: true,
|
|
113
|
+
* actions: [
|
|
114
|
+
* {
|
|
115
|
+
* type: "worker",
|
|
116
|
+
* value: ["email-processor"]
|
|
117
|
+
* }
|
|
118
|
+
* ]
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export declare const EmailCatchAll: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<EmailCatchAll>, _id: string, props: EmailCatchAllProps) => Promise<EmailCatchAll>);
|
|
123
|
+
//# sourceMappingURL=email-catch-all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Resource } from "../resource.js";
|
|
2
|
+
import { createCloudflareApi } from "./api.js";
|
|
3
|
+
/**
|
|
4
|
+
* Configures a catch-all email routing rule that handles emails not matched by other rules.
|
|
5
|
+
* This rule is processed last and typically matches all emails that haven't been handled.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ## Forward all unmatched emails
|
|
9
|
+
*
|
|
10
|
+
* Set up a catch-all rule to forward any unmatched emails to an admin address.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* const catchAll = await EmailCatchAll("default-catchall", {
|
|
14
|
+
* zone: "example.com",
|
|
15
|
+
* enabled: true,
|
|
16
|
+
* actions: [
|
|
17
|
+
* {
|
|
18
|
+
* type: "forward",
|
|
19
|
+
* value: ["admin@company.com"]
|
|
20
|
+
* }
|
|
21
|
+
* ]
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ## Drop unmatched emails
|
|
27
|
+
*
|
|
28
|
+
* Configure catch-all to drop any emails that don't match specific rules.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const catchAll = await EmailCatchAll("drop-catchall", {
|
|
32
|
+
* zone: "example.com",
|
|
33
|
+
* enabled: true,
|
|
34
|
+
* actions: [
|
|
35
|
+
* {
|
|
36
|
+
* type: "drop"
|
|
37
|
+
* }
|
|
38
|
+
* ]
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ## Process with Worker
|
|
44
|
+
*
|
|
45
|
+
* Use a Worker to handle all unmatched emails for custom processing.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* const catchAll = await EmailCatchAll("worker-catchall", {
|
|
49
|
+
* zone: "example.com",
|
|
50
|
+
* enabled: true,
|
|
51
|
+
* actions: [
|
|
52
|
+
* {
|
|
53
|
+
* type: "worker",
|
|
54
|
+
* value: ["email-processor"]
|
|
55
|
+
* }
|
|
56
|
+
* ]
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export const EmailCatchAll = Resource("cloudflare::EmailCatchAll", async function (_id, props) {
|
|
61
|
+
const api = await createCloudflareApi(props);
|
|
62
|
+
const zoneId = typeof props.zone === "string" ? props.zone : props.zone.id;
|
|
63
|
+
if (this.phase === "delete") {
|
|
64
|
+
// Disable the catch-all rule by setting enabled to false
|
|
65
|
+
const disablePayload = {
|
|
66
|
+
enabled: false,
|
|
67
|
+
name: "Catch All",
|
|
68
|
+
matchers: [{ type: "all" }],
|
|
69
|
+
actions: [{ type: "drop" }],
|
|
70
|
+
};
|
|
71
|
+
const response = await api.put(`/zones/${zoneId}/email/routing/rules/catch_all`, disablePayload);
|
|
72
|
+
if (!response.ok && response.status !== 404) {
|
|
73
|
+
throw new Error(`Failed to disable catch-all rule: ${response.statusText}`);
|
|
74
|
+
}
|
|
75
|
+
return this.destroy();
|
|
76
|
+
}
|
|
77
|
+
// Get current catch-all rule state
|
|
78
|
+
const _getResponse = await api.get(`/zones/${zoneId}/email/routing/rules/catch_all`);
|
|
79
|
+
if (this.phase === "update" && this.output) {
|
|
80
|
+
// Update the catch-all rule
|
|
81
|
+
const updatePayload = {
|
|
82
|
+
enabled: props.enabled ?? true,
|
|
83
|
+
name: props.name || "Catch All",
|
|
84
|
+
matchers: props.matchers || [{ type: "all" }],
|
|
85
|
+
actions: props.actions,
|
|
86
|
+
};
|
|
87
|
+
const response = await api.put(`/zones/${zoneId}/email/routing/rules/catch_all`, updatePayload);
|
|
88
|
+
if (!response.ok) {
|
|
89
|
+
const errorBody = await response.text();
|
|
90
|
+
throw new Error(`Failed to update catch-all rule: ${response.statusText}\nResponse: ${errorBody}`);
|
|
91
|
+
}
|
|
92
|
+
const result = (await response.json());
|
|
93
|
+
return this({
|
|
94
|
+
zoneId,
|
|
95
|
+
enabled: result.result.enabled,
|
|
96
|
+
name: result.result.name,
|
|
97
|
+
matchers: result.result.matchers,
|
|
98
|
+
actions: result.result.actions,
|
|
99
|
+
tag: result.result.tag,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// Create or update catch-all rule
|
|
103
|
+
const catchAllPayload = {
|
|
104
|
+
enabled: props.enabled ?? true,
|
|
105
|
+
name: props.name || "Catch All",
|
|
106
|
+
matchers: props.matchers || [{ type: "all" }],
|
|
107
|
+
actions: props.actions,
|
|
108
|
+
};
|
|
109
|
+
const response = await api.put(`/zones/${zoneId}/email/routing/rules/catch_all`, catchAllPayload);
|
|
110
|
+
if (!response.ok) {
|
|
111
|
+
const errorBody = await response.text();
|
|
112
|
+
throw new Error(`Failed to configure catch-all rule: ${response.statusText}\nResponse: ${errorBody}`);
|
|
113
|
+
}
|
|
114
|
+
const result = (await response.json());
|
|
115
|
+
return this({
|
|
116
|
+
zoneId,
|
|
117
|
+
enabled: result.result.enabled,
|
|
118
|
+
name: result.result.name,
|
|
119
|
+
matchers: result.result.matchers,
|
|
120
|
+
actions: result.result.actions,
|
|
121
|
+
tag: result.result.tag,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=email-catch-all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-catch-all.js","sourceRoot":"","sources":["../../src/cloudflare/email-catch-all.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAA6B,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAsF1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CACnC,2BAA2B,EAC3B,KAAK,WAEH,GAAW,EACX,KAAyB;IAEzB,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,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AAC;IAED,MAAM,MAAM,GACV,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAgD,CAAC;IAEzE,OAAO,IAAI,CAAC;QACV,MAAM;QACN,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO;QAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;QACxB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ;QAChC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO;QAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG;KACvB,CAAC,CAAC;AACL,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { type CloudflareApiOptions } from "./api.ts";
|
|
4
|
+
import type { Zone } from "./zone.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Properties for configuring email routing on a zone
|
|
7
|
+
*/
|
|
8
|
+
export interface EmailRoutingProps extends CloudflareApiOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Zone ID or Zone resource where email routing will be configured
|
|
11
|
+
*/
|
|
12
|
+
zone: string | Zone;
|
|
13
|
+
/**
|
|
14
|
+
* Whether email routing should be enabled
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Skip the DNS setup wizard when enabling email routing
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
skipWizard?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Email routing configuration for a Cloudflare zone
|
|
28
|
+
*/
|
|
29
|
+
export interface EmailRouting extends Resource<"cloudflare::EmailRouting"> {
|
|
30
|
+
/**
|
|
31
|
+
* Zone ID where email routing is configured
|
|
32
|
+
*/
|
|
33
|
+
zoneId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether email routing is enabled
|
|
36
|
+
*/
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Zone name
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* When email routing was created
|
|
44
|
+
*/
|
|
45
|
+
created: string;
|
|
46
|
+
/**
|
|
47
|
+
* When email routing was last modified
|
|
48
|
+
*/
|
|
49
|
+
modified: string;
|
|
50
|
+
/**
|
|
51
|
+
* Zone tag
|
|
52
|
+
*/
|
|
53
|
+
tag: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Configures email routing for a Cloudflare zone, allowing emails sent to the zone's domain
|
|
57
|
+
* to be routed according to defined rules.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ## Enable email routing for a zone
|
|
61
|
+
*
|
|
62
|
+
* Enable email routing for your domain to start receiving and routing emails.
|
|
63
|
+
*
|
|
64
|
+
* ```ts
|
|
65
|
+
* const emailRouting = await EmailRouting("example.com-routing", {
|
|
66
|
+
* zone: "example.com",
|
|
67
|
+
* enabled: true
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ## Use with existing Zone resource
|
|
73
|
+
*
|
|
74
|
+
* Configure email routing using an existing Zone resource reference.
|
|
75
|
+
*
|
|
76
|
+
* ```ts
|
|
77
|
+
* const zone = await Zone("my-zone", {
|
|
78
|
+
* name: "example.com"
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* const emailRouting = await EmailRouting("example.com-routing", {
|
|
82
|
+
* zone: zone,
|
|
83
|
+
* enabled: true,
|
|
84
|
+
* skipWizard: true
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare const EmailRouting: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<EmailRouting>, _id: string, props: EmailRoutingProps) => Promise<EmailRouting>);
|
|
89
|
+
//# sourceMappingURL=email-routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-routing.d.ts","sourceRoot":"","sources":["../../src/cloudflare/email-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,UAAU,CAAC;AAE1E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAatC;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ,CAAC,0BAA0B,CAAC;IACxE;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,YAAY,yFAGf,OAAO,CAAC,YAAY,CAAC,OACtB,MAAM,SACJ,iBAAiB,KACvB,OAAO,CAAC,YAAY,CAAC,CAiHzB,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Resource } from "../resource.js";
|
|
2
|
+
import { handleApiError } from "./api-error.js";
|
|
3
|
+
import { createCloudflareApi } from "./api.js";
|
|
4
|
+
/**
|
|
5
|
+
* Configures email routing for a Cloudflare zone, allowing emails sent to the zone's domain
|
|
6
|
+
* to be routed according to defined rules.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ## Enable email routing for a zone
|
|
10
|
+
*
|
|
11
|
+
* Enable email routing for your domain to start receiving and routing emails.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const emailRouting = await EmailRouting("example.com-routing", {
|
|
15
|
+
* zone: "example.com",
|
|
16
|
+
* enabled: true
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ## Use with existing Zone resource
|
|
22
|
+
*
|
|
23
|
+
* Configure email routing using an existing Zone resource reference.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* const zone = await Zone("my-zone", {
|
|
27
|
+
* name: "example.com"
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* const emailRouting = await EmailRouting("example.com-routing", {
|
|
31
|
+
* zone: zone,
|
|
32
|
+
* enabled: true,
|
|
33
|
+
* skipWizard: true
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const EmailRouting = Resource("cloudflare::EmailRouting", async function (_id, props) {
|
|
38
|
+
const api = await createCloudflareApi(props);
|
|
39
|
+
const zoneId = typeof props.zone === "string" ? props.zone : props.zone.id;
|
|
40
|
+
if (this.phase === "delete") {
|
|
41
|
+
// Disable email routing DNS
|
|
42
|
+
const response = await api.delete(`/zones/${zoneId}/email/routing/dns`);
|
|
43
|
+
if (!response.ok && response.status !== 404) {
|
|
44
|
+
await handleApiError(response, "disabling", "email routing DNS");
|
|
45
|
+
}
|
|
46
|
+
return this.destroy();
|
|
47
|
+
}
|
|
48
|
+
if (this.phase === "update" && this.output) {
|
|
49
|
+
// Check if we need to update the enabled state
|
|
50
|
+
const currentEnabled = this.output.enabled;
|
|
51
|
+
const desiredEnabled = props.enabled ?? true;
|
|
52
|
+
if (currentEnabled !== desiredEnabled) {
|
|
53
|
+
if (desiredEnabled) {
|
|
54
|
+
// Enable email routing DNS
|
|
55
|
+
const enablePayload = {
|
|
56
|
+
enabled: true,
|
|
57
|
+
...(props.skipWizard && { skip_wizard: props.skipWizard }),
|
|
58
|
+
};
|
|
59
|
+
const response = await api.post(`/zones/${zoneId}/email/routing/dns`, enablePayload);
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
await handleApiError(response, "enabling", "email routing DNS");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
// Disable email routing DNS
|
|
66
|
+
const response = await api.delete(`/zones/${zoneId}/email/routing/dns`);
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
await handleApiError(response, "disabling", "email routing DNS");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Get current state
|
|
73
|
+
const getResponse = await api.get(`/zones/${zoneId}/email/routing/dns`);
|
|
74
|
+
if (!getResponse.ok) {
|
|
75
|
+
if (getResponse.status === 404) {
|
|
76
|
+
throw new Error("Email routing DNS is not configured for this zone");
|
|
77
|
+
}
|
|
78
|
+
await handleApiError(getResponse, "getting", "email routing DNS settings");
|
|
79
|
+
}
|
|
80
|
+
const result = (await getResponse.json());
|
|
81
|
+
return this({
|
|
82
|
+
zoneId,
|
|
83
|
+
enabled: result.result.enabled,
|
|
84
|
+
name: result.result.name,
|
|
85
|
+
created: result.result.created,
|
|
86
|
+
modified: result.result.modified,
|
|
87
|
+
tag: result.result.tag,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// Create/Enable email routing
|
|
91
|
+
const enabled = props.enabled ?? true;
|
|
92
|
+
if (enabled) {
|
|
93
|
+
const enablePayload = {
|
|
94
|
+
enabled: true,
|
|
95
|
+
...(props.skipWizard && { skip_wizard: props.skipWizard }),
|
|
96
|
+
};
|
|
97
|
+
const response = await api.post(`/zones/${zoneId}/email/routing/dns`, enablePayload);
|
|
98
|
+
if (!response.ok) {
|
|
99
|
+
await handleApiError(response, "enabling", "email routing DNS");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Get the current state
|
|
103
|
+
const getResponse = await api.get(`/zones/${zoneId}/email/routing/dns`);
|
|
104
|
+
if (!getResponse.ok) {
|
|
105
|
+
if (getResponse.status === 404) {
|
|
106
|
+
throw new Error("Email routing DNS is not configured. Set enabled: true to configure it.");
|
|
107
|
+
}
|
|
108
|
+
await handleApiError(getResponse, "getting", "email routing DNS settings");
|
|
109
|
+
}
|
|
110
|
+
const result = (await getResponse.json());
|
|
111
|
+
return this({
|
|
112
|
+
zoneId,
|
|
113
|
+
enabled: result.result.enabled,
|
|
114
|
+
name: result.result.name,
|
|
115
|
+
created: result.result.created,
|
|
116
|
+
modified: result.result.modified,
|
|
117
|
+
tag: result.result.tag,
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=email-routing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-routing.js","sourceRoot":"","sources":["../../src/cloudflare/email-routing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA6B,mBAAmB,EAAE,MAAM,UAAU,CAAC;AA0E1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAClC,0BAA0B,EAC1B,KAAK,WAEH,GAAW,EACX,KAAwB;IAExB,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAE3E,IAA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EAAE,EAAE,CAAC;YACjB,MAAM,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IAED,wBAAwB;IACxB,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,UAAU,MAAM,oBAAoB,CAAC,CAAC;IACxE,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;QACpB,IAAI,WAAW,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QACD,MAAM,cAAc,CAClB,WAAW,EACX,SAAS,EACT,4BAA4B,CAC7B,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GACV,CAAC,MAAM,WAAW,CAAC,IAAI,EAAE,CAA+C,CAAC;IAE3E,OAAO,IAAI,CAAC;QACV,MAAM;QACN,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO;QAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;QACxB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO;QAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ;QAChC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG;KACvB,CAAC,CAAC;AACL,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { type CloudflareApiOptions } from "./api.ts";
|
|
4
|
+
import type { Zone } from "./zone.ts";
|
|
5
|
+
/**
|
|
6
|
+
* Email routing matcher - defines what emails to match
|
|
7
|
+
*/
|
|
8
|
+
export interface EmailMatcher {
|
|
9
|
+
/**
|
|
10
|
+
* Type of matcher
|
|
11
|
+
* - "literal": Exact string match
|
|
12
|
+
* - "all": Matches all emails
|
|
13
|
+
*/
|
|
14
|
+
type: "literal" | "all";
|
|
15
|
+
/**
|
|
16
|
+
* Field to match against (required for literal matchers)
|
|
17
|
+
*/
|
|
18
|
+
field?: "to" | "from" | "subject";
|
|
19
|
+
/**
|
|
20
|
+
* Value to match (required for literal matchers)
|
|
21
|
+
*/
|
|
22
|
+
value?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Email routing action - defines what to do with matched emails
|
|
26
|
+
*/
|
|
27
|
+
export interface EmailAction {
|
|
28
|
+
/**
|
|
29
|
+
* Type of action to take
|
|
30
|
+
* - "forward": Forward email to destination addresses
|
|
31
|
+
* - "worker": Process email with a Cloudflare Worker
|
|
32
|
+
* - "drop": Drop/reject the email
|
|
33
|
+
*/
|
|
34
|
+
type: "forward" | "worker" | "drop";
|
|
35
|
+
/**
|
|
36
|
+
* Action configuration
|
|
37
|
+
* - For "forward": Array of destination email addresses
|
|
38
|
+
* - For "worker": Worker script name
|
|
39
|
+
* - For "drop": Not used
|
|
40
|
+
*/
|
|
41
|
+
value?: string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Properties for creating an email routing rule
|
|
45
|
+
*/
|
|
46
|
+
export interface EmailRuleProps extends CloudflareApiOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Zone ID or Zone resource where the rule will be created
|
|
49
|
+
*/
|
|
50
|
+
zone: string | Zone;
|
|
51
|
+
/**
|
|
52
|
+
* Name for the email routing rule
|
|
53
|
+
*/
|
|
54
|
+
name?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the rule is enabled
|
|
57
|
+
*
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
enabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Rule priority - lower numbers have higher priority
|
|
63
|
+
* Rules are evaluated in priority order
|
|
64
|
+
*
|
|
65
|
+
* @default 0
|
|
66
|
+
*/
|
|
67
|
+
priority?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Array of matchers that define which emails this rule applies to
|
|
70
|
+
*/
|
|
71
|
+
matchers: EmailMatcher[];
|
|
72
|
+
/**
|
|
73
|
+
* Array of actions to take when emails match this rule
|
|
74
|
+
*/
|
|
75
|
+
actions: EmailAction[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* An email routing rule for a Cloudflare zone
|
|
79
|
+
*/
|
|
80
|
+
export interface EmailRule extends Resource<"cloudflare::EmailRule"> {
|
|
81
|
+
/**
|
|
82
|
+
* Zone ID where the rule is created
|
|
83
|
+
*/
|
|
84
|
+
zoneId: string;
|
|
85
|
+
/**
|
|
86
|
+
* Rule ID
|
|
87
|
+
*/
|
|
88
|
+
ruleId: string;
|
|
89
|
+
/**
|
|
90
|
+
* Rule name
|
|
91
|
+
*/
|
|
92
|
+
name: string;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the rule is enabled
|
|
95
|
+
*/
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Rule priority
|
|
99
|
+
*/
|
|
100
|
+
priority: number;
|
|
101
|
+
/**
|
|
102
|
+
* Matchers for this rule
|
|
103
|
+
*/
|
|
104
|
+
matchers: EmailMatcher[];
|
|
105
|
+
/**
|
|
106
|
+
* Actions for this rule
|
|
107
|
+
*/
|
|
108
|
+
actions: EmailAction[];
|
|
109
|
+
/**
|
|
110
|
+
* Rule tag
|
|
111
|
+
*/
|
|
112
|
+
tag: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates email routing rules that define how emails sent to your domain are processed.
|
|
116
|
+
* Rules are evaluated in priority order (lower number = higher priority).
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ## Forward emails to a specific address
|
|
120
|
+
*
|
|
121
|
+
* Forward all emails sent to info@example.com to a destination address.
|
|
122
|
+
*
|
|
123
|
+
* ```ts
|
|
124
|
+
* const infoRule = await EmailRule("info-forwarding", {
|
|
125
|
+
* zone: "example.com",
|
|
126
|
+
* name: "Forward info emails",
|
|
127
|
+
* matchers: [
|
|
128
|
+
* {
|
|
129
|
+
* type: "literal",
|
|
130
|
+
* field: "to",
|
|
131
|
+
* value: "info@example.com"
|
|
132
|
+
* }
|
|
133
|
+
* ],
|
|
134
|
+
* actions: [
|
|
135
|
+
* {
|
|
136
|
+
* type: "forward",
|
|
137
|
+
* value: ["admin@company.com"]
|
|
138
|
+
* }
|
|
139
|
+
* ]
|
|
140
|
+
* });
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ## Process emails with a Worker
|
|
145
|
+
*
|
|
146
|
+
* Route emails to a Cloudflare Worker for custom processing.
|
|
147
|
+
*
|
|
148
|
+
* ```ts
|
|
149
|
+
* const workerRule = await EmailRule("worker-processing", {
|
|
150
|
+
* zone: "example.com",
|
|
151
|
+
* name: "Process with Worker",
|
|
152
|
+
* priority: 1,
|
|
153
|
+
* matchers: [
|
|
154
|
+
* {
|
|
155
|
+
* type: "literal",
|
|
156
|
+
* field: "to",
|
|
157
|
+
* value: "webhook@example.com"
|
|
158
|
+
* }
|
|
159
|
+
* ],
|
|
160
|
+
* actions: [
|
|
161
|
+
* {
|
|
162
|
+
* type: "worker",
|
|
163
|
+
* value: ["email-processor"]
|
|
164
|
+
* }
|
|
165
|
+
* ]
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ## Multiple matchers and actions
|
|
171
|
+
*
|
|
172
|
+
* Create a rule with multiple conditions and actions.
|
|
173
|
+
*
|
|
174
|
+
* ```ts
|
|
175
|
+
* const complexRule = await EmailRule("support-routing", {
|
|
176
|
+
* zone: "example.com",
|
|
177
|
+
* name: "Support email routing",
|
|
178
|
+
* priority: 2,
|
|
179
|
+
* matchers: [
|
|
180
|
+
* {
|
|
181
|
+
* type: "literal",
|
|
182
|
+
* field: "to",
|
|
183
|
+
* value: "support@example.com"
|
|
184
|
+
* }
|
|
185
|
+
* ],
|
|
186
|
+
* actions: [
|
|
187
|
+
* {
|
|
188
|
+
* type: "forward",
|
|
189
|
+
* value: ["support@company.com", "backup@company.com"]
|
|
190
|
+
* }
|
|
191
|
+
* ]
|
|
192
|
+
* });
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
export declare const EmailRule: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<EmailRule>, _id: string, props: EmailRuleProps) => Promise<EmailRule>);
|
|
196
|
+
//# sourceMappingURL=email-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-rule.d.ts","sourceRoot":"","sources":["../../src/cloudflare/email-rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,UAAU,CAAC;AAE1E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,IAAI,EAAE,SAAS,GAAG,KAAK,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IAElC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAEpC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAeD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;OAKG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