wrangler 4.70.0 → 4.71.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": "4.70.0",
3
+ "version": "4.71.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -56,7 +56,7 @@
56
56
  "unenv": "2.0.0-rc.24",
57
57
  "workerd": "1.20260301.1",
58
58
  "@cloudflare/kv-asset-handler": "0.4.2",
59
- "@cloudflare/unenv-preset": "2.14.0",
59
+ "@cloudflare/unenv-preset": "2.15.0",
60
60
  "miniflare": "4.20260301.1"
61
61
  },
62
62
  "devDependencies": {
@@ -151,10 +151,10 @@
151
151
  "@cloudflare/containers-shared": "0.10.0",
152
152
  "@cloudflare/eslint-config-shared": "1.2.1",
153
153
  "@cloudflare/pages-shared": "^0.13.112",
154
- "@cloudflare/workers-shared": "0.19.0",
154
+ "@cloudflare/workers-shared": "0.19.1",
155
155
  "@cloudflare/workers-tsconfig": "0.0.0",
156
156
  "@cloudflare/workers-utils": "0.12.0",
157
- "@cloudflare/workflows-shared": "0.5.0"
157
+ "@cloudflare/workflows-shared": "0.6.0"
158
158
  },
159
159
  "peerDependencies": {
160
160
  "@cloudflare/workers-types": "^4.20260226.1"
@@ -51084,7 +51084,7 @@ var name, version;
51084
51084
  var init_package = __esm({
51085
51085
  "package.json"() {
51086
51086
  name = "wrangler";
51087
- version = "4.70.0";
51087
+ version = "4.71.0";
51088
51088
  }
51089
51089
  });
51090
51090
 
@@ -220851,11 +220851,14 @@ async function patchConfig(config, id, body) {
220851
220851
  }
220852
220852
  );
220853
220853
  }
220854
+ var PostgresSslmode, MySqlSslmode;
220854
220855
  var init_client4 = __esm({
220855
220856
  "src/hyperdrive/client.ts"() {
220856
220857
  init_import_meta_url();
220857
220858
  init_cfetch();
220858
220859
  init_user3();
220860
+ PostgresSslmode = ["require", "verify-ca", "verify-full"];
220861
+ MySqlSslmode = ["REQUIRED", "VERIFY_CA", "VERIFY_IDENTITY"];
220859
220862
  __name(createConfig, "createConfig");
220860
220863
  __name(deleteConfig, "deleteConfig");
220861
220864
  __name(getConfig, "getConfig");
@@ -220904,13 +220907,19 @@ var init_shared2 = __esm({
220904
220907
  });
220905
220908
 
220906
220909
  // src/hyperdrive/index.ts
220910
+ function normalizeMysqlSslmode(sslmode) {
220911
+ const mysqlSslmode = MySqlSslmode.find(
220912
+ (mode) => mode.toLowerCase() === sslmode.toLowerCase()
220913
+ );
220914
+ return mysqlSslmode ?? sslmode;
220915
+ }
220907
220916
  function getOriginFromArgs(allowPartialOrigin, args) {
220908
220917
  if (args.connectionString) {
220909
220918
  const url4 = new URL(args.connectionString);
220910
220919
  url4.protocol = url4.protocol.toLowerCase();
220911
- if (url4.port === "" && (url4.protocol == "postgresql:" || url4.protocol == "postgres:")) {
220920
+ if (url4.port === "" && (url4.protocol == "postgresql:" || url4.protocol === "postgres:")) {
220912
220921
  url4.port = "5432";
220913
- } else if (url4.port === "" && url4.protocol == "mysql:") {
220922
+ } else if (url4.port === "" && url4.protocol === "mysql:") {
220914
220923
  url4.port = "3306";
220915
220924
  }
220916
220925
  if (url4.protocol === "") {
@@ -220981,7 +220990,7 @@ function getOriginFromArgs(allowPartialOrigin, args) {
220981
220990
  "You must provide both an Access Client ID and Access Client Secret when configuring Hyperdrive-over-Access"
220982
220991
  );
220983
220992
  }
220984
- if (!args.originHost || args.originHost == "") {
220993
+ if (!args.originHost || args.originHost === "") {
220985
220994
  throw new UserError(
220986
220995
  "You must provide an origin hostname for the database"
220987
220996
  );
@@ -221033,17 +221042,16 @@ function getMtlsFromArgs(args) {
221033
221042
  const mtls = {
221034
221043
  ca_certificate_id: args.caCertificateId,
221035
221044
  mtls_certificate_id: args.mtlsCertificateId,
221036
- sslmode: args.sslmode
221045
+ sslmode: args.sslmode ? normalizeMysqlSslmode(args.sslmode) : void 0
221037
221046
  };
221038
221047
  if (JSON.stringify(mtls) === "{}") {
221039
221048
  return void 0;
221040
221049
  } else {
221041
- if (mtls.sslmode == "require" && mtls.ca_certificate_id?.trim()) {
221042
- throw new UserError("CA not allowed when sslmode = 'require' is set");
221043
- }
221044
- if ((mtls.sslmode == "verify-ca" || mtls.sslmode == "verify-full") && !mtls.ca_certificate_id?.trim()) {
221050
+ if (mtls.sslmode && !PostgresSslmode.includes(mtls.sslmode) && !MySqlSslmode.includes(mtls.sslmode)) {
221045
221051
  throw new UserError(
221046
- "CA required when sslmode = 'verify-ca' or 'verify-full' is set"
221052
+ `Invalid sslmode '${mtls.sslmode}'. Valid options are:
221053
+ - PostgreSQL: ${PostgresSslmode.join(", ")}
221054
+ - MySQL: ${MySqlSslmode.join(", ")}`
221047
221055
  );
221048
221056
  }
221049
221057
  return mtls;
@@ -221058,6 +221066,7 @@ var init_hyperdrive2 = __esm({
221058
221066
  init_import_meta_url();
221059
221067
  init_dist();
221060
221068
  init_create_command();
221069
+ init_client4();
221061
221070
  hyperdriveNamespace = createNamespace({
221062
221071
  metadata: {
221063
221072
  description: "\u{1F680} Manage Hyperdrive databases",
@@ -221066,6 +221075,7 @@ var init_hyperdrive2 = __esm({
221066
221075
  category: "Storage & databases"
221067
221076
  }
221068
221077
  });
221078
+ __name(normalizeMysqlSslmode, "normalizeMysqlSslmode");
221069
221079
  upsertOptions = /* @__PURE__ */ __name((defaultOriginScheme = void 0) => ({
221070
221080
  "connection-string": {
221071
221081
  type: "string",
@@ -221158,8 +221168,9 @@ var init_hyperdrive2 = __esm({
221158
221168
  },
221159
221169
  sslmode: {
221160
221170
  type: "string",
221161
- choices: ["require", "verify-ca", "verify-full"],
221162
- description: "Sets CA sslmode for connecting to database."
221171
+ coerce: normalizeMysqlSslmode,
221172
+ choices: [...PostgresSslmode, ...MySqlSslmode],
221173
+ description: `Sets sslmode for connecting to database. For PostgreSQL: '${PostgresSslmode.join(", ")}'. For MySQL: '${MySqlSslmode.join(", ")}'.`
221163
221174
  },
221164
221175
  "origin-connection-limit": {
221165
221176
  type: "number",