devflare 1.0.0-next.39 → 1.0.0-next.40
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/dist/_chunks/account-BtWcv3X9.js +462 -0
- package/dist/_chunks/account-resources-CsmVowJp.js +159 -0
- package/dist/_chunks/ai-CBEuLdoP.js +322 -0
- package/dist/_chunks/api-TzdliH-6.js +568 -0
- package/dist/_chunks/build-3T6O4uIg.js +24 -0
- package/dist/_chunks/build-artifacts-8TqBSQkG.js +483 -0
- package/dist/_chunks/cli-BTF1X4SG.js +1128 -0
- package/dist/_chunks/cloudflare-BaloqI3H.js +157 -0
- package/dist/_chunks/colors-DiK6wPJ5.js +13 -0
- package/dist/_chunks/command-utils-BsfkmTqh.js +45 -0
- package/dist/_chunks/compiler-uoyAQ8zW.js +424 -0
- package/dist/_chunks/config-D5u-bEkn.js +78 -0
- package/dist/_chunks/config-path-DCPto4XB.js +42 -0
- package/dist/_chunks/context-CX50Y2Kb.js +2250 -0
- package/dist/_chunks/decorators-QmV57ixr.js +19 -0
- package/dist/_chunks/dependencies-C2oxFjU_.js +57 -0
- package/dist/_chunks/deploy-DMTr6JeR.js +915 -0
- package/dist/_chunks/dev-CvRHmRFZ.js +3456 -0
- package/dist/_chunks/doctor-DIG8DoFU.js +219 -0
- package/dist/_chunks/durable-object-DMtH0XYX.js +234 -0
- package/dist/_chunks/env-S0_nMVz1.js +125 -0
- package/dist/_chunks/family-DXC5SdFK.js +143 -0
- package/dist/_chunks/generated-artifacts-dMJY4KAt.js +32 -0
- package/dist/_chunks/glob-CmQOvunB.js +56 -0
- package/dist/_chunks/init-3moXTgpb.js +165 -0
- package/dist/_chunks/loader-DLXO60RO.js +1153 -0
- package/dist/_chunks/local-dev-vars-CTSa-wvF.js +81 -0
- package/dist/_chunks/local-hyperdrive-CJ90j46O.js +119 -0
- package/dist/_chunks/local-media-bindings-DsAW4AMF.js +335 -0
- package/dist/_chunks/local-secrets-DMmEOygL.js +123 -0
- package/dist/_chunks/local-workflow-entrypoints-Wip3o1u8.js +90 -0
- package/dist/_chunks/login-BmnDzDlH.js +51 -0
- package/dist/_chunks/package-metadata-DAuCkyvK.js +39 -0
- package/dist/_chunks/preferences-BKp_7XJx.js +241 -0
- package/dist/_chunks/preview-BhqDmq8I.js +456 -0
- package/dist/_chunks/preview-registry-ClAbLTHH.js +1186 -0
- package/dist/_chunks/preview-resources-DdXj8LMM.js +358 -0
- package/dist/_chunks/previews-Dlr13x5M.js +1134 -0
- package/dist/_chunks/productions-D3AnOHac.js +411 -0
- package/dist/_chunks/ref-CYJNAAe_.js +178 -0
- package/dist/_chunks/remote-CZnP-HLJ.js +79 -0
- package/dist/_chunks/remote-config-D39BY9ji.js +132 -0
- package/dist/_chunks/resolve-package-Y84HB3Nt.js +133 -0
- package/dist/_chunks/rolldown-runtime-CvQ6eiug.js +14 -0
- package/dist/_chunks/routes-C3FqES2W.js +796 -0
- package/dist/_chunks/runtime-FvXvfuZ2.js +550 -0
- package/dist/_chunks/schema-normalization-DWVleVxo.js +477 -0
- package/dist/_chunks/secrets-70eN0Q6C.js +95 -0
- package/dist/_chunks/token-kguIDmej.js +333 -0
- package/dist/_chunks/tokens-iVcgNXi-.js +221 -0
- package/dist/_chunks/types-OrLbzv4I.js +476 -0
- package/dist/_chunks/ui-BUoZApvE.js +103 -0
- package/dist/_chunks/usage-BBTGzjon.js +272 -0
- package/dist/_chunks/vite-CsI0E-uV.js +1235 -0
- package/dist/_chunks/vite-utils-OVLMV605.js +183 -0
- package/dist/_chunks/worker-CS1jgNFE.js +410 -0
- package/dist/_chunks/worker-bundler-dTTnYU3n.js +458 -0
- package/dist/_chunks/worker-entrypoint-CQW77lG8.js +247 -0
- package/dist/_chunks/workerName-CFJsLZA-.js +23 -0
- package/dist/bridge/index.d.ts +6 -6
- package/dist/bridge/miniflare.d.ts +2 -2
- package/dist/bridge/proxy.d.ts +1 -1
- package/dist/bridge/v2/body-streams.d.ts +1 -1
- package/dist/bridge/v2/codec.d.ts +4 -4
- package/dist/bridge/v2/index.d.ts +10 -10
- package/dist/bridge/v2/serialization.d.ts +1 -1
- package/dist/bridge/v2/value-codec.d.ts +1 -1
- package/dist/bridge/v2/value-serialization.d.ts.map +1 -1
- package/dist/bridge/v2/ws-relay.d.ts +3 -3
- package/dist/browser-shim/index.d.ts +2 -2
- package/dist/browser.d.ts +70 -70
- package/dist/browser.js +74 -2462
- package/dist/bundler/do-bundler.d.ts +1 -1
- package/dist/bundler/index.d.ts +3 -3
- package/dist/bundler/rolldown-shared.d.ts +1 -1
- package/dist/bundler/worker-bundler.d.ts +1 -1
- package/dist/cli/build-manifest.d.ts +1 -1
- package/dist/cli/command-utils.d.ts +1 -1
- package/dist/cli/commands/account.d.ts +1 -1
- package/dist/cli/commands/ai.d.ts +1 -1
- package/dist/cli/commands/build-artifacts.d.ts +5 -5
- package/dist/cli/commands/build.d.ts +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/deploy/prepare.d.ts +2 -2
- package/dist/cli/commands/deploy/runtime.d.ts +1 -1
- package/dist/cli/commands/deploy/verification.d.ts +1 -1
- package/dist/cli/commands/deploy.d.ts +1 -1
- package/dist/cli/commands/dev.d.ts +1 -1
- package/dist/cli/commands/doctor.d.ts +1 -1
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/login.d.ts +1 -1
- package/dist/cli/commands/previews-support/cleanup.d.ts +1 -1
- package/dist/cli/commands/previews-support/family.d.ts +3 -3
- package/dist/cli/commands/previews-support/render.d.ts +3 -3
- package/dist/cli/commands/previews-support/theme.d.ts +2 -2
- package/dist/cli/commands/previews-support/types.d.ts +2 -2
- package/dist/cli/commands/previews.d.ts +1 -1
- package/dist/cli/commands/productions.d.ts +1 -1
- package/dist/cli/commands/remote.d.ts +1 -1
- package/dist/cli/commands/secrets.d.ts +1 -1
- package/dist/cli/commands/token.d.ts +1 -1
- package/dist/cli/commands/type-generation/discovery.d.ts +2 -2
- package/dist/cli/commands/type-generation/generator.d.ts +3 -3
- package/dist/cli/commands/type-generation/models.d.ts +1 -1
- package/dist/cli/commands/types.d.ts +1 -1
- package/dist/cli/commands/worker.d.ts +1 -1
- package/dist/cli/deploy-strategy.d.ts +1 -1
- package/dist/cli/deploy-target.d.ts +1 -1
- package/dist/cli/help-pages/pages/account.d.ts +1 -1
- package/dist/cli/help-pages/pages/core.d.ts +1 -1
- package/dist/cli/help-pages/pages/index.d.ts +1 -1
- package/dist/cli/help-pages/pages/misc.d.ts +1 -1
- package/dist/cli/help-pages/pages/previews.d.ts +1 -1
- package/dist/cli/help-pages/pages/productions.d.ts +1 -1
- package/dist/cli/help-pages/render.d.ts +2 -2
- package/dist/cli/help-pages/shared.d.ts +1 -1
- package/dist/cli/help.d.ts +2 -2
- package/dist/cli/index.js +2 -1383
- package/dist/cli/preview-bindings.d.ts +3 -3
- package/dist/cli/preview.d.ts +1 -1
- package/dist/cli/wrangler-auth.d.ts +1 -1
- package/dist/cloudflare/account-core.d.ts +2 -2
- package/dist/cloudflare/account-resources.d.ts +2 -2
- package/dist/cloudflare/account-status.d.ts +1 -1
- package/dist/cloudflare/account-workers.d.ts +2 -2
- package/dist/cloudflare/account.d.ts +7 -7
- package/dist/cloudflare/auth.d.ts +1 -1
- package/dist/cloudflare/index.d.ts +13 -13
- package/dist/cloudflare/index.js +4 -59
- package/dist/cloudflare/kv-namespace.d.ts +1 -1
- package/dist/cloudflare/preview-registry-cache.d.ts +1 -1
- package/dist/cloudflare/preview-registry-inference.d.ts +2 -2
- package/dist/cloudflare/preview-registry-records.d.ts +3 -3
- package/dist/cloudflare/preview-registry-shape.d.ts +2 -2
- package/dist/cloudflare/preview-registry-store.d.ts +3 -3
- package/dist/cloudflare/preview-registry-transport.d.ts +2 -2
- package/dist/cloudflare/preview-registry-types.d.ts +2 -2
- package/dist/cloudflare/preview-registry.d.ts +5 -5
- package/dist/cloudflare/tokens.d.ts +2 -2
- package/dist/cloudflare/usage.d.ts +2 -2
- package/dist/config/binding-resolution-helpers.d.ts +1 -1
- package/dist/config/compiler/bindings.d.ts +2 -2
- package/dist/config/compiler/core-helpers.d.ts +2 -2
- package/dist/config/compiler/do-workers.d.ts +2 -2
- package/dist/config/compiler/paths.d.ts +1 -1
- package/dist/config/compiler.d.ts +6 -6
- package/dist/config/define.d.ts +2 -2
- package/dist/config/deploy-resources.d.ts +5 -5
- package/dist/config/env-vars.d.ts +1 -1
- package/dist/config/framework-providers.d.ts +1 -1
- package/dist/config/index.d.ts +12 -12
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/local-dev-vars.d.ts +1 -1
- package/dist/config/preview-resources.d.ts +4 -4
- package/dist/config/preview.d.ts +1 -1
- package/dist/config/ref.d.ts +2 -2
- package/dist/config/resolve-phased.d.ts +4 -4
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resource-resolution.d.ts +6 -6
- package/dist/config/schema-env.d.ts +20 -20
- package/dist/config/schema-normalization.d.ts +1 -1
- package/dist/config/schema-types-bindings.d.ts +4 -4
- package/dist/config/schema-types-build.d.ts +1 -1
- package/dist/config/schema-types.d.ts +7 -7
- package/dist/config/schema.d.ts +46 -46
- package/dist/config/service-bindings-validation.d.ts +1 -1
- package/dist/config-entry.d.ts +6 -6
- package/dist/config-entry.js +3 -8
- package/dist/decorators/index.d.ts +2 -2
- package/dist/decorators/index.js +2 -9
- package/dist/dev-server/d1-migrations.d.ts +1 -1
- package/dist/dev-server/dev-server-state.d.ts +6 -6
- package/dist/dev-server/gateway-script.d.ts +1 -1
- package/dist/dev-server/index.d.ts +1 -1
- package/dist/dev-server/miniflare-bindings.d.ts +1 -1
- package/dist/dev-server/miniflare-dev-config.d.ts +5 -5
- package/dist/dev-server/miniflare-worker-config.d.ts +3 -3
- package/dist/dev-server/server-startup-helpers.d.ts +6 -6
- package/dist/dev-server/worker-surface-paths.d.ts +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -22
- package/dist/runtime/context-events.d.ts +1 -1
- package/dist/runtime/context.d.ts +3 -3
- package/dist/runtime/exports.d.ts +2 -2
- package/dist/runtime/index.d.ts +10 -10
- package/dist/runtime/index.js +5 -57
- package/dist/runtime/middleware.d.ts +1 -1
- package/dist/runtime/router/index.d.ts +3 -3
- package/dist/runtime/validation.d.ts +1 -1
- package/dist/secrets/local-secrets.d.ts +1 -1
- package/dist/shims/local-media-bindings.d.ts +1 -1
- package/dist/sveltekit/index.d.ts +1 -1
- package/dist/sveltekit/index.js +327 -9
- package/dist/sveltekit/local-bindings.d.ts +1 -1
- package/dist/sveltekit/platform.d.ts +1 -1
- package/dist/test/binding-hints.d.ts +2 -2
- package/dist/test/cf.d.ts +19 -19
- package/dist/test/index.d.ts +18 -18
- package/dist/test/index.js +4495 -46
- package/dist/test/offline-bindings.d.ts +3 -3
- package/dist/test/resolve-service-bindings.d.ts +1 -1
- package/dist/test/simple-context-bindings.d.ts +1 -1
- package/dist/test/simple-context-durable-objects.d.ts +1 -1
- package/dist/test/simple-context-env.d.ts +2 -2
- package/dist/test/simple-context-handlers.d.ts +2 -2
- package/dist/test/simple-context-lifecycle.d.ts +2 -2
- package/dist/test/simple-context-mfconfig.d.ts +1 -1
- package/dist/test/simple-context-multi-worker.d.ts +2 -2
- package/dist/test/simple-context-runtime.d.ts +1 -1
- package/dist/test/simple-context-startup.d.ts +1 -1
- package/dist/test/simple-context.d.ts +1 -1
- package/dist/test/utilities/env.d.ts +3 -3
- package/dist/test/utilities.d.ts +10 -10
- package/dist/test/worker.d.ts +1 -1
- package/dist/transform/index.d.ts +2 -2
- package/dist/utils/send-email.js +163 -19
- package/dist/vite/config-file.d.ts +2 -2
- package/dist/vite/index.d.ts +3 -3
- package/dist/vite/index.js +2 -31
- package/dist/vite/plugin-config-hook.d.ts +1 -1
- package/dist/vite/plugin-context.d.ts +3 -3
- package/dist/vite/plugin-durable-objects.d.ts +2 -2
- package/dist/vite/plugin-programmatic.d.ts +1 -1
- package/dist/vite/plugin-service-bindings.d.ts +2 -2
- package/dist/vite/plugin.d.ts +3 -3
- package/dist/worker-entry/composed-worker.d.ts +1 -1
- package/dist/worker-entry/routes.d.ts +2 -2
- package/dist/worker-entry/surface-paths.d.ts +1 -1
- package/dist/workflows/local-workflow-entrypoints.d.ts +1 -1
- package/package.json +5 -3
- package/dist/account-4tgh03a8.js +0 -484
- package/dist/ai-r3zqmxan.js +0 -261
- package/dist/api-6z01z734.js +0 -33
- package/dist/build-kw625v84.js +0 -51
- package/dist/config-ghk2bxj3.js +0 -102
- package/dist/deploy-9kee65n9.js +0 -1062
- package/dist/dev-x8zr249a.js +0 -3569
- package/dist/doctor-0ng5qrr1.js +0 -258
- package/dist/durable-object-0ybmg08a.js +0 -13
- package/dist/index-04wh9bxx.js +0 -514
- package/dist/index-0cc05hzv.js +0 -74
- package/dist/index-2yv7w548.js +0 -185
- package/dist/index-37x76zdn.js +0 -4
- package/dist/index-3cpzsr47.js +0 -125
- package/dist/index-3t6rypgc.js +0 -13
- package/dist/index-4mmpccrb.js +0 -309
- package/dist/index-5dkjffqz.js +0 -25
- package/dist/index-5hy7jmv3.js +0 -890
- package/dist/index-627srx16.js +0 -45
- package/dist/index-7m557715.js +0 -283
- package/dist/index-a8pnvg3r.js +0 -52
- package/dist/index-aabgympv.js +0 -39
- package/dist/index-atwc3csp.js +0 -256
- package/dist/index-cv4cvrxe.js +0 -2046
- package/dist/index-h7r11y4a.js +0 -539
- package/dist/index-hvtd936d.js +0 -1229
- package/dist/index-kcp7y951.js +0 -136
- package/dist/index-maw0jjnn.js +0 -147
- package/dist/index-mek9msfv.js +0 -705
- package/dist/index-n4xkaymm.js +0 -236
- package/dist/index-nkk59p3y.js +0 -579
- package/dist/index-phcrvs6d.js +0 -342
- package/dist/index-se4kw8tm.js +0 -460
- package/dist/index-x8s9rwfh.js +0 -2020
- package/dist/index-y7w3x9p1.js +0 -18
- package/dist/index-z9gy8w6b.js +0 -57
- package/dist/index-zdd0d9qa.js +0 -199
- package/dist/init-tb8jqgvr.js +0 -180
- package/dist/login-4h1sfsed.js +0 -75
- package/dist/previews-qr7c5j8h.js +0 -1336
- package/dist/productions-xpmd6bw8.js +0 -505
- package/dist/remote-kqcvhnfx.js +0 -192
- package/dist/secrets-6wbdsdek.js +0 -89
- package/dist/token-yp1qa70y.js +0 -419
- package/dist/types-15yv4cj3.js +0 -701
- package/dist/worker-1yg72jxg.js +0 -510
- package/dist/worker-entrypoint-y8s9kdcx.js +0 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Pipeline } from 'cloudflare:pipelines';
|
|
2
|
-
import { type DevflareConfig } from '../config';
|
|
3
|
-
import { type MockAISearchInstanceOptions, type MockAISearchNamespaceOptions } from './ai-search';
|
|
4
|
-
import { type MockArtifactsOptions, type MockDispatchNamespaceOptions, type MockFetcherHandler, type MockImagesBindingOptions, type MockMediaBindingOptions, type MockWorkerLoaderOptions, type MockWorkflowOptions } from './utilities';
|
|
2
|
+
import { type DevflareConfig } from '../config/index.js';
|
|
3
|
+
import { type MockAISearchInstanceOptions, type MockAISearchNamespaceOptions } from './ai-search.js';
|
|
4
|
+
import { type MockArtifactsOptions, type MockDispatchNamespaceOptions, type MockFetcherHandler, type MockImagesBindingOptions, type MockMediaBindingOptions, type MockWorkerLoaderOptions, type MockWorkflowOptions } from './utilities.js';
|
|
5
5
|
export type OfflineSupportTier = 'offline-native' | 'offline-fixture' | 'remote-boundary';
|
|
6
6
|
export interface OfflineSupportEntry {
|
|
7
7
|
service: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DevflareConfig } from '../config';
|
|
1
|
+
import { type DevflareConfig } from '../config/index.js';
|
|
2
2
|
export declare function buildDurableObjectGateway(config: DevflareConfig, configDir: string, transportFile: string | null): Promise<{
|
|
3
3
|
durableObjects?: Record<string, string>;
|
|
4
4
|
script: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BindingHints } from '../bridge/proxy';
|
|
2
|
-
import type { ResolvedHandlerPaths } from './simple-context-handlers';
|
|
1
|
+
import type { BindingHints } from '../bridge/proxy.js';
|
|
2
|
+
import type { ResolvedHandlerPaths } from './simple-context-handlers.js';
|
|
3
3
|
interface TestStateView {
|
|
4
4
|
envProxy: Record<string, unknown> | null;
|
|
5
5
|
remoteBindings: Record<string, unknown> | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DevflareConfig } from '../config';
|
|
2
|
-
import { type RouteDiscoveryResult } from '../worker-entry/routes';
|
|
1
|
+
import type { DevflareConfig } from '../config/index.js';
|
|
2
|
+
import { type RouteDiscoveryResult } from '../worker-entry/routes.js';
|
|
3
3
|
export interface ResolvedHandlerPaths {
|
|
4
4
|
fetch: string | null;
|
|
5
5
|
queue: string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BridgeClient } from '../bridge/client';
|
|
2
|
-
import type { DevflareConfig } from '../config';
|
|
1
|
+
import type { BridgeClient } from '../bridge/client.js';
|
|
2
|
+
import type { DevflareConfig } from '../config/index.js';
|
|
3
3
|
interface DisposeStateView {
|
|
4
4
|
client: BridgeClient | null;
|
|
5
5
|
miniflare: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DevflareConfig } from '../config';
|
|
2
|
-
import type { resolveDOBindings, resolveServiceBindings } from './resolve-service-bindings';
|
|
1
|
+
import type { DevflareConfig } from '../config/index.js';
|
|
2
|
+
import type { resolveDOBindings, resolveServiceBindings } from './resolve-service-bindings.js';
|
|
3
3
|
type ServiceBindingResolution = Awaited<ReturnType<typeof resolveServiceBindings>>;
|
|
4
4
|
type DOBindingResolution = Awaited<ReturnType<typeof resolveDOBindings>>;
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Pipeline } from 'cloudflare:pipelines';
|
|
2
|
-
import { type MockArtifactsOptions } from './artifacts';
|
|
3
|
-
import { type MockDispatchNamespaceOptions, type MockFetcherHandler, type MockRateLimitOptions, type MockWorkerLoaderOptions } from './platform';
|
|
4
|
-
import { type MockWorkflowOptions } from './workflows';
|
|
2
|
+
import { type MockArtifactsOptions } from './artifacts.js';
|
|
3
|
+
import { type MockDispatchNamespaceOptions, type MockFetcherHandler, type MockRateLimitOptions, type MockWorkerLoaderOptions } from './platform.js';
|
|
4
|
+
import { type MockWorkflowOptions } from './workflows.js';
|
|
5
5
|
export interface MockEnvOptions {
|
|
6
6
|
kv?: string[];
|
|
7
7
|
d1?: string[];
|
package/dist/test/utilities.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from './utilities/context';
|
|
2
|
-
export * from './utilities/kv';
|
|
3
|
-
export * from './utilities/d1';
|
|
4
|
-
export * from './utilities/r2';
|
|
5
|
-
export * from './utilities/queue';
|
|
6
|
-
export * from './utilities/platform';
|
|
7
|
-
export * from './utilities/workflows';
|
|
8
|
-
export * from './utilities/media';
|
|
9
|
-
export * from './utilities/artifacts';
|
|
10
|
-
export * from './utilities/env';
|
|
1
|
+
export * from './utilities/context.js';
|
|
2
|
+
export * from './utilities/kv.js';
|
|
3
|
+
export * from './utilities/d1.js';
|
|
4
|
+
export * from './utilities/r2.js';
|
|
5
|
+
export * from './utilities/queue.js';
|
|
6
|
+
export * from './utilities/platform.js';
|
|
7
|
+
export * from './utilities/workflows.js';
|
|
8
|
+
export * from './utilities/media.js';
|
|
9
|
+
export * from './utilities/artifacts.js';
|
|
10
|
+
export * from './utilities/env.js';
|
|
11
11
|
//# sourceMappingURL=utilities.d.ts.map
|
package/dist/test/worker.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { transformDurableObject, findDurableObjectClasses, generateWrapper, type TransformResult } from './durable-object';
|
|
2
|
-
export { transformWorkerEntrypoint, findExportedFunctions, shouldTransformWorker, generateRpcInterface, type ExportedFunction, type WorkerTransformOptions, type WorkerTransformResult } from './worker-entrypoint';
|
|
1
|
+
export { transformDurableObject, findDurableObjectClasses, generateWrapper, type TransformResult } from './durable-object.js';
|
|
2
|
+
export { transformWorkerEntrypoint, findExportedFunctions, shouldTransformWorker, generateRpcInterface, type ExportedFunction, type WorkerTransformOptions, type WorkerTransformResult } from './worker-entrypoint.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/send-email.js
CHANGED
|
@@ -1,19 +1,163 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
1
|
+
//#region src/utils/send-email.ts
|
|
2
|
+
const RAW_EMAIL = "EmailMessage::raw";
|
|
3
|
+
const wrappedSendEmailBindings = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
const wrappedEnvBindings = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
const localSendEmailBindings = /* @__PURE__ */ new Map();
|
|
6
|
+
function hasOwn(value, key) {
|
|
7
|
+
return Object.prototype.hasOwnProperty.call(value, key);
|
|
8
|
+
}
|
|
9
|
+
function isRecord(value) {
|
|
10
|
+
return typeof value === "object" && value !== null;
|
|
11
|
+
}
|
|
12
|
+
function isSendEmailBinding(value) {
|
|
13
|
+
if (!isRecord(value)) return false;
|
|
14
|
+
try {
|
|
15
|
+
return typeof value.send === "function" && typeof value.sendBatch !== "function";
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function isComposableSendEmailMessage(message) {
|
|
21
|
+
return isRecord(message) && typeof message.from === "string" && (typeof message.to === "string" || Array.isArray(message.to));
|
|
22
|
+
}
|
|
23
|
+
function formatEmailAddress(value) {
|
|
24
|
+
if (!value) return;
|
|
25
|
+
return typeof value === "string" ? value : String(value);
|
|
26
|
+
}
|
|
27
|
+
function formatEmailList(value) {
|
|
28
|
+
if (!value) return;
|
|
29
|
+
return Array.isArray(value) ? value.join(", ") : value;
|
|
30
|
+
}
|
|
31
|
+
function normalizeBodyText(value) {
|
|
32
|
+
return value.replace(/\r?\n/g, "\r\n");
|
|
33
|
+
}
|
|
34
|
+
function buildMultipartAlternativeBody(message, boundary) {
|
|
35
|
+
const parts = [];
|
|
36
|
+
if (message.text) parts.push(`--${boundary}`, "Content-Type: text/plain; charset=UTF-8", "", normalizeBodyText(message.text));
|
|
37
|
+
if (message.html) parts.push(`--${boundary}`, "Content-Type: text/html; charset=UTF-8", "", normalizeBodyText(message.html));
|
|
38
|
+
parts.push(`--${boundary}--`);
|
|
39
|
+
return parts.join("\r\n");
|
|
40
|
+
}
|
|
41
|
+
function buildRawEmail(message) {
|
|
42
|
+
const lines = [];
|
|
43
|
+
const messageId = `<${Date.now()}-${Math.random().toString(36).slice(2)}@devflare.dev>`;
|
|
44
|
+
lines.push(`From: ${message.from}`);
|
|
45
|
+
lines.push(`To: ${formatEmailList(message.to)}`);
|
|
46
|
+
lines.push(`Date: ${(/* @__PURE__ */ new Date()).toUTCString()}`);
|
|
47
|
+
lines.push(`Message-ID: ${messageId}`);
|
|
48
|
+
if (message.subject) lines.push(`Subject: ${message.subject}`);
|
|
49
|
+
const replyTo = formatEmailAddress(message.replyTo);
|
|
50
|
+
if (replyTo) lines.push(`Reply-To: ${replyTo}`);
|
|
51
|
+
const cc = formatEmailList(message.cc);
|
|
52
|
+
if (cc) lines.push(`Cc: ${cc}`);
|
|
53
|
+
const bcc = formatEmailList(message.bcc);
|
|
54
|
+
if (bcc) lines.push(`Bcc: ${bcc}`);
|
|
55
|
+
if (message.headers) for (const [key, value] of Object.entries(message.headers)) lines.push(`${key}: ${value}`);
|
|
56
|
+
lines.push("MIME-Version: 1.0");
|
|
57
|
+
if (message.text && message.html) {
|
|
58
|
+
const boundary = `devflare-alt-${crypto.randomUUID()}`;
|
|
59
|
+
lines.push(`Content-Type: multipart/alternative; boundary="${boundary}"`);
|
|
60
|
+
lines.push("");
|
|
61
|
+
lines.push(buildMultipartAlternativeBody(message, boundary));
|
|
62
|
+
return lines.join("\r\n");
|
|
63
|
+
}
|
|
64
|
+
lines.push(`Content-Type: ${message.html ? "text/html" : "text/plain"}; charset=UTF-8`);
|
|
65
|
+
lines.push("");
|
|
66
|
+
lines.push(normalizeBodyText(message.html ?? message.text ?? ""));
|
|
67
|
+
return lines.join("\r\n");
|
|
68
|
+
}
|
|
69
|
+
function createEmailMessageRaw(raw) {
|
|
70
|
+
if (typeof raw === "string" || raw instanceof ReadableStream) return raw;
|
|
71
|
+
if (raw instanceof Uint8Array) {
|
|
72
|
+
const copy = new Uint8Array(raw.byteLength);
|
|
73
|
+
copy.set(raw);
|
|
74
|
+
return new Blob([copy]).stream();
|
|
75
|
+
}
|
|
76
|
+
if (raw instanceof ArrayBuffer) return new Blob([new Uint8Array(raw.slice(0))]).stream();
|
|
77
|
+
throw new Error("Unsupported EmailMessage raw payload");
|
|
78
|
+
}
|
|
79
|
+
function normalizeSendEmailMessage(message) {
|
|
80
|
+
if (!isComposableSendEmailMessage(message)) return message;
|
|
81
|
+
if (hasOwn(message, RAW_EMAIL)) return message;
|
|
82
|
+
if (hasOwn(message, "raw") && message.raw !== void 0) return {
|
|
83
|
+
from: message.from,
|
|
84
|
+
to: message.to,
|
|
85
|
+
[RAW_EMAIL]: createEmailMessageRaw(message.raw)
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
from: message.from,
|
|
89
|
+
to: message.to,
|
|
90
|
+
[RAW_EMAIL]: createEmailMessageRaw(buildRawEmail(message))
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function wrapSendEmailBinding(binding) {
|
|
94
|
+
const cached = wrappedSendEmailBindings.get(binding);
|
|
95
|
+
if (cached) return cached;
|
|
96
|
+
const wrapped = new Proxy(binding, { get(target, prop, receiver) {
|
|
97
|
+
if (prop === "send") return async (message) => target.send(normalizeSendEmailMessage(message));
|
|
98
|
+
const value = Reflect.get(target, prop, receiver);
|
|
99
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
100
|
+
} });
|
|
101
|
+
wrappedSendEmailBindings.set(binding, wrapped);
|
|
102
|
+
return wrapped;
|
|
103
|
+
}
|
|
104
|
+
function createLocalSendEmailBinding(config = {}, options = {}) {
|
|
105
|
+
return { async send(message) {
|
|
106
|
+
const normalized = normalizeSendEmailMessage(message);
|
|
107
|
+
if (isRecord(normalized)) {
|
|
108
|
+
const from = typeof normalized.from === "string" ? normalized.from : void 0;
|
|
109
|
+
const recipients = Array.isArray(normalized.to) ? normalized.to.filter((value) => typeof value === "string") : typeof normalized.to === "string" ? [normalized.to] : [];
|
|
110
|
+
if (from && config.allowedSenderAddresses && !config.allowedSenderAddresses.includes(from)) throw new Error(`email from ${from} not allowed`);
|
|
111
|
+
for (const recipient of recipients) {
|
|
112
|
+
if (config.destinationAddress !== void 0 && recipient !== config.destinationAddress) throw new Error(`email to ${recipient} not allowed`);
|
|
113
|
+
if (config.allowedDestinationAddresses !== void 0 && !config.allowedDestinationAddresses.includes(recipient)) throw new Error(`email to ${recipient} not allowed`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
await options.onSend?.(normalized);
|
|
117
|
+
} };
|
|
118
|
+
}
|
|
119
|
+
function setLocalSendEmailBindings(bindings) {
|
|
120
|
+
localSendEmailBindings.clear();
|
|
121
|
+
for (const [name, config] of Object.entries(bindings)) localSendEmailBindings.set(name, createLocalSendEmailBinding(config));
|
|
122
|
+
}
|
|
123
|
+
function clearLocalSendEmailBindings() {
|
|
124
|
+
localSendEmailBindings.clear();
|
|
125
|
+
}
|
|
126
|
+
function needsEnvSendEmailWrapping(env) {
|
|
127
|
+
if (localSendEmailBindings.size > 0) return true;
|
|
128
|
+
for (const key of Reflect.ownKeys(env)) if (isSendEmailBinding(Reflect.get(env, key))) return true;
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
function wrapEnvSendEmailBindings(env) {
|
|
132
|
+
if (!isRecord(env)) return env;
|
|
133
|
+
if (!needsEnvSendEmailWrapping(env)) return env;
|
|
134
|
+
const cached = wrappedEnvBindings.get(env);
|
|
135
|
+
if (cached) return cached;
|
|
136
|
+
const wrapped = new Proxy(env, {
|
|
137
|
+
get(target, prop, receiver) {
|
|
138
|
+
if (typeof prop === "string" && localSendEmailBindings.has(prop)) return localSendEmailBindings.get(prop);
|
|
139
|
+
const value = Reflect.get(target, prop, receiver);
|
|
140
|
+
return isSendEmailBinding(value) ? wrapSendEmailBinding(value) : value;
|
|
141
|
+
},
|
|
142
|
+
has(target, prop) {
|
|
143
|
+
return Reflect.has(target, prop) || typeof prop === "string" && localSendEmailBindings.has(prop);
|
|
144
|
+
},
|
|
145
|
+
ownKeys(target) {
|
|
146
|
+
return Array.from(new Set([...Reflect.ownKeys(target), ...localSendEmailBindings.keys()]));
|
|
147
|
+
},
|
|
148
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
149
|
+
if (typeof prop === "string" && localSendEmailBindings.has(prop)) return {
|
|
150
|
+
configurable: true,
|
|
151
|
+
enumerable: true,
|
|
152
|
+
writable: false,
|
|
153
|
+
value: localSendEmailBindings.get(prop)
|
|
154
|
+
};
|
|
155
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
156
|
+
if (descriptor) return descriptor;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
wrappedEnvBindings.set(env, wrapped);
|
|
160
|
+
return wrapped;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { clearLocalSendEmailBindings, createEmailMessageRaw, createLocalSendEmailBinding, normalizeSendEmailMessage, setLocalSendEmailBindings, wrapEnvSendEmailBindings, wrapSendEmailBinding };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfigEnv, UserConfig } from 'vite';
|
|
2
|
-
import { type DevflareConfig } from '../config';
|
|
3
|
-
import type { ViteProjectDetection } from '../dev-server/vite-utils';
|
|
2
|
+
import { type DevflareConfig } from '../config/index.js';
|
|
3
|
+
import type { ViteProjectDetection } from '../dev-server/vite-utils.js';
|
|
4
4
|
export interface EffectiveViteProjectDetection extends ViteProjectDetection {
|
|
5
5
|
hasDevflareViteConfig: boolean;
|
|
6
6
|
shouldStartVite: boolean;
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { devflarePlugin, getPluginContext, getCloudflareConfig, getDevflareConfigs, type DevflarePluginOptions, type DevflarePluginContext, type AuxiliaryWorkerConfig, type DODiscoveryResult } from './plugin';
|
|
2
|
-
export { hasInlineViteConfig, resolveEffectiveViteProject, resolveViteUserConfig, writeGeneratedViteConfig, type EffectiveViteProjectDetection } from './config-file';
|
|
3
|
-
export { devflarePlugin as default } from './plugin';
|
|
1
|
+
export { devflarePlugin, getPluginContext, getCloudflareConfig, getDevflareConfigs, type DevflarePluginOptions, type DevflarePluginContext, type AuxiliaryWorkerConfig, type DODiscoveryResult } from './plugin.js';
|
|
2
|
+
export { hasInlineViteConfig, resolveEffectiveViteProject, resolveViteUserConfig, writeGeneratedViteConfig, type EffectiveViteProjectDetection } from './config-file.js';
|
|
3
|
+
export { devflarePlugin as default } from './plugin.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/vite/index.js
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
devflarePlugin1 as devflarePlugin2,
|
|
4
|
-
getCloudflareConfig,
|
|
5
|
-
getDevflareConfigs,
|
|
6
|
-
getPluginContext,
|
|
7
|
-
hasInlineViteConfig,
|
|
8
|
-
resolveEffectiveViteProject,
|
|
9
|
-
resolveViteUserConfig,
|
|
10
|
-
writeGeneratedViteConfig
|
|
11
|
-
} from "../index-cv4cvrxe.js";
|
|
12
|
-
import"../index-3cpzsr47.js";
|
|
13
|
-
import"../index-5dkjffqz.js";
|
|
14
|
-
import"../index-mek9msfv.js";
|
|
15
|
-
import"../index-x8s9rwfh.js";
|
|
16
|
-
import"../index-h7r11y4a.js";
|
|
17
|
-
import"../index-04wh9bxx.js";
|
|
18
|
-
import"../index-7m557715.js";
|
|
19
|
-
import"../index-4mmpccrb.js";
|
|
20
|
-
import"../index-37x76zdn.js";
|
|
21
|
-
export {
|
|
22
|
-
writeGeneratedViteConfig,
|
|
23
|
-
resolveViteUserConfig,
|
|
24
|
-
resolveEffectiveViteProject,
|
|
25
|
-
hasInlineViteConfig,
|
|
26
|
-
getPluginContext,
|
|
27
|
-
getDevflareConfigs,
|
|
28
|
-
getCloudflareConfig,
|
|
29
|
-
devflarePlugin,
|
|
30
|
-
devflarePlugin2 as default
|
|
31
|
-
};
|
|
1
|
+
import { a as devflarePlugin, c as getDevflareConfigs, i as writeGeneratedViteConfig, n as resolveEffectiveViteProject, o as getPluginContext, r as resolveViteUserConfig, s as getCloudflareConfig, t as hasInlineViteConfig } from "../_chunks/vite-CsI0E-uV.js";
|
|
2
|
+
export { devflarePlugin as default, devflarePlugin, getCloudflareConfig, getDevflareConfigs, getPluginContext, hasInlineViteConfig, resolveEffectiveViteProject, resolveViteUserConfig, writeGeneratedViteConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type WranglerConfig } from '../config/compiler';
|
|
2
|
-
import type { DevflareConfig } from '../config/schema';
|
|
3
|
-
import { type AuxiliaryWorkerConfig, type DODiscoveryResult } from './plugin-durable-objects';
|
|
1
|
+
import { type WranglerConfig } from '../config/compiler.js';
|
|
2
|
+
import type { DevflareConfig } from '../config/schema.js';
|
|
3
|
+
import { type AuxiliaryWorkerConfig, type DODiscoveryResult } from './plugin-durable-objects.js';
|
|
4
4
|
export interface ResolvedPluginContextState {
|
|
5
5
|
wranglerConfig: WranglerConfig;
|
|
6
6
|
cloudflareConfig: Record<string, unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { WranglerConfig } from '../config/compiler';
|
|
2
|
-
import { type DODiscoveryResult, discoverDurableObjects } from '../worker-entry/durable-object-discovery';
|
|
1
|
+
import type { WranglerConfig } from '../config/compiler.js';
|
|
2
|
+
import { type DODiscoveryResult, discoverDurableObjects } from '../worker-entry/durable-object-discovery.js';
|
|
3
3
|
export declare const VIRTUAL_DO_ENTRY = "virtual:devflare-do-entry";
|
|
4
4
|
export declare const RESOLVED_VIRTUAL_DO_ENTRY: string;
|
|
5
5
|
export { discoverDurableObjects, type DODiscoveryResult };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { resolveServiceBindings } from '../test/resolve-service-bindings';
|
|
2
|
-
import type { AuxiliaryWorkerConfig } from './plugin-durable-objects';
|
|
1
|
+
import type { resolveServiceBindings } from '../test/resolve-service-bindings.js';
|
|
2
|
+
import type { AuxiliaryWorkerConfig } from './plugin-durable-objects.js';
|
|
3
3
|
export declare const VIRTUAL_SERVICE_WORKER_PREFIX = "virtual:devflare-service-worker/";
|
|
4
4
|
export declare const RESOLVED_VIRTUAL_SERVICE_WORKER_PREFIX: string;
|
|
5
5
|
type ServiceBindingResolution = Awaited<ReturnType<typeof resolveServiceBindings>>;
|
package/dist/vite/plugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
import type { WranglerConfig } from '../config/compiler';
|
|
3
|
-
import { type AuxiliaryWorkerConfig, type DODiscoveryResult } from './plugin-durable-objects';
|
|
2
|
+
import type { WranglerConfig } from '../config/compiler.js';
|
|
3
|
+
import { type AuxiliaryWorkerConfig, type DODiscoveryResult } from './plugin-durable-objects.js';
|
|
4
4
|
export type { AuxiliaryWorkerConfig, DODiscoveryResult };
|
|
5
5
|
export interface DevflarePluginOptions {
|
|
6
6
|
/**
|
|
@@ -102,6 +102,6 @@ export declare function devflarePlugin(options?: DevflarePluginOptions): Plugin;
|
|
|
102
102
|
* Get cloudflare config for programmatic use with @cloudflare/vite-plugin.
|
|
103
103
|
* Re-exported from `./plugin-programmatic`.
|
|
104
104
|
*/
|
|
105
|
-
export { getCloudflareConfig, getDevflareConfigs } from './plugin-programmatic';
|
|
105
|
+
export { getCloudflareConfig, getDevflareConfigs } from './plugin-programmatic.js';
|
|
106
106
|
export default devflarePlugin;
|
|
107
107
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DevflareConfig } from '../config';
|
|
2
|
-
import type { RouteSegment } from '../runtime/router/types';
|
|
1
|
+
import type { DevflareConfig } from '../config/index.js';
|
|
2
|
+
import type { RouteSegment } from '../runtime/router/types.js';
|
|
3
3
|
export declare const DEFAULT_ROUTE_DIR = "src/routes";
|
|
4
4
|
export interface DiscoveredRoute {
|
|
5
5
|
readonly absolutePath: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DevflareConfig } from '../config';
|
|
1
|
+
import type { DevflareConfig } from '../config/index.js';
|
|
2
2
|
export declare const DEFAULT_FETCH_ENTRY_FILES: readonly string[];
|
|
3
3
|
export declare const DEFAULT_QUEUE_ENTRY_FILES: readonly string[];
|
|
4
4
|
export declare const DEFAULT_SCHEDULED_ENTRY_FILES: readonly string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devflare",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.40",
|
|
4
4
|
"description": "Devflare is a developer-first toolkit for Cloudflare Workers that sits on top of Miniflare and Wrangler-compatible config",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,16 +76,18 @@
|
|
|
76
76
|
"llm:generate": "bun ./scripts/generate-llm.ts",
|
|
77
77
|
"refresh-permission-groups": "bun ./scripts/refresh-permission-groups.ts",
|
|
78
78
|
"clean:dist": "bun ./scripts/clean-dist.ts",
|
|
79
|
-
"
|
|
79
|
+
"verify:dist": "bun ./scripts/verify-dist.ts",
|
|
80
|
+
"build": "bun run clean:dist && rolldown -c rolldown.config.ts && tsgo --declaration --emitDeclarationOnly --noEmit false --outDir ./dist && bun ./scripts/fix-dts-extensions.ts",
|
|
80
81
|
"dev": "bun --watch ./src/cli/index.ts",
|
|
81
82
|
"prepack": "bun run llm:generate",
|
|
82
|
-
"test": "bun run test:unit && bun run test:integration:control && bun run test:integration:bridge && bun run test:integration:test-context && bun run test:integration:dev-server",
|
|
83
|
+
"test": "bun run test:unit && bun run test:integration:control && bun run test:integration:bridge && bun run test:integration:test-context && bun run test:integration:dev-server && bun run test:integration:shims",
|
|
83
84
|
"test:unit": "bun test tests/unit",
|
|
84
85
|
"test:coverage": "bun test tests/unit --coverage",
|
|
85
86
|
"test:integration:control": "bun test tests/integration/cli tests/integration/examples tests/integration/package-entry tests/integration/vite",
|
|
86
87
|
"test:integration:bridge": "bun test tests/integration/bridge/bridge-proxy.test.ts --parallel=1 --max-concurrency=1 && bun test tests/integration/bridge/case18-do.test.ts --parallel=1 --max-concurrency=1 && bun test tests/integration/bridge/durable-object.test.ts --parallel=1 --max-concurrency=1 && bun test tests/integration/bridge/do-websocket.test.ts --parallel=1 --max-concurrency=1 && bun test tests/integration/bridge/miniflare.test.ts --parallel=1 --max-concurrency=1 && bun test tests/integration/bridge/r2-transfer.test.ts --parallel=1 --max-concurrency=1",
|
|
87
88
|
"test:integration:test-context": "bun test tests/integration/test-context --parallel=1 --max-concurrency=1",
|
|
88
89
|
"test:integration:dev-server": "bun test tests/integration/dev-server --parallel=1 --max-concurrency=1",
|
|
90
|
+
"test:integration:shims": "bun test tests/integration/shims --parallel=1 --max-concurrency=1",
|
|
89
91
|
"test:watch": "bun test --watch",
|
|
90
92
|
"typecheck": "tsgo --noEmit",
|
|
91
93
|
"types": "bun run typecheck",
|