wrangler 3.78.3 → 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.3",
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
69
  "@cloudflare/workers-shared": "0.5.3",
70
- "miniflare": "3.20240909.2"
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.3";
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
  },
@@ -161421,7 +161421,9 @@ function createWorkerUploadForm(worker) {
161421
161421
  assets: {
161422
161422
  jwt: experimental_assets.jwt,
161423
161423
  config: assetConfig
161424
- }
161424
+ },
161425
+ ...compatibility_date && { compatibility_date },
161426
+ ...compatibility_flags && { compatibility_flags }
161425
161427
  })
161426
161428
  );
161427
161429
  return formData;
@@ -166782,10 +166784,10 @@ var syncExperimentalAssets = /* @__PURE__ */ __name(async (accountId, scriptName
166782
166784
  let attempts = 0;
166783
166785
  const start = Date.now();
166784
166786
  let completionJwt = "";
166787
+ let assetUploadCount = 0;
166785
166788
  for (const [bucketIndex, bucket] of assetBuckets.entries()) {
166786
166789
  attempts = 0;
166787
166790
  let gatewayErrors = 0;
166788
- let assetUploadCount = 0;
166789
166791
  const doUpload = /* @__PURE__ */ __name(async () => {
166790
166792
  const payload = new import_undici5.FormData();
166791
166793
  for (const manifestEntry of bucket) {
@@ -166981,6 +166983,24 @@ ${resolvedExperimentalAssetsPath}`
166981
166983
  return experimentalAssetsOptions;
166982
166984
  }
166983
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");
166984
167004
  async function createAssetIgnoreFunction(dir) {
166985
167005
  const CF_ASSETS_IGNORE_FILENAME = ".assetsignore";
166986
167006
  const cfAssetIgnorePath = path16.resolve(dir, CF_ASSETS_IGNORE_FILENAME);
@@ -189516,16 +189536,12 @@ Please shift to the --legacy-assets command to preserve the current functionalit
189516
189536
  "The --experimental-public field has been deprecated, try --legacy-assets instead."
189517
189537
  );
189518
189538
  }
189519
- 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)) {
189520
189540
  throw new UserError(
189521
- "Cannot use Assets and Workers Sites in the same Worker."
189522
- );
189523
- }
189524
- if (args.assets) {
189525
- logger.warn(
189526
- "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."
189527
189542
  );
189528
189543
  }
189544
+ verifyMutuallyExclusiveAssetsArgsOrConfig(args, config);
189529
189545
  const experimentalAssetsOptions = processExperimentalAssetsArg(args, config);
189530
189546
  if (args.latest) {
189531
189547
  logger.warn(
@@ -191729,7 +191745,6 @@ async function handler5(args) {
191729
191745
  args.host,
191730
191746
  args.port,
191731
191747
  args.scheme,
191732
- args.database,
191733
191748
  args.user,
191734
191749
  args.password
191735
191750
  );
@@ -191752,9 +191767,9 @@ async function handler5(args) {
191752
191767
  throw new UserError(
191753
191768
  "You must provide a port number - e.g. 'user:password@database.example.com:port/databasename"
191754
191769
  );
191755
- } else if (url4.pathname === "") {
191770
+ } else if (args.connectionString && url4.pathname === "" || args.database === "") {
191756
191771
  throw new UserError(
191757
- "You must provide a database name as the path component - e.g. /postgres"
191772
+ "You must provide a database name as the path component - e.g. example.com:port/postgres"
191758
191773
  );
191759
191774
  } else if (url4.username === "") {
191760
191775
  throw new UserError(
@@ -191767,9 +191782,9 @@ async function handler5(args) {
191767
191782
  } else {
191768
191783
  logger.log(`\u{1F6A7} Creating '${args.name}'`);
191769
191784
  const origin = args.accessClientId && args.accessClientSecret ? {
191770
- host: url4.hostname,
191785
+ host: url4.hostname + url4.pathname,
191771
191786
  scheme: url4.protocol.replace(":", ""),
191772
- database: decodeURIComponent(url4.pathname.replace("/", "")),
191787
+ database: args.database,
191773
191788
  user: decodeURIComponent(url4.username),
191774
191789
  password: decodeURIComponent(url4.password),
191775
191790
  access_client_id: args.accessClientId,
@@ -191778,7 +191793,8 @@ async function handler5(args) {
191778
191793
  host: url4.hostname,
191779
191794
  port: parseInt(url4.port),
191780
191795
  scheme: url4.protocol.replace(":", ""),
191781
- database: decodeURIComponent(url4.pathname.replace("/", "")),
191796
+ // database will either be the value passed in the relevant yargs flag or is URL-decoded value from the url pathname
191797
+ database: args.connectionString !== "" ? decodeURIComponent(url4.pathname.replace("/", "")) : args.database,
191782
191798
  user: decodeURIComponent(url4.username),
191783
191799
  password: decodeURIComponent(url4.password)
191784
191800
  };
@@ -191799,8 +191815,8 @@ async function handler5(args) {
191799
191815
  }
191800
191816
  }
191801
191817
  __name(handler5, "handler");
191802
- function buildURLFromParts(host, port2, scheme, database, user, password) {
191803
- const url4 = new URL(database ? `/${database}` : "", `${scheme}://${host}`);
191818
+ function buildURLFromParts(host, port2, scheme, user, password) {
191819
+ const url4 = new URL(`${scheme}://${host}`);
191804
191820
  if (port2) {
191805
191821
  url4.port = port2.toString();
191806
191822
  }
@@ -191884,11 +191900,13 @@ function options8(yargs) {
191884
191900
  name: { type: "string", describe: "Give your config a new name" },
191885
191901
  "origin-host": {
191886
191902
  type: "string",
191887
- describe: "The host of the origin database"
191903
+ describe: "The host of the origin database",
191904
+ implies: ["database", "origin-user", "origin-password"]
191888
191905
  },
191889
191906
  "origin-port": {
191890
191907
  type: "number",
191891
- describe: "The port number of the origin database"
191908
+ describe: "The port number of the origin database",
191909
+ implies: ["origin-host", "database", "origin-user", "origin-password"]
191892
191910
  },
191893
191911
  "origin-scheme": {
191894
191912
  type: "string",
@@ -191896,27 +191914,42 @@ function options8(yargs) {
191896
191914
  },
191897
191915
  database: {
191898
191916
  type: "string",
191899
- describe: "The name of the database within the origin database"
191917
+ describe: "The name of the database within the origin database",
191918
+ implies: ["origin-host", "origin-user", "origin-password"]
191900
191919
  },
191901
191920
  "origin-user": {
191902
191921
  type: "string",
191903
- describe: "The username used to connect to the origin database"
191922
+ describe: "The username used to connect to the origin database",
191923
+ implies: ["origin-host", "database", "origin-password"]
191904
191924
  },
191905
191925
  "origin-password": {
191906
191926
  type: "string",
191907
- describe: "The password used to connect to the origin database"
191927
+ describe: "The password used to connect to the origin database",
191928
+ implies: ["origin-host", "database", "origin-user"]
191908
191929
  },
191909
191930
  "access-client-id": {
191910
191931
  type: "string",
191911
191932
  describe: "The Client ID of the Access token to use when connecting to the origin database",
191912
191933
  conflicts: ["origin-port"],
191913
- implies: ["access-client-secret"]
191934
+ implies: [
191935
+ "access-client-secret",
191936
+ "origin-host",
191937
+ "database",
191938
+ "origin-user",
191939
+ "origin-password"
191940
+ ]
191914
191941
  },
191915
191942
  "access-client-secret": {
191916
191943
  type: "string",
191917
191944
  describe: "The Client Secret of the Access token to use when connecting to the origin database",
191918
191945
  conflicts: ["origin-port"],
191919
- implies: ["access-client-id"]
191946
+ implies: [
191947
+ "access-client-id",
191948
+ "origin-host",
191949
+ "database",
191950
+ "origin-user",
191951
+ "origin-password"
191952
+ ]
191920
191953
  },
191921
191954
  "caching-disabled": {
191922
191955
  type: "boolean",
@@ -191934,33 +191967,21 @@ function options8(yargs) {
191934
191967
  });
191935
191968
  }
191936
191969
  __name(options8, "options");
191937
- var requiredOriginOptions = [
191970
+ var coreOriginOptions = [
191938
191971
  "originHost",
191939
191972
  "database",
191940
191973
  "originUser",
191941
191974
  "originPassword"
191942
191975
  ];
191943
- function camelToKebab(str) {
191944
- return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
191945
- }
191946
- __name(camelToKebab, "camelToKebab");
191947
191976
  function isOptionSet(args, key) {
191948
191977
  return key in args && args[key] !== void 0;
191949
191978
  }
191950
191979
  __name(isOptionSet, "isOptionSet");
191951
191980
  async function handler9(args) {
191952
- const allOriginFieldsSet = requiredOriginOptions.every(
191981
+ const coreOriginFieldsSet = coreOriginOptions.every(
191953
191982
  (field) => isOptionSet(args, field)
191954
191983
  );
191955
- const noOriginFieldSet = requiredOriginOptions.every(
191956
- (field) => !isOptionSet(args, field)
191957
- );
191958
- if (!allOriginFieldsSet && !noOriginFieldSet) {
191959
- throw new UserError(
191960
- `When updating the origin, all of the following must be set: ${requiredOriginOptions.map((option) => camelToKebab(option)).join(", ")}`
191961
- );
191962
- }
191963
- if (allOriginFieldsSet && args.originPort === void 0 && args.accessClientId === void 0 && args.accessClientSecret === void 0) {
191984
+ if (coreOriginFieldsSet && args.originPort === void 0 && args.accessClientId === void 0 && args.accessClientSecret === void 0) {
191964
191985
  throw new UserError(
191965
191986
  `When updating the origin, either the port or the Access Client ID and Secret must be set`
191966
191987
  );
@@ -191971,7 +191992,7 @@ async function handler9(args) {
191971
191992
  if (args.name !== void 0) {
191972
191993
  database.name = args.name;
191973
191994
  }
191974
- if (allOriginFieldsSet) {
191995
+ if (coreOriginFieldsSet) {
191975
191996
  if (args.accessClientId && args.accessClientSecret) {
191976
191997
  database.origin = {
191977
191998
  scheme: args.originScheme ?? "postgresql",
@@ -199231,8 +199252,8 @@ async function tableFromNotificationGetResponse(config, response) {
199231
199252
  rule_id: ruleId,
199232
199253
  created_at: createdAt,
199233
199254
  queue_name: entry.queueName,
199234
- prefix,
199235
- suffix,
199255
+ prefix: prefix || "(all prefixes)",
199256
+ suffix: suffix || "(all suffixes)",
199236
199257
  event_type: actions.join(",")
199237
199258
  });
199238
199259
  }
@@ -199246,9 +199267,9 @@ async function tableFromNotificationGetResponse(config, response) {
199246
199267
  return tableOutput;
199247
199268
  }
199248
199269
  __name(tableFromNotificationGetResponse, "tableFromNotificationGetResponse");
199249
- async function getEventNotificationConfig(apiCredentials, accountId, bucketName) {
199270
+ async function listEventNotificationConfig(apiCredentials, accountId, bucketName) {
199250
199271
  const headers = eventNotificationHeaders(apiCredentials);
199251
- logger.log(`Fetching notification configuration for bucket ${bucketName}...`);
199272
+ logger.log(`Fetching notification rules for bucket ${bucketName}...`);
199252
199273
  const res = await fetchResult(
199253
199274
  `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration`,
199254
199275
  { method: "GET", headers }
@@ -199281,7 +199302,7 @@ async function getEventNotificationConfig(apiCredentials, accountId, bucketName)
199281
199302
  };
199282
199303
  return newResult;
199283
199304
  }
199284
- __name(getEventNotificationConfig, "getEventNotificationConfig");
199305
+ __name(listEventNotificationConfig, "listEventNotificationConfig");
199285
199306
  async function putEventNotificationConfig(config, apiCredentials, accountId, bucketName, queueName, eventTypes, prefix, suffix) {
199286
199307
  const queue = await getQueue(config, queueName);
199287
199308
  const headers = eventNotificationHeaders(apiCredentials);
@@ -199309,16 +199330,24 @@ __name(putEventNotificationConfig, "putEventNotificationConfig");
199309
199330
  async function deleteEventNotificationConfig(config, apiCredentials, accountId, bucketName, queueName, ruleId) {
199310
199331
  const queue = await getQueue(config, queueName);
199311
199332
  const headers = eventNotificationHeaders(apiCredentials);
199312
- logger.log(
199313
- `Disabling event notifications for "${bucketName}" to queue ${queueName}...`
199314
- );
199315
- const body = ruleId !== void 0 ? {
199316
- ruleIds: [ruleId]
199317
- } : {};
199318
- return await fetchResult(
199319
- `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
199320
- { method: "DELETE", body: JSON.stringify(body), headers }
199321
- );
199333
+ if (ruleId !== void 0) {
199334
+ logger.log(`Deleting event notifications rule "${ruleId}"...`);
199335
+ const body = ruleId !== void 0 ? {
199336
+ ruleIds: [ruleId]
199337
+ } : {};
199338
+ return await fetchResult(
199339
+ `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
199340
+ { method: "DELETE", body: JSON.stringify(body), headers }
199341
+ );
199342
+ } else {
199343
+ logger.log(
199344
+ `Deleting event notification rules associated with queue ${queueName}...`
199345
+ );
199346
+ return await fetchResult(
199347
+ `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
199348
+ { method: "DELETE", headers }
199349
+ );
199350
+ }
199322
199351
  }
199323
199352
  __name(deleteEventNotificationConfig, "deleteEventNotificationConfig");
199324
199353
  function isValidR2BucketName(name) {
@@ -199328,20 +199357,25 @@ __name(isValidR2BucketName, "isValidR2BucketName");
199328
199357
 
199329
199358
  // src/r2/notification.ts
199330
199359
  init_import_meta_url();
199331
- function GetOptions(yargs) {
199360
+ function ListOptions5(yargs) {
199332
199361
  return yargs.positional("bucket", {
199333
- 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",
199334
199363
  type: "string",
199335
199364
  demandOption: true
199336
199365
  });
199337
199366
  }
199338
- __name(GetOptions, "GetOptions");
199339
- async function GetHandler(args) {
199367
+ __name(ListOptions5, "ListOptions");
199368
+ async function ListHandler5(args) {
199340
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
+ }
199341
199375
  const config = readConfig(args.config, args);
199342
199376
  const accountId = await requireAuth(config);
199343
199377
  const apiCreds = requireApiToken();
199344
- const resp = await getEventNotificationConfig(
199378
+ const resp = await listEventNotificationConfig(
199345
199379
  apiCreds,
199346
199380
  accountId,
199347
199381
  `${args.bucket}`
@@ -199349,28 +199383,28 @@ async function GetHandler(args) {
199349
199383
  const tableOutput = await tableFromNotificationGetResponse(config, resp);
199350
199384
  logger.log(tableOutput.map((x2) => formatLabelledValues(x2)).join("\n\n"));
199351
199385
  }
199352
- __name(GetHandler, "GetHandler");
199386
+ __name(ListHandler5, "ListHandler");
199353
199387
  function CreateOptions4(yargs) {
199354
199388
  return yargs.positional("bucket", {
199355
- 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",
199356
199390
  type: "string",
199357
199391
  demandOption: true
199358
199392
  }).option("event-types", {
199359
- describe: "Specify the kinds of object events to emit notifications for. ex. '--event-types object-create object-delete'",
199393
+ describe: "The type of event(s) that will emit event notifications",
199360
199394
  alias: "event-type",
199361
199395
  choices: Object.keys(actionsForEventCategories),
199362
199396
  demandOption: true,
199363
199397
  requiresArg: true,
199364
199398
  type: "array"
199365
199399
  }).option("prefix", {
199366
- describe: "only actions on objects with this prefix will emit notifications",
199400
+ describe: "The prefix that an object must match to emit event notifications (note: regular expressions not supported)",
199367
199401
  requiresArg: false,
199368
199402
  type: "string"
199369
199403
  }).option("suffix", {
199370
- describe: "only actions on objects with this suffix will emit notifications",
199404
+ describe: "The suffix that an object must match to emit event notifications (note: regular expressions not supported)",
199371
199405
  type: "string"
199372
199406
  }).option("queue", {
199373
- describe: "The name of the queue to which event notifications will be sent. ex '--queue my-queue'",
199407
+ describe: "The name of the queue that will receive event notification messages",
199374
199408
  demandOption: true,
199375
199409
  requiresArg: true,
199376
199410
  type: "string"
@@ -199393,21 +199427,21 @@ async function CreateHandler4(args) {
199393
199427
  prefix,
199394
199428
  suffix
199395
199429
  );
199396
- logger.log("Configuration created successfully!");
199430
+ logger.log("Event notification rule created successfully!");
199397
199431
  }
199398
199432
  __name(CreateHandler4, "CreateHandler");
199399
199433
  function DeleteOptions2(yargs) {
199400
199434
  return yargs.positional("bucket", {
199401
- 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",
199402
199436
  type: "string",
199403
199437
  demandOption: true
199404
199438
  }).option("queue", {
199405
- describe: "The name of the queue that is configured to receive notifications. ex '--queue my-queue'",
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",
199406
199440
  demandOption: true,
199407
199441
  requiresArg: true,
199408
199442
  type: "string"
199409
199443
  }).option("rule", {
199410
- 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",
199411
199445
  requiresArg: false,
199412
199446
  type: "string"
199413
199447
  });
@@ -199427,7 +199461,7 @@ async function DeleteHandler2(args) {
199427
199461
  queue,
199428
199462
  rule
199429
199463
  );
199430
- logger.log("Configuration deleted successfully!");
199464
+ logger.log("Event notification rule deleted successfully!");
199431
199465
  }
199432
199466
  __name(DeleteHandler2, "DeleteHandler");
199433
199467
 
@@ -199625,7 +199659,7 @@ async function EnableHandler(args) {
199625
199659
  logger.log(`\u2728 Successfully enabled Sippy on the '${args.name}' bucket.`);
199626
199660
  }
199627
199661
  __name(EnableHandler, "EnableHandler");
199628
- function GetOptions2(yargs) {
199662
+ function GetOptions(yargs) {
199629
199663
  return yargs.positional("name", {
199630
199664
  describe: "The name of the bucket",
199631
199665
  type: "string",
@@ -199637,8 +199671,8 @@ function GetOptions2(yargs) {
199637
199671
  type: "string"
199638
199672
  });
199639
199673
  }
199640
- __name(GetOptions2, "GetOptions");
199641
- async function GetHandler2(args) {
199674
+ __name(GetOptions, "GetOptions");
199675
+ async function GetHandler(args) {
199642
199676
  const config = readConfig(args.config, args);
199643
199677
  const accountId = await requireAuth(config);
199644
199678
  try {
@@ -199656,7 +199690,7 @@ async function GetHandler2(args) {
199656
199690
  }
199657
199691
  }
199658
199692
  }
199659
- __name(GetHandler2, "GetHandler");
199693
+ __name(GetHandler, "GetHandler");
199660
199694
  function DisableOptions(yargs) {
199661
199695
  return yargs.positional("name", {
199662
199696
  describe: "The name of the bucket",
@@ -200196,28 +200230,28 @@ ${key} is ${prettyBytes(objectSize, {
200196
200230
  ).command(
200197
200231
  "get <name>",
200198
200232
  "Check the status of Sippy on an R2 bucket",
200199
- GetOptions2,
200200
- GetHandler2
200233
+ GetOptions,
200234
+ GetHandler
200201
200235
  );
200202
200236
  }
200203
200237
  );
200204
200238
  r2BucketYargs.command(
200205
200239
  "notification",
200206
- `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]")}`,
200207
200241
  (r2EvNotifyYargs) => {
200208
200242
  return r2EvNotifyYargs.command(
200209
- "get <bucket>",
200210
- `Get event notification configuration for a bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200211
- GetOptions,
200212
- GetHandler
200243
+ ["list <bucket>", "get <bucket>"],
200244
+ `List event notification rules for a bucket ${source_default.hex(betaCmdColor)("[open beta]")}`,
200245
+ ListOptions5,
200246
+ ListHandler5
200213
200247
  ).command(
200214
200248
  "create <bucket>",
200215
- `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]")}`,
200216
200250
  CreateOptions4,
200217
200251
  CreateHandler4
200218
200252
  ).command(
200219
200253
  "delete <bucket>",
200220
- `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]")}`,
200221
200255
  DeleteOptions2,
200222
200256
  DeleteHandler2
200223
200257
  );
@@ -212827,6 +212861,17 @@ async function versionsUploadHandler(args) {
212827
212861
  "Legacy Assets does not support uploading versions through `wrangler versions upload`. You must use `wrangler deploy` instead."
212828
212862
  );
212829
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
+ );
212830
212875
  const experimentalAssetsOptions = processExperimentalAssetsArg(args, config);
212831
212876
  if (args.latest) {
212832
212877
  logger.warn(
@@ -214431,15 +214476,16 @@ Move any existing data to .wrangler/state and use --persist, or
214431
214476
  use --persist-to=./wrangler-local-state to keep using the old path.`
214432
214477
  );
214433
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);
214434
214485
  let experimentalAssetsOptions = processExperimentalAssetsArg(args, config);
214435
214486
  if (experimentalAssetsOptions) {
214436
214487
  args.forceLocal = true;
214437
214488
  }
214438
- if ((args.legacyAssets || config.legacy_assets) && experimentalAssetsOptions) {
214439
- throw new UserError(
214440
- "Cannot use Legacy Assets and Experimental Assets in the same Worker."
214441
- );
214442
- }
214443
214489
  const projectRoot = configPath && import_node_path63.default.dirname(configPath);
214444
214490
  const devEnv = new DevEnv();
214445
214491
  if (args.experimentalDevEnv) {
@@ -214988,16 +215034,6 @@ You can explicitly set the \`dev.host\` configuration in your wrangler.toml file
214988
215034
  }
214989
215035
  __name(getInferredHost, "getInferredHost");
214990
215036
  async function validateDevServerSettings(args, config) {
214991
- if ((args.legacyAssets || config.legacy_assets) && (args.site || config.site)) {
214992
- throw new UserError(
214993
- "Cannot use Legacy Assets and Workers Sites in the same Worker."
214994
- );
214995
- }
214996
- if ((args.experimentalAssets || config.experimental_assets) && (args.site || config.site)) {
214997
- throw new UserError(
214998
- "Cannot use Experimental Assets and Workers Sites in the same Worker."
214999
- );
215000
- }
215001
215037
  const entry = await getEntry(
215002
215038
  {
215003
215039
  legacyAssets: args.legacyAssets,