wrangler 3.63.2 → 3.64.0

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.63.2",
3
+ "version": "3.64.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -151,10 +151,10 @@
151
151
  "xdg-app-paths": "^8.3.0",
152
152
  "yargs": "^17.7.2",
153
153
  "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
154
- "@cloudflare/eslint-config-worker": "1.1.0",
155
154
  "@cloudflare/cli": "1.1.1",
156
- "@cloudflare/pages-shared": "^0.11.46",
157
- "@cloudflare/workers-tsconfig": "0.0.0"
155
+ "@cloudflare/eslint-config-worker": "1.1.0",
156
+ "@cloudflare/workers-tsconfig": "0.0.0",
157
+ "@cloudflare/pages-shared": "^0.11.46"
158
158
  },
159
159
  "peerDependencies": {
160
160
  "@cloudflare/workers-types": "^4.20240620.0"
@@ -1,105 +1,22 @@
1
1
  {
2
2
  "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Enable incremental compilation */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
3
  "target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
4
  "lib": [
16
5
  "es2021"
17
6
  ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
18
7
  "jsx": "react-jsx" /* Specify what JSX code is generated. */,
19
- // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
20
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
21
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
22
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
23
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
24
- // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
25
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
26
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
27
-
28
- /* Modules */
29
- "module": "es2022" /* Specify what module code is generated. */,
30
- // "rootDir": "./", /* Specify the root folder within your source files. */
31
- "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
32
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
- // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
8
+ "module": "ESNext" /* Specify what module code is generated. */,
9
+ "moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
36
10
  "types": [
37
11
  "@cloudflare/workers-types"
38
12
  ] /* Specify type package names to be included without being referenced in a source file. */,
39
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
40
13
  "resolveJsonModule": true /* Enable importing .json files */,
41
- // "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
42
-
43
- /* JavaScript Support */
44
14
  "allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
45
- "checkJs": false /* Enable error reporting in type-checked JavaScript files. */,
46
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
47
-
48
- /* Emit */
49
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
50
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
51
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
52
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
53
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
54
- // "outDir": "./", /* Specify an output folder for all emitted files. */
55
- // "removeComments": true, /* Disable emitting comments. */
56
15
  "noEmit": true /* Disable emitting files from a compilation. */,
57
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
58
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
59
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
60
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
61
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
62
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
63
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
64
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
65
- // "newLine": "crlf", /* Set the newline character for emitting files. */
66
- // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
67
- // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
68
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
69
- // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
70
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
71
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
72
-
73
- /* Interop Constraints */
74
16
  "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
75
17
  "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
76
- // "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
77
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
78
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
79
-
80
- /* Type Checking */
81
18
  "strict": true /* Enable all strict type-checking options. */,
82
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
83
- // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
84
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
85
- // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
86
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
87
- // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
88
- // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
89
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
90
- // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
91
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
92
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
93
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
94
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
95
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
96
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
97
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
98
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
99
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
100
-
101
- /* Completeness */
102
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
19
+ "noUncheckedIndexedAccess": true,
103
20
  "skipLibCheck": true /* Skip type checking all .d.ts files. */
104
21
  }
105
22
  }
@@ -100903,21 +100903,89 @@ var require_has_property_descriptors = __commonJS({
100903
100903
  }
100904
100904
  });
100905
100905
 
100906
- // ../../node_modules/.pnpm/define-properties@1.2.0/node_modules/define-properties/index.js
100906
+ // ../../node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js
100907
+ var require_gopd = __commonJS({
100908
+ "../../node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js"(exports2, module3) {
100909
+ "use strict";
100910
+ init_import_meta_url();
100911
+ var GetIntrinsic = require_get_intrinsic();
100912
+ var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
100913
+ if ($gOPD) {
100914
+ try {
100915
+ $gOPD([], "length");
100916
+ } catch (e3) {
100917
+ $gOPD = null;
100918
+ }
100919
+ }
100920
+ module3.exports = $gOPD;
100921
+ }
100922
+ });
100923
+
100924
+ // ../../node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js
100925
+ var require_define_data_property = __commonJS({
100926
+ "../../node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js"(exports2, module3) {
100927
+ "use strict";
100928
+ init_import_meta_url();
100929
+ var hasPropertyDescriptors = require_has_property_descriptors()();
100930
+ var GetIntrinsic = require_get_intrinsic();
100931
+ var $defineProperty = hasPropertyDescriptors && GetIntrinsic("%Object.defineProperty%", true);
100932
+ var $SyntaxError = GetIntrinsic("%SyntaxError%");
100933
+ var $TypeError = GetIntrinsic("%TypeError%");
100934
+ var gopd = require_gopd();
100935
+ module3.exports = /* @__PURE__ */ __name(function defineDataProperty(obj, property, value) {
100936
+ if (!obj || typeof obj !== "object" && typeof obj !== "function") {
100937
+ throw new $TypeError("`obj` must be an object or a function`");
100938
+ }
100939
+ if (typeof property !== "string" && typeof property !== "symbol") {
100940
+ throw new $TypeError("`property` must be a string or a symbol`");
100941
+ }
100942
+ if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) {
100943
+ throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
100944
+ }
100945
+ if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) {
100946
+ throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
100947
+ }
100948
+ if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) {
100949
+ throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
100950
+ }
100951
+ if (arguments.length > 6 && typeof arguments[6] !== "boolean") {
100952
+ throw new $TypeError("`loose`, if provided, must be a boolean");
100953
+ }
100954
+ var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
100955
+ var nonWritable = arguments.length > 4 ? arguments[4] : null;
100956
+ var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
100957
+ var loose = arguments.length > 6 ? arguments[6] : false;
100958
+ var desc = !!gopd && gopd(obj, property);
100959
+ if ($defineProperty) {
100960
+ $defineProperty(obj, property, {
100961
+ configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
100962
+ enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
100963
+ value,
100964
+ writable: nonWritable === null && desc ? desc.writable : !nonWritable
100965
+ });
100966
+ } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
100967
+ obj[property] = value;
100968
+ } else {
100969
+ throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
100970
+ }
100971
+ }, "defineDataProperty");
100972
+ }
100973
+ });
100974
+
100975
+ // ../../node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js
100907
100976
  var require_define_properties = __commonJS({
100908
- "../../node_modules/.pnpm/define-properties@1.2.0/node_modules/define-properties/index.js"(exports2, module3) {
100977
+ "../../node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js"(exports2, module3) {
100909
100978
  "use strict";
100910
100979
  init_import_meta_url();
100911
100980
  var keys = require_object_keys();
100912
100981
  var hasSymbols = typeof Symbol === "function" && typeof Symbol("foo") === "symbol";
100913
100982
  var toStr = Object.prototype.toString;
100914
100983
  var concat = Array.prototype.concat;
100915
- var origDefineProperty = Object.defineProperty;
100984
+ var defineDataProperty = require_define_data_property();
100916
100985
  var isFunction2 = /* @__PURE__ */ __name(function(fn2) {
100917
100986
  return typeof fn2 === "function" && toStr.call(fn2) === "[object Function]";
100918
100987
  }, "isFunction");
100919
- var hasPropertyDescriptors = require_has_property_descriptors()();
100920
- var supportsDescriptors = origDefineProperty && hasPropertyDescriptors;
100988
+ var supportsDescriptors = require_has_property_descriptors()();
100921
100989
  var defineProperty2 = /* @__PURE__ */ __name(function(object, name, value, predicate) {
100922
100990
  if (name in object) {
100923
100991
  if (predicate === true) {
@@ -100929,14 +100997,9 @@ var require_define_properties = __commonJS({
100929
100997
  }
100930
100998
  }
100931
100999
  if (supportsDescriptors) {
100932
- origDefineProperty(object, name, {
100933
- configurable: true,
100934
- enumerable: false,
100935
- value,
100936
- writable: true
100937
- });
101000
+ defineDataProperty(object, name, value, true);
100938
101001
  } else {
100939
- object[name] = value;
101002
+ defineDataProperty(object, name, value);
100940
101003
  }
100941
101004
  }, "defineProperty");
100942
101005
  var defineProperties = /* @__PURE__ */ __name(function(object, map) {
@@ -152612,7 +152675,7 @@ init_import_meta_url();
152612
152675
  init_import_meta_url();
152613
152676
 
152614
152677
  // package.json
152615
- var version = "3.63.2";
152678
+ var version = "3.64.0";
152616
152679
  var package_default = {
152617
152680
  name: "wrangler",
152618
152681
  version,
@@ -155032,6 +155095,13 @@ async function loginOrRefreshIfRequired(props) {
155032
155095
  }
155033
155096
  __name(loginOrRefreshIfRequired, "loginOrRefreshIfRequired");
155034
155097
  async function login(props = { browser: true }) {
155098
+ const authFromEnv = getAuthFromEnv();
155099
+ if (authFromEnv) {
155100
+ logger.error(
155101
+ "You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log in via OAuth."
155102
+ );
155103
+ return false;
155104
+ }
155035
155105
  logger.log("Attempting to login via OAuth...");
155036
155106
  const urlToOpen = await getAuthURL(props?.scopes);
155037
155107
  let server;
@@ -155149,6 +155219,13 @@ async function refreshToken() {
155149
155219
  }
155150
155220
  __name(refreshToken, "refreshToken");
155151
155221
  async function logout() {
155222
+ const authFromEnv = getAuthFromEnv();
155223
+ if (authFromEnv) {
155224
+ logger.log(
155225
+ "You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log out."
155226
+ );
155227
+ return;
155228
+ }
155152
155229
  if (!LocalState.accessToken) {
155153
155230
  if (!LocalState.refreshToken) {
155154
155231
  logger.log("Not logged in, exiting...");
@@ -187822,6 +187899,10 @@ async function deleteEventNotificationConfig(config, apiCredentials, accountId,
187822
187899
  );
187823
187900
  }
187824
187901
  __name(deleteEventNotificationConfig, "deleteEventNotificationConfig");
187902
+ function isValidR2BucketName(name) {
187903
+ return typeof name === "string" && /^[a-zA-Z][a-zA-Z0-9-]*$/.test(name);
187904
+ }
187905
+ __name(isValidR2BucketName, "isValidR2BucketName");
187825
187906
 
187826
187907
  // src/r2/notification.ts
187827
187908
  init_import_meta_url();
@@ -188540,6 +188621,11 @@ ${key} is ${prettyBytes(objectSize, {
188540
188621
  },
188541
188622
  async (args) => {
188542
188623
  await printWranglerBanner();
188624
+ if (!isValidR2BucketName(args.name)) {
188625
+ throw new CommandLineArgsError(
188626
+ `The bucket name "${args.name}" is invalid. Bucket names can only have alphanumeric and - characters.`
188627
+ );
188628
+ }
188543
188629
  const config = readConfig(args.config, args);
188544
188630
  const accountId = await requireAuth(config);
188545
188631
  let fullBucketName = `${args.name}`;
@@ -202003,6 +202089,11 @@ async function whoami() {
202003
202089
  `\u{1F44B} You are logged in with an ${user.authType}. Unable to retrieve email for this user. Are you missing the \`User->User Details->Read\` permission?`
202004
202090
  );
202005
202091
  }
202092
+ if (user.authType === "API Token") {
202093
+ logger.log(
202094
+ "\u2139\uFE0F The API Token is read from the CLOUDFLARE_API_TOKEN in your environment."
202095
+ );
202096
+ }
202006
202097
  logger.table(
202007
202098
  user.accounts.map((account) => ({
202008
202099
  "Account Name": account.name,
@@ -211316,4 +211407,3 @@ yargs-parser/build/lib/index.js:
211316
211407
  * SPDX-License-Identifier: ISC
211317
211408
  *)
211318
211409
  */
211319
- //# sourceMappingURL=cli.js.map