wrangler 3.78.4 → 3.78.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "3.78.4",
3
+ "version": "3.78.5",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -62,12 +62,12 @@
62
62
  "resolve.exports": "^2.0.2",
63
63
  "selfsigned": "^2.0.1",
64
64
  "source-map": "^0.6.1",
65
- "unenv": "npm:unenv-nightly@2.0.0-1724863496.70db6f1",
65
+ "unenv": "npm:unenv-nightly@2.0.0-1726478054.1e87097",
66
66
  "workerd": "1.20240909.0",
67
67
  "xxhash-wasm": "^1.0.1",
68
68
  "@cloudflare/kv-asset-handler": "0.3.4",
69
- "miniflare": "3.20240909.2",
70
- "@cloudflare/workers-shared": "0.5.3"
69
+ "@cloudflare/workers-shared": "0.5.3",
70
+ "miniflare": "3.20240909.3"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@cloudflare/types": "^6.18.4",
@@ -154,7 +154,7 @@
154
154
  "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
155
155
  "@cloudflare/cli": "1.1.1",
156
156
  "@cloudflare/eslint-config-worker": "1.1.0",
157
- "@cloudflare/pages-shared": "^0.11.58",
157
+ "@cloudflare/pages-shared": "^0.11.59",
158
158
  "@cloudflare/workers-tsconfig": "0.0.0"
159
159
  },
160
160
  "peerDependencies": {
@@ -192,7 +192,7 @@ declare type BodyInit =
192
192
  | ArrayBuffer
193
193
  | AsyncIterable<Uint8Array>
194
194
  | Blob_2
195
- | FormData
195
+ | FormData_2
196
196
  | Iterable<Uint8Array>
197
197
  | NodeJS.ArrayBufferView
198
198
  | URLSearchParams_2
@@ -205,7 +205,7 @@ declare interface BodyMixin {
205
205
 
206
206
  readonly arrayBuffer: () => Promise<ArrayBuffer>
207
207
  readonly blob: () => Promise<Blob_2>
208
- readonly formData: () => Promise<FormData>
208
+ readonly formData: () => Promise<FormData_2>
209
209
  readonly json: () => Promise<unknown>
210
210
  readonly text: () => Promise<string>
211
211
  }
@@ -1245,7 +1245,7 @@ declare namespace Dispatcher {
1245
1245
  path: string;
1246
1246
  method: HttpMethod;
1247
1247
  /** Default: `null` */
1248
- body?: string | Buffer | Uint8Array | Readable | null | FormData;
1248
+ body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
1249
1249
  /** Default: `null` */
1250
1250
  headers?: IncomingHttpHeaders | string[] | null;
1251
1251
  /** Query string params to be embedded in the request URL. Default: `null` */
@@ -2413,7 +2413,7 @@ declare class FileReader {
2413
2413
  /**
2414
2414
  * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
2415
2415
  */
2416
- declare class FormData {
2416
+ declare class FormData_2 {
2417
2417
  /**
2418
2418
  * Appends a new value onto an existing key inside a FormData object,
2419
2419
  * or adds the key if it does not already exist.
@@ -2478,7 +2478,7 @@ declare class FormData {
2478
2478
  * Executes given callback function for each field of the FormData instance
2479
2479
  */
2480
2480
  forEach: (
2481
- callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
2481
+ callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
2482
2482
  thisArg?: unknown
2483
2483
  ) => void
2484
2484
 
@@ -25594,7 +25594,7 @@ declare class Request implements BodyMixin {
25594
25594
 
25595
25595
  readonly arrayBuffer: () => Promise<ArrayBuffer>
25596
25596
  readonly blob: () => Promise<Blob_2>
25597
- readonly formData: () => Promise<FormData>
25597
+ readonly formData: () => Promise<FormData_2>
25598
25598
  readonly json: () => Promise<unknown>
25599
25599
  readonly text: () => Promise<string>
25600
25600
 
@@ -25678,7 +25678,7 @@ declare class Response implements BodyMixin {
25678
25678
 
25679
25679
  readonly arrayBuffer: () => Promise<ArrayBuffer>
25680
25680
  readonly blob: () => Promise<Blob_2>
25681
- readonly formData: () => Promise<FormData>
25681
+ readonly formData: () => Promise<FormData_2>
25682
25682
  readonly json: () => Promise<unknown>
25683
25683
  readonly text: () => Promise<string>
25684
25684
 
@@ -26113,7 +26113,7 @@ declare namespace Undici {
26113
26113
  var Headers: Headers;
26114
26114
  var Response: Response;
26115
26115
  var Request: Request;
26116
- var FormData: FormData;
26116
+ var FormData: FormData_2;
26117
26117
  var File: File;
26118
26118
  var FileReader: FileReader;
26119
26119
  var caches: caches;
@@ -26181,7 +26181,7 @@ declare namespace undici {
26181
26181
  ProgressEventInit,
26182
26182
  ProgressEvent,
26183
26183
  FormDataEntryValue,
26184
- FormData,
26184
+ FormData_2 as FormData,
26185
26185
  DiagnosticsChannel,
26186
26186
  BinaryType,
26187
26187
  WebSocketEventMap,
@@ -152876,7 +152876,7 @@ init_import_meta_url();
152876
152876
  init_import_meta_url();
152877
152877
 
152878
152878
  // package.json
152879
- var version = "3.78.4";
152879
+ var version = "3.78.5";
152880
152880
  var package_default = {
152881
152881
  name: "wrangler",
152882
152882
  version,
@@ -152963,7 +152963,7 @@ var package_default = {
152963
152963
  "resolve.exports": "^2.0.2",
152964
152964
  selfsigned: "^2.0.1",
152965
152965
  "source-map": "^0.6.1",
152966
- unenv: "npm:unenv-nightly@2.0.0-1724863496.70db6f1",
152966
+ unenv: "npm:unenv-nightly@2.0.0-1726478054.1e87097",
152967
152967
  workerd: "1.20240909.0",
152968
152968
  "xxhash-wasm": "^1.0.1"
152969
152969
  },
@@ -166784,10 +166784,10 @@ var syncExperimentalAssets = /* @__PURE__ */ __name(async (accountId, scriptName
166784
166784
  let attempts = 0;
166785
166785
  const start = Date.now();
166786
166786
  let completionJwt = "";
166787
+ let assetUploadCount = 0;
166787
166788
  for (const [bucketIndex, bucket] of assetBuckets.entries()) {
166788
166789
  attempts = 0;
166789
166790
  let gatewayErrors = 0;
166790
- let assetUploadCount = 0;
166791
166791
  const doUpload = /* @__PURE__ */ __name(async () => {
166792
166792
  const payload = new import_undici5.FormData();
166793
166793
  for (const manifestEntry of bucket) {
@@ -166983,6 +166983,24 @@ ${resolvedExperimentalAssetsPath}`
166983
166983
  return experimentalAssetsOptions;
166984
166984
  }
166985
166985
  __name(processExperimentalAssetsArg, "processExperimentalAssetsArg");
166986
+ function verifyMutuallyExclusiveAssetsArgsOrConfig(args, config) {
166987
+ if ((args.experimentalAssets || config.experimental_assets) && (args.legacyAssets || config.legacy_assets)) {
166988
+ throw new UserError(
166989
+ "Cannot use Experimental Assets and Legacy Assets in the same Worker."
166990
+ );
166991
+ }
166992
+ if ((args.experimentalAssets || config.experimental_assets) && (args.site || config.site)) {
166993
+ throw new UserError(
166994
+ "Cannot use Experimental Assets and Workers Sites in the same Worker."
166995
+ );
166996
+ }
166997
+ if ((args.experimentalAssets || config.experimental_assets) && config.tail_consumers?.length) {
166998
+ throw new UserError(
166999
+ "Cannot use Experimental Assets and tail consumers in the same Worker. Tail Workers are not yet supported for Workers with assets."
167000
+ );
167001
+ }
167002
+ }
167003
+ __name(verifyMutuallyExclusiveAssetsArgsOrConfig, "verifyMutuallyExclusiveAssetsArgsOrConfig");
166986
167004
  async function createAssetIgnoreFunction(dir) {
166987
167005
  const CF_ASSETS_IGNORE_FILENAME = ".assetsignore";
166988
167006
  const cfAssetIgnorePath = path16.resolve(dir, CF_ASSETS_IGNORE_FILENAME);
@@ -189518,16 +189536,12 @@ Please shift to the --legacy-assets command to preserve the current functionalit
189518
189536
  "The --experimental-public field has been deprecated, try --legacy-assets instead."
189519
189537
  );
189520
189538
  }
189521
- if ((args.legacyAssets || config.legacy_assets || args.experimentalAssets || config.experimental_assets) && (args.site || config.site)) {
189539
+ if ((args.legacyAssets || config.legacy_assets) && (args.site || config.site)) {
189522
189540
  throw new UserError(
189523
- "Cannot use Assets and Workers Sites in the same Worker."
189524
- );
189525
- }
189526
- if (args.assets) {
189527
- logger.warn(
189528
- "The --assets argument is experimental and may change or break at any time"
189541
+ "Cannot use Legacy Assets and Workers Sites in the same Worker."
189529
189542
  );
189530
189543
  }
189544
+ verifyMutuallyExclusiveAssetsArgsOrConfig(args, config);
189531
189545
  const experimentalAssetsOptions = processExperimentalAssetsArg(args, config);
189532
189546
  if (args.latest) {
189533
189547
  logger.warn(
@@ -199238,8 +199252,8 @@ async function tableFromNotificationGetResponse(config, response) {
199238
199252
  rule_id: ruleId,
199239
199253
  created_at: createdAt,
199240
199254
  queue_name: entry.queueName,
199241
- prefix,
199242
- suffix,
199255
+ prefix: prefix || "(all prefixes)",
199256
+ suffix: suffix || "(all suffixes)",
199243
199257
  event_type: actions.join(",")
199244
199258
  });
199245
199259
  }
@@ -199253,9 +199267,9 @@ async function tableFromNotificationGetResponse(config, response) {
199253
199267
  return tableOutput;
199254
199268
  }
199255
199269
  __name(tableFromNotificationGetResponse, "tableFromNotificationGetResponse");
199256
- async function getEventNotificationConfig(apiCredentials, accountId, bucketName) {
199270
+ async function listEventNotificationConfig(apiCredentials, accountId, bucketName) {
199257
199271
  const headers = eventNotificationHeaders(apiCredentials);
199258
- logger.log(`Fetching notification configuration for bucket ${bucketName}...`);
199272
+ logger.log(`Fetching notification rules for bucket ${bucketName}...`);
199259
199273
  const res = await fetchResult(
199260
199274
  `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration`,
199261
199275
  { method: "GET", headers }
@@ -199288,7 +199302,7 @@ async function getEventNotificationConfig(apiCredentials, accountId, bucketName)
199288
199302
  };
199289
199303
  return newResult;
199290
199304
  }
199291
- __name(getEventNotificationConfig, "getEventNotificationConfig");
199305
+ __name(listEventNotificationConfig, "listEventNotificationConfig");
199292
199306
  async function putEventNotificationConfig(config, apiCredentials, accountId, bucketName, queueName, eventTypes, prefix, suffix) {
199293
199307
  const queue = await getQueue(config, queueName);
199294
199308
  const headers = eventNotificationHeaders(apiCredentials);
@@ -199316,10 +199330,8 @@ __name(putEventNotificationConfig, "putEventNotificationConfig");
199316
199330
  async function deleteEventNotificationConfig(config, apiCredentials, accountId, bucketName, queueName, ruleId) {
199317
199331
  const queue = await getQueue(config, queueName);
199318
199332
  const headers = eventNotificationHeaders(apiCredentials);
199319
- logger.log(
199320
- `Disabling event notifications for "${bucketName}" to queue ${queueName}...`
199321
- );
199322
199333
  if (ruleId !== void 0) {
199334
+ logger.log(`Deleting event notifications rule "${ruleId}"...`);
199323
199335
  const body = ruleId !== void 0 ? {
199324
199336
  ruleIds: [ruleId]
199325
199337
  } : {};
@@ -199328,6 +199340,9 @@ async function deleteEventNotificationConfig(config, apiCredentials, accountId,
199328
199340
  { method: "DELETE", body: JSON.stringify(body), headers }
199329
199341
  );
199330
199342
  } else {
199343
+ logger.log(
199344
+ `Deleting event notification rules associated with queue ${queueName}...`
199345
+ );
199331
199346
  return await fetchResult(
199332
199347
  `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
199333
199348
  { method: "DELETE", headers }
@@ -199342,20 +199357,25 @@ __name(isValidR2BucketName, "isValidR2BucketName");
199342
199357
 
199343
199358
  // src/r2/notification.ts
199344
199359
  init_import_meta_url();
199345
- function GetOptions(yargs) {
199360
+ function ListOptions5(yargs) {
199346
199361
  return yargs.positional("bucket", {
199347
- describe: "The name of the bucket for which notifications will be emitted",
199362
+ describe: "The name of the R2 bucket to get event notification rules for",
199348
199363
  type: "string",
199349
199364
  demandOption: true
199350
199365
  });
199351
199366
  }
199352
- __name(GetOptions, "GetOptions");
199353
- async function GetHandler(args) {
199367
+ __name(ListOptions5, "ListOptions");
199368
+ async function ListHandler5(args) {
199354
199369
  await printWranglerBanner();
199370
+ if (args._[3] === "get") {
199371
+ logger.warn(
199372
+ "`wrangler r2 bucket notification get` is deprecated and will be removed in an upcoming release.\nPlease use `wrangler r2 bucket notification list` instead."
199373
+ );
199374
+ }
199355
199375
  const config = readConfig(args.config, args);
199356
199376
  const accountId = await requireAuth(config);
199357
199377
  const apiCreds = requireApiToken();
199358
- const resp = await getEventNotificationConfig(
199378
+ const resp = await listEventNotificationConfig(
199359
199379
  apiCreds,
199360
199380
  accountId,
199361
199381
  `${args.bucket}`
@@ -199363,10 +199383,10 @@ async function GetHandler(args) {
199363
199383
  const tableOutput = await tableFromNotificationGetResponse(config, resp);
199364
199384
  logger.log(tableOutput.map((x2) => formatLabelledValues(x2)).join("\n\n"));
199365
199385
  }
199366
- __name(GetHandler, "GetHandler");
199386
+ __name(ListHandler5, "ListHandler");
199367
199387
  function CreateOptions4(yargs) {
199368
199388
  return yargs.positional("bucket", {
199369
- describe: "The name of the bucket for which notifications will be emitted",
199389
+ describe: "The name of the R2 bucket to create an event notification rule for",
199370
199390
  type: "string",
199371
199391
  demandOption: true
199372
199392
  }).option("event-types", {
@@ -199407,21 +199427,21 @@ async function CreateHandler4(args) {
199407
199427
  prefix,
199408
199428
  suffix
199409
199429
  );
199410
- logger.log("Configuration created successfully!");
199430
+ logger.log("Event notification rule created successfully!");
199411
199431
  }
199412
199432
  __name(CreateHandler4, "CreateHandler");
199413
199433
  function DeleteOptions2(yargs) {
199414
199434
  return yargs.positional("bucket", {
199415
- describe: "The name of the bucket for which notifications will be emitted",
199435
+ describe: "The name of the R2 bucket to delete an event notification rule for",
199416
199436
  type: "string",
199417
199437
  demandOption: true
199418
199438
  }).option("queue", {
199419
- describe: "The name of the queue that will receive event notification messages",
199439
+ describe: "The name of the queue that corresponds to the event notification rule. If no rule is provided, all event notification rules associated with the bucket and queue will be deleted",
199420
199440
  demandOption: true,
199421
199441
  requiresArg: true,
199422
199442
  type: "string"
199423
199443
  }).option("rule", {
199424
- describe: "The id of the rule to delete. If no rule is specified, all rules for the bucket/queue configuration will be deleted",
199444
+ describe: "The ID of the event notification rule to delete",
199425
199445
  requiresArg: false,
199426
199446
  type: "string"
199427
199447
  });
@@ -199441,7 +199461,7 @@ async function DeleteHandler2(args) {
199441
199461
  queue,
199442
199462
  rule
199443
199463
  );
199444
- logger.log("Configuration deleted successfully!");
199464
+ logger.log("Event notification rule deleted successfully!");
199445
199465
  }
199446
199466
  __name(DeleteHandler2, "DeleteHandler");
199447
199467
 
@@ -199639,7 +199659,7 @@ async function EnableHandler(args) {
199639
199659
  logger.log(`\u2728 Successfully enabled Sippy on the '${args.name}' bucket.`);
199640
199660
  }
199641
199661
  __name(EnableHandler, "EnableHandler");
199642
- function GetOptions2(yargs) {
199662
+ function GetOptions(yargs) {
199643
199663
  return yargs.positional("name", {
199644
199664
  describe: "The name of the bucket",
199645
199665
  type: "string",
@@ -199651,8 +199671,8 @@ function GetOptions2(yargs) {
199651
199671
  type: "string"
199652
199672
  });
199653
199673
  }
199654
- __name(GetOptions2, "GetOptions");
199655
- async function GetHandler2(args) {
199674
+ __name(GetOptions, "GetOptions");
199675
+ async function GetHandler(args) {
199656
199676
  const config = readConfig(args.config, args);
199657
199677
  const accountId = await requireAuth(config);
199658
199678
  try {
@@ -199670,7 +199690,7 @@ async function GetHandler2(args) {
199670
199690
  }
199671
199691
  }
199672
199692
  }
199673
- __name(GetHandler2, "GetHandler");
199693
+ __name(GetHandler, "GetHandler");
199674
199694
  function DisableOptions(yargs) {
199675
199695
  return yargs.positional("name", {
199676
199696
  describe: "The name of the bucket",
@@ -200210,28 +200230,28 @@ ${key} is ${prettyBytes(objectSize, {
200210
200230
  ).command(
200211
200231
  "get <name>",
200212
200232
  "Check the status of Sippy on an R2 bucket",
200213
- GetOptions2,
200214
- GetHandler2
200233
+ GetOptions,
200234
+ GetHandler
200215
200235
  );
200216
200236
  }
200217
200237
  );
200218
200238
  r2BucketYargs.command(
200219
200239
  "notification",
200220
- `Manage event notifications for an R2 bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200240
+ `Manage event notification rules for an R2 bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200221
200241
  (r2EvNotifyYargs) => {
200222
200242
  return r2EvNotifyYargs.command(
200223
- "get <bucket>",
200224
- `Get event notification configuration for a bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200225
- GetOptions,
200226
- GetHandler
200243
+ ["list <bucket>", "get <bucket>"],
200244
+ `List event notification rules for a bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200245
+ ListOptions5,
200246
+ ListHandler5
200227
200247
  ).command(
200228
200248
  "create <bucket>",
200229
- `Create new event notification configuration for an R2 bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200249
+ `Create an event notification rule for an R2 bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200230
200250
  CreateOptions4,
200231
200251
  CreateHandler4
200232
200252
  ).command(
200233
200253
  "delete <bucket>",
200234
- `Delete event notification configuration for an R2 bucket and queue ${source_default.hex(betaCmdColor)("[open beta]")}`,
200254
+ `Delete an event notification rule from an R2 bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200235
200255
  DeleteOptions2,
200236
200256
  DeleteHandler2
200237
200257
  );
@@ -212841,6 +212861,17 @@ async function versionsUploadHandler(args) {
212841
212861
  "Legacy Assets does not support uploading versions through `wrangler versions upload`. You must use `wrangler deploy` instead."
212842
212862
  );
212843
212863
  }
212864
+ verifyMutuallyExclusiveAssetsArgsOrConfig(
212865
+ {
212866
+ // given that legacyAssets and sites are not supported by
212867
+ // `wrangler versions upload` pass them as undefined to
212868
+ // skip the corresponding mutual exclusivity validation
212869
+ legacyAssets: void 0,
212870
+ site: void 0,
212871
+ experimentalAssets: args.experimentalAssets
212872
+ },
212873
+ config
212874
+ );
212844
212875
  const experimentalAssetsOptions = processExperimentalAssetsArg(args, config);
212845
212876
  if (args.latest) {
212846
212877
  logger.warn(
@@ -214445,15 +214476,16 @@ Move any existing data to .wrangler/state and use --persist, or
214445
214476
  use --persist-to=./wrangler-local-state to keep using the old path.`
214446
214477
  );
214447
214478
  }
214479
+ if ((args.legacyAssets || config.legacy_assets) && (args.site || config.site)) {
214480
+ throw new UserError(
214481
+ "Cannot use Legacy Assets and Workers Sites in the same Worker."
214482
+ );
214483
+ }
214484
+ verifyMutuallyExclusiveAssetsArgsOrConfig(args, config);
214448
214485
  let experimentalAssetsOptions = processExperimentalAssetsArg(args, config);
214449
214486
  if (experimentalAssetsOptions) {
214450
214487
  args.forceLocal = true;
214451
214488
  }
214452
- if ((args.legacyAssets || config.legacy_assets) && experimentalAssetsOptions) {
214453
- throw new UserError(
214454
- "Cannot use Legacy Assets and Experimental Assets in the same Worker."
214455
- );
214456
- }
214457
214489
  const projectRoot = configPath && import_node_path63.default.dirname(configPath);
214458
214490
  const devEnv = new DevEnv();
214459
214491
  if (args.experimentalDevEnv) {
@@ -215002,16 +215034,6 @@ You can explicitly set the \`dev.host\` configuration in your wrangler.toml file
215002
215034
  }
215003
215035
  __name(getInferredHost, "getInferredHost");
215004
215036
  async function validateDevServerSettings(args, config) {
215005
- if ((args.legacyAssets || config.legacy_assets) && (args.site || config.site)) {
215006
- throw new UserError(
215007
- "Cannot use Legacy Assets and Workers Sites in the same Worker."
215008
- );
215009
- }
215010
- if ((args.experimentalAssets || config.experimental_assets) && (args.site || config.site)) {
215011
- throw new UserError(
215012
- "Cannot use Experimental Assets and Workers Sites in the same Worker."
215013
- );
215014
- }
215015
215037
  const entry = await getEntry(
215016
215038
  {
215017
215039
  legacyAssets: args.legacyAssets,
@@ -218080,4 +218102,3 @@ yargs-parser/build/lib/index.js:
218080
218102
  * SPDX-License-Identifier: ISC
218081
218103
  *)
218082
218104
  */
218083
- //# sourceMappingURL=cli.js.map