alchemy 0.16.10 → 0.17.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/lib/ai/astro-file.d.ts +1 -1
- package/lib/ai/astro-file.d.ts.map +1 -1
- package/lib/ai/astro-file.js +1 -1
- package/lib/ai/astro-file.js.map +1 -1
- package/lib/ai/client.js +2 -2
- package/lib/ai/client.js.map +1 -1
- package/lib/ai/css-file.d.ts +1 -1
- package/lib/ai/css-file.d.ts.map +1 -1
- package/lib/ai/css-file.js +1 -1
- package/lib/ai/css-file.js.map +1 -1
- package/lib/ai/data.d.ts +1 -1
- package/lib/ai/data.d.ts.map +1 -1
- package/lib/ai/data.js +1 -1
- package/lib/ai/data.js.map +1 -1
- package/lib/ai/html-file.d.ts +1 -1
- package/lib/ai/html-file.d.ts.map +1 -1
- package/lib/ai/html-file.js +1 -1
- package/lib/ai/html-file.js.map +1 -1
- package/lib/ai/json-file.d.ts +1 -1
- package/lib/ai/json-file.d.ts.map +1 -1
- package/lib/ai/json-file.js +1 -1
- package/lib/ai/json-file.js.map +1 -1
- package/lib/ai/typescript-file.d.ts +1 -1
- package/lib/ai/typescript-file.d.ts.map +1 -1
- package/lib/ai/typescript-file.js +1 -1
- package/lib/ai/typescript-file.js.map +1 -1
- package/lib/ai/vue-file.d.ts +1 -1
- package/lib/ai/vue-file.d.ts.map +1 -1
- package/lib/ai/vue-file.js +1 -1
- package/lib/ai/vue-file.js.map +1 -1
- package/lib/ai/yaml-file.d.ts +1 -1
- package/lib/ai/yaml-file.d.ts.map +1 -1
- package/lib/ai/yaml-file.js +2 -2
- package/lib/ai/yaml-file.js.map +1 -1
- package/lib/alchemy.d.ts +4 -0
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +14 -4
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts +2 -0
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +17 -2
- package/lib/apply.js.map +1 -1
- package/lib/aws/bucket.d.ts +1 -1
- package/lib/aws/bucket.d.ts.map +1 -1
- package/lib/aws/bucket.js +1 -1
- package/lib/aws/bucket.js.map +1 -1
- package/lib/aws/function.d.ts +1 -1
- package/lib/aws/function.d.ts.map +1 -1
- package/lib/aws/function.js +2 -2
- package/lib/aws/function.js.map +1 -1
- package/lib/aws/oidc/oidc-provider.d.ts +1 -1
- package/lib/aws/oidc/oidc-provider.d.ts.map +1 -1
- package/lib/aws/oidc/oidc-provider.js +1 -1
- package/lib/aws/oidc/oidc-provider.js.map +1 -1
- package/lib/aws/policy-attachment.d.ts +1 -1
- package/lib/aws/policy-attachment.d.ts.map +1 -1
- package/lib/aws/policy-attachment.js +1 -1
- package/lib/aws/policy-attachment.js.map +1 -1
- package/lib/aws/policy.d.ts +1 -1
- package/lib/aws/policy.d.ts.map +1 -1
- package/lib/aws/policy.js +1 -1
- package/lib/aws/policy.js.map +1 -1
- package/lib/aws/queue.d.ts +1 -1
- package/lib/aws/queue.d.ts.map +1 -1
- package/lib/aws/queue.js +20 -25
- package/lib/aws/queue.js.map +1 -1
- package/lib/aws/role.d.ts +1 -1
- package/lib/aws/role.d.ts.map +1 -1
- package/lib/aws/role.js +1 -1
- package/lib/aws/role.js.map +1 -1
- package/lib/aws/ses.d.ts +1 -1
- package/lib/aws/ses.d.ts.map +1 -1
- package/lib/aws/ses.js +1 -1
- package/lib/aws/ses.js.map +1 -1
- package/lib/aws/table.d.ts +1 -1
- package/lib/aws/table.d.ts.map +1 -1
- package/lib/aws/table.js +1 -1
- package/lib/aws/table.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts +1 -1
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js +1 -1
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/ai-gateway.d.ts +4 -3
- package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
- package/lib/cloudflare/ai-gateway.js +13 -1
- package/lib/cloudflare/ai-gateway.js.map +1 -1
- package/lib/cloudflare/api-error.js +1 -1
- package/lib/cloudflare/api-error.js.map +1 -1
- package/lib/cloudflare/assets.js +2 -2
- package/lib/cloudflare/assets.js.map +1 -1
- package/lib/cloudflare/auth.js +1 -1
- package/lib/cloudflare/auth.js.map +1 -1
- package/lib/cloudflare/bindings.d.ts +17 -11
- package/lib/cloudflare/bindings.d.ts.map +1 -1
- package/lib/cloudflare/bindings.js +6 -0
- package/lib/cloudflare/bindings.js.map +1 -1
- package/lib/cloudflare/bound.d.ts +11 -10
- package/lib/cloudflare/bound.d.ts.map +1 -1
- package/lib/cloudflare/bucket.d.ts +6 -4
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +22 -2
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/bundle-worker.d.ts +1 -0
- package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -1
- package/lib/cloudflare/bundle/bundle-worker.js +4 -2
- package/lib/cloudflare/bundle/bundle-worker.js.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.js +2 -2
- package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat.js +1 -1
- package/lib/cloudflare/bundle/nodejs-compat.js.map +1 -1
- package/lib/cloudflare/custom-domain.js +1 -1
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-database.d.ts +4 -62
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +27 -11
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/dns-records.d.ts +1 -1
- package/lib/cloudflare/dns-records.d.ts.map +1 -1
- package/lib/cloudflare/dns-records.js +2 -2
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/event-source.d.ts +3 -3
- package/lib/cloudflare/event-source.d.ts.map +1 -1
- package/lib/cloudflare/hyperdrive.d.ts +4 -3
- package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
- package/lib/cloudflare/hyperdrive.js +9 -1
- package/lib/cloudflare/hyperdrive.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts +9 -5
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js +26 -6
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/permission-groups.d.ts +1 -1
- package/lib/cloudflare/permission-groups.d.ts.map +1 -1
- package/lib/cloudflare/permission-groups.js +1 -1
- package/lib/cloudflare/permission-groups.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +5 -3
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +16 -2
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts +3 -3
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +1 -1
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/queue.d.ts +34 -22
- package/lib/cloudflare/queue.d.ts.map +1 -1
- package/lib/cloudflare/queue.js +66 -4
- package/lib/cloudflare/queue.js.map +1 -1
- package/lib/cloudflare/route.d.ts +1 -1
- package/lib/cloudflare/route.d.ts.map +1 -1
- package/lib/cloudflare/route.js +1 -1
- package/lib/cloudflare/route.js.map +1 -1
- package/lib/cloudflare/types.js +1 -1
- package/lib/cloudflare/types.js.map +1 -1
- package/lib/cloudflare/vectorize-index.d.ts +6 -4
- package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-index.js +20 -3
- package/lib/cloudflare/vectorize-index.js.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts +4 -3
- package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.js +5 -2
- package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +1 -0
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-assets.d.ts +32 -0
- package/lib/cloudflare/worker-assets.d.ts.map +1 -0
- package/lib/cloudflare/worker-assets.js +143 -0
- package/lib/cloudflare/worker-assets.js.map +1 -0
- package/lib/cloudflare/worker-metadata.d.ts +31 -0
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
- package/lib/cloudflare/worker-metadata.js +248 -0
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker-stub.d.ts +40 -0
- package/lib/cloudflare/worker-stub.d.ts.map +1 -0
- package/lib/cloudflare/worker-stub.js +86 -0
- package/lib/cloudflare/worker-stub.js.map +1 -0
- package/lib/cloudflare/worker.d.ts +57 -28
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +203 -479
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +1 -1
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +5 -2
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/cloudflare/zone.d.ts +1 -1
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +1 -1
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/destroy.d.ts +1 -4
- package/lib/destroy.d.ts.map +1 -1
- package/lib/destroy.js +10 -21
- package/lib/destroy.js.map +1 -1
- package/lib/dns/import-dns.d.ts +1 -1
- package/lib/dns/import-dns.d.ts.map +1 -1
- package/lib/dns/import-dns.js +1 -1
- package/lib/dns/import-dns.js.map +1 -1
- package/lib/encrypt.d.ts.map +1 -1
- package/lib/encrypt.js +2 -1
- package/lib/encrypt.js.map +1 -1
- package/lib/env.js +14 -8
- package/lib/env.js.map +1 -1
- package/lib/esbuild/bundle.d.ts +2 -2
- package/lib/esbuild/bundle.d.ts.map +1 -1
- package/lib/esbuild/bundle.js +3 -3
- package/lib/esbuild/bundle.js.map +1 -1
- package/lib/fs/copy-file.d.ts +1 -1
- package/lib/fs/copy-file.d.ts.map +1 -1
- package/lib/fs/copy-file.js +1 -1
- package/lib/fs/copy-file.js.map +1 -1
- package/lib/github/client.js +1 -1
- package/lib/github/client.js.map +1 -1
- package/lib/github/repository-environment.d.ts +1 -1
- package/lib/github/repository-environment.d.ts.map +1 -1
- package/lib/github/repository-environment.js +2 -2
- package/lib/github/repository-environment.js.map +1 -1
- package/lib/github/secret.d.ts +1 -1
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js +1 -1
- package/lib/github/secret.js.map +1 -1
- package/lib/internal/docs/providers.d.ts +1 -1
- package/lib/internal/docs/providers.d.ts.map +1 -1
- package/lib/internal/docs/providers.js +3 -1
- package/lib/internal/docs/providers.js.map +1 -1
- package/lib/neon/api-error.js +2 -2
- package/lib/neon/api-error.js.map +1 -1
- package/lib/os/exec.js +1 -1
- package/lib/os/exec.js.map +1 -1
- package/lib/resource.d.ts +13 -11
- package/lib/resource.d.ts.map +1 -1
- package/lib/resource.js +10 -5
- package/lib/resource.js.map +1 -1
- package/lib/runtime/bind.d.ts +25 -0
- package/lib/runtime/bind.d.ts.map +1 -0
- package/lib/runtime/bind.js +76 -0
- package/lib/runtime/bind.js.map +1 -0
- package/lib/runtime/global.d.ts +8 -0
- package/lib/runtime/global.d.ts.map +1 -0
- package/lib/runtime/global.js +3 -0
- package/lib/runtime/global.js.map +1 -0
- package/lib/runtime/plugin.d.ts +35 -0
- package/lib/runtime/plugin.d.ts.map +1 -0
- package/lib/runtime/plugin.js +133 -0
- package/lib/runtime/plugin.js.map +1 -0
- package/lib/runtime/shims.d.ts +6 -0
- package/lib/runtime/shims.d.ts.map +1 -0
- package/lib/runtime/shims.js +27 -0
- package/lib/runtime/shims.js.map +1 -0
- package/lib/runtime/state.d.ts +5 -0
- package/lib/runtime/state.d.ts.map +1 -0
- package/lib/runtime/state.js +4 -0
- package/lib/runtime/state.js.map +1 -0
- package/lib/scope.d.ts +16 -2
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +56 -9
- package/lib/scope.js.map +1 -1
- package/lib/secret.d.ts +7 -2
- package/lib/secret.d.ts.map +1 -1
- package/lib/secret.js +19 -4
- package/lib/secret.js.map +1 -1
- package/lib/sentry/client-key.d.ts +1 -1
- package/lib/sentry/client-key.d.ts.map +1 -1
- package/lib/sentry/client-key.js +1 -1
- package/lib/sentry/client-key.js.map +1 -1
- package/lib/sentry/project.d.ts +1 -1
- package/lib/sentry/project.d.ts.map +1 -1
- package/lib/sentry/project.js +1 -1
- package/lib/sentry/project.js.map +1 -1
- package/lib/sentry/team.d.ts +1 -1
- package/lib/sentry/team.d.ts.map +1 -1
- package/lib/sentry/team.js +1 -1
- package/lib/sentry/team.js.map +1 -1
- package/lib/serde.d.ts +26 -1
- package/lib/serde.d.ts.map +1 -1
- package/lib/serde.js +53 -8
- package/lib/serde.js.map +1 -1
- package/lib/stripe/meter.d.ts +1 -1
- package/lib/stripe/meter.d.ts.map +1 -1
- package/lib/stripe/meter.js +1 -1
- package/lib/stripe/meter.js.map +1 -1
- package/lib/stripe/price.d.ts +1 -1
- package/lib/stripe/price.d.ts.map +1 -1
- package/lib/stripe/price.js +1 -1
- package/lib/stripe/price.js.map +1 -1
- package/lib/stripe/product.d.ts +1 -1
- package/lib/stripe/product.d.ts.map +1 -1
- package/lib/stripe/product.js +1 -1
- package/lib/stripe/product.js.map +1 -1
- package/lib/stripe/webhook.d.ts +1 -1
- package/lib/stripe/webhook.d.ts.map +1 -1
- package/lib/stripe/webhook.js +1 -1
- package/lib/stripe/webhook.js.map +1 -1
- package/lib/test/bun.js +1 -1
- package/lib/test/bun.js.map +1 -1
- package/lib/test/prune.js +1 -1
- package/lib/test/prune.js.map +1 -1
- package/lib/upstash/redis.d.ts +1 -1
- package/lib/upstash/redis.d.ts.map +1 -1
- package/lib/upstash/redis.js +1 -1
- package/lib/upstash/redis.js.map +1 -1
- package/lib/util/content-type.d.ts +1 -1
- package/lib/util/content-type.d.ts.map +1 -1
- package/lib/util/content-type.js +1 -2
- package/lib/util/content-type.js.map +1 -1
- package/lib/util/retry.d.ts.map +1 -1
- package/lib/util/retry.js +1 -0
- package/lib/util/retry.js.map +1 -1
- package/lib/vercel/project-domain.d.ts +1 -1
- package/lib/vercel/project-domain.d.ts.map +1 -1
- package/lib/vercel/project-domain.js +1 -1
- package/lib/vercel/project-domain.js.map +1 -1
- package/lib/vercel/project.js +1 -1
- package/lib/vercel/project.js.map +1 -1
- package/lib/web/shadcn-component.d.ts +1 -1
- package/lib/web/shadcn-component.d.ts.map +1 -1
- package/lib/web/shadcn-component.js +1 -1
- package/lib/web/shadcn-component.js.map +1 -1
- package/lib/web/shadcn.d.ts +1 -1
- package/lib/web/shadcn.d.ts.map +1 -1
- package/lib/web/shadcn.js +1 -1
- package/lib/web/shadcn.js.map +1 -1
- package/lib/web/vitepress/dependencies.d.ts +1 -1
- package/lib/web/vitepress/dependencies.d.ts.map +1 -1
- package/lib/web/vitepress/dependencies.js +1 -1
- package/lib/web/vitepress/dependencies.js.map +1 -1
- package/lib/web/vitepress/vitepress.js +1 -1
- package/lib/web/vitepress/vitepress.js.map +1 -1
- package/package.json +2 -1
- package/src/ai/astro-file.ts +1 -1
- package/src/ai/client.ts +2 -2
- package/src/ai/css-file.ts +1 -1
- package/src/ai/data.ts +1 -1
- package/src/ai/html-file.ts +1 -1
- package/src/ai/json-file.ts +1 -1
- package/src/ai/typescript-file.ts +1 -1
- package/src/ai/vue-file.ts +1 -1
- package/src/ai/yaml-file.ts +2 -2
- package/src/alchemy.ts +18 -4
- package/src/apply.ts +27 -2
- package/src/aws/bucket.ts +1 -1
- package/src/aws/function.ts +2 -2
- package/src/aws/oidc/oidc-provider.ts +1 -1
- package/src/aws/policy-attachment.ts +1 -1
- package/src/aws/policy.ts +1 -1
- package/src/aws/queue.ts +28 -29
- package/src/aws/role.ts +1 -1
- package/src/aws/ses.ts +1 -1
- package/src/aws/table.ts +1 -1
- package/src/cloudflare/account-api-token.ts +1 -1
- package/src/cloudflare/ai-gateway.ts +23 -4
- package/src/cloudflare/api-error.ts +1 -1
- package/src/cloudflare/assets.ts +2 -2
- package/src/cloudflare/auth.ts +1 -1
- package/src/cloudflare/bindings.ts +33 -18
- package/src/cloudflare/bound.ts +18 -17
- package/src/cloudflare/bucket.ts +52 -24
- package/src/cloudflare/bundle/bundle-worker.ts +5 -2
- package/src/cloudflare/bundle/nodejs-compat-mode.ts +3 -3
- package/src/cloudflare/bundle/nodejs-compat.ts +1 -1
- package/src/cloudflare/custom-domain.ts +1 -1
- package/src/cloudflare/d1-database.ts +40 -19
- package/src/cloudflare/dns-records.ts +2 -2
- package/src/cloudflare/event-source.ts +3 -3
- package/src/cloudflare/hyperdrive.ts +19 -4
- package/src/cloudflare/kv-namespace.ts +46 -15
- package/src/cloudflare/permission-groups.ts +1 -1
- package/src/cloudflare/pipeline.ts +29 -6
- package/src/cloudflare/queue-consumer.ts +3 -3
- package/src/cloudflare/queue.ts +124 -23
- package/src/cloudflare/route.ts +1 -1
- package/src/cloudflare/types.ts +1 -1
- package/src/cloudflare/vectorize-index.ts +36 -8
- package/src/cloudflare/vectorize-metadata-index.ts +10 -4
- package/src/cloudflare/website.ts +4 -3
- package/src/cloudflare/worker-assets.ts +237 -0
- package/src/cloudflare/worker-metadata.ts +287 -0
- package/src/cloudflare/worker-stub.ts +153 -0
- package/src/cloudflare/worker.ts +386 -592
- package/src/cloudflare/wrangler.json.ts +4 -2
- package/src/cloudflare/zone.ts +1 -1
- package/src/destroy.ts +12 -23
- package/src/dns/import-dns.ts +1 -1
- package/src/encrypt.ts +2 -2
- package/src/env.ts +15 -8
- package/src/esbuild/bundle.ts +4 -3
- package/src/fs/copy-file.ts +1 -1
- package/src/github/client.ts +1 -1
- package/src/github/repository-environment.ts +2 -2
- package/src/github/secret.ts +1 -1
- package/src/internal/docs/providers.ts +1 -1
- package/src/neon/api-error.ts +2 -2
- package/src/os/exec.ts +1 -1
- package/src/resource.ts +22 -31
- package/src/runtime/bind.ts +95 -0
- package/src/runtime/global.ts +10 -0
- package/src/runtime/plugin.ts +162 -0
- package/src/runtime/shims.js +34 -0
- package/src/runtime/state.ts +9 -0
- package/src/scope.ts +72 -11
- package/src/secret.ts +29 -4
- package/src/sentry/client-key.ts +1 -1
- package/src/sentry/project.ts +1 -1
- package/src/sentry/team.ts +1 -1
- package/src/serde.ts +126 -10
- package/src/stripe/meter.ts +1 -1
- package/src/stripe/price.ts +1 -1
- package/src/stripe/product.ts +1 -1
- package/src/stripe/webhook.ts +1 -1
- package/src/test/bun.ts +1 -1
- package/src/test/prune.ts +1 -1
- package/src/upstash/redis.ts +1 -1
- package/src/util/content-type.ts +2 -3
- package/src/util/retry.ts +1 -0
- package/src/vercel/project-domain.ts +1 -1
- package/src/vercel/project.ts +1 -1
- package/src/web/shadcn-component.ts +1 -1
- package/src/web/shadcn.ts +1 -1
- package/src/web/vitepress/dependencies.ts +1 -1
- package/src/web/vitepress/vitepress.ts +1 -1
package/src/aws/queue.ts
CHANGED
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
DeleteQueueCommand,
|
|
4
4
|
GetQueueAttributesCommand,
|
|
5
5
|
GetQueueUrlCommand,
|
|
6
|
+
QueueDeletedRecently,
|
|
7
|
+
QueueDoesNotExist,
|
|
6
8
|
SQSClient,
|
|
7
9
|
} from "@aws-sdk/client-sqs";
|
|
8
10
|
import type { Context } from "../context.js";
|
|
@@ -136,7 +138,7 @@ export const Queue = Resource(
|
|
|
136
138
|
"sqs::Queue",
|
|
137
139
|
async function (
|
|
138
140
|
this: Context<Queue>,
|
|
139
|
-
|
|
141
|
+
_id: string,
|
|
140
142
|
props: QueueProps,
|
|
141
143
|
): Promise<Queue> {
|
|
142
144
|
const client = new SQSClient({});
|
|
@@ -176,7 +178,7 @@ export const Queue = Resource(
|
|
|
176
178
|
// If we get here, queue still exists
|
|
177
179
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
178
180
|
} catch (error: any) {
|
|
179
|
-
if (error
|
|
181
|
+
if (isQueueDoesNotExist(error)) {
|
|
180
182
|
queueDeleted = true;
|
|
181
183
|
} else {
|
|
182
184
|
throw error;
|
|
@@ -184,7 +186,7 @@ export const Queue = Resource(
|
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
188
|
} catch (error: any) {
|
|
187
|
-
if (error
|
|
189
|
+
if (!isQueueDoesNotExist(error)) {
|
|
188
190
|
throw error;
|
|
189
191
|
}
|
|
190
192
|
}
|
|
@@ -258,37 +260,18 @@ export const Queue = Resource(
|
|
|
258
260
|
url: createResponse.QueueUrl!,
|
|
259
261
|
});
|
|
260
262
|
} catch (error: any) {
|
|
261
|
-
if (error
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
new GetQueueUrlCommand({
|
|
265
|
-
QueueName: queueName,
|
|
266
|
-
}),
|
|
267
|
-
);
|
|
268
|
-
|
|
269
|
-
// Get queue attributes
|
|
270
|
-
const attributesResponse = await client.send(
|
|
271
|
-
new GetQueueAttributesCommand({
|
|
272
|
-
QueueUrl: urlResponse.QueueUrl,
|
|
273
|
-
AttributeNames: ["QueueArn"],
|
|
274
|
-
}),
|
|
263
|
+
if (isQueueDeletedRecently(error)) {
|
|
264
|
+
console.log(
|
|
265
|
+
`Queue "${queueName}" was recently deleted and can't be re-created. Waiting and retrying...`,
|
|
275
266
|
);
|
|
276
|
-
|
|
277
|
-
return this({
|
|
278
|
-
...props,
|
|
279
|
-
arn: attributesResponse.Attributes!.QueueArn!,
|
|
280
|
-
url: urlResponse.QueueUrl!,
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
if (error.name === "QueueDeletedRecently") {
|
|
284
267
|
// Queue was recently deleted, wait and retry
|
|
285
|
-
const maxRetries =
|
|
268
|
+
const maxRetries = 61;
|
|
286
269
|
let retryCount = 0;
|
|
287
270
|
|
|
288
271
|
while (retryCount < maxRetries) {
|
|
289
272
|
try {
|
|
290
|
-
// Wait for
|
|
291
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
273
|
+
// Wait for 1 second before retrying
|
|
274
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
292
275
|
|
|
293
276
|
// Retry creating the queue
|
|
294
277
|
const createResponse = await client.send(
|
|
@@ -314,7 +297,7 @@ export const Queue = Resource(
|
|
|
314
297
|
});
|
|
315
298
|
} catch (retryError: any) {
|
|
316
299
|
if (
|
|
317
|
-
retryError
|
|
300
|
+
!isQueueDeletedRecently(retryError) ||
|
|
318
301
|
retryCount === maxRetries - 1
|
|
319
302
|
) {
|
|
320
303
|
throw retryError;
|
|
@@ -327,3 +310,19 @@ export const Queue = Resource(
|
|
|
327
310
|
}
|
|
328
311
|
},
|
|
329
312
|
);
|
|
313
|
+
|
|
314
|
+
function isQueueDoesNotExist(error: any): error is QueueDoesNotExist {
|
|
315
|
+
return (
|
|
316
|
+
error.name === "QueueDoesNotExist" ||
|
|
317
|
+
error.Code === "AWS.SimpleQueueService.NonExistentQueue" ||
|
|
318
|
+
error instanceof QueueDoesNotExist
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function isQueueDeletedRecently(error: any): error is QueueDeletedRecently {
|
|
323
|
+
return (
|
|
324
|
+
error instanceof QueueDeletedRecently ||
|
|
325
|
+
error.Code === "AWS.SimpleQueueService.QueueDeletedRecently" ||
|
|
326
|
+
error.name === "QueueDeletedRecently"
|
|
327
|
+
);
|
|
328
|
+
}
|
package/src/aws/role.ts
CHANGED
package/src/aws/ses.ts
CHANGED
package/src/aws/table.ts
CHANGED
|
@@ -251,7 +251,7 @@ export const AccountApiToken = Resource(
|
|
|
251
251
|
"cloudflare::AccountApiToken",
|
|
252
252
|
async function (
|
|
253
253
|
this: Context<AccountApiToken>,
|
|
254
|
-
|
|
254
|
+
_id: string,
|
|
255
255
|
props: AccountApiTokenProps,
|
|
256
256
|
): Promise<AccountApiToken> {
|
|
257
257
|
// Create Cloudflare API client with automatic account discovery
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Context } from "../context.js";
|
|
2
2
|
import { Resource } from "../resource.js";
|
|
3
|
+
import { bind } from "../runtime/bind.js";
|
|
3
4
|
import { handleApiError } from "./api-error.js";
|
|
4
5
|
import { createCloudflareApi, type CloudflareApiOptions } from "./api.js";
|
|
6
|
+
import type { Bound } from "./bound.js";
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Properties for creating or updating a Cloudflare AI Gateway.
|
|
@@ -85,7 +87,7 @@ export interface AiGatewayProps extends CloudflareApiOptions {
|
|
|
85
87
|
* Output returned after Cloudflare AI Gateway creation/update.
|
|
86
88
|
* IMPORTANT: The interface name MUST match the exported resource name.
|
|
87
89
|
*/
|
|
88
|
-
export interface
|
|
90
|
+
export interface AiGatewayResource
|
|
89
91
|
extends Resource<"cloudflare::AiGateway">,
|
|
90
92
|
AiGatewayProps {
|
|
91
93
|
/**
|
|
@@ -125,6 +127,8 @@ export interface AiGateway
|
|
|
125
127
|
type: "ai_gateway";
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
export type AiGateway = AiGatewayResource & Bound<AiGatewayResource>;
|
|
131
|
+
|
|
128
132
|
/**
|
|
129
133
|
* Represents a Cloudflare AI Gateway.
|
|
130
134
|
*
|
|
@@ -149,13 +153,28 @@ export interface AiGateway
|
|
|
149
153
|
* logpushPublicKey: "mypublickey..." // Replace with actual public key
|
|
150
154
|
* });
|
|
151
155
|
*/
|
|
152
|
-
export
|
|
156
|
+
export async function AiGateway(
|
|
157
|
+
name: string,
|
|
158
|
+
props: AiGatewayProps = {},
|
|
159
|
+
): Promise<AiGateway> {
|
|
160
|
+
const gateway = await AiGatewayResource(name, props);
|
|
161
|
+
const binding = await bind(gateway);
|
|
162
|
+
return {
|
|
163
|
+
...gateway,
|
|
164
|
+
getLog: binding.getLog,
|
|
165
|
+
getUrl: binding.getUrl,
|
|
166
|
+
patchLog: binding.patchLog,
|
|
167
|
+
run: binding.run,
|
|
168
|
+
} as AiGateway;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const AiGatewayResource = Resource(
|
|
153
172
|
"cloudflare::AiGateway",
|
|
154
173
|
async function (
|
|
155
|
-
this: Context<
|
|
174
|
+
this: Context<AiGatewayResource>,
|
|
156
175
|
id: string,
|
|
157
176
|
props: AiGatewayProps = {},
|
|
158
|
-
): Promise<
|
|
177
|
+
): Promise<AiGatewayResource> {
|
|
159
178
|
const api = await createCloudflareApi(props);
|
|
160
179
|
const gatewayPath = `/accounts/${api.accountId}/ai-gateway/gateways/${id}`;
|
|
161
180
|
const gatewaysPath = `/accounts/${api.accountId}/ai-gateway/gateways`;
|
package/src/cloudflare/assets.ts
CHANGED
|
@@ -104,7 +104,7 @@ export const Assets = Resource(
|
|
|
104
104
|
if (!stats.isDirectory()) {
|
|
105
105
|
throw new Error(`Assets path ${props.path} is not a directory`);
|
|
106
106
|
}
|
|
107
|
-
} catch (
|
|
107
|
+
} catch (_error) {
|
|
108
108
|
throw new Error(
|
|
109
109
|
`Assets directory ${props.path} does not exist or is not accessible`,
|
|
110
110
|
);
|
|
@@ -121,7 +121,7 @@ export const Assets = Resource(
|
|
|
121
121
|
return {
|
|
122
122
|
path: normalizedPath,
|
|
123
123
|
filePath,
|
|
124
|
-
contentType: getContentType(filePath),
|
|
124
|
+
contentType: getContentType(filePath) ?? "application/null",
|
|
125
125
|
};
|
|
126
126
|
});
|
|
127
127
|
|
package/src/cloudflare/auth.ts
CHANGED
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
* https://developers.cloudflare.com/api/resources/workers/subresources/scripts/methods/update/
|
|
5
5
|
*/
|
|
6
6
|
import type { Secret } from "../secret.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { AiGatewayResource } from "./ai-gateway.js";
|
|
8
8
|
import type { Ai } from "./ai.js";
|
|
9
9
|
import type { AnalyticsEngineDataset } from "./analytics-engine.js";
|
|
10
10
|
import type { Assets } from "./assets.js";
|
|
11
11
|
import type { Bound } from "./bound.js";
|
|
12
12
|
import type { BrowserRendering } from "./browser-rendering.js";
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
13
|
+
import type { R2BucketResource } from "./bucket.js";
|
|
14
|
+
import type { D1DatabaseResource } from "./d1-database.js";
|
|
15
15
|
import type { DurableObjectNamespace } from "./durable-object-namespace.js";
|
|
16
|
-
import type {
|
|
17
|
-
import type {
|
|
18
|
-
import type {
|
|
19
|
-
import type {
|
|
20
|
-
import type {
|
|
16
|
+
import type { HyperdriveResource } from "./hyperdrive.js";
|
|
17
|
+
import type { KVNamespaceResource } from "./kv-namespace.js";
|
|
18
|
+
import type { PipelineResource } from "./pipeline.js";
|
|
19
|
+
import type { QueueResource } from "./queue.js";
|
|
20
|
+
import type { VectorizeIndexResource } from "./vectorize-index.js";
|
|
21
|
+
import type { WorkerStub } from "./worker-stub.js";
|
|
21
22
|
import type { Worker } from "./worker.js";
|
|
22
23
|
import type { Workflow } from "./workflow.js";
|
|
23
24
|
|
|
@@ -36,31 +37,45 @@ export declare namespace Bindings {
|
|
|
36
37
|
*/
|
|
37
38
|
export type Binding =
|
|
38
39
|
| Ai
|
|
39
|
-
|
|
|
40
|
+
| AiGatewayResource
|
|
40
41
|
| Assets
|
|
42
|
+
| D1DatabaseResource
|
|
41
43
|
| AnalyticsEngineDataset
|
|
42
|
-
| D1Database
|
|
43
44
|
| DurableObjectNamespace
|
|
44
|
-
|
|
|
45
|
-
|
|
|
45
|
+
| HyperdriveResource
|
|
46
|
+
| KVNamespaceResource
|
|
47
|
+
| PipelineResource
|
|
48
|
+
| QueueResource
|
|
49
|
+
| R2BucketResource
|
|
46
50
|
| {
|
|
47
51
|
type: "kv_namespace";
|
|
48
52
|
id: string;
|
|
49
53
|
}
|
|
50
|
-
| Pipeline
|
|
51
|
-
| Queue
|
|
52
|
-
| R2Bucket
|
|
53
54
|
| Secret
|
|
54
55
|
| string
|
|
55
|
-
|
|
|
56
|
+
| VectorizeIndexResource
|
|
56
57
|
| Worker
|
|
58
|
+
| WorkerStub
|
|
57
59
|
| Workflow
|
|
58
60
|
| BrowserRendering
|
|
59
|
-
| Self
|
|
61
|
+
| Self
|
|
62
|
+
| Json;
|
|
60
63
|
|
|
61
64
|
export type Self = typeof Self;
|
|
62
65
|
export const Self = Symbol.for("Self");
|
|
63
66
|
|
|
67
|
+
export type Json<T = any> = {
|
|
68
|
+
type: "json";
|
|
69
|
+
json: T;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export function Json<const T>(value: T): Json<T> {
|
|
73
|
+
return {
|
|
74
|
+
type: "json",
|
|
75
|
+
json: value,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
64
79
|
/**
|
|
65
80
|
* Union type for all Worker binding types (API spec)
|
|
66
81
|
*/
|
|
@@ -201,7 +216,7 @@ export interface WorkerBindingJson {
|
|
|
201
216
|
/** Type identifier for JSON binding */
|
|
202
217
|
type: "json";
|
|
203
218
|
/** JSON value */
|
|
204
|
-
json:
|
|
219
|
+
json: string;
|
|
205
220
|
}
|
|
206
221
|
|
|
207
222
|
/**
|
package/src/cloudflare/bound.ts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import type { Pipeline } from "cloudflare:pipelines";
|
|
2
2
|
import type { Secret } from "../secret.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AiGatewayResource as _AiGateway } from "./ai-gateway.js";
|
|
4
4
|
import type { Ai as _Ai } from "./ai.js";
|
|
5
5
|
import type { AnalyticsEngineDataset as _AnalyticsEngineDataset } from "./analytics-engine.js";
|
|
6
6
|
import type { Assets } from "./assets.js";
|
|
7
|
-
import type { Binding, Self } from "./bindings.js";
|
|
7
|
+
import type { Binding, Json, Self } from "./bindings.js";
|
|
8
8
|
import type { BrowserRendering } from "./browser-rendering.js";
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
9
|
+
import type { R2BucketResource as _R2Bucket } from "./bucket.js";
|
|
10
|
+
import type { D1DatabaseResource } from "./d1-database.js";
|
|
11
11
|
import type { DurableObjectNamespace as _DurableObjectNamespace } from "./durable-object-namespace.js";
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
16
|
-
import type { Worker as _Worker } from "./worker.js";
|
|
12
|
+
import type { HyperdriveResource as _Hyperdrive } from "./hyperdrive.js";
|
|
13
|
+
import type { PipelineResource as _Pipeline } from "./pipeline.js";
|
|
14
|
+
import type { QueueResource as _Queue } from "./queue.js";
|
|
15
|
+
import type { VectorizeIndexResource as _VectorizeIndex } from "./vectorize-index.js";
|
|
17
16
|
import type { Workflow as _Workflow } from "./workflow.js";
|
|
18
17
|
|
|
19
18
|
export type Bound<T extends Binding> = T extends _DurableObjectNamespace
|
|
20
19
|
? DurableObjectNamespace
|
|
21
20
|
: T extends { type: "kv_namespace" }
|
|
22
21
|
? KVNamespace
|
|
23
|
-
: T extends
|
|
24
|
-
?
|
|
22
|
+
: T extends { type: "service" }
|
|
23
|
+
? Service
|
|
25
24
|
: T extends _R2Bucket
|
|
26
25
|
? R2Bucket
|
|
27
26
|
: T extends _AiGateway
|
|
@@ -34,16 +33,16 @@ export type Bound<T extends Binding> = T extends _DurableObjectNamespace
|
|
|
34
33
|
? Service
|
|
35
34
|
: T extends _Workflow<infer P>
|
|
36
35
|
? Workflow<P>
|
|
37
|
-
: T extends
|
|
36
|
+
: T extends D1DatabaseResource
|
|
38
37
|
? D1Database
|
|
39
38
|
: T extends _VectorizeIndex
|
|
40
39
|
? VectorizeIndex
|
|
41
40
|
: T extends _Queue<infer Body>
|
|
42
41
|
? Queue<Body>
|
|
43
|
-
: T extends
|
|
44
|
-
?
|
|
45
|
-
: T extends
|
|
46
|
-
?
|
|
42
|
+
: T extends _AnalyticsEngineDataset
|
|
43
|
+
? AnalyticsEngineDataset
|
|
44
|
+
: T extends _Pipeline<infer R>
|
|
45
|
+
? Pipeline<R>
|
|
47
46
|
: T extends string
|
|
48
47
|
? string
|
|
49
48
|
: T extends BrowserRendering
|
|
@@ -52,4 +51,6 @@ export type Bound<T extends Binding> = T extends _DurableObjectNamespace
|
|
|
52
51
|
? Ai<M>
|
|
53
52
|
: T extends Self
|
|
54
53
|
? Service
|
|
55
|
-
:
|
|
54
|
+
: T extends Json<infer T>
|
|
55
|
+
? T
|
|
56
|
+
: Service;
|
package/src/cloudflare/bucket.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { AwsClient } from "aws4fetch";
|
|
2
2
|
import type { Context } from "../context.js";
|
|
3
|
-
import { Resource } from "../resource.js";
|
|
3
|
+
import { Resource, ResourceKind } from "../resource.js";
|
|
4
|
+
import { bind } from "../runtime/bind.js";
|
|
4
5
|
import type { Secret } from "../secret.js";
|
|
5
6
|
import { CloudflareApiError, handleApiError } from "./api-error.js";
|
|
6
7
|
import { type CloudflareApi, createCloudflareApi } from "./api.js";
|
|
8
|
+
import type { Bound } from "./bound.js";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Properties for creating or updating an R2 Bucket
|
|
@@ -89,30 +91,35 @@ export interface BucketProps {
|
|
|
89
91
|
/**
|
|
90
92
|
* Output returned after R2 Bucket creation/update
|
|
91
93
|
*/
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
export type R2BucketResource = Resource<"cloudflare::R2Bucket"> &
|
|
95
|
+
Omit<BucketProps, "delete"> & {
|
|
96
|
+
/**
|
|
97
|
+
* Resource type identifier
|
|
98
|
+
*/
|
|
99
|
+
type: "r2_bucket";
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The name of the bucket
|
|
103
|
+
*/
|
|
104
|
+
name: string;
|
|
99
105
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Location of the bucket
|
|
108
|
+
*/
|
|
109
|
+
location: string;
|
|
104
110
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Time at which the bucket was created
|
|
113
|
+
*/
|
|
114
|
+
creationDate: Date;
|
|
115
|
+
};
|
|
109
116
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*/
|
|
113
|
-
creationDate: Date;
|
|
117
|
+
export function isBucket(resource: Resource): resource is R2BucketResource {
|
|
118
|
+
return resource[ResourceKind] === "cloudflare::R2Bucket";
|
|
114
119
|
}
|
|
115
120
|
|
|
121
|
+
export type R2Bucket = R2BucketResource & Bound<R2BucketResource>;
|
|
122
|
+
|
|
116
123
|
/**
|
|
117
124
|
* Creates and manages Cloudflare R2 Buckets for object storage.
|
|
118
125
|
*
|
|
@@ -157,13 +164,31 @@ export interface R2Bucket
|
|
|
157
164
|
*
|
|
158
165
|
* @see https://developers.cloudflare.com/r2/buckets/
|
|
159
166
|
*/
|
|
160
|
-
export
|
|
167
|
+
export async function R2Bucket(
|
|
168
|
+
name: string,
|
|
169
|
+
props: BucketProps = {},
|
|
170
|
+
): Promise<R2Bucket> {
|
|
171
|
+
const bucket = await R2BucketResource(name, props);
|
|
172
|
+
const binding = await bind(bucket);
|
|
173
|
+
return {
|
|
174
|
+
...bucket,
|
|
175
|
+
createMultipartUpload: binding.createMultipartUpload,
|
|
176
|
+
delete: binding.delete,
|
|
177
|
+
get: binding.get,
|
|
178
|
+
list: binding.list,
|
|
179
|
+
put: binding.put,
|
|
180
|
+
head: binding.head,
|
|
181
|
+
resumeMultipartUpload: binding.resumeMultipartUpload,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const R2BucketResource = Resource(
|
|
161
186
|
"cloudflare::R2Bucket",
|
|
162
187
|
async function (
|
|
163
|
-
this: Context<
|
|
164
|
-
|
|
188
|
+
this: Context<R2BucketResource>,
|
|
189
|
+
_id: string,
|
|
165
190
|
props: BucketProps = {},
|
|
166
|
-
): Promise<
|
|
191
|
+
): Promise<R2BucketResource> {
|
|
167
192
|
const api = await createCloudflareApi(props);
|
|
168
193
|
const bucketName = props.name || this.id;
|
|
169
194
|
|
|
@@ -174,6 +199,9 @@ export const R2Bucket = Resource(
|
|
|
174
199
|
const r2Client = await createR2Client({
|
|
175
200
|
...props,
|
|
176
201
|
accountId: api.accountId,
|
|
202
|
+
accessKeyId: props.accessKey ?? this.output.accessKey,
|
|
203
|
+
secretAccessKey:
|
|
204
|
+
props.secretAccessKey ?? this.output.secretAccessKey,
|
|
177
205
|
});
|
|
178
206
|
// Empty the bucket first by deleting all objects
|
|
179
207
|
await emptyBucket(r2Client, bucketName, props.jurisdiction);
|
|
@@ -13,13 +13,14 @@ import { nodeJsCompatPlugin } from "./nodejs-compat.js";
|
|
|
13
13
|
|
|
14
14
|
export async function bundleWorkerScript<B extends Bindings>(
|
|
15
15
|
props: WorkerProps<B> & {
|
|
16
|
+
entrypoint: string;
|
|
16
17
|
compatibilityDate: string;
|
|
17
18
|
compatibilityFlags: string[];
|
|
18
19
|
},
|
|
19
20
|
) {
|
|
20
21
|
const projectRoot = props.projectRoot ?? process.cwd();
|
|
21
22
|
|
|
22
|
-
const nodeJsCompatMode = getNodeJSCompatMode(
|
|
23
|
+
const nodeJsCompatMode = await getNodeJSCompatMode(
|
|
23
24
|
props.compatibilityDate,
|
|
24
25
|
props.compatibilityFlags,
|
|
25
26
|
);
|
|
@@ -29,10 +30,11 @@ export async function bundleWorkerScript<B extends Bindings>(
|
|
|
29
30
|
"You must set your compatibilty date >= 2024-09-23 when using 'nodejs_compat' compatibility flag",
|
|
30
31
|
);
|
|
31
32
|
}
|
|
33
|
+
const main = props.entrypoint;
|
|
32
34
|
|
|
33
35
|
try {
|
|
34
36
|
const bundle = await Bundle("bundle", {
|
|
35
|
-
entryPoint:
|
|
37
|
+
entryPoint: main,
|
|
36
38
|
format: props.format === "cjs" ? "cjs" : "esm", // Use the specified format or default to ESM
|
|
37
39
|
target: "esnext",
|
|
38
40
|
platform: "node",
|
|
@@ -48,6 +50,7 @@ export async function bundleWorkerScript<B extends Bindings>(
|
|
|
48
50
|
".json": "json",
|
|
49
51
|
},
|
|
50
52
|
plugins: [
|
|
53
|
+
...(props.bundle?.plugins ?? []),
|
|
51
54
|
...(nodeJsCompatMode === "v2" ? [await nodeJsCompatPlugin()] : []),
|
|
52
55
|
...(props.bundle?.alias
|
|
53
56
|
? [
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { NodeJSCompatMode } from "miniflare";
|
|
2
|
-
import { getNodeCompat } from "miniflare";
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Computes and validates the Node.js compatibility mode we are running.
|
|
@@ -13,13 +12,14 @@ import { getNodeCompat } from "miniflare";
|
|
|
13
12
|
* @param noBundle Whether to skip internal build steps and directly deploy script
|
|
14
13
|
*
|
|
15
14
|
*/
|
|
16
|
-
export function getNodeJSCompatMode(
|
|
15
|
+
export async function getNodeJSCompatMode(
|
|
17
16
|
compatibilityDateStr: string,
|
|
18
17
|
compatibilityFlags: string[],
|
|
19
18
|
props?: {
|
|
20
19
|
noBundle?: boolean;
|
|
21
20
|
},
|
|
22
|
-
): NodeJSCompatMode {
|
|
21
|
+
): Promise<NodeJSCompatMode> {
|
|
22
|
+
const { getNodeCompat } = await import("miniflare");
|
|
23
23
|
const {
|
|
24
24
|
mode,
|
|
25
25
|
hasNodejsCompatFlag,
|
|
@@ -122,7 +122,7 @@ function handleUnenvAliasedPackages(
|
|
|
122
122
|
for (const [module, unresolvedAlias] of Object.entries(alias)) {
|
|
123
123
|
try {
|
|
124
124
|
aliasAbsolute[module] = _require.resolve(unresolvedAlias);
|
|
125
|
-
} catch (
|
|
125
|
+
} catch (_e) {
|
|
126
126
|
// this is an alias for package that is not installed in the current app => ignore
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -165,7 +165,7 @@ async function deleteCustomDomain(
|
|
|
165
165
|
async function ensureCustomDomain(
|
|
166
166
|
context: Context<CustomDomain>,
|
|
167
167
|
api: CloudflareApi,
|
|
168
|
-
|
|
168
|
+
_logicalId: string,
|
|
169
169
|
props: CustomDomainProps,
|
|
170
170
|
): Promise<CustomDomain> {
|
|
171
171
|
const environment = props.environment || "production";
|