alchemy 0.21.0 → 0.22.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/lib/ai/astro-file.d.ts +4 -4
- package/lib/ai/client.d.ts +1 -1
- package/lib/ai/css-file.d.ts +4 -4
- package/lib/ai/data.d.ts +4 -4
- package/lib/ai/document.d.ts +5 -5
- package/lib/ai/html-file.d.ts +4 -4
- package/lib/ai/index.d.ts +10 -10
- package/lib/ai/json-file.d.ts +4 -4
- package/lib/ai/typescript-file.d.ts +4 -4
- package/lib/ai/vue-file.d.ts +4 -4
- package/lib/ai/yaml-file.d.ts +4 -4
- package/lib/alchemy.d.ts +5 -5
- package/lib/apply.d.ts +2 -2
- package/lib/aws/bucket.d.ts +2 -2
- package/lib/aws/control/error.d.ts +1 -1
- package/lib/aws/control/index.d.ts +4 -4
- package/lib/aws/control/resource.d.ts +2 -2
- package/lib/aws/credentials.d.ts +1 -1
- package/lib/aws/function.d.ts +3 -3
- package/lib/aws/index.d.ts +9 -9
- package/lib/aws/oidc/github-oidc-provider.d.ts +1 -1
- package/lib/aws/oidc/index.d.ts +2 -2
- package/lib/aws/oidc/oidc-provider.d.ts +2 -2
- package/lib/aws/policy-attachment.d.ts +2 -2
- package/lib/aws/policy.d.ts +2 -2
- package/lib/aws/queue.d.ts +2 -2
- package/lib/aws/role.d.ts +3 -3
- package/lib/aws/ses.d.ts +2 -2
- package/lib/aws/table.d.ts +2 -2
- package/lib/cloudflare/account-api-token.d.ts +5 -5
- package/lib/cloudflare/account-id.d.ts +1 -1
- package/lib/cloudflare/ai-gateway.d.ts +3 -3
- package/lib/cloudflare/api.d.ts +2 -2
- package/lib/cloudflare/assets.d.ts +2 -2
- package/lib/cloudflare/auth.d.ts +1 -1
- package/lib/cloudflare/bindings.d.ts +18 -18
- package/lib/cloudflare/bound.d.ts +16 -16
- package/lib/cloudflare/bucket.d.ts +4 -4
- package/lib/cloudflare/bundle/bundle-worker.d.ts +2 -2
- package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -1
- package/lib/cloudflare/bundle/bundle-worker.js +4 -0
- package/lib/cloudflare/bundle/bundle-worker.js.map +1 -1
- package/lib/cloudflare/bundle/wasm-plugin.d.ts +3 -0
- package/lib/cloudflare/bundle/wasm-plugin.d.ts.map +1 -0
- package/lib/cloudflare/bundle/wasm-plugin.js +53 -0
- package/lib/cloudflare/bundle/wasm-plugin.js.map +1 -0
- package/lib/cloudflare/custom-domain.d.ts +3 -3
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-clone.d.ts +3 -3
- package/lib/cloudflare/d1-database.d.ts +3 -3
- package/lib/cloudflare/d1-export.d.ts +1 -1
- package/lib/cloudflare/d1-import.d.ts +1 -1
- package/lib/cloudflare/d1-migrations.d.ts +1 -1
- package/lib/cloudflare/dns-records.d.ts +4 -4
- package/lib/cloudflare/durable-object-namespace.d.ts +1 -1
- package/lib/cloudflare/event-source.d.ts +2 -2
- package/lib/cloudflare/hyperdrive.d.ts +4 -4
- package/lib/cloudflare/index.d.ts +40 -39
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +1 -0
- package/lib/cloudflare/index.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts +3 -3
- package/lib/cloudflare/nuxt.d.ts +4 -4
- package/lib/cloudflare/nuxt.d.ts.map +1 -1
- package/lib/cloudflare/nuxt.js +2 -1
- package/lib/cloudflare/nuxt.js.map +1 -1
- package/lib/cloudflare/permission-groups.d.ts +3 -3
- package/lib/cloudflare/pipeline.d.ts +4 -4
- package/lib/cloudflare/queue-consumer.d.ts +4 -4
- package/lib/cloudflare/queue.d.ts +3 -3
- package/lib/cloudflare/r2-rest-state-store.d.ts +3 -3
- package/lib/cloudflare/react-router.d.ts +13 -0
- package/lib/cloudflare/react-router.d.ts.map +1 -0
- package/lib/cloudflare/react-router.js +29 -0
- package/lib/cloudflare/react-router.js.map +1 -0
- package/lib/cloudflare/redwood.d.ts +4 -4
- package/lib/cloudflare/route.d.ts +4 -4
- package/lib/cloudflare/tanstack-start.d.ts +4 -4
- package/lib/cloudflare/user.d.ts +2 -2
- package/lib/cloudflare/vectorize-index.d.ts +3 -3
- package/lib/cloudflare/vectorize-metadata-index.d.ts +4 -4
- package/lib/cloudflare/vite.d.ts +4 -4
- package/lib/cloudflare/website.d.ts +3 -3
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +30 -35
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-assets.d.ts +3 -3
- package/lib/cloudflare/worker-metadata.d.ts +5 -5
- package/lib/cloudflare/worker-stub.d.ts +3 -3
- package/lib/cloudflare/worker.d.ts +12 -11
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +2 -1
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/workflow.d.ts +2 -2
- package/lib/cloudflare/wrangler.json.d.ts +13 -2
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +1 -0
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/cloudflare/zone.d.ts +4 -4
- package/lib/context.d.ts +3 -3
- package/lib/destroy.d.ts +2 -2
- package/lib/dns/import-dns.d.ts +3 -3
- package/lib/dns/index.d.ts +2 -2
- package/lib/esbuild/bundle.d.ts +2 -2
- package/lib/esbuild/index.d.ts +1 -1
- package/lib/fs/copy-file.d.ts +2 -2
- package/lib/fs/file-system-state-store.d.ts +2 -2
- package/lib/fs/file.d.ts +5 -5
- package/lib/fs/folder.d.ts +2 -2
- package/lib/fs/index.d.ts +14 -14
- package/lib/fs/static-astro-file.d.ts +1 -1
- package/lib/fs/static-css-file.d.ts +1 -1
- package/lib/fs/static-html-file.d.ts +1 -1
- package/lib/fs/static-json-file.d.ts +1 -1
- package/lib/fs/static-text-file.d.ts +1 -1
- package/lib/fs/static-typescript-file.d.ts +1 -1
- package/lib/fs/static-vue-file.d.ts +1 -1
- package/lib/fs/static-yaml-file.d.ts +1 -1
- package/lib/github/index.d.ts +2 -2
- package/lib/github/repository-environment.d.ts +2 -2
- package/lib/github/secret.d.ts +3 -3
- package/lib/index.d.ts +10 -10
- package/lib/internal/docs/providers.d.ts +2 -2
- package/lib/neon/api.d.ts +1 -1
- package/lib/neon/index.d.ts +3 -3
- package/lib/neon/project.d.ts +4 -4
- package/lib/os/exec.d.ts +2 -2
- package/lib/os/index.d.ts +1 -1
- package/lib/resource.d.ts +2 -2
- package/lib/runtime/bind.d.ts +3 -3
- package/lib/runtime/global.d.ts +1 -1
- package/lib/runtime/state.d.ts +1 -1
- package/lib/scope.d.ts +3 -3
- package/lib/sentry/api.d.ts +1 -1
- package/lib/sentry/client-key.d.ts +3 -3
- package/lib/sentry/index.d.ts +4 -4
- package/lib/sentry/project.d.ts +3 -3
- package/lib/sentry/team.d.ts +3 -3
- package/lib/serde.d.ts +3 -3
- package/lib/state.d.ts +2 -2
- package/lib/stripe/index.d.ts +4 -4
- package/lib/stripe/index.d.ts.map +1 -1
- package/lib/stripe/index.js +1 -1
- package/lib/stripe/index.js.map +1 -1
- package/lib/stripe/meter.d.ts +2 -2
- package/lib/stripe/price.d.ts +2 -2
- package/lib/stripe/product.d.ts +2 -2
- package/lib/stripe/webhook.d.ts +2 -2
- package/lib/test/bun.d.ts +3 -3
- package/lib/upstash/api.d.ts +1 -1
- package/lib/upstash/index.d.ts +3 -3
- package/lib/upstash/redis.d.ts +4 -4
- package/lib/vercel/api.d.ts +1 -1
- package/lib/vercel/index.d.ts +3 -3
- package/lib/vercel/project-domain.d.ts +3 -3
- package/lib/vercel/project.d.ts +4 -4
- package/lib/web/astro.d.ts +2 -2
- package/lib/web/shadcn-component.d.ts +2 -2
- package/lib/web/shadcn.d.ts +3 -3
- package/lib/web/tailwind.d.ts +2 -2
- package/lib/web/vite.d.ts +2 -2
- package/lib/web/vitepress/config.d.ts +1 -1
- package/lib/web/vitepress/custom-theme.d.ts +4 -4
- package/lib/web/vitepress/dependencies.d.ts +2 -2
- package/lib/web/vitepress/home-page.d.ts +3 -3
- package/lib/web/vitepress/index.d.ts +5 -5
- package/lib/web/vitepress/vitepress.d.ts +2 -2
- package/package.json +7 -7
- package/src/ai/astro-file.ts +5 -5
- package/src/ai/client.ts +1 -1
- package/src/ai/css-file.ts +5 -5
- package/src/ai/data.ts +5 -5
- package/src/ai/document.ts +5 -5
- package/src/ai/html-file.ts +5 -5
- package/src/ai/index.ts +10 -10
- package/src/ai/json-file.ts +6 -6
- package/src/ai/typescript-file.ts +5 -5
- package/src/ai/vue-file.ts +5 -5
- package/src/ai/yaml-file.ts +6 -6
- package/src/alchemy.ts +9 -9
- package/src/apply.ts +6 -6
- package/src/aws/bucket.ts +3 -3
- package/src/aws/control/client.ts +1 -1
- package/src/aws/control/error.ts +1 -1
- package/src/aws/control/index.ts +4 -4
- package/src/aws/control/proxy.ts +1 -1
- package/src/aws/control/resource.ts +5 -5
- package/src/aws/credentials.ts +1 -1
- package/src/aws/function.ts +4 -4
- package/src/aws/index.ts +9 -9
- package/src/aws/oidc/github-oidc-provider.ts +1 -1
- package/src/aws/oidc/index.ts +2 -2
- package/src/aws/oidc/oidc-provider.ts +3 -3
- package/src/aws/policy-attachment.ts +3 -3
- package/src/aws/policy.ts +2 -2
- package/src/aws/queue.ts +2 -2
- package/src/aws/role.ts +4 -4
- package/src/aws/ses.ts +3 -3
- package/src/aws/table.ts +4 -4
- package/src/cloudflare/account-api-token.ts +7 -7
- package/src/cloudflare/account-id.ts +1 -1
- package/src/cloudflare/ai-gateway.ts +6 -6
- package/src/cloudflare/api.ts +5 -5
- package/src/cloudflare/assets.ts +3 -3
- package/src/cloudflare/auth.ts +1 -1
- package/src/cloudflare/bindings.ts +18 -18
- package/src/cloudflare/bound.ts +16 -16
- package/src/cloudflare/bucket.ts +7 -7
- package/src/cloudflare/bundle/bundle-worker.ts +12 -8
- package/src/cloudflare/bundle/local-dev-cloudflare-shim.ts +1 -1
- package/src/cloudflare/bundle/nodejs-compat.ts +1 -1
- package/src/cloudflare/bundle/wasm-plugin.ts +57 -0
- package/src/cloudflare/custom-domain.ts +5 -5
- package/src/cloudflare/d1-clone.ts +3 -3
- package/src/cloudflare/d1-database.ts +7 -7
- package/src/cloudflare/d1-export.ts +1 -1
- package/src/cloudflare/d1-import.ts +1 -1
- package/src/cloudflare/d1-migrations.ts +2 -2
- package/src/cloudflare/dns-records.ts +5 -5
- package/src/cloudflare/durable-object-namespace.ts +1 -1
- package/src/cloudflare/event-source.ts +2 -2
- package/src/cloudflare/hyperdrive.ts +7 -7
- package/src/cloudflare/index.ts +40 -39
- package/src/cloudflare/kv-namespace.ts +7 -7
- package/src/cloudflare/nuxt.ts +6 -5
- package/src/cloudflare/permission-groups.ts +3 -3
- package/src/cloudflare/pipeline.ts +7 -7
- package/src/cloudflare/queue-consumer.ts +5 -5
- package/src/cloudflare/queue.ts +6 -6
- package/src/cloudflare/r2-rest-state-store.ts +8 -8
- package/src/cloudflare/react-router.ts +45 -0
- package/src/cloudflare/redwood.ts +4 -4
- package/src/cloudflare/route.ts +5 -5
- package/src/cloudflare/tanstack-start.ts +4 -4
- package/src/cloudflare/user.ts +3 -3
- package/src/cloudflare/vectorize-index.ts +6 -6
- package/src/cloudflare/vectorize-metadata-index.ts +5 -5
- package/src/cloudflare/vite.ts +4 -4
- package/src/cloudflare/website.ts +42 -48
- package/src/cloudflare/worker-assets.ts +4 -4
- package/src/cloudflare/worker-metadata.ts +7 -7
- package/src/cloudflare/worker-stub.ts +4 -4
- package/src/cloudflare/worker.ts +36 -33
- package/src/cloudflare/workflow.ts +3 -3
- package/src/cloudflare/wrangler.json.ts +17 -2
- package/src/cloudflare/zone.ts +5 -5
- package/src/context.ts +4 -4
- package/src/destroy.ts +4 -4
- package/src/dns/import-dns.ts +3 -3
- package/src/dns/index.ts +2 -2
- package/src/esbuild/bundle.ts +2 -2
- package/src/esbuild/index.ts +1 -1
- package/src/fs/copy-file.ts +3 -3
- package/src/fs/file-system-state-store.ts +5 -5
- package/src/fs/file.ts +7 -7
- package/src/fs/folder.ts +3 -3
- package/src/fs/index.ts +14 -14
- package/src/fs/static-astro-file.ts +1 -1
- package/src/fs/static-css-file.ts +1 -1
- package/src/fs/static-html-file.ts +1 -1
- package/src/fs/static-json-file.ts +1 -1
- package/src/fs/static-text-file.ts +1 -1
- package/src/fs/static-typescript-file.ts +1 -1
- package/src/fs/static-vue-file.ts +1 -1
- package/src/fs/static-yaml-file.ts +1 -1
- package/src/github/index.ts +2 -2
- package/src/github/repository-environment.ts +3 -3
- package/src/github/secret.ts +4 -4
- package/src/index.ts +10 -10
- package/src/internal/docs/providers.ts +4 -4
- package/src/neon/api.ts +2 -2
- package/src/neon/index.ts +3 -3
- package/src/neon/project.ts +6 -6
- package/src/os/exec.ts +2 -2
- package/src/os/index.ts +1 -1
- package/src/resource.ts +3 -3
- package/src/runtime/bind.ts +7 -7
- package/src/runtime/global.ts +1 -1
- package/src/runtime/state.ts +1 -1
- package/src/scope.ts +5 -5
- package/src/secret.ts +1 -1
- package/src/sentry/api.ts +2 -2
- package/src/sentry/client-key.ts +4 -4
- package/src/sentry/index.ts +4 -4
- package/src/sentry/project.ts +4 -4
- package/src/sentry/team.ts +4 -4
- package/src/serde.ts +4 -4
- package/src/state.ts +3 -3
- package/src/stripe/index.ts +4 -4
- package/src/stripe/meter.ts +2 -2
- package/src/stripe/price.ts +2 -2
- package/src/stripe/product.ts +2 -2
- package/src/stripe/webhook.ts +2 -2
- package/src/test/bun.ts +5 -5
- package/src/upstash/api.ts +1 -1
- package/src/upstash/index.ts +3 -3
- package/src/upstash/redis.ts +6 -6
- package/src/vercel/api.ts +2 -2
- package/src/vercel/index.ts +3 -3
- package/src/vercel/project-domain.ts +4 -4
- package/src/vercel/project.ts +4 -4
- package/src/web/astro.ts +7 -7
- package/src/web/shadcn-component.ts +3 -3
- package/src/web/shadcn.ts +6 -6
- package/src/web/tailwind.ts +4 -4
- package/src/web/vite.ts +8 -8
- package/src/web/vitepress/config.ts +1 -1
- package/src/web/vitepress/custom-theme.ts +10 -10
- package/src/web/vitepress/dependencies.ts +2 -2
- package/src/web/vitepress/home-page.ts +4 -4
- package/src/web/vitepress/index.ts +5 -5
- package/src/web/vitepress/vitepress.ts +7 -7
- package/lib/runtime/shims.d.ts +0 -6
- package/lib/runtime/shims.d.ts.map +0 -1
- package/lib/runtime/shims.js +0 -27
- package/lib/runtime/shims.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type esbuild from "esbuild";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
export const wasmPlugin: esbuild.Plugin = {
|
|
6
|
+
name: "wasm",
|
|
7
|
+
setup(build) {
|
|
8
|
+
// Resolve ".wasm" files to a path with a namespace
|
|
9
|
+
build.onResolve({ filter: /\.wasm$/ }, (args) => {
|
|
10
|
+
// If this is the import inside the stub module, import the
|
|
11
|
+
// binary itself. Put the path in the "wasm-binary" namespace
|
|
12
|
+
// to tell our binary load callback to load the binary file.
|
|
13
|
+
if (args.namespace === "wasm-stub") {
|
|
14
|
+
return {
|
|
15
|
+
path: args.path,
|
|
16
|
+
namespace: "wasm-binary",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Otherwise, generate the JavaScript stub module for this
|
|
21
|
+
// ".wasm" file. Put it in the "wasm-stub" namespace to tell
|
|
22
|
+
// our stub load callback to fill it with JavaScript.
|
|
23
|
+
//
|
|
24
|
+
// Resolve relative paths to absolute paths here since this
|
|
25
|
+
// resolve callback is given "resolveDir", the directory to
|
|
26
|
+
// resolve imports against.
|
|
27
|
+
if (args.resolveDir === "") {
|
|
28
|
+
return; // Ignore unresolvable paths
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
path: path.isAbsolute(args.path)
|
|
32
|
+
? args.path
|
|
33
|
+
: path.join(args.resolveDir, args.path),
|
|
34
|
+
namespace: "wasm-stub",
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Virtual modules in the "wasm-stub" namespace are filled with
|
|
39
|
+
// the JavaScript code for compiling the WebAssembly binary. The
|
|
40
|
+
// binary itself is imported from a second virtual module.
|
|
41
|
+
build.onLoad({ filter: /.*/, namespace: "wasm-stub" }, async (args) => ({
|
|
42
|
+
contents: `import wasm from ${JSON.stringify(args.path)}
|
|
43
|
+
export default (imports) =>
|
|
44
|
+
WebAssembly.instantiate(wasm, imports).then(
|
|
45
|
+
result => result.instance.exports)`,
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
// Virtual modules in the "wasm-binary" namespace contain the
|
|
49
|
+
// actual bytes of the WebAssembly file. This uses esbuild's
|
|
50
|
+
// built-in "binary" loader instead of manually embedding the
|
|
51
|
+
// binary data inside JavaScript code ourselves.
|
|
52
|
+
build.onLoad({ filter: /.*/, namespace: "wasm-binary" }, async (args) => ({
|
|
53
|
+
contents: await fs.promises.readFile(args.path),
|
|
54
|
+
loader: "binary",
|
|
55
|
+
}));
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource } from "../resource.
|
|
3
|
-
import { handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { handleApiError } from "./api-error.ts";
|
|
4
4
|
import {
|
|
5
|
-
type CloudflareApi,
|
|
6
5
|
createCloudflareApi,
|
|
6
|
+
type CloudflareApi,
|
|
7
7
|
type CloudflareApiOptions,
|
|
8
|
-
} from "./api.
|
|
8
|
+
} from "./api.ts";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Properties for creating or updating a CustomDomain
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { CloudflareApi } from "./api.
|
|
1
|
+
import type { CloudflareApi } from "./api.ts";
|
|
2
2
|
import {
|
|
3
3
|
exportD1Database,
|
|
4
4
|
type ExportD1DatabaseOptions,
|
|
5
5
|
type ExportD1DatabaseResult,
|
|
6
|
-
} from "./d1-export.
|
|
6
|
+
} from "./d1-export.ts";
|
|
7
7
|
import {
|
|
8
8
|
importD1Database,
|
|
9
9
|
type ImportD1DatabaseOptions,
|
|
10
10
|
type ImportD1DatabaseResult,
|
|
11
|
-
} from "./d1-import.
|
|
11
|
+
} from "./d1-import.ts";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Options for cloning a D1 database
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource, ResourceKind } from "../resource.
|
|
3
|
-
import { bind, type Bound } from "../runtime/bind.
|
|
4
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource, ResourceKind } from "../resource.ts";
|
|
3
|
+
import { bind, type Bound } from "../runtime/bind.ts";
|
|
4
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
5
5
|
import {
|
|
6
6
|
createCloudflareApi,
|
|
7
7
|
type CloudflareApi,
|
|
8
8
|
type CloudflareApiOptions,
|
|
9
|
-
} from "./api.
|
|
10
|
-
import { cloneD1Database } from "./d1-clone.
|
|
11
|
-
import { applyMigrations, listMigrationsFiles } from "./d1-migrations.
|
|
9
|
+
} from "./api.ts";
|
|
10
|
+
import { cloneD1Database } from "./d1-clone.ts";
|
|
11
|
+
import { applyMigrations, listMigrationsFiles } from "./d1-migrations.ts";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Properties for creating or updating a D1 Database
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
import { handleApiError } from "./api-error.
|
|
4
|
-
import type { CloudflareApi } from "./api.
|
|
3
|
+
import { handleApiError } from "./api-error.ts";
|
|
4
|
+
import type { CloudflareApi } from "./api.ts";
|
|
5
5
|
|
|
6
6
|
export interface D1MigrationOptions {
|
|
7
7
|
migrationsFiles: Array<{ id: string; sql: string }>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
2
|
import type {
|
|
3
3
|
DnsRecord as BaseDnsRecord,
|
|
4
4
|
DnsRecordType,
|
|
5
5
|
DnsRecordWithMetadata,
|
|
6
|
-
} from "../dns/record.
|
|
7
|
-
import { Resource } from "../resource.
|
|
6
|
+
} from "../dns/record.ts";
|
|
7
|
+
import { Resource } from "../resource.ts";
|
|
8
8
|
import {
|
|
9
9
|
type CloudflareApi,
|
|
10
10
|
type CloudflareApiOptions,
|
|
11
11
|
createCloudflareApi,
|
|
12
|
-
} from "./api.
|
|
13
|
-
import type { CloudflareResponse } from "./response.
|
|
12
|
+
} from "./api.ts";
|
|
13
|
+
import type { CloudflareResponse } from "./response.ts";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Cloudflare DNS Record response format
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QueueConsumerSettings } from "./queue-consumer.
|
|
2
|
-
import type { QueueResource } from "./queue.
|
|
1
|
+
import type { QueueConsumerSettings } from "./queue-consumer.ts";
|
|
2
|
+
import type { QueueResource } from "./queue.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Base interface for event sources that can be bound to a Worker
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource } from "../resource.
|
|
3
|
-
import { tryGetBinding } from "../runtime/bind.
|
|
4
|
-
import type { Secret } from "../secret.
|
|
5
|
-
import { handleApiError } from "./api-error.
|
|
6
|
-
import { createCloudflareApi, type CloudflareApiOptions } from "./api.
|
|
7
|
-
import type { Bound } from "./bound.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { tryGetBinding } from "../runtime/bind.ts";
|
|
4
|
+
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { handleApiError } from "./api-error.ts";
|
|
6
|
+
import { createCloudflareApi, type CloudflareApiOptions } from "./api.ts";
|
|
7
|
+
import type { Bound } from "./bound.ts";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Origin configuration for a PostgreSQL database connection
|
package/src/cloudflare/index.ts
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
export * from "./account-api-token.
|
|
2
|
-
export * from "./account-id.
|
|
3
|
-
export * from "./ai-gateway.
|
|
4
|
-
export * from "./ai.
|
|
5
|
-
export * from "./api-error.
|
|
6
|
-
export * from "./api.
|
|
7
|
-
export * from "./assets.
|
|
8
|
-
export * from "./bindings.
|
|
9
|
-
export * from "./bound.
|
|
10
|
-
export * from "./browser-rendering.
|
|
11
|
-
export * from "./bucket.
|
|
12
|
-
export * from "./bundle/external.
|
|
13
|
-
export * from "./bundle/local-dev-cloudflare-shim.
|
|
14
|
-
export * from "./custom-domain.
|
|
15
|
-
export * from "./d1-clone.
|
|
16
|
-
export * from "./d1-database.
|
|
17
|
-
export * from "./d1-export.
|
|
18
|
-
export * from "./d1-import.
|
|
19
|
-
export * from "./dns-records.
|
|
20
|
-
export * from "./durable-object-namespace.
|
|
21
|
-
export * from "./hyperdrive.
|
|
22
|
-
export * from "./kv-namespace.
|
|
23
|
-
export * from "./nuxt.
|
|
24
|
-
export * from "./permission-groups.
|
|
25
|
-
export * from "./pipeline.
|
|
26
|
-
export * from "./queue-consumer.
|
|
27
|
-
export * from "./queue.
|
|
28
|
-
export * from "./r2-rest-state-store.
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./
|
|
31
|
-
export * from "./
|
|
32
|
-
export * from "./
|
|
33
|
-
export * from "./vectorize-
|
|
34
|
-
export * from "./
|
|
35
|
-
export * from "./
|
|
36
|
-
export * from "./
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export * from "./
|
|
1
|
+
export * from "./account-api-token.ts";
|
|
2
|
+
export * from "./account-id.ts";
|
|
3
|
+
export * from "./ai-gateway.ts";
|
|
4
|
+
export * from "./ai.ts";
|
|
5
|
+
export * from "./api-error.ts";
|
|
6
|
+
export * from "./api.ts";
|
|
7
|
+
export * from "./assets.ts";
|
|
8
|
+
export * from "./bindings.ts";
|
|
9
|
+
export * from "./bound.ts";
|
|
10
|
+
export * from "./browser-rendering.ts";
|
|
11
|
+
export * from "./bucket.ts";
|
|
12
|
+
export * from "./bundle/external.ts";
|
|
13
|
+
export * from "./bundle/local-dev-cloudflare-shim.ts";
|
|
14
|
+
export * from "./custom-domain.ts";
|
|
15
|
+
export * from "./d1-clone.ts";
|
|
16
|
+
export * from "./d1-database.ts";
|
|
17
|
+
export * from "./d1-export.ts";
|
|
18
|
+
export * from "./d1-import.ts";
|
|
19
|
+
export * from "./dns-records.ts";
|
|
20
|
+
export * from "./durable-object-namespace.ts";
|
|
21
|
+
export * from "./hyperdrive.ts";
|
|
22
|
+
export * from "./kv-namespace.ts";
|
|
23
|
+
export * from "./nuxt.ts";
|
|
24
|
+
export * from "./permission-groups.ts";
|
|
25
|
+
export * from "./pipeline.ts";
|
|
26
|
+
export * from "./queue-consumer.ts";
|
|
27
|
+
export * from "./queue.ts";
|
|
28
|
+
export * from "./r2-rest-state-store.ts";
|
|
29
|
+
export * from "./react-router.ts";
|
|
30
|
+
export * from "./redwood.ts";
|
|
31
|
+
export * from "./route.ts";
|
|
32
|
+
export * from "./tanstack-start.ts";
|
|
33
|
+
export * from "./vectorize-index.ts";
|
|
34
|
+
export * from "./vectorize-metadata-index.ts";
|
|
35
|
+
export * from "./vite.ts";
|
|
36
|
+
export * from "./website.ts";
|
|
37
|
+
export * from "./worker.ts";
|
|
38
|
+
export { Workflow } from "./workflow.ts";
|
|
39
|
+
export * from "./wrangler.json.ts";
|
|
40
|
+
export * from "./zone.ts";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource, ResourceKind } from "../resource.
|
|
3
|
-
import { bind } from "../runtime/bind.
|
|
4
|
-
import { withExponentialBackoff } from "../util/retry.
|
|
5
|
-
import { handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource, ResourceKind } from "../resource.ts";
|
|
3
|
+
import { bind } from "../runtime/bind.ts";
|
|
4
|
+
import { withExponentialBackoff } from "../util/retry.ts";
|
|
5
|
+
import { handleApiError } from "./api-error.ts";
|
|
6
6
|
import {
|
|
7
7
|
createCloudflareApi,
|
|
8
8
|
type CloudflareApi,
|
|
9
9
|
type CloudflareApiOptions,
|
|
10
|
-
} from "./api.
|
|
11
|
-
import type { Bound } from "./bound.
|
|
10
|
+
} from "./api.ts";
|
|
11
|
+
import type { Bound } from "./bound.ts";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Properties for creating or updating a KV Namespace
|
package/src/cloudflare/nuxt.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import type
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import type { Assets } from "./assets.ts";
|
|
3
|
+
import type { Bindings } from "./bindings.ts";
|
|
4
|
+
import { Website, type WebsiteProps } from "./website.ts";
|
|
5
|
+
import type { Worker } from "./worker.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Properties for creating a Nuxt resource.
|
|
@@ -57,7 +58,7 @@ export async function Nuxt<B extends Bindings>(
|
|
|
57
58
|
// Default entry point for cloudflare-module preset
|
|
58
59
|
main: props?.main ?? "./index.ts",
|
|
59
60
|
// Default static assets directory for cloudflare-module preset
|
|
60
|
-
assets: props?.assets ?? "
|
|
61
|
+
assets: props?.assets ?? path.join(".output", "public"),
|
|
61
62
|
// Ensure nodejs_compat flag is included for Nuxt compatibility
|
|
62
63
|
compatibilityFlags: ["nodejs_compat", ...(props?.compatibilityFlags ?? [])],
|
|
63
64
|
// Enable wrangler by default, common for Nuxt/Cloudflare deployments
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource } from "../resource.
|
|
3
|
-
import { createCloudflareApi, type CloudflareApiOptions } from "./api.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { createCloudflareApi, type CloudflareApiOptions } from "./api.ts";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Cloudflare permission group as returned by the API
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource, ResourceKind } from "../resource.
|
|
3
|
-
import { bind } from "../runtime/bind.
|
|
4
|
-
import type { Secret } from "../secret.
|
|
5
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource, ResourceKind } from "../resource.ts";
|
|
3
|
+
import { bind } from "../runtime/bind.ts";
|
|
4
|
+
import type { Secret } from "../secret.ts";
|
|
5
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
6
6
|
import {
|
|
7
7
|
createCloudflareApi,
|
|
8
8
|
type CloudflareApi,
|
|
9
9
|
type CloudflareApiOptions,
|
|
10
|
-
} from "./api.
|
|
11
|
-
import type { Bound } from "./bound.
|
|
10
|
+
} from "./api.ts";
|
|
11
|
+
import type { Bound } from "./bound.ts";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Settings for compression of pipeline output
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource } from "../resource.
|
|
3
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
4
4
|
import {
|
|
5
5
|
createCloudflareApi,
|
|
6
6
|
type CloudflareApi,
|
|
7
7
|
type CloudflareApiOptions,
|
|
8
|
-
} from "./api.
|
|
9
|
-
import type { QueueResource } from "./queue.
|
|
8
|
+
} from "./api.ts";
|
|
9
|
+
import type { QueueResource } from "./queue.ts";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Settings for configuring a Queue Consumer
|
package/src/cloudflare/queue.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource, ResourceKind } from "../resource.
|
|
3
|
-
import { bind } from "../runtime/bind.
|
|
4
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource, ResourceKind } from "../resource.ts";
|
|
3
|
+
import { bind } from "../runtime/bind.ts";
|
|
4
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
5
5
|
import {
|
|
6
6
|
createCloudflareApi,
|
|
7
7
|
type CloudflareApi,
|
|
8
8
|
type CloudflareApiOptions,
|
|
9
|
-
} from "./api.
|
|
10
|
-
import type { Bound } from "./bound.
|
|
9
|
+
} from "./api.ts";
|
|
10
|
+
import type { Bound } from "./bound.ts";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Settings for a Cloudflare Queue
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ResourceScope } from "../resource.
|
|
2
|
-
import type { Scope } from "../scope.
|
|
3
|
-
import { serialize } from "../serde.
|
|
4
|
-
import { deserializeState, type State, type StateStore } from "../state.
|
|
5
|
-
import { withExponentialBackoff } from "../util/retry.
|
|
6
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import { ResourceScope } from "../resource.ts";
|
|
2
|
+
import type { Scope } from "../scope.ts";
|
|
3
|
+
import { serialize } from "../serde.ts";
|
|
4
|
+
import { deserializeState, type State, type StateStore } from "../state.ts";
|
|
5
|
+
import { withExponentialBackoff } from "../util/retry.ts";
|
|
6
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
7
7
|
import {
|
|
8
8
|
type CloudflareApi,
|
|
9
9
|
type CloudflareApiOptions,
|
|
10
10
|
createCloudflareApi,
|
|
11
|
-
} from "./api.
|
|
12
|
-
import { createBucket, getBucket } from "./bucket.
|
|
11
|
+
} from "./api.ts";
|
|
12
|
+
import { createBucket, getBucket } from "./bucket.ts";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Options for CloudflareR2StateStore
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import type { Assets } from "./assets.js";
|
|
3
|
+
import type { Bindings } from "./bindings.js";
|
|
4
|
+
import { Website, type WebsiteProps } from "./website.js";
|
|
5
|
+
import type { Worker } from "./worker.js";
|
|
6
|
+
|
|
7
|
+
export interface ReactRouterProps<B extends Bindings> extends WebsiteProps<B> {}
|
|
8
|
+
|
|
9
|
+
// don't allow the ASSETS to be overriden
|
|
10
|
+
export type ReactRouter<B extends Bindings> = B extends { ASSETS: any }
|
|
11
|
+
? never
|
|
12
|
+
: Worker<B & { ASSETS: Assets }>;
|
|
13
|
+
|
|
14
|
+
export async function ReactRouter<B extends Bindings>(
|
|
15
|
+
id: string,
|
|
16
|
+
props: ReactRouterProps<B>,
|
|
17
|
+
): Promise<ReactRouter<B>> {
|
|
18
|
+
const defaultAssets = path.join("build", "client");
|
|
19
|
+
return Website(id, {
|
|
20
|
+
...props,
|
|
21
|
+
// Alchemy should bundle the result of `vite built`, not the user's main
|
|
22
|
+
// TODO: we probably need bundling to properly handle WASM/rules
|
|
23
|
+
main: path.join(props.cwd ?? process.cwd(), "build", "server", "index.js"),
|
|
24
|
+
wrangler: {
|
|
25
|
+
// wrangler should point to the user's main (e.g. `worker.ts`), unless overridden
|
|
26
|
+
main:
|
|
27
|
+
typeof props.wrangler === "object"
|
|
28
|
+
? (props.wrangler.main ?? props.main)
|
|
29
|
+
: props.main,
|
|
30
|
+
// write to wrangler.json by default but respect overrides
|
|
31
|
+
path:
|
|
32
|
+
typeof props.wrangler === "string"
|
|
33
|
+
? props.wrangler
|
|
34
|
+
: typeof props.wrangler === "object"
|
|
35
|
+
? props.wrangler.path
|
|
36
|
+
: undefined,
|
|
37
|
+
},
|
|
38
|
+
assets:
|
|
39
|
+
typeof props.assets === "object"
|
|
40
|
+
? {
|
|
41
|
+
dist: props.assets.dist ?? defaultAssets,
|
|
42
|
+
}
|
|
43
|
+
: (props.assets ?? defaultAssets),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import type { Assets } from "./assets.
|
|
3
|
-
import type { Bindings } from "./bindings.
|
|
4
|
-
import { Website, type WebsiteProps } from "./website.
|
|
5
|
-
import type { Worker } from "./worker.
|
|
2
|
+
import type { Assets } from "./assets.ts";
|
|
3
|
+
import type { Bindings } from "./bindings.ts";
|
|
4
|
+
import { Website, type WebsiteProps } from "./website.ts";
|
|
5
|
+
import type { Worker } from "./worker.ts";
|
|
6
6
|
|
|
7
7
|
export interface RedwoodProps<B extends Bindings> extends WebsiteProps<B> {}
|
|
8
8
|
|
package/src/cloudflare/route.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource } from "../resource.
|
|
3
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource } from "../resource.ts";
|
|
3
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
4
4
|
import {
|
|
5
5
|
createCloudflareApi,
|
|
6
6
|
type CloudflareApi,
|
|
7
7
|
type CloudflareApiOptions,
|
|
8
|
-
} from "./api.
|
|
9
|
-
import type { Worker } from "./worker.
|
|
8
|
+
} from "./api.ts";
|
|
9
|
+
import type { Worker } from "./worker.ts";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Properties for creating or updating a Route
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Assets } from "./assets.
|
|
2
|
-
import type { Bindings } from "./bindings.
|
|
3
|
-
import { Website, type WebsiteProps } from "./website.
|
|
4
|
-
import type { Worker } from "./worker.
|
|
1
|
+
import type { Assets } from "./assets.ts";
|
|
2
|
+
import type { Bindings } from "./bindings.ts";
|
|
3
|
+
import { Website, type WebsiteProps } from "./website.ts";
|
|
4
|
+
import type { Worker } from "./worker.ts";
|
|
5
5
|
|
|
6
6
|
export interface TanStackStartProps<B extends Bindings>
|
|
7
7
|
extends WebsiteProps<B> {}
|
package/src/cloudflare/user.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Secret } from "../secret.
|
|
2
|
-
import { CloudflareApiError } from "./api-error.
|
|
1
|
+
import type { Secret } from "../secret.ts";
|
|
2
|
+
import { CloudflareApiError } from "./api-error.ts";
|
|
3
3
|
import {
|
|
4
4
|
getCloudflareAuthHeaders,
|
|
5
5
|
type CloudflareAuthOptions,
|
|
6
|
-
} from "./auth.
|
|
6
|
+
} from "./auth.ts";
|
|
7
7
|
|
|
8
8
|
export interface CloudflareAccount {
|
|
9
9
|
name: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource, ResourceKind } from "../resource.
|
|
3
|
-
import { bind } from "../runtime/bind.
|
|
4
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource, ResourceKind } from "../resource.ts";
|
|
3
|
+
import { bind } from "../runtime/bind.ts";
|
|
4
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
5
5
|
import {
|
|
6
6
|
createCloudflareApi,
|
|
7
7
|
type CloudflareApi,
|
|
8
8
|
type CloudflareApiOptions,
|
|
9
|
-
} from "./api.
|
|
10
|
-
import type { Bound } from "./bound.
|
|
9
|
+
} from "./api.ts";
|
|
10
|
+
import type { Bound } from "./bound.ts";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Properties for creating or updating a Vectorize Index
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Context } from "../context.
|
|
2
|
-
import { Resource, ResourceKind } from "../resource.
|
|
3
|
-
import { CloudflareApiError, handleApiError } from "./api-error.
|
|
1
|
+
import type { Context } from "../context.ts";
|
|
2
|
+
import { Resource, ResourceKind } from "../resource.ts";
|
|
3
|
+
import { CloudflareApiError, handleApiError } from "./api-error.ts";
|
|
4
4
|
import {
|
|
5
5
|
createCloudflareApi,
|
|
6
6
|
type CloudflareApi,
|
|
7
7
|
type CloudflareApiOptions,
|
|
8
|
-
} from "./api.
|
|
9
|
-
import type { VectorizeIndexResource } from "./vectorize-index.
|
|
8
|
+
} from "./api.ts";
|
|
9
|
+
import type { VectorizeIndexResource } from "./vectorize-index.ts";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Properties for creating or deleting a Vectorize Metadata Index
|
package/src/cloudflare/vite.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import type { Assets } from "./assets.
|
|
3
|
-
import type { Bindings } from "./bindings.
|
|
4
|
-
import { Website, type WebsiteProps } from "./website.
|
|
5
|
-
import type { Worker } from "./worker.
|
|
2
|
+
import type { Assets } from "./assets.ts";
|
|
3
|
+
import type { Bindings } from "./bindings.ts";
|
|
4
|
+
import { Website, type WebsiteProps } from "./website.ts";
|
|
5
|
+
import type { Worker } from "./worker.ts";
|
|
6
6
|
|
|
7
7
|
export interface ViteProps<B extends Bindings> extends WebsiteProps<B> {}
|
|
8
8
|
|