wrangler 0.0.0-ca41ebf0e → 0.0.0-ca8123726

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.
@@ -74,20 +74,137 @@ declare type ApiCredentials = {
74
74
  declare type AssetConfig = z.infer<typeof AssetConfigSchema>;
75
75
 
76
76
  declare const AssetConfigSchema: z.ZodObject<{
77
+ account_id: z.ZodOptional<z.ZodNumber>;
78
+ script_id: z.ZodOptional<z.ZodNumber>;
79
+ compatibility_date: z.ZodOptional<z.ZodString>;
80
+ compatibility_flags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
77
81
  html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
78
82
  not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
79
- serve_directly: z.ZodOptional<z.ZodBoolean>;
80
- run_worker_first: z.ZodOptional<z.ZodBoolean>;
83
+ redirects: z.ZodOptional<z.ZodObject<{
84
+ version: z.ZodLiteral<1>;
85
+ staticRules: z.ZodRecord<z.ZodString, z.ZodObject<{
86
+ status: z.ZodNumber;
87
+ to: z.ZodString;
88
+ lineNumber: z.ZodNumber;
89
+ }, "strip", z.ZodTypeAny, {
90
+ status?: number;
91
+ to?: string;
92
+ lineNumber?: number;
93
+ }, {
94
+ status?: number;
95
+ to?: string;
96
+ lineNumber?: number;
97
+ }>>;
98
+ rules: z.ZodRecord<z.ZodString, z.ZodObject<{
99
+ status: z.ZodNumber;
100
+ to: z.ZodString;
101
+ }, "strip", z.ZodTypeAny, {
102
+ status?: number;
103
+ to?: string;
104
+ }, {
105
+ status?: number;
106
+ to?: string;
107
+ }>>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ version?: 1;
110
+ staticRules?: Record<string, {
111
+ status?: number;
112
+ to?: string;
113
+ lineNumber?: number;
114
+ }>;
115
+ rules?: Record<string, {
116
+ status?: number;
117
+ to?: string;
118
+ }>;
119
+ }, {
120
+ version?: 1;
121
+ staticRules?: Record<string, {
122
+ status?: number;
123
+ to?: string;
124
+ lineNumber?: number;
125
+ }>;
126
+ rules?: Record<string, {
127
+ status?: number;
128
+ to?: string;
129
+ }>;
130
+ }>>;
131
+ headers: z.ZodOptional<z.ZodObject<{
132
+ version: z.ZodLiteral<2>;
133
+ rules: z.ZodRecord<z.ZodString, z.ZodObject<{
134
+ set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
135
+ unset: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ set?: Record<string, string>;
138
+ unset?: string[];
139
+ }, {
140
+ set?: Record<string, string>;
141
+ unset?: string[];
142
+ }>>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ version?: 2;
145
+ rules?: Record<string, {
146
+ set?: Record<string, string>;
147
+ unset?: string[];
148
+ }>;
149
+ }, {
150
+ version?: 2;
151
+ rules?: Record<string, {
152
+ set?: Record<string, string>;
153
+ unset?: string[];
154
+ }>;
155
+ }>>;
81
156
  }, "strip", z.ZodTypeAny, {
157
+ account_id?: number;
158
+ script_id?: number;
159
+ compatibility_date?: string;
160
+ compatibility_flags?: string[];
82
161
  html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
83
162
  not_found_handling?: "none" | "single-page-application" | "404-page";
84
- serve_directly?: boolean;
85
- run_worker_first?: boolean;
163
+ redirects?: {
164
+ version?: 1;
165
+ staticRules?: Record<string, {
166
+ status?: number;
167
+ to?: string;
168
+ lineNumber?: number;
169
+ }>;
170
+ rules?: Record<string, {
171
+ status?: number;
172
+ to?: string;
173
+ }>;
174
+ };
175
+ headers?: {
176
+ version?: 2;
177
+ rules?: Record<string, {
178
+ set?: Record<string, string>;
179
+ unset?: string[];
180
+ }>;
181
+ };
86
182
  }, {
183
+ account_id?: number;
184
+ script_id?: number;
185
+ compatibility_date?: string;
186
+ compatibility_flags?: string[];
87
187
  html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
88
188
  not_found_handling?: "none" | "single-page-application" | "404-page";
89
- serve_directly?: boolean;
90
- run_worker_first?: boolean;
189
+ redirects?: {
190
+ version?: 1;
191
+ staticRules?: Record<string, {
192
+ status?: number;
193
+ to?: string;
194
+ lineNumber?: number;
195
+ }>;
196
+ rules?: Record<string, {
197
+ status?: number;
198
+ to?: string;
199
+ }>;
200
+ };
201
+ headers?: {
202
+ version?: 2;
203
+ rules?: Record<string, {
204
+ set?: Record<string, string>;
205
+ unset?: string[];
206
+ }>;
207
+ };
91
208
  }>;
92
209
 
93
210
  declare type Assets = {
@@ -111,8 +228,10 @@ declare type Assets = {
111
228
  declare type AssetsOptions = {
112
229
  directory: string;
113
230
  binding?: string;
114
- routingConfig: RoutingConfig;
231
+ routerConfig: RouterConfig;
115
232
  assetConfig: AssetConfig;
233
+ _redirects?: string;
234
+ _headers?: string;
116
235
  };
117
236
 
118
237
  declare type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
@@ -162,6 +281,8 @@ declare type Binding = {
162
281
  type: "browser";
163
282
  } | {
164
283
  type: "ai";
284
+ } | {
285
+ type: "images";
165
286
  } | {
166
287
  type: "version_metadata";
167
288
  } | {
@@ -177,24 +298,24 @@ declare type Binding = {
177
298
  type: "r2_bucket";
178
299
  } & BindingOmit<CfR2Bucket>) | ({
179
300
  type: "d1";
180
- } & Omit<CfD1Database, "binding">) | ({
301
+ } & BindingOmit<CfD1Database>) | ({
181
302
  type: "vectorize";
182
- } & Omit<CfVectorize, "binding">) | ({
303
+ } & BindingOmit<CfVectorize>) | ({
183
304
  type: "hyperdrive";
184
- } & Omit<CfHyperdrive, "binding">) | ({
305
+ } & BindingOmit<CfHyperdrive>) | ({
185
306
  type: "service";
186
- } & Omit<CfService, "binding">) | {
307
+ } & BindingOmit<CfService>) | {
187
308
  type: "fetcher";
188
309
  fetcher: ServiceFetch;
189
310
  } | ({
190
311
  type: "analytics_engine";
191
- } & Omit<CfAnalyticsEngineDataset, "binding">) | ({
312
+ } & BindingOmit<CfAnalyticsEngineDataset>) | ({
192
313
  type: "dispatch_namespace";
193
- } & Omit<CfDispatchNamespace, "binding">) | ({
314
+ } & BindingOmit<CfDispatchNamespace>) | ({
194
315
  type: "mtls_certificate";
195
- } & Omit<CfMTlsCertificate, "binding">) | ({
316
+ } & BindingOmit<CfMTlsCertificate>) | ({
196
317
  type: "pipeline";
197
- } & Omit<CfPipeline, "binding">) | ({
318
+ } & BindingOmit<CfPipeline>) | ({
198
319
  type: "logfwdr";
199
320
  } & NameOmit<CfLogfwdrBinding>) | {
200
321
  type: `unsafe_${string}`;
@@ -559,7 +680,7 @@ declare interface CfModule {
559
680
  /**
560
681
  * A module type.
561
682
  */
562
- declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement" | "nodejs-compat-module";
683
+ declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
563
684
 
564
685
  declare interface CfMTlsCertificate {
565
686
  binding: string;
@@ -924,7 +1045,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
924
1045
  /**
925
1046
  * The possible types for a `Rule`.
926
1047
  */
927
- declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement" | "NodeJsCompatModule";
1048
+ declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
928
1049
 
929
1050
  declare type ConfigUpdateEvent = {
930
1051
  type: "configUpdate";
@@ -1013,66 +1134,69 @@ attributes?: { name?: string, domain?: string }
1013
1134
  * variable set
1014
1135
  */
1015
1136
  declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, sourceMaps, args, }: PagesDeployOptions): Promise<{
1016
- url: string;
1017
- id: string;
1018
- environment: "production" | "preview";
1019
- build_config: {
1020
- build_command: string;
1021
- destination_dir: string;
1022
- root_dir: string;
1023
- web_analytics_tag?: string | undefined;
1024
- web_analytics_token?: string | undefined;
1025
- fast_builds?: boolean | undefined;
1026
- };
1027
- created_on: string;
1028
- production_branch: string;
1029
- project_id: string;
1030
- project_name: string;
1031
- deployment_trigger: {
1032
- metadata: {
1033
- branch: string;
1034
- commit_hash: string;
1035
- commit_message: string;
1036
- };
1037
- type: string;
1038
- };
1039
- latest_stage: {
1040
- status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
1041
- name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
1042
- started_on: string | null;
1043
- ended_on: string | null;
1137
+ deploymentResponse: {
1138
+ url: string;
1139
+ id: string;
1140
+ environment: "production" | "preview";
1141
+ build_config: {
1142
+ build_command: string;
1143
+ destination_dir: string;
1144
+ root_dir: string;
1145
+ web_analytics_tag?: string | undefined;
1146
+ web_analytics_token?: string | undefined;
1147
+ fast_builds?: boolean | undefined;
1148
+ };
1149
+ created_on: string;
1150
+ production_branch: string;
1151
+ project_id: string;
1152
+ project_name: string;
1153
+ deployment_trigger: {
1154
+ metadata: {
1155
+ branch: string;
1156
+ commit_hash: string;
1157
+ commit_message: string;
1158
+ };
1159
+ type: string;
1160
+ };
1161
+ latest_stage: {
1162
+ status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
1163
+ name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
1164
+ started_on: string | null;
1165
+ ended_on: string | null;
1166
+ };
1167
+ stages: {
1168
+ status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
1169
+ name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
1170
+ started_on: string | null;
1171
+ ended_on: string | null;
1172
+ }[];
1173
+ aliases: string[];
1174
+ modified_on: string;
1175
+ short_id: string;
1176
+ build_image_major_version: number;
1177
+ kv_namespaces?: any;
1178
+ source?: {
1179
+ type: "github" | "gitlab";
1180
+ config: {
1181
+ owner: string;
1182
+ repo_name: string;
1183
+ production_branch?: string | undefined;
1184
+ pr_comments_enabled?: boolean | undefined;
1185
+ deployments_enabled?: boolean | undefined;
1186
+ production_deployments_enabled?: boolean | undefined;
1187
+ preview_deployment_setting?: "none" | "custom" | "all" | undefined;
1188
+ preview_branch_includes?: string[] | undefined;
1189
+ preview_branch_excludes?: string[] | undefined;
1190
+ };
1191
+ } | undefined;
1192
+ env_vars?: any;
1193
+ durable_object_namespaces?: any;
1194
+ is_skipped?: boolean | undefined;
1195
+ files?: {
1196
+ [x: string]: string | undefined;
1197
+ } | undefined;
1044
1198
  };
1045
- stages: {
1046
- status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
1047
- name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
1048
- started_on: string | null;
1049
- ended_on: string | null;
1050
- }[];
1051
- aliases: string[];
1052
- modified_on: string;
1053
- short_id: string;
1054
- build_image_major_version: number;
1055
- kv_namespaces?: any;
1056
- source?: {
1057
- config: {
1058
- owner: string;
1059
- repo_name: string;
1060
- production_branch?: string | undefined;
1061
- pr_comments_enabled?: boolean | undefined;
1062
- deployments_enabled?: boolean | undefined;
1063
- production_deployments_enabled?: boolean | undefined;
1064
- preview_deployment_setting?: "none" | "custom" | "all" | undefined;
1065
- preview_branch_includes?: string[] | undefined;
1066
- preview_branch_excludes?: string[] | undefined;
1067
- };
1068
- type: "github" | "gitlab";
1069
- } | undefined;
1070
- env_vars?: any;
1071
- durable_object_namespaces?: any;
1072
- is_skipped?: boolean | undefined;
1073
- files?: {
1074
- [x: string]: string | undefined;
1075
- } | undefined;
1199
+ formData: FormData_2;
1076
1200
  }>;
1077
1201
 
1078
1202
  declare interface DeprecatedConfigFields {
@@ -1525,6 +1649,8 @@ declare type Entry = {
1525
1649
  file: string;
1526
1650
  /** A worker's directory. Usually where the Wrangler configuration file is located */
1527
1651
  projectRoot: string;
1652
+ /** The path to the config file, if it exists. */
1653
+ configPath: string | undefined;
1528
1654
  /** Is this a module worker or a service worker? */
1529
1655
  format: CfScriptFormat;
1530
1656
  /** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
@@ -2174,6 +2300,18 @@ declare interface EnvironmentNonInheritable {
2174
2300
  binding: string;
2175
2301
  staging?: boolean;
2176
2302
  } | undefined;
2303
+ /**
2304
+ * Binding to Cloudflare Images
2305
+ *
2306
+ * NOTE: This field is not automatically inherited from the top level environment,
2307
+ * and so must be specified in every named environment.
2308
+ *
2309
+ * @default {}
2310
+ * @nonInheritable
2311
+ */
2312
+ images: {
2313
+ binding: string;
2314
+ } | undefined;
2177
2315
  /**
2178
2316
  * Binding to the Worker Version's metadata
2179
2317
  */
@@ -2801,8 +2939,10 @@ declare class Logger {
2801
2939
  #private;
2802
2940
  constructor();
2803
2941
  private overrideLoggerLevel?;
2942
+ private onceHistory;
2804
2943
  get loggerLevel(): "log" | "error" | "none" | "debug" | "info" | "warn";
2805
2944
  set loggerLevel(val: "log" | "error" | "none" | "debug" | "info" | "warn");
2945
+ resetLoggerLevel(): void;
2806
2946
  columns: number;
2807
2947
  debug: (...args: unknown[]) => void;
2808
2948
  debugWithSanitization: (label: string, ...args: unknown[]) => void;
@@ -2812,13 +2952,13 @@ declare class Logger {
2812
2952
  error: (...args: unknown[]) => void;
2813
2953
  table<Keys extends string>(data: TableRow<Keys>[]): void;
2814
2954
  console<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
2815
- static onceHistory: Set<unknown>;
2816
2955
  get once(): {
2817
2956
  info: (...args: unknown[]) => void;
2818
2957
  log: (...args: unknown[]) => void;
2819
2958
  warn: (...args: unknown[]) => void;
2820
2959
  error: (...args: unknown[]) => void;
2821
2960
  };
2961
+ clearHistory(): void;
2822
2962
  doLogOnce(messageLevel: Exclude<LoggerLevel, "none">, args: unknown[]): void;
2823
2963
  private doLog;
2824
2964
  static registerBeforeLogHook(callback: (() => void) | undefined): void;
@@ -26000,23 +26140,23 @@ declare namespace RetryHandler {
26000
26140
 
26001
26141
  declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
26002
26142
 
26003
- declare type RoutingConfig = z.infer<typeof RoutingConfigSchema>;
26143
+ declare type RouterConfig = z.infer<typeof RouterConfigSchema>;
26004
26144
 
26005
- declare const RoutingConfigSchema: z.ZodObject<{
26006
- has_user_worker: z.ZodOptional<z.ZodBoolean>;
26007
- invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>;
26145
+ declare const RouterConfigSchema: z.ZodObject<{
26008
26146
  account_id: z.ZodOptional<z.ZodNumber>;
26009
26147
  script_id: z.ZodOptional<z.ZodNumber>;
26148
+ invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>;
26149
+ has_user_worker: z.ZodOptional<z.ZodBoolean>;
26010
26150
  }, "strip", z.ZodTypeAny, {
26011
- has_user_worker?: boolean;
26012
- invoke_user_worker_ahead_of_assets?: boolean;
26013
26151
  account_id?: number;
26014
26152
  script_id?: number;
26015
- }, {
26016
- has_user_worker?: boolean;
26017
26153
  invoke_user_worker_ahead_of_assets?: boolean;
26154
+ has_user_worker?: boolean;
26155
+ }, {
26018
26156
  account_id?: number;
26019
26157
  script_id?: number;
26158
+ invoke_user_worker_ahead_of_assets?: boolean;
26159
+ has_user_worker?: boolean;
26020
26160
  }>;
26021
26161
 
26022
26162
  /**
@@ -26096,7 +26236,6 @@ declare interface StartDevWorkerInput {
26096
26236
  /**
26097
26237
  * The javascript or typescript entry-point of the worker.
26098
26238
  * This is the `main` property of a Wrangler configuration file.
26099
- * You can specify a file path or provide the contents directly.
26100
26239
  */
26101
26240
  entrypoint?: string;
26102
26241
  /** The configuration of the worker. */
@@ -26190,6 +26329,8 @@ declare interface StartDevWorkerInput {
26190
26329
  testScheduled?: boolean;
26191
26330
  /** Whether to use Vectorize mixed mode -- the worker is run locally but accesses to Vectorize are made remotely */
26192
26331
  bindVectorizeToProd?: boolean;
26332
+ /** Whether to use Images local mode -- this is lower fidelity, but doesn't require network access */
26333
+ imagesLocalMode?: boolean;
26193
26334
  /** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
26194
26335
  multiworkerPrimary?: boolean;
26195
26336
  };
@@ -26518,6 +26659,7 @@ export declare interface Unstable_DevOptions {
26518
26659
  devEnv?: boolean;
26519
26660
  fileBasedRegistry?: boolean;
26520
26661
  vectorizeBindToProd?: boolean;
26662
+ imagesLocalMode?: boolean;
26521
26663
  enableIpc?: boolean;
26522
26664
  };
26523
26665
  }
@@ -26540,6 +26682,7 @@ export declare interface Unstable_MiniflareWorkerOptions {
26540
26682
  workerOptions: SourcelessWorkerOptions;
26541
26683
  define: Record<string, string>;
26542
26684
  main?: string;
26685
+ externalWorkers: WorkerOptions[];
26543
26686
  }
26544
26687
 
26545
26688
  export declare const unstable_pages: {
@@ -26663,6 +26806,7 @@ declare interface Worker {
26663
26806
  scheduled: MiniflareWorker["scheduled"];
26664
26807
  queue: MiniflareWorker["queue"];
26665
26808
  dispose(): Promise<void>;
26809
+ raw: unstable_DevEnv;
26666
26810
  }
26667
26811
 
26668
26812
  declare type WorkerDefinition = {