wrangler 3.85.0 → 3.86.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 +7 -7
- package/wrangler-dist/cli.d.ts +19 -2
- package/wrangler-dist/cli.js +248 -60
- package/wrangler-dist/cli.js.map +4 -4
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.86.0",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -64,15 +64,15 @@
|
|
64
64
|
"selfsigned": "^2.0.1",
|
65
65
|
"source-map": "^0.6.1",
|
66
66
|
"unenv": "npm:unenv-nightly@2.0.0-20241024-111401-d4156ac",
|
67
|
-
"workerd": "1.
|
67
|
+
"workerd": "1.20241106.1",
|
68
68
|
"xxhash-wasm": "^1.0.1",
|
69
69
|
"@cloudflare/kv-asset-handler": "0.3.4",
|
70
|
-
"
|
71
|
-
"
|
70
|
+
"@cloudflare/workers-shared": "0.7.1",
|
71
|
+
"miniflare": "3.20241106.0"
|
72
72
|
},
|
73
73
|
"devDependencies": {
|
74
74
|
"@cloudflare/types": "6.18.4",
|
75
|
-
"@cloudflare/workers-types": "^4.
|
75
|
+
"@cloudflare/workers-types": "^4.20241106.0",
|
76
76
|
"@cspotcode/source-map-support": "0.8.1",
|
77
77
|
"@iarna/toml": "^3.0.0",
|
78
78
|
"@microsoft/api-extractor": "^7.47.0",
|
@@ -154,11 +154,11 @@
|
|
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.
|
157
|
+
"@cloudflare/pages-shared": "^0.11.68",
|
158
158
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
159
159
|
},
|
160
160
|
"peerDependencies": {
|
161
|
-
"@cloudflare/workers-types": "^4.
|
161
|
+
"@cloudflare/workers-types": "^4.20241106.0"
|
162
162
|
},
|
163
163
|
"peerDependenciesMeta": {
|
164
164
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -2691,14 +2691,31 @@ declare class Logger {
|
|
2691
2691
|
error: (...args: unknown[]) => void;
|
2692
2692
|
table<Keys extends string>(data: TableRow<Keys>[]): void;
|
2693
2693
|
console<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
|
2694
|
-
static
|
2695
|
-
|
2694
|
+
static onceHistory: Set<unknown>;
|
2695
|
+
get once(): {
|
2696
|
+
info: (...args: unknown[]) => void;
|
2697
|
+
log: (...args: unknown[]) => void;
|
2698
|
+
warn: (...args: unknown[]) => void;
|
2699
|
+
error: (...args: unknown[]) => void;
|
2700
|
+
};
|
2701
|
+
doLogOnce(messageLevel: Exclude<LoggerLevel, "none">, args: unknown[]): void;
|
2696
2702
|
private doLog;
|
2697
2703
|
static registerBeforeLogHook(callback: (() => void) | undefined): void;
|
2698
2704
|
static registerAfterLogHook(callback: (() => void) | undefined): void;
|
2699
2705
|
private formatMessage;
|
2700
2706
|
}
|
2701
2707
|
|
2708
|
+
declare const LOGGER_LEVELS: {
|
2709
|
+
readonly none: -1;
|
2710
|
+
readonly error: 0;
|
2711
|
+
readonly warn: 1;
|
2712
|
+
readonly info: 2;
|
2713
|
+
readonly log: 3;
|
2714
|
+
readonly debug: 4;
|
2715
|
+
};
|
2716
|
+
|
2717
|
+
declare type LoggerLevel = keyof typeof LOGGER_LEVELS;
|
2718
|
+
|
2702
2719
|
declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
|
2703
2720
|
|
2704
2721
|
declare type MaybePromise<T> = T | Promise<T>;
|
package/wrangler-dist/cli.js
CHANGED
@@ -154577,7 +154577,7 @@ function getLoggerLevel() {
|
|
154577
154577
|
return fromEnv;
|
154578
154578
|
}
|
154579
154579
|
const expected = Object.keys(LOGGER_LEVELS).map((level) => `"${level}"`).join(" | ");
|
154580
|
-
logger.
|
154580
|
+
logger.once.warn(
|
154581
154581
|
`Unrecognised WRANGLER_LOG value ${JSON.stringify(
|
154582
154582
|
fromEnv
|
154583
154583
|
)}, expected ${expected}, defaulting to "log"...`
|
@@ -154634,11 +154634,20 @@ var _Logger = class {
|
|
154634
154634
|
console[method].apply(console, args);
|
154635
154635
|
(_b2 = __privateGet(_Logger, _afterLogHook)) == null ? void 0 : _b2.call(_Logger);
|
154636
154636
|
}
|
154637
|
-
|
154638
|
-
|
154639
|
-
|
154640
|
-
|
154641
|
-
this.warn
|
154637
|
+
get once() {
|
154638
|
+
return {
|
154639
|
+
info: (...args) => this.doLogOnce("info", args),
|
154640
|
+
log: (...args) => this.doLogOnce("log", args),
|
154641
|
+
warn: (...args) => this.doLogOnce("warn", args),
|
154642
|
+
error: (...args) => this.doLogOnce("error", args)
|
154643
|
+
};
|
154644
|
+
}
|
154645
|
+
doLogOnce(messageLevel, args) {
|
154646
|
+
const { onceHistory } = this.constructor;
|
154647
|
+
const cacheKey = `${messageLevel}: ${args.join(" ")}`;
|
154648
|
+
if (!onceHistory.has(cacheKey)) {
|
154649
|
+
onceHistory.add(cacheKey);
|
154650
|
+
this.doLog(messageLevel, args);
|
154642
154651
|
}
|
154643
154652
|
}
|
154644
154653
|
doLog(messageLevel, args) {
|
@@ -154679,7 +154688,7 @@ var Logger = _Logger;
|
|
154679
154688
|
__name(Logger, "Logger");
|
154680
154689
|
_beforeLogHook = new WeakMap();
|
154681
154690
|
_afterLogHook = new WeakMap();
|
154682
|
-
__publicField(Logger, "
|
154691
|
+
__publicField(Logger, "onceHistory", /* @__PURE__ */ new Set());
|
154683
154692
|
__privateAdd(Logger, _beforeLogHook, void 0);
|
154684
154693
|
__privateAdd(Logger, _afterLogHook, void 0);
|
154685
154694
|
var logger = new Logger();
|
@@ -155898,7 +155907,7 @@ var import_undici3 = __toESM(require_undici());
|
|
155898
155907
|
|
155899
155908
|
// package.json
|
155900
155909
|
var name = "wrangler";
|
155901
|
-
var version = "3.
|
155910
|
+
var version = "3.86.0";
|
155902
155911
|
|
155903
155912
|
// src/user/index.ts
|
155904
155913
|
init_import_meta_url();
|
@@ -161471,6 +161480,7 @@ var friendlyBindingNames = {
|
|
161471
161480
|
assets: "Assets"
|
161472
161481
|
};
|
161473
161482
|
function printBindings(bindings, context2 = {}) {
|
161483
|
+
let hasConnectionStatus = false;
|
161474
161484
|
const truncate4 = /* @__PURE__ */ __name((item) => {
|
161475
161485
|
const s = typeof item === "string" ? item : JSON.stringify(item);
|
161476
161486
|
const maxLength = 40;
|
@@ -161523,12 +161533,13 @@ function printBindings(bindings, context2 = {}) {
|
|
161523
161533
|
if (script_name) {
|
161524
161534
|
if (context2.local) {
|
161525
161535
|
const registryDefinition = context2.registry?.[script_name];
|
161536
|
+
hasConnectionStatus = true;
|
161526
161537
|
if (registryDefinition && registryDefinition.durableObjects.some(
|
161527
161538
|
(d2) => d2.className === class_name
|
161528
161539
|
)) {
|
161529
|
-
value += ` (defined in
|
161540
|
+
value += ` (defined in ${script_name} ${source_default.green("[connected]")})`;
|
161530
161541
|
} else {
|
161531
|
-
value += ` (defined in
|
161542
|
+
value += ` (defined in ${script_name} ${source_default.red("[not connected]")})`;
|
161532
161543
|
}
|
161533
161544
|
} else {
|
161534
161545
|
value += ` (defined in ${script_name})`;
|
@@ -161669,10 +161680,11 @@ function printBindings(bindings, context2 = {}) {
|
|
161669
161680
|
}
|
161670
161681
|
if (context2.local) {
|
161671
161682
|
const registryDefinition = context2.registry?.[service];
|
161683
|
+
hasConnectionStatus = true;
|
161672
161684
|
if (registryDefinition && (!entrypoint || registryDefinition.entrypointAddresses?.[entrypoint])) {
|
161673
|
-
value =
|
161685
|
+
value = value + " " + source_default.green("[connected]");
|
161674
161686
|
} else {
|
161675
|
-
value =
|
161687
|
+
value = value + " " + source_default.red("[not connected]");
|
161676
161688
|
}
|
161677
161689
|
}
|
161678
161690
|
return {
|
@@ -161816,6 +161828,13 @@ function printBindings(bindings, context2 = {}) {
|
|
161816
161828
|
}).flat(2)
|
161817
161829
|
].join("\n");
|
161818
161830
|
logger.log(message);
|
161831
|
+
if (hasConnectionStatus) {
|
161832
|
+
logger.once.info(
|
161833
|
+
`
|
161834
|
+
Service bindings & durable object bindings connect to other \`wrangler dev\` processes running locally, with their connection status indicated by ${source_default.green("[connected]")} or ${source_default.red("[not connected]")}. For more details, refer to https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#local-development
|
161835
|
+
`
|
161836
|
+
);
|
161837
|
+
}
|
161819
161838
|
}
|
161820
161839
|
__name(printBindings, "printBindings");
|
161821
161840
|
function withConfig(handler30) {
|
@@ -166924,7 +166943,7 @@ ${dashLink}`);
|
|
166924
166943
|
deployments2.push(...updateConsumers);
|
166925
166944
|
}
|
166926
166945
|
if (config.workflows?.length) {
|
166927
|
-
logger.
|
166946
|
+
logger.once.warn("Workflows is currently in open beta.");
|
166928
166947
|
for (const workflow of config.workflows) {
|
166929
166948
|
deployments2.push(
|
166930
166949
|
fetchResult(`/accounts/${accountId}/workflows/${workflow.name}`, {
|
@@ -168904,7 +168923,7 @@ async function versionsDeployHandler(args) {
|
|
168904
168923
|
);
|
168905
168924
|
}
|
168906
168925
|
if (config.workflows?.length) {
|
168907
|
-
logger.
|
168926
|
+
logger.once.warn("Workflows is currently in open beta.");
|
168908
168927
|
}
|
168909
168928
|
const versionCache = /* @__PURE__ */ new Map();
|
168910
168929
|
const optionalVersionTraffic = parseVersionSpecs(args);
|
@@ -188057,7 +188076,7 @@ To learn more about Workers with assets, visit our documentation at https://deve
|
|
188057
188076
|
);
|
188058
188077
|
}
|
188059
188078
|
if (config.workflows?.length) {
|
188060
|
-
logger.
|
188079
|
+
logger.once.warn("Workflows is currently in open beta.");
|
188061
188080
|
}
|
188062
188081
|
validateAssetsArgsAndConfig(args, config);
|
188063
188082
|
const assetsOptions = processAssetsArg(args, config);
|
@@ -199311,9 +199330,22 @@ async function handler14(args) {
|
|
199311
199330
|
const config = readConfig(args.config, args);
|
199312
199331
|
const body = createBody3(args);
|
199313
199332
|
try {
|
199314
|
-
logger.log(
|
199333
|
+
logger.log(`\u{1F300} Creating queue '${args.name}'`);
|
199315
199334
|
await createQueue(config, body);
|
199316
|
-
logger.log(
|
199335
|
+
logger.log(
|
199336
|
+
`\u2705 Created queue '${args.name}'
|
199337
|
+
|
199338
|
+
Configure your Worker to send messages to this queue:
|
199339
|
+
|
199340
|
+
[[queues.producers]]
|
199341
|
+
queue = "${args.name}"
|
199342
|
+
binding = "${getValidBindingName(args.name, "queue")}"
|
199343
|
+
|
199344
|
+
Configure your Worker to consume messages from this queue:
|
199345
|
+
|
199346
|
+
[[queues.consumers]]
|
199347
|
+
queue = "${args.name}"`
|
199348
|
+
);
|
199317
199349
|
} catch (e4) {
|
199318
199350
|
handleFetchError(e4);
|
199319
199351
|
}
|
@@ -199821,6 +199853,39 @@ async function configureCustomDomainSettings(accountId, bucketName, domainName,
|
|
199821
199853
|
);
|
199822
199854
|
}
|
199823
199855
|
__name(configureCustomDomainSettings, "configureCustomDomainSettings");
|
199856
|
+
async function getR2DevDomain(accountId, bucketName, jurisdiction) {
|
199857
|
+
const headers = {};
|
199858
|
+
if (jurisdiction) {
|
199859
|
+
headers["cf-r2-jurisdiction"] = jurisdiction;
|
199860
|
+
}
|
199861
|
+
const result = await fetchResult(
|
199862
|
+
`/accounts/${accountId}/r2/buckets/${bucketName}/domains/managed`,
|
199863
|
+
{
|
199864
|
+
method: "GET",
|
199865
|
+
headers
|
199866
|
+
}
|
199867
|
+
);
|
199868
|
+
return result;
|
199869
|
+
}
|
199870
|
+
__name(getR2DevDomain, "getR2DevDomain");
|
199871
|
+
async function updateR2DevDomain(accountId, bucketName, enabled, jurisdiction) {
|
199872
|
+
const headers = {
|
199873
|
+
"Content-Type": "application/json"
|
199874
|
+
};
|
199875
|
+
if (jurisdiction) {
|
199876
|
+
headers["cf-r2-jurisdiction"] = jurisdiction;
|
199877
|
+
}
|
199878
|
+
const result = await fetchResult(
|
199879
|
+
`/accounts/${accountId}/r2/buckets/${bucketName}/domains/managed`,
|
199880
|
+
{
|
199881
|
+
method: "PUT",
|
199882
|
+
headers,
|
199883
|
+
body: JSON.stringify({ enabled })
|
199884
|
+
}
|
199885
|
+
);
|
199886
|
+
return result;
|
199887
|
+
}
|
199888
|
+
__name(updateR2DevDomain, "updateR2DevDomain");
|
199824
199889
|
function isValidR2BucketName(name2) {
|
199825
199890
|
return typeof name2 === "string" && /^[a-zA-Z][a-zA-Z0-9-]*$/.test(name2);
|
199826
199891
|
}
|
@@ -199872,7 +199937,13 @@ async function Handler16(args) {
|
|
199872
199937
|
logger.log(`Creating bucket '${fullBucketName}'...`);
|
199873
199938
|
await createR2Bucket(accountId, name2, location, jurisdiction, storageClass);
|
199874
199939
|
logger.log(
|
199875
|
-
`\u2705 Created bucket '${fullBucketName}' with${location ? ` location hint ${location} and` : ``} default storage class of ${storageClass ? storageClass : `Standard`}
|
199940
|
+
`\u2705 Created bucket '${fullBucketName}' with${location ? ` location hint ${location} and` : ``} default storage class of ${storageClass ? storageClass : `Standard`}.
|
199941
|
+
|
199942
|
+
Configure your Worker to write objects to this bucket:
|
199943
|
+
|
199944
|
+
[[r2_buckets]]
|
199945
|
+
bucket_name = "${args.name}"
|
199946
|
+
binding = "${getValidBindingName(args.name, "r2")}"`
|
199876
199947
|
);
|
199877
199948
|
await sendMetricsEvent("create r2 bucket", {
|
199878
199949
|
sendMetrics: config.send_metrics
|
@@ -200195,11 +200266,124 @@ async function DeleteHandler2(args) {
|
|
200195
200266
|
}
|
200196
200267
|
__name(DeleteHandler2, "DeleteHandler");
|
200197
200268
|
|
200269
|
+
// src/r2/public-dev-url.ts
|
200270
|
+
init_import_meta_url();
|
200271
|
+
function GetOptions(yargs) {
|
200272
|
+
return yargs.positional("bucket", {
|
200273
|
+
describe: "The name of the R2 bucket whose r2.dev URL status to retrieve",
|
200274
|
+
type: "string",
|
200275
|
+
demandOption: true
|
200276
|
+
}).option("jurisdiction", {
|
200277
|
+
describe: "The jurisdiction where the bucket exists",
|
200278
|
+
alias: "J",
|
200279
|
+
requiresArg: true,
|
200280
|
+
type: "string"
|
200281
|
+
});
|
200282
|
+
}
|
200283
|
+
__name(GetOptions, "GetOptions");
|
200284
|
+
async function GetHandler(args) {
|
200285
|
+
await printWranglerBanner();
|
200286
|
+
const config = readConfig(args.config, args);
|
200287
|
+
const accountId = await requireAuth(config);
|
200288
|
+
const { bucket, jurisdiction } = args;
|
200289
|
+
const devDomain = await getR2DevDomain(accountId, bucket, jurisdiction);
|
200290
|
+
if (devDomain.enabled) {
|
200291
|
+
logger.log(`Public access is enabled at 'https://${devDomain.domain}'.`);
|
200292
|
+
} else {
|
200293
|
+
logger.log(`Public access via the r2.dev URL is disabled.`);
|
200294
|
+
}
|
200295
|
+
}
|
200296
|
+
__name(GetHandler, "GetHandler");
|
200297
|
+
function EnableOptions(yargs) {
|
200298
|
+
return yargs.positional("bucket", {
|
200299
|
+
describe: "The name of the R2 bucket to enable public access via its r2.dev URL",
|
200300
|
+
type: "string",
|
200301
|
+
demandOption: true
|
200302
|
+
}).option("jurisdiction", {
|
200303
|
+
describe: "The jurisdiction where the bucket exists",
|
200304
|
+
alias: "J",
|
200305
|
+
requiresArg: true,
|
200306
|
+
type: "string"
|
200307
|
+
}).option("force", {
|
200308
|
+
describe: "Skip confirmation",
|
200309
|
+
type: "boolean",
|
200310
|
+
alias: "y",
|
200311
|
+
default: false
|
200312
|
+
});
|
200313
|
+
}
|
200314
|
+
__name(EnableOptions, "EnableOptions");
|
200315
|
+
async function EnableHandler(args) {
|
200316
|
+
await printWranglerBanner();
|
200317
|
+
const config = readConfig(args.config, args);
|
200318
|
+
const accountId = await requireAuth(config);
|
200319
|
+
const { bucket, jurisdiction, force } = args;
|
200320
|
+
if (!force) {
|
200321
|
+
const confirmedAdd = await confirm(
|
200322
|
+
`Are you sure you enable public access for bucket '${bucket}'? The contents of your bucket will be made publicly available at its r2.dev URL`
|
200323
|
+
);
|
200324
|
+
if (!confirmedAdd) {
|
200325
|
+
logger.log("Enable cancelled.");
|
200326
|
+
return;
|
200327
|
+
}
|
200328
|
+
}
|
200329
|
+
logger.log(`Enabling public access for bucket '${bucket}'...`);
|
200330
|
+
const devDomain = await updateR2DevDomain(
|
200331
|
+
accountId,
|
200332
|
+
bucket,
|
200333
|
+
true,
|
200334
|
+
jurisdiction
|
200335
|
+
);
|
200336
|
+
logger.log(`\u2728 Public access enabled at 'https://${devDomain.domain}'.`);
|
200337
|
+
}
|
200338
|
+
__name(EnableHandler, "EnableHandler");
|
200339
|
+
function DisableOptions(yargs) {
|
200340
|
+
return yargs.positional("bucket", {
|
200341
|
+
describe: "The name of the R2 bucket to disable public access via its r2.dev URL",
|
200342
|
+
type: "string",
|
200343
|
+
demandOption: true
|
200344
|
+
}).option("jurisdiction", {
|
200345
|
+
describe: "The jurisdiction where the bucket exists",
|
200346
|
+
alias: "J",
|
200347
|
+
requiresArg: true,
|
200348
|
+
type: "string"
|
200349
|
+
}).option("force", {
|
200350
|
+
describe: "Skip confirmation",
|
200351
|
+
type: "boolean",
|
200352
|
+
alias: "y",
|
200353
|
+
default: false
|
200354
|
+
});
|
200355
|
+
}
|
200356
|
+
__name(DisableOptions, "DisableOptions");
|
200357
|
+
async function DisableHandler(args) {
|
200358
|
+
await printWranglerBanner();
|
200359
|
+
const config = readConfig(args.config, args);
|
200360
|
+
const accountId = await requireAuth(config);
|
200361
|
+
const { bucket, jurisdiction, force } = args;
|
200362
|
+
if (!force) {
|
200363
|
+
const confirmedAdd = await confirm(
|
200364
|
+
`Are you sure you disable public access for bucket '${bucket}'? The contents of your bucket will no longer be publicly available at its r2.dev URL`
|
200365
|
+
);
|
200366
|
+
if (!confirmedAdd) {
|
200367
|
+
logger.log("Disable cancelled.");
|
200368
|
+
return;
|
200369
|
+
}
|
200370
|
+
}
|
200371
|
+
logger.log(`Disabling public access for bucket '${bucket}'...`);
|
200372
|
+
const devDomain = await updateR2DevDomain(
|
200373
|
+
accountId,
|
200374
|
+
bucket,
|
200375
|
+
false,
|
200376
|
+
jurisdiction
|
200377
|
+
);
|
200378
|
+
logger.log(`Public access disabled at 'https://${devDomain.domain}'.`);
|
200379
|
+
}
|
200380
|
+
__name(DisableHandler, "DisableHandler");
|
200381
|
+
|
200198
200382
|
// src/r2/sippy.ts
|
200199
200383
|
init_import_meta_url();
|
200200
200384
|
var NO_SUCH_OBJECT_KEY = 10007;
|
200201
200385
|
var SIPPY_PROVIDER_CHOICES = ["AWS", "GCS"];
|
200202
|
-
function
|
200386
|
+
function EnableOptions2(yargs) {
|
200203
200387
|
return yargs.positional("name", {
|
200204
200388
|
describe: "The name of the bucket",
|
200205
200389
|
type: "string",
|
@@ -200240,8 +200424,8 @@ function EnableOptions(yargs) {
|
|
200240
200424
|
string: true
|
200241
200425
|
});
|
200242
200426
|
}
|
200243
|
-
__name(
|
200244
|
-
async function
|
200427
|
+
__name(EnableOptions2, "EnableOptions");
|
200428
|
+
async function EnableHandler2(args) {
|
200245
200429
|
const isInteractive3 = process.stdin.isTTY;
|
200246
200430
|
const config = readConfig(args.config, args);
|
200247
200431
|
const accountId = await requireAuth(config);
|
@@ -200388,8 +200572,8 @@ async function EnableHandler(args) {
|
|
200388
200572
|
await putR2Sippy(accountId, args.name, sippyConfig, args.jurisdiction);
|
200389
200573
|
logger.log(`\u2728 Successfully enabled Sippy on the '${args.name}' bucket.`);
|
200390
200574
|
}
|
200391
|
-
__name(
|
200392
|
-
function
|
200575
|
+
__name(EnableHandler2, "EnableHandler");
|
200576
|
+
function GetOptions2(yargs) {
|
200393
200577
|
return yargs.positional("name", {
|
200394
200578
|
describe: "The name of the bucket",
|
200395
200579
|
type: "string",
|
@@ -200401,8 +200585,8 @@ function GetOptions(yargs) {
|
|
200401
200585
|
type: "string"
|
200402
200586
|
});
|
200403
200587
|
}
|
200404
|
-
__name(
|
200405
|
-
async function
|
200588
|
+
__name(GetOptions2, "GetOptions");
|
200589
|
+
async function GetHandler2(args) {
|
200406
200590
|
const config = readConfig(args.config, args);
|
200407
200591
|
const accountId = await requireAuth(config);
|
200408
200592
|
try {
|
@@ -200420,8 +200604,8 @@ async function GetHandler(args) {
|
|
200420
200604
|
}
|
200421
200605
|
}
|
200422
200606
|
}
|
200423
|
-
__name(
|
200424
|
-
function
|
200607
|
+
__name(GetHandler2, "GetHandler");
|
200608
|
+
function DisableOptions2(yargs) {
|
200425
200609
|
return yargs.positional("name", {
|
200426
200610
|
describe: "The name of the bucket",
|
200427
200611
|
type: "string",
|
@@ -200433,14 +200617,14 @@ function DisableOptions(yargs) {
|
|
200433
200617
|
type: "string"
|
200434
200618
|
});
|
200435
200619
|
}
|
200436
|
-
__name(
|
200437
|
-
async function
|
200620
|
+
__name(DisableOptions2, "DisableOptions");
|
200621
|
+
async function DisableHandler2(args) {
|
200438
200622
|
const config = readConfig(args.config, args);
|
200439
200623
|
const accountId = await requireAuth(config);
|
200440
200624
|
await deleteR2Sippy(accountId, args.name, args.jurisdiction);
|
200441
200625
|
logger.log(`\u2728 Successfully disabled Sippy on the '${args.name}' bucket.`);
|
200442
200626
|
}
|
200443
|
-
__name(
|
200627
|
+
__name(DisableHandler2, "DisableHandler");
|
200444
200628
|
|
200445
200629
|
// src/r2/index.ts
|
200446
200630
|
var CHUNK_SIZE = 1024;
|
@@ -200902,18 +201086,18 @@ ${key} is ${prettyBytes(objectSize, {
|
|
200902
201086
|
return sippyYargs.command(
|
200903
201087
|
"enable <name>",
|
200904
201088
|
"Enable Sippy on an R2 bucket",
|
200905
|
-
|
200906
|
-
|
201089
|
+
EnableOptions2,
|
201090
|
+
EnableHandler2
|
200907
201091
|
).command(
|
200908
201092
|
"disable <name>",
|
200909
201093
|
"Disable Sippy on an R2 bucket",
|
200910
|
-
|
200911
|
-
|
201094
|
+
DisableOptions2,
|
201095
|
+
DisableHandler2
|
200912
201096
|
).command(
|
200913
201097
|
"get <name>",
|
200914
201098
|
"Check the status of Sippy on an R2 bucket",
|
200915
|
-
|
200916
|
-
|
201099
|
+
GetOptions2,
|
201100
|
+
GetHandler2
|
200917
201101
|
);
|
200918
201102
|
}
|
200919
201103
|
);
|
@@ -200966,6 +201150,28 @@ ${key} is ${prettyBytes(objectSize, {
|
|
200966
201150
|
);
|
200967
201151
|
}
|
200968
201152
|
);
|
201153
|
+
r2BucketYargs.command(
|
201154
|
+
"dev-url",
|
201155
|
+
"Manage public access via the r2.dev URL for an R2 bucket",
|
201156
|
+
(devUrlYargs) => {
|
201157
|
+
return devUrlYargs.command(
|
201158
|
+
"enable <bucket>",
|
201159
|
+
"Enable public access via the r2.dev URL for an R2 bucket",
|
201160
|
+
EnableOptions,
|
201161
|
+
EnableHandler
|
201162
|
+
).command(
|
201163
|
+
"disable <bucket>",
|
201164
|
+
"Disable public access via the r2.dev URL for an R2 bucket",
|
201165
|
+
DisableOptions,
|
201166
|
+
DisableHandler
|
201167
|
+
).command(
|
201168
|
+
"get <bucket>",
|
201169
|
+
"Get the r2.dev URL and status for an R2 bucket",
|
201170
|
+
GetOptions,
|
201171
|
+
GetHandler
|
201172
|
+
);
|
201173
|
+
}
|
201174
|
+
);
|
200969
201175
|
return r2BucketYargs;
|
200970
201176
|
});
|
200971
201177
|
}
|
@@ -213705,7 +213911,7 @@ async function versionsUploadHandler(args) {
|
|
213705
213911
|
);
|
213706
213912
|
}
|
213707
213913
|
if (config.workflows?.length) {
|
213708
|
-
logger.
|
213914
|
+
logger.once.warn("Workflows is currently in open beta.");
|
213709
213915
|
}
|
213710
213916
|
validateAssetsArgsAndConfig(
|
213711
213917
|
{
|
@@ -216647,7 +216853,7 @@ async function resolveConfig(config, input) {
|
|
216647
216853
|
}
|
216648
216854
|
validateAssetsArgsAndConfig(resolved);
|
216649
216855
|
const services = extractBindingsOfType("service", resolved.bindings);
|
216650
|
-
if (services && services.length > 0) {
|
216856
|
+
if (services && services.length > 0 && resolved.dev?.remote) {
|
216651
216857
|
logger.warn(
|
216652
216858
|
`This worker is bound to live services: ${services.map(
|
216653
216859
|
(service) => `${service.name} (${service.service}${service.environment ? `@${service.environment}` : ""}${service.entrypoint ? `#${service.entrypoint}` : ""})`
|
@@ -217116,7 +217322,9 @@ var ProxyController = class extends Controller {
|
|
217116
217322
|
this.proxyWorkerOptions = proxyWorkerOptions;
|
217117
217323
|
if (proxyWorkerOptionsChanged) {
|
217118
217324
|
logger.debug("ProxyWorker miniflare options changed, reinstantiating...");
|
217119
|
-
void this.proxyWorker.setOptions(proxyWorkerOptions)
|
217325
|
+
void this.proxyWorker.setOptions(proxyWorkerOptions).catch((error2) => {
|
217326
|
+
this.emitErrorEvent("Failed to start ProxyWorker", error2);
|
217327
|
+
});
|
217120
217328
|
this.ready = createDeferred(this.ready);
|
217121
217329
|
}
|
217122
217330
|
const { proxyWorker } = this;
|
@@ -217217,7 +217425,6 @@ var ProxyController = class extends Controller {
|
|
217217
217425
|
`Failed to send message to ProxyWorker: ${JSON.stringify(message)}`,
|
217218
217426
|
error2
|
217219
217427
|
);
|
217220
|
-
throw error2;
|
217221
217428
|
}
|
217222
217429
|
}
|
217223
217430
|
async sendMessageToInspectorProxyWorker(message, retries = 3) {
|
@@ -217242,7 +217449,6 @@ var ProxyController = class extends Controller {
|
|
217242
217449
|
)}`,
|
217243
217450
|
error2
|
217244
217451
|
);
|
217245
|
-
throw error2;
|
217246
217452
|
}
|
217247
217453
|
}
|
217248
217454
|
// ******************
|
@@ -217739,25 +217945,7 @@ var DevEnv = class extends import_node_events6.EventEmitter {
|
|
217739
217945
|
logger.debug("DevEnv teardown complete");
|
217740
217946
|
}
|
217741
217947
|
emitErrorEvent(ev) {
|
217742
|
-
if (ev.source === "ProxyController" && ev.reason
|
217743
|
-
(0, import_node_assert28.default)(ev.data.config);
|
217744
|
-
const { config } = ev.data;
|
217745
|
-
const port2 = config.dev?.server?.port;
|
217746
|
-
const inspectorPort = config.dev?.inspector?.port;
|
217747
|
-
const randomPorts = [0, void 0];
|
217748
|
-
if (!randomPorts.includes(port2) || !randomPorts.includes(inspectorPort)) {
|
217749
|
-
this.config.emitConfigUpdateEvent({
|
217750
|
-
...config,
|
217751
|
-
dev: {
|
217752
|
-
...config.dev,
|
217753
|
-
server: { ...config.dev?.server, port: 0 },
|
217754
|
-
// override port
|
217755
|
-
inspector: { ...config.dev?.inspector, port: 0 }
|
217756
|
-
// override port
|
217757
|
-
}
|
217758
|
-
});
|
217759
|
-
}
|
217760
|
-
} else if (ev.source === "ProxyController" && (ev.reason.startsWith("Failed to send message to") || ev.reason.startsWith("Could not connect to InspectorProxyWorker"))) {
|
217948
|
+
if (ev.source === "ProxyController" && (ev.reason.startsWith("Failed to send message to") || ev.reason.startsWith("Could not connect to InspectorProxyWorker"))) {
|
217761
217949
|
logger.debug(`Error in ${ev.source}: ${ev.reason}
|
217762
217950
|
`, ev.cause);
|
217763
217951
|
logger.debug("=> Error contextual data:", ev.data);
|