UNPKG

miniflare

Version:

Fun, full-featured, fully-local simulator for Cloudflare Workers

1,165 lines (1,121 loc) • 282 kB
import { Abortable } from 'events'; import type { AbortSignal as AbortSignal_2 } from '@cloudflare/workers-types/experimental'; import { Awaitable as Awaitable_2 } from '..'; import type { Blob as Blob_2 } from '@cloudflare/workers-types/experimental'; import { Blob as Blob_3 } from 'buffer'; import { BodyInit } from 'undici'; import type { CacheStorage } from '@cloudflare/workers-types/experimental'; import { cspotcodeSourceMapSupport } from '@cspotcode/source-map-support'; import type { D1Database } from '@cloudflare/workers-types/experimental'; import type { DurableObjectNamespace } from '@cloudflare/workers-types/experimental'; import { ExternalServer as ExternalServer_2 } from '../..'; import { ExternalServer as ExternalServer_3 } from '..'; import type { Fetcher } from '@cloudflare/workers-types/experimental'; import { File as File_2 } from 'undici'; import type { File as File_3 } from '@cloudflare/workers-types/experimental'; import { FormData as FormData_2 } from 'undici'; import { Headers as Headers_2 } from 'undici'; import type { Headers as Headers_3 } from '@cloudflare/workers-types/experimental'; import { HeadersInit } from 'undici'; import http from 'http'; import { IncomingMessage } from 'http'; import { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental'; import { Json as Json_2 } from '..'; import { kCurrentWorker as kCurrentWorker_2 } from '..'; import { kUnsafeEphemeralUniqueKey as kUnsafeEphemeralUniqueKey_2 } from './shared'; import type { KVNamespace } from '@cloudflare/workers-types/experimental'; import type { KVNamespaceListKey } from '@cloudflare/workers-types/experimental'; import { Log as Log_2 } from '..'; import { Miniflare as Miniflare_2 } from '../..'; import { Miniflare as Miniflare_3 } from '..'; import { MixedModeConnectionString as MixedModeConnectionString_2 } from '..'; import { MixedModeConnectionString as MixedModeConnectionString_3 } from './shared'; import { MockAgent } from 'undici'; import NodeWebSocket from 'ws'; import { ParseParams } from 'zod'; import { PeriodType as PeriodType_2 } from './ratelimit'; import { Plugin as Plugin_2 } from './shared'; import type { Queue } from '@cloudflare/workers-types/experimental'; import type { R2Bucket } from '@cloudflare/workers-types/experimental'; import { Readable } from 'stream'; import type { ReadableStream as ReadableStream_2 } from '@cloudflare/workers-types/experimental'; import { ReadableStream as ReadableStream_3 } from 'stream/web'; import { ReferrerPolicy } from 'undici'; import { Request as Request_3 } from '../..'; import { Request as Request_4 } from 'undici'; import type { Request as Request_5 } from '@cloudflare/workers-types/experimental'; import { Request as Request_6 } from '..'; import { RequestCache } from 'undici'; import { RequestCredentials } from 'undici'; import { RequestDestination } from 'undici'; import { RequestDuplex } from 'undici'; import { RequestInfo as RequestInfo_2 } from 'undici'; import { RequestInit as RequestInit_3 } from 'undici'; import type { RequestInit as RequestInit_4 } from '@cloudflare/workers-types/experimental'; import type { RequestInitCfProperties } from '@cloudflare/workers-types/experimental'; import { RequestMode } from 'undici'; import { RequestRedirect } from 'undici'; import { Response as Response_3 } from '../..'; import { Response as Response_4 } from 'undici'; import type { Response as Response_5 } from '@cloudflare/workers-types/experimental'; import { Response as Response_6 } from '..'; import { ResponseInit as ResponseInit_3 } from 'undici'; import { ResponseRedirectStatus } from 'undici'; import { ResponseType } from 'undici'; import { ServerResponse } from 'http'; import type { ServiceWorkerGlobalScope } from '@cloudflare/workers-types/experimental'; import { compatibilityDate as supportedCompatibilityDate } from 'workerd'; import { Transform } from 'stream'; import * as undici from 'undici'; import { URL as URL_2 } from 'url'; import { z } from 'zod'; export declare class __MiniflareFunctionWrapper { constructor(fnWithProps: ((...args: unknown[]) => unknown) & { [key: string | symbol]: unknown; }); } export declare const AI_PLUGIN: Plugin<typeof AIOptionsSchema>; export declare const AI_PLUGIN_NAME = "ai"; export declare const AIOptionsSchema: z.ZodObject<{ ai: z.ZodOptional<z.ZodObject<{ binding: z.ZodString; mixedModeConnectionString: z.ZodType<MixedModeConnectionString, z.ZodTypeDef, MixedModeConnectionString>; }, "strip", z.ZodTypeAny, { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; }, { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; }>>; }, "strip", z.ZodTypeAny, { ai?: { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; } | undefined; }, { ai?: { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; } | undefined; }>; export declare const ANALYTICS_ENGINE_PLUGIN: Plugin<typeof AnalyticsEngineSchemaOptionsSchema, typeof AnalyticsEngineSchemaSharedOptionsSchema>; export declare const ANALYTICS_ENGINE_PLUGIN_NAME = "analytics-engine"; export declare const AnalyticsEngineSchemaOptionsSchema: z.ZodObject<{ analyticsEngineDatasets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{ dataset: z.ZodString; }, "strip", z.ZodTypeAny, { dataset: string; }, { dataset: string; }>>>; }, "strip", z.ZodTypeAny, { analyticsEngineDatasets?: Record<string, { dataset: string; }> | undefined; }, { analyticsEngineDatasets?: Record<string, { dataset: string; }> | undefined; }>; export declare const AnalyticsEngineSchemaSharedOptionsSchema: z.ZodObject<{ analyticsEngineDatasetsPersist: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodEffects<z.ZodString, string, string>]>>; }, "strip", z.ZodTypeAny, { analyticsEngineDatasetsPersist?: string | boolean | undefined; }, { analyticsEngineDatasetsPersist?: string | boolean | undefined; }>; export declare type AnyHeaders = http.IncomingHttpHeaders | string[]; export declare type AssetReverseMap = { [pathHash: string]: { filePath: string; contentType: string | null; }; }; export declare const ASSETS_PLUGIN: Plugin<typeof AssetsOptionsSchema>; export declare const AssetsOptionsSchema: z.ZodObject<{ assets: z.ZodOptional<z.ZodObject<{ workerName: z.ZodOptional<z.ZodString>; directory: z.ZodEffects<z.ZodString, string, string>; binding: z.ZodOptional<z.ZodString>; routerConfig: z.ZodOptional<z.ZodObject<{ account_id: z.ZodOptional<z.ZodNumber>; script_id: z.ZodOptional<z.ZodNumber>; debug: z.ZodOptional<z.ZodBoolean>; invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>; static_routing: z.ZodOptional<z.ZodObject<{ user_worker: z.ZodArray<z.ZodString, "many">; asset_worker: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { user_worker: string[]; asset_worker?: string[] | undefined; }, { user_worker: string[]; asset_worker?: string[] | undefined; }>>; has_user_worker: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { account_id?: number | undefined; script_id?: number | undefined; debug?: boolean | undefined; invoke_user_worker_ahead_of_assets?: boolean | undefined; static_routing?: { user_worker: string[]; asset_worker?: string[] | undefined; } | undefined; has_user_worker?: boolean | undefined; }, { account_id?: number | undefined; script_id?: number | undefined; debug?: boolean | undefined; invoke_user_worker_ahead_of_assets?: boolean | undefined; static_routing?: { user_worker: string[]; asset_worker?: string[] | undefined; } | undefined; has_user_worker?: boolean | undefined; }>>; assetConfig: z.ZodOptional<z.ZodObject<Omit<{ account_id: z.ZodOptional<z.ZodNumber>; script_id: z.ZodOptional<z.ZodNumber>; debug: z.ZodOptional<z.ZodBoolean>; compatibility_date: z.ZodOptional<z.ZodString>; compatibility_flags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>; not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>; redirects: z.ZodOptional<z.ZodObject<{ version: z.ZodLiteral<1>; staticRules: z.ZodRecord<z.ZodString, z.ZodObject<{ status: z.ZodNumber; to: z.ZodString; lineNumber: z.ZodNumber; }, "strip", z.ZodTypeAny, { status: number; to: string; lineNumber: number; }, { status: number; to: string; lineNumber: number; }>>; rules: z.ZodRecord<z.ZodString, z.ZodObject<{ status: z.ZodNumber; to: z.ZodString; }, "strip", z.ZodTypeAny, { status: number; to: string; }, { status: number; to: string; }>>; }, "strip", z.ZodTypeAny, { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; }, { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; }>>; headers: z.ZodOptional<z.ZodObject<{ version: z.ZodLiteral<2>; rules: z.ZodRecord<z.ZodString, z.ZodObject<{ set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; unset: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; }, { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; }>>; has_static_routing: z.ZodOptional<z.ZodBoolean>; }, "compatibility_date" | "compatibility_flags">, "strip", z.ZodTypeAny, { debug?: boolean | undefined; headers?: { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; } | undefined; account_id?: number | undefined; script_id?: number | undefined; html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | undefined; not_found_handling?: "none" | "single-page-application" | "404-page" | undefined; redirects?: { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; } | undefined; has_static_routing?: boolean | undefined; }, { debug?: boolean | undefined; headers?: { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; } | undefined; account_id?: number | undefined; script_id?: number | undefined; html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | undefined; not_found_handling?: "none" | "single-page-application" | "404-page" | undefined; redirects?: { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; } | undefined; has_static_routing?: boolean | undefined; }>>; }, "strip", z.ZodTypeAny, { directory: string; workerName?: string | undefined; binding?: string | undefined; routerConfig?: { account_id?: number | undefined; script_id?: number | undefined; debug?: boolean | undefined; invoke_user_worker_ahead_of_assets?: boolean | undefined; static_routing?: { user_worker: string[]; asset_worker?: string[] | undefined; } | undefined; has_user_worker?: boolean | undefined; } | undefined; assetConfig?: { debug?: boolean | undefined; headers?: { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; } | undefined; account_id?: number | undefined; script_id?: number | undefined; html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | undefined; not_found_handling?: "none" | "single-page-application" | "404-page" | undefined; redirects?: { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; } | undefined; has_static_routing?: boolean | undefined; } | undefined; }, { directory: string; workerName?: string | undefined; binding?: string | undefined; routerConfig?: { account_id?: number | undefined; script_id?: number | undefined; debug?: boolean | undefined; invoke_user_worker_ahead_of_assets?: boolean | undefined; static_routing?: { user_worker: string[]; asset_worker?: string[] | undefined; } | undefined; has_user_worker?: boolean | undefined; } | undefined; assetConfig?: { debug?: boolean | undefined; headers?: { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; } | undefined; account_id?: number | undefined; script_id?: number | undefined; html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | undefined; not_found_handling?: "none" | "single-page-application" | "404-page" | undefined; redirects?: { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; } | undefined; has_static_routing?: boolean | undefined; } | undefined; }>>; compatibilityDate: z.ZodOptional<z.ZodString>; compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { assets?: { directory: string; workerName?: string | undefined; binding?: string | undefined; routerConfig?: { account_id?: number | undefined; script_id?: number | undefined; debug?: boolean | undefined; invoke_user_worker_ahead_of_assets?: boolean | undefined; static_routing?: { user_worker: string[]; asset_worker?: string[] | undefined; } | undefined; has_user_worker?: boolean | undefined; } | undefined; assetConfig?: { debug?: boolean | undefined; headers?: { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; } | undefined; account_id?: number | undefined; script_id?: number | undefined; html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | undefined; not_found_handling?: "none" | "single-page-application" | "404-page" | undefined; redirects?: { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; } | undefined; has_static_routing?: boolean | undefined; } | undefined; } | undefined; compatibilityDate?: string | undefined; compatibilityFlags?: string[] | undefined; }, { assets?: { directory: string; workerName?: string | undefined; binding?: string | undefined; routerConfig?: { account_id?: number | undefined; script_id?: number | undefined; debug?: boolean | undefined; invoke_user_worker_ahead_of_assets?: boolean | undefined; static_routing?: { user_worker: string[]; asset_worker?: string[] | undefined; } | undefined; has_user_worker?: boolean | undefined; } | undefined; assetConfig?: { debug?: boolean | undefined; headers?: { version: 2; rules: Record<string, { set?: Record<string, string> | undefined; unset?: string[] | undefined; }>; } | undefined; account_id?: number | undefined; script_id?: number | undefined; html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | undefined; not_found_handling?: "none" | "single-page-application" | "404-page" | undefined; redirects?: { version: 1; staticRules: Record<string, { status: number; to: string; lineNumber: number; }>; rules: Record<string, { status: number; to: string; }>; } | undefined; has_static_routing?: boolean | undefined; } | undefined; } | undefined; compatibilityDate?: string | undefined; compatibilityFlags?: string[] | undefined; }>; export declare type Awaitable<T> = T | Promise<T>; export declare function base64Decode(encoded: string): string; export declare function base64Encode(value: string): string; export { BodyInit } export declare const BROWSER_RENDERING_PLUGIN: Plugin<typeof BrowserRenderingOptionsSchema>; export declare const BROWSER_RENDERING_PLUGIN_NAME = "browser-rendering"; export declare const BrowserRenderingOptionsSchema: z.ZodObject<{ browserRendering: z.ZodOptional<z.ZodObject<{ binding: z.ZodString; mixedModeConnectionString: z.ZodType<MixedModeConnectionString, z.ZodTypeDef, MixedModeConnectionString>; }, "strip", z.ZodTypeAny, { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; }, { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; }>>; }, "strip", z.ZodTypeAny, { browserRendering?: { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; } | undefined; }, { browserRendering?: { mixedModeConnectionString: URL & { __brand: "MixedModeConnectionString"; }; binding: string; } | undefined; }>; /** * The Asset Manifest and Asset Reverse Map are used to map a request path to an asset. * 1. Hash path of request * 2. Use this path hash to find the manifest entry * 3. Get content hash from manifest entry * 4a. In prod, use content hash to get asset from KV * 4b. In dev, we fake out the KV store and use the file system instead. * Use content hash to get file path from asset reverse map. */ export declare const buildAssetManifest: (dir: string) => Promise<{ encodedAssetManifest: Uint8Array<ArrayBuffer>; assetsReverseMap: AssetReverseMap; }>; export declare const CACHE_PLUGIN: Plugin<typeof CacheOptionsSchema, typeof CacheSharedOptionsSchema>; export declare const CACHE_PLUGIN_NAME = "cache"; export declare const CacheBindings: { readonly MAYBE_JSON_CACHE_WARN_USAGE: "MINIFLARE_CACHE_WARN_USAGE"; }; export declare const CacheHeaders: { readonly NAMESPACE: "cf-cache-namespace"; readonly STATUS: "cf-cache-status"; }; export declare interface CacheObjectCf { miniflare?: { cacheWarnUsage?: boolean; }; } export declare const CacheOptionsSchema: z.ZodObject<{ cache: z.ZodOptional<z.ZodBoolean>; cacheWarnUsage: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { cache?: boolean | undefined; cacheWarnUsage?: boolean | undefined; }, { cache?: boolean | undefined; cacheWarnUsage?: boolean | undefined; }>; export declare const CacheSharedOptionsSchema: z.ZodObject<{ cachePersist: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodEffects<z.ZodString, string, string>]>>; }, "strip", z.ZodTypeAny, { cachePersist?: string | boolean | undefined; }, { cachePersist?: string | boolean | undefined; }>; export declare class CloseEvent extends Event { readonly code: number; readonly reason: string; readonly wasClean: boolean; constructor(type: "close", init?: { code?: number; reason?: string; wasClean?: boolean; }); } export declare interface CompiledModuleRule { type: ModuleRuleType; include: MatcherRegExps; } export declare function compileModuleRules(rules: ModuleRule[]): CompiledModuleRule[]; export declare interface Config { services?: Service[]; sockets?: Socket[]; v8Flags?: string[]; extensions?: Extension[]; autogates?: string[]; } export declare const CONTAINER_PLUGIN: Plugin<typeof ContainersOptionsSchema, typeof ContainersSharedSchema>; export declare const CONTAINER_PLUGIN_NAME = "containers"; /** * ContainerController manages container configuration, building or pulling * containers, and cleaning up containers at the end of the dev session. */ export declare class ContainerController { #private; constructor(containerOptions: { [className: string]: ContainerOptions; }, sharedOptions: ContainersSharedOptions, logger: Log); updateConfig(containerOptions: { [className: string]: ContainerOptions; }, sharedOptions: ContainersSharedOptions): void; buildAllContainers(): Promise<void>; buildContainer(options: ContainerOptions): Promise<void>; checkExposedPorts(imageTag: string): Promise<void>; } export declare type ContainerOptions = z.infer<typeof ContainerSchema>; export declare const ContainerSchema: z.ZodObject<{ image: z.ZodString; maxInstances: z.ZodOptional<z.ZodNumber>; imageBuildContext: z.ZodOptional<z.ZodString>; args: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>; exposedPorts: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>; name: z.ZodString; }, "strip", z.ZodTypeAny, { image: string; name: string; args: Record<string, string>; maxInstances?: number | undefined; imageBuildContext?: string | undefined; exposedPorts?: number[] | undefined; }, { image: string; name: string; maxInstances?: number | undefined; imageBuildContext?: string | undefined; args?: Record<string, string> | undefined; exposedPorts?: number[] | undefined; }>; export declare const ContainersOptionsSchema: z.ZodObject<{ containers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{ image: z.ZodString; maxInstances: z.ZodOptional<z.ZodNumber>; imageBuildContext: z.ZodOptional<z.ZodString>; args: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>; exposedPorts: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>; name: z.ZodString; }, "strip", z.ZodTypeAny, { image: string; name: string; args: Record<string, string>; maxInstances?: number | undefined; imageBuildContext?: string | undefined; exposedPorts?: number[] | undefined; }, { image: string; name: string; maxInstances?: number | undefined; imageBuildContext?: string | undefined; args?: Record<string, string> | undefined; exposedPorts?: number[] | undefined; }>>>; }, "strip", z.ZodTypeAny, { containers?: Record<string, { image: string; name: string; args: Record<string, string>; maxInstances?: number | undefined; imageBuildContext?: string | undefined; exposedPorts?: number[] | undefined; }> | undefined; }, { containers?: Record<string, { image: string; name: string; maxInstances?: number | undefined; imageBuildContext?: string | undefined; args?: Record<string, string> | undefined; exposedPorts?: number[] | undefined; }> | undefined; }>; export declare type ContainersSharedOptions = z.infer<typeof ContainersSharedSchema>; export declare const ContainersSharedSchema: z.ZodObject<{ enableContainers: z.ZodDefault<z.ZodBoolean>; dockerPath: z.ZodDefault<z.ZodString>; }, "strip", z.ZodTypeAny, { enableContainers: boolean; dockerPath: string; }, { enableContainers?: boolean | undefined; dockerPath?: string | undefined; }>; export declare const CORE_PLUGIN: Plugin<typeof CoreOptionsSchema, typeof CoreSharedOptionsSchema>; export declare const CORE_PLUGIN_NAME = "core"; export declare const CoreBindings: { readonly SERVICE_LOOPBACK: "MINIFLARE_LOOPBACK"; readonly SERVICE_USER_ROUTE_PREFIX: "MINIFLARE_USER_ROUTE_"; readonly SERVICE_USER_FALLBACK: "MINIFLARE_USER_FALLBACK"; readonly TEXT_CUSTOM_SERVICE: "MINIFLARE_CUSTOM_SERVICE"; readonly IMAGES_SERVICE: "MINIFLARE_IMAGES_SERVICE"; readonly TEXT_UPSTREAM_URL: "MINIFLARE_UPSTREAM_URL"; readonly JSON_CF_BLOB: "CF_BLOB"; readonly JSON_ROUTES: "MINIFLARE_ROUTES"; readonly JSON_LOG_LEVEL: "MINIFLARE_LOG_LEVEL"; readonly DATA_LIVE_RELOAD_SCRIPT: "MINIFLARE_LIVE_RELOAD_SCRIPT"; readonly DURABLE_OBJECT_NAMESPACE_PROXY: "MINIFLARE_PROXY"; readonly DATA_PROXY_SECRET: "MINIFLARE_PROXY_SECRET"; readonly DATA_PROXY_SHARED_SECRET: "MINIFLARE_PROXY_SHARED_SECRET"; readonly TRIGGER_HANDLERS: "TRIGGER_HANDLERS"; readonly LOG_REQUESTS: "LOG_REQUESTS"; }; export declare const CoreHeaders: { readonly CUSTOM_FETCH_SERVICE: "MF-Custom-Fetch-Service"; readonly CUSTOM_NODE_SERVICE: "MF-Custom-Node-Service"; readonly ORIGINAL_URL: "MF-Original-URL"; readonly PROXY_SHARED_SECRET: "MF-Proxy-Shared-Secret"; readonly DISABLE_PRETTY_ERROR: "MF-Disable-Pretty-Error"; readonly ERROR_STACK: "MF-Experimental-Error-Stack"; readonly ROUTE_OVERRIDE: "MF-Route-Override"; readonly CF_BLOB: "MF-CF-Blob"; readonly OP_SECRET: "MF-Op-Secret"; readonly OP: "MF-Op"; readonly OP_TARGET: "MF-Op-Target"; readonly OP_KEY: "MF-Op-Key"; readonly OP_SYNC: "MF-Op-Sync"; readonly OP_STRINGIFIED_SIZE: "MF-Op-Stringified-Size"; readonly OP_RESULT_TYPE: "MF-Op-Result-Type"; }; export declare const CoreOptionsSchema: z.ZodEffects<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{ modules: z.ZodArray<z.ZodObject<{ type: z.ZodEnum<["ESModule", "CommonJS", "Text", "Data", "CompiledWasm", "PythonModule", "PythonRequirement"]>; path: z.ZodEffects<z.ZodString, string, string>; contents: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>]>>; }, "strip", z.ZodTypeAny, { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; path: string; contents?: string | Uint8Array<ArrayBuffer> | undefined; }, { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; path: string; contents?: string | Uint8Array<ArrayBuffer> | undefined; }>, "many">; modulesRoot: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; }, "strip", z.ZodTypeAny, { modules: { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; path: string; contents?: string | Uint8Array<ArrayBuffer> | undefined; }[]; modulesRoot?: string | undefined; }, { modules: { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; path: string; contents?: string | Uint8Array<ArrayBuffer> | undefined; }[]; modulesRoot?: string | undefined; }>, z.ZodObject<{ script: z.ZodString; scriptPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; modules: z.ZodOptional<z.ZodBoolean>; modulesRules: z.ZodOptional<z.ZodArray<z.ZodObject<{ type: z.ZodEnum<["ESModule", "CommonJS", "Text", "Data", "CompiledWasm", "PythonModule", "PythonRequirement"]>; include: z.ZodArray<z.ZodString, "many">; fallthrough: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }, { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }>, "many">>; modulesRoot: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; }, "strip", z.ZodTypeAny, { script: string; scriptPath?: string | undefined; modules?: boolean | undefined; modulesRules?: { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }[] | undefined; modulesRoot?: string | undefined; }, { script: string; scriptPath?: string | undefined; modules?: boolean | undefined; modulesRules?: { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }[] | undefined; modulesRoot?: string | undefined; }>, z.ZodObject<{ scriptPath: z.ZodEffects<z.ZodString, string, string>; modules: z.ZodOptional<z.ZodBoolean>; modulesRules: z.ZodOptional<z.ZodArray<z.ZodObject<{ type: z.ZodEnum<["ESModule", "CommonJS", "Text", "Data", "CompiledWasm", "PythonModule", "PythonRequirement"]>; include: z.ZodArray<z.ZodString, "many">; fallthrough: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }, { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }>, "many">>; modulesRoot: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; }, "strip", z.ZodTypeAny, { scriptPath: string; modules?: boolean | undefined; modulesRules?: { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }[] | undefined; modulesRoot?: string | undefined; }, { scriptPath: string; modules?: boolean | undefined; modulesRules?: { type: "ESModule" | "CommonJS" | "Text" | "Data" | "CompiledWasm" | "PythonModule" | "PythonRequirement"; include: string[]; fallthrough?: boolean | undefined; }[] | undefined; modulesRoot?: string | undefined; }>]>, z.ZodObject<{ name: z.ZodOptional<z.ZodString>; rootPath: z.ZodOptional<z.ZodEffects<z.ZodString, undefined, string>>; compatibilityDate: z.ZodOptional<z.ZodString>; compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; unsafeInspectorProxy: z.ZodOptional<z.ZodBoolean>; routes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<Json, z.ZodTypeDef, Json>>>; wasmBindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>]>>>; textBlobBindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodString, string, string>>>; dataBlobBindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>]>>>; serviceBindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodLiteral<typeof kCurrentWorker>, z.ZodObject<{ name: z.ZodUnion<[z.ZodString, z.ZodLiteral<typeof kCurrentWorker>]>; entrypoint: z.ZodOptional<z.ZodString>; props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; mixedModeConnectionString: z.ZodOptional<z.ZodType<MixedModeConnectionString_2, z.ZodTypeDef, MixedModeConnectionString_2>>; }, "strip", z.ZodTypeAny, { name: string | typeof kCurrentWorker; entrypoint?: string | undefined; props?: Record<string, unknown> | undefined; mixedModeConnectionString?: MixedModeConnectionString_2 | undefined; }, { name: string | typeof kCurrentWorker; entrypoint?: string | undefined; props?: Record<string, unknown> | undefined; mixedModeConnectionString?: MixedModeConnectionString_2 | undefined; }>, z.ZodObject<{ network: z.ZodObject<{ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; tlsOptions: z.ZodOptional<z.ZodObject<{ keypair: z.ZodOptional<z.ZodObject<{ privateKey: z.ZodOptional<z.ZodString>; certificateChain: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { privateKey?: string | undefined; certificateChain?: string | undefined; }, { privateKey?: string | undefined; certificateChain?: string | undefined; }>>; requireClientCerts: z.ZodOptional<z.ZodBoolean>; trustBrowserCas: z.ZodOptional<z.ZodBoolean>; trustedCertificates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; minVersion: z.ZodOptional<z.ZodNativeEnum<{ readonly GOOD_DEFAULT: 0; readonly SSL3: 1; readonly TLS1DOT0: 2; readonly TLS1DOT1: 3; readonly TLS1DOT2: 4; readonly TLS1DOT3: 5; }>>; cipherList: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; }, { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; tlsOptions?: { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; } | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; tlsOptions?: { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; } | undefined; }>; }, "strip", z.ZodTypeAny, { network: { allow?: string[] | undefined; deny?: string[] | undefined; tlsOptions?: { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; } | undefined; }; }, { network: { allow?: string[] | undefined; deny?: string[] | undefined; tlsOptions?: { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; } | undefined; }; }>, z.ZodObject<{ external: z.ZodType<ExternalServer_2, z.ZodTypeDef, ExternalServer_2>; }, "strip", z.ZodTypeAny, { external: ExternalServer_2 & (ExternalServer_2 | undefined); }, { external: ExternalServer_2 & (ExternalServer_2 | undefined); }>, z.ZodObject<{ disk: z.ZodObject<{ path: z.ZodString; writable: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { path: string; writable?: boolean | undefined; }, { path: string; writable?: boolean | undefined; }>; }, "strip", z.ZodTypeAny, { disk: { path: string; writable?: boolean | undefined; }; }, { disk: { path: string; writable?: boolean | undefined; }; }>, z.ZodObject<{ node: z.ZodType<(req: IncomingMessage, res: ServerResponse, miniflare: Miniflare_2) => Awaitable<void>, z.ZodTypeDef, (req: IncomingMessage, res: ServerResponse, miniflare: Miniflare_2) => Awaitable<void>>; }, "strip", z.ZodTypeAny, { node: (req: IncomingMessage, res: ServerResponse, miniflare: Miniflare_2) => Awaitable<void>; }, { node: (req: IncomingMessage, res: ServerResponse, miniflare: Miniflare_2) => Awaitable<void>; }>, z.ZodType<(request: Request_3, miniflare: Miniflare_2) => Awaitable<Response_3>, z.ZodTypeDef, (request: Request_3, miniflare: Miniflare_2) => Awaitable<Response_3>>]>>>; wrappedBindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{ scriptName: z.ZodString; entrypoint: z.ZodOptional<z.ZodString>; bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<Json, z.ZodTypeDef, Json>>>; }, "strip", z.ZodTypeAny, { scriptName: string; entrypoint?: string | undefined; bindings?: Record<string, Json> | undefined; }, { scriptName: string; entrypoint?: string | undefined; bindings?: Record<string, Json> | undefined; }>]>>>; outboundService: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<typeof kCurrentWorker>, z.ZodObject<{ name: z.ZodUnion<[z.ZodString, z.ZodLiteral<typeof kCurrentWorker>]>; entrypoint: z.ZodOptional<z.ZodString>; props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; mixedModeConnectionString: z.ZodOptional<z.ZodType<MixedModeConnectionString_2, z.ZodTypeDef, MixedModeConnectionString_2>>; }, "strip", z.ZodTypeAny, { name: string | typeof kCurrentWorker; entrypoint?: string | undefined; props?: Record<string, unknown> | undefined; mixedModeConnectionString?: MixedModeConnectionString_2 | undefined; }, { name: string | typeof kCurrentWorker; entrypoint?: string | undefined; props?: Record<string, unknown> | undefined; mixedModeConnectionString?: MixedModeConnectionString_2 | undefined; }>, z.ZodObject<{ network: z.ZodObject<{ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; tlsOptions: z.ZodOptional<z.ZodObject<{ keypair: z.ZodOptional<z.ZodObject<{ privateKey: z.ZodOptional<z.ZodString>; certificateChain: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { privateKey?: string | undefined; certificateChain?: string | undefined; }, { privateKey?: string | undefined; certificateChain?: string | undefined; }>>; requireClientCerts: z.ZodOptional<z.ZodBoolean>; trustBrowserCas: z.ZodOptional<z.ZodBoolean>; trustedCertificates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; minVersion: z.ZodOptional<z.ZodNativeEnum<{ readonly GOOD_DEFAULT: 0; readonly SSL3: 1; readonly TLS1DOT0: 2; readonly TLS1DOT1: 3; readonly TLS1DOT2: 4; readonly TLS1DOT3: 5; }>>; cipherList: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; }, { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { allow?: string[] | undefined; deny?: string[] | undefined; tlsOptions?: { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; } | undefined; }, { allow?: string[] | undefined; deny?: string[] | undefined; tlsOptions?: { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: string | undefined; } | undefined; }>; }, "strip", z.ZodTypeAny, { network: { allow?: string[] | undefined; deny?: string[] | undefined; tlsOptions?: { keypair?: { privateKey?: string | undefined; certificateChain?: string | undefined; } | undefined; requireClientCerts?: boolean | undefined; trustBrowserCas?: boolean | undefined; trustedCertificates?: string[] | undefined; minVersion?: 0 | 1 | 2 | 3 | 4 | 5 | undefined; cipherList?: