wrangler 4.5.0 → 4.6.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/config-schema.json +1 -2
- package/package.json +3 -3
- package/wrangler-dist/cli.d.ts +2 -2
- package/wrangler-dist/cli.js +174 -6
- package/wrangler-dist/cli.js.map +7 -0
package/config-schema.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.6.0",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"unenv": "2.0.0-rc.15",
|
58
58
|
"workerd": "1.20250321.0",
|
59
59
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
60
|
-
"miniflare": "4.20250321.
|
60
|
+
"miniflare": "4.20250321.1"
|
61
61
|
},
|
62
62
|
"devDependencies": {
|
63
63
|
"@aws-sdk/client-s3": "^3.721.0",
|
@@ -137,7 +137,7 @@
|
|
137
137
|
"yargs": "^17.7.2",
|
138
138
|
"@cloudflare/cli": "1.1.1",
|
139
139
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
140
|
-
"@cloudflare/pages-shared": "^0.13.
|
140
|
+
"@cloudflare/pages-shared": "^0.13.20",
|
141
141
|
"@cloudflare/workers-shared": "0.17.1",
|
142
142
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
143
143
|
},
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -668,7 +668,7 @@ declare interface CfModule {
|
|
668
668
|
/**
|
669
669
|
* A module type.
|
670
670
|
*/
|
671
|
-
declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement"
|
671
|
+
declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
|
672
672
|
|
673
673
|
declare interface CfMTlsCertificate {
|
674
674
|
binding: string;
|
@@ -1019,7 +1019,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
1019
1019
|
/**
|
1020
1020
|
* The possible types for a `Rule`.
|
1021
1021
|
*/
|
1022
|
-
declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement"
|
1022
|
+
declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
|
1023
1023
|
|
1024
1024
|
declare type ConfigUpdateEvent = {
|
1025
1025
|
type: "configUpdate";
|
package/wrangler-dist/cli.js
CHANGED
@@ -81185,7 +81185,7 @@ var import_undici3 = __toESM(require_undici());
|
|
81185
81185
|
|
81186
81186
|
// package.json
|
81187
81187
|
var name = "wrangler";
|
81188
|
-
var version = "4.
|
81188
|
+
var version = "4.6.0";
|
81189
81189
|
|
81190
81190
|
// src/environment-variables/misc-variables.ts
|
81191
81191
|
init_import_meta_url();
|
@@ -91539,8 +91539,7 @@ var RuleTypeToModuleType = {
|
|
91539
91539
|
Data: "buffer",
|
91540
91540
|
Text: "text",
|
91541
91541
|
PythonModule: "python",
|
91542
|
-
PythonRequirement: "python-requirement"
|
91543
|
-
NodeJsCompatModule: "nodejs-compat-module"
|
91542
|
+
PythonRequirement: "python-requirement"
|
91544
91543
|
};
|
91545
91544
|
var ModuleTypeToRuleType = flipObject(RuleTypeToModuleType);
|
91546
91545
|
var modulesWatchRegexp = /^wrangler:modules-watch$/;
|
@@ -101783,6 +101782,24 @@ async function putR2Sippy(accountId, bucketName, params, jurisdiction) {
|
|
101783
101782
|
);
|
101784
101783
|
}
|
101785
101784
|
__name(putR2Sippy, "putR2Sippy");
|
101785
|
+
async function getR2Catalog(accountId, bucketName) {
|
101786
|
+
return await fetchResult(`/accounts/${accountId}/r2-catalog/${bucketName}`, {
|
101787
|
+
method: "GET"
|
101788
|
+
});
|
101789
|
+
}
|
101790
|
+
__name(getR2Catalog, "getR2Catalog");
|
101791
|
+
async function enableR2Catalog(accountId, bucketName) {
|
101792
|
+
return await fetchResult(`/accounts/${accountId}/r2-catalog/${bucketName}`, {
|
101793
|
+
method: "POST"
|
101794
|
+
});
|
101795
|
+
}
|
101796
|
+
__name(enableR2Catalog, "enableR2Catalog");
|
101797
|
+
async function disableR2Catalog(accountId, bucketName) {
|
101798
|
+
return await fetchResult(`/accounts/${accountId}/r2-catalog/${bucketName}`, {
|
101799
|
+
method: "DELETE"
|
101800
|
+
});
|
101801
|
+
}
|
101802
|
+
__name(disableR2Catalog, "disableR2Catalog");
|
101786
101803
|
var actionsForEventCategories = {
|
101787
101804
|
"object-create": ["PutObject", "CompleteMultipartUpload", "CopyObject"],
|
101788
101805
|
"object-delete": ["DeleteObject", "LifecycleDeletion"]
|
@@ -103714,8 +103731,7 @@ var moduleTypeMimeType = {
|
|
103714
103731
|
buffer: "application/octet-stream",
|
103715
103732
|
text: "text/plain",
|
103716
103733
|
python: "text/x-python",
|
103717
|
-
"python-requirement": "text/x-python-requirement"
|
103718
|
-
"nodejs-compat-module": void 0
|
103734
|
+
"python-requirement": "text/x-python-requirement"
|
103719
103735
|
};
|
103720
103736
|
function toMimeType(type) {
|
103721
103737
|
const mimeType = moduleTypeMimeType[type];
|
@@ -117461,6 +117477,26 @@ function capitalizeScheme(scheme) {
|
|
117461
117477
|
}
|
117462
117478
|
}
|
117463
117479
|
__name(capitalizeScheme, "capitalizeScheme");
|
117480
|
+
function formatCachingOptions(cachingOptions) {
|
117481
|
+
switch (cachingOptions?.disabled) {
|
117482
|
+
case false: {
|
117483
|
+
if (cachingOptions.stale_while_revalidate === 0) {
|
117484
|
+
return `max_age: ${cachingOptions.max_age}, stale_while_revalidate: disabled`;
|
117485
|
+
} else {
|
117486
|
+
return `max_age: ${cachingOptions.max_age}, stale_while_revalidate: ${cachingOptions.stale_while_revalidate}`;
|
117487
|
+
}
|
117488
|
+
}
|
117489
|
+
case void 0: {
|
117490
|
+
return "enabled";
|
117491
|
+
}
|
117492
|
+
case true: {
|
117493
|
+
return "disabled";
|
117494
|
+
}
|
117495
|
+
default:
|
117496
|
+
return JSON.stringify(cachingOptions);
|
117497
|
+
}
|
117498
|
+
}
|
117499
|
+
__name(formatCachingOptions, "formatCachingOptions");
|
117464
117500
|
|
117465
117501
|
// src/hyperdrive/create.ts
|
117466
117502
|
function options4(commonYargs) {
|
@@ -117556,7 +117592,7 @@ async function handler7(args) {
|
|
117556
117592
|
port: database.origin.port?.toString() ?? "",
|
117557
117593
|
scheme: capitalizeScheme(database.origin.scheme),
|
117558
117594
|
database: database.origin.database ?? "",
|
117559
|
-
caching:
|
117595
|
+
caching: formatCachingOptions(database.caching),
|
117560
117596
|
mtls: JSON.stringify(database.mtls)
|
117561
117597
|
}))
|
117562
117598
|
);
|
@@ -131015,6 +131051,121 @@ var r2BucketDeleteCommand = createCommand({
|
|
131015
131051
|
}
|
131016
131052
|
});
|
131017
131053
|
|
131054
|
+
// src/r2/catalog.ts
|
131055
|
+
init_import_meta_url();
|
131056
|
+
var r2BucketCatalogNamespace = createNamespace({
|
131057
|
+
metadata: {
|
131058
|
+
description: "Manage the data catalog for your R2 buckets - provides an Iceberg REST interface for query engines like Spark, DuckDB, and Trino",
|
131059
|
+
status: "open-beta",
|
131060
|
+
owner: "Product: R2 Data Catalog"
|
131061
|
+
}
|
131062
|
+
});
|
131063
|
+
var r2BucketCatalogEnableCommand = createCommand({
|
131064
|
+
metadata: {
|
131065
|
+
description: "Enable the data catalog on an R2 bucket",
|
131066
|
+
status: "open-beta",
|
131067
|
+
owner: "Product: R2 Data Catalog"
|
131068
|
+
},
|
131069
|
+
positionalArgs: ["bucket"],
|
131070
|
+
args: {
|
131071
|
+
bucket: {
|
131072
|
+
describe: "The name of the bucket to enable",
|
131073
|
+
type: "string",
|
131074
|
+
demandOption: true
|
131075
|
+
}
|
131076
|
+
},
|
131077
|
+
async handler(args, { config }) {
|
131078
|
+
const accountId = await requireAuth(config);
|
131079
|
+
const response = await enableR2Catalog(accountId, args.bucket);
|
131080
|
+
let catalogHost;
|
131081
|
+
const env6 = getCloudflareApiEnvironmentFromEnv();
|
131082
|
+
if (env6 === "staging") {
|
131083
|
+
catalogHost = `https://catalog-staging.cloudflarestorage.com/${response.name}`;
|
131084
|
+
} else {
|
131085
|
+
catalogHost = `https://catalog.cloudflarestorage.com/${response.name}`;
|
131086
|
+
}
|
131087
|
+
logger.log(
|
131088
|
+
`\u2728 Successfully enabled data catalog on bucket '${args.bucket}'.
|
131089
|
+
|
131090
|
+
Catalog URI: '${catalogHost}'
|
131091
|
+
|
131092
|
+
Use this Catalog URI with Iceberg-compatible query engines (Spark, DuckDB, Trino, etc.) to query data as tables.
|
131093
|
+
Note: You'll need a Cloudflare API token with 'R2 Data Catalog' permission to authenticate your client with this catalog.
|
131094
|
+
For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/`
|
131095
|
+
);
|
131096
|
+
}
|
131097
|
+
});
|
131098
|
+
var r2BucketCatalogDisableCommand = createCommand({
|
131099
|
+
metadata: {
|
131100
|
+
description: "Disable the data catalog for an R2 bucket",
|
131101
|
+
status: "open-beta",
|
131102
|
+
owner: "Product: R2 Data Catalog"
|
131103
|
+
},
|
131104
|
+
positionalArgs: ["bucket"],
|
131105
|
+
args: {
|
131106
|
+
bucket: {
|
131107
|
+
describe: "The name of the bucket to disable the data catalog for",
|
131108
|
+
type: "string",
|
131109
|
+
demandOption: true
|
131110
|
+
}
|
131111
|
+
},
|
131112
|
+
async handler(args, { config }) {
|
131113
|
+
const accountId = await requireAuth(config);
|
131114
|
+
const confirmedDisable = await confirm(
|
131115
|
+
`Are you sure you want to disable the data catalog for bucket '${args.bucket}'? This action is irreversible, and you cannot re-enable it on this bucket.`
|
131116
|
+
);
|
131117
|
+
if (!confirmedDisable) {
|
131118
|
+
logger.log("Disable cancelled.");
|
131119
|
+
return;
|
131120
|
+
}
|
131121
|
+
await disableR2Catalog(accountId, args.bucket);
|
131122
|
+
logger.log(
|
131123
|
+
`Successfully disabled the data catalog on bucket '${args.bucket}'.`
|
131124
|
+
);
|
131125
|
+
}
|
131126
|
+
});
|
131127
|
+
var r2BucketCatalogGetCommand = createCommand({
|
131128
|
+
metadata: {
|
131129
|
+
description: "Get the status of the data catalog for an R2 bucket",
|
131130
|
+
status: "open-beta",
|
131131
|
+
owner: "Product: R2 Data Catalog"
|
131132
|
+
},
|
131133
|
+
positionalArgs: ["bucket"],
|
131134
|
+
args: {
|
131135
|
+
bucket: {
|
131136
|
+
describe: "The name of the R2 bucket whose data catalog status to retrieve",
|
131137
|
+
type: "string",
|
131138
|
+
demandOption: true
|
131139
|
+
}
|
131140
|
+
},
|
131141
|
+
async handler(args, { config }) {
|
131142
|
+
const accountId = await requireAuth(config);
|
131143
|
+
logger.log(`Getting data catalog status for '${args.bucket}'...`);
|
131144
|
+
try {
|
131145
|
+
const catalog = await getR2Catalog(accountId, args.bucket);
|
131146
|
+
const env6 = getCloudflareApiEnvironmentFromEnv();
|
131147
|
+
let catalogHost;
|
131148
|
+
if (env6 === "staging") {
|
131149
|
+
catalogHost = `https://catalog-staging.cloudflarestorage.com/${catalog.name}`;
|
131150
|
+
} else {
|
131151
|
+
catalogHost = `https://catalog.cloudflarestorage.com/${catalog.name}`;
|
131152
|
+
}
|
131153
|
+
const output = {
|
131154
|
+
Bucket: args.bucket,
|
131155
|
+
"Catalog URI": catalogHost,
|
131156
|
+
Status: catalog.status
|
131157
|
+
};
|
131158
|
+
logger.log(formatLabelledValues(output));
|
131159
|
+
} catch (e7) {
|
131160
|
+
if (e7 instanceof APIError && e7.code == 40401) {
|
131161
|
+
logger.log(`Data catalog isn't enabled for bucket '${args.bucket}'.`);
|
131162
|
+
} else {
|
131163
|
+
throw e7;
|
131164
|
+
}
|
131165
|
+
}
|
131166
|
+
}
|
131167
|
+
});
|
131168
|
+
|
131018
131169
|
// src/r2/cors.ts
|
131019
131170
|
init_import_meta_url();
|
131020
131171
|
var import_node_path54 = __toESM(require("node:path"));
|
@@ -149491,6 +149642,22 @@ function createCLIParser(argv) {
|
|
149491
149642
|
command: "wrangler r2 bucket sippy get",
|
149492
149643
|
definition: r2BucketSippyGetCommand
|
149493
149644
|
},
|
149645
|
+
{
|
149646
|
+
command: "wrangler r2 bucket catalog",
|
149647
|
+
definition: r2BucketCatalogNamespace
|
149648
|
+
},
|
149649
|
+
{
|
149650
|
+
command: "wrangler r2 bucket catalog enable",
|
149651
|
+
definition: r2BucketCatalogEnableCommand
|
149652
|
+
},
|
149653
|
+
{
|
149654
|
+
command: "wrangler r2 bucket catalog disable",
|
149655
|
+
definition: r2BucketCatalogDisableCommand
|
149656
|
+
},
|
149657
|
+
{
|
149658
|
+
command: "wrangler r2 bucket catalog get",
|
149659
|
+
definition: r2BucketCatalogGetCommand
|
149660
|
+
},
|
149494
149661
|
{
|
149495
149662
|
command: "wrangler r2 bucket notification",
|
149496
149663
|
definition: r2BucketNotificationNamespace
|
@@ -155011,3 +155178,4 @@ yargs-parser/build/lib/index.js:
|
|
155011
155178
|
* SPDX-License-Identifier: ISC
|
155012
155179
|
*)
|
155013
155180
|
*/
|
155181
|
+
//# sourceMappingURL=cli.js.map
|