wrangler 3.84.0 → 3.85.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 +3 -3
- package/wrangler-dist/cli.js +1041 -355
- package/wrangler-dist/cli.js.map +4 -4
package/wrangler-dist/cli.js
CHANGED
@@ -22717,12 +22717,12 @@ var require_lodash = __commonJS({
|
|
22717
22717
|
__name(random, "random");
|
22718
22718
|
var camelCase2 = createCompounder(function(result2, word, index) {
|
22719
22719
|
word = word.toLowerCase();
|
22720
|
-
return result2 + (index ?
|
22720
|
+
return result2 + (index ? capitalize2(word) : word);
|
22721
22721
|
});
|
22722
|
-
function
|
22722
|
+
function capitalize2(string) {
|
22723
22723
|
return upperFirst(toString2(string).toLowerCase());
|
22724
22724
|
}
|
22725
|
-
__name(
|
22725
|
+
__name(capitalize2, "capitalize");
|
22726
22726
|
function deburr(string) {
|
22727
22727
|
string = toString2(string);
|
22728
22728
|
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
@@ -23380,7 +23380,7 @@ var require_lodash = __commonJS({
|
|
23380
23380
|
lodash.add = add;
|
23381
23381
|
lodash.attempt = attempt;
|
23382
23382
|
lodash.camelCase = camelCase2;
|
23383
|
-
lodash.capitalize =
|
23383
|
+
lodash.capitalize = capitalize2;
|
23384
23384
|
lodash.ceil = ceil;
|
23385
23385
|
lodash.clamp = clamp;
|
23386
23386
|
lodash.clone = clone;
|
@@ -57481,7 +57481,7 @@ var require_parser = __commonJS({
|
|
57481
57481
|
}
|
57482
57482
|
};
|
57483
57483
|
__name(ParserError, "ParserError");
|
57484
|
-
var
|
57484
|
+
var State = class {
|
57485
57485
|
constructor(parser2) {
|
57486
57486
|
this.parser = parser2;
|
57487
57487
|
this.buf = "";
|
@@ -57491,7 +57491,7 @@ var require_parser = __commonJS({
|
|
57491
57491
|
this.resultArr = null;
|
57492
57492
|
}
|
57493
57493
|
};
|
57494
|
-
__name(
|
57494
|
+
__name(State, "State");
|
57495
57495
|
var Parser2 = class {
|
57496
57496
|
constructor() {
|
57497
57497
|
this.pos = 0;
|
@@ -57503,7 +57503,7 @@ var require_parser = __commonJS({
|
|
57503
57503
|
this._buf = "";
|
57504
57504
|
this.char = null;
|
57505
57505
|
this.ii = 0;
|
57506
|
-
this.state = new
|
57506
|
+
this.state = new State(this.parseStart);
|
57507
57507
|
}
|
57508
57508
|
parse(str) {
|
57509
57509
|
if (str.length === 0 || str.length == null)
|
@@ -57559,7 +57559,7 @@ var require_parser = __commonJS({
|
|
57559
57559
|
if (returnWith)
|
57560
57560
|
this.next(returnWith);
|
57561
57561
|
this.stack.push(this.state);
|
57562
|
-
this.state = new
|
57562
|
+
this.state = new State(fn2);
|
57563
57563
|
}
|
57564
57564
|
callNow(fn2, returnWith) {
|
57565
57565
|
this.call(fn2, returnWith);
|
@@ -111468,10 +111468,10 @@ var require_src6 = __commonJS({
|
|
111468
111468
|
});
|
111469
111469
|
var import_assert7 = __toModule(require("assert"));
|
111470
111470
|
var import_path21 = __toModule(require("path"));
|
111471
|
-
var
|
111471
|
+
var import_util9 = __toModule(require("util"));
|
111472
111472
|
var import_worker_threads = __toModule(require("worker_threads"));
|
111473
111473
|
var import_picomatch = __toModule(require_picomatch2());
|
111474
|
-
var encoder = new
|
111474
|
+
var encoder = new import_util9.TextEncoder();
|
111475
111475
|
var numericCompare = new Intl.Collator(void 0, { numeric: true }).compare;
|
111476
111476
|
function arrayCompare(a, b2) {
|
111477
111477
|
const minLength = Math.min(a.length, b2.length);
|
@@ -132574,7 +132574,7 @@ var require_parser2 = __commonJS({
|
|
132574
132574
|
}
|
132575
132575
|
};
|
132576
132576
|
__name(ParserError, "ParserError");
|
132577
|
-
var
|
132577
|
+
var State = class {
|
132578
132578
|
constructor(parser2) {
|
132579
132579
|
this.parser = parser2;
|
132580
132580
|
this.buf = "";
|
@@ -132584,7 +132584,7 @@ var require_parser2 = __commonJS({
|
|
132584
132584
|
this.resultArr = null;
|
132585
132585
|
}
|
132586
132586
|
};
|
132587
|
-
__name(
|
132587
|
+
__name(State, "State");
|
132588
132588
|
var Parser2 = class {
|
132589
132589
|
constructor() {
|
132590
132590
|
this.pos = 0;
|
@@ -132596,7 +132596,7 @@ var require_parser2 = __commonJS({
|
|
132596
132596
|
this._buf = "";
|
132597
132597
|
this.char = null;
|
132598
132598
|
this.ii = 0;
|
132599
|
-
this.state = new
|
132599
|
+
this.state = new State(this.parseStart);
|
132600
132600
|
}
|
132601
132601
|
parse(str) {
|
132602
132602
|
if (str.length === 0 || str.length == null)
|
@@ -132652,7 +132652,7 @@ var require_parser2 = __commonJS({
|
|
132652
132652
|
if (returnWith)
|
132653
132653
|
this.next(returnWith);
|
132654
132654
|
this.stack.push(this.state);
|
132655
|
-
this.state = new
|
132655
|
+
this.state = new State(fn2);
|
132656
132656
|
}
|
132657
132657
|
callNow(fn2, returnWith) {
|
132658
132658
|
this.call(fn2, returnWith);
|
@@ -134712,8 +134712,8 @@ var require_src7 = __commonJS({
|
|
134712
134712
|
var import_assert7 = __toModule(require("assert"));
|
134713
134713
|
var import_fs16 = __toModule(require("fs"));
|
134714
134714
|
var import_path21 = __toModule(require("path"));
|
134715
|
-
var
|
134716
|
-
var log2 = (0,
|
134715
|
+
var import_util9 = __toModule(require("util"));
|
134716
|
+
var log2 = (0, import_util9.debuglog)("mf-watch");
|
134717
134717
|
function withinDir(dir, file) {
|
134718
134718
|
const rel = import_path21.default.relative(dir, file);
|
134719
134719
|
return !!rel && !rel.startsWith("..") && !import_path21.default.isAbsolute(rel);
|
@@ -136618,8 +136618,8 @@ Make sure you're ${suggestion}.`);
|
|
136618
136618
|
userAgent = "Cloudflare-Workers";
|
136619
136619
|
}, "Navigator");
|
136620
136620
|
var import_web4 = __toModule(require("stream/web"));
|
136621
|
-
var
|
136622
|
-
var encoder = new
|
136621
|
+
var import_util9 = __toModule(require("util"));
|
136622
|
+
var encoder = new import_util9.TextEncoder();
|
136623
136623
|
var rangePrefixRegexp = /^ *bytes *=/i;
|
136624
136624
|
var rangeRegexp = /^ *(?<start>\d+)? *- *(?<end>\d+)? *$/;
|
136625
136625
|
function parseRanges(rangeHeader, length) {
|
@@ -139500,7 +139500,7 @@ var require_src9 = __commonJS({
|
|
139500
139500
|
});
|
139501
139501
|
var import_shared = __toModule(require_src6());
|
139502
139502
|
var import_web2 = __toModule(require("stream/web"));
|
139503
|
-
var
|
139503
|
+
var import_core31 = __toModule(require_src8());
|
139504
139504
|
var import_undici29 = __toModule(require_undici2());
|
139505
139505
|
var kEnableEsiTags = Symbol("kEnableEsiTags");
|
139506
139506
|
var HTMLRewriter2 = /* @__PURE__ */ __name(class {
|
@@ -139518,9 +139518,9 @@ var require_src9 = __commonJS({
|
|
139518
139518
|
transform(response) {
|
139519
139519
|
const body = response.body;
|
139520
139520
|
if (body === null)
|
139521
|
-
return new
|
139521
|
+
return new import_core31.Response(body, response);
|
139522
139522
|
if (response instanceof import_undici29.Response) {
|
139523
|
-
response = new
|
139523
|
+
response = new import_core31.Response(response.body, response);
|
139524
139524
|
}
|
139525
139525
|
let rewriter;
|
139526
139526
|
const transformStream = new import_web2.TransformStream({
|
@@ -139545,7 +139545,7 @@ var require_src9 = __commonJS({
|
|
139545
139545
|
const promise = body.pipeTo(transformStream.writable);
|
139546
139546
|
promise.catch(() => {
|
139547
139547
|
}).finally(() => rewriter.free());
|
139548
|
-
const res = new
|
139548
|
+
const res = new import_core31.Response(transformStream.readable, response);
|
139549
139549
|
res.headers.delete("Content-Length");
|
139550
139550
|
return res;
|
139551
139551
|
}
|
@@ -155898,7 +155898,7 @@ var import_undici3 = __toESM(require_undici());
|
|
155898
155898
|
|
155899
155899
|
// package.json
|
155900
155900
|
var name = "wrangler";
|
155901
|
-
var version = "3.
|
155901
|
+
var version = "3.85.0";
|
155902
155902
|
|
155903
155903
|
// src/user/index.ts
|
155904
155904
|
init_import_meta_url();
|
@@ -160626,6 +160626,11 @@ var validateBindingsHaveUniqueNames = /* @__PURE__ */ __name((diagnostics, confi
|
|
160626
160626
|
if (!(bindingName in bindingsGroupedByName)) {
|
160627
160627
|
bindingsGroupedByName[bindingName] = [];
|
160628
160628
|
}
|
160629
|
+
if (bindingName === "ASSETS" && isPagesConfig(config)) {
|
160630
|
+
diagnostics.errors.push(
|
160631
|
+
`The name 'ASSETS' is reserved in Pages projects. Please use a different name for your ${bindingType} binding.`
|
160632
|
+
);
|
160633
|
+
}
|
160629
160634
|
bindingsGroupedByName[bindingName].push(bindingType);
|
160630
160635
|
}
|
160631
160636
|
}
|
@@ -163225,7 +163230,6 @@ async function bundleWorker(entry, destination, {
|
|
163225
163230
|
targetConsumer,
|
163226
163231
|
testScheduled,
|
163227
163232
|
inject: injectOption,
|
163228
|
-
loader,
|
163229
163233
|
sourcemap,
|
163230
163234
|
plugins,
|
163231
163235
|
isOutfile,
|
@@ -163383,10 +163387,7 @@ async function bundleWorker(entry, destination, {
|
|
163383
163387
|
...define2
|
163384
163388
|
}
|
163385
163389
|
},
|
163386
|
-
loader:
|
163387
|
-
...COMMON_ESBUILD_OPTIONS.loader,
|
163388
|
-
...loader || {}
|
163389
|
-
},
|
163390
|
+
loader: COMMON_ESBUILD_OPTIONS.loader,
|
163390
163391
|
plugins: [
|
163391
163392
|
aliasPlugin,
|
163392
163393
|
moduleCollector.plugin,
|
@@ -163791,7 +163792,7 @@ function createWorkerUploadForm(worker) {
|
|
163791
163792
|
metadataBindings.push({
|
163792
163793
|
name: binding,
|
163793
163794
|
type: "pipelines",
|
163794
|
-
|
163795
|
+
pipeline
|
163795
163796
|
});
|
163796
163797
|
});
|
163797
163798
|
bindings.logfwdr?.bindings.forEach(({ name: name2, destination }) => {
|
@@ -165808,7 +165809,7 @@ var didWarnMiniflareCronSupport = false;
|
|
165808
165809
|
var didWarnMiniflareVectorizeSupport = false;
|
165809
165810
|
var didWarnAiAccountUsage = false;
|
165810
165811
|
async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticationSecret) {
|
165811
|
-
if (config.crons.length > 0) {
|
165812
|
+
if (config.crons.length > 0 && !config.testScheduled) {
|
165812
165813
|
if (!didWarnMiniflareCronSupport) {
|
165813
165814
|
didWarnMiniflareCronSupport = true;
|
165814
165815
|
log2.warn(
|
@@ -169708,7 +169709,15 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
169708
169709
|
props.compatibilityDate ?? config.compatibility_date,
|
169709
169710
|
props.compatibilityFlags ?? config.compatibility_flags
|
169710
169711
|
),
|
169711
|
-
plugins: [logBuildOutput(nodejsCompatMode)]
|
169712
|
+
plugins: [logBuildOutput(nodejsCompatMode)],
|
169713
|
+
// Pages specific options used by wrangler pages commands
|
169714
|
+
entryName: void 0,
|
169715
|
+
inject: void 0,
|
169716
|
+
isOutfile: void 0,
|
169717
|
+
external: void 0,
|
169718
|
+
// These options are dev-only
|
169719
|
+
testScheduled: void 0,
|
169720
|
+
watch: void 0
|
169712
169721
|
}
|
169713
169722
|
);
|
169714
169723
|
for (const module3 of modules) {
|
@@ -172228,7 +172237,8 @@ async function localPropsToConfigBundle(props) {
|
|
172228
172237
|
inspect: props.inspect,
|
172229
172238
|
services: props.services,
|
172230
172239
|
serviceBindings,
|
172231
|
-
bindVectorizeToProd: props.bindVectorizeToProd
|
172240
|
+
bindVectorizeToProd: props.bindVectorizeToProd,
|
172241
|
+
testScheduled: !!props.testScheduled
|
172232
172242
|
};
|
172233
172243
|
}
|
172234
172244
|
__name(localPropsToConfigBundle, "localPropsToConfigBundle");
|
@@ -173693,7 +173703,14 @@ function runBuild({
|
|
173693
173703
|
plugins: [logBuildOutput(nodejsCompatMode, onStart, updateBundle)],
|
173694
173704
|
local,
|
173695
173705
|
projectRoot,
|
173696
|
-
defineNavigatorUserAgent
|
173706
|
+
defineNavigatorUserAgent,
|
173707
|
+
// Pages specific options used by wrangler pages commands
|
173708
|
+
entryName: void 0,
|
173709
|
+
inject: void 0,
|
173710
|
+
isOutfile: void 0,
|
173711
|
+
external: void 0,
|
173712
|
+
// sourcemap defaults to true in dev
|
173713
|
+
sourcemap: void 0
|
173697
173714
|
}) : void 0;
|
173698
173715
|
stopWatching = bundleResult?.stop;
|
173699
173716
|
if (noBundle) {
|
@@ -175071,7 +175088,15 @@ async function runEsbuild({
|
|
175071
175088
|
doBindings,
|
175072
175089
|
workflowBindings,
|
175073
175090
|
projectRoot,
|
175074
|
-
defineNavigatorUserAgent
|
175091
|
+
defineNavigatorUserAgent,
|
175092
|
+
// Pages specific options used by wrangler pages commands
|
175093
|
+
entryName: void 0,
|
175094
|
+
inject: void 0,
|
175095
|
+
isOutfile: void 0,
|
175096
|
+
external: void 0,
|
175097
|
+
watch: void 0,
|
175098
|
+
sourcemap: void 0,
|
175099
|
+
plugins: void 0
|
175075
175100
|
}) : void 0;
|
175076
175101
|
const entrypointPath = bundleResult?.resolvedEntryPointPath ?? entry.file;
|
175077
175102
|
return {
|
@@ -179098,12 +179123,18 @@ var OpenAPI = {
|
|
179098
179123
|
ENCODE_PATH: void 0
|
179099
179124
|
};
|
179100
179125
|
|
179126
|
+
// src/cloudchamber/client/models/ApplicationAffinityColocation.ts
|
179127
|
+
init_import_meta_url();
|
179128
|
+
|
179101
179129
|
// src/cloudchamber/client/models/ApplicationMutationError.ts
|
179102
179130
|
init_import_meta_url();
|
179103
179131
|
|
179104
179132
|
// src/cloudchamber/client/models/AssignIPv4.ts
|
179105
179133
|
init_import_meta_url();
|
179106
179134
|
|
179135
|
+
// src/cloudchamber/client/models/AssignIPv6.ts
|
179136
|
+
init_import_meta_url();
|
179137
|
+
|
179107
179138
|
// src/cloudchamber/client/models/BadRequestWithCodeError.ts
|
179108
179139
|
init_import_meta_url();
|
179109
179140
|
var BadRequestWithCodeError;
|
@@ -179114,6 +179145,15 @@ var BadRequestWithCodeError;
|
|
179114
179145
|
})(error2 = BadRequestWithCodeError2.error || (BadRequestWithCodeError2.error = {}));
|
179115
179146
|
})(BadRequestWithCodeError || (BadRequestWithCodeError = {}));
|
179116
179147
|
|
179148
|
+
// src/cloudchamber/client/models/ContainerNetworkMode.ts
|
179149
|
+
init_import_meta_url();
|
179150
|
+
|
179151
|
+
// src/cloudchamber/client/models/DeploymentCheckKind.ts
|
179152
|
+
init_import_meta_url();
|
179153
|
+
|
179154
|
+
// src/cloudchamber/client/models/DeploymentCheckType.ts
|
179155
|
+
init_import_meta_url();
|
179156
|
+
|
179117
179157
|
// src/cloudchamber/client/models/DeploymentMutationError.ts
|
179118
179158
|
init_import_meta_url();
|
179119
179159
|
var DeploymentMutationError = /* @__PURE__ */ ((DeploymentMutationError2) => {
|
@@ -179126,6 +179166,19 @@ var DeploymentMutationError = /* @__PURE__ */ ((DeploymentMutationError2) => {
|
|
179126
179166
|
return DeploymentMutationError2;
|
179127
179167
|
})(DeploymentMutationError || {});
|
179128
179168
|
|
179169
|
+
// src/cloudchamber/client/models/DeploymentNotFoundError.ts
|
179170
|
+
init_import_meta_url();
|
179171
|
+
var DeploymentNotFoundError;
|
179172
|
+
((DeploymentNotFoundError2) => {
|
179173
|
+
let error2;
|
179174
|
+
((error3) => {
|
179175
|
+
error3["DEPLOYMENT_NOT_FOUND"] = "DEPLOYMENT_NOT_FOUND";
|
179176
|
+
})(error2 = DeploymentNotFoundError2.error || (DeploymentNotFoundError2.error = {}));
|
179177
|
+
})(DeploymentNotFoundError || (DeploymentNotFoundError = {}));
|
179178
|
+
|
179179
|
+
// src/cloudchamber/client/models/DeploymentPlacementState.ts
|
179180
|
+
init_import_meta_url();
|
179181
|
+
|
179129
179182
|
// src/cloudchamber/client/models/DeploymentQueuedReason.ts
|
179130
179183
|
init_import_meta_url();
|
179131
179184
|
|
@@ -179135,6 +179188,15 @@ init_import_meta_url();
|
|
179135
179188
|
// src/cloudchamber/client/models/DeploymentType.ts
|
179136
179189
|
init_import_meta_url();
|
179137
179190
|
|
179191
|
+
// src/cloudchamber/client/models/EventName.ts
|
179192
|
+
init_import_meta_url();
|
179193
|
+
|
179194
|
+
// src/cloudchamber/client/models/EventType.ts
|
179195
|
+
init_import_meta_url();
|
179196
|
+
|
179197
|
+
// src/cloudchamber/client/models/HTTPMethod.ts
|
179198
|
+
init_import_meta_url();
|
179199
|
+
|
179138
179200
|
// src/cloudchamber/client/models/ImageRegistryAlreadyExistsError.ts
|
179139
179201
|
init_import_meta_url();
|
179140
179202
|
var ImageRegistryAlreadyExistsError;
|
@@ -179178,20 +179240,86 @@ var ImageRegistryNotFoundError;
|
|
179178
179240
|
// src/cloudchamber/client/models/ImageRegistryPermissions.ts
|
179179
179241
|
init_import_meta_url();
|
179180
179242
|
|
179243
|
+
// src/cloudchamber/client/models/ImageRegistryProtocolAlreadyExists.ts
|
179244
|
+
init_import_meta_url();
|
179245
|
+
var ImageRegistryProtocolAlreadyExists;
|
179246
|
+
((ImageRegistryProtocolAlreadyExists2) => {
|
179247
|
+
let error2;
|
179248
|
+
((error3) => {
|
179249
|
+
error3["IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS"] = "IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS";
|
179250
|
+
})(error2 = ImageRegistryProtocolAlreadyExists2.error || (ImageRegistryProtocolAlreadyExists2.error = {}));
|
179251
|
+
})(ImageRegistryProtocolAlreadyExists || (ImageRegistryProtocolAlreadyExists = {}));
|
179252
|
+
|
179253
|
+
// src/cloudchamber/client/models/ImageRegistryProtocolIsReferencedError.ts
|
179254
|
+
init_import_meta_url();
|
179255
|
+
var ImageRegistryProtocolIsReferencedError;
|
179256
|
+
((ImageRegistryProtocolIsReferencedError2) => {
|
179257
|
+
let error2;
|
179258
|
+
((error3) => {
|
179259
|
+
error3["IMAGE_REGISTRY_PROTO_IS_REFERENCED"] = "IMAGE_REGISTRY_PROTO_IS_REFERENCED";
|
179260
|
+
})(error2 = ImageRegistryProtocolIsReferencedError2.error || (ImageRegistryProtocolIsReferencedError2.error = {}));
|
179261
|
+
})(ImageRegistryProtocolIsReferencedError || (ImageRegistryProtocolIsReferencedError = {}));
|
179262
|
+
|
179263
|
+
// src/cloudchamber/client/models/ImageRegistryProtocolNotFound.ts
|
179264
|
+
init_import_meta_url();
|
179265
|
+
var ImageRegistryProtocolNotFound;
|
179266
|
+
((ImageRegistryProtocolNotFound2) => {
|
179267
|
+
let error2;
|
179268
|
+
((error3) => {
|
179269
|
+
error3["IMAGE_REGISTRY_PROTOCOL_NOT_FOUND"] = "IMAGE_REGISTRY_PROTOCOL_NOT_FOUND";
|
179270
|
+
})(error2 = ImageRegistryProtocolNotFound2.error || (ImageRegistryProtocolNotFound2.error = {}));
|
179271
|
+
})(ImageRegistryProtocolNotFound || (ImageRegistryProtocolNotFound = {}));
|
179272
|
+
|
179181
179273
|
// src/cloudchamber/client/models/IPType.ts
|
179182
179274
|
init_import_meta_url();
|
179183
179275
|
|
179276
|
+
// src/cloudchamber/client/models/JobStatusHealth.ts
|
179277
|
+
init_import_meta_url();
|
179278
|
+
|
179184
179279
|
// src/cloudchamber/client/models/NetworkMode.ts
|
179185
179280
|
init_import_meta_url();
|
179186
179281
|
|
179187
179282
|
// src/cloudchamber/client/models/NodeGroup.ts
|
179188
179283
|
init_import_meta_url();
|
179189
179284
|
|
179285
|
+
// src/cloudchamber/client/models/PlacementStatusHealth.ts
|
179286
|
+
init_import_meta_url();
|
179287
|
+
|
179190
179288
|
// src/cloudchamber/client/models/SchedulingPolicy.ts
|
179191
179289
|
init_import_meta_url();
|
179192
179290
|
|
179193
|
-
// src/cloudchamber/client/models/
|
179291
|
+
// src/cloudchamber/client/models/SecretAccessType.ts
|
179292
|
+
init_import_meta_url();
|
179293
|
+
|
179294
|
+
// src/cloudchamber/client/models/SecretNameAlreadyExists.ts
|
179295
|
+
init_import_meta_url();
|
179296
|
+
var SecretNameAlreadyExists;
|
179297
|
+
((SecretNameAlreadyExists2) => {
|
179298
|
+
let error2;
|
179299
|
+
((error3) => {
|
179300
|
+
error3["SECRET_NAME_ALREADY_EXISTS"] = "SECRET_NAME_ALREADY_EXISTS";
|
179301
|
+
})(error2 = SecretNameAlreadyExists2.error || (SecretNameAlreadyExists2.error = {}));
|
179302
|
+
})(SecretNameAlreadyExists || (SecretNameAlreadyExists = {}));
|
179303
|
+
|
179304
|
+
// src/cloudchamber/client/models/SecretNotFound.ts
|
179305
|
+
init_import_meta_url();
|
179306
|
+
var SecretNotFound;
|
179307
|
+
((SecretNotFound2) => {
|
179308
|
+
let error2;
|
179309
|
+
((error3) => {
|
179310
|
+
error3["SECRET_NAME_NOT_FOUND"] = "SECRET_NAME_NOT_FOUND";
|
179311
|
+
})(error2 = SecretNotFound2.error || (SecretNotFound2.error = {}));
|
179312
|
+
})(SecretNotFound || (SecretNotFound = {}));
|
179313
|
+
|
179314
|
+
// src/cloudchamber/client/models/SSHPublicKeyNotFoundError.ts
|
179194
179315
|
init_import_meta_url();
|
179316
|
+
var SSHPublicKeyNotFoundError;
|
179317
|
+
((SSHPublicKeyNotFoundError2) => {
|
179318
|
+
let error2;
|
179319
|
+
((error3) => {
|
179320
|
+
error3["SSH_PUBLIC_KEY_NOT_FOUND"] = "SSH_PUBLIC_KEY_NOT_FOUND";
|
179321
|
+
})(error2 = SSHPublicKeyNotFoundError2.error || (SSHPublicKeyNotFoundError2.error = {}));
|
179322
|
+
})(SSHPublicKeyNotFoundError || (SSHPublicKeyNotFoundError = {}));
|
179195
179323
|
|
179196
179324
|
// src/cloudchamber/client/services/AccountService.ts
|
179197
179325
|
init_import_meta_url();
|
@@ -179511,7 +179639,7 @@ var DeploymentsService = class {
|
|
179511
179639
|
* @param appId Filter deployments by application id
|
179512
179640
|
* @param location Filter deployments by location
|
179513
179641
|
* @param image Filter deployments by image
|
179514
|
-
* @param state Filter deployments by
|
179642
|
+
* @param state Filter deployments by placement state
|
179515
179643
|
* @param ipv4 Filter deployments by ipv4 address
|
179516
179644
|
* @param label Filter deployments by label
|
179517
179645
|
* @returns ListDeploymentsV2 List of deployments with their corresponding placements
|
@@ -179522,7 +179650,7 @@ var DeploymentsService = class {
|
|
179522
179650
|
method: "GET",
|
179523
179651
|
url: "/deployments/v2",
|
179524
179652
|
query: {
|
179525
|
-
appId,
|
179653
|
+
app_id: appId,
|
179526
179654
|
location,
|
179527
179655
|
image,
|
179528
179656
|
state,
|
@@ -179546,9 +179674,9 @@ var DeploymentsService = class {
|
|
179546
179674
|
static getDeploymentV2(deploymentId) {
|
179547
179675
|
return request(OpenAPI, {
|
179548
179676
|
method: "GET",
|
179549
|
-
url: "/deployments/{
|
179677
|
+
url: "/deployments/{deployment_id}/v2",
|
179550
179678
|
path: {
|
179551
|
-
|
179679
|
+
deployment_id: deploymentId
|
179552
179680
|
},
|
179553
179681
|
errors: {
|
179554
179682
|
400: `Unknown account`,
|
@@ -179569,9 +179697,9 @@ var DeploymentsService = class {
|
|
179569
179697
|
static modifyDeploymentV2(deploymentId, requestBody) {
|
179570
179698
|
return request(OpenAPI, {
|
179571
179699
|
method: "PATCH",
|
179572
|
-
url: "/deployments/{
|
179700
|
+
url: "/deployments/{deployment_id}/v2",
|
179573
179701
|
path: {
|
179574
|
-
|
179702
|
+
deployment_id: deploymentId
|
179575
179703
|
},
|
179576
179704
|
body: requestBody,
|
179577
179705
|
mediaType: "application/json",
|
@@ -179593,9 +179721,9 @@ var DeploymentsService = class {
|
|
179593
179721
|
static deleteDeploymentV2(deploymentId) {
|
179594
179722
|
return request(OpenAPI, {
|
179595
179723
|
method: "DELETE",
|
179596
|
-
url: "/deployments/{
|
179724
|
+
url: "/deployments/{deployment_id}/v2",
|
179597
179725
|
path: {
|
179598
|
-
|
179726
|
+
deployment_id: deploymentId
|
179599
179727
|
},
|
179600
179728
|
errors: {
|
179601
179729
|
400: `Unknown account`,
|
@@ -179616,9 +179744,9 @@ var DeploymentsService = class {
|
|
179616
179744
|
static replaceDeployment(placementId, requestBody) {
|
179617
179745
|
return request(OpenAPI, {
|
179618
179746
|
method: "POST",
|
179619
|
-
url: "/placements/{
|
179747
|
+
url: "/placements/{placement_id}",
|
179620
179748
|
path: {
|
179621
|
-
|
179749
|
+
placement_id: placementId
|
179622
179750
|
},
|
179623
179751
|
body: requestBody,
|
179624
179752
|
mediaType: "application/json",
|
@@ -179636,12 +179764,86 @@ __name(DeploymentsService, "DeploymentsService");
|
|
179636
179764
|
// src/cloudchamber/client/services/ImageRegistriesService.ts
|
179637
179765
|
init_import_meta_url();
|
179638
179766
|
var ImageRegistriesService = class {
|
179767
|
+
/**
|
179768
|
+
* Create an image registry protocol that resolves to multiple domains.
|
179769
|
+
* @param requestBody
|
179770
|
+
* @returns ImageRegistryProtocol The image registry protocol was created
|
179771
|
+
* @throws ApiError
|
179772
|
+
*/
|
179773
|
+
static createImageRegistryProtocol(requestBody) {
|
179774
|
+
return request(OpenAPI, {
|
179775
|
+
method: "POST",
|
179776
|
+
url: "/registries/protos",
|
179777
|
+
body: requestBody,
|
179778
|
+
mediaType: "application/json",
|
179779
|
+
errors: {
|
179780
|
+
400: `Bad Request that contains a specific constant code and details object about the error.`,
|
179781
|
+
403: `The registry that is being added is not allowed`,
|
179782
|
+
409: `Image registry protocol already exists`,
|
179783
|
+
500: `There has been an internal error`
|
179784
|
+
}
|
179785
|
+
});
|
179786
|
+
}
|
179787
|
+
/**
|
179788
|
+
* List all image registry protocols.
|
179789
|
+
* @returns ImageRegistryProtocols The image registry protocols in the account
|
179790
|
+
* @throws ApiError
|
179791
|
+
*/
|
179792
|
+
static listImageRegistryProtocols() {
|
179793
|
+
return request(OpenAPI, {
|
179794
|
+
method: "GET",
|
179795
|
+
url: "/registries/protos",
|
179796
|
+
errors: {
|
179797
|
+
500: `There has been an internal error`
|
179798
|
+
}
|
179799
|
+
});
|
179800
|
+
}
|
179801
|
+
/**
|
179802
|
+
* Modify an image registry protocol. The previous list of domains will be replaced by the ones you specify in this endpoint.
|
179803
|
+
* @param requestBody
|
179804
|
+
* @returns ImageRegistryProtocol The image registry protocol was modified
|
179805
|
+
* @throws ApiError
|
179806
|
+
*/
|
179807
|
+
static modifyImageRegistryProtocol(requestBody) {
|
179808
|
+
return request(OpenAPI, {
|
179809
|
+
method: "PUT",
|
179810
|
+
url: "/registries/protos",
|
179811
|
+
body: requestBody,
|
179812
|
+
mediaType: "application/json",
|
179813
|
+
errors: {
|
179814
|
+
400: `Bad Request that contains a specific constant code and details object about the error.`,
|
179815
|
+
403: `The registry that is being added is not allowed`,
|
179816
|
+
404: `Image registry protocol doesn't exist`,
|
179817
|
+
500: `There has been an internal error`
|
179818
|
+
}
|
179819
|
+
});
|
179820
|
+
}
|
179821
|
+
/**
|
179822
|
+
* Delete an image registry protocol. Be careful, if there is deployments running referencing this protocol they won't be able to pull the image.
|
179823
|
+
* @param proto
|
179824
|
+
* @returns EmptyResponse Image registry protocol was deleted successfully
|
179825
|
+
* @throws ApiError
|
179826
|
+
*/
|
179827
|
+
static deleteImageRegistryProto(proto2) {
|
179828
|
+
return request(OpenAPI, {
|
179829
|
+
method: "DELETE",
|
179830
|
+
url: "/registries/protos/{proto}",
|
179831
|
+
path: {
|
179832
|
+
proto: proto2
|
179833
|
+
},
|
179834
|
+
errors: {
|
179835
|
+
400: `The image registry protocol couldn't be deleted because it's referenced by a deployment or application`,
|
179836
|
+
404: `Image registry protocol doesn't exist`,
|
179837
|
+
500: `There has been an internal error`
|
179838
|
+
}
|
179839
|
+
});
|
179840
|
+
}
|
179639
179841
|
/**
|
179640
179842
|
* Get a JWT to pull from the image registry
|
179641
179843
|
* Get a JWT to pull from the image registry specifying its domain
|
179642
179844
|
* @param domain
|
179643
179845
|
* @param requestBody
|
179644
|
-
* @returns AccountRegistryToken
|
179846
|
+
* @returns AccountRegistryToken Credentials with 'pull' or 'push' permissions to access the registry
|
179645
179847
|
* @throws ApiError
|
179646
179848
|
*/
|
179647
179849
|
static generateImageRegistryCredentials(domain2, requestBody) {
|
@@ -179655,8 +179857,8 @@ var ImageRegistriesService = class {
|
|
179655
179857
|
mediaType: "application/json",
|
179656
179858
|
errors: {
|
179657
179859
|
400: `Bad Request that contains a specific constant code and details object about the error.`,
|
179658
|
-
404: `The
|
179659
|
-
409: `
|
179860
|
+
404: `The image registry does not exist`,
|
179861
|
+
409: `The registry was configured as public, so credentials can not be generated`,
|
179660
179862
|
500: `There has been an internal error`
|
179661
179863
|
}
|
179662
179864
|
});
|
@@ -179676,7 +179878,7 @@ var ImageRegistriesService = class {
|
|
179676
179878
|
domain: domain2
|
179677
179879
|
},
|
179678
179880
|
errors: {
|
179679
|
-
404: `The
|
179881
|
+
404: `The image registry does not exist`,
|
179680
179882
|
500: `There has been an internal error`
|
179681
179883
|
}
|
179682
179884
|
});
|
@@ -179700,7 +179902,7 @@ var ImageRegistriesService = class {
|
|
179700
179902
|
* Add a new image registry configuration
|
179701
179903
|
* Add a new image registry into your account, so then Cloudflare can pull docker images with public key JWT authentication
|
179702
179904
|
* @param requestBody
|
179703
|
-
* @returns CustomerImageRegistry
|
179905
|
+
* @returns CustomerImageRegistry Created a new image registry in the account
|
179704
179906
|
* @throws ApiError
|
179705
179907
|
*/
|
179706
179908
|
static createImageRegistry(requestBody) {
|
@@ -179710,9 +179912,9 @@ var ImageRegistriesService = class {
|
|
179710
179912
|
body: requestBody,
|
179711
179913
|
mediaType: "application/json",
|
179712
179914
|
errors: {
|
179713
|
-
400: `
|
179714
|
-
403: `The
|
179715
|
-
409: `The
|
179915
|
+
400: `Image registry input is malformed, see the error details`,
|
179916
|
+
403: `The registry that is being added is not allowed`,
|
179917
|
+
409: `The image registry already exists in the account`,
|
179716
179918
|
500: `There has been an internal error`
|
179717
179919
|
}
|
179718
179920
|
});
|
@@ -179723,6 +179925,9 @@ __name(ImageRegistriesService, "ImageRegistriesService");
|
|
179723
179925
|
// src/cloudchamber/client/services/IPsService.ts
|
179724
179926
|
init_import_meta_url();
|
179725
179927
|
|
179928
|
+
// src/cloudchamber/client/services/JobsService.ts
|
179929
|
+
init_import_meta_url();
|
179930
|
+
|
179726
179931
|
// src/cloudchamber/client/services/PlacementsService.ts
|
179727
179932
|
init_import_meta_url();
|
179728
179933
|
var PlacementsService = class {
|
@@ -179736,9 +179941,9 @@ var PlacementsService = class {
|
|
179736
179941
|
static listPlacements(deploymentId) {
|
179737
179942
|
return request(OpenAPI, {
|
179738
179943
|
method: "GET",
|
179739
|
-
url: "/deployments/{
|
179944
|
+
url: "/deployments/{deployment_id}/placements",
|
179740
179945
|
path: {
|
179741
|
-
|
179946
|
+
deployment_id: deploymentId
|
179742
179947
|
},
|
179743
179948
|
errors: {
|
179744
179949
|
400: `Unknown account`,
|
@@ -179758,9 +179963,9 @@ var PlacementsService = class {
|
|
179758
179963
|
static getPlacement(placementId) {
|
179759
179964
|
return request(OpenAPI, {
|
179760
179965
|
method: "GET",
|
179761
|
-
url: "/placements/{
|
179966
|
+
url: "/placements/{placement_id}",
|
179762
179967
|
path: {
|
179763
|
-
|
179968
|
+
placement_id: placementId
|
179764
179969
|
},
|
179765
179970
|
errors: {
|
179766
179971
|
400: `Unknown account`,
|
@@ -179781,9 +179986,9 @@ var PlacementsService = class {
|
|
179781
179986
|
static replaceDeployment(placementId, requestBody) {
|
179782
179987
|
return request(OpenAPI, {
|
179783
179988
|
method: "POST",
|
179784
|
-
url: "/placements/{
|
179989
|
+
url: "/placements/{placement_id}",
|
179785
179990
|
path: {
|
179786
|
-
|
179991
|
+
placement_id: placementId
|
179787
179992
|
},
|
179788
179993
|
body: requestBody,
|
179789
179994
|
mediaType: "application/json",
|
@@ -179798,6 +180003,9 @@ var PlacementsService = class {
|
|
179798
180003
|
};
|
179799
180004
|
__name(PlacementsService, "PlacementsService");
|
179800
180005
|
|
180006
|
+
// src/cloudchamber/client/services/SecretsService.ts
|
180007
|
+
init_import_meta_url();
|
180008
|
+
|
179801
180009
|
// src/cloudchamber/client/services/SshPublicKeysService.ts
|
179802
180010
|
init_import_meta_url();
|
179803
180011
|
var SshPublicKeysService = class {
|
@@ -179836,6 +180044,27 @@ var SshPublicKeysService = class {
|
|
179836
180044
|
}
|
179837
180045
|
});
|
179838
180046
|
}
|
180047
|
+
/**
|
180048
|
+
* Delete SSH public key from the account
|
180049
|
+
* Delete an SSH public key from an account.
|
180050
|
+
* @param sshPublicKeyName
|
180051
|
+
* @returns EmptyResponse SSH Public key was removed successfully
|
180052
|
+
* @throws ApiError
|
180053
|
+
*/
|
180054
|
+
static deleteSshPublicKey(sshPublicKeyName) {
|
180055
|
+
return request(OpenAPI, {
|
180056
|
+
method: "DELETE",
|
180057
|
+
url: "/ssh-public-keys/{sshPublicKeyName}",
|
180058
|
+
path: {
|
180059
|
+
sshPublicKeyName
|
180060
|
+
},
|
180061
|
+
errors: {
|
180062
|
+
401: `Unauthorized`,
|
180063
|
+
404: `Response body when the SSH public key that is trying to be found does not exist`,
|
180064
|
+
500: `There has been an internal error`
|
180065
|
+
}
|
180066
|
+
});
|
180067
|
+
}
|
179839
180068
|
};
|
179840
180069
|
__name(SshPublicKeysService, "SshPublicKeysService");
|
179841
180070
|
|
@@ -180280,6 +180509,35 @@ var processArgument = /* @__PURE__ */ __name(async (args, name2, promptConfig) =
|
|
180280
180509
|
|
180281
180510
|
// src/cloudchamber/cli/index.ts
|
180282
180511
|
init_import_meta_url();
|
180512
|
+
|
180513
|
+
// src/cloudchamber/cli/util.ts
|
180514
|
+
init_import_meta_url();
|
180515
|
+
function capitalize(str) {
|
180516
|
+
return str.length > 0 ? str[0].toUpperCase() + str.substring(1) : str;
|
180517
|
+
}
|
180518
|
+
__name(capitalize, "capitalize");
|
180519
|
+
function statusToColored(status2) {
|
180520
|
+
if (!status2) {
|
180521
|
+
return bgYellow("PLACING");
|
180522
|
+
}
|
180523
|
+
const mappings = {
|
180524
|
+
pending: bgYellow,
|
180525
|
+
placed: bgYellow,
|
180526
|
+
running: bgGreen,
|
180527
|
+
stopped: bgYellow,
|
180528
|
+
stopping: bgYellow,
|
180529
|
+
failed: bgRed,
|
180530
|
+
unhealthy: bgRed,
|
180531
|
+
complete: bgGreen
|
180532
|
+
};
|
180533
|
+
if (!(status2 in mappings)) {
|
180534
|
+
return bgYellow(status2);
|
180535
|
+
}
|
180536
|
+
return mappings[status2](status2.toUpperCase());
|
180537
|
+
}
|
180538
|
+
__name(statusToColored, "statusToColored");
|
180539
|
+
|
180540
|
+
// src/cloudchamber/cli/index.ts
|
180283
180541
|
function pollRegistriesUntilCondition(onRegistries) {
|
180284
180542
|
return new Promise((res, rej) => {
|
180285
180543
|
let errCount = 0;
|
@@ -180430,20 +180688,21 @@ async function waitForImagePull(deployment) {
|
|
180430
180688
|
s.stop();
|
180431
180689
|
if (err) {
|
180432
180690
|
crash(err.message);
|
180433
|
-
return;
|
180434
180691
|
}
|
180435
180692
|
if (eventPlacement.event == void 0 || eventPlacement.event.name === "ImagePullError" && eventPlacement.event.type !== "UserError") {
|
180436
180693
|
checkPlacementStatus(eventPlacement.placement);
|
180437
180694
|
return;
|
180438
180695
|
}
|
180439
180696
|
if (eventPlacement.event.name == "ImagePullError") {
|
180440
|
-
|
180441
|
-
|
180442
|
-
|
180443
|
-
|
180444
|
-
|
180445
|
-
|
180446
|
-
|
180697
|
+
if (eventPlacement.event.message.includes("404")) {
|
180698
|
+
crash(
|
180699
|
+
"Your container image couldn't be pulled, (404 not found). Did you specify the correct URL?",
|
180700
|
+
`Run ${brandColor(
|
180701
|
+
process.argv0 + " cloudchamber modify " + deployment.id
|
180702
|
+
)} to change the deployment image`
|
180703
|
+
);
|
180704
|
+
}
|
180705
|
+
crash(capitalize(eventPlacement.event.message));
|
180447
180706
|
}
|
180448
180707
|
updateStatus("Pulled your image");
|
180449
180708
|
log(
|
@@ -180473,7 +180732,6 @@ async function waitForVMToStart(deployment) {
|
|
180473
180732
|
s.stop();
|
180474
180733
|
if (err) {
|
180475
180734
|
crash(err.message);
|
180476
|
-
return;
|
180477
180735
|
}
|
180478
180736
|
if (!eventPlacement.event) {
|
180479
180737
|
checkPlacementStatus(eventPlacement.placement);
|
@@ -180524,7 +180782,6 @@ async function waitForPlacementInstance(deployment) {
|
|
180524
180782
|
}
|
180525
180783
|
if (err) {
|
180526
180784
|
crash(err.message);
|
180527
|
-
return;
|
180528
180785
|
}
|
180529
180786
|
updateStatus(
|
180530
180787
|
"Assigned placement in " + idToLocationName(deployment.location.name)
|
@@ -181359,26 +181616,6 @@ init_import_meta_url();
|
|
181359
181616
|
// src/cloudchamber/cli/deployments.ts
|
181360
181617
|
init_import_meta_url();
|
181361
181618
|
var import_process5 = require("process");
|
181362
|
-
|
181363
|
-
// src/cloudchamber/cli/util.ts
|
181364
|
-
init_import_meta_url();
|
181365
|
-
function statusToColored(status2) {
|
181366
|
-
if (!status2) {
|
181367
|
-
return bgYellow("PLACING");
|
181368
|
-
}
|
181369
|
-
const mappings = {
|
181370
|
-
placing: bgYellow,
|
181371
|
-
placed: bgYellow,
|
181372
|
-
running: bgGreen,
|
181373
|
-
stopped: bgYellow,
|
181374
|
-
stopping: bgYellow,
|
181375
|
-
failed: bgRed
|
181376
|
-
};
|
181377
|
-
return mappings[status2](status2.toUpperCase());
|
181378
|
-
}
|
181379
|
-
__name(statusToColored, "statusToColored");
|
181380
|
-
|
181381
|
-
// src/cloudchamber/cli/deployments.ts
|
181382
181619
|
function ipv6(placement) {
|
181383
181620
|
if (!placement) {
|
181384
181621
|
return yellow("no ipv6 yet");
|
@@ -181416,10 +181653,10 @@ function version2(deployment) {
|
|
181416
181653
|
__name(version2, "version");
|
181417
181654
|
function health(placement) {
|
181418
181655
|
if (!placement) {
|
181419
|
-
return statusToColored(
|
181656
|
+
return statusToColored();
|
181420
181657
|
}
|
181421
181658
|
if (!placement.status["health"]) {
|
181422
|
-
return statusToColored(
|
181659
|
+
return statusToColored();
|
181423
181660
|
}
|
181424
181661
|
return statusToColored(placement.status["health"]);
|
181425
181662
|
}
|
@@ -181842,6 +182079,7 @@ async function listCommand(deploymentArgs, config) {
|
|
181842
182079
|
__name(listCommand, "listCommand");
|
181843
182080
|
function eventMessage(event, lastEvent) {
|
181844
182081
|
let { message } = event;
|
182082
|
+
message = capitalize(message);
|
181845
182083
|
const name2 = event.name;
|
181846
182084
|
const health2 = event.statusChange["health"];
|
181847
182085
|
if (health2 === "failed") {
|
@@ -182104,6 +182342,7 @@ async function handleModifyCommand(args, config) {
|
|
182104
182342
|
location,
|
182105
182343
|
ssh_public_key_ids: keys,
|
182106
182344
|
environment_variables: selectedEnvironmentVariables,
|
182345
|
+
labels: selectedLabels,
|
182107
182346
|
vcpu: args.vcpu ?? config.cloudchamber.vcpu,
|
182108
182347
|
memory: args.memory ?? config.cloudchamber.memory
|
182109
182348
|
})
|
@@ -182317,7 +182556,7 @@ Alias for "${aliasOf}".`;
|
|
182317
182556
|
}
|
182318
182557
|
if (def.type === "command") {
|
182319
182558
|
const commandPositionalArgsSuffix = def.positionalArgs?.map((key) => {
|
182320
|
-
const { demandOption, array } = def.args[key];
|
182559
|
+
const { demandOption, array } = def.args?.[key] ?? {};
|
182321
182560
|
return demandOption ? `<${key}${array ? ".." : ""}>` : `[${key}${array ? ".." : ""}]`;
|
182322
182561
|
}).join(" ");
|
182323
182562
|
if (commandPositionalArgsSuffix) {
|
@@ -182330,14 +182569,15 @@ Alias for "${aliasOf}".`;
|
|
182330
182569
|
// cast to satisfy typescript overload selection
|
182331
182570
|
/* @__PURE__ */ __name(function builder(subYargs) {
|
182332
182571
|
if (def.type === "command") {
|
182333
|
-
|
182334
|
-
|
182572
|
+
const args = def.args ?? {};
|
182573
|
+
yargs.options(args);
|
182574
|
+
for (const [key, opt] of Object.entries(args)) {
|
182335
182575
|
if (!opt.array) {
|
182336
182576
|
yargs.check(demandSingleValue(key));
|
182337
182577
|
}
|
182338
182578
|
}
|
182339
182579
|
for (const key of def.positionalArgs ?? []) {
|
182340
|
-
yargs.positional(key,
|
182580
|
+
yargs.positional(key, args[key]);
|
182341
182581
|
}
|
182342
182582
|
} else if (def.type === "namespace") {
|
182343
182583
|
subYargs.command(subHelp);
|
@@ -182370,7 +182610,12 @@ function createHandler(def) {
|
|
182370
182610
|
}
|
182371
182611
|
await def.validateArgs?.(args);
|
182372
182612
|
await def.handler(args, {
|
182373
|
-
config: readConfig(
|
182613
|
+
config: readConfig(
|
182614
|
+
args.config,
|
182615
|
+
args,
|
182616
|
+
void 0,
|
182617
|
+
!(def.behaviour?.printConfigWarnings ?? true)
|
182618
|
+
),
|
182374
182619
|
errors: { UserError, FatalError },
|
182375
182620
|
logger,
|
182376
182621
|
fetchResult
|
@@ -189137,7 +189382,7 @@ async function mapBindings(accountId, bindings) {
|
|
189137
189382
|
...configObj.pipelines ?? [],
|
189138
189383
|
{
|
189139
189384
|
binding: binding.name,
|
189140
|
-
pipeline: binding.
|
189385
|
+
pipeline: binding.pipeline
|
189141
189386
|
}
|
189142
189387
|
];
|
189143
189388
|
break;
|
@@ -191254,7 +191499,8 @@ defineCommand({
|
|
191254
191499
|
metadata: {
|
191255
191500
|
description: "Delete workflow - when deleting a workflow, it will also delete it's own instances",
|
191256
191501
|
owner: "Product: Workflows",
|
191257
|
-
status: "open-beta"
|
191502
|
+
status: "open-beta",
|
191503
|
+
hidden: true
|
191258
191504
|
},
|
191259
191505
|
args: {
|
191260
191506
|
name: {
|
@@ -191264,12 +191510,9 @@ defineCommand({
|
|
191264
191510
|
}
|
191265
191511
|
},
|
191266
191512
|
positionalArgs: ["name"],
|
191267
|
-
async handler(args
|
191268
|
-
|
191269
|
-
|
191270
|
-
method: "DELETE"
|
191271
|
-
});
|
191272
|
-
logger.info(`Workflow "${args.name}" was successfully removed`);
|
191513
|
+
async handler(args) {
|
191514
|
+
logger.info("\u{1F6AB} delete command not yet implement");
|
191515
|
+
logger.log(`\u{1F6AB} Workflow "${args.name}" NOT removed`);
|
191273
191516
|
}
|
191274
191517
|
});
|
191275
191518
|
|
@@ -191403,7 +191646,7 @@ var validateStatus = /* @__PURE__ */ __name((status2) => {
|
|
191403
191646
|
defineCommand({
|
191404
191647
|
command: "wrangler workflows instances list",
|
191405
191648
|
metadata: {
|
191406
|
-
description: "Instance related commands (list, describe, terminate
|
191649
|
+
description: "Instance related commands (list, describe, terminate, pause, resume)",
|
191407
191650
|
owner: "Product: Workflows",
|
191408
191651
|
status: "open-beta"
|
191409
191652
|
},
|
@@ -192448,11 +192691,117 @@ defineCommand({
|
|
192448
192691
|
headers: {
|
192449
192692
|
"Content-Type": "application/json"
|
192450
192693
|
},
|
192451
|
-
body: JSON.stringify({ status: "terminate" })
|
192694
|
+
body: JSON.stringify({ status: "terminate" })
|
192695
|
+
}
|
192696
|
+
);
|
192697
|
+
logger.info(
|
192698
|
+
`\u{1F977} The instance "${id}" from ${args.name} was terminated successfully`
|
192699
|
+
);
|
192700
|
+
}
|
192701
|
+
});
|
192702
|
+
|
192703
|
+
// src/workflows/commands/instances/pause.ts
|
192704
|
+
init_import_meta_url();
|
192705
|
+
defineCommand({
|
192706
|
+
command: "wrangler workflows instances pause",
|
192707
|
+
metadata: {
|
192708
|
+
description: "Pause a workflow instance",
|
192709
|
+
owner: "Product: Workflows",
|
192710
|
+
status: "open-beta"
|
192711
|
+
},
|
192712
|
+
positionalArgs: ["name", "id"],
|
192713
|
+
args: {
|
192714
|
+
name: {
|
192715
|
+
describe: "Name of the workflow",
|
192716
|
+
type: "string",
|
192717
|
+
demandOption: true
|
192718
|
+
},
|
192719
|
+
id: {
|
192720
|
+
describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and pause it",
|
192721
|
+
type: "string",
|
192722
|
+
demandOption: true
|
192723
|
+
}
|
192724
|
+
},
|
192725
|
+
async handler(args, { config }) {
|
192726
|
+
const accountId = await requireAuth(config);
|
192727
|
+
let id = args.id;
|
192728
|
+
if (id == "latest") {
|
192729
|
+
const instances = (await fetchResult(
|
192730
|
+
`/accounts/${accountId}/workflows/${args.name}/instances`
|
192731
|
+
)).sort((a, b2) => b2.created_on.localeCompare(a.created_on));
|
192732
|
+
if (instances.length == 0) {
|
192733
|
+
logger.error(
|
192734
|
+
`There are no deployed instances in workflow "${args.name}"`
|
192735
|
+
);
|
192736
|
+
return;
|
192737
|
+
}
|
192738
|
+
id = instances[0].id;
|
192739
|
+
}
|
192740
|
+
await fetchResult(
|
192741
|
+
`/accounts/${accountId}/workflows/${args.name}/instances/${id}/status`,
|
192742
|
+
{
|
192743
|
+
method: "PATCH",
|
192744
|
+
headers: {
|
192745
|
+
"Content-Type": "application/json"
|
192746
|
+
},
|
192747
|
+
body: JSON.stringify({ status: "pause" })
|
192748
|
+
}
|
192749
|
+
);
|
192750
|
+
logger.info(
|
192751
|
+
`\u23F8\uFE0F The instance "${id}" from ${args.name} was paused successfully`
|
192752
|
+
);
|
192753
|
+
}
|
192754
|
+
});
|
192755
|
+
|
192756
|
+
// src/workflows/commands/instances/resume.ts
|
192757
|
+
init_import_meta_url();
|
192758
|
+
defineCommand({
|
192759
|
+
command: "wrangler workflows instances resume",
|
192760
|
+
metadata: {
|
192761
|
+
description: "Resume a workflow instance",
|
192762
|
+
owner: "Product: Workflows",
|
192763
|
+
status: "open-beta"
|
192764
|
+
},
|
192765
|
+
positionalArgs: ["name", "id"],
|
192766
|
+
args: {
|
192767
|
+
name: {
|
192768
|
+
describe: "Name of the workflow",
|
192769
|
+
type: "string",
|
192770
|
+
demandOption: true
|
192771
|
+
},
|
192772
|
+
id: {
|
192773
|
+
describe: "ID of the instance - instead of an UUID you can type 'latest' to get the latest instance and resume it",
|
192774
|
+
type: "string",
|
192775
|
+
demandOption: true
|
192776
|
+
}
|
192777
|
+
},
|
192778
|
+
async handler(args, { config }) {
|
192779
|
+
const accountId = await requireAuth(config);
|
192780
|
+
let id = args.id;
|
192781
|
+
if (id == "latest") {
|
192782
|
+
const instances = (await fetchResult(
|
192783
|
+
`/accounts/${accountId}/workflows/${args.name}/instances`
|
192784
|
+
)).sort((a, b2) => b2.created_on.localeCompare(a.created_on));
|
192785
|
+
if (instances.length == 0) {
|
192786
|
+
logger.error(
|
192787
|
+
`There are no deployed instances in workflow "${args.name}"`
|
192788
|
+
);
|
192789
|
+
return;
|
192790
|
+
}
|
192791
|
+
id = instances[0].id;
|
192792
|
+
}
|
192793
|
+
await fetchResult(
|
192794
|
+
`/accounts/${accountId}/workflows/${args.name}/instances/${id}/status`,
|
192795
|
+
{
|
192796
|
+
method: "PATCH",
|
192797
|
+
headers: {
|
192798
|
+
"Content-Type": "application/json"
|
192799
|
+
},
|
192800
|
+
body: JSON.stringify({ status: "resume" })
|
192452
192801
|
}
|
192453
192802
|
);
|
192454
192803
|
logger.info(
|
192455
|
-
`\u{
|
192804
|
+
`\u{1F504} The instance "${id}" from ${args.name} was resumed successfully`
|
192456
192805
|
);
|
192457
192806
|
}
|
192458
192807
|
});
|
@@ -192475,6 +192824,243 @@ defineNamespace({
|
|
192475
192824
|
}
|
192476
192825
|
});
|
192477
192826
|
|
192827
|
+
// src/user/commands.ts
|
192828
|
+
init_import_meta_url();
|
192829
|
+
|
192830
|
+
// src/user/whoami.ts
|
192831
|
+
init_import_meta_url();
|
192832
|
+
|
192833
|
+
// src/user/membership.ts
|
192834
|
+
init_import_meta_url();
|
192835
|
+
async function fetchMembershipRoles(accountTag) {
|
192836
|
+
const allMemberships = await fetchPagedListResult("/memberships");
|
192837
|
+
const membership = allMemberships.find((m2) => m2.account.id === accountTag);
|
192838
|
+
return membership?.roles;
|
192839
|
+
}
|
192840
|
+
__name(fetchMembershipRoles, "fetchMembershipRoles");
|
192841
|
+
|
192842
|
+
// src/user/whoami.ts
|
192843
|
+
async function whoami(accountFilter) {
|
192844
|
+
logger.log("Getting User settings...");
|
192845
|
+
const user = await getUserInfo();
|
192846
|
+
if (!user) {
|
192847
|
+
return void logger.log(
|
192848
|
+
"You are not authenticated. Please run `wrangler login`."
|
192849
|
+
);
|
192850
|
+
}
|
192851
|
+
if (user.authType === "API Token") {
|
192852
|
+
logger.log(
|
192853
|
+
"\u2139\uFE0F The API Token is read from the CLOUDFLARE_API_TOKEN in your environment."
|
192854
|
+
);
|
192855
|
+
}
|
192856
|
+
await printUserEmail(user);
|
192857
|
+
await printAccountList(user);
|
192858
|
+
await printTokenPermissions(user);
|
192859
|
+
await printMembershipInfo(user, accountFilter);
|
192860
|
+
}
|
192861
|
+
__name(whoami, "whoami");
|
192862
|
+
function printUserEmail(user) {
|
192863
|
+
if (!user.email) {
|
192864
|
+
return void logger.log(
|
192865
|
+
`\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?`
|
192866
|
+
);
|
192867
|
+
}
|
192868
|
+
logger.log(
|
192869
|
+
`\u{1F44B} You are logged in with an ${user.authType}, associated with the email ${source_default.blue(user.email)}.`
|
192870
|
+
);
|
192871
|
+
}
|
192872
|
+
__name(printUserEmail, "printUserEmail");
|
192873
|
+
function printAccountList(user) {
|
192874
|
+
logger.table(
|
192875
|
+
user.accounts.map((account) => ({
|
192876
|
+
"Account Name": account.name,
|
192877
|
+
"Account ID": account.id
|
192878
|
+
}))
|
192879
|
+
);
|
192880
|
+
}
|
192881
|
+
__name(printAccountList, "printAccountList");
|
192882
|
+
function printTokenPermissions(user) {
|
192883
|
+
const permissions = user.tokenPermissions?.map((scope) => scope.split(":")) ?? [];
|
192884
|
+
if (user.authType !== "OAuth Token") {
|
192885
|
+
return void logger.log(
|
192886
|
+
`\u{1F513} To see token permissions visit https://dash.cloudflare.com/profile/api-tokens.`
|
192887
|
+
);
|
192888
|
+
}
|
192889
|
+
logger.log(
|
192890
|
+
`\u{1F513} Token Permissions: If scopes are missing, you may need to logout and re-login.`
|
192891
|
+
);
|
192892
|
+
logger.log(`Scope (Access)`);
|
192893
|
+
for (const [scope, access3] of permissions) {
|
192894
|
+
logger.log(`- ${scope} ${access3 ? `(${access3})` : ``}`);
|
192895
|
+
}
|
192896
|
+
}
|
192897
|
+
__name(printTokenPermissions, "printTokenPermissions");
|
192898
|
+
async function printMembershipInfo(user, accountFilter) {
|
192899
|
+
try {
|
192900
|
+
if (!accountFilter) {
|
192901
|
+
return;
|
192902
|
+
}
|
192903
|
+
const eq = /* @__PURE__ */ __name((a, b2) => a.localeCompare(b2, void 0, { sensitivity: "base" }) == 0, "eq");
|
192904
|
+
const selectedAccount = user.accounts.find(
|
192905
|
+
(a) => eq(a.id, accountFilter) || eq(a.name, accountFilter)
|
192906
|
+
);
|
192907
|
+
if (!selectedAccount) {
|
192908
|
+
return;
|
192909
|
+
}
|
192910
|
+
const membershipRoles = await fetchMembershipRoles(selectedAccount.id);
|
192911
|
+
if (!membershipRoles) {
|
192912
|
+
return;
|
192913
|
+
}
|
192914
|
+
logger.log(
|
192915
|
+
`\u{1F3A2} Membership roles in "${selectedAccount.name}": Contact account super admin to change your permissions.`
|
192916
|
+
);
|
192917
|
+
for (const role of membershipRoles) {
|
192918
|
+
logger.log(`- ${role}`);
|
192919
|
+
}
|
192920
|
+
} catch (e4) {
|
192921
|
+
if (isAuthenticationError(e4)) {
|
192922
|
+
logger.log(
|
192923
|
+
`\u{1F3A2} Unable to get membership roles. Make sure you have permissions to read the account.`
|
192924
|
+
);
|
192925
|
+
return;
|
192926
|
+
} else {
|
192927
|
+
throw e4;
|
192928
|
+
}
|
192929
|
+
}
|
192930
|
+
}
|
192931
|
+
__name(printMembershipInfo, "printMembershipInfo");
|
192932
|
+
async function getUserInfo() {
|
192933
|
+
const apiToken = getAPIToken();
|
192934
|
+
if (!apiToken) {
|
192935
|
+
return;
|
192936
|
+
}
|
192937
|
+
const tokenPermissions = await getTokenPermissions();
|
192938
|
+
const usingEnvAuth = !!getAuthFromEnv();
|
192939
|
+
const usingGlobalAuthKey = "authKey" in apiToken;
|
192940
|
+
return {
|
192941
|
+
apiToken: usingGlobalAuthKey ? apiToken.authKey : apiToken.apiToken,
|
192942
|
+
authType: usingGlobalAuthKey ? "Global API Key" : usingEnvAuth ? "API Token" : "OAuth Token",
|
192943
|
+
email: "authEmail" in apiToken ? apiToken.authEmail : await getEmail(),
|
192944
|
+
accounts: await getAccounts(),
|
192945
|
+
tokenPermissions
|
192946
|
+
};
|
192947
|
+
}
|
192948
|
+
__name(getUserInfo, "getUserInfo");
|
192949
|
+
async function getEmail() {
|
192950
|
+
try {
|
192951
|
+
const { email } = await fetchResult("/user");
|
192952
|
+
return email;
|
192953
|
+
} catch (e4) {
|
192954
|
+
const unauthorizedAccess = 9109;
|
192955
|
+
if (e4.code === unauthorizedAccess) {
|
192956
|
+
return void 0;
|
192957
|
+
} else {
|
192958
|
+
throw e4;
|
192959
|
+
}
|
192960
|
+
}
|
192961
|
+
}
|
192962
|
+
__name(getEmail, "getEmail");
|
192963
|
+
async function getAccounts() {
|
192964
|
+
return await fetchPagedListResult("/accounts");
|
192965
|
+
}
|
192966
|
+
__name(getAccounts, "getAccounts");
|
192967
|
+
async function getTokenPermissions() {
|
192968
|
+
return getScopes();
|
192969
|
+
}
|
192970
|
+
__name(getTokenPermissions, "getTokenPermissions");
|
192971
|
+
|
192972
|
+
// src/user/commands.ts
|
192973
|
+
defineCommand({
|
192974
|
+
command: "wrangler login",
|
192975
|
+
metadata: {
|
192976
|
+
description: "\u{1F513} Login to Cloudflare",
|
192977
|
+
owner: "Workers: Authoring and Testing",
|
192978
|
+
status: "stable"
|
192979
|
+
},
|
192980
|
+
behaviour: {
|
192981
|
+
printConfigWarnings: false
|
192982
|
+
},
|
192983
|
+
args: {
|
192984
|
+
"scopes-list": {
|
192985
|
+
describe: "List all the available OAuth scopes with descriptions"
|
192986
|
+
},
|
192987
|
+
browser: {
|
192988
|
+
default: true,
|
192989
|
+
type: "boolean",
|
192990
|
+
describe: "Automatically open the OAuth link in a browser"
|
192991
|
+
},
|
192992
|
+
scopes: {
|
192993
|
+
describe: "Pick the set of applicable OAuth scopes when logging in",
|
192994
|
+
array: true,
|
192995
|
+
type: "string",
|
192996
|
+
requiresArg: true
|
192997
|
+
}
|
192998
|
+
},
|
192999
|
+
async handler(args, { config }) {
|
193000
|
+
if (args.scopesList) {
|
193001
|
+
listScopes();
|
193002
|
+
return;
|
193003
|
+
}
|
193004
|
+
if (args.scopes) {
|
193005
|
+
if (args.scopes.length === 0) {
|
193006
|
+
listScopes();
|
193007
|
+
return;
|
193008
|
+
}
|
193009
|
+
if (!validateScopeKeys(args.scopes)) {
|
193010
|
+
throw new CommandLineArgsError(
|
193011
|
+
`One of ${args.scopes} is not a valid authentication scope. Run "wrangler login --scopes-list" to see the valid scopes.`
|
193012
|
+
);
|
193013
|
+
}
|
193014
|
+
await login({ scopes: args.scopes, browser: args.browser });
|
193015
|
+
return;
|
193016
|
+
}
|
193017
|
+
await login({ browser: args.browser });
|
193018
|
+
await sendMetricsEvent("login user", {
|
193019
|
+
sendMetrics: config.send_metrics
|
193020
|
+
});
|
193021
|
+
}
|
193022
|
+
});
|
193023
|
+
defineCommand({
|
193024
|
+
command: "wrangler logout",
|
193025
|
+
metadata: {
|
193026
|
+
description: "\u{1F6AA} Logout from Cloudflare",
|
193027
|
+
owner: "Workers: Authoring and Testing",
|
193028
|
+
status: "stable"
|
193029
|
+
},
|
193030
|
+
behaviour: {
|
193031
|
+
printConfigWarnings: false
|
193032
|
+
},
|
193033
|
+
async handler(_3, { config }) {
|
193034
|
+
await logout();
|
193035
|
+
await sendMetricsEvent("logout user", {
|
193036
|
+
sendMetrics: config.send_metrics
|
193037
|
+
});
|
193038
|
+
}
|
193039
|
+
});
|
193040
|
+
defineCommand({
|
193041
|
+
command: "wrangler whoami",
|
193042
|
+
metadata: {
|
193043
|
+
description: "\u{1F575}\uFE0F Retrieve your user information",
|
193044
|
+
owner: "Workers: Authoring and Testing",
|
193045
|
+
status: "stable"
|
193046
|
+
},
|
193047
|
+
behaviour: {
|
193048
|
+
printConfigWarnings: false
|
193049
|
+
},
|
193050
|
+
args: {
|
193051
|
+
account: {
|
193052
|
+
type: "string",
|
193053
|
+
describe: "Show membership information for the given account (id or name)."
|
193054
|
+
}
|
193055
|
+
},
|
193056
|
+
async handler(args, { config }) {
|
193057
|
+
await whoami(args.account);
|
193058
|
+
await sendMetricsEvent("view accounts", {
|
193059
|
+
sendMetrics: config.send_metrics
|
193060
|
+
});
|
193061
|
+
}
|
193062
|
+
});
|
193063
|
+
|
192478
193064
|
// src/mtls-certificate/cli.ts
|
192479
193065
|
init_import_meta_url();
|
192480
193066
|
|
@@ -192826,7 +193412,7 @@ function buildWorkerFromFunctions({
|
|
192826
193412
|
additionalModules: [],
|
192827
193413
|
moduleCollector,
|
192828
193414
|
inject: [routesModule],
|
192829
|
-
...outdir ? { entryName: "index" } : {},
|
193415
|
+
...outdir ? { entryName: "index" } : { entryName: void 0 },
|
192830
193416
|
minify,
|
192831
193417
|
sourcemap,
|
192832
193418
|
watch: watch9,
|
@@ -192849,7 +193435,13 @@ function buildWorkerFromFunctions({
|
|
192849
193435
|
targetConsumer: local ? "dev" : "deploy",
|
192850
193436
|
local,
|
192851
193437
|
projectRoot: getPagesProjectRoot(),
|
192852
|
-
defineNavigatorUserAgent
|
193438
|
+
defineNavigatorUserAgent,
|
193439
|
+
legacyAssets: void 0,
|
193440
|
+
bypassAssetCache: void 0,
|
193441
|
+
jsxFactory: void 0,
|
193442
|
+
jsxFragment: void 0,
|
193443
|
+
tsconfig: void 0,
|
193444
|
+
testScheduled: void 0
|
192853
193445
|
});
|
192854
193446
|
}
|
192855
193447
|
__name(buildWorkerFromFunctions, "buildWorkerFromFunctions");
|
@@ -192923,7 +193515,15 @@ function buildRawWorker({
|
|
192923
193515
|
targetConsumer: local ? "dev" : "deploy",
|
192924
193516
|
local,
|
192925
193517
|
projectRoot: getPagesProjectRoot(),
|
192926
|
-
defineNavigatorUserAgent
|
193518
|
+
defineNavigatorUserAgent,
|
193519
|
+
legacyAssets: void 0,
|
193520
|
+
bypassAssetCache: void 0,
|
193521
|
+
jsxFactory: void 0,
|
193522
|
+
jsxFragment: void 0,
|
193523
|
+
tsconfig: void 0,
|
193524
|
+
testScheduled: void 0,
|
193525
|
+
entryName: void 0,
|
193526
|
+
inject: void 0
|
192927
193527
|
});
|
192928
193528
|
}
|
192929
193529
|
__name(buildRawWorker, "buildRawWorker");
|
@@ -193211,7 +193811,14 @@ function buildPluginFromFunctions({
|
|
193211
193811
|
targetConsumer: local ? "dev" : "deploy",
|
193212
193812
|
local,
|
193213
193813
|
projectRoot: getPagesProjectRoot(),
|
193214
|
-
defineNavigatorUserAgent
|
193814
|
+
defineNavigatorUserAgent,
|
193815
|
+
legacyAssets: void 0,
|
193816
|
+
bypassAssetCache: void 0,
|
193817
|
+
jsxFactory: void 0,
|
193818
|
+
jsxFragment: void 0,
|
193819
|
+
tsconfig: void 0,
|
193820
|
+
testScheduled: void 0,
|
193821
|
+
isOutfile: void 0
|
193215
193822
|
});
|
193216
193823
|
}
|
193217
193824
|
__name(buildPluginFromFunctions, "buildPluginFromFunctions");
|
@@ -199027,9 +199634,9 @@ function eventNotificationHeaders(apiCredentials, jurisdiction) {
|
|
199027
199634
|
return headers;
|
199028
199635
|
}
|
199029
199636
|
__name(eventNotificationHeaders, "eventNotificationHeaders");
|
199030
|
-
|
199031
|
-
const
|
199032
|
-
|
199637
|
+
function tableFromNotificationGetResponse(response) {
|
199638
|
+
const rows = [];
|
199639
|
+
for (const entry of response.queues) {
|
199033
199640
|
for (const {
|
199034
199641
|
prefix = "",
|
199035
199642
|
suffix = "",
|
@@ -199046,14 +199653,8 @@ async function tableFromNotificationGetResponse(config, response) {
|
|
199046
199653
|
event_type: actions.join(",")
|
199047
199654
|
});
|
199048
199655
|
}
|
199049
|
-
return rows;
|
199050
|
-
}, "reducer");
|
199051
|
-
let tableOutput = [];
|
199052
|
-
for (const entry of response.queues) {
|
199053
|
-
const result = await reducer(entry);
|
199054
|
-
tableOutput = tableOutput.concat(...result);
|
199055
199656
|
}
|
199056
|
-
return
|
199657
|
+
return rows;
|
199057
199658
|
}
|
199058
199659
|
__name(tableFromNotificationGetResponse, "tableFromNotificationGetResponse");
|
199059
199660
|
async function listEventNotificationConfig(apiCredentials, accountId, bucketName, jurisdiction) {
|
@@ -199141,6 +199742,85 @@ async function deleteEventNotificationConfig(config, apiCredentials, accountId,
|
|
199141
199742
|
}
|
199142
199743
|
}
|
199143
199744
|
__name(deleteEventNotificationConfig, "deleteEventNotificationConfig");
|
199745
|
+
async function attachCustomDomainToBucket(accountId, bucketName, config, jurisdiction) {
|
199746
|
+
const headers = {
|
199747
|
+
"Content-Type": "application/json"
|
199748
|
+
};
|
199749
|
+
if (jurisdiction) {
|
199750
|
+
headers["cf-r2-jurisdiction"] = jurisdiction;
|
199751
|
+
}
|
199752
|
+
await fetchResult(
|
199753
|
+
`/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom`,
|
199754
|
+
{
|
199755
|
+
method: "POST",
|
199756
|
+
headers,
|
199757
|
+
body: JSON.stringify({
|
199758
|
+
...config,
|
199759
|
+
enabled: true
|
199760
|
+
})
|
199761
|
+
}
|
199762
|
+
);
|
199763
|
+
}
|
199764
|
+
__name(attachCustomDomainToBucket, "attachCustomDomainToBucket");
|
199765
|
+
async function removeCustomDomainFromBucket(accountId, bucketName, domainName, jurisdiction) {
|
199766
|
+
const headers = {};
|
199767
|
+
if (jurisdiction) {
|
199768
|
+
headers["cf-r2-jurisdiction"] = jurisdiction;
|
199769
|
+
}
|
199770
|
+
await fetchResult(
|
199771
|
+
`/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`,
|
199772
|
+
{
|
199773
|
+
method: "DELETE",
|
199774
|
+
headers
|
199775
|
+
}
|
199776
|
+
);
|
199777
|
+
}
|
199778
|
+
__name(removeCustomDomainFromBucket, "removeCustomDomainFromBucket");
|
199779
|
+
function tableFromCustomDomainListResponse(domains) {
|
199780
|
+
const rows = [];
|
199781
|
+
for (const domainInfo of domains) {
|
199782
|
+
rows.push({
|
199783
|
+
domain: domainInfo.domain,
|
199784
|
+
enabled: domainInfo.enabled ? "Yes" : "No",
|
199785
|
+
ownership_status: domainInfo.status.ownership || "(unknown)",
|
199786
|
+
ssl_status: domainInfo.status.ssl || "(unknown)",
|
199787
|
+
min_tls_version: domainInfo.minTLS || "1.0",
|
199788
|
+
zone_id: domainInfo.zoneId || "(none)",
|
199789
|
+
zone_name: domainInfo.zoneName || "(none)"
|
199790
|
+
});
|
199791
|
+
}
|
199792
|
+
return rows;
|
199793
|
+
}
|
199794
|
+
__name(tableFromCustomDomainListResponse, "tableFromCustomDomainListResponse");
|
199795
|
+
async function listCustomDomainsOfBucket(accountId, bucketName, jurisdiction) {
|
199796
|
+
const headers = {};
|
199797
|
+
if (jurisdiction) {
|
199798
|
+
headers["cf-r2-jurisdiction"] = jurisdiction;
|
199799
|
+
}
|
199800
|
+
const result = await fetchResult(`/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom`, {
|
199801
|
+
method: "GET",
|
199802
|
+
headers
|
199803
|
+
});
|
199804
|
+
return result.domains;
|
199805
|
+
}
|
199806
|
+
__name(listCustomDomainsOfBucket, "listCustomDomainsOfBucket");
|
199807
|
+
async function configureCustomDomainSettings(accountId, bucketName, domainName, config, jurisdiction) {
|
199808
|
+
const headers = {
|
199809
|
+
"Content-Type": "application/json"
|
199810
|
+
};
|
199811
|
+
if (jurisdiction) {
|
199812
|
+
headers["cf-r2-jurisdiction"] = jurisdiction;
|
199813
|
+
}
|
199814
|
+
await fetchResult(
|
199815
|
+
`/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`,
|
199816
|
+
{
|
199817
|
+
method: "PUT",
|
199818
|
+
headers,
|
199819
|
+
body: JSON.stringify(config)
|
199820
|
+
}
|
199821
|
+
);
|
199822
|
+
}
|
199823
|
+
__name(configureCustomDomainSettings, "configureCustomDomainSettings");
|
199144
199824
|
function isValidR2BucketName(name2) {
|
199145
199825
|
return typeof name2 === "string" && /^[a-zA-Z][a-zA-Z0-9-]*$/.test(name2);
|
199146
199826
|
}
|
@@ -199200,11 +199880,11 @@ async function Handler16(args) {
|
|
199200
199880
|
}
|
199201
199881
|
__name(Handler16, "Handler");
|
199202
199882
|
|
199203
|
-
// src/r2/
|
199883
|
+
// src/r2/domain.ts
|
199204
199884
|
init_import_meta_url();
|
199205
199885
|
function ListOptions5(yargs) {
|
199206
199886
|
return yargs.positional("bucket", {
|
199207
|
-
describe: "The name of the R2 bucket
|
199887
|
+
describe: "The name of the R2 bucket whose connected custom domains will be listed",
|
199208
199888
|
type: "string",
|
199209
199889
|
demandOption: true
|
199210
199890
|
}).option("jurisdiction", {
|
@@ -199216,6 +199896,180 @@ function ListOptions5(yargs) {
|
|
199216
199896
|
}
|
199217
199897
|
__name(ListOptions5, "ListOptions");
|
199218
199898
|
async function ListHandler5(args) {
|
199899
|
+
await printWranglerBanner();
|
199900
|
+
const config = readConfig(args.config, args);
|
199901
|
+
const accountId = await requireAuth(config);
|
199902
|
+
const { bucket, jurisdiction } = args;
|
199903
|
+
logger.log(`Listing custom domains connected to bucket '${bucket}'...`);
|
199904
|
+
const domains = await listCustomDomainsOfBucket(
|
199905
|
+
accountId,
|
199906
|
+
bucket,
|
199907
|
+
jurisdiction
|
199908
|
+
);
|
199909
|
+
if (domains.length === 0) {
|
199910
|
+
logger.log("There are no custom domains connected to this bucket.");
|
199911
|
+
} else {
|
199912
|
+
const tableOutput = tableFromCustomDomainListResponse(domains);
|
199913
|
+
logger.log(tableOutput.map((x2) => formatLabelledValues(x2)).join("\n\n"));
|
199914
|
+
}
|
199915
|
+
}
|
199916
|
+
__name(ListHandler5, "ListHandler");
|
199917
|
+
function AddOptions(yargs) {
|
199918
|
+
return yargs.positional("bucket", {
|
199919
|
+
describe: "The name of the R2 bucket to connect a custom domain to",
|
199920
|
+
type: "string",
|
199921
|
+
demandOption: true
|
199922
|
+
}).option("domain", {
|
199923
|
+
describe: "The custom domain to connect to the R2 bucket",
|
199924
|
+
type: "string",
|
199925
|
+
demandOption: true
|
199926
|
+
}).option("zone-id", {
|
199927
|
+
describe: "The zone ID associated with the custom domain",
|
199928
|
+
type: "string",
|
199929
|
+
demandOption: true
|
199930
|
+
}).option("min-tls", {
|
199931
|
+
describe: "Set the minimum TLS version for the custom domain (defaults to 1.0 if not set)",
|
199932
|
+
choices: ["1.0", "1.1", "1.2", "1.3"],
|
199933
|
+
type: "string"
|
199934
|
+
}).option("jurisdiction", {
|
199935
|
+
describe: "The jurisdiction where the bucket exists",
|
199936
|
+
alias: "J",
|
199937
|
+
requiresArg: true,
|
199938
|
+
type: "string"
|
199939
|
+
}).option("force", {
|
199940
|
+
describe: "Skip confirmation",
|
199941
|
+
type: "boolean",
|
199942
|
+
alias: "y",
|
199943
|
+
default: false
|
199944
|
+
});
|
199945
|
+
}
|
199946
|
+
__name(AddOptions, "AddOptions");
|
199947
|
+
async function AddHandler(args) {
|
199948
|
+
await printWranglerBanner();
|
199949
|
+
const config = readConfig(args.config, args);
|
199950
|
+
const accountId = await requireAuth(config);
|
199951
|
+
const { bucket, domain: domain2, zoneId, minTls = "1.0", jurisdiction, force } = args;
|
199952
|
+
if (!force) {
|
199953
|
+
const confirmedAdd = await confirm(
|
199954
|
+
`Are you sure you want to add the custom domain '${domain2}' to bucket '${bucket}'? The contents of your bucket will be made publicly available at 'https://${domain2}'`
|
199955
|
+
);
|
199956
|
+
if (!confirmedAdd) {
|
199957
|
+
logger.log("Add cancelled.");
|
199958
|
+
return;
|
199959
|
+
}
|
199960
|
+
}
|
199961
|
+
logger.log(`Connecting custom domain '${domain2}' to bucket '${bucket}'...`);
|
199962
|
+
await attachCustomDomainToBucket(
|
199963
|
+
accountId,
|
199964
|
+
bucket,
|
199965
|
+
{
|
199966
|
+
domain: domain2,
|
199967
|
+
zoneId,
|
199968
|
+
minTLS: minTls
|
199969
|
+
},
|
199970
|
+
jurisdiction
|
199971
|
+
);
|
199972
|
+
logger.log(`\u2728 Custom domain '${domain2}' connected successfully.`);
|
199973
|
+
}
|
199974
|
+
__name(AddHandler, "AddHandler");
|
199975
|
+
function RemoveOptions(yargs) {
|
199976
|
+
return yargs.positional("bucket", {
|
199977
|
+
describe: "The name of the R2 bucket to remove the custom domain from",
|
199978
|
+
type: "string",
|
199979
|
+
demandOption: true
|
199980
|
+
}).option("domain", {
|
199981
|
+
describe: "The custom domain to remove from the R2 bucket",
|
199982
|
+
type: "string",
|
199983
|
+
demandOption: true
|
199984
|
+
}).option("jurisdiction", {
|
199985
|
+
describe: "The jurisdiction where the bucket exists",
|
199986
|
+
alias: "J",
|
199987
|
+
requiresArg: true,
|
199988
|
+
type: "string"
|
199989
|
+
}).option("force", {
|
199990
|
+
describe: "Skip confirmation",
|
199991
|
+
type: "boolean",
|
199992
|
+
alias: "y",
|
199993
|
+
default: false
|
199994
|
+
});
|
199995
|
+
}
|
199996
|
+
__name(RemoveOptions, "RemoveOptions");
|
199997
|
+
async function RemoveHandler(args) {
|
199998
|
+
await printWranglerBanner();
|
199999
|
+
const config = readConfig(args.config, args);
|
200000
|
+
const accountId = await requireAuth(config);
|
200001
|
+
const { bucket, domain: domain2, jurisdiction, force } = args;
|
200002
|
+
if (!force) {
|
200003
|
+
const confirmedRemoval = await confirm(
|
200004
|
+
`Are you sure you want to remove the custom domain '${domain2}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain2}'`
|
200005
|
+
);
|
200006
|
+
if (!confirmedRemoval) {
|
200007
|
+
logger.log("Removal cancelled.");
|
200008
|
+
return;
|
200009
|
+
}
|
200010
|
+
}
|
200011
|
+
logger.log(`Removing custom domain '${domain2}' from bucket '${bucket}'...`);
|
200012
|
+
await removeCustomDomainFromBucket(accountId, bucket, domain2, jurisdiction);
|
200013
|
+
logger.log(`Custom domain '${domain2}' removed successfully.`);
|
200014
|
+
}
|
200015
|
+
__name(RemoveHandler, "RemoveHandler");
|
200016
|
+
function UpdateOptions(yargs) {
|
200017
|
+
return yargs.positional("bucket", {
|
200018
|
+
describe: "The name of the R2 bucket associated with the custom domain to update",
|
200019
|
+
type: "string",
|
200020
|
+
demandOption: true
|
200021
|
+
}).option("domain", {
|
200022
|
+
describe: "The custom domain whose settings will be updated",
|
200023
|
+
type: "string",
|
200024
|
+
demandOption: true
|
200025
|
+
}).option("min-tls", {
|
200026
|
+
describe: "Update the minimum TLS version for the custom domain",
|
200027
|
+
choices: ["1.0", "1.1", "1.2", "1.3"],
|
200028
|
+
type: "string"
|
200029
|
+
}).option("jurisdiction", {
|
200030
|
+
describe: "The jurisdiction where the bucket exists",
|
200031
|
+
alias: "J",
|
200032
|
+
requiresArg: true,
|
200033
|
+
type: "string"
|
200034
|
+
});
|
200035
|
+
}
|
200036
|
+
__name(UpdateOptions, "UpdateOptions");
|
200037
|
+
async function UpdateHandler(args) {
|
200038
|
+
await printWranglerBanner();
|
200039
|
+
const config = readConfig(args.config, args);
|
200040
|
+
const accountId = await requireAuth(config);
|
200041
|
+
const { bucket, domain: domain2, minTls, jurisdiction } = args;
|
200042
|
+
logger.log(`Updating custom domain '${domain2}' for bucket '${bucket}'...`);
|
200043
|
+
await configureCustomDomainSettings(
|
200044
|
+
accountId,
|
200045
|
+
bucket,
|
200046
|
+
domain2,
|
200047
|
+
{
|
200048
|
+
domain: domain2,
|
200049
|
+
minTLS: minTls
|
200050
|
+
},
|
200051
|
+
jurisdiction
|
200052
|
+
);
|
200053
|
+
logger.log(`\u2728 Custom domain '${domain2}' updated successfully.`);
|
200054
|
+
}
|
200055
|
+
__name(UpdateHandler, "UpdateHandler");
|
200056
|
+
|
200057
|
+
// src/r2/notification.ts
|
200058
|
+
init_import_meta_url();
|
200059
|
+
function ListOptions6(yargs) {
|
200060
|
+
return yargs.positional("bucket", {
|
200061
|
+
describe: "The name of the R2 bucket to get event notification rules for",
|
200062
|
+
type: "string",
|
200063
|
+
demandOption: true
|
200064
|
+
}).option("jurisdiction", {
|
200065
|
+
describe: "The jurisdiction where the bucket exists",
|
200066
|
+
alias: "J",
|
200067
|
+
requiresArg: true,
|
200068
|
+
type: "string"
|
200069
|
+
});
|
200070
|
+
}
|
200071
|
+
__name(ListOptions6, "ListOptions");
|
200072
|
+
async function ListHandler6(args) {
|
199219
200073
|
await printWranglerBanner();
|
199220
200074
|
if (args._[3] === "get") {
|
199221
200075
|
logger.warn(
|
@@ -199232,10 +200086,10 @@ async function ListHandler5(args) {
|
|
199232
200086
|
bucket,
|
199233
200087
|
jurisdiction
|
199234
200088
|
);
|
199235
|
-
const tableOutput =
|
200089
|
+
const tableOutput = tableFromNotificationGetResponse(resp);
|
199236
200090
|
logger.log(tableOutput.map((x2) => formatLabelledValues(x2)).join("\n\n"));
|
199237
200091
|
}
|
199238
|
-
__name(
|
200092
|
+
__name(ListHandler6, "ListHandler");
|
199239
200093
|
function CreateOptions4(yargs) {
|
199240
200094
|
return yargs.positional("bucket", {
|
199241
200095
|
describe: "The name of the R2 bucket to create an event notification rule for",
|
@@ -200070,8 +200924,8 @@ ${key} is ${prettyBytes(objectSize, {
|
|
200070
200924
|
return r2EvNotifyYargs.command(
|
200071
200925
|
["list <bucket>", "get <bucket>"],
|
200072
200926
|
"List event notification rules for a bucket",
|
200073
|
-
|
200074
|
-
|
200927
|
+
ListOptions6,
|
200928
|
+
ListHandler6
|
200075
200929
|
).command(
|
200076
200930
|
"create <bucket>",
|
200077
200931
|
"Create an event notification rule for an R2 bucket",
|
@@ -200085,6 +200939,33 @@ ${key} is ${prettyBytes(objectSize, {
|
|
200085
200939
|
);
|
200086
200940
|
}
|
200087
200941
|
);
|
200942
|
+
r2BucketYargs.command(
|
200943
|
+
"domain",
|
200944
|
+
"Manage custom domains for an R2 bucket",
|
200945
|
+
(domainYargs) => {
|
200946
|
+
return domainYargs.command(
|
200947
|
+
"list <bucket>",
|
200948
|
+
"List custom domains for an R2 bucket",
|
200949
|
+
ListOptions5,
|
200950
|
+
ListHandler5
|
200951
|
+
).command(
|
200952
|
+
"add <bucket>",
|
200953
|
+
"Connect a custom domain to an R2 bucket",
|
200954
|
+
AddOptions,
|
200955
|
+
AddHandler
|
200956
|
+
).command(
|
200957
|
+
"remove <bucket>",
|
200958
|
+
"Remove a custom domain from an R2 bucket",
|
200959
|
+
RemoveOptions,
|
200960
|
+
RemoveHandler
|
200961
|
+
).command(
|
200962
|
+
"update <bucket>",
|
200963
|
+
"Update settings for a custom domain connected to an R2 bucket",
|
200964
|
+
UpdateOptions,
|
200965
|
+
UpdateHandler
|
200966
|
+
);
|
200967
|
+
}
|
200968
|
+
);
|
200088
200969
|
return r2BucketYargs;
|
200089
200970
|
});
|
200090
200971
|
}
|
@@ -200269,7 +201150,6 @@ var secret2 = /* @__PURE__ */ __name((secretYargs) => {
|
|
200269
201150
|
"delete <key>",
|
200270
201151
|
"Delete a secret variable from a Worker",
|
200271
201152
|
async (yargs) => {
|
200272
|
-
await printWranglerBanner();
|
200273
201153
|
return yargs.positional("key", {
|
200274
201154
|
describe: "The variable name to be accessible in the Worker",
|
200275
201155
|
type: "string"
|
@@ -200280,6 +201160,7 @@ var secret2 = /* @__PURE__ */ __name((secretYargs) => {
|
|
200280
201160
|
});
|
200281
201161
|
},
|
200282
201162
|
async (args) => {
|
201163
|
+
await printWranglerBanner();
|
200283
201164
|
const config = readConfig(args.config, args);
|
200284
201165
|
if (config.pages_build_output_dir) {
|
200285
201166
|
throw new UserError(
|
@@ -207329,7 +208210,7 @@ __name(wrapResolver, "wrapResolver");
|
|
207329
208210
|
// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/client.js
|
207330
208211
|
init_import_meta_url();
|
207331
208212
|
var os9 = __toESM(require("os"));
|
207332
|
-
var
|
208213
|
+
var import_util7 = require("util");
|
207333
208214
|
var NodeClient = class extends ServerRuntimeClient {
|
207334
208215
|
/**
|
207335
208216
|
* Creates a new Node SDK instance.
|
@@ -207348,7 +208229,7 @@ var NodeClient = class extends ServerRuntimeClient {
|
|
207348
208229
|
version: SDK_VERSION
|
207349
208230
|
};
|
207350
208231
|
options29.transportOptions = {
|
207351
|
-
textEncoder: new
|
208232
|
+
textEncoder: new import_util7.TextEncoder(),
|
207352
208233
|
...options29.transportOptions
|
207353
208234
|
};
|
207354
208235
|
const clientOptions = {
|
@@ -208402,9 +209283,9 @@ var import_child_process2 = require("child_process");
|
|
208402
209283
|
var import_fs13 = require("fs");
|
208403
209284
|
var os10 = __toESM(require("os"));
|
208404
209285
|
var import_path18 = require("path");
|
208405
|
-
var
|
208406
|
-
var readFileAsync = (0,
|
208407
|
-
var readDirAsync = (0,
|
209286
|
+
var import_util8 = require("util");
|
209287
|
+
var readFileAsync = (0, import_util8.promisify)(import_fs13.readFile);
|
209288
|
+
var readDirAsync = (0, import_util8.promisify)(import_fs13.readdir);
|
208408
209289
|
var Context = class {
|
208409
209290
|
/**
|
208410
209291
|
* @inheritDoc
|
@@ -212264,7 +213145,16 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
212264
213145
|
defineNavigatorUserAgent: isNavigatorDefined(
|
212265
213146
|
props.compatibilityDate ?? config.compatibility_date,
|
212266
213147
|
props.compatibilityFlags ?? config.compatibility_flags
|
212267
|
-
)
|
213148
|
+
),
|
213149
|
+
plugins: [logBuildOutput(nodejsCompatMode)],
|
213150
|
+
// Pages specific options used by wrangler pages commands
|
213151
|
+
entryName: void 0,
|
213152
|
+
inject: void 0,
|
213153
|
+
isOutfile: void 0,
|
213154
|
+
external: void 0,
|
213155
|
+
// These options are dev-only
|
213156
|
+
testScheduled: void 0,
|
213157
|
+
watch: void 0
|
212268
213158
|
}
|
212269
213159
|
);
|
212270
213160
|
for (const module3 of modules) {
|
@@ -213266,148 +214156,6 @@ async function fetchDefaultRollbackVersionId(accountId, workerName) {
|
|
213266
214156
|
}
|
213267
214157
|
__name(fetchDefaultRollbackVersionId, "fetchDefaultRollbackVersionId");
|
213268
214158
|
|
213269
|
-
// src/whoami.ts
|
213270
|
-
init_import_meta_url();
|
213271
|
-
|
213272
|
-
// src/user/membership.ts
|
213273
|
-
init_import_meta_url();
|
213274
|
-
async function fetchMembershipRoles(accountTag) {
|
213275
|
-
const allMemberships = await fetchPagedListResult("/memberships");
|
213276
|
-
const membership = allMemberships.find((m2) => m2.account.id === accountTag);
|
213277
|
-
return membership?.roles;
|
213278
|
-
}
|
213279
|
-
__name(fetchMembershipRoles, "fetchMembershipRoles");
|
213280
|
-
|
213281
|
-
// src/whoami.ts
|
213282
|
-
async function whoami(accountFilter) {
|
213283
|
-
logger.log("Getting User settings...");
|
213284
|
-
const user = await getUserInfo();
|
213285
|
-
if (!user) {
|
213286
|
-
return void logger.log(
|
213287
|
-
"You are not authenticated. Please run `wrangler login`."
|
213288
|
-
);
|
213289
|
-
}
|
213290
|
-
if (user.authType === "API Token") {
|
213291
|
-
logger.log(
|
213292
|
-
"\u2139\uFE0F The API Token is read from the CLOUDFLARE_API_TOKEN in your environment."
|
213293
|
-
);
|
213294
|
-
}
|
213295
|
-
await printUserEmail(user);
|
213296
|
-
await printAccountList(user);
|
213297
|
-
await printTokenPermissions(user);
|
213298
|
-
await printMembershipInfo(user, accountFilter);
|
213299
|
-
}
|
213300
|
-
__name(whoami, "whoami");
|
213301
|
-
function printUserEmail(user) {
|
213302
|
-
if (!user.email) {
|
213303
|
-
return void logger.log(
|
213304
|
-
`\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?`
|
213305
|
-
);
|
213306
|
-
}
|
213307
|
-
logger.log(
|
213308
|
-
`\u{1F44B} You are logged in with an ${user.authType}, associated with the email ${source_default.blue(user.email)}.`
|
213309
|
-
);
|
213310
|
-
}
|
213311
|
-
__name(printUserEmail, "printUserEmail");
|
213312
|
-
function printAccountList(user) {
|
213313
|
-
logger.table(
|
213314
|
-
user.accounts.map((account) => ({
|
213315
|
-
"Account Name": account.name,
|
213316
|
-
"Account ID": account.id
|
213317
|
-
}))
|
213318
|
-
);
|
213319
|
-
}
|
213320
|
-
__name(printAccountList, "printAccountList");
|
213321
|
-
function printTokenPermissions(user) {
|
213322
|
-
const permissions = user.tokenPermissions?.map((scope) => scope.split(":")) ?? [];
|
213323
|
-
if (user.authType !== "OAuth Token") {
|
213324
|
-
return void logger.log(
|
213325
|
-
`\u{1F513} To see token permissions visit https://dash.cloudflare.com/profile/api-tokens.`
|
213326
|
-
);
|
213327
|
-
}
|
213328
|
-
logger.log(
|
213329
|
-
`\u{1F513} Token Permissions: If scopes are missing, you may need to logout and re-login.`
|
213330
|
-
);
|
213331
|
-
logger.log(`Scope (Access)`);
|
213332
|
-
for (const [scope, access3] of permissions) {
|
213333
|
-
logger.log(`- ${scope} ${access3 ? `(${access3})` : ``}`);
|
213334
|
-
}
|
213335
|
-
}
|
213336
|
-
__name(printTokenPermissions, "printTokenPermissions");
|
213337
|
-
async function printMembershipInfo(user, accountFilter) {
|
213338
|
-
try {
|
213339
|
-
if (!accountFilter) {
|
213340
|
-
return;
|
213341
|
-
}
|
213342
|
-
const eq = /* @__PURE__ */ __name((a, b2) => a.localeCompare(b2, void 0, { sensitivity: "base" }) == 0, "eq");
|
213343
|
-
const selectedAccount = user.accounts.find(
|
213344
|
-
(a) => eq(a.id, accountFilter) || eq(a.name, accountFilter)
|
213345
|
-
);
|
213346
|
-
if (!selectedAccount) {
|
213347
|
-
return;
|
213348
|
-
}
|
213349
|
-
const membershipRoles = await fetchMembershipRoles(selectedAccount.id);
|
213350
|
-
if (!membershipRoles) {
|
213351
|
-
return;
|
213352
|
-
}
|
213353
|
-
logger.log(
|
213354
|
-
`\u{1F3A2} Membership roles in "${selectedAccount.name}": Contact account super admin to change your permissions.`
|
213355
|
-
);
|
213356
|
-
for (const role of membershipRoles) {
|
213357
|
-
logger.log(`- ${role}`);
|
213358
|
-
}
|
213359
|
-
} catch (e4) {
|
213360
|
-
if (isAuthenticationError(e4)) {
|
213361
|
-
logger.log(
|
213362
|
-
`\u{1F3A2} Unable to get membership roles. Make sure you have permissions to read the account.`
|
213363
|
-
);
|
213364
|
-
return;
|
213365
|
-
} else {
|
213366
|
-
throw e4;
|
213367
|
-
}
|
213368
|
-
}
|
213369
|
-
}
|
213370
|
-
__name(printMembershipInfo, "printMembershipInfo");
|
213371
|
-
async function getUserInfo() {
|
213372
|
-
const apiToken = getAPIToken();
|
213373
|
-
if (!apiToken) {
|
213374
|
-
return;
|
213375
|
-
}
|
213376
|
-
const tokenPermissions = await getTokenPermissions();
|
213377
|
-
const usingEnvAuth = !!getAuthFromEnv();
|
213378
|
-
const usingGlobalAuthKey = "authKey" in apiToken;
|
213379
|
-
return {
|
213380
|
-
apiToken: usingGlobalAuthKey ? apiToken.authKey : apiToken.apiToken,
|
213381
|
-
authType: usingGlobalAuthKey ? "Global API Key" : usingEnvAuth ? "API Token" : "OAuth Token",
|
213382
|
-
email: "authEmail" in apiToken ? apiToken.authEmail : await getEmail(),
|
213383
|
-
accounts: await getAccounts(),
|
213384
|
-
tokenPermissions
|
213385
|
-
};
|
213386
|
-
}
|
213387
|
-
__name(getUserInfo, "getUserInfo");
|
213388
|
-
async function getEmail() {
|
213389
|
-
try {
|
213390
|
-
const { email } = await fetchResult("/user");
|
213391
|
-
return email;
|
213392
|
-
} catch (e4) {
|
213393
|
-
const unauthorizedAccess = 9109;
|
213394
|
-
if (e4.code === unauthorizedAccess) {
|
213395
|
-
return void 0;
|
213396
|
-
} else {
|
213397
|
-
throw e4;
|
213398
|
-
}
|
213399
|
-
}
|
213400
|
-
}
|
213401
|
-
__name(getEmail, "getEmail");
|
213402
|
-
async function getAccounts() {
|
213403
|
-
return await fetchPagedListResult("/accounts");
|
213404
|
-
}
|
213405
|
-
__name(getAccounts, "getAccounts");
|
213406
|
-
async function getTokenPermissions() {
|
213407
|
-
return getScopes();
|
213408
|
-
}
|
213409
|
-
__name(getTokenPermissions, "getTokenPermissions");
|
213410
|
-
|
213411
214159
|
// src/index.ts
|
213412
214160
|
var resetColor = "\x1B[0m";
|
213413
214161
|
var fgGreenColor = "\x1B[32m";
|
@@ -213758,83 +214506,9 @@ function createCLIParser(argv) {
|
|
213758
214506
|
wrangler.command("pipelines", false, (pipelinesYargs) => {
|
213759
214507
|
return pipelines(pipelinesYargs.command(subHelp));
|
213760
214508
|
});
|
213761
|
-
|
213762
|
-
|
213763
|
-
|
213764
|
-
"\u{1F513} Login to Cloudflare",
|
213765
|
-
(yargs) => {
|
213766
|
-
return yargs.option("scopes-list", {
|
213767
|
-
describe: "List all the available OAuth scopes with descriptions"
|
213768
|
-
}).option("browser", {
|
213769
|
-
default: true,
|
213770
|
-
type: "boolean",
|
213771
|
-
describe: "Automatically open the OAuth link in a browser"
|
213772
|
-
}).option("scopes", {
|
213773
|
-
describe: "Pick the set of applicable OAuth scopes when logging in",
|
213774
|
-
array: true,
|
213775
|
-
type: "string",
|
213776
|
-
requiresArg: true
|
213777
|
-
});
|
213778
|
-
},
|
213779
|
-
async (args) => {
|
213780
|
-
await printWranglerBanner();
|
213781
|
-
if (args["scopes-list"]) {
|
213782
|
-
listScopes();
|
213783
|
-
return;
|
213784
|
-
}
|
213785
|
-
if (args.scopes) {
|
213786
|
-
if (args.scopes.length === 0) {
|
213787
|
-
listScopes();
|
213788
|
-
return;
|
213789
|
-
}
|
213790
|
-
if (!validateScopeKeys(args.scopes)) {
|
213791
|
-
throw new CommandLineArgsError(
|
213792
|
-
`One of ${args.scopes} is not a valid authentication scope. Run "wrangler login --scopes-list" to see the valid scopes.`
|
213793
|
-
);
|
213794
|
-
}
|
213795
|
-
await login({ scopes: args.scopes, browser: args.browser });
|
213796
|
-
return;
|
213797
|
-
}
|
213798
|
-
await login({ browser: args.browser });
|
213799
|
-
const config = readConfig(args.config, args);
|
213800
|
-
await sendMetricsEvent("login user", {
|
213801
|
-
sendMetrics: config.send_metrics
|
213802
|
-
});
|
213803
|
-
}
|
213804
|
-
);
|
213805
|
-
wrangler.command(
|
213806
|
-
// this needs scopes as an option?
|
213807
|
-
"logout",
|
213808
|
-
"\u{1F6AA} Logout from Cloudflare",
|
213809
|
-
() => {
|
213810
|
-
},
|
213811
|
-
async (args) => {
|
213812
|
-
await printWranglerBanner();
|
213813
|
-
await logout();
|
213814
|
-
const config = readConfig(void 0, args);
|
213815
|
-
await sendMetricsEvent("logout user", {
|
213816
|
-
sendMetrics: config.send_metrics
|
213817
|
-
});
|
213818
|
-
}
|
213819
|
-
);
|
213820
|
-
wrangler.command(
|
213821
|
-
"whoami",
|
213822
|
-
"\u{1F575}\uFE0F Retrieve your user information",
|
213823
|
-
(yargs) => {
|
213824
|
-
return yargs.option("account", {
|
213825
|
-
type: "string",
|
213826
|
-
describe: "Show membership information for the given account (id or name)."
|
213827
|
-
});
|
213828
|
-
},
|
213829
|
-
async (args) => {
|
213830
|
-
await printWranglerBanner();
|
213831
|
-
await whoami(args.account);
|
213832
|
-
const config = readConfig(void 0, args);
|
213833
|
-
await sendMetricsEvent("view accounts", {
|
213834
|
-
sendMetrics: config.send_metrics
|
213835
|
-
});
|
213836
|
-
}
|
213837
|
-
);
|
214509
|
+
register2.registerNamespace("login");
|
214510
|
+
register2.registerNamespace("logout");
|
214511
|
+
register2.registerNamespace("whoami");
|
213838
214512
|
wrangler.command("build", false, buildOptions, buildHandler);
|
213839
214513
|
wrangler.command("config", false, noOpOptions, configHandler);
|
213840
214514
|
wrangler.command(
|
@@ -215559,7 +216233,18 @@ var BundlerController = class extends Controller {
|
|
215559
216233
|
defineNavigatorUserAgent: isNavigatorDefined(
|
215560
216234
|
config.compatibilityDate,
|
215561
216235
|
config.compatibilityFlags
|
215562
|
-
)
|
216236
|
+
),
|
216237
|
+
testScheduled: config.dev.testScheduled,
|
216238
|
+
plugins: void 0,
|
216239
|
+
// Pages specific options used by wrangler pages commands
|
216240
|
+
entryName: void 0,
|
216241
|
+
inject: void 0,
|
216242
|
+
isOutfile: void 0,
|
216243
|
+
external: void 0,
|
216244
|
+
// We don't use esbuild watching for custom builds
|
216245
|
+
watch: void 0,
|
216246
|
+
// sourcemap defaults to true in dev
|
216247
|
+
sourcemap: void 0
|
215563
216248
|
});
|
215564
216249
|
if (buildAborter.signal.aborted) {
|
215565
216250
|
return;
|
@@ -216177,7 +216862,8 @@ async function convertToConfigBundle(event) {
|
|
216177
216862
|
inspect: true,
|
216178
216863
|
services: bindings.services,
|
216179
216864
|
serviceBindings: fetchers,
|
216180
|
-
bindVectorizeToProd: event.config.dev?.bindVectorizeToProd ?? false
|
216865
|
+
bindVectorizeToProd: event.config.dev?.bindVectorizeToProd ?? false,
|
216866
|
+
testScheduled: !!event.config.dev.testScheduled
|
216181
216867
|
};
|
216182
216868
|
}
|
216183
216869
|
__name(convertToConfigBundle, "convertToConfigBundle");
|