wrangler 4.6.0 → 4.7.1
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 +8 -8
- package/wrangler-dist/cli.js +178 -64
- package/wrangler-dist/cli.js.map +0 -7
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.7.1",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -56,8 +56,8 @@
|
|
56
56
|
"path-to-regexp": "6.3.0",
|
57
57
|
"unenv": "2.0.0-rc.15",
|
58
58
|
"workerd": "1.20250321.0",
|
59
|
-
"
|
60
|
-
"
|
59
|
+
"miniflare": "4.20250321.2",
|
60
|
+
"@cloudflare/kv-asset-handler": "0.4.0"
|
61
61
|
},
|
62
62
|
"devDependencies": {
|
63
63
|
"@aws-sdk/client-s3": "^3.721.0",
|
@@ -115,7 +115,7 @@
|
|
115
115
|
"pretty-bytes": "^6.0.0",
|
116
116
|
"prompts": "^2.4.2",
|
117
117
|
"resolve": "^1.22.8",
|
118
|
-
"rimraf": "^
|
118
|
+
"rimraf": "^6.0.1",
|
119
119
|
"selfsigned": "^2.0.1",
|
120
120
|
"semiver": "^1.1.0",
|
121
121
|
"shell-quote": "^1.8.1",
|
@@ -135,11 +135,11 @@
|
|
135
135
|
"xdg-app-paths": "^8.3.0",
|
136
136
|
"xxhash-wasm": "^1.0.1",
|
137
137
|
"yargs": "^17.7.2",
|
138
|
-
"@cloudflare/cli": "1.1.1",
|
139
138
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
140
|
-
"@cloudflare/pages-shared": "^0.13.
|
139
|
+
"@cloudflare/pages-shared": "^0.13.21",
|
141
140
|
"@cloudflare/workers-shared": "0.17.1",
|
142
|
-
"@cloudflare/workers-tsconfig": "0.0.0"
|
141
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
142
|
+
"@cloudflare/cli": "1.1.1"
|
143
143
|
},
|
144
144
|
"peerDependencies": {
|
145
145
|
"@cloudflare/workers-types": "^4.20250321.0"
|
@@ -176,7 +176,7 @@
|
|
176
176
|
"test": "dotenv -- pnpm run assert-git-version && dotenv -- vitest",
|
177
177
|
"test:ci": "pnpm run test run",
|
178
178
|
"test:debug": "pnpm run test --silent=false --verbose=true",
|
179
|
-
"test:e2e": "dotenv -- vitest -c ./e2e/vitest.config.mts",
|
179
|
+
"test:e2e": "dotenv -- vitest run -c ./e2e/vitest.config.mts",
|
180
180
|
"test:watch": "pnpm run test --testTimeout=50000 --watch",
|
181
181
|
"type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
|
182
182
|
}
|
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.7.1";
|
81189
81189
|
|
81190
81190
|
// src/environment-variables/misc-variables.ts
|
81191
81191
|
init_import_meta_url();
|
@@ -90086,11 +90086,14 @@ function hasCursor(result_info) {
|
|
90086
90086
|
}
|
90087
90087
|
__name(hasCursor, "hasCursor");
|
90088
90088
|
function renderError(err, level = 0) {
|
90089
|
+
const indent = " ".repeat(level);
|
90089
90090
|
const chainedMessages = err.error_chain?.map(
|
90090
90091
|
(chainedError) => `
|
90091
|
-
|
90092
|
+
|
90093
|
+
${indent}- ${renderError(chainedError, level + 1)}`
|
90092
90094
|
).join("\n") ?? "";
|
90093
|
-
return (err.code ? `${err.message} [code: ${err.code}]` : err.message) +
|
90095
|
+
return (err.code ? `${err.message} [code: ${err.code}]` : err.message) + (err.documentation_url ? `
|
90096
|
+
${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
|
90094
90097
|
}
|
90095
90098
|
__name(renderError, "renderError");
|
90096
90099
|
|
@@ -101789,15 +101792,21 @@ async function getR2Catalog(accountId, bucketName) {
|
|
101789
101792
|
}
|
101790
101793
|
__name(getR2Catalog, "getR2Catalog");
|
101791
101794
|
async function enableR2Catalog(accountId, bucketName) {
|
101792
|
-
return await fetchResult(
|
101793
|
-
|
101794
|
-
|
101795
|
+
return await fetchResult(
|
101796
|
+
`/accounts/${accountId}/r2-catalog/${bucketName}/enable`,
|
101797
|
+
{
|
101798
|
+
method: "POST"
|
101799
|
+
}
|
101800
|
+
);
|
101795
101801
|
}
|
101796
101802
|
__name(enableR2Catalog, "enableR2Catalog");
|
101797
101803
|
async function disableR2Catalog(accountId, bucketName) {
|
101798
|
-
return await fetchResult(
|
101799
|
-
|
101800
|
-
|
101804
|
+
return await fetchResult(
|
101805
|
+
`/accounts/${accountId}/r2-catalog/${bucketName}/disable`,
|
101806
|
+
{
|
101807
|
+
method: "POST"
|
101808
|
+
}
|
101809
|
+
);
|
101801
101810
|
}
|
101802
101811
|
__name(disableR2Catalog, "disableR2Catalog");
|
101803
101812
|
var actionsForEventCategories = {
|
@@ -102656,7 +102665,7 @@ async function runProvisioningFlow(item, preExisting, friendlyBindingName, scrip
|
|
102656
102665
|
value: SEARCH_OPTION_VALUE
|
102657
102666
|
});
|
102658
102667
|
}
|
102659
|
-
const defaultName = `${scriptName}-${item.binding.toLowerCase().
|
102668
|
+
const defaultName = `${scriptName}-${item.binding.toLowerCase().replaceAll("_", "-")}`;
|
102660
102669
|
logger.log("Provisioning", item.binding, `(${friendlyBindingName})...`);
|
102661
102670
|
if (item.handler.name) {
|
102662
102671
|
logger.log("Resource name found in config:", item.handler.name);
|
@@ -114332,6 +114341,22 @@ var CommandRegistrationError = class extends Error {
|
|
114332
114341
|
|
114333
114342
|
// src/core/register-yargs-command.ts
|
114334
114343
|
init_import_meta_url();
|
114344
|
+
|
114345
|
+
// src/utils/is-local.ts
|
114346
|
+
init_import_meta_url();
|
114347
|
+
function isLocal(args, defaultValue = true) {
|
114348
|
+
if (args.local === void 0 && args.remote === void 0) {
|
114349
|
+
return defaultValue;
|
114350
|
+
}
|
114351
|
+
return args.local === true || args.remote === false;
|
114352
|
+
}
|
114353
|
+
__name(isLocal, "isLocal");
|
114354
|
+
function printResourceLocation(location) {
|
114355
|
+
logger.log(source_default.hex("#BD5B08").bold("Resource location:"), location);
|
114356
|
+
}
|
114357
|
+
__name(printResourceLocation, "printResourceLocation");
|
114358
|
+
|
114359
|
+
// src/core/register-yargs-command.ts
|
114335
114360
|
function createRegisterYargsCommand(yargs, subHelp) {
|
114336
114361
|
return /* @__PURE__ */ __name(function registerCommand(segment, def, registerSubTreeCallback) {
|
114337
114362
|
yargs.command(
|
@@ -114380,6 +114405,21 @@ function createHandler(def) {
|
|
114380
114405
|
logger.warn(def.metadata.statusMessage);
|
114381
114406
|
}
|
114382
114407
|
await def.validateArgs?.(args);
|
114408
|
+
const shouldPrintResourceLocation = typeof def.behaviour?.printResourceLocation === "function" ? def.behaviour?.printResourceLocation(args) : def.behaviour?.printResourceLocation;
|
114409
|
+
if (shouldPrintResourceLocation) {
|
114410
|
+
const remote = "remote" in args && typeof args.remote === "boolean" ? args.remote : void 0;
|
114411
|
+
const local = "local" in args && typeof args.local === "boolean" ? args.local : void 0;
|
114412
|
+
const resourceIsLocal = isLocal({ remote, local });
|
114413
|
+
if (resourceIsLocal) {
|
114414
|
+
printResourceLocation("local");
|
114415
|
+
logger.log(
|
114416
|
+
`Use --remote if you want to access the remote instance.
|
114417
|
+
`
|
114418
|
+
);
|
114419
|
+
} else {
|
114420
|
+
printResourceLocation("remote");
|
114421
|
+
}
|
114422
|
+
}
|
114383
114423
|
const experimentalFlags = def.behaviour?.overrideExperimentalFlags ? def.behaviour?.overrideExperimentalFlags(args) : {
|
114384
114424
|
MULTIWORKER: false,
|
114385
114425
|
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
@@ -116656,12 +116696,7 @@ async function getEntry(args, config, command2) {
|
|
116656
116696
|
projectRoot,
|
116657
116697
|
config.tsconfig
|
116658
116698
|
);
|
116659
|
-
const { localBindings
|
116660
|
-
if (command2 === "dev" && remoteBindings.length > 0) {
|
116661
|
-
logger.warn(
|
116662
|
-
"WARNING: You have Durable Object bindings that are not defined locally in the worker being developed.\nBe aware that changes to the data stored in these Durable Objects will be permanent and affect the live instances.\nRemote Durable Objects that are affected:\n" + remoteBindings.map((b6) => `- ${JSON.stringify(b6)}`).join("\n")
|
116663
|
-
);
|
116664
|
-
}
|
116699
|
+
const { localBindings } = partitionDurableObjectBindings(config);
|
116665
116700
|
if (format9 === "service-worker" && localBindings.length > 0) {
|
116666
116701
|
const errorMessage = "You seem to be trying to use Durable Objects in a Worker written as a service-worker.";
|
116667
116702
|
const addScriptName = `You can use Durable Objects defined in other Workers by specifying a \`script_name\` in your ${configFileName(config.configPath)} file, where \`script_name\` is the name of the Worker that implements that Durable Object. For example:`;
|
@@ -116690,7 +116725,7 @@ function partitionDurableObjectBindings(config) {
|
|
116690
116725
|
const localBindings = [];
|
116691
116726
|
const remoteBindings = [];
|
116692
116727
|
for (const binding of config.durable_objects.bindings) {
|
116693
|
-
if (binding.script_name === void 0) {
|
116728
|
+
if (binding.script_name === void 0 || binding.script_name === config.name) {
|
116694
116729
|
localBindings.push(binding);
|
116695
116730
|
} else {
|
116696
116731
|
remoteBindings.push(binding);
|
@@ -117718,13 +117753,20 @@ function upsertOptions(yargs) {
|
|
117718
117753
|
type: "number",
|
117719
117754
|
describe: "Indicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled"
|
117720
117755
|
},
|
117721
|
-
"ca-certificate-
|
117756
|
+
"ca-certificate-id": {
|
117757
|
+
alias: "ca-certificate-uuid",
|
117722
117758
|
type: "string",
|
117723
117759
|
describe: "Sets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate."
|
117724
117760
|
},
|
117725
|
-
"mtls-certificate-
|
117761
|
+
"mtls-certificate-id": {
|
117762
|
+
alias: "mtls-certificate-uuid",
|
117726
117763
|
type: "string",
|
117727
117764
|
describe: "Sets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates."
|
117765
|
+
},
|
117766
|
+
sslmode: {
|
117767
|
+
type: "string",
|
117768
|
+
choices: ["require", "verify-ca", "verify-full"],
|
117769
|
+
describe: "Sets CA sslmode for connecting to database."
|
117728
117770
|
}
|
117729
117771
|
}).group(
|
117730
117772
|
["connection-string"],
|
@@ -117878,12 +117920,21 @@ function getCacheOptionsFromArgs(args) {
|
|
117878
117920
|
__name(getCacheOptionsFromArgs, "getCacheOptionsFromArgs");
|
117879
117921
|
function getMtlsFromArgs(args) {
|
117880
117922
|
const mtls = {
|
117881
|
-
|
117882
|
-
|
117923
|
+
ca_certificate_id: args.caCertificateId,
|
117924
|
+
mtls_certificate_id: args.mtlsCertificateId,
|
117925
|
+
sslmode: args.sslmode
|
117883
117926
|
};
|
117884
117927
|
if (JSON.stringify(mtls) === "{}") {
|
117885
117928
|
return void 0;
|
117886
117929
|
} else {
|
117930
|
+
if (mtls.sslmode == "require" && mtls.ca_certificate_id?.trim()) {
|
117931
|
+
throw new UserError("CA not allowed when sslmode = 'require' is set");
|
117932
|
+
}
|
117933
|
+
if ((mtls.sslmode == "verify-ca" || mtls.sslmode == "verify-full") && !mtls.ca_certificate_id?.trim()) {
|
117934
|
+
throw new UserError(
|
117935
|
+
"CA required when sslmode = 'verify-ca' or 'verify-full' is set"
|
117936
|
+
);
|
117937
|
+
}
|
117887
117938
|
return mtls;
|
117888
117939
|
}
|
117889
117940
|
}
|
@@ -118418,16 +118469,6 @@ function getValidBindingName(name2, fallback) {
|
|
118418
118469
|
}
|
118419
118470
|
__name(getValidBindingName, "getValidBindingName");
|
118420
118471
|
|
118421
|
-
// src/utils/is-local.ts
|
118422
|
-
init_import_meta_url();
|
118423
|
-
function isLocal(args, defaultValue = true) {
|
118424
|
-
if (args.local === void 0 && args.remote === void 0) {
|
118425
|
-
return defaultValue;
|
118426
|
-
}
|
118427
|
-
return args.local === true || args.remote === false;
|
118428
|
-
}
|
118429
|
-
__name(isLocal, "isLocal");
|
118430
|
-
|
118431
118472
|
// src/kv/index.ts
|
118432
118473
|
var kvNamespace = createNamespace({
|
118433
118474
|
metadata: {
|
@@ -118481,6 +118522,7 @@ var kvNamespaceCreateCommand = createCommand({
|
|
118481
118522
|
const preview = args.preview ? "_preview" : "";
|
118482
118523
|
const title = `${environment}${args.namespace}${preview}`;
|
118483
118524
|
const accountId = await requireAuth(config);
|
118525
|
+
printResourceLocation("remote");
|
118484
118526
|
logger.log(`\u{1F300} Creating namespace with title "${title}"`);
|
118485
118527
|
const namespaceId = await createKVNamespace(accountId, title);
|
118486
118528
|
sendMetricsEvent("create kv namespace", {
|
@@ -118514,7 +118556,7 @@ var kvNamespaceListCommand = createCommand({
|
|
118514
118556
|
owner: "Product: KV"
|
118515
118557
|
},
|
118516
118558
|
args: {},
|
118517
|
-
behaviour: { printBanner: false },
|
118559
|
+
behaviour: { printBanner: false, printResourceLocation: false },
|
118518
118560
|
async handler(args) {
|
118519
118561
|
const config = readConfig(args);
|
118520
118562
|
const accountId = await requireAuth(config);
|
@@ -118551,6 +118593,7 @@ var kvNamespaceDeleteCommand = createCommand({
|
|
118551
118593
|
},
|
118552
118594
|
async handler(args) {
|
118553
118595
|
const config = readConfig(args);
|
118596
|
+
printResourceLocation("remote");
|
118554
118597
|
let id;
|
118555
118598
|
try {
|
118556
118599
|
id = getKVNamespaceId(args, config);
|
@@ -118574,6 +118617,9 @@ var kvKeyPutCommand = createCommand({
|
|
118574
118617
|
status: "stable",
|
118575
118618
|
owner: "Product: KV"
|
118576
118619
|
},
|
118620
|
+
behaviour: {
|
118621
|
+
printResourceLocation: true
|
118622
|
+
},
|
118577
118623
|
positionalArgs: ["key", "value"],
|
118578
118624
|
args: {
|
118579
118625
|
key: {
|
@@ -118693,6 +118739,11 @@ var kvKeyListCommand = createCommand({
|
|
118693
118739
|
status: "stable",
|
118694
118740
|
owner: "Product: KV"
|
118695
118741
|
},
|
118742
|
+
behaviour: {
|
118743
|
+
// implicitly expects to output JSON only
|
118744
|
+
printResourceLocation: false,
|
118745
|
+
printBanner: false
|
118746
|
+
},
|
118696
118747
|
args: {
|
118697
118748
|
binding: {
|
118698
118749
|
type: "string",
|
@@ -118732,7 +118783,6 @@ var kvKeyListCommand = createCommand({
|
|
118732
118783
|
validateArgs(args) {
|
118733
118784
|
demandOneOfOption("binding", "namespace-id")(args);
|
118734
118785
|
},
|
118735
|
-
behaviour: { printBanner: false },
|
118736
118786
|
async handler({ prefix, ...args }) {
|
118737
118787
|
const localMode = isLocal(args);
|
118738
118788
|
const config = readConfig(args);
|
@@ -118765,6 +118815,10 @@ var kvKeyGetCommand = createCommand({
|
|
118765
118815
|
status: "stable",
|
118766
118816
|
owner: "Product: KV"
|
118767
118817
|
},
|
118818
|
+
behaviour: {
|
118819
|
+
printBanner: false,
|
118820
|
+
printResourceLocation: false
|
118821
|
+
},
|
118768
118822
|
positionalArgs: ["key"],
|
118769
118823
|
args: {
|
118770
118824
|
key: {
|
@@ -118810,7 +118864,6 @@ var kvKeyGetCommand = createCommand({
|
|
118810
118864
|
validateArgs(args) {
|
118811
118865
|
demandOneOfOption("binding", "namespace-id")(args);
|
118812
118866
|
},
|
118813
|
-
behaviour: { printBanner: false },
|
118814
118867
|
async handler({ key, ...args }) {
|
118815
118868
|
const localMode = isLocal(args);
|
118816
118869
|
const config = readConfig(args);
|
@@ -118857,6 +118910,9 @@ var kvKeyDeleteCommand = createCommand({
|
|
118857
118910
|
status: "stable",
|
118858
118911
|
owner: "Product: KV"
|
118859
118912
|
},
|
118913
|
+
behaviour: {
|
118914
|
+
printResourceLocation: true
|
118915
|
+
},
|
118860
118916
|
positionalArgs: ["key"],
|
118861
118917
|
args: {
|
118862
118918
|
key: {
|
@@ -118922,6 +118978,10 @@ var kvBulkGetCommand = createCommand({
|
|
118922
118978
|
status: "open-beta",
|
118923
118979
|
owner: "Product: KV"
|
118924
118980
|
},
|
118981
|
+
behaviour: {
|
118982
|
+
printBanner: false,
|
118983
|
+
printResourceLocation: false
|
118984
|
+
},
|
118925
118985
|
positionalArgs: ["filename"],
|
118926
118986
|
args: {
|
118927
118987
|
filename: {
|
@@ -119026,6 +119086,9 @@ var kvBulkPutCommand = createCommand({
|
|
119026
119086
|
status: "stable",
|
119027
119087
|
owner: "Product: KV"
|
119028
119088
|
},
|
119089
|
+
behaviour: {
|
119090
|
+
printResourceLocation: true
|
119091
|
+
},
|
119029
119092
|
positionalArgs: ["filename"],
|
119030
119093
|
args: {
|
119031
119094
|
filename: {
|
@@ -119168,6 +119231,9 @@ var kvBulkDeleteCommand = createCommand({
|
|
119168
119231
|
status: "stable",
|
119169
119232
|
owner: "Product: KV"
|
119170
119233
|
},
|
119234
|
+
behaviour: {
|
119235
|
+
printResourceLocation: true
|
119236
|
+
},
|
119171
119237
|
positionalArgs: ["filename"],
|
119172
119238
|
args: {
|
119173
119239
|
filename: {
|
@@ -124584,9 +124650,8 @@ var secretBulkCommand = createCommand({
|
|
124584
124650
|
logger.log(`\u2728 ${upsertBindings.length} secrets successfully uploaded`);
|
124585
124651
|
} catch (err) {
|
124586
124652
|
logger.log("");
|
124587
|
-
logger.log(
|
124588
|
-
|
124589
|
-
throw new Error(`\u{1F6A8} ${upsertBindings.length} secrets failed to upload`);
|
124653
|
+
logger.log(`\u{1F6A8} Secrets failed to upload`);
|
124654
|
+
throw err;
|
124590
124655
|
}
|
124591
124656
|
}
|
124592
124657
|
});
|
@@ -124811,11 +124876,8 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
124811
124876
|
`\u2728 ${Object.keys(upsertBindings).length} secrets successfully uploaded`
|
124812
124877
|
);
|
124813
124878
|
} catch (err) {
|
124814
|
-
logger.log(
|
124815
|
-
|
124816
|
-
throw new FatalError(
|
124817
|
-
`\u{1F6A8} ${Object.keys(upsertBindings).length} secrets failed to upload`
|
124818
|
-
);
|
124879
|
+
logger.log(`\u{1F6A8} Secrets failed to upload`);
|
124880
|
+
throw err;
|
124819
124881
|
}
|
124820
124882
|
}
|
124821
124883
|
).command(
|
@@ -128940,7 +129002,9 @@ function addCreateOptions(yargs) {
|
|
128940
129002
|
}).group(["transform-worker"], `${source_default.bold("Transformations")}`).option("transform-worker", {
|
128941
129003
|
type: "string",
|
128942
129004
|
describe: "Pipeline transform Worker and entrypoint (<worker>.<entrypoint>)",
|
128943
|
-
demandOption: false
|
129005
|
+
demandOption: false,
|
129006
|
+
hidden: true
|
129007
|
+
// TODO: Remove once transformations launch
|
128944
129008
|
}).group(
|
128945
129009
|
[
|
128946
129010
|
"r2-bucket",
|
@@ -128988,7 +129052,7 @@ function addCreateOptions(yargs) {
|
|
128988
129052
|
demandOption: false
|
128989
129053
|
}).option("file-template", {
|
128990
129054
|
type: "string",
|
128991
|
-
describe:
|
129055
|
+
describe: `Template for individual file names (must include \${slug}). For example: "\${slug}.log.gz"`,
|
128992
129056
|
demandOption: false,
|
128993
129057
|
coerce: /* @__PURE__ */ __name((val2) => {
|
128994
129058
|
if (!val2.includes("${slug}")) {
|
@@ -128996,6 +129060,10 @@ function addCreateOptions(yargs) {
|
|
128996
129060
|
}
|
128997
129061
|
return val2;
|
128998
129062
|
}, "coerce")
|
129063
|
+
}).group(["shard-count"], `${source_default.bold("Pipeline settings")}`).option("shard-count", {
|
129064
|
+
type: "number",
|
129065
|
+
describe: "Number of pipeline shards. More shards handle higher request volume; fewer shards produce larger output files",
|
129066
|
+
demandOption: false
|
128999
129067
|
});
|
129000
129068
|
}
|
129001
129069
|
__name(addCreateOptions, "addCreateOptions");
|
@@ -129083,6 +129151,9 @@ async function createPipelineHandler(args) {
|
|
129083
129151
|
if (args.fileTemplate) {
|
129084
129152
|
pipelineConfig.destination.path.filename = args.fileTemplate;
|
129085
129153
|
}
|
129154
|
+
if (args.shardCount) {
|
129155
|
+
pipelineConfig.metadata.shards = args.shardCount;
|
129156
|
+
}
|
129086
129157
|
logger.log(`\u{1F300} Creating Pipeline named "${name2}"`);
|
129087
129158
|
const pipeline = await createPipeline(accountId, pipelineConfig);
|
129088
129159
|
logger.log(
|
@@ -129238,7 +129309,9 @@ function addUpdateOptions(yargs) {
|
|
129238
129309
|
}).group(["transform-worker"], `${source_default.bold("Transformations")}`).option("transform-worker", {
|
129239
129310
|
type: "string",
|
129240
129311
|
describe: 'Pipeline transform Worker and entrypoint, to transform ingested records. Specified as <worker-name>.<entrypoint>, or "none".',
|
129241
|
-
demandOption: false
|
129312
|
+
demandOption: false,
|
129313
|
+
hidden: true
|
129314
|
+
// TODO: Remove once transformations launch
|
129242
129315
|
}).group(
|
129243
129316
|
[
|
129244
129317
|
"r2-bucket",
|
@@ -129288,6 +129361,10 @@ function addUpdateOptions(yargs) {
|
|
129288
129361
|
}
|
129289
129362
|
return val2;
|
129290
129363
|
}, "coerce")
|
129364
|
+
}).group(["shard-count"], `${source_default.bold("Pipeline settings")}`).option("shard-count", {
|
129365
|
+
type: "number",
|
129366
|
+
describe: "Number of pipeline shards. More shards handle higher request volume; fewer shards produce larger output files",
|
129367
|
+
demandOption: false
|
129291
129368
|
});
|
129292
129369
|
}
|
129293
129370
|
__name(addUpdateOptions, "addUpdateOptions");
|
@@ -129394,6 +129471,9 @@ async function updatePipelineHandler(args) {
|
|
129394
129471
|
if (args.fileTemplate) {
|
129395
129472
|
pipelineConfig.destination.path.filename = args.fileTemplate;
|
129396
129473
|
}
|
129474
|
+
if (args.shardCount) {
|
129475
|
+
pipelineConfig.metadata.shards = args.shardCount;
|
129476
|
+
}
|
129397
129477
|
logger.log(`\u{1F300} Updating Pipeline "${name2}"`);
|
129398
129478
|
const pipeline = await updatePipeline(accountId, name2, pipelineConfig);
|
129399
129479
|
logger.log(
|
@@ -131055,7 +131135,7 @@ var r2BucketDeleteCommand = createCommand({
|
|
131055
131135
|
init_import_meta_url();
|
131056
131136
|
var r2BucketCatalogNamespace = createNamespace({
|
131057
131137
|
metadata: {
|
131058
|
-
description: "Manage the data catalog for your R2 buckets - provides an Iceberg REST interface for query engines like Spark
|
131138
|
+
description: "Manage the data catalog for your R2 buckets - provides an Iceberg REST interface for query engines like Spark and PyIceberg",
|
131059
131139
|
status: "open-beta",
|
131060
131140
|
owner: "Product: R2 Data Catalog"
|
131061
131141
|
}
|
@@ -131088,9 +131168,10 @@ var r2BucketCatalogEnableCommand = createCommand({
|
|
131088
131168
|
`\u2728 Successfully enabled data catalog on bucket '${args.bucket}'.
|
131089
131169
|
|
131090
131170
|
Catalog URI: '${catalogHost}'
|
131171
|
+
Warehouse: '${response.name}'
|
131091
131172
|
|
131092
|
-
Use this Catalog URI with Iceberg-compatible query engines (Spark,
|
131093
|
-
Note: You
|
131173
|
+
Use this Catalog URI with Iceberg-compatible query engines (Spark, PyIceberg etc.) to query data as tables.
|
131174
|
+
Note: You will need a Cloudflare API token with 'R2 Data Catalog' permission to authenticate your client with this catalog.
|
131094
131175
|
For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/`
|
131095
131176
|
);
|
131096
131177
|
}
|
@@ -131112,16 +131193,26 @@ var r2BucketCatalogDisableCommand = createCommand({
|
|
131112
131193
|
async handler(args, { config }) {
|
131113
131194
|
const accountId = await requireAuth(config);
|
131114
131195
|
const confirmedDisable = await confirm(
|
131115
|
-
`Are you sure you want to disable the data catalog for bucket '${args.bucket}'
|
131196
|
+
`Are you sure you want to disable the data catalog for bucket '${args.bucket}'?`
|
131116
131197
|
);
|
131117
131198
|
if (!confirmedDisable) {
|
131118
131199
|
logger.log("Disable cancelled.");
|
131119
131200
|
return;
|
131120
131201
|
}
|
131121
|
-
|
131122
|
-
|
131123
|
-
|
131124
|
-
|
131202
|
+
try {
|
131203
|
+
await disableR2Catalog(accountId, args.bucket);
|
131204
|
+
logger.log(
|
131205
|
+
`Successfully disabled the data catalog on bucket '${args.bucket}'.`
|
131206
|
+
);
|
131207
|
+
} catch (e7) {
|
131208
|
+
if (e7 instanceof APIError && e7.code == 40401) {
|
131209
|
+
logger.log(
|
131210
|
+
`Data catalog is not enabled for bucket '${args.bucket}'. Please use 'wrangler r2 bucket catalog enable ${args.bucket}' to first enable the data catalog on this bucket.`
|
131211
|
+
);
|
131212
|
+
} else {
|
131213
|
+
throw e7;
|
131214
|
+
}
|
131215
|
+
}
|
131125
131216
|
}
|
131126
131217
|
});
|
131127
131218
|
var r2BucketCatalogGetCommand = createCommand({
|
@@ -131140,7 +131231,8 @@ var r2BucketCatalogGetCommand = createCommand({
|
|
131140
131231
|
},
|
131141
131232
|
async handler(args, { config }) {
|
131142
131233
|
const accountId = await requireAuth(config);
|
131143
|
-
logger.log(`Getting data catalog status for '${args.bucket}'
|
131234
|
+
logger.log(`Getting data catalog status for '${args.bucket}'...
|
131235
|
+
`);
|
131144
131236
|
try {
|
131145
131237
|
const catalog = await getR2Catalog(accountId, args.bucket);
|
131146
131238
|
const env6 = getCloudflareApiEnvironmentFromEnv();
|
@@ -131151,14 +131243,16 @@ var r2BucketCatalogGetCommand = createCommand({
|
|
131151
131243
|
catalogHost = `https://catalog.cloudflarestorage.com/${catalog.name}`;
|
131152
131244
|
}
|
131153
131245
|
const output = {
|
131154
|
-
Bucket: args.bucket,
|
131155
131246
|
"Catalog URI": catalogHost,
|
131247
|
+
Warehouse: catalog.name,
|
131156
131248
|
Status: catalog.status
|
131157
131249
|
};
|
131158
131250
|
logger.log(formatLabelledValues(output));
|
131159
131251
|
} catch (e7) {
|
131160
131252
|
if (e7 instanceof APIError && e7.code == 40401) {
|
131161
|
-
logger.log(
|
131253
|
+
logger.log(
|
131254
|
+
`Data catalog is not enabled for bucket '${args.bucket}'. Please use 'wrangler r2 bucket catalog enable ${args.bucket}' to first enable the data catalog on this bucket.`
|
131255
|
+
);
|
131162
131256
|
} else {
|
131163
131257
|
throw e7;
|
131164
131258
|
}
|
@@ -132452,7 +132546,6 @@ var import_node_buffer5 = require("node:buffer");
|
|
132452
132546
|
var fs21 = __toESM(require("node:fs"));
|
132453
132547
|
var path56 = __toESM(require("node:path"));
|
132454
132548
|
var stream = __toESM(require("node:stream"));
|
132455
|
-
var remoteFlagWarning = "By default, `wrangler r2` commands access a local simulator of your R2 bucket, the same as that used by `wrangler dev`. To access your remote R2 bucket, re-run the command with the --remote flag";
|
132456
132549
|
var r2ObjectNamespace = createNamespace({
|
132457
132550
|
metadata: {
|
132458
132551
|
description: `Manage R2 objects`,
|
@@ -132505,6 +132598,11 @@ var r2ObjectGetCommand = createCommand({
|
|
132505
132598
|
type: "string"
|
132506
132599
|
}
|
132507
132600
|
},
|
132601
|
+
behaviour: {
|
132602
|
+
printResourceLocation(args) {
|
132603
|
+
return !args?.pipe;
|
132604
|
+
}
|
132605
|
+
},
|
132508
132606
|
positionalArgs: ["objectPath"],
|
132509
132607
|
async handler(objectGetYargs, { config }) {
|
132510
132608
|
const localMode = isLocal(objectGetYargs);
|
@@ -132529,9 +132627,6 @@ var r2ObjectGetCommand = createCommand({
|
|
132529
132627
|
output = process.stdout;
|
132530
132628
|
}
|
132531
132629
|
if (localMode) {
|
132532
|
-
if (!pipe) {
|
132533
|
-
logger.warn(remoteFlagWarning);
|
132534
|
-
}
|
132535
132630
|
await usingLocalBucket(
|
132536
132631
|
objectGetYargs.persistTo,
|
132537
132632
|
config,
|
@@ -132645,6 +132740,11 @@ var r2ObjectPutCommand = createCommand({
|
|
132645
132740
|
type: "string"
|
132646
132741
|
}
|
132647
132742
|
},
|
132743
|
+
behaviour: {
|
132744
|
+
printResourceLocation(args) {
|
132745
|
+
return !args?.pipe;
|
132746
|
+
}
|
132747
|
+
},
|
132648
132748
|
async handler(objectPutYargs, { config }) {
|
132649
132749
|
const {
|
132650
132750
|
objectPath,
|
@@ -132709,7 +132809,6 @@ ${key} is ${prettyBytes(objectSize, {
|
|
132709
132809
|
`Creating object "${key}"${storageClassLog} in bucket "${fullBucketName}".`
|
132710
132810
|
);
|
132711
132811
|
if (localMode) {
|
132712
|
-
logger.warn(remoteFlagWarning);
|
132713
132812
|
await usingLocalBucket(
|
132714
132813
|
persistTo,
|
132715
132814
|
config,
|
@@ -132797,6 +132896,9 @@ var r2ObjectDeleteCommand = createCommand({
|
|
132797
132896
|
type: "string"
|
132798
132897
|
}
|
132799
132898
|
},
|
132899
|
+
behaviour: {
|
132900
|
+
printResourceLocation: true
|
132901
|
+
},
|
132800
132902
|
async handler(args) {
|
132801
132903
|
const localMode = isLocal(args);
|
132802
132904
|
const { objectPath, jurisdiction } = args;
|
@@ -132808,7 +132910,6 @@ var r2ObjectDeleteCommand = createCommand({
|
|
132808
132910
|
}
|
132809
132911
|
logger.log(`Deleting object "${key}" from bucket "${fullBucketName}".`);
|
132810
132912
|
if (localMode) {
|
132811
|
-
logger.warn(remoteFlagWarning);
|
132812
132913
|
await usingLocalBucket(
|
132813
132914
|
args.persistTo,
|
132814
132915
|
config,
|
@@ -154862,13 +154963,26 @@ async function getPlatformProxy(options33 = {}) {
|
|
154862
154963
|
__name(getPlatformProxy, "getPlatformProxy");
|
154863
154964
|
async function getMiniflareOptionsFromConfig(rawConfig, env6, options33) {
|
154864
154965
|
const bindings = getBindings2(rawConfig, env6, true, {});
|
154966
|
+
if (rawConfig["durable_objects"]) {
|
154967
|
+
const { localBindings } = partitionDurableObjectBindings(rawConfig);
|
154968
|
+
if (localBindings.length > 0) {
|
154969
|
+
logger.warn(dedent2`
|
154970
|
+
You have defined bindings to the following internal Durable Objects:
|
154971
|
+
${localBindings.map((b6) => `- ${JSON.stringify(b6)}`).join("\n")}
|
154972
|
+
These will not work in local development, but they should work in production.
|
154973
|
+
|
154974
|
+
If you want to develop these locally, you can define your DO in a separate Worker, with a separate configuration file.
|
154975
|
+
For detailed instructions, refer to the Durable Objects section here: https://developers.cloudflare.com/workers/wrangler/api#supported-bindings
|
154976
|
+
`);
|
154977
|
+
}
|
154978
|
+
}
|
154865
154979
|
const workerDefinitions = await getBoundRegisteredWorkers({
|
154866
154980
|
name: rawConfig.name,
|
154867
154981
|
services: bindings.services,
|
154868
154982
|
durableObjects: rawConfig["durable_objects"]
|
154869
154983
|
});
|
154870
154984
|
const { bindingOptions, externalWorkers } = buildMiniflareBindingOptions({
|
154871
|
-
name:
|
154985
|
+
name: rawConfig.name,
|
154872
154986
|
bindings,
|
154873
154987
|
workerDefinitions,
|
154874
154988
|
queueConsumers: void 0,
|
@@ -154884,6 +154998,7 @@ async function getMiniflareOptionsFromConfig(rawConfig, env6, options33) {
|
|
154884
154998
|
{
|
154885
154999
|
script: "",
|
154886
155000
|
modules: true,
|
155001
|
+
name: rawConfig.name,
|
154887
155002
|
...bindingOptions,
|
154888
155003
|
serviceBindings: {
|
154889
155004
|
...serviceBindings,
|
@@ -155178,4 +155293,3 @@ yargs-parser/build/lib/index.js:
|
|
155178
155293
|
* SPDX-License-Identifier: ISC
|
155179
155294
|
*)
|
155180
155295
|
*/
|
155181
|
-
//# sourceMappingURL=cli.js.map
|