@cloudflare/vitest-plugin 1.1.9 → 1.1.10
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/dist/pool/index.mjs +561 -73
- package/dist/pool/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/pool/index.mjs
CHANGED
|
@@ -325,7 +325,7 @@ function createFatalError$1(message, isJson, options) {
|
|
|
325
325
|
__name$3(createFatalError$1, "createFatalError");
|
|
326
326
|
|
|
327
327
|
//#endregion
|
|
328
|
-
//#region ../workers-utils/dist/chunk-
|
|
328
|
+
//#region ../workers-utils/dist/chunk-JGKSDUFK.mjs
|
|
329
329
|
function hasKnownExportType(entry) {
|
|
330
330
|
const type = entry?.type;
|
|
331
331
|
return type === "durable-object" || type === "worker";
|
|
@@ -361,6 +361,17 @@ function getDurableObjectContainerApps(containers) {
|
|
|
361
361
|
return Array.isArray(containers) ? containers.filter(isDurableObjectContainerApp) : [];
|
|
362
362
|
}
|
|
363
363
|
__name$3(getDurableObjectContainerApps, "getDurableObjectContainerApps");
|
|
364
|
+
function getResolvedDurableObjectContainerApps(containers, exports$1) {
|
|
365
|
+
return getDurableObjectContainerApps(containers).map((container) => {
|
|
366
|
+
const className = resolveContainerClassName(container, exports$1);
|
|
367
|
+
if (typeof className !== "string" || className.length === 0) throw new UserError$1(`The container "${container.name}" is not linked to a Durable Object. Either set "containers.class_name", or reference this container from a Durable Object's \`exports\` entry via its "container" field.`, { telemetryMessage: "durable object container class unresolved" });
|
|
368
|
+
return {
|
|
369
|
+
...container,
|
|
370
|
+
class_name: className
|
|
371
|
+
};
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
__name$3(getResolvedDurableObjectContainerApps, "getResolvedDurableObjectContainerApps");
|
|
364
375
|
function getContainerNameToClassNameMap(exports$1) {
|
|
365
376
|
const containerNameToClassName = /* @__PURE__ */ new Map();
|
|
366
377
|
for (const [className, entry] of Object.entries(getDurableObjectExports(exports$1))) if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) containerNameToClassName.set(entry.container, className);
|
|
@@ -415,7 +426,7 @@ function getDurableObjectClassNameToUseSQLiteMap(migrations, exports$1) {
|
|
|
415
426
|
__name$3(getDurableObjectClassNameToUseSQLiteMap, "getDurableObjectClassNameToUseSQLiteMap");
|
|
416
427
|
function validateDurableObjectContainerApplications(config$1, containers = getDurableObjectContainerApps(config$1.containers)) {
|
|
417
428
|
const allDOs = getDurableObjectClassNameToUseSQLiteMap(config$1.migrations, config$1.exports);
|
|
418
|
-
for (const container of containers) {
|
|
429
|
+
for (const container of getResolvedDurableObjectContainerApps(containers, config$1.exports)) {
|
|
419
430
|
const maybeBoundDO = config$1.durable_objects.bindings.find((durableObject) => durableObject.class_name === container.class_name);
|
|
420
431
|
const useSQLite = allDOs.get(container.class_name);
|
|
421
432
|
if (useSQLite === void 0 && maybeBoundDO === void 0) throw new UserError$1(`The container class_name ${container.class_name} does not match any durable object class_name defined in your Wrangler config file. Note that the durable object must be defined in the same script as the container.`, { telemetryMessage: "no DO defined that matches container class_name" });
|
|
@@ -2383,7 +2394,12 @@ var APIError = class extends ParseError {
|
|
|
2383
2394
|
return this.#status;
|
|
2384
2395
|
}
|
|
2385
2396
|
isGatewayError() {
|
|
2386
|
-
if (this.#status !== void 0) return [
|
|
2397
|
+
if (this.#status !== void 0) return [
|
|
2398
|
+
502,
|
|
2399
|
+
503,
|
|
2400
|
+
504,
|
|
2401
|
+
524
|
|
2402
|
+
].includes(this.#status);
|
|
2387
2403
|
return false;
|
|
2388
2404
|
}
|
|
2389
2405
|
isRetryable() {
|
|
@@ -2787,8 +2803,8 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
|
|
|
2787
2803
|
__name$3(formatConfigSnippet, "formatConfigSnippet");
|
|
2788
2804
|
|
|
2789
2805
|
//#endregion
|
|
2790
|
-
//#region ../workers-utils/dist/chunk-
|
|
2791
|
-
var DEFAULT_COMPAT_DATE = "2026-09-
|
|
2806
|
+
//#region ../workers-utils/dist/chunk-5H6GBNUC.mjs
|
|
2807
|
+
var DEFAULT_COMPAT_DATE = "2026-09-15";
|
|
2792
2808
|
function assertNever(_value) {}
|
|
2793
2809
|
__name$3(assertNever, "assertNever");
|
|
2794
2810
|
function mapWorkerMetadataBindings(bindings) {
|
|
@@ -2960,9 +2976,6 @@ function mapWorkerMetadataBindings(bindings) {
|
|
|
2960
2976
|
instance_name: binding.instance_name
|
|
2961
2977
|
}];
|
|
2962
2978
|
break;
|
|
2963
|
-
case "websearch":
|
|
2964
|
-
configObj.websearch = { binding: binding.name };
|
|
2965
|
-
break;
|
|
2966
2979
|
case "agent_memory":
|
|
2967
2980
|
configObj.agent_memory = [...configObj.agent_memory ?? [], {
|
|
2968
2981
|
binding: binding.name,
|
|
@@ -27489,7 +27502,6 @@ var defaultWranglerConfig = {
|
|
|
27489
27502
|
vectorize: [],
|
|
27490
27503
|
ai_search_namespaces: [],
|
|
27491
27504
|
ai_search: [],
|
|
27492
|
-
websearch: void 0,
|
|
27493
27505
|
agent_memory: [],
|
|
27494
27506
|
hyperdrive: [],
|
|
27495
27507
|
workflows: [],
|
|
@@ -41567,7 +41579,6 @@ var friendlyBindingNames = {
|
|
|
41567
41579
|
vectorize: "Vectorize Index",
|
|
41568
41580
|
ai_search_namespaces: "AI Search Namespace",
|
|
41569
41581
|
ai_search: "AI Search Instance",
|
|
41570
|
-
websearch: "Web Search",
|
|
41571
41582
|
agent_memory: "Agent Memory",
|
|
41572
41583
|
hyperdrive: "Hyperdrive Config",
|
|
41573
41584
|
r2_buckets: "R2 Bucket",
|
|
@@ -41620,7 +41631,6 @@ var bindingTypeFriendlyNames = {
|
|
|
41620
41631
|
vectorize: "Vectorize Index",
|
|
41621
41632
|
ai_search_namespace: "AI Search Namespace",
|
|
41622
41633
|
ai_search: "AI Search Instance",
|
|
41623
|
-
websearch: "Web Search",
|
|
41624
41634
|
agent_memory: "Agent Memory",
|
|
41625
41635
|
hyperdrive: "Hyperdrive Config",
|
|
41626
41636
|
service: "Worker",
|
|
@@ -42123,7 +42133,6 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
42123
42133
|
vectorize: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vectorize", validateBindingArray(envName, validateVectorizeBinding), []),
|
|
42124
42134
|
ai_search_namespaces: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "ai_search_namespaces", validateBindingArray(envName, validateAISearchNamespaceBinding), []),
|
|
42125
42135
|
ai_search: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "ai_search", validateBindingArray(envName, validateAISearchBinding), []),
|
|
42126
|
-
websearch: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "websearch", validateNamedSimpleBinding(envName), void 0),
|
|
42127
42136
|
agent_memory: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "agent_memory", validateBindingArray(envName, validateAgentMemoryBinding), []),
|
|
42128
42137
|
hyperdrive: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "hyperdrive", validateBindingArray(envName, validateHyperdriveBinding), []),
|
|
42129
42138
|
services: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "services", validateBindingArray(envName, validateServiceBinding), []),
|
|
@@ -42663,7 +42672,6 @@ var validateUnsafeBinding = /* @__PURE__ */ __name$3((diagnostics, field, value)
|
|
|
42663
42672
|
"ai",
|
|
42664
42673
|
"ai_search_namespace",
|
|
42665
42674
|
"ai_search",
|
|
42666
|
-
"websearch",
|
|
42667
42675
|
"agent_memory",
|
|
42668
42676
|
"kv_namespace",
|
|
42669
42677
|
"durable_object_namespace",
|
|
@@ -42809,7 +42817,18 @@ function validateDurableObjectContainerImages(diagnostics, field, images, compli
|
|
|
42809
42817
|
valid = false;
|
|
42810
42818
|
}
|
|
42811
42819
|
}
|
|
42812
|
-
const
|
|
42820
|
+
const isDockerfileBuild = hasDockerfile && !hasImage;
|
|
42821
|
+
if (isDockerfileBuild) {
|
|
42822
|
+
if (image.build_context !== void 0 && (typeof image.build_context !== "string" || image.build_context.length === 0)) {
|
|
42823
|
+
diagnostics.errors.push(`"${imageField}.build_context" must be a non-empty string.`);
|
|
42824
|
+
valid = false;
|
|
42825
|
+
}
|
|
42826
|
+
if (image.build_vars !== void 0 && (typeof image.build_vars !== "object" || image.build_vars === null || Array.isArray(image.build_vars) || Object.values(image.build_vars).some((value) => typeof value !== "string"))) {
|
|
42827
|
+
diagnostics.errors.push(`"${imageField}.build_vars" must be an object with string values.`);
|
|
42828
|
+
valid = false;
|
|
42829
|
+
}
|
|
42830
|
+
}
|
|
42831
|
+
const unsupportedFields = Object.keys(image).filter((property) => property !== "dockerfile" && property !== "image" && !(isDockerfileBuild && (property === "build_context" || property === "build_vars")));
|
|
42813
42832
|
if (unsupportedFields.length > 0) {
|
|
42814
42833
|
diagnostics.errors.push(`Unexpected fields found in ${imageField} field: ${unsupportedFields.map((property) => `"${property}"`).join(", ")}`);
|
|
42815
42834
|
valid = false;
|
|
@@ -42818,6 +42837,24 @@ function validateDurableObjectContainerImages(diagnostics, field, images, compli
|
|
|
42818
42837
|
return valid;
|
|
42819
42838
|
}
|
|
42820
42839
|
__name$3(validateDurableObjectContainerImages, "validateDurableObjectContainerImages");
|
|
42840
|
+
function validateDurableObjectContainerUnsafe(diagnostics, field, value) {
|
|
42841
|
+
if (value === void 0) return;
|
|
42842
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
42843
|
+
diagnostics.errors.push(`"${field}" should be an object.`);
|
|
42844
|
+
return;
|
|
42845
|
+
}
|
|
42846
|
+
const unsafe = value;
|
|
42847
|
+
const configuration = unsafe.configuration;
|
|
42848
|
+
if (Object.keys(unsafe).some((key) => key !== "configuration") || configuration !== void 0 && (typeof configuration !== "object" || configuration === null || Array.isArray(configuration) || Object.keys(configuration).some((key) => key !== "experimental_flags"))) {
|
|
42849
|
+
diagnostics.errors.push(`Only "${field}.configuration.experimental_flags" is supported for Durable Object-managed Containers.`);
|
|
42850
|
+
return;
|
|
42851
|
+
}
|
|
42852
|
+
if (configuration !== void 0) {
|
|
42853
|
+
const flags = configuration.experimental_flags;
|
|
42854
|
+
if (flags !== void 0 && (!Array.isArray(flags) || flags.some((flag) => typeof flag !== "string"))) diagnostics.errors.push(`"${field}.configuration.experimental_flags" should be an array of strings.`);
|
|
42855
|
+
}
|
|
42856
|
+
}
|
|
42857
|
+
__name$3(validateDurableObjectContainerUnsafe, "validateDurableObjectContainerUnsafe");
|
|
42821
42858
|
function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
42822
42859
|
const { generateDefaultName = true } = options;
|
|
42823
42860
|
return (diagnostics, field, value, config2) => {
|
|
@@ -42829,11 +42866,10 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
42829
42866
|
for (const containerAppOptional of value) {
|
|
42830
42867
|
const isDurableObjectManaged = containerAppOptional.scheduling_policy === "durable_object";
|
|
42831
42868
|
const hasValidDurableObjectClassName = typeof containerAppOptional.class_name === "string" && containerAppOptional.class_name.length > 0;
|
|
42832
|
-
|
|
42833
|
-
|
|
42834
|
-
} else validateOptionalProperty(diagnostics, field, "class_name", containerAppOptional.class_name, "string");
|
|
42869
|
+
validateOptionalProperty(diagnostics, field, "class_name", containerAppOptional.class_name, "string");
|
|
42870
|
+
if (isDurableObjectManaged && containerAppOptional.class_name === "") diagnostics.errors.push(`"containers.class_name" must be a non-empty string when specified for a Durable Object-managed Container.`);
|
|
42835
42871
|
validateOptionalProperty(diagnostics, field, "name", containerAppOptional.name, "string");
|
|
42836
|
-
if (generateDefaultName && !containerAppOptional.name && (!isDurableObjectManaged || hasValidDurableObjectClassName)) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
|
|
42872
|
+
if (generateDefaultName && !containerAppOptional.name && (!isDurableObjectManaged || containerAppOptional.class_name === void 0 || hasValidDurableObjectClassName)) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
|
|
42837
42873
|
else if (!topLevelName) diagnostics.errors.push(`Must have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.`);
|
|
42838
42874
|
else {
|
|
42839
42875
|
let name = `${topLevelName}-${containerAppOptional.class_name}`;
|
|
@@ -42842,13 +42878,18 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
42842
42878
|
}
|
|
42843
42879
|
if (isDurableObjectManaged) {
|
|
42844
42880
|
validateDurableObjectContainerImages(diagnostics, `${field}.images`, containerAppOptional.images, options.complianceConfig);
|
|
42881
|
+
validateContainerObservability(diagnostics, `${field}.observability`, containerAppOptional.observability, config2);
|
|
42882
|
+
if (containerAppOptional.observability?.target_instance_count !== void 0 || containerAppOptional.observability?.target_instance_percentage !== void 0) diagnostics.errors.push(`"${field}.observability" only supports enabling or disabling logs for Durable Object-managed Containers; instance targeting is not supported.`);
|
|
42883
|
+
validateDurableObjectContainerUnsafe(diagnostics, `${field}.unsafe`, containerAppOptional.unsafe);
|
|
42845
42884
|
const unsupportedFields = Object.keys(containerAppOptional).filter((key) => ![
|
|
42846
42885
|
"name",
|
|
42847
42886
|
"class_name",
|
|
42848
42887
|
"scheduling_policy",
|
|
42849
|
-
"images"
|
|
42888
|
+
"images",
|
|
42889
|
+
"observability",
|
|
42890
|
+
"unsafe"
|
|
42850
42891
|
].includes(key));
|
|
42851
|
-
if (unsupportedFields.length > 0) diagnostics.errors.push(`Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", and "
|
|
42892
|
+
if (unsupportedFields.length > 0) diagnostics.errors.push(`Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", "images", "observability", and restricted "unsafe" settings are supported.`);
|
|
42852
42893
|
continue;
|
|
42853
42894
|
}
|
|
42854
42895
|
if (!containerAppOptional.configuration?.image && !containerAppOptional.image) diagnostics.errors.push(`"containers.image" field must be defined for each container app. This should be the path to your Dockerfile or an image URI pointing to the Cloudflare registry.`);
|
|
@@ -43919,6 +43960,8 @@ var validatePreviewsConfig = /* @__PURE__ */ __name$3((envName, configPath) => (
|
|
|
43919
43960
|
"d1_databases",
|
|
43920
43961
|
"r2_buckets",
|
|
43921
43962
|
"vectorize",
|
|
43963
|
+
"ai_search_namespaces",
|
|
43964
|
+
"ai_search",
|
|
43922
43965
|
"hyperdrive",
|
|
43923
43966
|
"services",
|
|
43924
43967
|
"analytics_engine_datasets",
|
|
@@ -43957,6 +44000,8 @@ var validatePreviewsConfig = /* @__PURE__ */ __name$3((envName, configPath) => (
|
|
|
43957
44000
|
isValid = validateBindingArray(envName, validateD1Binding)(diagnostics, `${field}.d1_databases`, previews.d1_databases, void 0) && isValid;
|
|
43958
44001
|
isValid = validateBindingArray(envName, validateR2Binding)(diagnostics, `${field}.r2_buckets`, previews.r2_buckets, void 0) && isValid;
|
|
43959
44002
|
isValid = validateBindingArray(envName, validateVectorizeBinding)(diagnostics, `${field}.vectorize`, previews.vectorize, void 0) && isValid;
|
|
44003
|
+
isValid = validateBindingArray(envName, validateAISearchNamespaceBinding)(diagnostics, `${field}.ai_search_namespaces`, previews.ai_search_namespaces, void 0) && isValid;
|
|
44004
|
+
isValid = validateBindingArray(envName, validateAISearchBinding)(diagnostics, `${field}.ai_search`, previews.ai_search, void 0) && isValid;
|
|
43960
44005
|
isValid = validateBindingArray(envName, validateHyperdriveBinding)(diagnostics, `${field}.hyperdrive`, previews.hyperdrive, void 0) && isValid;
|
|
43961
44006
|
isValid = validateBindingArray(envName, validateServiceBinding)(diagnostics, `${field}.services`, previews.services, void 0) && isValid;
|
|
43962
44007
|
isValid = validateBindingArray(envName, validateAnalyticsEngineBinding)(diagnostics, `${field}.analytics_engine_datasets`, previews.analytics_engine_datasets, void 0) && isValid;
|
|
@@ -44517,7 +44562,6 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
44517
44562
|
flagship: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44518
44563
|
vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44519
44564
|
vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44520
|
-
websearch: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44521
44565
|
agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
|
|
44522
44566
|
};
|
|
44523
44567
|
function getBindingLocalSupport(type) {
|
|
@@ -44875,14 +44919,6 @@ function convertConfigToBindings(config2, options) {
|
|
|
44875
44919
|
...x
|
|
44876
44920
|
};
|
|
44877
44921
|
break;
|
|
44878
|
-
case "websearch": {
|
|
44879
|
-
const { binding,...x } = info;
|
|
44880
|
-
output[binding] = {
|
|
44881
|
-
type: "websearch",
|
|
44882
|
-
...x
|
|
44883
|
-
};
|
|
44884
|
-
break;
|
|
44885
|
-
}
|
|
44886
44922
|
case "agent_memory":
|
|
44887
44923
|
for (const { binding,...x } of info) output[binding] = {
|
|
44888
44924
|
type: "agent_memory",
|
|
@@ -45028,7 +45064,6 @@ function printBindings(bindings, options) {
|
|
|
45028
45064
|
const vectorize = extractBindingsOfType("vectorize", bindings);
|
|
45029
45065
|
const ai_search_namespaces = extractBindingsOfType("ai_search_namespace", bindings);
|
|
45030
45066
|
const ai_search = extractBindingsOfType("ai_search", bindings);
|
|
45031
|
-
const websearch = extractBindingsOfType("websearch", bindings);
|
|
45032
45067
|
const agent_memory = extractBindingsOfType("agent_memory", bindings);
|
|
45033
45068
|
const hyperdrive = extractBindingsOfType("hyperdrive", bindings);
|
|
45034
45069
|
const r2_buckets = extractBindingsOfType("r2_bucket", bindings);
|
|
@@ -45168,12 +45203,6 @@ function printBindings(bindings, options) {
|
|
|
45168
45203
|
value: instance_name ? String(instance_name) : void 0,
|
|
45169
45204
|
mode: getMode({ isSimulatedLocally: false })
|
|
45170
45205
|
})));
|
|
45171
|
-
if (websearch.length > 0) output.push(...websearch.map(({ binding }) => ({
|
|
45172
|
-
name: binding,
|
|
45173
|
-
type: getBindingTypeFriendlyName("websearch"),
|
|
45174
|
-
value: void 0,
|
|
45175
|
-
mode: getMode({ isSimulatedLocally: false })
|
|
45176
|
-
})));
|
|
45177
45206
|
if (agent_memory.length > 0) output.push(...agent_memory.map(({ binding, namespace }) => ({
|
|
45178
45207
|
name: binding,
|
|
45179
45208
|
type: getBindingTypeFriendlyName("agent_memory"),
|
|
@@ -45462,7 +45491,7 @@ ${allTailConsumers.map(({ service, streaming }) => {
|
|
|
45462
45491
|
let containersTitle = "The following containers are available:";
|
|
45463
45492
|
if (context.name && isMultiWorker) containersTitle = `The following containers are available from ${source_default.blue(context.name)}:`;
|
|
45464
45493
|
log$2(`${containersTitle}
|
|
45465
|
-
${containers.map((container) => container.scheduling_policy === "durable_object" ? `- ${container.class_name} (durable_object)` : `- ${container.name} (${container.image})`).join("\n")}`);
|
|
45494
|
+
${containers.map((container) => container.scheduling_policy === "durable_object" ? `- ${container.class_name ?? container.name} (durable_object)` : `- ${container.name} (${container.image})`).join("\n")}`);
|
|
45466
45495
|
log$2("");
|
|
45467
45496
|
}
|
|
45468
45497
|
if (context.unsafeMetadata) {
|
|
@@ -54836,7 +54865,7 @@ function scrubEncryptedCredentials(options) {
|
|
|
54836
54865
|
__name$2(scrubEncryptedCredentials, "scrubEncryptedCredentials");
|
|
54837
54866
|
|
|
54838
54867
|
//#endregion
|
|
54839
|
-
//#region ../workers-auth/dist/chunk-
|
|
54868
|
+
//#region ../workers-auth/dist/chunk-T63LVVAX.mjs
|
|
54840
54869
|
function createPreferences(getConfigPath) {
|
|
54841
54870
|
function getUserPreferencesPath() {
|
|
54842
54871
|
return path.resolve(getConfigPath(), "preferences.json");
|
|
@@ -55615,7 +55644,7 @@ Run \`${descriptor.commands.whoami}\` to check your current authentication statu
|
|
|
55615
55644
|
return oauthFlow.requireApiToken();
|
|
55616
55645
|
}
|
|
55617
55646
|
__name$2(requireApiToken$1, "requireApiToken");
|
|
55618
|
-
function
|
|
55647
|
+
function withLoginDefaults(complianceConfig, props) {
|
|
55619
55648
|
return {
|
|
55620
55649
|
complianceConfig,
|
|
55621
55650
|
scopes: props?.scopes ?? descriptor.getDefaultScopeKeys(),
|
|
@@ -55623,12 +55652,12 @@ Run \`${descriptor.commands.whoami}\` to check your current authentication statu
|
|
|
55623
55652
|
callbackHost: props?.callbackHost,
|
|
55624
55653
|
callbackPort: props?.callbackPort,
|
|
55625
55654
|
profile: props?.profile,
|
|
55626
|
-
device: props?.device
|
|
55655
|
+
device: props?.device ?? descriptor.useDeviceFlowByDefault ?? false
|
|
55627
55656
|
};
|
|
55628
55657
|
}
|
|
55629
|
-
__name$2(
|
|
55658
|
+
__name$2(withLoginDefaults, "withLoginDefaults");
|
|
55630
55659
|
async function login(complianceConfig, props) {
|
|
55631
|
-
return oauthFlow.login(
|
|
55660
|
+
return oauthFlow.login(withLoginDefaults(complianceConfig, props));
|
|
55632
55661
|
}
|
|
55633
55662
|
__name$2(login, "login");
|
|
55634
55663
|
async function logout(profile) {
|
|
@@ -55637,7 +55666,7 @@ Run \`${descriptor.commands.whoami}\` to check your current authentication statu
|
|
|
55637
55666
|
__name$2(logout, "logout");
|
|
55638
55667
|
async function loginOrRefreshIfRequired(complianceConfig, props) {
|
|
55639
55668
|
if (oauthFlow.getActiveTemporaryAccount()) return { loggedIn: true };
|
|
55640
|
-
return oauthFlow.loginOrRefreshIfRequired(
|
|
55669
|
+
return oauthFlow.loginOrRefreshIfRequired(withLoginDefaults(complianceConfig, props));
|
|
55641
55670
|
}
|
|
55642
55671
|
__name$2(loginOrRefreshIfRequired, "loginOrRefreshIfRequired");
|
|
55643
55672
|
async function getOAuthTokenFromLocalState() {
|
|
@@ -55670,10 +55699,7 @@ Run \`${descriptor.commands.whoami}\` to check your current authentication statu
|
|
|
55670
55699
|
return configCache.getConfigCache(getAccountCacheFileName()).account;
|
|
55671
55700
|
}
|
|
55672
55701
|
__name$2(getAccountFromCache, "getAccountFromCache");
|
|
55673
|
-
async function fetchAccountsPaged(complianceConfig, resource) {
|
|
55674
|
-
const result = await loginOrRefreshIfRequired(complianceConfig);
|
|
55675
|
-
if (!result.loggedIn) throw new UserError$1(`Not logged in. ${NOT_LOGGED_IN_ERROR_BODIES[result.reason]}${NOT_LOGGED_IN_WHOAMI_TIP}`, { telemetryMessage: "cfetch auth login required" });
|
|
55676
|
-
const credentials = requireApiToken$1();
|
|
55702
|
+
async function fetchAccountsPaged(complianceConfig, resource, credentials) {
|
|
55677
55703
|
const results = [];
|
|
55678
55704
|
let getMoreResults = true;
|
|
55679
55705
|
let page = 1;
|
|
@@ -55693,7 +55719,10 @@ Run \`${descriptor.commands.whoami}\` to check your current authentication statu
|
|
|
55693
55719
|
__name$2(fetchAccountsPaged, "fetchAccountsPaged");
|
|
55694
55720
|
async function fetchAllAccounts(complianceConfig, options = {}) {
|
|
55695
55721
|
const { throwOnEmpty = true } = options;
|
|
55696
|
-
const
|
|
55722
|
+
const loginResult = await loginOrRefreshIfRequired(complianceConfig);
|
|
55723
|
+
if (!loginResult.loggedIn) throw new UserError$1(`Not logged in. ${NOT_LOGGED_IN_ERROR_BODIES[loginResult.reason]}${NOT_LOGGED_IN_WHOAMI_TIP}`, { telemetryMessage: "cfetch auth login required" });
|
|
55724
|
+
const credentials = requireApiToken$1();
|
|
55725
|
+
const [accountsRes, membershipsRes] = await Promise.allSettled([fetchAccountsPaged(complianceConfig, `/accounts`, credentials), fetchAccountsPaged(complianceConfig, `/memberships`, credentials)]);
|
|
55697
55726
|
if (accountsRes.status === "rejected") throw accountsRes.reason;
|
|
55698
55727
|
if (membershipsRes.status === "rejected") if (isMembershipsInaccessible(membershipsRes.reason)) {
|
|
55699
55728
|
if (accountsRes.status === "fulfilled" && accountsRes.value.length > 0) return accountsRes.value;
|
|
@@ -55990,7 +56019,483 @@ function getCfConfigPath() {
|
|
|
55990
56019
|
});
|
|
55991
56020
|
}
|
|
55992
56021
|
__name$2(getCfConfigPath, "getCfConfigPath");
|
|
55993
|
-
var
|
|
56022
|
+
var CF_REGISTERED_SCOPES = [
|
|
56023
|
+
"access:read",
|
|
56024
|
+
"access:write",
|
|
56025
|
+
"account:read",
|
|
56026
|
+
"agw:read",
|
|
56027
|
+
"agw:run",
|
|
56028
|
+
"agw:write",
|
|
56029
|
+
"ai:read",
|
|
56030
|
+
"ai:write",
|
|
56031
|
+
"ai-search:read",
|
|
56032
|
+
"ai-search:run",
|
|
56033
|
+
"ai-search:write",
|
|
56034
|
+
"aiaudit:read",
|
|
56035
|
+
"aiaudit:write",
|
|
56036
|
+
"aig:read",
|
|
56037
|
+
"aig:write",
|
|
56038
|
+
"auditlogs:read",
|
|
56039
|
+
"billing:read",
|
|
56040
|
+
"billing:write",
|
|
56041
|
+
"browser:read",
|
|
56042
|
+
"browser:write",
|
|
56043
|
+
"cfone:read",
|
|
56044
|
+
"cfone:write",
|
|
56045
|
+
"cloudchamber:write",
|
|
56046
|
+
"connectivity:admin",
|
|
56047
|
+
"connectivity:bind",
|
|
56048
|
+
"connectivity:read",
|
|
56049
|
+
"constellation:write",
|
|
56050
|
+
"containers:write",
|
|
56051
|
+
"d1:write",
|
|
56052
|
+
"dex:read",
|
|
56053
|
+
"dex:write",
|
|
56054
|
+
"dns_analytics:read",
|
|
56055
|
+
"dns_records:edit",
|
|
56056
|
+
"dns_records:read",
|
|
56057
|
+
"dns_settings:read",
|
|
56058
|
+
"email_routing:read",
|
|
56059
|
+
"email_routing:write",
|
|
56060
|
+
"email_sending:read",
|
|
56061
|
+
"email_sending:write",
|
|
56062
|
+
"firstpartytags:write",
|
|
56063
|
+
"images:read",
|
|
56064
|
+
"images:write",
|
|
56065
|
+
"lb:edit",
|
|
56066
|
+
"lb:read",
|
|
56067
|
+
"logpush:read",
|
|
56068
|
+
"logpush:write",
|
|
56069
|
+
"mcp_portals:read",
|
|
56070
|
+
"mcp_portals:write",
|
|
56071
|
+
"notebook-examples:read",
|
|
56072
|
+
"notebook-managed:read",
|
|
56073
|
+
"notification:read",
|
|
56074
|
+
"notification:write",
|
|
56075
|
+
"oauth_account_ssl_and_certificates_write",
|
|
56076
|
+
"offline",
|
|
56077
|
+
"openid",
|
|
56078
|
+
"pages:read",
|
|
56079
|
+
"pages:write",
|
|
56080
|
+
"pipelines:read",
|
|
56081
|
+
"pipelines:setup",
|
|
56082
|
+
"pipelines:write",
|
|
56083
|
+
"query_cache:write",
|
|
56084
|
+
"queues:write",
|
|
56085
|
+
"r2_catalog:write",
|
|
56086
|
+
"radar:read",
|
|
56087
|
+
"rag:read",
|
|
56088
|
+
"rag:write",
|
|
56089
|
+
"registrar:read",
|
|
56090
|
+
"registrar:write",
|
|
56091
|
+
"secrets_store:read",
|
|
56092
|
+
"secrets_store:write",
|
|
56093
|
+
"sso-connector:read",
|
|
56094
|
+
"sso-connector:write",
|
|
56095
|
+
"ssl_certs:write",
|
|
56096
|
+
"teams:pii",
|
|
56097
|
+
"teams:read",
|
|
56098
|
+
"teams:secure_location",
|
|
56099
|
+
"teams:write",
|
|
56100
|
+
"url_scanner:read",
|
|
56101
|
+
"url_scanner:write",
|
|
56102
|
+
"user:read",
|
|
56103
|
+
"vectorize:write",
|
|
56104
|
+
"workers:read",
|
|
56105
|
+
"workers:write",
|
|
56106
|
+
"workers_builds:read",
|
|
56107
|
+
"workers_builds:write",
|
|
56108
|
+
"workers_deployments:read",
|
|
56109
|
+
"workers_kv:write",
|
|
56110
|
+
"workers_observability:read",
|
|
56111
|
+
"workers_observability:write",
|
|
56112
|
+
"workers_observability_telemetry:write",
|
|
56113
|
+
"workers_routes:write",
|
|
56114
|
+
"workers_scripts:write",
|
|
56115
|
+
"workers_tail:read",
|
|
56116
|
+
"zone:read",
|
|
56117
|
+
"account-analytics.read",
|
|
56118
|
+
"account-ssl-and-certificates.write",
|
|
56119
|
+
"ssl-and-certificates.read",
|
|
56120
|
+
"ssl-and-certificates.write",
|
|
56121
|
+
"registrar-domains.read",
|
|
56122
|
+
"registrar-domains.admin",
|
|
56123
|
+
"logs.read",
|
|
56124
|
+
"logs.write",
|
|
56125
|
+
"websearch.run",
|
|
56126
|
+
"snippets.read",
|
|
56127
|
+
"snippets.write",
|
|
56128
|
+
"access-acct.read",
|
|
56129
|
+
"access-acct.revoke",
|
|
56130
|
+
"access-acct.write",
|
|
56131
|
+
"access-app.read",
|
|
56132
|
+
"access-app.revoke",
|
|
56133
|
+
"access-app.write",
|
|
56134
|
+
"access-audit-log.read",
|
|
56135
|
+
"access-certificate.read",
|
|
56136
|
+
"access-certificate.write",
|
|
56137
|
+
"access-custom-page.read",
|
|
56138
|
+
"access-custom-page.write",
|
|
56139
|
+
"access-device-posture.read",
|
|
56140
|
+
"access-device-posture.write",
|
|
56141
|
+
"access-group.read",
|
|
56142
|
+
"access-group.write",
|
|
56143
|
+
"access-idp.read",
|
|
56144
|
+
"access-idp.write",
|
|
56145
|
+
"access-key.read",
|
|
56146
|
+
"access-key.write",
|
|
56147
|
+
"access-org.read",
|
|
56148
|
+
"access-org.revoke",
|
|
56149
|
+
"access-org.write",
|
|
56150
|
+
"access-policy-test.read",
|
|
56151
|
+
"access-policy-test.write",
|
|
56152
|
+
"access-policy.read",
|
|
56153
|
+
"access-policy.write",
|
|
56154
|
+
"access-population.read",
|
|
56155
|
+
"access-population.write",
|
|
56156
|
+
"access-saml-certificate.read",
|
|
56157
|
+
"access-saml-certificate.write",
|
|
56158
|
+
"access-scim-log.read",
|
|
56159
|
+
"access-seats.write",
|
|
56160
|
+
"access-service-token.read",
|
|
56161
|
+
"access-service-token.write",
|
|
56162
|
+
"access-ssh-auditing.read",
|
|
56163
|
+
"access-ssh-auditing.write",
|
|
56164
|
+
"access-tag.read",
|
|
56165
|
+
"access-tag.write",
|
|
56166
|
+
"access-users.read",
|
|
56167
|
+
"access-users.write",
|
|
56168
|
+
"access.read",
|
|
56169
|
+
"access.revoke",
|
|
56170
|
+
"access.write",
|
|
56171
|
+
"account-api-gateway.read",
|
|
56172
|
+
"account-api-gateway.write",
|
|
56173
|
+
"account-custom-asset.read",
|
|
56174
|
+
"account-custom-asset.write",
|
|
56175
|
+
"account-custom-error-rules.read",
|
|
56176
|
+
"account-custom-error-rules.write",
|
|
56177
|
+
"account-custom-pages.read",
|
|
56178
|
+
"account-custom-pages.write",
|
|
56179
|
+
"account-disable-esc.read",
|
|
56180
|
+
"account-disable-esc.write",
|
|
56181
|
+
"account-dns-settings.read",
|
|
56182
|
+
"account-dns-settings.write",
|
|
56183
|
+
"account-firewall-access-rules.read",
|
|
56184
|
+
"account-firewall-access-rules.write",
|
|
56185
|
+
"account-logs.read",
|
|
56186
|
+
"account-logs.write",
|
|
56187
|
+
"account-rule-lists.read",
|
|
56188
|
+
"account-rule-lists.write",
|
|
56189
|
+
"account-rulesets.read",
|
|
56190
|
+
"account-rulesets.write",
|
|
56191
|
+
"account-security-center-insights.read",
|
|
56192
|
+
"account-security-center-insights.write",
|
|
56193
|
+
"account-settings.read",
|
|
56194
|
+
"account-settings.write",
|
|
56195
|
+
"account-ssl-and-certificates.read",
|
|
56196
|
+
"account-waf.read",
|
|
56197
|
+
"account-waf.write",
|
|
56198
|
+
"account-waiting-rooms.read",
|
|
56199
|
+
"address-maps.read",
|
|
56200
|
+
"address-maps.write",
|
|
56201
|
+
"agent-memory.write",
|
|
56202
|
+
"agw.read",
|
|
56203
|
+
"agw.run",
|
|
56204
|
+
"agw.write",
|
|
56205
|
+
"ai-search.index",
|
|
56206
|
+
"ai-search.metadata_read",
|
|
56207
|
+
"ai-search.read",
|
|
56208
|
+
"ai-search.run",
|
|
56209
|
+
"ai-search.write",
|
|
56210
|
+
"ai.read",
|
|
56211
|
+
"ai.write",
|
|
56212
|
+
"aiaudit.read",
|
|
56213
|
+
"aiaudit.write",
|
|
56214
|
+
"aig.metadata_read",
|
|
56215
|
+
"aig.read",
|
|
56216
|
+
"aig.run",
|
|
56217
|
+
"aig.write",
|
|
56218
|
+
"analytics.read",
|
|
56219
|
+
"api-gateway.read",
|
|
56220
|
+
"api-gateway.write",
|
|
56221
|
+
"apps.write",
|
|
56222
|
+
"argotunnel.read",
|
|
56223
|
+
"argotunnel.write",
|
|
56224
|
+
"artifacts.read",
|
|
56225
|
+
"artifacts.write",
|
|
56226
|
+
"bot-management-feedback.read",
|
|
56227
|
+
"bot-management-feedback.write",
|
|
56228
|
+
"bot-management.read",
|
|
56229
|
+
"bot-management.write",
|
|
56230
|
+
"browser-rendering.read",
|
|
56231
|
+
"browser-rendering.write",
|
|
56232
|
+
"cache-settings.read",
|
|
56233
|
+
"cache-settings.write",
|
|
56234
|
+
"cache.purge",
|
|
56235
|
+
"calls.read",
|
|
56236
|
+
"calls.write",
|
|
56237
|
+
"casb.read",
|
|
56238
|
+
"casb.write",
|
|
56239
|
+
"cf-agents.read",
|
|
56240
|
+
"cf-agents.write",
|
|
56241
|
+
"challenge-widgets.read",
|
|
56242
|
+
"challenge-widgets.write",
|
|
56243
|
+
"chinanetwork-steering.read",
|
|
56244
|
+
"chinanetwork-steering.write",
|
|
56245
|
+
"cloud-connector.read",
|
|
56246
|
+
"cloud-connector.write",
|
|
56247
|
+
"cloud-email-security.read",
|
|
56248
|
+
"cloud-email-security.write",
|
|
56249
|
+
"cloudchamber.read",
|
|
56250
|
+
"cloudchamber.write",
|
|
56251
|
+
"cloudforce-one.read",
|
|
56252
|
+
"cloudforce-one.write",
|
|
56253
|
+
"config-settings.read",
|
|
56254
|
+
"config-settings.write",
|
|
56255
|
+
"connectivity-directory.admin",
|
|
56256
|
+
"connectivity-directory.bind",
|
|
56257
|
+
"connectivity-directory.read",
|
|
56258
|
+
"constellation.read",
|
|
56259
|
+
"constellation.write",
|
|
56260
|
+
"containers.read",
|
|
56261
|
+
"containers.write",
|
|
56262
|
+
"custom-errors.read",
|
|
56263
|
+
"custom-errors.write",
|
|
56264
|
+
"custom-pages.read",
|
|
56265
|
+
"custom-pages.write",
|
|
56266
|
+
"d1.metadata_read",
|
|
56267
|
+
"d1.read",
|
|
56268
|
+
"d1.write",
|
|
56269
|
+
"ddos-botnet-feed.read",
|
|
56270
|
+
"ddos-botnet-feed.write",
|
|
56271
|
+
"ddos-protection.read",
|
|
56272
|
+
"ddos-protection.write",
|
|
56273
|
+
"dls.read",
|
|
56274
|
+
"dls.write",
|
|
56275
|
+
"dns-firewall.read",
|
|
56276
|
+
"dns-firewall.write",
|
|
56277
|
+
"dns-view.read",
|
|
56278
|
+
"dns-view.write",
|
|
56279
|
+
"dns.read",
|
|
56280
|
+
"dns.write",
|
|
56281
|
+
"domain-page-shield.read",
|
|
56282
|
+
"domain-page.shield",
|
|
56283
|
+
"dynamic-redirect.read",
|
|
56284
|
+
"dynamic-redirect.write",
|
|
56285
|
+
"email-routing-account-rule.read",
|
|
56286
|
+
"email-routing-address.read",
|
|
56287
|
+
"email-routing-address.write",
|
|
56288
|
+
"email-routing-rule.read",
|
|
56289
|
+
"email-routing-rule.write",
|
|
56290
|
+
"email-routing-suppression.read",
|
|
56291
|
+
"email-routing-suppression.write",
|
|
56292
|
+
"email-security-dmarcreports.read",
|
|
56293
|
+
"email-security-dmarcreports.write",
|
|
56294
|
+
"email-sending.read",
|
|
56295
|
+
"email-sending.write",
|
|
56296
|
+
"fbm.admin",
|
|
56297
|
+
"fbm.read",
|
|
56298
|
+
"fbm.write",
|
|
56299
|
+
"field-extractor.read",
|
|
56300
|
+
"field-extractor.write",
|
|
56301
|
+
"firewall-for-ai.read",
|
|
56302
|
+
"firewall-for-ai.write",
|
|
56303
|
+
"firewall-services.read",
|
|
56304
|
+
"firewall-services.write",
|
|
56305
|
+
"flagship.evaluate",
|
|
56306
|
+
"flagship.read",
|
|
56307
|
+
"flagship.write",
|
|
56308
|
+
"fraud-detection-pii.read",
|
|
56309
|
+
"fraud-detection.read",
|
|
56310
|
+
"fraud-detection.write",
|
|
56311
|
+
"fraud-events.write",
|
|
56312
|
+
"fraud-feedback.read",
|
|
56313
|
+
"fraud-feedback.write",
|
|
56314
|
+
"healthcheck.read",
|
|
56315
|
+
"healthcheck.write",
|
|
56316
|
+
"http-applications.read",
|
|
56317
|
+
"http-applications.write",
|
|
56318
|
+
"http-ddos-managed-ruleset.read",
|
|
56319
|
+
"http-ddos-managed-ruleset.write",
|
|
56320
|
+
"images.metadata_read",
|
|
56321
|
+
"images.read",
|
|
56322
|
+
"images.write",
|
|
56323
|
+
"integration.write",
|
|
56324
|
+
"intel.read",
|
|
56325
|
+
"intel.write",
|
|
56326
|
+
"iot.read",
|
|
56327
|
+
"iot.write",
|
|
56328
|
+
"ip-prefix-bgp-on-demand.read",
|
|
56329
|
+
"ip-prefix-bgp-on-demand.write",
|
|
56330
|
+
"ip-prefix.read",
|
|
56331
|
+
"ip-prefix.write",
|
|
56332
|
+
"l4-ddos-managed-ruleset.read",
|
|
56333
|
+
"l4-ddos-managed-ruleset.write",
|
|
56334
|
+
"load-balancers-account.read",
|
|
56335
|
+
"load-balancers-account.write",
|
|
56336
|
+
"load-balancers.read",
|
|
56337
|
+
"load-balancers.write",
|
|
56338
|
+
"load-balancing-monitors-and-pools.read",
|
|
56339
|
+
"load-balancing-monitors-and-pools.write",
|
|
56340
|
+
"magic-firewall.read",
|
|
56341
|
+
"magic-firewall.write",
|
|
56342
|
+
"magic-transit.read",
|
|
56343
|
+
"magic-transit.write",
|
|
56344
|
+
"magic-wan.read",
|
|
56345
|
+
"magic-wan.write",
|
|
56346
|
+
"managed-headers.read",
|
|
56347
|
+
"managed-headers.write",
|
|
56348
|
+
"mass-url-redirects.read",
|
|
56349
|
+
"mass-url-redirects.write",
|
|
56350
|
+
"mcp-portals.read",
|
|
56351
|
+
"mcp-portals.write",
|
|
56352
|
+
"memberships.read",
|
|
56353
|
+
"memberships.write",
|
|
56354
|
+
"messaging.edit",
|
|
56355
|
+
"messaging.metadata_read",
|
|
56356
|
+
"messaging.read",
|
|
56357
|
+
"moq.read",
|
|
56358
|
+
"moq.write",
|
|
56359
|
+
"notifications.read",
|
|
56360
|
+
"notifications.write",
|
|
56361
|
+
"origin.read",
|
|
56362
|
+
"origin.write",
|
|
56363
|
+
"page-rules.read",
|
|
56364
|
+
"page-rules.write",
|
|
56365
|
+
"page-shield.read",
|
|
56366
|
+
"page.read",
|
|
56367
|
+
"page.shield",
|
|
56368
|
+
"page.write",
|
|
56369
|
+
"pages.metadata_read",
|
|
56370
|
+
"payments-gateway.read",
|
|
56371
|
+
"payments-gateway.write",
|
|
56372
|
+
"pcaps-api.read",
|
|
56373
|
+
"pcaps-api.write",
|
|
56374
|
+
"pipelines.read",
|
|
56375
|
+
"pipelines.send",
|
|
56376
|
+
"pipelines.write",
|
|
56377
|
+
"precursor.read",
|
|
56378
|
+
"precursor.write",
|
|
56379
|
+
"pubsub.read",
|
|
56380
|
+
"pubsub.write",
|
|
56381
|
+
"query-cache.read",
|
|
56382
|
+
"query-cache.write",
|
|
56383
|
+
"queues.metadata_read",
|
|
56384
|
+
"queues.read",
|
|
56385
|
+
"queues.write",
|
|
56386
|
+
"r2-catalog-sql.read",
|
|
56387
|
+
"r2-catalog.read",
|
|
56388
|
+
"r2-catalog.write",
|
|
56389
|
+
"radar.read",
|
|
56390
|
+
"rag.read",
|
|
56391
|
+
"rag.run",
|
|
56392
|
+
"rag.write",
|
|
56393
|
+
"realtime.admin",
|
|
56394
|
+
"realtime.read",
|
|
56395
|
+
"realtime.write",
|
|
56396
|
+
"registrar-sandbox-domains.admin",
|
|
56397
|
+
"registrar-sandbox-domains.read",
|
|
56398
|
+
"reports-application-security-report.read",
|
|
56399
|
+
"request-tracer.read",
|
|
56400
|
+
"resource-library.read",
|
|
56401
|
+
"resource-library.write",
|
|
56402
|
+
"resource-sharing.read",
|
|
56403
|
+
"response-compression.read",
|
|
56404
|
+
"response-compression.write",
|
|
56405
|
+
"sanitize.read",
|
|
56406
|
+
"sanitize.write",
|
|
56407
|
+
"secrets-store.read",
|
|
56408
|
+
"secrets-store.write",
|
|
56409
|
+
"select-configuration.read",
|
|
56410
|
+
"select-configuration.write",
|
|
56411
|
+
"stream.metadata_read",
|
|
56412
|
+
"stream.read",
|
|
56413
|
+
"stream.write",
|
|
56414
|
+
"tag.read",
|
|
56415
|
+
"tag.write",
|
|
56416
|
+
"teams-cds-compute-account.read",
|
|
56417
|
+
"teams-cds-compute-account.write",
|
|
56418
|
+
"teams-connector-cloudflared.monitoring",
|
|
56419
|
+
"teams-connector-cloudflared.read",
|
|
56420
|
+
"teams-connector-cloudflared.write",
|
|
56421
|
+
"teams-connector-warp.read",
|
|
56422
|
+
"teams-connector-warp.write",
|
|
56423
|
+
"teams-connectors.read",
|
|
56424
|
+
"teams-connectors.write",
|
|
56425
|
+
"teams-dex.read",
|
|
56426
|
+
"teams-dex.write",
|
|
56427
|
+
"teams-networks.read",
|
|
56428
|
+
"teams-networks.write",
|
|
56429
|
+
"teams-pii.read",
|
|
56430
|
+
"teams-resilience.read",
|
|
56431
|
+
"teams-resilience.write",
|
|
56432
|
+
"teams-secure.location",
|
|
56433
|
+
"teams.read",
|
|
56434
|
+
"teams.report",
|
|
56435
|
+
"teams.write",
|
|
56436
|
+
"transform-rules.read",
|
|
56437
|
+
"transform-rules.write",
|
|
56438
|
+
"trust-and-safety.read",
|
|
56439
|
+
"trust-and-safety.write",
|
|
56440
|
+
"url-scanner.read",
|
|
56441
|
+
"url-scanner.write",
|
|
56442
|
+
"user-details.read",
|
|
56443
|
+
"user-details.write",
|
|
56444
|
+
"vectorize.read",
|
|
56445
|
+
"vectorize.write",
|
|
56446
|
+
"waiting-rooms.read",
|
|
56447
|
+
"waiting-rooms.write",
|
|
56448
|
+
"web3-hostnames.read",
|
|
56449
|
+
"web3-hostnames.write",
|
|
56450
|
+
"websearch.metadata_read",
|
|
56451
|
+
"websearch.read",
|
|
56452
|
+
"websearch.write",
|
|
56453
|
+
"workers-ci.read",
|
|
56454
|
+
"workers-ci.write",
|
|
56455
|
+
"workers-kv-storage.metadata_read",
|
|
56456
|
+
"workers-kv-storage.read",
|
|
56457
|
+
"workers-kv-storage.write",
|
|
56458
|
+
"workers-observability-telemetry.write",
|
|
56459
|
+
"workers-observability.read",
|
|
56460
|
+
"workers-observability.write",
|
|
56461
|
+
"workers-r2-bucket-item.read",
|
|
56462
|
+
"workers-r2-bucket-item.write",
|
|
56463
|
+
"workers-r2.metadata_read",
|
|
56464
|
+
"workers-r2.read",
|
|
56465
|
+
"workers-r2.write",
|
|
56466
|
+
"workers-routes.read",
|
|
56467
|
+
"workers-routes.write",
|
|
56468
|
+
"workers-scripts.bind",
|
|
56469
|
+
"workers-scripts.read",
|
|
56470
|
+
"workers-scripts.write",
|
|
56471
|
+
"workers-tail.read",
|
|
56472
|
+
"workers_ai.metadata_read",
|
|
56473
|
+
"zaraz.edit",
|
|
56474
|
+
"zaraz.read",
|
|
56475
|
+
"zaraz.write",
|
|
56476
|
+
"zone-access.read",
|
|
56477
|
+
"zone-access.revoke",
|
|
56478
|
+
"zone-access.write",
|
|
56479
|
+
"zone-custom-asset.read",
|
|
56480
|
+
"zone-custom-asset.write",
|
|
56481
|
+
"zone-disable-esc.read",
|
|
56482
|
+
"zone-disable-esc.write",
|
|
56483
|
+
"zone-dns-settings.read",
|
|
56484
|
+
"zone-dns-settings.write",
|
|
56485
|
+
"zone-security-center-insights.read",
|
|
56486
|
+
"zone-security-center-insights.write",
|
|
56487
|
+
"zone-settings.read",
|
|
56488
|
+
"zone-settings.write",
|
|
56489
|
+
"zone-transform-rules.read",
|
|
56490
|
+
"zone-transform-rules.write",
|
|
56491
|
+
"zone-versioning.read",
|
|
56492
|
+
"zone-versioning.write",
|
|
56493
|
+
"zone-waf.read",
|
|
56494
|
+
"zone-waf.write",
|
|
56495
|
+
"zone.read",
|
|
56496
|
+
"zone.write"
|
|
56497
|
+
];
|
|
56498
|
+
var DefaultScopeKeys$1 = [...[
|
|
55994
56499
|
"openid",
|
|
55995
56500
|
"offline",
|
|
55996
56501
|
"user:read",
|
|
@@ -56079,13 +56584,12 @@ var CF_SCOPES = [
|
|
|
56079
56584
|
"workers_scripts:write",
|
|
56080
56585
|
"workers_tail:read",
|
|
56081
56586
|
"zone:read"
|
|
56082
|
-
];
|
|
56083
|
-
var DefaultScopeKeys$1 = [...CF_SCOPES];
|
|
56587
|
+
]];
|
|
56084
56588
|
function setLoginScopeKeys$1(scopes) {
|
|
56085
56589
|
DefaultScopeKeys$1 = scopes;
|
|
56086
56590
|
}
|
|
56087
56591
|
__name$2(setLoginScopeKeys$1, "setLoginScopeKeys");
|
|
56088
|
-
var CF_SCOPE_SET = new Set(
|
|
56592
|
+
var CF_SCOPE_SET = new Set(CF_REGISTERED_SCOPES);
|
|
56089
56593
|
function validateScopeKeys$1(scopes) {
|
|
56090
56594
|
return scopes.every((scope) => CF_SCOPE_SET.has(scope));
|
|
56091
56595
|
}
|
|
@@ -56114,12 +56618,13 @@ var CF_CLI = {
|
|
|
56114
56618
|
login: "cf auth login",
|
|
56115
56619
|
whoami: "cf auth whoami",
|
|
56116
56620
|
createProfile: "cf auth create",
|
|
56117
|
-
deviceLogin: "cf auth login
|
|
56621
|
+
deviceLogin: "cf auth login"
|
|
56118
56622
|
},
|
|
56119
56623
|
keyringServiceName: CF_KEYRING_SERVICE_NAME,
|
|
56120
56624
|
clientId: getClientIdFromEnv$1,
|
|
56121
56625
|
consent: CF_CONSENT_PAGES,
|
|
56122
56626
|
redirectUri: CF_OAUTH_CALLBACK_URL,
|
|
56627
|
+
useDeviceFlowByDefault: true,
|
|
56123
56628
|
allowGlobalAuthKey: false,
|
|
56124
56629
|
getConfigPath: getCfConfigPath,
|
|
56125
56630
|
getTemporaryAccountConfigPath: getCfTemporaryAccountConfigPath,
|
|
@@ -56174,7 +56679,6 @@ var DefaultScopes = {
|
|
|
56174
56679
|
"ai:write": "See and change Workers AI catalog and assets",
|
|
56175
56680
|
"ai-search:write": "See and change AI Search data",
|
|
56176
56681
|
"ai-search:run": "Run search queries on your AI Search instances",
|
|
56177
|
-
"websearch.run": "Run search queries against Cloudflare Web Search",
|
|
56178
56682
|
"agent-memory:write": "See and change Agent Memory data such as keys and namespaces.",
|
|
56179
56683
|
"queues:write": "See and change Cloudflare Queues settings and data",
|
|
56180
56684
|
"pipelines:write": "See and change Cloudflare Pipelines configurations and data",
|
|
@@ -59982,7 +60486,7 @@ var require_command_exists = /* @__PURE__ */ __commonJS$2({ "../../node_modules/
|
|
|
59982
60486
|
}) });
|
|
59983
60487
|
|
|
59984
60488
|
//#endregion
|
|
59985
|
-
//#region ../deploy-helpers/dist/chunk-
|
|
60489
|
+
//#region ../deploy-helpers/dist/chunk-QBZBEHZB.mjs
|
|
59986
60490
|
var import_undici$1 = require_undici();
|
|
59987
60491
|
var import_command_exists = require_command_exists();
|
|
59988
60492
|
function handleUnsafeCapnp(capnp) {
|
|
@@ -60059,7 +60563,6 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
60059
60563
|
const vectorize = extractBindingsOfType("vectorize", bindings);
|
|
60060
60564
|
const ai_search_namespaces = extractBindingsOfType("ai_search_namespace", bindings);
|
|
60061
60565
|
const ai_search = extractBindingsOfType("ai_search", bindings);
|
|
60062
|
-
const websearch = extractBindingsOfType("websearch", bindings)[0];
|
|
60063
60566
|
const agent_memory = extractBindingsOfType("agent_memory", bindings);
|
|
60064
60567
|
const hyperdrive = extractBindingsOfType("hyperdrive", bindings);
|
|
60065
60568
|
const secrets_store_secrets = extractBindingsOfType("secrets_store_secret", bindings);
|
|
@@ -60235,10 +60738,6 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
60235
60738
|
instance_name
|
|
60236
60739
|
});
|
|
60237
60740
|
});
|
|
60238
|
-
if (websearch !== void 0) metadataBindings.push({
|
|
60239
|
-
name: websearch.binding,
|
|
60240
|
-
type: "websearch"
|
|
60241
|
-
});
|
|
60242
60741
|
agent_memory.forEach(({ binding, namespace }) => {
|
|
60243
60742
|
if (options?.dryRun) namespace ??= INHERIT_SYMBOL;
|
|
60244
60743
|
if (namespace === void 0) throw new UserError$1(`${binding} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the namespace to bind to.`, { telemetryMessage: false });
|
|
@@ -60542,7 +61041,7 @@ __name$1(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
60542
61041
|
//#endregion
|
|
60543
61042
|
//#region ../remote-bindings/dist/index.mjs
|
|
60544
61043
|
var import_undici = require_undici();
|
|
60545
|
-
var version = "0.0.
|
|
61044
|
+
var version = "0.0.25";
|
|
60546
61045
|
var NoDefaultValueProvided = class extends UserError$1 {
|
|
60547
61046
|
constructor() {
|
|
60548
61047
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|
|
@@ -61647,10 +62146,6 @@ const KnownBindingSchema = z$1.discriminatedUnion("type", [
|
|
|
61647
62146
|
const value = input;
|
|
61648
62147
|
return value.tunnelId !== void 0 && value.networkId !== void 0 ? `"vpc-network" bindings must specify exactly one of "tunnelId" or "networkId", not both` : `"vpc-network" bindings must specify either "tunnelId" or "networkId"`;
|
|
61649
62148
|
} }),
|
|
61650
|
-
z$1.strictObject({
|
|
61651
|
-
type: z$1.literal("web-search"),
|
|
61652
|
-
dev: RemoteBindingDevSchema.optional()
|
|
61653
|
-
}),
|
|
61654
62149
|
WorkerBindingSchema,
|
|
61655
62150
|
z$1.strictObject({ type: z$1.literal("worker-loader") })
|
|
61656
62151
|
]);
|
|
@@ -61689,8 +62184,7 @@ const SINGLETON_BINDING_TYPES = new Set([
|
|
|
61689
62184
|
"images",
|
|
61690
62185
|
"media",
|
|
61691
62186
|
"stream",
|
|
61692
|
-
"version-metadata"
|
|
61693
|
-
"web-search"
|
|
62187
|
+
"version-metadata"
|
|
61694
62188
|
]);
|
|
61695
62189
|
const listFormatter = new Intl.ListFormat("en-US");
|
|
61696
62190
|
function validateSingletonBindings(env$2, ctx) {
|
|
@@ -62596,12 +63090,6 @@ function convertBindingsAndAssets(config$1, result) {
|
|
|
62596
63090
|
remote: binding.dev?.remote
|
|
62597
63091
|
}));
|
|
62598
63092
|
break;
|
|
62599
|
-
case "web-search":
|
|
62600
|
-
result.websearch = omitUndefined({
|
|
62601
|
-
binding: name,
|
|
62602
|
-
remote: binding.dev?.remote
|
|
62603
|
-
});
|
|
62604
|
-
break;
|
|
62605
63093
|
case "worker":
|
|
62606
63094
|
services.push(omitUndefined({
|
|
62607
63095
|
binding: name,
|