@cloudflare/workers-utils 0.33.1 → 0.35.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/dist/browser.d.mts +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/chunk-3IYLA2JH.mjs +73 -0
- package/dist/{chunk-IV7UMGT2.mjs → chunk-6VP24PQU.mjs} +1 -1
- package/dist/chunk-7AX24RFK.mjs +265 -0
- package/dist/chunk-C6O4ION7.mjs +42 -0
- package/dist/chunk-MCNIGVAF.mjs +45 -0
- package/dist/{chunk-QFKPUV4H.mjs → chunk-V6JSHOVJ.mjs} +16 -115
- package/dist/chunk-WO2IAW6M.mjs +62 -0
- package/dist/chunk-XUGGRRBO.mjs +178 -0
- package/dist/compatibility-date.d.mts +80 -0
- package/dist/compatibility-date.mjs +2 -0
- package/dist/{config-CRUFg2tu.d.mts → compliance-j3-tqeao.d.mts} +64 -17
- package/dist/compliance.d.mts +4 -0
- package/dist/compliance.mjs +7 -0
- package/dist/docker-path.d.mts +8 -0
- package/dist/docker-path.mjs +3 -0
- package/dist/errors.d.mts +55 -0
- package/dist/errors.mjs +2 -0
- package/dist/index.d.mts +238 -145
- package/dist/index.mjs +1656 -703
- package/dist/metafile-esm.json +1 -1
- package/dist/open-PBXRGS4R.mjs +3 -3
- package/dist/test-helpers/index.d.mts +6 -2
- package/dist/test-helpers/index.mjs +39 -2
- package/dist/zod-format.d.mts +6 -0
- package/dist/zod-format.mjs +2 -0
- package/package.json +24 -3
package/dist/index.mjs
CHANGED
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { MetricsRegistry } from './chunk-Z62CVNHJ.mjs';
|
|
2
|
+
export { _forceColour, formatZodError } from './chunk-7AX24RFK.mjs';
|
|
3
|
+
import { isRedirectedRawConfig, configFileName, formatConfigSnippet, getDurableObjectExports, getContainerNameToClassNameMap, parsePackageJSON, readFileSync, ParseError, parseJSON, APIError, dir, parseTOML, modify, applyEdits, format, dist_default, parseJSONC } from './chunk-V6JSHOVJ.mjs';
|
|
4
|
+
export { APIError, ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, PATH_TO_DEPLOY_CONFIG, ParseError, SERVICE_TAG_PREFIX, configFileName, configFormat, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectExports, hasDurableObjectExports, indexLocation, isRedirectedConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveWranglerConfigPath, searchLocation } from './chunk-V6JSHOVJ.mjs';
|
|
5
|
+
import { assertNever } from './chunk-6VP24PQU.mjs';
|
|
6
|
+
export { DEFAULT_COMPAT_DATE, assertNever, constructWranglerConfig, mapWorkerMetadataBindings } from './chunk-6VP24PQU.mjs';
|
|
7
|
+
export { NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, getTodaysCompatDate, isCompatDate, isNodejsCompatDefaultOn, resolveNodejsCompat, stripRedundantNodejsCompatFlags } from './chunk-C6O4ION7.mjs';
|
|
8
|
+
import { getCloudflareEnv, getCloudflaredPathFromEnv, getCloudflareApiBaseUrl, getTraceHeader, getOutputFilePathFromEnv, getOutputFileDirectoryFromEnv, getCIOverrideName, getWranglerCacheDirFromEnv } from './chunk-XUGGRRBO.mjs';
|
|
9
|
+
export { COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getNoSkillsUpdatePromptsFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, isDoNotTrackEnabled } from './chunk-XUGGRRBO.mjs';
|
|
10
|
+
import { dedent } from './chunk-MCNIGVAF.mjs';
|
|
11
|
+
export { getBooleanEnvironmentVariableFactory, getDockerPath, getEnvironmentVariableFactory } from './chunk-3IYLA2JH.mjs';
|
|
12
|
+
import { UserError, FatalError } from './chunk-WO2IAW6M.mjs';
|
|
13
|
+
export { CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, UserError, createFatalError } from './chunk-WO2IAW6M.mjs';
|
|
2
14
|
import { getGlobalConfigPath } from './chunk-34VZWBGB.mjs';
|
|
3
15
|
export { getGlobalConfigPath, getGlobalWranglerCachePath } from './chunk-34VZWBGB.mjs';
|
|
4
|
-
export { MetricsRegistry } from './chunk-Z62CVNHJ.mjs';
|
|
5
|
-
import { UserError, isRedirectedRawConfig, dedent, configFileName, formatConfigSnippet, getDurableObjectExports, getContainerNameToClassNameMap, FatalError, parsePackageJSON, readFileSync, ParseError, parseJSON, APIError, dir, parseTOML, modify, applyEdits, format, dist_default, parseJSONC } from './chunk-QFKPUV4H.mjs';
|
|
6
|
-
export { APIError, CommandLineArgsError, DeprecationError, ENVIRONMENT_TAG_PREFIX, FatalError, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, JsonFriendlyFatalError, MissingConfigError, PATH_TO_DEPLOY_CONFIG, ParseError, SERVICE_TAG_PREFIX, UserError, configFileName, configFormat, createFatalError, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectExports, hasDurableObjectExports, indexLocation, isRedirectedConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveWranglerConfigPath, searchLocation } from './chunk-QFKPUV4H.mjs';
|
|
7
16
|
import { isDirectory, removeDirSync } from './chunk-53IMCORZ.mjs';
|
|
8
17
|
export { isDirectory, removeDir, removeDirSync } from './chunk-53IMCORZ.mjs';
|
|
9
18
|
import { __commonJS, __name, __require, __export, __toESM } from './chunk-Q72B4Q5Z.mjs';
|
|
10
|
-
import fs2, { statSync, accessSync, constants, writeFileSync, renameSync, existsSync, unlinkSync, mkdirSync, chmodSync, readFileSync as readFileSync$1 } from 'node:fs';
|
|
19
|
+
import fs2, { statSync, accessSync, constants, writeFileSync, renameSync, existsSync, unlinkSync, mkdirSync, chmodSync, readFileSync as readFileSync$1, appendFileSync } from 'node:fs';
|
|
11
20
|
import assert2 from 'node:assert';
|
|
12
|
-
import * as
|
|
13
|
-
import
|
|
21
|
+
import * as path from 'node:path';
|
|
22
|
+
import path__default, { join, dirname, resolve, basename } from 'node:path';
|
|
23
|
+
import { stripVTControlCharacters } from 'node:util';
|
|
24
|
+
import chalk from 'chalk';
|
|
14
25
|
import { execFileSync, spawn } from 'node:child_process';
|
|
15
|
-
import { createHash } from 'node:crypto';
|
|
26
|
+
import { createHash, randomBytes } from 'node:crypto';
|
|
16
27
|
import { arch } from 'node:os';
|
|
17
28
|
import { fetch, Headers, FormData, Response } from 'undici';
|
|
18
29
|
import { URLSearchParams } from 'node:url';
|
|
19
30
|
import * as timersPromises from 'node:timers/promises';
|
|
20
31
|
import { setTimeout as setTimeout$1 } from 'node:timers/promises';
|
|
21
|
-
import util from 'node:util';
|
|
22
32
|
import { assert as assert$1 } from 'node:console';
|
|
23
33
|
|
|
24
34
|
// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json
|
|
25
35
|
var require_vendors = __commonJS({
|
|
26
|
-
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports, module) {
|
|
36
|
+
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports$1, module) {
|
|
27
37
|
module.exports = [
|
|
28
38
|
{
|
|
29
39
|
name: "Agola CI",
|
|
@@ -392,33 +402,33 @@ var require_vendors = __commonJS({
|
|
|
392
402
|
|
|
393
403
|
// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js
|
|
394
404
|
var require_ci_info = __commonJS({
|
|
395
|
-
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports) {
|
|
405
|
+
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports$1) {
|
|
396
406
|
var vendors = require_vendors();
|
|
397
407
|
var env = process.env;
|
|
398
|
-
Object.defineProperty(exports, "_vendors", {
|
|
408
|
+
Object.defineProperty(exports$1, "_vendors", {
|
|
399
409
|
value: vendors.map(function(v) {
|
|
400
410
|
return v.constant;
|
|
401
411
|
})
|
|
402
412
|
});
|
|
403
|
-
exports.name = null;
|
|
404
|
-
exports.isPR = null;
|
|
405
|
-
exports.id = null;
|
|
413
|
+
exports$1.name = null;
|
|
414
|
+
exports$1.isPR = null;
|
|
415
|
+
exports$1.id = null;
|
|
406
416
|
if (env.CI !== "false") {
|
|
407
417
|
vendors.forEach(function(vendor) {
|
|
408
418
|
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
|
|
409
419
|
const isCI2 = envs.every(function(obj) {
|
|
410
420
|
return checkEnv(obj);
|
|
411
421
|
});
|
|
412
|
-
exports[vendor.constant] = isCI2;
|
|
422
|
+
exports$1[vendor.constant] = isCI2;
|
|
413
423
|
if (!isCI2) {
|
|
414
424
|
return;
|
|
415
425
|
}
|
|
416
|
-
exports.name = vendor.name;
|
|
417
|
-
exports.isPR = checkPR(vendor);
|
|
418
|
-
exports.id = vendor.constant;
|
|
426
|
+
exports$1.name = vendor.name;
|
|
427
|
+
exports$1.isPR = checkPR(vendor);
|
|
428
|
+
exports$1.id = vendor.constant;
|
|
419
429
|
});
|
|
420
430
|
}
|
|
421
|
-
exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
|
431
|
+
exports$1.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
|
422
432
|
(env.BUILD_ID || // Jenkins, Cloudbees
|
|
423
433
|
env.BUILD_NUMBER || // Jenkins, TeamCity
|
|
424
434
|
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers
|
|
@@ -428,7 +438,7 @@ var require_ci_info = __commonJS({
|
|
|
428
438
|
env.CI_NAME || // Codeship and others
|
|
429
439
|
env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
|
|
430
440
|
env.RUN_ID || // TaskCluster, dsari
|
|
431
|
-
exports.name || false));
|
|
441
|
+
exports$1.name || false));
|
|
432
442
|
function checkEnv(obj) {
|
|
433
443
|
if (typeof obj === "string") return !!env[obj];
|
|
434
444
|
if ("env" in obj) {
|
|
@@ -474,11 +484,11 @@ var require_ci_info = __commonJS({
|
|
|
474
484
|
|
|
475
485
|
// ../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js
|
|
476
486
|
var require_command_exists = __commonJS({
|
|
477
|
-
"../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports, module) {
|
|
487
|
+
"../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports$1, module) {
|
|
478
488
|
var exec = __require("child_process").exec;
|
|
479
489
|
var execSync = __require("child_process").execSync;
|
|
480
490
|
var fs3 = __require("fs");
|
|
481
|
-
var
|
|
491
|
+
var path5 = __require("path");
|
|
482
492
|
var access = fs3.access;
|
|
483
493
|
var accessSync2 = fs3.accessSync;
|
|
484
494
|
var constants2 = fs3.constants || fs3;
|
|
@@ -582,9 +592,9 @@ var require_command_exists = __commonJS({
|
|
|
582
592
|
cleanInput = /* @__PURE__ */ __name(function(s) {
|
|
583
593
|
var isPathName = /[\\]/.test(s);
|
|
584
594
|
if (isPathName) {
|
|
585
|
-
var
|
|
586
|
-
var basename2 = '"' +
|
|
587
|
-
return
|
|
595
|
+
var dirname4 = '"' + path5.dirname(s) + '"';
|
|
596
|
+
var basename2 = '"' + path5.basename(s) + '"';
|
|
597
|
+
return dirname4 + ":" + basename2;
|
|
588
598
|
}
|
|
589
599
|
return '"' + s + '"';
|
|
590
600
|
}, "cleanInput");
|
|
@@ -592,10 +602,10 @@ var require_command_exists = __commonJS({
|
|
|
592
602
|
module.exports = /* @__PURE__ */ __name(function commandExists(commandName, callback) {
|
|
593
603
|
var cleanedCommandName = cleanInput(commandName);
|
|
594
604
|
if (!callback && typeof Promise !== "undefined") {
|
|
595
|
-
return new Promise(function(
|
|
605
|
+
return new Promise(function(resolve3, reject) {
|
|
596
606
|
commandExists(commandName, function(error51, output) {
|
|
597
607
|
if (output) {
|
|
598
|
-
|
|
608
|
+
resolve3(commandName);
|
|
599
609
|
} else {
|
|
600
610
|
reject(error51);
|
|
601
611
|
}
|
|
@@ -621,18 +631,18 @@ var require_command_exists = __commonJS({
|
|
|
621
631
|
|
|
622
632
|
// ../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js
|
|
623
633
|
var require_command_exists2 = __commonJS({
|
|
624
|
-
"../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports, module) {
|
|
634
|
+
"../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports$1, module) {
|
|
625
635
|
module.exports = require_command_exists();
|
|
626
636
|
}
|
|
627
637
|
});
|
|
628
638
|
|
|
629
639
|
// ../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js
|
|
630
640
|
var require_ini = __commonJS({
|
|
631
|
-
"../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports) {
|
|
632
|
-
exports.parse = exports.decode = decode3;
|
|
633
|
-
exports.stringify = exports.encode = encode3;
|
|
634
|
-
exports.safe = safe;
|
|
635
|
-
exports.unsafe = unsafe;
|
|
641
|
+
"../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports$1) {
|
|
642
|
+
exports$1.parse = exports$1.decode = decode3;
|
|
643
|
+
exports$1.stringify = exports$1.encode = encode3;
|
|
644
|
+
exports$1.safe = safe;
|
|
645
|
+
exports$1.unsafe = unsafe;
|
|
636
646
|
var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
|
|
637
647
|
function encode3(obj, opt) {
|
|
638
648
|
var children = [];
|
|
@@ -796,7 +806,7 @@ var require_ini = __commonJS({
|
|
|
796
806
|
|
|
797
807
|
// ../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js
|
|
798
808
|
var require_strip_json_comments = __commonJS({
|
|
799
|
-
"../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports, module) {
|
|
809
|
+
"../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports$1, module) {
|
|
800
810
|
var singleComment = 1;
|
|
801
811
|
var multiComment = 2;
|
|
802
812
|
function stripWithoutWhitespace() {
|
|
@@ -864,35 +874,35 @@ var require_strip_json_comments = __commonJS({
|
|
|
864
874
|
|
|
865
875
|
// ../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js
|
|
866
876
|
var require_utils = __commonJS({
|
|
867
|
-
"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports) {
|
|
877
|
+
"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports$1) {
|
|
868
878
|
var fs3 = __require("fs");
|
|
869
879
|
var ini = require_ini();
|
|
870
|
-
var
|
|
880
|
+
var path5 = __require("path");
|
|
871
881
|
var stripJsonComments = require_strip_json_comments();
|
|
872
|
-
var parse3 = exports.parse = function(content) {
|
|
882
|
+
var parse3 = exports$1.parse = function(content) {
|
|
873
883
|
if (/^\s*{/.test(content))
|
|
874
884
|
return JSON.parse(stripJsonComments(content));
|
|
875
885
|
return ini.parse(content);
|
|
876
886
|
};
|
|
877
|
-
var file2 = exports.file = function() {
|
|
887
|
+
var file2 = exports$1.file = function() {
|
|
878
888
|
var args = [].slice.call(arguments).filter(function(arg) {
|
|
879
889
|
return arg != null;
|
|
880
890
|
});
|
|
881
891
|
for (var i in args)
|
|
882
892
|
if ("string" !== typeof args[i])
|
|
883
893
|
return;
|
|
884
|
-
var file3 =
|
|
894
|
+
var file3 = path5.join.apply(null, args);
|
|
885
895
|
try {
|
|
886
896
|
return fs3.readFileSync(file3, "utf-8");
|
|
887
897
|
} catch (err) {
|
|
888
898
|
return;
|
|
889
899
|
}
|
|
890
900
|
};
|
|
891
|
-
exports.json = function() {
|
|
901
|
+
exports$1.json = function() {
|
|
892
902
|
var content = file2.apply(null, arguments);
|
|
893
903
|
return content ? parse3(content) : null;
|
|
894
904
|
};
|
|
895
|
-
exports.env = function(prefix, env2) {
|
|
905
|
+
exports$1.env = function(prefix, env2) {
|
|
896
906
|
env2 = env2 || process.env;
|
|
897
907
|
var obj = {};
|
|
898
908
|
var l = prefix.length;
|
|
@@ -917,16 +927,16 @@ var require_utils = __commonJS({
|
|
|
917
927
|
}
|
|
918
928
|
return obj;
|
|
919
929
|
};
|
|
920
|
-
exports.find = function() {
|
|
921
|
-
var rel =
|
|
930
|
+
exports$1.find = function() {
|
|
931
|
+
var rel = path5.join.apply(null, [].slice.call(arguments));
|
|
922
932
|
function find2(start, rel2) {
|
|
923
|
-
var file3 =
|
|
933
|
+
var file3 = path5.join(start, rel2);
|
|
924
934
|
try {
|
|
925
935
|
fs3.statSync(file3);
|
|
926
936
|
return file3;
|
|
927
937
|
} catch (err) {
|
|
928
|
-
if (
|
|
929
|
-
return find2(
|
|
938
|
+
if (path5.dirname(start) !== start)
|
|
939
|
+
return find2(path5.dirname(start), rel2);
|
|
930
940
|
}
|
|
931
941
|
}
|
|
932
942
|
__name(find2, "find");
|
|
@@ -937,7 +947,7 @@ var require_utils = __commonJS({
|
|
|
937
947
|
|
|
938
948
|
// ../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js
|
|
939
949
|
var require_deep_extend = __commonJS({
|
|
940
|
-
"../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports, module) {
|
|
950
|
+
"../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports$1, module) {
|
|
941
951
|
function isSpecificValue(val) {
|
|
942
952
|
return val instanceof Buffer || val instanceof Date || val instanceof RegExp ? true : false;
|
|
943
953
|
}
|
|
@@ -1022,7 +1032,7 @@ var require_deep_extend = __commonJS({
|
|
|
1022
1032
|
|
|
1023
1033
|
// ../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js
|
|
1024
1034
|
var require_minimist = __commonJS({
|
|
1025
|
-
"../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports, module) {
|
|
1035
|
+
"../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports$1, module) {
|
|
1026
1036
|
module.exports = function(args, opts) {
|
|
1027
1037
|
if (!opts) opts = {};
|
|
1028
1038
|
var flags = { bools: {}, strings: {}, unknownFn: null };
|
|
@@ -1225,7 +1235,7 @@ var require_minimist = __commonJS({
|
|
|
1225
1235
|
|
|
1226
1236
|
// ../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js
|
|
1227
1237
|
var require_rc = __commonJS({
|
|
1228
|
-
"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports, module) {
|
|
1238
|
+
"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports$1, module) {
|
|
1229
1239
|
var cc = require_utils();
|
|
1230
1240
|
var join3 = __require("path").join;
|
|
1231
1241
|
var deepExtend = require_deep_extend();
|
|
@@ -1277,7 +1287,7 @@ var require_rc = __commonJS({
|
|
|
1277
1287
|
|
|
1278
1288
|
// ../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js
|
|
1279
1289
|
var require_registry_url = __commonJS({
|
|
1280
|
-
"../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports, module) {
|
|
1290
|
+
"../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports$1, module) {
|
|
1281
1291
|
module.exports = function(scope) {
|
|
1282
1292
|
var rc = require_rc()("npm", { registry: "https://registry.npmjs.org/" });
|
|
1283
1293
|
var url2 = rc[scope + ":registry"] || rc.registry;
|
|
@@ -1288,7 +1298,7 @@ var require_registry_url = __commonJS({
|
|
|
1288
1298
|
|
|
1289
1299
|
// ../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js
|
|
1290
1300
|
var require_safe_buffer = __commonJS({
|
|
1291
|
-
"../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports, module) {
|
|
1301
|
+
"../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports$1, module) {
|
|
1292
1302
|
var buffer = __require("buffer");
|
|
1293
1303
|
var Buffer2 = buffer.Buffer;
|
|
1294
1304
|
function copyProps(src, dst) {
|
|
@@ -1300,8 +1310,8 @@ var require_safe_buffer = __commonJS({
|
|
|
1300
1310
|
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
1301
1311
|
module.exports = buffer;
|
|
1302
1312
|
} else {
|
|
1303
|
-
copyProps(buffer, exports);
|
|
1304
|
-
exports.Buffer = SafeBuffer;
|
|
1313
|
+
copyProps(buffer, exports$1);
|
|
1314
|
+
exports$1.Buffer = SafeBuffer;
|
|
1305
1315
|
}
|
|
1306
1316
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
1307
1317
|
return Buffer2(arg, encodingOrOffset, length);
|
|
@@ -1348,7 +1358,7 @@ var require_safe_buffer = __commonJS({
|
|
|
1348
1358
|
|
|
1349
1359
|
// ../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js
|
|
1350
1360
|
var require_base64 = __commonJS({
|
|
1351
|
-
"../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports, module) {
|
|
1361
|
+
"../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports$1, module) {
|
|
1352
1362
|
var safeBuffer = require_safe_buffer().Buffer;
|
|
1353
1363
|
function decodeBase64(base643) {
|
|
1354
1364
|
return safeBuffer.from(base643, "base64").toString("utf8");
|
|
@@ -1367,7 +1377,7 @@ var require_base64 = __commonJS({
|
|
|
1367
1377
|
|
|
1368
1378
|
// ../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js
|
|
1369
1379
|
var require_registry_auth_token = __commonJS({
|
|
1370
|
-
"../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports, module) {
|
|
1380
|
+
"../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports$1, module) {
|
|
1371
1381
|
var url2 = __require("url");
|
|
1372
1382
|
var base643 = require_base64();
|
|
1373
1383
|
var decodeBase64 = base643.decodeBase64;
|
|
@@ -1416,8 +1426,8 @@ var require_registry_auth_token = __commonJS({
|
|
|
1416
1426
|
return void 0;
|
|
1417
1427
|
}
|
|
1418
1428
|
__name(getLegacyAuthInfo, "getLegacyAuthInfo");
|
|
1419
|
-
function normalizePath(
|
|
1420
|
-
return
|
|
1429
|
+
function normalizePath(path5) {
|
|
1430
|
+
return path5[path5.length - 1] === "/" ? path5 : path5 + "/";
|
|
1421
1431
|
}
|
|
1422
1432
|
__name(normalizePath, "normalizePath");
|
|
1423
1433
|
function getAuthInfoForUrl(regUrl, npmrc) {
|
|
@@ -1465,7 +1475,7 @@ var require_registry_auth_token = __commonJS({
|
|
|
1465
1475
|
|
|
1466
1476
|
// ../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js
|
|
1467
1477
|
var require_update_check = __commonJS({
|
|
1468
|
-
"../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports, module) {
|
|
1478
|
+
"../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports$1, module) {
|
|
1469
1479
|
var { URL: URL2 } = __require("url");
|
|
1470
1480
|
var { join: join3 } = __require("path");
|
|
1471
1481
|
var fs3 = __require("fs");
|
|
@@ -1513,7 +1523,7 @@ var require_update_check = __commonJS({
|
|
|
1513
1523
|
});
|
|
1514
1524
|
await writeFile(file2, content, "utf8");
|
|
1515
1525
|
}, "updateCache");
|
|
1516
|
-
var loadPackage = /* @__PURE__ */ __name((url2, authInfo) => new Promise((
|
|
1526
|
+
var loadPackage = /* @__PURE__ */ __name((url2, authInfo) => new Promise((resolve3, reject) => {
|
|
1517
1527
|
const options = {
|
|
1518
1528
|
host: url2.hostname,
|
|
1519
1529
|
path: url2.pathname,
|
|
@@ -1544,7 +1554,7 @@ var require_update_check = __commonJS({
|
|
|
1544
1554
|
response.on("end", () => {
|
|
1545
1555
|
try {
|
|
1546
1556
|
const parsedData = JSON.parse(rawData);
|
|
1547
|
-
|
|
1557
|
+
resolve3(parsedData);
|
|
1548
1558
|
} catch (e2) {
|
|
1549
1559
|
reject(e2);
|
|
1550
1560
|
}
|
|
@@ -1676,6 +1686,7 @@ var defaultWranglerConfig = {
|
|
|
1676
1686
|
consumers: []
|
|
1677
1687
|
// WORKERS SUPPORT ONLY!!
|
|
1678
1688
|
},
|
|
1689
|
+
connect: [],
|
|
1679
1690
|
r2_buckets: [],
|
|
1680
1691
|
d1_databases: [],
|
|
1681
1692
|
vectorize: [],
|
|
@@ -2342,7 +2353,7 @@ var NEVER = /* @__PURE__ */ Object.freeze({
|
|
|
2342
2353
|
});
|
|
2343
2354
|
// @__NO_SIDE_EFFECTS__
|
|
2344
2355
|
function $constructor(name, initializer3, params) {
|
|
2345
|
-
function
|
|
2356
|
+
function init(inst, def) {
|
|
2346
2357
|
if (!inst._zod) {
|
|
2347
2358
|
Object.defineProperty(inst, "_zod", {
|
|
2348
2359
|
value: {
|
|
@@ -2367,7 +2378,7 @@ function $constructor(name, initializer3, params) {
|
|
|
2367
2378
|
}
|
|
2368
2379
|
}
|
|
2369
2380
|
}
|
|
2370
|
-
__name(
|
|
2381
|
+
__name(init, "init");
|
|
2371
2382
|
const Parent = params?.Parent ?? Object;
|
|
2372
2383
|
class Definition extends Parent {
|
|
2373
2384
|
static {
|
|
@@ -2378,7 +2389,7 @@ function $constructor(name, initializer3, params) {
|
|
|
2378
2389
|
function _(def) {
|
|
2379
2390
|
var _a3;
|
|
2380
2391
|
const inst = params?.Parent ? new Definition() : this;
|
|
2381
|
-
|
|
2392
|
+
init(inst, def);
|
|
2382
2393
|
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
2383
2394
|
for (const fn of inst._zod.deferred) {
|
|
2384
2395
|
fn();
|
|
@@ -2386,7 +2397,7 @@ function $constructor(name, initializer3, params) {
|
|
|
2386
2397
|
return inst;
|
|
2387
2398
|
}
|
|
2388
2399
|
__name(_, "_");
|
|
2389
|
-
Object.defineProperty(_, "init", { value:
|
|
2400
|
+
Object.defineProperty(_, "init", { value: init });
|
|
2390
2401
|
Object.defineProperty(_, Symbol.hasInstance, {
|
|
2391
2402
|
value: /* @__PURE__ */ __name((inst) => {
|
|
2392
2403
|
if (params?.Parent && inst instanceof params.Parent)
|
|
@@ -2607,10 +2618,10 @@ function cloneDef(schema) {
|
|
|
2607
2618
|
return mergeDefs(schema._zod.def);
|
|
2608
2619
|
}
|
|
2609
2620
|
__name(cloneDef, "cloneDef");
|
|
2610
|
-
function getElementAtPath(obj,
|
|
2611
|
-
if (!
|
|
2621
|
+
function getElementAtPath(obj, path5) {
|
|
2622
|
+
if (!path5)
|
|
2612
2623
|
return obj;
|
|
2613
|
-
return
|
|
2624
|
+
return path5.reduce((acc, key) => acc?.[key], obj);
|
|
2614
2625
|
}
|
|
2615
2626
|
__name(getElementAtPath, "getElementAtPath");
|
|
2616
2627
|
function promiseAllObject(promisesObj) {
|
|
@@ -3043,11 +3054,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
3043
3054
|
return false;
|
|
3044
3055
|
}
|
|
3045
3056
|
__name(explicitlyAborted, "explicitlyAborted");
|
|
3046
|
-
function prefixIssues(
|
|
3057
|
+
function prefixIssues(path5, issues) {
|
|
3047
3058
|
return issues.map((iss) => {
|
|
3048
3059
|
var _a3;
|
|
3049
3060
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
3050
|
-
iss.path.unshift(
|
|
3061
|
+
iss.path.unshift(path5);
|
|
3051
3062
|
return iss;
|
|
3052
3063
|
});
|
|
3053
3064
|
}
|
|
@@ -3212,16 +3223,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
3212
3223
|
__name(flattenError, "flattenError");
|
|
3213
3224
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
3214
3225
|
const fieldErrors = { _errors: [] };
|
|
3215
|
-
const processError = /* @__PURE__ */ __name((error52,
|
|
3226
|
+
const processError = /* @__PURE__ */ __name((error52, path5 = []) => {
|
|
3216
3227
|
for (const issue2 of error52.issues) {
|
|
3217
3228
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
3218
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
3229
|
+
issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
|
|
3219
3230
|
} else if (issue2.code === "invalid_key") {
|
|
3220
|
-
processError({ issues: issue2.issues }, [...
|
|
3231
|
+
processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
|
|
3221
3232
|
} else if (issue2.code === "invalid_element") {
|
|
3222
|
-
processError({ issues: issue2.issues }, [...
|
|
3233
|
+
processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
|
|
3223
3234
|
} else {
|
|
3224
|
-
const fullpath = [...
|
|
3235
|
+
const fullpath = [...path5, ...issue2.path];
|
|
3225
3236
|
if (fullpath.length === 0) {
|
|
3226
3237
|
fieldErrors._errors.push(mapper(issue2));
|
|
3227
3238
|
} else {
|
|
@@ -3249,17 +3260,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
3249
3260
|
__name(formatError, "formatError");
|
|
3250
3261
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
3251
3262
|
const result = { errors: [] };
|
|
3252
|
-
const processError = /* @__PURE__ */ __name((error52,
|
|
3263
|
+
const processError = /* @__PURE__ */ __name((error52, path5 = []) => {
|
|
3253
3264
|
var _a3, _b;
|
|
3254
3265
|
for (const issue2 of error52.issues) {
|
|
3255
3266
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
3256
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
3267
|
+
issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
|
|
3257
3268
|
} else if (issue2.code === "invalid_key") {
|
|
3258
|
-
processError({ issues: issue2.issues }, [...
|
|
3269
|
+
processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
|
|
3259
3270
|
} else if (issue2.code === "invalid_element") {
|
|
3260
|
-
processError({ issues: issue2.issues }, [...
|
|
3271
|
+
processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
|
|
3261
3272
|
} else {
|
|
3262
|
-
const fullpath = [...
|
|
3273
|
+
const fullpath = [...path5, ...issue2.path];
|
|
3263
3274
|
if (fullpath.length === 0) {
|
|
3264
3275
|
result.errors.push(mapper(issue2));
|
|
3265
3276
|
continue;
|
|
@@ -3292,8 +3303,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
3292
3303
|
__name(treeifyError, "treeifyError");
|
|
3293
3304
|
function toDotPath(_path) {
|
|
3294
3305
|
const segs = [];
|
|
3295
|
-
const
|
|
3296
|
-
for (const seg of
|
|
3306
|
+
const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
3307
|
+
for (const seg of path5) {
|
|
3297
3308
|
if (typeof seg === "number")
|
|
3298
3309
|
segs.push(`[${seg}]`);
|
|
3299
3310
|
else if (typeof seg === "symbol")
|
|
@@ -16349,13 +16360,13 @@ function resolveRef(ref, ctx) {
|
|
|
16349
16360
|
if (!ref.startsWith("#")) {
|
|
16350
16361
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
16351
16362
|
}
|
|
16352
|
-
const
|
|
16353
|
-
if (
|
|
16363
|
+
const path5 = ref.slice(1).split("/").filter(Boolean);
|
|
16364
|
+
if (path5.length === 0) {
|
|
16354
16365
|
return ctx.rootSchema;
|
|
16355
16366
|
}
|
|
16356
16367
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
16357
|
-
if (
|
|
16358
|
-
const key =
|
|
16368
|
+
if (path5[0] === defsKey) {
|
|
16369
|
+
const key = path5[1];
|
|
16359
16370
|
if (!key || !ctx.defs[key]) {
|
|
16360
16371
|
throw new Error(`Reference not found: ${ref}`);
|
|
16361
16372
|
}
|
|
@@ -16800,244 +16811,6 @@ external_exports.object({
|
|
|
16800
16811
|
sensitive: external_exports.literal(SENSITIVE_STEP_OUTPUT).optional()
|
|
16801
16812
|
}).strict();
|
|
16802
16813
|
|
|
16803
|
-
// src/environment-variables/factory.ts
|
|
16804
|
-
function getBooleanEnvironmentVariableFactory(options) {
|
|
16805
|
-
return () => {
|
|
16806
|
-
if (!(options.variableName in process.env) || process.env[options.variableName] === void 0) {
|
|
16807
|
-
return typeof options.defaultValue === "function" ? options.defaultValue() : options.defaultValue;
|
|
16808
|
-
}
|
|
16809
|
-
switch (process.env[options.variableName]?.toLowerCase()) {
|
|
16810
|
-
case "true":
|
|
16811
|
-
return true;
|
|
16812
|
-
case "false":
|
|
16813
|
-
return false;
|
|
16814
|
-
default:
|
|
16815
|
-
throw new UserError(
|
|
16816
|
-
`Expected ${options.variableName} to be "true" or "false", but got ${JSON.stringify(
|
|
16817
|
-
process.env[options.variableName]
|
|
16818
|
-
)}`,
|
|
16819
|
-
{ telemetryMessage: false }
|
|
16820
|
-
);
|
|
16821
|
-
}
|
|
16822
|
-
};
|
|
16823
|
-
}
|
|
16824
|
-
__name(getBooleanEnvironmentVariableFactory, "getBooleanEnvironmentVariableFactory");
|
|
16825
|
-
function getEnvironmentVariableFactory({
|
|
16826
|
-
variableName,
|
|
16827
|
-
deprecatedName,
|
|
16828
|
-
choices,
|
|
16829
|
-
defaultValue
|
|
16830
|
-
}) {
|
|
16831
|
-
let hasWarned = false;
|
|
16832
|
-
return () => {
|
|
16833
|
-
if (variableName in process.env) {
|
|
16834
|
-
return getProcessEnv(variableName, choices);
|
|
16835
|
-
}
|
|
16836
|
-
if (deprecatedName && deprecatedName in process.env) {
|
|
16837
|
-
if (!hasWarned) {
|
|
16838
|
-
hasWarned = true;
|
|
16839
|
-
console.warn(
|
|
16840
|
-
`Using "${deprecatedName}" environment variable. This is deprecated. Please use "${variableName}", instead.`
|
|
16841
|
-
);
|
|
16842
|
-
}
|
|
16843
|
-
return getProcessEnv(deprecatedName, choices);
|
|
16844
|
-
}
|
|
16845
|
-
return defaultValue?.();
|
|
16846
|
-
};
|
|
16847
|
-
}
|
|
16848
|
-
__name(getEnvironmentVariableFactory, "getEnvironmentVariableFactory");
|
|
16849
|
-
function getProcessEnv(variableName, choices) {
|
|
16850
|
-
assertOneOf(choices, process.env[variableName]);
|
|
16851
|
-
return process.env[variableName];
|
|
16852
|
-
}
|
|
16853
|
-
__name(getProcessEnv, "getProcessEnv");
|
|
16854
|
-
function assertOneOf(choices, value) {
|
|
16855
|
-
if (Array.isArray(choices) && !choices.includes(value)) {
|
|
16856
|
-
throw new UserError(
|
|
16857
|
-
`Expected ${JSON.stringify(value)} to be one of ${JSON.stringify(choices)}`,
|
|
16858
|
-
{ telemetryMessage: false }
|
|
16859
|
-
);
|
|
16860
|
-
}
|
|
16861
|
-
}
|
|
16862
|
-
__name(assertOneOf, "assertOneOf");
|
|
16863
|
-
|
|
16864
|
-
// src/environment-variables/misc-variables.ts
|
|
16865
|
-
var getC3CommandFromEnv = getEnvironmentVariableFactory({
|
|
16866
|
-
variableName: "WRANGLER_C3_COMMAND",
|
|
16867
|
-
defaultValue: /* @__PURE__ */ __name(() => "create cloudflare", "defaultValue")
|
|
16868
|
-
});
|
|
16869
|
-
var getDoNotTrackFromEnv = getEnvironmentVariableFactory({
|
|
16870
|
-
variableName: "DO_NOT_TRACK"
|
|
16871
|
-
});
|
|
16872
|
-
function isDoNotTrackEnabled() {
|
|
16873
|
-
const value = getDoNotTrackFromEnv()?.toLowerCase();
|
|
16874
|
-
return value === "1" || value === "true";
|
|
16875
|
-
}
|
|
16876
|
-
__name(isDoNotTrackEnabled, "isDoNotTrackEnabled");
|
|
16877
|
-
var getWranglerSendMetricsVariableFromEnv = getBooleanEnvironmentVariableFactory({
|
|
16878
|
-
variableName: "WRANGLER_SEND_METRICS"
|
|
16879
|
-
});
|
|
16880
|
-
function getWranglerSendMetricsFromEnv() {
|
|
16881
|
-
if (isDoNotTrackEnabled()) {
|
|
16882
|
-
return false;
|
|
16883
|
-
}
|
|
16884
|
-
return getWranglerSendMetricsVariableFromEnv();
|
|
16885
|
-
}
|
|
16886
|
-
__name(getWranglerSendMetricsFromEnv, "getWranglerSendMetricsFromEnv");
|
|
16887
|
-
var getNoSkillsUpdatePromptsFromEnv = getBooleanEnvironmentVariableFactory({
|
|
16888
|
-
variableName: "WRANGLER_NO_SKILLS_UPDATE_PROMPTS"
|
|
16889
|
-
});
|
|
16890
|
-
var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
|
|
16891
|
-
variableName: "WRANGLER_SEND_ERROR_REPORTS",
|
|
16892
|
-
defaultValue: false
|
|
16893
|
-
});
|
|
16894
|
-
var getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory(
|
|
16895
|
-
{
|
|
16896
|
-
variableName: "WRANGLER_API_ENVIRONMENT",
|
|
16897
|
-
defaultValue: /* @__PURE__ */ __name(() => "production", "defaultValue"),
|
|
16898
|
-
choices: ["production", "staging"]
|
|
16899
|
-
}
|
|
16900
|
-
);
|
|
16901
|
-
var COMPLIANCE_REGION_CONFIG_PUBLIC = {
|
|
16902
|
-
compliance_region: "public"
|
|
16903
|
-
};
|
|
16904
|
-
var COMPLIANCE_REGION_CONFIG_UNKNOWN = {
|
|
16905
|
-
compliance_region: void 0
|
|
16906
|
-
};
|
|
16907
|
-
var getCloudflareComplianceRegionFromEnv = getEnvironmentVariableFactory({
|
|
16908
|
-
variableName: "CLOUDFLARE_COMPLIANCE_REGION",
|
|
16909
|
-
choices: ["public", "fedramp_high"]
|
|
16910
|
-
});
|
|
16911
|
-
var getCloudflareComplianceRegion = /* @__PURE__ */ __name((complianceConfig) => {
|
|
16912
|
-
const complianceRegionFromEnv = getCloudflareComplianceRegionFromEnv();
|
|
16913
|
-
if (complianceRegionFromEnv !== void 0 && complianceConfig?.compliance_region !== void 0 && complianceRegionFromEnv !== complianceConfig.compliance_region) {
|
|
16914
|
-
throw new UserError(
|
|
16915
|
-
dedent`
|
|
16916
|
-
The compliance region has been set to different values in two places:
|
|
16917
|
-
- \`CLOUDFLARE_COMPLIANCE_REGION\` environment variable: \`${complianceRegionFromEnv}\`
|
|
16918
|
-
- \`compliance_region\` configuration property: \`${complianceConfig.compliance_region}\`
|
|
16919
|
-
`,
|
|
16920
|
-
{ telemetryMessage: false }
|
|
16921
|
-
);
|
|
16922
|
-
}
|
|
16923
|
-
return complianceRegionFromEnv || complianceConfig?.compliance_region || "public";
|
|
16924
|
-
}, "getCloudflareComplianceRegion");
|
|
16925
|
-
var getCloudflareApiBaseUrlFromEnv = getEnvironmentVariableFactory({
|
|
16926
|
-
variableName: "CLOUDFLARE_API_BASE_URL",
|
|
16927
|
-
deprecatedName: "CF_API_BASE_URL"
|
|
16928
|
-
});
|
|
16929
|
-
var getCloudflareApiBaseUrl = /* @__PURE__ */ __name((complianceConfig) => getCloudflareApiBaseUrlFromEnv() ?? `https://api${getComplianceRegionSubdomain(complianceConfig)}${getStagingSubdomain()}.cloudflare.com/client/v4`, "getCloudflareApiBaseUrl");
|
|
16930
|
-
function getComplianceRegionSubdomain(complianceConfig) {
|
|
16931
|
-
return getCloudflareComplianceRegion(complianceConfig) === "fedramp_high" ? ".fed" : "";
|
|
16932
|
-
}
|
|
16933
|
-
__name(getComplianceRegionSubdomain, "getComplianceRegionSubdomain");
|
|
16934
|
-
function getStagingSubdomain() {
|
|
16935
|
-
return getCloudflareApiEnvironmentFromEnv() === "staging" ? ".staging" : "";
|
|
16936
|
-
}
|
|
16937
|
-
__name(getStagingSubdomain, "getStagingSubdomain");
|
|
16938
|
-
var getSanitizeLogs = getBooleanEnvironmentVariableFactory({
|
|
16939
|
-
variableName: "WRANGLER_LOG_SANITIZE",
|
|
16940
|
-
defaultValue: true
|
|
16941
|
-
});
|
|
16942
|
-
var getOutputFileDirectoryFromEnv = getEnvironmentVariableFactory({
|
|
16943
|
-
variableName: "WRANGLER_OUTPUT_FILE_DIRECTORY"
|
|
16944
|
-
});
|
|
16945
|
-
var getOutputFilePathFromEnv = getEnvironmentVariableFactory({
|
|
16946
|
-
variableName: "WRANGLER_OUTPUT_FILE_PATH"
|
|
16947
|
-
});
|
|
16948
|
-
var getCIMatchTag = getEnvironmentVariableFactory({
|
|
16949
|
-
variableName: "WRANGLER_CI_MATCH_TAG"
|
|
16950
|
-
});
|
|
16951
|
-
var getCIOverrideName = getEnvironmentVariableFactory({
|
|
16952
|
-
variableName: "WRANGLER_CI_OVERRIDE_NAME"
|
|
16953
|
-
});
|
|
16954
|
-
var getCIOverrideNetworkModeHost = getEnvironmentVariableFactory({
|
|
16955
|
-
variableName: "WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST"
|
|
16956
|
-
});
|
|
16957
|
-
var getCIGeneratePreviewAlias = getEnvironmentVariableFactory({
|
|
16958
|
-
variableName: "WRANGLER_CI_GENERATE_PREVIEW_ALIAS",
|
|
16959
|
-
defaultValue: /* @__PURE__ */ __name(() => "false", "defaultValue"),
|
|
16960
|
-
choices: ["true", "false"]
|
|
16961
|
-
});
|
|
16962
|
-
var getWorkersCIBranchName = getEnvironmentVariableFactory({
|
|
16963
|
-
variableName: "WORKERS_CI_BRANCH"
|
|
16964
|
-
});
|
|
16965
|
-
var getBuildConditionsFromEnv = getEnvironmentVariableFactory({
|
|
16966
|
-
variableName: "WRANGLER_BUILD_CONDITIONS"
|
|
16967
|
-
});
|
|
16968
|
-
var getBuildPlatformFromEnv = getEnvironmentVariableFactory({
|
|
16969
|
-
variableName: "WRANGLER_BUILD_PLATFORM"
|
|
16970
|
-
});
|
|
16971
|
-
var getRegistryPath = getEnvironmentVariableFactory({
|
|
16972
|
-
variableName: "WRANGLER_REGISTRY_PATH",
|
|
16973
|
-
defaultValue() {
|
|
16974
|
-
return path2__default.join(getGlobalConfigPath(), "registry");
|
|
16975
|
-
}
|
|
16976
|
-
});
|
|
16977
|
-
var getD1ExtraLocationChoices = getEnvironmentVariableFactory({
|
|
16978
|
-
variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES"
|
|
16979
|
-
});
|
|
16980
|
-
var getDockerPath = getEnvironmentVariableFactory({
|
|
16981
|
-
variableName: "WRANGLER_DOCKER_BIN",
|
|
16982
|
-
defaultValue() {
|
|
16983
|
-
return "docker";
|
|
16984
|
-
}
|
|
16985
|
-
});
|
|
16986
|
-
var getSubdomainMixedStateCheckDisabled = getBooleanEnvironmentVariableFactory({
|
|
16987
|
-
variableName: "WRANGLER_DISABLE_SUBDOMAIN_MIXED_STATE_CHECK",
|
|
16988
|
-
defaultValue: false
|
|
16989
|
-
});
|
|
16990
|
-
var getCloudflareLoadDevVarsFromDotEnv = getBooleanEnvironmentVariableFactory({
|
|
16991
|
-
variableName: "CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV",
|
|
16992
|
-
defaultValue: true
|
|
16993
|
-
});
|
|
16994
|
-
var getCloudflareIncludeProcessEnvFromEnv = getBooleanEnvironmentVariableFactory({
|
|
16995
|
-
variableName: "CLOUDFLARE_INCLUDE_PROCESS_ENV",
|
|
16996
|
-
defaultValue: false
|
|
16997
|
-
});
|
|
16998
|
-
var getTraceHeader = getEnvironmentVariableFactory({
|
|
16999
|
-
variableName: "WRANGLER_TRACE_ID"
|
|
17000
|
-
});
|
|
17001
|
-
var getDisableConfigWatching = getBooleanEnvironmentVariableFactory({
|
|
17002
|
-
variableName: "WRANGLER_CI_DISABLE_CONFIG_WATCHING",
|
|
17003
|
-
defaultValue: false
|
|
17004
|
-
});
|
|
17005
|
-
var getWranglerHideBanner = getBooleanEnvironmentVariableFactory({
|
|
17006
|
-
variableName: "WRANGLER_HIDE_BANNER",
|
|
17007
|
-
defaultValue: false
|
|
17008
|
-
});
|
|
17009
|
-
var getCloudflareEnv = getEnvironmentVariableFactory({
|
|
17010
|
-
variableName: "CLOUDFLARE_ENV"
|
|
17011
|
-
});
|
|
17012
|
-
var getOpenNextDeployFromEnv = getEnvironmentVariableFactory({
|
|
17013
|
-
variableName: "OPEN_NEXT_DEPLOY"
|
|
17014
|
-
});
|
|
17015
|
-
var getLocalExplorerEnabledFromEnv = getBooleanEnvironmentVariableFactory({
|
|
17016
|
-
variableName: "X_LOCAL_EXPLORER",
|
|
17017
|
-
defaultValue: true
|
|
17018
|
-
});
|
|
17019
|
-
var getLocalObservabilityEnabledFromEnv = getBooleanEnvironmentVariableFactory({
|
|
17020
|
-
variableName: "X_LOCAL_OBSERVABILITY",
|
|
17021
|
-
defaultValue: true
|
|
17022
|
-
});
|
|
17023
|
-
var getBrowserRenderingHeadfulFromEnv = getBooleanEnvironmentVariableFactory({
|
|
17024
|
-
variableName: "X_BROWSER_HEADFUL",
|
|
17025
|
-
defaultValue: false
|
|
17026
|
-
});
|
|
17027
|
-
var getCfFetchEnabledFromEnv = getBooleanEnvironmentVariableFactory({
|
|
17028
|
-
variableName: "CLOUDFLARE_CF_FETCH_ENABLED",
|
|
17029
|
-
defaultValue: true
|
|
17030
|
-
});
|
|
17031
|
-
var getCfFetchPathFromEnv = getEnvironmentVariableFactory({
|
|
17032
|
-
variableName: "CLOUDFLARE_CF_FETCH_PATH"
|
|
17033
|
-
});
|
|
17034
|
-
var getWranglerCacheDirFromEnv = getEnvironmentVariableFactory({
|
|
17035
|
-
variableName: "WRANGLER_CACHE_DIR"
|
|
17036
|
-
});
|
|
17037
|
-
var getCloudflaredPathFromEnv = getEnvironmentVariableFactory({
|
|
17038
|
-
variableName: "CLOUDFLARED_PATH"
|
|
17039
|
-
});
|
|
17040
|
-
|
|
17041
16814
|
// src/config/diagnostics.ts
|
|
17042
16815
|
var Diagnostics = class {
|
|
17043
16816
|
/**
|
|
@@ -17165,9 +16938,9 @@ Please add "${field}" to "env.${envName}".`
|
|
|
17165
16938
|
return rawEnv[field] ?? defaultValue;
|
|
17166
16939
|
}
|
|
17167
16940
|
__name(notInheritable, "notInheritable");
|
|
17168
|
-
function unwindPropertyPath(root,
|
|
16941
|
+
function unwindPropertyPath(root, path5) {
|
|
17169
16942
|
let container = root;
|
|
17170
|
-
const parts =
|
|
16943
|
+
const parts = path5.split(".");
|
|
17171
16944
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
17172
16945
|
if (!hasProperty(container, parts[i])) {
|
|
17173
16946
|
return;
|
|
@@ -17546,7 +17319,7 @@ function isPagesConfig(rawConfig) {
|
|
|
17546
17319
|
__name(isPagesConfig, "isPagesConfig");
|
|
17547
17320
|
function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
|
|
17548
17321
|
const diagnostics = new Diagnostics(
|
|
17549
|
-
`Processing ${configPath ?
|
|
17322
|
+
`Processing ${configPath ? path__default.relative(process.cwd(), configPath) : "wrangler"} configuration:`
|
|
17550
17323
|
);
|
|
17551
17324
|
const isRedirectedConfig2 = isRedirectedRawConfig(
|
|
17552
17325
|
rawConfig,
|
|
@@ -17805,13 +17578,13 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
|
|
|
17805
17578
|
// be configured in the Wrangler configuration file, but who knows, that may
|
|
17806
17579
|
// change in the future, so we do a check anyway
|
|
17807
17580
|
command && configPath ? Array.isArray(watch_dir) ? watch_dir.map(
|
|
17808
|
-
(dir2) =>
|
|
17581
|
+
(dir2) => path__default.relative(
|
|
17809
17582
|
process.cwd(),
|
|
17810
|
-
|
|
17583
|
+
path__default.join(path__default.dirname(configPath), `${dir2}`)
|
|
17811
17584
|
)
|
|
17812
|
-
) :
|
|
17585
|
+
) : path__default.relative(
|
|
17813
17586
|
process.cwd(),
|
|
17814
|
-
|
|
17587
|
+
path__default.join(path__default.dirname(configPath), `${watch_dir}`)
|
|
17815
17588
|
) : watch_dir
|
|
17816
17589
|
),
|
|
17817
17590
|
cwd
|
|
@@ -17819,11 +17592,11 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
|
|
|
17819
17592
|
}
|
|
17820
17593
|
__name(normalizeAndValidateBuild, "normalizeAndValidateBuild");
|
|
17821
17594
|
function normalizeAndValidateMainField(configPath, rawMain) {
|
|
17822
|
-
const configDir =
|
|
17595
|
+
const configDir = path__default.dirname(configPath ?? "wrangler.toml");
|
|
17823
17596
|
if (rawMain !== void 0) {
|
|
17824
17597
|
if (typeof rawMain === "string") {
|
|
17825
|
-
const directory =
|
|
17826
|
-
return
|
|
17598
|
+
const directory = path__default.resolve(configDir);
|
|
17599
|
+
return path__default.resolve(directory, rawMain);
|
|
17827
17600
|
} else {
|
|
17828
17601
|
return rawMain;
|
|
17829
17602
|
}
|
|
@@ -17833,11 +17606,11 @@ function normalizeAndValidateMainField(configPath, rawMain) {
|
|
|
17833
17606
|
}
|
|
17834
17607
|
__name(normalizeAndValidateMainField, "normalizeAndValidateMainField");
|
|
17835
17608
|
function normalizeAndValidateBaseDirField(configPath, rawDir) {
|
|
17836
|
-
const configDir =
|
|
17609
|
+
const configDir = path__default.dirname(configPath ?? "wrangler.toml");
|
|
17837
17610
|
if (rawDir !== void 0) {
|
|
17838
17611
|
if (typeof rawDir === "string") {
|
|
17839
|
-
const directory =
|
|
17840
|
-
return
|
|
17612
|
+
const directory = path__default.resolve(configDir);
|
|
17613
|
+
return path__default.resolve(directory, rawDir);
|
|
17841
17614
|
} else {
|
|
17842
17615
|
return rawDir;
|
|
17843
17616
|
}
|
|
@@ -17847,11 +17620,11 @@ function normalizeAndValidateBaseDirField(configPath, rawDir) {
|
|
|
17847
17620
|
}
|
|
17848
17621
|
__name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
|
|
17849
17622
|
function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
|
|
17850
|
-
const configDir =
|
|
17623
|
+
const configDir = path__default.dirname(configPath ?? "wrangler.toml");
|
|
17851
17624
|
if (rawPagesDir !== void 0) {
|
|
17852
17625
|
if (typeof rawPagesDir === "string") {
|
|
17853
|
-
const directory =
|
|
17854
|
-
return
|
|
17626
|
+
const directory = path__default.resolve(configDir);
|
|
17627
|
+
return path__default.resolve(directory, rawPagesDir);
|
|
17855
17628
|
} else {
|
|
17856
17629
|
return rawPagesDir;
|
|
17857
17630
|
}
|
|
@@ -18006,9 +17779,9 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
|
|
|
18006
17779
|
`site.entry-point`,
|
|
18007
17780
|
`Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
|
|
18008
17781
|
\`\`\`
|
|
18009
|
-
main = "${
|
|
17782
|
+
main = "${path__default.join(
|
|
18010
17783
|
String(legacySiteEntryPoint) || "workers-site",
|
|
18011
|
-
|
|
17784
|
+
path__default.extname(String(legacySiteEntryPoint) || "workers-site") ? "" : "index.js"
|
|
18012
17785
|
)}"
|
|
18013
17786
|
\`\`\``,
|
|
18014
17787
|
false,
|
|
@@ -18033,9 +17806,9 @@ Delete the deprecated \`site.entry-point\` field from your config.`
|
|
|
18033
17806
|
);
|
|
18034
17807
|
}
|
|
18035
17808
|
if (configPath && siteEntryPoint) {
|
|
18036
|
-
siteEntryPoint =
|
|
17809
|
+
siteEntryPoint = path__default.relative(
|
|
18037
17810
|
process.cwd(),
|
|
18038
|
-
|
|
17811
|
+
path__default.join(path__default.dirname(configPath), siteEntryPoint)
|
|
18039
17812
|
);
|
|
18040
17813
|
}
|
|
18041
17814
|
return {
|
|
@@ -18081,9 +17854,9 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
|
|
|
18081
17854
|
for (const [name, filePath] of Object.entries(rawMapping)) {
|
|
18082
17855
|
if (isString(diagnostics, `${field}['${name}']`, filePath, void 0)) {
|
|
18083
17856
|
if (configPath) {
|
|
18084
|
-
mapping[name] = configPath ?
|
|
17857
|
+
mapping[name] = configPath ? path__default.relative(
|
|
18085
17858
|
process.cwd(),
|
|
18086
|
-
|
|
17859
|
+
path__default.join(path__default.dirname(configPath), filePath)
|
|
18087
17860
|
) : filePath;
|
|
18088
17861
|
}
|
|
18089
17862
|
}
|
|
@@ -18701,6 +18474,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
18701
18474
|
validateQueues(envName),
|
|
18702
18475
|
{ producers: [], consumers: [] }
|
|
18703
18476
|
),
|
|
18477
|
+
connect: notInheritable(
|
|
18478
|
+
diagnostics,
|
|
18479
|
+
topLevelEnv,
|
|
18480
|
+
rawConfig,
|
|
18481
|
+
rawEnv,
|
|
18482
|
+
envName,
|
|
18483
|
+
"connect",
|
|
18484
|
+
validateConnectHandlers(envName),
|
|
18485
|
+
[]
|
|
18486
|
+
),
|
|
18704
18487
|
r2_buckets: notInheritable(
|
|
18705
18488
|
diagnostics,
|
|
18706
18489
|
topLevelEnv,
|
|
@@ -19104,7 +18887,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
19104
18887
|
topLevelEnv,
|
|
19105
18888
|
rawEnv,
|
|
19106
18889
|
"previews",
|
|
19107
|
-
validatePreviewsConfig(envName),
|
|
18890
|
+
validatePreviewsConfig(envName, configPath),
|
|
19108
18891
|
void 0
|
|
19109
18892
|
)
|
|
19110
18893
|
};
|
|
@@ -19149,9 +18932,9 @@ function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPa
|
|
|
19149
18932
|
isString,
|
|
19150
18933
|
void 0
|
|
19151
18934
|
);
|
|
19152
|
-
return configPath && tsconfig ?
|
|
18935
|
+
return configPath && tsconfig ? path__default.relative(
|
|
19153
18936
|
process.cwd(),
|
|
19154
|
-
|
|
18937
|
+
path__default.join(path__default.dirname(configPath), tsconfig)
|
|
19155
18938
|
) : tsconfig;
|
|
19156
18939
|
}
|
|
19157
18940
|
__name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
|
|
@@ -19612,6 +19395,20 @@ var validateDurableObjectBinding = /* @__PURE__ */ __name((diagnostics, field, v
|
|
|
19612
19395
|
return isValid;
|
|
19613
19396
|
}, "validateDurableObjectBinding");
|
|
19614
19397
|
var workflowNameFormatMessage = `Workflow names must be 1-64 characters long, start with a letter, number, or underscore, and may only contain letters, numbers, underscores, or hyphens.`;
|
|
19398
|
+
function validateWorkflowRetentionValue(diagnostics, field, key, value) {
|
|
19399
|
+
const isValidNumber = typeof value === "number" && Number.isInteger(value) && value > 0;
|
|
19400
|
+
const isValidString = typeof value === "string" && value.length > 0;
|
|
19401
|
+
if (isValidNumber || isValidString) {
|
|
19402
|
+
return true;
|
|
19403
|
+
}
|
|
19404
|
+
diagnostics.errors.push(
|
|
19405
|
+
`"${field}" bindings "default_retention.${key}" field must be a positive integer of milliseconds or a duration string such as "3 days", but got ${JSON.stringify(
|
|
19406
|
+
value
|
|
19407
|
+
)}.`
|
|
19408
|
+
);
|
|
19409
|
+
return false;
|
|
19410
|
+
}
|
|
19411
|
+
__name(validateWorkflowRetentionValue, "validateWorkflowRetentionValue");
|
|
19615
19412
|
var validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
19616
19413
|
if (typeof value !== "object" || value === null) {
|
|
19617
19414
|
diagnostics.errors.push(
|
|
@@ -19657,14 +19454,6 @@ var validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value)
|
|
|
19657
19454
|
);
|
|
19658
19455
|
isValid = false;
|
|
19659
19456
|
}
|
|
19660
|
-
if (!isOptionalProperty(value, "remote", "boolean")) {
|
|
19661
|
-
diagnostics.errors.push(
|
|
19662
|
-
`"${field}" bindings should, optionally, have a boolean "remote" field but got ${JSON.stringify(
|
|
19663
|
-
value
|
|
19664
|
-
)}.`
|
|
19665
|
-
);
|
|
19666
|
-
isValid = false;
|
|
19667
|
-
}
|
|
19668
19457
|
if (hasProperty(value, "schedules") && value.schedules !== void 0) {
|
|
19669
19458
|
if (typeof value.schedules === "string") {
|
|
19670
19459
|
if (value.schedules.length === 0) {
|
|
@@ -19733,14 +19522,69 @@ var validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value)
|
|
|
19733
19522
|
);
|
|
19734
19523
|
}
|
|
19735
19524
|
}
|
|
19525
|
+
if (hasProperty(value, "default_retention") && value.default_retention !== void 0) {
|
|
19526
|
+
if (typeof value.default_retention !== "object" || value.default_retention === null || Array.isArray(value.default_retention)) {
|
|
19527
|
+
diagnostics.errors.push(
|
|
19528
|
+
`"${field}" bindings should, optionally, have an object "default_retention" field but got ${JSON.stringify(
|
|
19529
|
+
value
|
|
19530
|
+
)}.`
|
|
19531
|
+
);
|
|
19532
|
+
isValid = false;
|
|
19533
|
+
} else {
|
|
19534
|
+
const defaultRetention = value.default_retention;
|
|
19535
|
+
for (const key of ["success_retention", "error_retention"]) {
|
|
19536
|
+
if (defaultRetention[key] !== void 0 && !validateWorkflowRetentionValue(
|
|
19537
|
+
diagnostics,
|
|
19538
|
+
field,
|
|
19539
|
+
key,
|
|
19540
|
+
defaultRetention[key]
|
|
19541
|
+
)) {
|
|
19542
|
+
isValid = false;
|
|
19543
|
+
}
|
|
19544
|
+
}
|
|
19545
|
+
validateAdditionalProperties(
|
|
19546
|
+
diagnostics,
|
|
19547
|
+
`${field}.default_retention`,
|
|
19548
|
+
Object.keys(defaultRetention),
|
|
19549
|
+
["success_retention", "error_retention"]
|
|
19550
|
+
);
|
|
19551
|
+
}
|
|
19552
|
+
}
|
|
19553
|
+
if (hasProperty(value, "concurrency") && value.concurrency !== void 0) {
|
|
19554
|
+
if (typeof value.concurrency !== "object" || value.concurrency === null || Array.isArray(value.concurrency)) {
|
|
19555
|
+
diagnostics.errors.push(
|
|
19556
|
+
`"${field}" bindings should, optionally, have an object "concurrency" field but got ${JSON.stringify(
|
|
19557
|
+
value
|
|
19558
|
+
)}.`
|
|
19559
|
+
);
|
|
19560
|
+
isValid = false;
|
|
19561
|
+
} else {
|
|
19562
|
+
const concurrency = value.concurrency;
|
|
19563
|
+
if (concurrency.limit !== void 0 && (typeof concurrency.limit !== "number" || !Number.isInteger(concurrency.limit) || concurrency.limit < 1)) {
|
|
19564
|
+
diagnostics.errors.push(
|
|
19565
|
+
`"${field}" bindings "concurrency.limit" field must be a positive integer but got ${JSON.stringify(
|
|
19566
|
+
concurrency.limit
|
|
19567
|
+
)}.`
|
|
19568
|
+
);
|
|
19569
|
+
isValid = false;
|
|
19570
|
+
}
|
|
19571
|
+
validateAdditionalProperties(
|
|
19572
|
+
diagnostics,
|
|
19573
|
+
`${field}.concurrency`,
|
|
19574
|
+
Object.keys(concurrency),
|
|
19575
|
+
["limit"]
|
|
19576
|
+
);
|
|
19577
|
+
}
|
|
19578
|
+
}
|
|
19736
19579
|
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
19737
19580
|
"binding",
|
|
19738
19581
|
"name",
|
|
19739
19582
|
"class_name",
|
|
19740
19583
|
"script_name",
|
|
19741
|
-
"remote",
|
|
19742
19584
|
"limits",
|
|
19743
|
-
"
|
|
19585
|
+
"concurrency",
|
|
19586
|
+
"schedules",
|
|
19587
|
+
"default_retention"
|
|
19744
19588
|
]);
|
|
19745
19589
|
return isValid;
|
|
19746
19590
|
}, "validateWorkflowBinding");
|
|
@@ -20053,7 +19897,48 @@ function validateSshPublicKeys(diagnostics, field, value, nameRequired) {
|
|
|
20053
19897
|
}
|
|
20054
19898
|
}
|
|
20055
19899
|
__name(validateSshPublicKeys, "validateSshPublicKeys");
|
|
20056
|
-
function
|
|
19900
|
+
function validatePreviewsContainers(envName, configPath) {
|
|
19901
|
+
const innerValidator = validateContainerApp(envName, void 0, configPath, {
|
|
19902
|
+
generateDefaultName: false
|
|
19903
|
+
});
|
|
19904
|
+
return (diagnostics, field, value, config2) => {
|
|
19905
|
+
if (Array.isArray(value)) {
|
|
19906
|
+
const nameFields = [...value.entries()].filter(
|
|
19907
|
+
([, entry]) => entry && typeof entry === "object" && "name" in entry
|
|
19908
|
+
).map(([index]) => `"${field}[${index}].name"`);
|
|
19909
|
+
if (nameFields.length > 0) {
|
|
19910
|
+
diagnostics.errors.push(
|
|
19911
|
+
`${nameFields.join(", ")} cannot be set. A preview container's application name is generated from the worker name, preview slug, and Durable Object class name, so that separate previews of the same Worker do not collide. Remove it and identify the container with "class_name".`
|
|
19912
|
+
);
|
|
19913
|
+
return false;
|
|
19914
|
+
}
|
|
19915
|
+
const seenClasses = /* @__PURE__ */ new Set();
|
|
19916
|
+
const duplicateClasses = /* @__PURE__ */ new Set();
|
|
19917
|
+
for (const entry of value) {
|
|
19918
|
+
if (!entry || typeof entry !== "object") {
|
|
19919
|
+
continue;
|
|
19920
|
+
}
|
|
19921
|
+
if (typeof entry.class_name === "string") {
|
|
19922
|
+
if (seenClasses.has(entry.class_name)) {
|
|
19923
|
+
duplicateClasses.add(entry.class_name);
|
|
19924
|
+
}
|
|
19925
|
+
seenClasses.add(entry.class_name);
|
|
19926
|
+
}
|
|
19927
|
+
}
|
|
19928
|
+
if (duplicateClasses.size > 0) {
|
|
19929
|
+
const classList = [...duplicateClasses].map((className) => `"${className}"`).join(", ");
|
|
19930
|
+
diagnostics.errors.push(
|
|
19931
|
+
`"${field}" declares more than one container for the Durable Object class ${classList}; each Durable Object class may appear at most once.`
|
|
19932
|
+
);
|
|
19933
|
+
return false;
|
|
19934
|
+
}
|
|
19935
|
+
}
|
|
19936
|
+
return innerValidator(diagnostics, field, value, config2);
|
|
19937
|
+
};
|
|
19938
|
+
}
|
|
19939
|
+
__name(validatePreviewsContainers, "validatePreviewsContainers");
|
|
19940
|
+
function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
19941
|
+
const { generateDefaultName = true } = options;
|
|
20057
19942
|
return (diagnostics, field, value, config2) => {
|
|
20058
19943
|
if (!value) {
|
|
20059
19944
|
return true;
|
|
@@ -20079,7 +19964,7 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
20079
19964
|
containerAppOptional.name,
|
|
20080
19965
|
"string"
|
|
20081
19966
|
);
|
|
20082
|
-
if (!containerAppOptional.name) {
|
|
19967
|
+
if (generateDefaultName && !containerAppOptional.name) {
|
|
20083
19968
|
if (containerAppOptional.class_name === void 0) {
|
|
20084
19969
|
diagnostics.errors.push(
|
|
20085
19970
|
`"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".`
|
|
@@ -20124,9 +20009,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
20124
20009
|
let resolvedBuildContextPath = void 0;
|
|
20125
20010
|
try {
|
|
20126
20011
|
if (isDockerfile(resolvedImage, configPath)) {
|
|
20127
|
-
const baseDir = configPath ?
|
|
20128
|
-
resolvedImage =
|
|
20129
|
-
resolvedBuildContextPath = containerAppOptional.image_build_context ?
|
|
20012
|
+
const baseDir = configPath ? path__default.dirname(configPath) : process.cwd();
|
|
20013
|
+
resolvedImage = path__default.resolve(baseDir, resolvedImage);
|
|
20014
|
+
resolvedBuildContextPath = containerAppOptional.image_build_context ? path__default.resolve(baseDir, containerAppOptional.image_build_context) : path__default.dirname(resolvedImage);
|
|
20130
20015
|
}
|
|
20131
20016
|
} catch (err) {
|
|
20132
20017
|
if (err instanceof Error && err.message) {
|
|
@@ -21488,6 +21373,108 @@ var validateConsumer = /* @__PURE__ */ __name((diagnostics, field, value, _confi
|
|
|
21488
21373
|
}
|
|
21489
21374
|
return isValid;
|
|
21490
21375
|
}, "validateConsumer");
|
|
21376
|
+
function validateConnectHandlers(envName) {
|
|
21377
|
+
return (diagnostics, field, value, config2) => {
|
|
21378
|
+
if (value === void 0) {
|
|
21379
|
+
return true;
|
|
21380
|
+
}
|
|
21381
|
+
const fieldPath = config2 === void 0 ? `${field}` : `env.${envName}.${field}`;
|
|
21382
|
+
if (!Array.isArray(value)) {
|
|
21383
|
+
diagnostics.errors.push(
|
|
21384
|
+
`The field "${fieldPath}" should be an array but got ${JSON.stringify(
|
|
21385
|
+
value
|
|
21386
|
+
)}.`
|
|
21387
|
+
);
|
|
21388
|
+
return false;
|
|
21389
|
+
}
|
|
21390
|
+
let isValid = true;
|
|
21391
|
+
for (let i = 0; i < value.length; i++) {
|
|
21392
|
+
if (!validateConnectHandler(
|
|
21393
|
+
diagnostics,
|
|
21394
|
+
`${fieldPath}[${i}]`,
|
|
21395
|
+
value[i],
|
|
21396
|
+
config2
|
|
21397
|
+
)) {
|
|
21398
|
+
isValid = false;
|
|
21399
|
+
}
|
|
21400
|
+
}
|
|
21401
|
+
const firstIndexByKey = /* @__PURE__ */ new Map();
|
|
21402
|
+
for (let i = 0; i < value.length; i++) {
|
|
21403
|
+
const handler = value[i];
|
|
21404
|
+
if (typeof handler !== "object" || handler === null || typeof handler.port !== "number" || typeof handler.protocol !== "string") {
|
|
21405
|
+
continue;
|
|
21406
|
+
}
|
|
21407
|
+
const { protocol, port } = handler;
|
|
21408
|
+
const key = `${protocol}:${port}`;
|
|
21409
|
+
const firstIndex = firstIndexByKey.get(key);
|
|
21410
|
+
if (firstIndex !== void 0) {
|
|
21411
|
+
diagnostics.errors.push(
|
|
21412
|
+
`"${fieldPath}[${i}]" has the same "protocol" (${protocol}) and "port" (${port}) as "${fieldPath}[${firstIndex}]". Each entry in "connect" must use a unique protocol/port combination.`
|
|
21413
|
+
);
|
|
21414
|
+
isValid = false;
|
|
21415
|
+
} else {
|
|
21416
|
+
firstIndexByKey.set(key, i);
|
|
21417
|
+
}
|
|
21418
|
+
}
|
|
21419
|
+
return isValid;
|
|
21420
|
+
};
|
|
21421
|
+
}
|
|
21422
|
+
__name(validateConnectHandlers, "validateConnectHandlers");
|
|
21423
|
+
var validateConnectHandler = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
21424
|
+
if (typeof value !== "object" || value === null) {
|
|
21425
|
+
diagnostics.errors.push(
|
|
21426
|
+
`"${field}" should be an object, but got ${JSON.stringify(value)}`
|
|
21427
|
+
);
|
|
21428
|
+
return false;
|
|
21429
|
+
}
|
|
21430
|
+
let isValid = true;
|
|
21431
|
+
if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
21432
|
+
"protocol",
|
|
21433
|
+
"port",
|
|
21434
|
+
"address"
|
|
21435
|
+
])) {
|
|
21436
|
+
isValid = false;
|
|
21437
|
+
}
|
|
21438
|
+
if ("protocol" in value && value.protocol !== "tcp") {
|
|
21439
|
+
diagnostics.errors.push(
|
|
21440
|
+
`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(
|
|
21441
|
+
value.protocol
|
|
21442
|
+
)}.`
|
|
21443
|
+
);
|
|
21444
|
+
isValid = false;
|
|
21445
|
+
} else if (!("protocol" in value)) {
|
|
21446
|
+
diagnostics.errors.push(
|
|
21447
|
+
`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(
|
|
21448
|
+
value
|
|
21449
|
+
)}.`
|
|
21450
|
+
);
|
|
21451
|
+
isValid = false;
|
|
21452
|
+
}
|
|
21453
|
+
if (!isRequiredProperty(value, "port", "number")) {
|
|
21454
|
+
diagnostics.errors.push(
|
|
21455
|
+
`"${field}" should have a number "port" field but got ${JSON.stringify(
|
|
21456
|
+
value
|
|
21457
|
+
)}.`
|
|
21458
|
+
);
|
|
21459
|
+
isValid = false;
|
|
21460
|
+
} else if (!Number.isInteger(value.port) || value.port < 1 || value.port > 65535) {
|
|
21461
|
+
diagnostics.errors.push(
|
|
21462
|
+
`"${field}" should have an integer "port" field between 1 and 65535 but got ${JSON.stringify(
|
|
21463
|
+
value
|
|
21464
|
+
)}.`
|
|
21465
|
+
);
|
|
21466
|
+
isValid = false;
|
|
21467
|
+
}
|
|
21468
|
+
if (!isOptionalProperty(value, "address", "string")) {
|
|
21469
|
+
diagnostics.errors.push(
|
|
21470
|
+
`"${field}" should, optionally, have a string "address" field but got ${JSON.stringify(
|
|
21471
|
+
value
|
|
21472
|
+
)}.`
|
|
21473
|
+
);
|
|
21474
|
+
isValid = false;
|
|
21475
|
+
}
|
|
21476
|
+
return isValid;
|
|
21477
|
+
}, "validateConnectHandler");
|
|
21491
21478
|
var validateCompatibilityDate = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
21492
21479
|
if (value === void 0) {
|
|
21493
21480
|
return true;
|
|
@@ -21796,7 +21783,7 @@ function normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv) {
|
|
|
21796
21783
|
);
|
|
21797
21784
|
}
|
|
21798
21785
|
__name(normalizeAndValidateLimits, "normalizeAndValidateLimits");
|
|
21799
|
-
var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, field, value) => {
|
|
21786
|
+
var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (diagnostics, field, value) => {
|
|
21800
21787
|
if (value === void 0) {
|
|
21801
21788
|
return true;
|
|
21802
21789
|
}
|
|
@@ -21843,6 +21830,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
21843
21830
|
"ratelimits",
|
|
21844
21831
|
"vpc_services",
|
|
21845
21832
|
"version_metadata",
|
|
21833
|
+
"containers",
|
|
21846
21834
|
"logpush",
|
|
21847
21835
|
"observability",
|
|
21848
21836
|
"limits",
|
|
@@ -22052,6 +22040,14 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
22052
22040
|
void 0
|
|
22053
22041
|
) && isValid;
|
|
22054
22042
|
}
|
|
22043
|
+
if (previews.containers !== void 0) {
|
|
22044
|
+
isValid = validatePreviewsContainers(envName, configPath)(
|
|
22045
|
+
diagnostics,
|
|
22046
|
+
`${field}.containers`,
|
|
22047
|
+
previews.containers,
|
|
22048
|
+
void 0
|
|
22049
|
+
) && isValid;
|
|
22050
|
+
}
|
|
22055
22051
|
isValid = isBoolean(diagnostics, `${field}.logpush`, previews.logpush, void 0) && isValid;
|
|
22056
22052
|
isValid = validateObservability(
|
|
22057
22053
|
diagnostics,
|
|
@@ -22440,6 +22436,13 @@ var validateObservability = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
22440
22436
|
val.head_sampling_rate,
|
|
22441
22437
|
"number"
|
|
22442
22438
|
) && isValid;
|
|
22439
|
+
isValid = validateOptionalProperty(
|
|
22440
|
+
diagnostics,
|
|
22441
|
+
field,
|
|
22442
|
+
"redact_query_string",
|
|
22443
|
+
val.redact_query_string,
|
|
22444
|
+
"boolean"
|
|
22445
|
+
) && isValid;
|
|
22443
22446
|
isValid = validateOptionalProperty(diagnostics, field, "logs", val.logs, "object") && isValid;
|
|
22444
22447
|
isValid = validateOptionalProperty(
|
|
22445
22448
|
diagnostics,
|
|
@@ -22451,6 +22454,7 @@ var validateObservability = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
22451
22454
|
isValid = validateAdditionalProperties(diagnostics, field, Object.keys(val), [
|
|
22452
22455
|
"enabled",
|
|
22453
22456
|
"head_sampling_rate",
|
|
22457
|
+
"redact_query_string",
|
|
22454
22458
|
"logs",
|
|
22455
22459
|
"traces"
|
|
22456
22460
|
]) && isValid;
|
|
@@ -22632,7 +22636,7 @@ var validateCache = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
|
22632
22636
|
]) && isValid;
|
|
22633
22637
|
return isValid;
|
|
22634
22638
|
}, "validateCache");
|
|
22635
|
-
function warnIfDurableObjectsHaveNoLifecycleConfig(diagnostics, durableObjects, migrations, exports, configPath) {
|
|
22639
|
+
function warnIfDurableObjectsHaveNoLifecycleConfig(diagnostics, durableObjects, migrations, exports$1, configPath) {
|
|
22636
22640
|
if (!Array.isArray(durableObjects.bindings) || durableObjects.bindings.length === 0) {
|
|
22637
22641
|
return;
|
|
22638
22642
|
}
|
|
@@ -22640,7 +22644,7 @@ function warnIfDurableObjectsHaveNoLifecycleConfig(diagnostics, durableObjects,
|
|
|
22640
22644
|
(binding) => !binding.script_name
|
|
22641
22645
|
);
|
|
22642
22646
|
const exportsCovers = /* @__PURE__ */ __name((className) => {
|
|
22643
|
-
const entry = exports?.[className];
|
|
22647
|
+
const entry = exports$1?.[className];
|
|
22644
22648
|
if (entry === void 0 || entry.type !== "durable-object") {
|
|
22645
22649
|
return false;
|
|
22646
22650
|
}
|
|
@@ -22676,15 +22680,15 @@ function warnIfDurableObjectsHaveNoLifecycleConfig(diagnostics, durableObjects,
|
|
|
22676
22680
|
\`\`\``);
|
|
22677
22681
|
}
|
|
22678
22682
|
__name(warnIfDurableObjectsHaveNoLifecycleConfig, "warnIfDurableObjectsHaveNoLifecycleConfig");
|
|
22679
|
-
function errorIfMigrationsAndExportsBothSet(diagnostics, migrations, exports) {
|
|
22680
|
-
if (migrations.length > 0 && exports !== void 0 && Object.values(exports).some((entry) => entry.type === "durable-object")) {
|
|
22683
|
+
function errorIfMigrationsAndExportsBothSet(diagnostics, migrations, exports$1) {
|
|
22684
|
+
if (migrations.length > 0 && exports$1 !== void 0 && Object.values(exports$1).some((entry) => entry.type === "durable-object")) {
|
|
22681
22685
|
diagnostics.errors.push(
|
|
22682
22686
|
`\`migrations\` and \`exports\` are mutually exclusive. Choose one or the other to declare your Durable Object lifecycle, but not both.`
|
|
22683
22687
|
);
|
|
22684
22688
|
}
|
|
22685
22689
|
}
|
|
22686
22690
|
__name(errorIfMigrationsAndExportsBothSet, "errorIfMigrationsAndExportsBothSet");
|
|
22687
|
-
function validateContainerExportLinks(diagnostics, containers, exports, containersDeclaredElsewhere) {
|
|
22691
|
+
function validateContainerExportLinks(diagnostics, containers, exports$1, containersDeclaredElsewhere) {
|
|
22688
22692
|
if (containers !== void 0 && !Array.isArray(containers)) {
|
|
22689
22693
|
return;
|
|
22690
22694
|
}
|
|
@@ -22726,7 +22730,7 @@ function validateContainerExportLinks(diagnostics, containers, exports, containe
|
|
|
22726
22730
|
`More than one container is attached to the Durable Object "${className}". A Durable Object can only have one container attached to it.`
|
|
22727
22731
|
);
|
|
22728
22732
|
}
|
|
22729
|
-
const durableObjectExports = getDurableObjectExports(exports);
|
|
22733
|
+
const durableObjectExports = getDurableObjectExports(exports$1);
|
|
22730
22734
|
const liveExportClassNames = /* @__PURE__ */ new Set();
|
|
22731
22735
|
const classNamesByContainerName = /* @__PURE__ */ new Map();
|
|
22732
22736
|
for (const [className, entry] of Object.entries(durableObjectExports)) {
|
|
@@ -22755,7 +22759,7 @@ function validateContainerExportLinks(diagnostics, containers, exports, containe
|
|
|
22755
22759
|
);
|
|
22756
22760
|
}
|
|
22757
22761
|
}
|
|
22758
|
-
const containerNameToClassName = getContainerNameToClassNameMap(exports);
|
|
22762
|
+
const containerNameToClassName = getContainerNameToClassNameMap(exports$1);
|
|
22759
22763
|
const usesDurableObjectExports = Object.keys(durableObjectExports).length > 0;
|
|
22760
22764
|
for (const container of containers ?? []) {
|
|
22761
22765
|
if (typeof container.name !== "string") {
|
|
@@ -22834,8 +22838,8 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
|
|
|
22834
22838
|
}
|
|
22835
22839
|
__name(isRemoteValid, "isRemoteValid");
|
|
22836
22840
|
function isDockerfile(imagePath, configPath) {
|
|
22837
|
-
const baseDir = configPath ?
|
|
22838
|
-
const maybeDockerfile =
|
|
22841
|
+
const baseDir = configPath ? path__default.dirname(configPath) : process.cwd();
|
|
22842
|
+
const maybeDockerfile = path__default.resolve(baseDir, imagePath);
|
|
22839
22843
|
if (fs2.existsSync(maybeDockerfile)) {
|
|
22840
22844
|
if (isDirectory(maybeDockerfile)) {
|
|
22841
22845
|
throw new UserError(
|
|
@@ -22897,7 +22901,7 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
22897
22901
|
kv_namespace: "local-and-remote",
|
|
22898
22902
|
r2_bucket: "local-and-remote",
|
|
22899
22903
|
d1: "local-and-remote",
|
|
22900
|
-
workflow: "local-
|
|
22904
|
+
workflow: "local-only",
|
|
22901
22905
|
browser: "local-and-remote",
|
|
22902
22906
|
images: "local-and-remote",
|
|
22903
22907
|
stream: "local-and-remote",
|
|
@@ -22928,6 +22932,56 @@ function getBindingLocalSupport(type) {
|
|
|
22928
22932
|
return "local-only";
|
|
22929
22933
|
}
|
|
22930
22934
|
__name(getBindingLocalSupport, "getBindingLocalSupport");
|
|
22935
|
+
function validateBindingRemoteSetting(type, remote, warn) {
|
|
22936
|
+
const support = getBindingLocalSupport(type);
|
|
22937
|
+
switch (support) {
|
|
22938
|
+
case "local-and-remote":
|
|
22939
|
+
return;
|
|
22940
|
+
case "local-only":
|
|
22941
|
+
if (remote === true) {
|
|
22942
|
+
throw new UserError(
|
|
22943
|
+
`${getBindingTypeFriendlyName(type)} bindings do not support accessing remote resources.`,
|
|
22944
|
+
{
|
|
22945
|
+
telemetryMessage: "utils bindings unsupported remote resources"
|
|
22946
|
+
}
|
|
22947
|
+
);
|
|
22948
|
+
}
|
|
22949
|
+
return;
|
|
22950
|
+
case "remote":
|
|
22951
|
+
if (remote === false) {
|
|
22952
|
+
throw new UserError(
|
|
22953
|
+
`${getBindingTypeFriendlyName(type)} bindings do not support local development. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,
|
|
22954
|
+
{
|
|
22955
|
+
telemetryMessage: "utils bindings unsupported local development"
|
|
22956
|
+
}
|
|
22957
|
+
);
|
|
22958
|
+
}
|
|
22959
|
+
if (remote === void 0) {
|
|
22960
|
+
warn(
|
|
22961
|
+
`${getBindingTypeFriendlyName(type)} bindings do not support local development, and so parts of your Worker may not work correctly. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
|
|
22962
|
+
);
|
|
22963
|
+
}
|
|
22964
|
+
return;
|
|
22965
|
+
case "DO-NOT-USE-this-resource-will-never-have-a-local-simulator":
|
|
22966
|
+
if (remote === false) {
|
|
22967
|
+
throw new UserError(
|
|
22968
|
+
`${getBindingTypeFriendlyName(type)} bindings do not support local development. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,
|
|
22969
|
+
{
|
|
22970
|
+
telemetryMessage: "utils bindings unsupported local development always remote"
|
|
22971
|
+
}
|
|
22972
|
+
);
|
|
22973
|
+
}
|
|
22974
|
+
if (remote === void 0) {
|
|
22975
|
+
warn(
|
|
22976
|
+
`${getBindingTypeFriendlyName(type)} bindings always access remote resources, and so may incur usage charges even in local dev. To suppress this warning, set \`remote: true\` for the binding definition in your configuration file.`
|
|
22977
|
+
);
|
|
22978
|
+
}
|
|
22979
|
+
return;
|
|
22980
|
+
default:
|
|
22981
|
+
assertNever(support);
|
|
22982
|
+
}
|
|
22983
|
+
}
|
|
22984
|
+
__name(validateBindingRemoteSetting, "validateBindingRemoteSetting");
|
|
22931
22985
|
|
|
22932
22986
|
// src/config/validation-pages.ts
|
|
22933
22987
|
var supportedPagesConfigFields = [
|
|
@@ -23061,7 +23115,7 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
|
|
|
23061
23115
|
__name(validateDurableObjectBinding2, "validateDurableObjectBinding");
|
|
23062
23116
|
function getPackagePath(packageName, projectPath) {
|
|
23063
23117
|
try {
|
|
23064
|
-
return
|
|
23118
|
+
return path__default.dirname(
|
|
23065
23119
|
__require.resolve(`${packageName}/package.json`, {
|
|
23066
23120
|
paths: [projectPath]
|
|
23067
23121
|
})
|
|
@@ -23069,13 +23123,25 @@ function getPackagePath(packageName, projectPath) {
|
|
|
23069
23123
|
} catch {
|
|
23070
23124
|
}
|
|
23071
23125
|
try {
|
|
23072
|
-
return
|
|
23126
|
+
return path__default.dirname(
|
|
23073
23127
|
__require.resolve(packageName, {
|
|
23074
23128
|
paths: [projectPath]
|
|
23075
23129
|
})
|
|
23076
23130
|
);
|
|
23077
23131
|
} catch {
|
|
23078
23132
|
}
|
|
23133
|
+
try {
|
|
23134
|
+
const candidate = path__default.join(
|
|
23135
|
+
projectPath,
|
|
23136
|
+
"node_modules",
|
|
23137
|
+
packageName,
|
|
23138
|
+
"package.json"
|
|
23139
|
+
);
|
|
23140
|
+
if (statSync(candidate).isFile()) {
|
|
23141
|
+
return path__default.dirname(candidate);
|
|
23142
|
+
}
|
|
23143
|
+
} catch {
|
|
23144
|
+
}
|
|
23079
23145
|
return void 0;
|
|
23080
23146
|
}
|
|
23081
23147
|
__name(getPackagePath, "getPackagePath");
|
|
@@ -23111,9 +23177,9 @@ function getInstalledPackageVersion(packageName, projectPath, opts = {}) {
|
|
|
23111
23177
|
__name(getInstalledPackageVersion, "getInstalledPackageVersion");
|
|
23112
23178
|
function findFileUp(name, startDir, lastDir) {
|
|
23113
23179
|
let dir2 = startDir;
|
|
23114
|
-
const root =
|
|
23180
|
+
const root = path__default.parse(dir2).root;
|
|
23115
23181
|
while (true) {
|
|
23116
|
-
const candidate =
|
|
23182
|
+
const candidate = path__default.join(dir2, name);
|
|
23117
23183
|
try {
|
|
23118
23184
|
if (statSync(candidate).isFile()) {
|
|
23119
23185
|
return candidate;
|
|
@@ -23123,7 +23189,7 @@ function findFileUp(name, startDir, lastDir) {
|
|
|
23123
23189
|
if (lastDir !== void 0 && dir2 === lastDir) {
|
|
23124
23190
|
break;
|
|
23125
23191
|
}
|
|
23126
|
-
const parent =
|
|
23192
|
+
const parent = path__default.dirname(dir2);
|
|
23127
23193
|
if (parent === dir2 || dir2 === root) {
|
|
23128
23194
|
break;
|
|
23129
23195
|
}
|
|
@@ -23132,43 +23198,1155 @@ function findFileUp(name, startDir, lastDir) {
|
|
|
23132
23198
|
return void 0;
|
|
23133
23199
|
}
|
|
23134
23200
|
__name(findFileUp, "findFileUp");
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
|
|
23138
|
-
|
|
23139
|
-
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
23143
|
-
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
|
|
23147
|
-
}
|
|
23148
|
-
|
|
23149
|
-
|
|
23150
|
-
|
|
23151
|
-
|
|
23152
|
-
}
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
|
|
23160
|
-
}
|
|
23161
|
-
|
|
23162
|
-
|
|
23163
|
-
|
|
23164
|
-
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23168
|
-
|
|
23169
|
-
|
|
23201
|
+
|
|
23202
|
+
// src/binding-utils.ts
|
|
23203
|
+
function assertNever3(_value) {
|
|
23204
|
+
}
|
|
23205
|
+
__name(assertNever3, "assertNever");
|
|
23206
|
+
function convertConfigToBindings(config2, options) {
|
|
23207
|
+
const { usePreviewIds = false, pages = false } = options ?? {};
|
|
23208
|
+
const output = {};
|
|
23209
|
+
const configIterable = Object.entries(config2);
|
|
23210
|
+
for (const [type, info] of configIterable) {
|
|
23211
|
+
if (info === void 0) {
|
|
23212
|
+
continue;
|
|
23213
|
+
}
|
|
23214
|
+
switch (type) {
|
|
23215
|
+
case "vars": {
|
|
23216
|
+
for (const [key, value] of Object.entries(info)) {
|
|
23217
|
+
if (typeof value === "string") {
|
|
23218
|
+
output[key] = { type: "plain_text", value };
|
|
23219
|
+
} else {
|
|
23220
|
+
output[key] = { type: "json", value };
|
|
23221
|
+
}
|
|
23222
|
+
}
|
|
23223
|
+
break;
|
|
23224
|
+
}
|
|
23225
|
+
case "kv_namespaces": {
|
|
23226
|
+
for (const { binding, ...x } of info) {
|
|
23227
|
+
output[binding] = {
|
|
23228
|
+
type: "kv_namespace",
|
|
23229
|
+
...x,
|
|
23230
|
+
id: usePreviewIds ? x.preview_id ?? x.id : x.id
|
|
23231
|
+
};
|
|
23232
|
+
}
|
|
23233
|
+
break;
|
|
23234
|
+
}
|
|
23235
|
+
case "send_email": {
|
|
23236
|
+
if (pages) {
|
|
23237
|
+
break;
|
|
23238
|
+
}
|
|
23239
|
+
for (const {
|
|
23240
|
+
name,
|
|
23241
|
+
destination_address,
|
|
23242
|
+
allowed_destination_addresses,
|
|
23243
|
+
allowed_sender_addresses,
|
|
23244
|
+
remote
|
|
23245
|
+
} of info) {
|
|
23246
|
+
const shared = {
|
|
23247
|
+
type: "send_email",
|
|
23248
|
+
allowed_sender_addresses,
|
|
23249
|
+
remote
|
|
23250
|
+
};
|
|
23251
|
+
if (destination_address !== void 0) {
|
|
23252
|
+
output[name] = { ...shared, destination_address };
|
|
23253
|
+
} else if (allowed_destination_addresses !== void 0) {
|
|
23254
|
+
output[name] = { ...shared, allowed_destination_addresses };
|
|
23255
|
+
} else {
|
|
23256
|
+
output[name] = shared;
|
|
23257
|
+
}
|
|
23258
|
+
}
|
|
23259
|
+
break;
|
|
23260
|
+
}
|
|
23261
|
+
case "wasm_modules": {
|
|
23262
|
+
if (pages) {
|
|
23263
|
+
break;
|
|
23264
|
+
}
|
|
23265
|
+
for (const [key, value] of Object.entries(info)) {
|
|
23266
|
+
if (typeof value === "string") {
|
|
23267
|
+
output[key] = { type: "wasm_module", source: { path: value } };
|
|
23268
|
+
} else {
|
|
23269
|
+
output[key] = { type: "wasm_module", source: { contents: value } };
|
|
23270
|
+
}
|
|
23271
|
+
}
|
|
23272
|
+
break;
|
|
23273
|
+
}
|
|
23274
|
+
case "text_blobs": {
|
|
23275
|
+
if (pages) {
|
|
23276
|
+
break;
|
|
23277
|
+
}
|
|
23278
|
+
for (const [key, value] of Object.entries(info)) {
|
|
23279
|
+
output[key] = { type: "text_blob", source: { path: value } };
|
|
23280
|
+
}
|
|
23281
|
+
break;
|
|
23282
|
+
}
|
|
23283
|
+
case "data_blobs": {
|
|
23284
|
+
if (pages) {
|
|
23285
|
+
break;
|
|
23286
|
+
}
|
|
23287
|
+
for (const [key, value] of Object.entries(info)) {
|
|
23288
|
+
if (typeof value === "string") {
|
|
23289
|
+
output[key] = { type: "data_blob", source: { path: value } };
|
|
23290
|
+
} else {
|
|
23291
|
+
output[key] = { type: "data_blob", source: { contents: value } };
|
|
23292
|
+
}
|
|
23293
|
+
}
|
|
23294
|
+
break;
|
|
23295
|
+
}
|
|
23296
|
+
case "browser": {
|
|
23297
|
+
const { binding, ...x } = info;
|
|
23298
|
+
output[binding] = { type: "browser", ...x };
|
|
23299
|
+
break;
|
|
23300
|
+
}
|
|
23301
|
+
case "durable_objects": {
|
|
23302
|
+
for (const { name, ...x } of info.bindings ?? []) {
|
|
23303
|
+
output[name] = { type: "durable_object_namespace", ...x };
|
|
23304
|
+
}
|
|
23305
|
+
break;
|
|
23306
|
+
}
|
|
23307
|
+
case "workflows": {
|
|
23308
|
+
for (const { binding, ...x } of info) {
|
|
23309
|
+
output[binding] = { type: "workflow", ...x };
|
|
23310
|
+
}
|
|
23311
|
+
break;
|
|
23312
|
+
}
|
|
23313
|
+
case "queues": {
|
|
23314
|
+
for (const { binding, ...x } of info.producers ?? []) {
|
|
23315
|
+
output[binding] = {
|
|
23316
|
+
type: "queue",
|
|
23317
|
+
queue_name: x.queue,
|
|
23318
|
+
...x
|
|
23319
|
+
};
|
|
23320
|
+
}
|
|
23321
|
+
break;
|
|
23322
|
+
}
|
|
23323
|
+
case "r2_buckets": {
|
|
23324
|
+
for (const { binding, ...x } of info) {
|
|
23325
|
+
output[binding] = {
|
|
23326
|
+
type: "r2_bucket",
|
|
23327
|
+
...x,
|
|
23328
|
+
bucket_name: usePreviewIds ? x.preview_bucket_name ?? x.bucket_name : x.bucket_name
|
|
23329
|
+
};
|
|
23330
|
+
}
|
|
23331
|
+
break;
|
|
23332
|
+
}
|
|
23333
|
+
case "d1_databases": {
|
|
23334
|
+
for (const { binding, ...x } of info) {
|
|
23335
|
+
output[binding] = {
|
|
23336
|
+
type: "d1",
|
|
23337
|
+
...x,
|
|
23338
|
+
database_id: usePreviewIds ? x.preview_database_id ?? x.database_id : x.database_id
|
|
23339
|
+
};
|
|
23340
|
+
}
|
|
23341
|
+
break;
|
|
23342
|
+
}
|
|
23343
|
+
case "services": {
|
|
23344
|
+
for (const { binding, ...x } of info) {
|
|
23345
|
+
output[binding] = { type: "service", ...x };
|
|
23346
|
+
}
|
|
23347
|
+
break;
|
|
23348
|
+
}
|
|
23349
|
+
case "analytics_engine_datasets": {
|
|
23350
|
+
for (const { binding, ...x } of info) {
|
|
23351
|
+
output[binding] = { type: "analytics_engine", ...x };
|
|
23352
|
+
}
|
|
23353
|
+
break;
|
|
23354
|
+
}
|
|
23355
|
+
case "dispatch_namespaces": {
|
|
23356
|
+
if (pages) {
|
|
23357
|
+
break;
|
|
23358
|
+
}
|
|
23359
|
+
for (const { binding, ...x } of info) {
|
|
23360
|
+
output[binding] = { type: "dispatch_namespace", ...x };
|
|
23361
|
+
}
|
|
23362
|
+
break;
|
|
23363
|
+
}
|
|
23364
|
+
case "mtls_certificates": {
|
|
23365
|
+
for (const { binding, ...x } of info) {
|
|
23366
|
+
output[binding] = { type: "mtls_certificate", ...x };
|
|
23367
|
+
}
|
|
23368
|
+
break;
|
|
23369
|
+
}
|
|
23370
|
+
case "logfwdr": {
|
|
23371
|
+
if (pages) {
|
|
23372
|
+
break;
|
|
23373
|
+
}
|
|
23374
|
+
for (const { name, ...x } of info.bindings ?? []) {
|
|
23375
|
+
output[name] = { type: "logfwdr", ...x };
|
|
23376
|
+
}
|
|
23377
|
+
break;
|
|
23378
|
+
}
|
|
23379
|
+
case "ai": {
|
|
23380
|
+
const { binding, ...x } = info;
|
|
23381
|
+
output[binding] = { type: "ai", ...x };
|
|
23382
|
+
break;
|
|
23383
|
+
}
|
|
23384
|
+
case "images": {
|
|
23385
|
+
const { binding, ...x } = info;
|
|
23386
|
+
output[binding] = { type: "images", ...x };
|
|
23387
|
+
break;
|
|
23388
|
+
}
|
|
23389
|
+
case "stream": {
|
|
23390
|
+
const { binding, ...x } = info;
|
|
23391
|
+
output[binding] = { type: "stream", ...x };
|
|
23392
|
+
break;
|
|
23393
|
+
}
|
|
23394
|
+
case "version_metadata": {
|
|
23395
|
+
const { binding, ...x } = info;
|
|
23396
|
+
output[binding] = { type: "version_metadata", ...x };
|
|
23397
|
+
break;
|
|
23398
|
+
}
|
|
23399
|
+
case "hyperdrive": {
|
|
23400
|
+
for (const { binding, ...x } of info) {
|
|
23401
|
+
output[binding] = { type: "hyperdrive", ...x };
|
|
23402
|
+
}
|
|
23403
|
+
break;
|
|
23404
|
+
}
|
|
23405
|
+
case "vectorize": {
|
|
23406
|
+
for (const { binding, ...x } of info) {
|
|
23407
|
+
output[binding] = { type: "vectorize", ...x };
|
|
23408
|
+
}
|
|
23409
|
+
break;
|
|
23410
|
+
}
|
|
23411
|
+
case "ai_search_namespaces": {
|
|
23412
|
+
for (const { binding, ...x } of info) {
|
|
23413
|
+
output[binding] = { type: "ai_search_namespace", ...x };
|
|
23414
|
+
}
|
|
23415
|
+
break;
|
|
23416
|
+
}
|
|
23417
|
+
case "ai_search": {
|
|
23418
|
+
for (const { binding, ...x } of info) {
|
|
23419
|
+
output[binding] = { type: "ai_search", ...x };
|
|
23420
|
+
}
|
|
23421
|
+
break;
|
|
23422
|
+
}
|
|
23423
|
+
case "websearch": {
|
|
23424
|
+
const { binding, ...x } = info;
|
|
23425
|
+
output[binding] = { type: "websearch", ...x };
|
|
23426
|
+
break;
|
|
23427
|
+
}
|
|
23428
|
+
case "agent_memory": {
|
|
23429
|
+
for (const { binding, ...x } of info) {
|
|
23430
|
+
output[binding] = { type: "agent_memory", ...x };
|
|
23431
|
+
}
|
|
23432
|
+
break;
|
|
23433
|
+
}
|
|
23434
|
+
case "unsafe": {
|
|
23435
|
+
if (pages) {
|
|
23436
|
+
break;
|
|
23437
|
+
}
|
|
23438
|
+
for (const { type: unsafeType, name, ...data } of info.bindings ?? []) {
|
|
23439
|
+
output[name] = { type: `unsafe_${unsafeType}`, ...data };
|
|
23440
|
+
}
|
|
23441
|
+
break;
|
|
23442
|
+
}
|
|
23443
|
+
case "assets": {
|
|
23444
|
+
if (pages) {
|
|
23445
|
+
break;
|
|
23446
|
+
}
|
|
23447
|
+
if (info.binding) {
|
|
23448
|
+
output[info.binding] = { type: "assets" };
|
|
23449
|
+
}
|
|
23450
|
+
break;
|
|
23451
|
+
}
|
|
23452
|
+
case "pipelines": {
|
|
23453
|
+
if (pages) {
|
|
23454
|
+
break;
|
|
23455
|
+
}
|
|
23456
|
+
for (const { binding, ...x } of info) {
|
|
23457
|
+
output[binding] = { type: "pipeline", ...x };
|
|
23458
|
+
}
|
|
23459
|
+
break;
|
|
23460
|
+
}
|
|
23461
|
+
case "secrets_store_secrets": {
|
|
23462
|
+
for (const { binding, ...x } of info) {
|
|
23463
|
+
output[binding] = { type: "secrets_store_secret", ...x };
|
|
23464
|
+
}
|
|
23465
|
+
break;
|
|
23466
|
+
}
|
|
23467
|
+
case "artifacts": {
|
|
23468
|
+
for (const { binding, ...x } of info) {
|
|
23469
|
+
output[binding] = { type: "artifacts", ...x };
|
|
23470
|
+
}
|
|
23471
|
+
break;
|
|
23472
|
+
}
|
|
23473
|
+
case "unsafe_hello_world": {
|
|
23474
|
+
if (pages) {
|
|
23475
|
+
break;
|
|
23476
|
+
}
|
|
23477
|
+
for (const { binding, ...x } of info) {
|
|
23478
|
+
output[binding] = { type: "unsafe_hello_world", ...x };
|
|
23479
|
+
}
|
|
23480
|
+
break;
|
|
23481
|
+
}
|
|
23482
|
+
case "flagship": {
|
|
23483
|
+
for (const { binding, ...x } of info) {
|
|
23484
|
+
output[binding] = { type: "flagship", ...x };
|
|
23485
|
+
}
|
|
23486
|
+
break;
|
|
23487
|
+
}
|
|
23488
|
+
case "ratelimits": {
|
|
23489
|
+
for (const { name, ...x } of info) {
|
|
23490
|
+
output[name] = { type: "ratelimit", ...x };
|
|
23491
|
+
}
|
|
23492
|
+
break;
|
|
23493
|
+
}
|
|
23494
|
+
case "worker_loaders": {
|
|
23495
|
+
for (const { binding, ...x } of info) {
|
|
23496
|
+
output[binding] = { type: "worker_loader", ...x };
|
|
23497
|
+
}
|
|
23498
|
+
break;
|
|
23499
|
+
}
|
|
23500
|
+
case "vpc_services": {
|
|
23501
|
+
for (const { binding, ...x } of info) {
|
|
23502
|
+
output[binding] = { type: "vpc_service", ...x };
|
|
23503
|
+
}
|
|
23504
|
+
break;
|
|
23505
|
+
}
|
|
23506
|
+
case "vpc_networks": {
|
|
23507
|
+
for (const { binding, ...x } of info) {
|
|
23508
|
+
output[binding] = { type: "vpc_network", ...x };
|
|
23509
|
+
}
|
|
23510
|
+
break;
|
|
23511
|
+
}
|
|
23512
|
+
case "media": {
|
|
23513
|
+
const { binding, ...x } = info;
|
|
23514
|
+
output[binding] = { type: "media", ...x };
|
|
23515
|
+
break;
|
|
23516
|
+
}
|
|
23517
|
+
}
|
|
23518
|
+
}
|
|
23519
|
+
return output;
|
|
23520
|
+
}
|
|
23521
|
+
__name(convertConfigToBindings, "convertConfigToBindings");
|
|
23522
|
+
function isUnsafeBindingType(type) {
|
|
23523
|
+
return type.startsWith("unsafe_");
|
|
23524
|
+
}
|
|
23525
|
+
__name(isUnsafeBindingType, "isUnsafeBindingType");
|
|
23526
|
+
var nameBindings = [
|
|
23527
|
+
"durable_object_namespace",
|
|
23528
|
+
"logfwdr",
|
|
23529
|
+
"ratelimit",
|
|
23530
|
+
"unsafe_ratelimit",
|
|
23531
|
+
"send_email"
|
|
23532
|
+
];
|
|
23533
|
+
function getBindingKey(type) {
|
|
23534
|
+
if (nameBindings.includes(type)) {
|
|
23535
|
+
return "name";
|
|
23536
|
+
}
|
|
23537
|
+
return "binding";
|
|
23538
|
+
}
|
|
23539
|
+
__name(getBindingKey, "getBindingKey");
|
|
23540
|
+
function extractBindingsOfType(type, bindings) {
|
|
23541
|
+
return Object.entries(bindings ?? {}).filter(
|
|
23542
|
+
(binding) => binding[1].type === type
|
|
23543
|
+
).map((binding) => ({
|
|
23544
|
+
...binding[1],
|
|
23545
|
+
[getBindingKey(type)]: binding[0]
|
|
23546
|
+
}));
|
|
23547
|
+
}
|
|
23548
|
+
__name(extractBindingsOfType, "extractBindingsOfType");
|
|
23549
|
+
function getBindings(config2, options) {
|
|
23550
|
+
if (!config2) {
|
|
23551
|
+
return {};
|
|
23552
|
+
}
|
|
23553
|
+
return convertConfigToBindings(config2, {
|
|
23554
|
+
usePreviewIds: false,
|
|
23555
|
+
pages: options?.pages
|
|
23556
|
+
});
|
|
23557
|
+
}
|
|
23558
|
+
__name(getBindings, "getBindings");
|
|
23559
|
+
var { dim, white } = chalk;
|
|
23560
|
+
var brandColor = chalk.hex("#BD5B08");
|
|
23561
|
+
var isConnectedStatusExplained = false;
|
|
23562
|
+
function printBindings(bindings, options) {
|
|
23563
|
+
const {
|
|
23564
|
+
containers = [],
|
|
23565
|
+
log,
|
|
23566
|
+
streamingTailConsumers = [],
|
|
23567
|
+
tailConsumers = []
|
|
23568
|
+
} = options;
|
|
23569
|
+
const context = options;
|
|
23570
|
+
let hasConnectionStatus = false;
|
|
23571
|
+
const isMultiWorker = context.isMultiWorker ?? false;
|
|
23572
|
+
const getMode = createGetMode({
|
|
23573
|
+
isProvisioning: context.provisioning,
|
|
23574
|
+
isLocalDev: context.local
|
|
23575
|
+
});
|
|
23576
|
+
const truncate2 = /* @__PURE__ */ __name((item, maxLength = 40) => {
|
|
23577
|
+
const s = typeof item === "string" ? item : JSON.stringify(item);
|
|
23578
|
+
if (s.length < maxLength) {
|
|
23579
|
+
return s;
|
|
23580
|
+
}
|
|
23581
|
+
return `${s.substring(0, maxLength - 3)}...`;
|
|
23582
|
+
}, "truncate");
|
|
23583
|
+
const output = [];
|
|
23584
|
+
const data_blobs = extractBindingsOfType("data_blob", bindings);
|
|
23585
|
+
const durable_objects = extractBindingsOfType(
|
|
23586
|
+
"durable_object_namespace",
|
|
23587
|
+
bindings
|
|
23588
|
+
);
|
|
23589
|
+
const workflows = extractBindingsOfType("workflow", bindings);
|
|
23590
|
+
const kv_namespaces = extractBindingsOfType("kv_namespace", bindings);
|
|
23591
|
+
const send_email = extractBindingsOfType("send_email", bindings);
|
|
23592
|
+
const queues = extractBindingsOfType("queue", bindings);
|
|
23593
|
+
const d1_databases = extractBindingsOfType("d1", bindings);
|
|
23594
|
+
const vectorize = extractBindingsOfType("vectorize", bindings);
|
|
23595
|
+
const ai_search_namespaces = extractBindingsOfType(
|
|
23596
|
+
"ai_search_namespace",
|
|
23597
|
+
bindings
|
|
23598
|
+
);
|
|
23599
|
+
const ai_search = extractBindingsOfType("ai_search", bindings);
|
|
23600
|
+
const websearch = extractBindingsOfType("websearch", bindings);
|
|
23601
|
+
const agent_memory = extractBindingsOfType("agent_memory", bindings);
|
|
23602
|
+
const hyperdrive = extractBindingsOfType("hyperdrive", bindings);
|
|
23603
|
+
const r2_buckets = extractBindingsOfType("r2_bucket", bindings);
|
|
23604
|
+
const logfwdr = extractBindingsOfType("logfwdr", bindings);
|
|
23605
|
+
const secrets_store_secrets = extractBindingsOfType(
|
|
23606
|
+
"secrets_store_secret",
|
|
23607
|
+
bindings
|
|
23608
|
+
);
|
|
23609
|
+
const artifacts = extractBindingsOfType("artifacts", bindings);
|
|
23610
|
+
const services = extractBindingsOfType("service", bindings);
|
|
23611
|
+
const vpc_services = extractBindingsOfType("vpc_service", bindings);
|
|
23612
|
+
const vpc_networks = extractBindingsOfType("vpc_network", bindings);
|
|
23613
|
+
const analytics_engine_datasets = extractBindingsOfType(
|
|
23614
|
+
"analytics_engine",
|
|
23615
|
+
bindings
|
|
23616
|
+
);
|
|
23617
|
+
const text_blobs = extractBindingsOfType("text_blob", bindings);
|
|
23618
|
+
const browser = extractBindingsOfType("browser", bindings);
|
|
23619
|
+
const images = extractBindingsOfType("images", bindings);
|
|
23620
|
+
const stream = extractBindingsOfType("stream", bindings);
|
|
23621
|
+
const ai = extractBindingsOfType("ai", bindings);
|
|
23622
|
+
const version_metadata = extractBindingsOfType("version_metadata", bindings);
|
|
23623
|
+
const vars = Object.entries(bindings ?? {}).filter(
|
|
23624
|
+
([_, binding]) => binding.type === "plain_text" || binding.type === "json" || binding.type === "secret_text"
|
|
23625
|
+
).map(([name, binding]) => ({
|
|
23626
|
+
binding: name,
|
|
23627
|
+
...binding
|
|
23628
|
+
}));
|
|
23629
|
+
const wasm_modules = extractBindingsOfType("wasm_module", bindings);
|
|
23630
|
+
const dispatch_namespaces = extractBindingsOfType(
|
|
23631
|
+
"dispatch_namespace",
|
|
23632
|
+
bindings
|
|
23633
|
+
);
|
|
23634
|
+
const mtls_certificates = extractBindingsOfType("mtls_certificate", bindings);
|
|
23635
|
+
const pipelines = extractBindingsOfType("pipeline", bindings);
|
|
23636
|
+
const ratelimits = extractBindingsOfType("ratelimit", bindings);
|
|
23637
|
+
const assets = extractBindingsOfType("assets", bindings);
|
|
23638
|
+
const unsafe_hello_world = extractBindingsOfType(
|
|
23639
|
+
"unsafe_hello_world",
|
|
23640
|
+
bindings
|
|
23641
|
+
);
|
|
23642
|
+
const flagship = extractBindingsOfType("flagship", bindings);
|
|
23643
|
+
const media = extractBindingsOfType("media", bindings);
|
|
23644
|
+
const worker_loaders = extractBindingsOfType("worker_loader", bindings);
|
|
23645
|
+
const unsafe_bindings = Object.entries(bindings ?? {}).filter(
|
|
23646
|
+
([_, binding]) => isUnsafeBindingType(binding.type) && binding.type !== "unsafe_hello_world"
|
|
23647
|
+
).map(([name, binding]) => ({ name, ...binding }));
|
|
23648
|
+
if (data_blobs.length > 0) {
|
|
23649
|
+
output.push(
|
|
23650
|
+
...data_blobs.map(({ binding, source }) => ({
|
|
23651
|
+
name: binding,
|
|
23652
|
+
type: getBindingTypeFriendlyName("data_blob"),
|
|
23653
|
+
value: "contents" in source ? "<Buffer>" : truncate2(source.path),
|
|
23654
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
23655
|
+
}))
|
|
23656
|
+
);
|
|
23657
|
+
}
|
|
23658
|
+
if (durable_objects.length > 0) {
|
|
23659
|
+
output.push(
|
|
23660
|
+
...durable_objects.map(({ name, class_name, script_name }) => {
|
|
23661
|
+
let value = class_name;
|
|
23662
|
+
let mode = void 0;
|
|
23663
|
+
if (script_name) {
|
|
23664
|
+
if (context.local && context.registry !== null) {
|
|
23665
|
+
const registryDefinition = context.registry?.[script_name];
|
|
23666
|
+
hasConnectionStatus = true;
|
|
23667
|
+
if (registryDefinition && registryDefinition.debugPortAddress) {
|
|
23668
|
+
value += `, defined in ${script_name}`;
|
|
23669
|
+
mode = getMode({ isSimulatedLocally: true, connected: true });
|
|
23670
|
+
} else {
|
|
23671
|
+
value += `, defined in ${script_name}`;
|
|
23672
|
+
mode = getMode({ isSimulatedLocally: true, connected: false });
|
|
23673
|
+
}
|
|
23674
|
+
} else {
|
|
23675
|
+
value += `, defined in ${script_name}`;
|
|
23676
|
+
mode = getMode({ isSimulatedLocally: true });
|
|
23677
|
+
}
|
|
23678
|
+
} else {
|
|
23679
|
+
mode = getMode({ isSimulatedLocally: true });
|
|
23680
|
+
}
|
|
23681
|
+
return {
|
|
23682
|
+
name,
|
|
23683
|
+
type: getBindingTypeFriendlyName("durable_object_namespace"),
|
|
23684
|
+
value,
|
|
23685
|
+
mode
|
|
23686
|
+
};
|
|
23687
|
+
})
|
|
23688
|
+
);
|
|
23689
|
+
}
|
|
23690
|
+
if (workflows.length > 0) {
|
|
23691
|
+
output.push(
|
|
23692
|
+
...workflows.map(({ class_name, script_name, binding }) => {
|
|
23693
|
+
let value = class_name;
|
|
23694
|
+
if (script_name) {
|
|
23695
|
+
value += ` (defined in ${script_name})`;
|
|
23696
|
+
}
|
|
23697
|
+
return {
|
|
23698
|
+
name: binding,
|
|
23699
|
+
type: getBindingTypeFriendlyName("workflow"),
|
|
23700
|
+
value,
|
|
23701
|
+
mode: getMode({
|
|
23702
|
+
isSimulatedLocally: true
|
|
23703
|
+
})
|
|
23704
|
+
};
|
|
23705
|
+
})
|
|
23706
|
+
);
|
|
23707
|
+
}
|
|
23708
|
+
if (kv_namespaces.length > 0) {
|
|
23709
|
+
output.push(
|
|
23710
|
+
...kv_namespaces.map(({ binding, id, remote }) => {
|
|
23711
|
+
return {
|
|
23712
|
+
name: binding,
|
|
23713
|
+
type: getBindingTypeFriendlyName("kv_namespace"),
|
|
23714
|
+
value: id,
|
|
23715
|
+
mode: getMode({
|
|
23716
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !remote
|
|
23717
|
+
})
|
|
23718
|
+
};
|
|
23719
|
+
})
|
|
23720
|
+
);
|
|
23721
|
+
}
|
|
23722
|
+
if (send_email.length > 0) {
|
|
23723
|
+
output.push(
|
|
23724
|
+
...send_email.map((emailBinding) => {
|
|
23725
|
+
const destination_address = "destination_address" in emailBinding ? emailBinding.destination_address : void 0;
|
|
23726
|
+
const allowed_destination_addresses = "allowed_destination_addresses" in emailBinding ? emailBinding.allowed_destination_addresses : void 0;
|
|
23727
|
+
const allowed_sender_addresses = "allowed_sender_addresses" in emailBinding ? emailBinding.allowed_sender_addresses : void 0;
|
|
23728
|
+
let value = destination_address || allowed_destination_addresses?.join(", ") || "unrestricted";
|
|
23729
|
+
if (allowed_sender_addresses) {
|
|
23730
|
+
value += ` - senders: ${allowed_sender_addresses.join(", ")}`;
|
|
23731
|
+
}
|
|
23732
|
+
return {
|
|
23733
|
+
name: emailBinding.name,
|
|
23734
|
+
type: getBindingTypeFriendlyName("send_email"),
|
|
23735
|
+
value,
|
|
23736
|
+
mode: getMode({
|
|
23737
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !emailBinding.remote
|
|
23738
|
+
})
|
|
23739
|
+
};
|
|
23740
|
+
})
|
|
23741
|
+
);
|
|
23742
|
+
}
|
|
23743
|
+
if (queues.length > 0) {
|
|
23744
|
+
output.push(
|
|
23745
|
+
...queues.map(({ binding, queue_name, remote }) => {
|
|
23746
|
+
return {
|
|
23747
|
+
name: binding,
|
|
23748
|
+
type: getBindingTypeFriendlyName("queue"),
|
|
23749
|
+
value: queue_name,
|
|
23750
|
+
mode: getMode({
|
|
23751
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !remote
|
|
23752
|
+
})
|
|
23753
|
+
};
|
|
23754
|
+
})
|
|
23755
|
+
);
|
|
23756
|
+
}
|
|
23757
|
+
if (d1_databases.length > 0) {
|
|
23758
|
+
output.push(
|
|
23759
|
+
...d1_databases.map(
|
|
23760
|
+
({
|
|
23761
|
+
binding,
|
|
23762
|
+
database_name,
|
|
23763
|
+
database_id,
|
|
23764
|
+
preview_database_id,
|
|
23765
|
+
remote
|
|
23766
|
+
}) => {
|
|
23767
|
+
const value = typeof database_id == "symbol" ? database_id : preview_database_id ?? database_name ?? database_id;
|
|
23768
|
+
return {
|
|
23769
|
+
name: binding,
|
|
23770
|
+
type: getBindingTypeFriendlyName("d1"),
|
|
23771
|
+
mode: getMode({
|
|
23772
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !remote
|
|
23773
|
+
}),
|
|
23774
|
+
value
|
|
23775
|
+
};
|
|
23776
|
+
}
|
|
23777
|
+
)
|
|
23778
|
+
);
|
|
23779
|
+
}
|
|
23780
|
+
if (vectorize.length > 0) {
|
|
23781
|
+
output.push(
|
|
23782
|
+
...vectorize.map(({ binding, index_name, remote }) => {
|
|
23783
|
+
return {
|
|
23784
|
+
name: binding,
|
|
23785
|
+
type: getBindingTypeFriendlyName("vectorize"),
|
|
23786
|
+
value: index_name,
|
|
23787
|
+
mode: getMode({
|
|
23788
|
+
isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
|
|
23789
|
+
})
|
|
23790
|
+
};
|
|
23791
|
+
})
|
|
23792
|
+
);
|
|
23793
|
+
}
|
|
23794
|
+
if (ai_search_namespaces.length > 0) {
|
|
23795
|
+
output.push(
|
|
23796
|
+
...ai_search_namespaces.map(({ binding, namespace }) => ({
|
|
23797
|
+
name: binding,
|
|
23798
|
+
type: getBindingTypeFriendlyName("ai_search_namespace"),
|
|
23799
|
+
// Preserve `namespace` as-is so `typeof === "symbol"` handling
|
|
23800
|
+
// downstream can render INHERIT_SYMBOL as `"inherited"`. Using
|
|
23801
|
+
// `String(namespace)` would stringify it to
|
|
23802
|
+
// `"Symbol(inherit_binding)"` and defeat that check.
|
|
23803
|
+
value: namespace ?? void 0,
|
|
23804
|
+
mode: getMode({ isSimulatedLocally: false })
|
|
23805
|
+
}))
|
|
23806
|
+
);
|
|
23807
|
+
}
|
|
23808
|
+
if (ai_search.length > 0) {
|
|
23809
|
+
output.push(
|
|
23810
|
+
...ai_search.map(({ binding, instance_name }) => ({
|
|
23811
|
+
name: binding,
|
|
23812
|
+
type: getBindingTypeFriendlyName("ai_search"),
|
|
23813
|
+
value: instance_name ? String(instance_name) : void 0,
|
|
23814
|
+
mode: getMode({ isSimulatedLocally: false })
|
|
23815
|
+
}))
|
|
23816
|
+
);
|
|
23817
|
+
}
|
|
23818
|
+
if (websearch.length > 0) {
|
|
23819
|
+
output.push(
|
|
23820
|
+
...websearch.map(({ binding }) => ({
|
|
23821
|
+
name: binding,
|
|
23822
|
+
type: getBindingTypeFriendlyName("websearch"),
|
|
23823
|
+
value: void 0,
|
|
23824
|
+
mode: getMode({ isSimulatedLocally: false })
|
|
23825
|
+
}))
|
|
23826
|
+
);
|
|
23827
|
+
}
|
|
23828
|
+
if (agent_memory.length > 0) {
|
|
23829
|
+
output.push(
|
|
23830
|
+
...agent_memory.map(({ binding, namespace }) => ({
|
|
23831
|
+
name: binding,
|
|
23832
|
+
type: getBindingTypeFriendlyName("agent_memory"),
|
|
23833
|
+
value: namespace ?? void 0,
|
|
23834
|
+
mode: getMode({ isSimulatedLocally: false })
|
|
23835
|
+
}))
|
|
23836
|
+
);
|
|
23837
|
+
}
|
|
23838
|
+
if (hyperdrive.length > 0) {
|
|
23839
|
+
output.push(
|
|
23840
|
+
...hyperdrive.map(({ binding, id }) => {
|
|
23841
|
+
return {
|
|
23842
|
+
name: binding,
|
|
23843
|
+
type: getBindingTypeFriendlyName("hyperdrive"),
|
|
23844
|
+
value: id,
|
|
23845
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
23846
|
+
};
|
|
23847
|
+
})
|
|
23848
|
+
);
|
|
23849
|
+
}
|
|
23850
|
+
if (vpc_services.length > 0) {
|
|
23851
|
+
output.push(
|
|
23852
|
+
...vpc_services.map(({ binding, service_id, remote }) => {
|
|
23853
|
+
return {
|
|
23854
|
+
name: binding,
|
|
23855
|
+
type: getBindingTypeFriendlyName("vpc_service"),
|
|
23856
|
+
value: service_id,
|
|
23857
|
+
mode: getMode({
|
|
23858
|
+
isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
|
|
23859
|
+
})
|
|
23860
|
+
};
|
|
23861
|
+
})
|
|
23862
|
+
);
|
|
23863
|
+
}
|
|
23864
|
+
if (vpc_networks.length > 0) {
|
|
23865
|
+
output.push(
|
|
23866
|
+
...vpc_networks.map(({ binding, tunnel_id, network_id, remote }) => {
|
|
23867
|
+
return {
|
|
23868
|
+
name: binding,
|
|
23869
|
+
type: getBindingTypeFriendlyName("vpc_network"),
|
|
23870
|
+
value: tunnel_id ?? network_id,
|
|
23871
|
+
mode: getMode({
|
|
23872
|
+
isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
|
|
23873
|
+
})
|
|
23874
|
+
};
|
|
23875
|
+
})
|
|
23876
|
+
);
|
|
23877
|
+
}
|
|
23878
|
+
if (r2_buckets.length > 0) {
|
|
23879
|
+
output.push(
|
|
23880
|
+
...r2_buckets.map(({ binding, bucket_name, jurisdiction, remote }) => {
|
|
23881
|
+
const value = typeof bucket_name === "symbol" ? bucket_name : bucket_name ? `${bucket_name}${jurisdiction ? ` (${jurisdiction})` : ""}` : void 0;
|
|
23882
|
+
return {
|
|
23883
|
+
name: binding,
|
|
23884
|
+
type: getBindingTypeFriendlyName("r2_bucket"),
|
|
23885
|
+
value,
|
|
23886
|
+
mode: getMode({
|
|
23887
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !remote
|
|
23888
|
+
})
|
|
23889
|
+
};
|
|
23890
|
+
})
|
|
23891
|
+
);
|
|
23892
|
+
}
|
|
23893
|
+
if (logfwdr.length > 0) {
|
|
23894
|
+
output.push(
|
|
23895
|
+
...logfwdr.map(({ name, destination }) => {
|
|
23896
|
+
return {
|
|
23897
|
+
name,
|
|
23898
|
+
type: getBindingTypeFriendlyName("logfwdr"),
|
|
23899
|
+
value: destination,
|
|
23900
|
+
mode: getMode()
|
|
23901
|
+
};
|
|
23902
|
+
})
|
|
23903
|
+
);
|
|
23904
|
+
}
|
|
23905
|
+
if (secrets_store_secrets.length > 0) {
|
|
23906
|
+
output.push(
|
|
23907
|
+
...secrets_store_secrets.map(({ binding, store_id, secret_name }) => {
|
|
23908
|
+
return {
|
|
23909
|
+
name: binding,
|
|
23910
|
+
type: getBindingTypeFriendlyName("secrets_store_secret"),
|
|
23911
|
+
value: `${store_id}/${secret_name}`,
|
|
23912
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
23913
|
+
};
|
|
23914
|
+
})
|
|
23915
|
+
);
|
|
23916
|
+
}
|
|
23917
|
+
if (artifacts.length > 0) {
|
|
23918
|
+
output.push(
|
|
23919
|
+
...artifacts.map(({ binding, namespace }) => {
|
|
23920
|
+
return {
|
|
23921
|
+
name: binding,
|
|
23922
|
+
type: getBindingTypeFriendlyName("artifacts"),
|
|
23923
|
+
value: namespace,
|
|
23924
|
+
mode: getMode({ isSimulatedLocally: false })
|
|
23925
|
+
};
|
|
23926
|
+
})
|
|
23927
|
+
);
|
|
23928
|
+
}
|
|
23929
|
+
if (unsafe_hello_world.length > 0) {
|
|
23930
|
+
output.push(
|
|
23931
|
+
...unsafe_hello_world.map(({ binding, enable_timer }) => {
|
|
23932
|
+
return {
|
|
23933
|
+
name: binding,
|
|
23934
|
+
type: getBindingTypeFriendlyName("unsafe_hello_world"),
|
|
23935
|
+
value: enable_timer ? `Timer enabled` : `Timer disabled`,
|
|
23936
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
23937
|
+
};
|
|
23938
|
+
})
|
|
23939
|
+
);
|
|
23940
|
+
}
|
|
23941
|
+
if (flagship.length > 0) {
|
|
23942
|
+
output.push(
|
|
23943
|
+
...flagship.map(({ binding, app_id }) => {
|
|
23944
|
+
return {
|
|
23945
|
+
name: binding,
|
|
23946
|
+
type: getBindingTypeFriendlyName("flagship"),
|
|
23947
|
+
value: app_id,
|
|
23948
|
+
mode: getMode({
|
|
23949
|
+
isSimulatedLocally: !context.remoteBindingsDisabled ? false : void 0
|
|
23950
|
+
})
|
|
23951
|
+
};
|
|
23952
|
+
})
|
|
23953
|
+
);
|
|
23954
|
+
}
|
|
23955
|
+
if (services.length > 0) {
|
|
23956
|
+
output.push(
|
|
23957
|
+
...services.map(({ binding, service, entrypoint, remote, dev }) => {
|
|
23958
|
+
let value = service;
|
|
23959
|
+
let mode = void 0;
|
|
23960
|
+
if (entrypoint) {
|
|
23961
|
+
value += `#${entrypoint}`;
|
|
23962
|
+
}
|
|
23963
|
+
if (dev !== void 0 && context.local) {
|
|
23964
|
+
mode = getMode({ isSimulatedLocally: true });
|
|
23965
|
+
} else if (remote) {
|
|
23966
|
+
mode = getMode({ isSimulatedLocally: false });
|
|
23967
|
+
} else if (context.local && context.registry !== null) {
|
|
23968
|
+
const isSelfBinding = service === context.name;
|
|
23969
|
+
if (isSelfBinding) {
|
|
23970
|
+
hasConnectionStatus = true;
|
|
23971
|
+
mode = getMode({ isSimulatedLocally: true, connected: true });
|
|
23972
|
+
} else {
|
|
23973
|
+
const registryDefinition = context.registry?.[service];
|
|
23974
|
+
hasConnectionStatus = true;
|
|
23975
|
+
if (registryDefinition && registryDefinition.debugPortAddress) {
|
|
23976
|
+
mode = getMode({ isSimulatedLocally: true, connected: true });
|
|
23977
|
+
} else {
|
|
23978
|
+
mode = getMode({ isSimulatedLocally: true, connected: false });
|
|
23979
|
+
}
|
|
23980
|
+
}
|
|
23981
|
+
}
|
|
23982
|
+
return {
|
|
23983
|
+
name: binding,
|
|
23984
|
+
type: getBindingTypeFriendlyName("service"),
|
|
23985
|
+
value,
|
|
23986
|
+
mode
|
|
23987
|
+
};
|
|
23988
|
+
})
|
|
23989
|
+
);
|
|
23990
|
+
}
|
|
23991
|
+
if (analytics_engine_datasets.length > 0) {
|
|
23992
|
+
output.push(
|
|
23993
|
+
...analytics_engine_datasets.map(({ binding, dataset }) => {
|
|
23994
|
+
return {
|
|
23995
|
+
name: binding,
|
|
23996
|
+
type: getBindingTypeFriendlyName("analytics_engine"),
|
|
23997
|
+
value: dataset ?? binding,
|
|
23998
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
23999
|
+
};
|
|
24000
|
+
})
|
|
24001
|
+
);
|
|
24002
|
+
}
|
|
24003
|
+
if (text_blobs.length > 0) {
|
|
24004
|
+
output.push(
|
|
24005
|
+
...text_blobs.map(({ binding, source }) => ({
|
|
24006
|
+
name: binding,
|
|
24007
|
+
type: getBindingTypeFriendlyName("text_blob"),
|
|
24008
|
+
value: "contents" in source ? truncate2(source.contents) : "path" in source ? truncate2(source.path) : void 0,
|
|
24009
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
24010
|
+
}))
|
|
24011
|
+
);
|
|
24012
|
+
}
|
|
24013
|
+
if (browser.length > 0) {
|
|
24014
|
+
output.push(
|
|
24015
|
+
...browser.map(({ binding, remote }) => ({
|
|
24016
|
+
name: binding,
|
|
24017
|
+
type: getBindingTypeFriendlyName("browser"),
|
|
24018
|
+
value: void 0,
|
|
24019
|
+
mode: getMode({
|
|
24020
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !remote
|
|
24021
|
+
})
|
|
24022
|
+
}))
|
|
24023
|
+
);
|
|
24024
|
+
}
|
|
24025
|
+
if (images.length > 0) {
|
|
24026
|
+
output.push(
|
|
24027
|
+
...images.map(({ binding, remote }) => ({
|
|
24028
|
+
name: binding,
|
|
24029
|
+
type: getBindingTypeFriendlyName("images"),
|
|
24030
|
+
value: void 0,
|
|
24031
|
+
mode: getMode({
|
|
24032
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !remote
|
|
24033
|
+
})
|
|
24034
|
+
}))
|
|
24035
|
+
);
|
|
24036
|
+
}
|
|
24037
|
+
if (stream.length > 0) {
|
|
24038
|
+
output.push(
|
|
24039
|
+
...stream.map(({ binding, remote }) => ({
|
|
24040
|
+
name: binding,
|
|
24041
|
+
type: getBindingTypeFriendlyName("stream"),
|
|
24042
|
+
value: void 0,
|
|
24043
|
+
mode: getMode({
|
|
24044
|
+
isSimulatedLocally: (remote === true || remote === void 0) && !context.remoteBindingsDisabled ? false : void 0
|
|
24045
|
+
})
|
|
24046
|
+
}))
|
|
24047
|
+
);
|
|
24048
|
+
}
|
|
24049
|
+
if (media.length > 0) {
|
|
24050
|
+
output.push(
|
|
24051
|
+
...media.map(({ binding, remote }) => ({
|
|
24052
|
+
name: binding,
|
|
24053
|
+
type: getBindingTypeFriendlyName("media"),
|
|
24054
|
+
value: void 0,
|
|
24055
|
+
mode: getMode({
|
|
24056
|
+
isSimulatedLocally: (remote === true || remote === void 0) && !context.remoteBindingsDisabled ? false : void 0
|
|
24057
|
+
})
|
|
24058
|
+
}))
|
|
24059
|
+
);
|
|
24060
|
+
}
|
|
24061
|
+
if (ai.length > 0) {
|
|
24062
|
+
output.push(
|
|
24063
|
+
...ai.map(({ binding, staging, remote }) => ({
|
|
24064
|
+
name: binding,
|
|
24065
|
+
type: getBindingTypeFriendlyName("ai"),
|
|
24066
|
+
value: staging ? `staging` : void 0,
|
|
24067
|
+
mode: getMode({
|
|
24068
|
+
isSimulatedLocally: (remote === true || remote === void 0) && !context.remoteBindingsDisabled ? false : void 0
|
|
24069
|
+
})
|
|
24070
|
+
}))
|
|
24071
|
+
);
|
|
24072
|
+
}
|
|
24073
|
+
if (pipelines.length > 0) {
|
|
24074
|
+
output.push(
|
|
24075
|
+
...pipelines.map(
|
|
24076
|
+
({ binding, stream: pipelineStream, pipeline, remote }) => ({
|
|
24077
|
+
name: binding,
|
|
24078
|
+
type: getBindingTypeFriendlyName("pipeline"),
|
|
24079
|
+
value: pipelineStream || pipeline,
|
|
24080
|
+
mode: getMode({
|
|
24081
|
+
isSimulatedLocally: context.remoteBindingsDisabled || !remote
|
|
24082
|
+
})
|
|
24083
|
+
})
|
|
24084
|
+
)
|
|
24085
|
+
);
|
|
24086
|
+
}
|
|
24087
|
+
if (ratelimits.length > 0) {
|
|
24088
|
+
output.push(
|
|
24089
|
+
...ratelimits.map(({ name, simple }) => ({
|
|
24090
|
+
name,
|
|
24091
|
+
type: getBindingTypeFriendlyName("ratelimit"),
|
|
24092
|
+
value: `${simple.limit} requests/${simple.period}s`,
|
|
24093
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
24094
|
+
}))
|
|
24095
|
+
);
|
|
24096
|
+
}
|
|
24097
|
+
if (assets.length > 0) {
|
|
24098
|
+
output.push(
|
|
24099
|
+
...assets.map(({ binding }) => ({
|
|
24100
|
+
name: binding,
|
|
24101
|
+
type: getBindingTypeFriendlyName("assets"),
|
|
24102
|
+
value: void 0,
|
|
24103
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
24104
|
+
}))
|
|
24105
|
+
);
|
|
24106
|
+
}
|
|
24107
|
+
if (version_metadata.length > 0) {
|
|
24108
|
+
output.push(
|
|
24109
|
+
...version_metadata.map(({ binding }) => ({
|
|
24110
|
+
name: binding,
|
|
24111
|
+
type: getBindingTypeFriendlyName("version_metadata"),
|
|
24112
|
+
value: void 0,
|
|
24113
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
24114
|
+
}))
|
|
24115
|
+
);
|
|
24116
|
+
}
|
|
24117
|
+
if (unsafe_bindings.length > 0) {
|
|
24118
|
+
output.push(
|
|
24119
|
+
...unsafe_bindings.map((binding) => {
|
|
24120
|
+
const dev = "dev" in binding ? binding.dev : void 0;
|
|
24121
|
+
const originalType = binding.type.slice("unsafe_".length);
|
|
24122
|
+
return {
|
|
24123
|
+
name: binding.name,
|
|
24124
|
+
type: dev ? dev.plugin.name : getBindingTypeFriendlyName(binding.type),
|
|
24125
|
+
value: originalType,
|
|
24126
|
+
mode: getMode({
|
|
24127
|
+
isSimulatedLocally: !!dev
|
|
24128
|
+
})
|
|
24129
|
+
};
|
|
24130
|
+
})
|
|
24131
|
+
);
|
|
24132
|
+
}
|
|
24133
|
+
if (vars.length > 0) {
|
|
24134
|
+
output.push(
|
|
24135
|
+
...vars.map((variable) => {
|
|
24136
|
+
const { binding, type: varType, value: varValue } = variable;
|
|
24137
|
+
let parsedValue;
|
|
24138
|
+
if (varType === "plain_text" && variable.hidden !== true) {
|
|
24139
|
+
parsedValue = `"${truncate2(varValue)}"`;
|
|
24140
|
+
} else if (varType === "json") {
|
|
24141
|
+
parsedValue = truncate2(JSON.stringify(varValue));
|
|
24142
|
+
} else {
|
|
24143
|
+
parsedValue = `"(hidden)"`;
|
|
24144
|
+
}
|
|
24145
|
+
return {
|
|
24146
|
+
name: binding,
|
|
24147
|
+
type: getBindingTypeFriendlyName(varType),
|
|
24148
|
+
value: parsedValue,
|
|
24149
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
24150
|
+
};
|
|
24151
|
+
})
|
|
24152
|
+
);
|
|
24153
|
+
}
|
|
24154
|
+
if (wasm_modules.length > 0) {
|
|
24155
|
+
output.push(
|
|
24156
|
+
...wasm_modules.map(({ binding, source }) => ({
|
|
24157
|
+
name: binding,
|
|
24158
|
+
type: getBindingTypeFriendlyName("wasm_module"),
|
|
24159
|
+
value: "contents" in source ? "<Wasm>" : truncate2(source.path),
|
|
24160
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
24161
|
+
}))
|
|
24162
|
+
);
|
|
24163
|
+
}
|
|
24164
|
+
if (dispatch_namespaces.length > 0) {
|
|
24165
|
+
output.push(
|
|
24166
|
+
...dispatch_namespaces.map(({ binding, namespace, outbound, remote }) => {
|
|
24167
|
+
return {
|
|
24168
|
+
name: binding,
|
|
24169
|
+
type: getBindingTypeFriendlyName("dispatch_namespace"),
|
|
24170
|
+
value: typeof namespace === "symbol" ? namespace : outbound ? `${namespace} (outbound -> ${outbound.service})` : namespace,
|
|
24171
|
+
mode: getMode({
|
|
24172
|
+
isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
|
|
24173
|
+
})
|
|
24174
|
+
};
|
|
24175
|
+
})
|
|
24176
|
+
);
|
|
24177
|
+
}
|
|
24178
|
+
if (mtls_certificates.length > 0) {
|
|
24179
|
+
output.push(
|
|
24180
|
+
...mtls_certificates.map(({ binding, certificate_id, remote }) => {
|
|
24181
|
+
return {
|
|
24182
|
+
name: binding,
|
|
24183
|
+
type: getBindingTypeFriendlyName("mtls_certificate"),
|
|
24184
|
+
value: certificate_id,
|
|
24185
|
+
mode: getMode({
|
|
24186
|
+
isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
|
|
24187
|
+
})
|
|
24188
|
+
};
|
|
24189
|
+
})
|
|
24190
|
+
);
|
|
24191
|
+
}
|
|
24192
|
+
if (worker_loaders.length > 0) {
|
|
24193
|
+
output.push(
|
|
24194
|
+
...worker_loaders.map(({ binding }) => ({
|
|
24195
|
+
name: binding,
|
|
24196
|
+
type: getBindingTypeFriendlyName("worker_loader"),
|
|
24197
|
+
value: void 0,
|
|
24198
|
+
mode: getMode({ isSimulatedLocally: true })
|
|
24199
|
+
}))
|
|
24200
|
+
);
|
|
24201
|
+
}
|
|
24202
|
+
if (output.length === 0) {
|
|
24203
|
+
if (context.warnIfNoBindings) {
|
|
24204
|
+
if (context.name && isMultiWorker) {
|
|
24205
|
+
log(`No bindings found for ${chalk.blue(context.name)}`);
|
|
24206
|
+
} else {
|
|
24207
|
+
log("No bindings found.");
|
|
24208
|
+
}
|
|
24209
|
+
}
|
|
24210
|
+
} else {
|
|
24211
|
+
let title2;
|
|
24212
|
+
if (context.provisioning) {
|
|
24213
|
+
title2 = "The following bindings need to be provisioned:";
|
|
24214
|
+
} else if (context.name && isMultiWorker) {
|
|
24215
|
+
title2 = `${chalk.blue(context.name)} has access to the following bindings:`;
|
|
24216
|
+
} else {
|
|
24217
|
+
title2 = "Your Worker has access to the following bindings:";
|
|
24218
|
+
}
|
|
24219
|
+
const headings = {
|
|
24220
|
+
binding: "Binding",
|
|
24221
|
+
resource: "Resource",
|
|
24222
|
+
mode: "Mode"
|
|
24223
|
+
};
|
|
24224
|
+
const maxValueLength = Math.max(
|
|
24225
|
+
...output.map(
|
|
24226
|
+
(b) => typeof b.value === "symbol" ? "inherited".length : b.value?.length ?? 0
|
|
24227
|
+
)
|
|
24228
|
+
);
|
|
24229
|
+
const maxNameLength = Math.max(...output.map((b) => b.name.length));
|
|
24230
|
+
const maxTypeLength = Math.max(
|
|
24231
|
+
...output.map((b) => b.type.length),
|
|
24232
|
+
headings.resource.length
|
|
24233
|
+
);
|
|
24234
|
+
const maxModeLength = Math.max(
|
|
24235
|
+
...output.map(
|
|
24236
|
+
(b) => b.mode ? stripVTControlCharacters(b.mode).length : headings.mode.length
|
|
24237
|
+
)
|
|
24238
|
+
);
|
|
24239
|
+
const hasMode = output.some((b) => b.mode);
|
|
24240
|
+
const bindingPrefix = `env.`;
|
|
24241
|
+
const bindingLength = bindingPrefix.length + maxNameLength + " (".length + maxValueLength + ")".length;
|
|
24242
|
+
const columnGapSpaces = 6;
|
|
24243
|
+
const columnGapSpacesWrapped = 4;
|
|
24244
|
+
const shouldWrap = bindingLength + columnGapSpaces + maxTypeLength + columnGapSpaces + maxModeLength >= process.stdout.columns;
|
|
24245
|
+
log(title2);
|
|
24246
|
+
const columnGap = shouldWrap ? " ".repeat(columnGapSpacesWrapped) : " ".repeat(columnGapSpaces);
|
|
24247
|
+
log(
|
|
24248
|
+
`${padEndAnsi(dim(headings.binding), shouldWrap ? bindingPrefix.length + maxNameLength : bindingLength)}${columnGap}${padEndAnsi(dim(headings.resource), maxTypeLength)}${columnGap}${hasMode ? dim(headings.mode) : ""}`
|
|
24249
|
+
);
|
|
24250
|
+
for (const binding of output) {
|
|
24251
|
+
const bindingValue = dim(
|
|
24252
|
+
typeof binding.value === "symbol" ? chalk.italic("inherited") : binding.value ?? ""
|
|
24253
|
+
);
|
|
24254
|
+
const bindingString = padEndAnsi(
|
|
24255
|
+
`${white(`env.${binding.name}`)}${binding.value && !shouldWrap ? ` (${bindingValue})` : ""}`,
|
|
24256
|
+
shouldWrap ? bindingPrefix.length + maxNameLength : bindingLength
|
|
24257
|
+
);
|
|
24258
|
+
const suffix = shouldWrap ? binding.value ? `
|
|
24259
|
+
${bindingValue}` : "" : "";
|
|
24260
|
+
log(
|
|
24261
|
+
`${bindingString}${columnGap}${brandColor(binding.type.padEnd(maxTypeLength))}${columnGap}${hasMode ? binding.mode : ""}${suffix}`
|
|
24262
|
+
);
|
|
24263
|
+
}
|
|
24264
|
+
log("");
|
|
24265
|
+
}
|
|
24266
|
+
let title;
|
|
24267
|
+
if (context.name && isMultiWorker) {
|
|
24268
|
+
title = `${chalk.blue(context.name)} is sending Tail events to the following Workers:`;
|
|
24269
|
+
} else {
|
|
24270
|
+
title = "Your Worker is sending Tail events to the following Workers:";
|
|
24271
|
+
}
|
|
24272
|
+
const allTailConsumers = [
|
|
24273
|
+
...(tailConsumers ?? []).map((c) => ({
|
|
24274
|
+
service: c.service,
|
|
24275
|
+
streaming: false
|
|
24276
|
+
})),
|
|
24277
|
+
...(streamingTailConsumers ?? []).map((c) => ({
|
|
24278
|
+
service: c.service,
|
|
24279
|
+
streaming: true
|
|
24280
|
+
}))
|
|
24281
|
+
];
|
|
24282
|
+
if (allTailConsumers.length > 0) {
|
|
24283
|
+
log(
|
|
24284
|
+
`${title}
|
|
24285
|
+
${allTailConsumers.map(({ service, streaming }) => {
|
|
24286
|
+
const displayName = `${service}${streaming ? ` (streaming)` : ""}`;
|
|
24287
|
+
if (context.local && context.registry !== null) {
|
|
24288
|
+
const registryDefinition = context.registry?.[service];
|
|
24289
|
+
hasConnectionStatus = true;
|
|
24290
|
+
if (registryDefinition) {
|
|
24291
|
+
return `- ${displayName} ${chalk.green("[connected]")}`;
|
|
24292
|
+
} else {
|
|
24293
|
+
return `- ${displayName} ${chalk.red("[not connected]")}`;
|
|
24294
|
+
}
|
|
24295
|
+
} else {
|
|
24296
|
+
return `- ${displayName}`;
|
|
24297
|
+
}
|
|
24298
|
+
}).join("\n")}`
|
|
24299
|
+
);
|
|
24300
|
+
}
|
|
24301
|
+
if (containers.length > 0 && !context.provisioning) {
|
|
24302
|
+
let containersTitle = "The following containers are available:";
|
|
24303
|
+
if (context.name && isMultiWorker) {
|
|
24304
|
+
containersTitle = `The following containers are available from ${chalk.blue(context.name)}:`;
|
|
24305
|
+
}
|
|
24306
|
+
log(
|
|
24307
|
+
`${containersTitle}
|
|
24308
|
+
${containers.map((c) => `- ${c.name} (${c.image})`).join("\n")}`
|
|
24309
|
+
);
|
|
24310
|
+
log("");
|
|
24311
|
+
}
|
|
24312
|
+
if (context.unsafeMetadata) {
|
|
24313
|
+
log("The following unsafe metadata will be attached to your Worker:");
|
|
24314
|
+
log(JSON.stringify(context.unsafeMetadata, null, 2));
|
|
24315
|
+
}
|
|
24316
|
+
if (hasConnectionStatus && !isConnectedStatusExplained) {
|
|
24317
|
+
log(
|
|
24318
|
+
dim(
|
|
24319
|
+
`
|
|
24320
|
+
Service bindings, Durable Object bindings, and Tail consumers connect to other Wrangler or Vite dev processes running locally, with their connection status indicated by ${chalk.green("[connected]")} or ${chalk.red("[not connected]")}. For more details, refer to https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#local-development
|
|
24321
|
+
`
|
|
24322
|
+
)
|
|
24323
|
+
);
|
|
24324
|
+
isConnectedStatusExplained = true;
|
|
24325
|
+
}
|
|
24326
|
+
}
|
|
24327
|
+
__name(printBindings, "printBindings");
|
|
24328
|
+
function padEndAnsi(str, length) {
|
|
24329
|
+
return str + " ".repeat(Math.max(0, length - stripVTControlCharacters(str).length));
|
|
24330
|
+
}
|
|
24331
|
+
__name(padEndAnsi, "padEndAnsi");
|
|
24332
|
+
function createGetMode({
|
|
24333
|
+
isProvisioning = false,
|
|
24334
|
+
isLocalDev = false
|
|
24335
|
+
}) {
|
|
24336
|
+
return /* @__PURE__ */ __name(function bindingMode({
|
|
24337
|
+
isSimulatedLocally,
|
|
24338
|
+
connected
|
|
24339
|
+
} = {}) {
|
|
24340
|
+
if (isProvisioning || !isLocalDev) {
|
|
24341
|
+
return void 0;
|
|
24342
|
+
}
|
|
24343
|
+
if (isSimulatedLocally === void 0) {
|
|
24344
|
+
return dim("not supported");
|
|
24345
|
+
}
|
|
24346
|
+
return `${isSimulatedLocally ? chalk.blue("local") : chalk.yellow("remote")}${connected === void 0 ? "" : connected ? chalk.green(" [connected]") : chalk.red(" [not connected]")}`;
|
|
24347
|
+
}, "bindingMode");
|
|
23170
24348
|
}
|
|
23171
|
-
__name(
|
|
24349
|
+
__name(createGetMode, "createGetMode");
|
|
23172
24350
|
|
|
23173
24351
|
// src/is-interactive.ts
|
|
23174
24352
|
var import_ci_info = __toESM(require_ci_info());
|
|
@@ -23212,8 +24390,8 @@ function createConfigCache(logger, options) {
|
|
|
23212
24390
|
}
|
|
23213
24391
|
}
|
|
23214
24392
|
const closestNodeModulesDirectory = dir("node_modules");
|
|
23215
|
-
const nodeModulesCache = closestNodeModulesDirectory ?
|
|
23216
|
-
const localCache =
|
|
24393
|
+
const nodeModulesCache = closestNodeModulesDirectory ? path.join(closestNodeModulesDirectory, ".cache", namespace) : null;
|
|
24394
|
+
const localCache = path.join(process.cwd(), `.${namespace}`, "cache");
|
|
23217
24395
|
if (nodeModulesCache && existsSync(nodeModulesCache)) {
|
|
23218
24396
|
return nodeModulesCache;
|
|
23219
24397
|
}
|
|
@@ -23232,7 +24410,7 @@ function createConfigCache(logger, options) {
|
|
|
23232
24410
|
logger.debug(
|
|
23233
24411
|
`Retrieving cached values for ${arrayFormatter.format(
|
|
23234
24412
|
fields
|
|
23235
|
-
)} from ${
|
|
24413
|
+
)} from ${path.relative(process.cwd(), folder)}`
|
|
23236
24414
|
);
|
|
23237
24415
|
cacheMessageShown = true;
|
|
23238
24416
|
}
|
|
@@ -23242,7 +24420,7 @@ function createConfigCache(logger, options) {
|
|
|
23242
24420
|
function getConfigCache(fileName) {
|
|
23243
24421
|
try {
|
|
23244
24422
|
const cacheFolder = getCacheFolder();
|
|
23245
|
-
const configCacheLocation =
|
|
24423
|
+
const configCacheLocation = path.join(cacheFolder, fileName);
|
|
23246
24424
|
const configCache = JSON.parse(
|
|
23247
24425
|
readFileSync$1(configCacheLocation, "utf-8")
|
|
23248
24426
|
);
|
|
@@ -23257,9 +24435,9 @@ function createConfigCache(logger, options) {
|
|
|
23257
24435
|
const cacheFolder = getCacheFolder();
|
|
23258
24436
|
if (cacheFolder) {
|
|
23259
24437
|
logger.debug(`Saving to cache: ${JSON.stringify(newValues)}`);
|
|
23260
|
-
const configCacheLocation =
|
|
24438
|
+
const configCacheLocation = path.join(cacheFolder, fileName);
|
|
23261
24439
|
const existingValues = getConfigCache(fileName);
|
|
23262
|
-
mkdirSync(
|
|
24440
|
+
mkdirSync(path.dirname(configCacheLocation), { recursive: true });
|
|
23263
24441
|
writeFileSync(
|
|
23264
24442
|
configCacheLocation,
|
|
23265
24443
|
JSON.stringify({ ...existingValues, ...newValues }, null, 2)
|
|
@@ -23549,7 +24727,7 @@ var {
|
|
|
23549
24727
|
// src/wrangler-tmp-dir.ts
|
|
23550
24728
|
function getWranglerHiddenDirPath(projectRoot) {
|
|
23551
24729
|
projectRoot ??= process.cwd();
|
|
23552
|
-
return
|
|
24730
|
+
return path__default.join(projectRoot, ".wrangler");
|
|
23553
24731
|
}
|
|
23554
24732
|
__name(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
|
|
23555
24733
|
var STALE_WRANGLER_TMP_DIR_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -23570,7 +24748,7 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
|
|
|
23570
24748
|
if (!entry.isDirectory()) {
|
|
23571
24749
|
continue;
|
|
23572
24750
|
}
|
|
23573
|
-
const entryPath =
|
|
24751
|
+
const entryPath = path__default.join(tmpRoot, entry.name);
|
|
23574
24752
|
try {
|
|
23575
24753
|
if (fs2.statSync(entryPath).mtimeMs < cutoff) {
|
|
23576
24754
|
removeDirSync(entryPath);
|
|
@@ -23581,10 +24759,10 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
|
|
|
23581
24759
|
}
|
|
23582
24760
|
__name(sweepStaleWranglerTmpDirs, "sweepStaleWranglerTmpDirs");
|
|
23583
24761
|
function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
|
|
23584
|
-
const tmpRoot =
|
|
24762
|
+
const tmpRoot = path__default.join(getWranglerHiddenDirPath(projectRoot), "tmp");
|
|
23585
24763
|
fs2.mkdirSync(tmpRoot, { recursive: true });
|
|
23586
24764
|
sweepStaleWranglerTmpDirs(tmpRoot);
|
|
23587
|
-
const tmpPrefix =
|
|
24765
|
+
const tmpPrefix = path__default.join(tmpRoot, `${prefix}-`);
|
|
23588
24766
|
const tmpDir = fs2.realpathSync(fs2.mkdtempSync(tmpPrefix));
|
|
23589
24767
|
const cleanupDir = /* @__PURE__ */ __name(() => {
|
|
23590
24768
|
if (cleanup) {
|
|
@@ -24288,7 +25466,7 @@ function terminateCloudflared(cloudflared) {
|
|
|
24288
25466
|
}
|
|
24289
25467
|
__name(terminateCloudflared, "terminateCloudflared");
|
|
24290
25468
|
function waitForQuickTunnelReady(cloudflared, timeoutMs, options) {
|
|
24291
|
-
return new Promise((
|
|
25469
|
+
return new Promise((resolve3, reject) => {
|
|
24292
25470
|
let resolved = false;
|
|
24293
25471
|
let stderrOutput = "";
|
|
24294
25472
|
const logger = options?.logger;
|
|
@@ -24316,7 +25494,7 @@ function waitForQuickTunnelReady(cloudflared, timeoutMs, options) {
|
|
|
24316
25494
|
if (match && !resolved) {
|
|
24317
25495
|
resolved = true;
|
|
24318
25496
|
clearTimeout(timeoutId);
|
|
24319
|
-
|
|
25497
|
+
resolve3({ mode: "quick", publicUrl: new URL(match[0]) });
|
|
24320
25498
|
}
|
|
24321
25499
|
});
|
|
24322
25500
|
}
|
|
@@ -24390,14 +25568,14 @@ function logHeaders(headers, logger) {
|
|
|
24390
25568
|
);
|
|
24391
25569
|
}
|
|
24392
25570
|
__name(logHeaders, "logHeaders");
|
|
24393
|
-
async function performApiFetchBase(complianceConfig, resource,
|
|
25571
|
+
async function performApiFetchBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
|
|
24394
25572
|
assert2(credentials, "credentials are required for performApiFetch");
|
|
24395
|
-
const method =
|
|
25573
|
+
const method = init.method ?? "GET";
|
|
24396
25574
|
assert2(
|
|
24397
25575
|
resource.startsWith("/"),
|
|
24398
25576
|
`CF API fetch - resource path must start with a "/" but got "${resource}"`
|
|
24399
25577
|
);
|
|
24400
|
-
const headers = cloneHeaders(new Headers(
|
|
25578
|
+
const headers = cloneHeaders(new Headers(init.headers));
|
|
24401
25579
|
addAuthorizationHeader(headers, credentials);
|
|
24402
25580
|
headers.set("User-Agent", userAgent);
|
|
24403
25581
|
maybeAddTraceHeader(headers);
|
|
@@ -24407,11 +25585,11 @@ async function performApiFetchBase(complianceConfig, resource, init2 = {}, userA
|
|
|
24407
25585
|
);
|
|
24408
25586
|
logger.debugWithSanitization?.("QUERY STRING:", queryString);
|
|
24409
25587
|
logHeaders(headers, logger);
|
|
24410
|
-
logger.debugWithSanitization?.("INIT:", JSON.stringify({ ...
|
|
24411
|
-
if (
|
|
25588
|
+
logger.debugWithSanitization?.("INIT:", JSON.stringify({ ...init }, null, 2));
|
|
25589
|
+
if (init.body instanceof FormData) {
|
|
24412
25590
|
logger.debugWithSanitization?.(
|
|
24413
25591
|
"BODY:",
|
|
24414
|
-
await new Response(
|
|
25592
|
+
await new Response(init.body).text(),
|
|
24415
25593
|
null,
|
|
24416
25594
|
2
|
|
24417
25595
|
);
|
|
@@ -24421,19 +25599,19 @@ async function performApiFetchBase(complianceConfig, resource, init2 = {}, userA
|
|
|
24421
25599
|
`${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`,
|
|
24422
25600
|
{
|
|
24423
25601
|
method,
|
|
24424
|
-
...
|
|
25602
|
+
...init,
|
|
24425
25603
|
headers,
|
|
24426
25604
|
signal: abortSignal
|
|
24427
25605
|
}
|
|
24428
25606
|
);
|
|
24429
25607
|
}
|
|
24430
25608
|
__name(performApiFetchBase, "performApiFetchBase");
|
|
24431
|
-
async function fetchInternalBase(complianceConfig, resource,
|
|
24432
|
-
const method =
|
|
25609
|
+
async function fetchInternalBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
|
|
25610
|
+
const method = init.method ?? "GET";
|
|
24433
25611
|
const response = await performApiFetchBase(
|
|
24434
25612
|
complianceConfig,
|
|
24435
25613
|
resource,
|
|
24436
|
-
|
|
25614
|
+
init,
|
|
24437
25615
|
userAgent,
|
|
24438
25616
|
logger,
|
|
24439
25617
|
queryParams,
|
|
@@ -24495,7 +25673,7 @@ async function fetchInternalBase(complianceConfig, resource, init2 = {}, userAge
|
|
|
24495
25673
|
}
|
|
24496
25674
|
}
|
|
24497
25675
|
__name(fetchInternalBase, "fetchInternalBase");
|
|
24498
|
-
async function fetchResultBase(complianceConfig, resource,
|
|
25676
|
+
async function fetchResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
|
|
24499
25677
|
const {
|
|
24500
25678
|
response: json2,
|
|
24501
25679
|
status,
|
|
@@ -24503,7 +25681,7 @@ async function fetchResultBase(complianceConfig, resource, init2 = {}, userAgent
|
|
|
24503
25681
|
} = await fetchInternalBase(
|
|
24504
25682
|
complianceConfig,
|
|
24505
25683
|
resource,
|
|
24506
|
-
|
|
25684
|
+
init,
|
|
24507
25685
|
userAgent,
|
|
24508
25686
|
logger,
|
|
24509
25687
|
queryParams,
|
|
@@ -24517,7 +25695,7 @@ async function fetchResultBase(complianceConfig, resource, init2 = {}, userAgent
|
|
|
24517
25695
|
}
|
|
24518
25696
|
}
|
|
24519
25697
|
__name(fetchResultBase, "fetchResultBase");
|
|
24520
|
-
async function fetchListResultBase(complianceConfig, resource,
|
|
25698
|
+
async function fetchListResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, credentials) {
|
|
24521
25699
|
const results = [];
|
|
24522
25700
|
let getMoreResults = true;
|
|
24523
25701
|
let cursor;
|
|
@@ -24533,7 +25711,7 @@ async function fetchListResultBase(complianceConfig, resource, init2 = {}, userA
|
|
|
24533
25711
|
} = await fetchInternalBase(
|
|
24534
25712
|
complianceConfig,
|
|
24535
25713
|
resource,
|
|
24536
|
-
|
|
25714
|
+
init,
|
|
24537
25715
|
userAgent,
|
|
24538
25716
|
logger,
|
|
24539
25717
|
queryParams,
|
|
@@ -24837,6 +26015,41 @@ ${url2}`
|
|
|
24837
26015
|
logger.debug(err instanceof Error ? err.stack ?? String(err) : String(err));
|
|
24838
26016
|
}
|
|
24839
26017
|
__name(handleBrowserOpenError, "handleBrowserOpenError");
|
|
26018
|
+
function writeOutput(entry) {
|
|
26019
|
+
if (outputFilePath === void 0) {
|
|
26020
|
+
outputFilePath = getOutputFilePath();
|
|
26021
|
+
}
|
|
26022
|
+
if (outputFilePath !== null) {
|
|
26023
|
+
mkdirSync(dirname(outputFilePath), { recursive: true });
|
|
26024
|
+
const entryJSON = JSON.stringify({
|
|
26025
|
+
...entry,
|
|
26026
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
26027
|
+
});
|
|
26028
|
+
appendFileSync(outputFilePath, entryJSON + "\n");
|
|
26029
|
+
}
|
|
26030
|
+
}
|
|
26031
|
+
__name(writeOutput, "writeOutput");
|
|
26032
|
+
function clearOutputFilePath() {
|
|
26033
|
+
outputFilePath = void 0;
|
|
26034
|
+
}
|
|
26035
|
+
__name(clearOutputFilePath, "clearOutputFilePath");
|
|
26036
|
+
var outputFilePath = void 0;
|
|
26037
|
+
function getOutputFilePath() {
|
|
26038
|
+
const outputFilePathFromEnv = getOutputFilePathFromEnv();
|
|
26039
|
+
if (outputFilePathFromEnv) {
|
|
26040
|
+
return outputFilePathFromEnv;
|
|
26041
|
+
}
|
|
26042
|
+
const outputFileDirectoryFromEnv = getOutputFileDirectoryFromEnv();
|
|
26043
|
+
if (outputFileDirectoryFromEnv) {
|
|
26044
|
+
const date5 = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-").replace(".", "_").replace("T", "_").replace("Z", "");
|
|
26045
|
+
return resolve(
|
|
26046
|
+
outputFileDirectoryFromEnv,
|
|
26047
|
+
`wrangler-output-${date5}-${randomBytes(3).toString("hex")}.json`
|
|
26048
|
+
);
|
|
26049
|
+
}
|
|
26050
|
+
return null;
|
|
26051
|
+
}
|
|
26052
|
+
__name(getOutputFilePath, "getOutputFilePath");
|
|
24840
26053
|
var MAX_ATTEMPTS = 3;
|
|
24841
26054
|
var MAX_RETRY_AFTER_MS = 6e4;
|
|
24842
26055
|
async function retryOnAPIFailure(action, logger, backoff = 0, attempts = MAX_ATTEMPTS, abortSignal) {
|
|
@@ -25019,266 +26232,6 @@ function getWorkerNameFromProject(projectPath) {
|
|
|
25019
26232
|
return getWorkerName(packageJsonName, projectPath);
|
|
25020
26233
|
}
|
|
25021
26234
|
__name(getWorkerNameFromProject, "getWorkerNameFromProject");
|
|
25022
|
-
|
|
25023
|
-
// ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
|
|
25024
|
-
var FORCE_COLOR;
|
|
25025
|
-
var NODE_DISABLE_COLORS;
|
|
25026
|
-
var NO_COLOR;
|
|
25027
|
-
var TERM;
|
|
25028
|
-
var isTTY = true;
|
|
25029
|
-
if (typeof process !== "undefined") {
|
|
25030
|
-
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
|
|
25031
|
-
isTTY = process.stdout && process.stdout.isTTY;
|
|
25032
|
-
}
|
|
25033
|
-
var $ = {
|
|
25034
|
-
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
|
|
25035
|
-
};
|
|
25036
|
-
function init(x, y) {
|
|
25037
|
-
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
|
|
25038
|
-
let open = `\x1B[${x}m`, close = `\x1B[${y}m`;
|
|
25039
|
-
return function(txt) {
|
|
25040
|
-
if (!$.enabled || txt == null) return txt;
|
|
25041
|
-
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
|
|
25042
|
-
};
|
|
25043
|
-
}
|
|
25044
|
-
__name(init, "init");
|
|
25045
|
-
var dim = init(2, 22);
|
|
25046
|
-
var red = init(31, 39);
|
|
25047
|
-
var green = init(32, 39);
|
|
25048
|
-
var yellow = init(33, 39);
|
|
25049
|
-
var blue = init(34, 39);
|
|
25050
|
-
var magenta = init(35, 39);
|
|
25051
|
-
var cyan = init(36, 39);
|
|
25052
|
-
|
|
25053
|
-
// src/zod-format.ts
|
|
25054
|
-
var originalEnabled = $.enabled;
|
|
25055
|
-
function _forceColour(enabled = originalEnabled) {
|
|
25056
|
-
$.enabled = enabled;
|
|
25057
|
-
}
|
|
25058
|
-
__name(_forceColour, "_forceColour");
|
|
25059
|
-
var kMessages = Symbol("kMessages");
|
|
25060
|
-
var kActual = Symbol("kActual");
|
|
25061
|
-
var kGroupId = Symbol("kGroupId");
|
|
25062
|
-
var groupColours = [
|
|
25063
|
-
yellow,
|
|
25064
|
-
/* (green) */
|
|
25065
|
-
cyan,
|
|
25066
|
-
blue,
|
|
25067
|
-
magenta,
|
|
25068
|
-
green
|
|
25069
|
-
];
|
|
25070
|
-
var GroupCountsMap = Map;
|
|
25071
|
-
function isAnnotation(value) {
|
|
25072
|
-
return typeof value === "object" && value !== null && kMessages in value && kActual in value;
|
|
25073
|
-
}
|
|
25074
|
-
__name(isAnnotation, "isAnnotation");
|
|
25075
|
-
function isRecord2(value) {
|
|
25076
|
-
return typeof value === "object" && value !== null;
|
|
25077
|
-
}
|
|
25078
|
-
__name(isRecord2, "isRecord");
|
|
25079
|
-
function arrayShallowEqual(a, b) {
|
|
25080
|
-
if (a.length !== b.length) {
|
|
25081
|
-
return false;
|
|
25082
|
-
}
|
|
25083
|
-
for (let i = 0; i < a.length; i++) {
|
|
25084
|
-
if (a[i] !== b[i]) {
|
|
25085
|
-
return false;
|
|
25086
|
-
}
|
|
25087
|
-
}
|
|
25088
|
-
return true;
|
|
25089
|
-
}
|
|
25090
|
-
__name(arrayShallowEqual, "arrayShallowEqual");
|
|
25091
|
-
function issueEqual(a, b) {
|
|
25092
|
-
return a.message === b.message && arrayShallowEqual(a.path, b.path);
|
|
25093
|
-
}
|
|
25094
|
-
__name(issueEqual, "issueEqual");
|
|
25095
|
-
function hasMultipleDistinctMessages(issues, atDepth) {
|
|
25096
|
-
let firstIssue;
|
|
25097
|
-
for (const issue2 of issues) {
|
|
25098
|
-
if (issue2.path.length < atDepth) {
|
|
25099
|
-
continue;
|
|
25100
|
-
}
|
|
25101
|
-
if (firstIssue === void 0) {
|
|
25102
|
-
firstIssue = issue2;
|
|
25103
|
-
} else if (!issueEqual(firstIssue, issue2)) {
|
|
25104
|
-
return true;
|
|
25105
|
-
}
|
|
25106
|
-
}
|
|
25107
|
-
return false;
|
|
25108
|
-
}
|
|
25109
|
-
__name(hasMultipleDistinctMessages, "hasMultipleDistinctMessages");
|
|
25110
|
-
function annotate(groupCounts, annotated, input, issue2, path6, groupId) {
|
|
25111
|
-
if (path6.length === 0) {
|
|
25112
|
-
if (issue2.code === "invalid_union") {
|
|
25113
|
-
const allBranchIssues = issue2.errors;
|
|
25114
|
-
const unionIssues = allBranchIssues.flat();
|
|
25115
|
-
if (unionIssues.length > 0) {
|
|
25116
|
-
const multipleDistinct = hasMultipleDistinctMessages(unionIssues, 1);
|
|
25117
|
-
let newGroupId;
|
|
25118
|
-
if (isRecord2(input) && multipleDistinct) {
|
|
25119
|
-
newGroupId = groupCounts.size;
|
|
25120
|
-
groupCounts.set(newGroupId, 0);
|
|
25121
|
-
}
|
|
25122
|
-
for (const branchIssues of allBranchIssues) {
|
|
25123
|
-
for (const unionIssue of branchIssues) {
|
|
25124
|
-
const unionPath = unionIssue.path;
|
|
25125
|
-
if (multipleDistinct && unionPath.length === 0) {
|
|
25126
|
-
continue;
|
|
25127
|
-
}
|
|
25128
|
-
annotated = annotate(
|
|
25129
|
-
groupCounts,
|
|
25130
|
-
annotated,
|
|
25131
|
-
input,
|
|
25132
|
-
unionIssue,
|
|
25133
|
-
unionPath,
|
|
25134
|
-
newGroupId
|
|
25135
|
-
);
|
|
25136
|
-
}
|
|
25137
|
-
}
|
|
25138
|
-
return annotated;
|
|
25139
|
-
}
|
|
25140
|
-
}
|
|
25141
|
-
const message = issue2.message;
|
|
25142
|
-
if (annotated !== void 0) {
|
|
25143
|
-
if (isAnnotation(annotated) && !annotated[kMessages].includes(message)) {
|
|
25144
|
-
annotated[kMessages].push(message);
|
|
25145
|
-
}
|
|
25146
|
-
return annotated;
|
|
25147
|
-
}
|
|
25148
|
-
if (groupId !== void 0) {
|
|
25149
|
-
const current = groupCounts.get(groupId);
|
|
25150
|
-
assert2(current !== void 0);
|
|
25151
|
-
groupCounts.set(groupId, current + 1);
|
|
25152
|
-
}
|
|
25153
|
-
return {
|
|
25154
|
-
[kMessages]: [message],
|
|
25155
|
-
[kActual]: input,
|
|
25156
|
-
[kGroupId]: groupId
|
|
25157
|
-
};
|
|
25158
|
-
}
|
|
25159
|
-
const [head, ...tail] = path6;
|
|
25160
|
-
assert2(isRecord2(input), "Expected object/array input for nested issue");
|
|
25161
|
-
if (annotated === void 0) {
|
|
25162
|
-
if (Array.isArray(input)) {
|
|
25163
|
-
annotated = new Array(input.length);
|
|
25164
|
-
} else {
|
|
25165
|
-
const entries = Object.keys(input).map((key) => [key, void 0]);
|
|
25166
|
-
annotated = Object.fromEntries(entries);
|
|
25167
|
-
}
|
|
25168
|
-
}
|
|
25169
|
-
assert2(isRecord2(annotated), "Expected object/array for nested issue");
|
|
25170
|
-
annotated[head] = annotate(
|
|
25171
|
-
groupCounts,
|
|
25172
|
-
annotated[head],
|
|
25173
|
-
input[head],
|
|
25174
|
-
issue2,
|
|
25175
|
-
tail,
|
|
25176
|
-
groupId
|
|
25177
|
-
);
|
|
25178
|
-
return annotated;
|
|
25179
|
-
}
|
|
25180
|
-
__name(annotate, "annotate");
|
|
25181
|
-
function print(inspectOptions, groupCounts, annotated, indent = "", extras) {
|
|
25182
|
-
const prefix = extras?.prefix ?? "";
|
|
25183
|
-
const suffix = extras?.suffix ?? "";
|
|
25184
|
-
if (isAnnotation(annotated)) {
|
|
25185
|
-
const prefixIndent = indent + " ".repeat(prefix.length);
|
|
25186
|
-
const actual = util.inspect(annotated[kActual], inspectOptions);
|
|
25187
|
-
const actualIndented = actual.split("\n").map((line, i) => i > 0 ? prefixIndent + line : line).join("\n");
|
|
25188
|
-
let messageColour = red;
|
|
25189
|
-
let messagePrefix = prefixIndent + "^";
|
|
25190
|
-
let groupOr = "";
|
|
25191
|
-
if (annotated[kGroupId] !== void 0) {
|
|
25192
|
-
messageColour = groupColours[annotated[kGroupId] % groupColours.length];
|
|
25193
|
-
messagePrefix += annotated[kGroupId] + 1;
|
|
25194
|
-
const remaining = groupCounts.get(annotated[kGroupId]);
|
|
25195
|
-
assert2(remaining !== void 0);
|
|
25196
|
-
if (remaining > 1) {
|
|
25197
|
-
groupOr = " *or*";
|
|
25198
|
-
}
|
|
25199
|
-
groupCounts.set(annotated[kGroupId], remaining - 1);
|
|
25200
|
-
}
|
|
25201
|
-
messagePrefix += " ";
|
|
25202
|
-
const messageIndent = " ".repeat(messagePrefix.length);
|
|
25203
|
-
const messageIndented = annotated[kMessages].flatMap((m) => m.split("\n")).map((line, i) => i > 0 ? messageIndent + line : line).join("\n");
|
|
25204
|
-
const error51 = messageColour(`${messagePrefix}${messageIndented}${groupOr}`);
|
|
25205
|
-
return `${indent}${dim(prefix)}${actualIndented}${dim(suffix)}
|
|
25206
|
-
${error51}`;
|
|
25207
|
-
} else if (Array.isArray(annotated)) {
|
|
25208
|
-
let result = `${indent}${dim(`${prefix}[`)}
|
|
25209
|
-
`;
|
|
25210
|
-
const arrayIndent = indent + " ";
|
|
25211
|
-
for (let i = 0; i < annotated.length; i++) {
|
|
25212
|
-
const value = annotated[i];
|
|
25213
|
-
if (value === void 0 && (i === 0 || annotated[i - 1] !== void 0)) {
|
|
25214
|
-
result += `${arrayIndent}${dim("...,")}
|
|
25215
|
-
`;
|
|
25216
|
-
}
|
|
25217
|
-
if (value !== void 0) {
|
|
25218
|
-
result += print(inspectOptions, groupCounts, value, arrayIndent, {
|
|
25219
|
-
prefix: `/* [${i}] */ `,
|
|
25220
|
-
suffix: ","
|
|
25221
|
-
});
|
|
25222
|
-
result += "\n";
|
|
25223
|
-
}
|
|
25224
|
-
}
|
|
25225
|
-
result += `${indent}${dim(`]${suffix}`)}`;
|
|
25226
|
-
return result;
|
|
25227
|
-
} else if (isRecord2(annotated)) {
|
|
25228
|
-
let result = `${indent}${dim(`${prefix}{`)}
|
|
25229
|
-
`;
|
|
25230
|
-
const objectIndent = indent + " ";
|
|
25231
|
-
const entries = Object.entries(annotated);
|
|
25232
|
-
for (let i = 0; i < entries.length; i++) {
|
|
25233
|
-
const [key, value] = entries[i];
|
|
25234
|
-
if (value === void 0 && (i === 0 || entries[i - 1][1] !== void 0)) {
|
|
25235
|
-
result += `${objectIndent}${dim("...,")}
|
|
25236
|
-
`;
|
|
25237
|
-
}
|
|
25238
|
-
if (value !== void 0) {
|
|
25239
|
-
result += print(inspectOptions, groupCounts, value, objectIndent, {
|
|
25240
|
-
prefix: `${key}: `,
|
|
25241
|
-
suffix: ","
|
|
25242
|
-
});
|
|
25243
|
-
result += "\n";
|
|
25244
|
-
}
|
|
25245
|
-
}
|
|
25246
|
-
result += `${indent}${dim(`}${suffix}`)}`;
|
|
25247
|
-
return result;
|
|
25248
|
-
}
|
|
25249
|
-
return "";
|
|
25250
|
-
}
|
|
25251
|
-
__name(print, "print");
|
|
25252
|
-
function formatZodError(error51, input) {
|
|
25253
|
-
const sortedIssues = Array.from(error51.issues).sort((a, b) => {
|
|
25254
|
-
if (a.code !== b.code) {
|
|
25255
|
-
if (a.code === "invalid_union") {
|
|
25256
|
-
return -1;
|
|
25257
|
-
}
|
|
25258
|
-
if (b.code === "invalid_union") {
|
|
25259
|
-
return 1;
|
|
25260
|
-
}
|
|
25261
|
-
}
|
|
25262
|
-
return 0;
|
|
25263
|
-
});
|
|
25264
|
-
let annotated;
|
|
25265
|
-
const groupCounts = new GroupCountsMap();
|
|
25266
|
-
for (const issue2 of sortedIssues) {
|
|
25267
|
-
annotated = annotate(
|
|
25268
|
-
groupCounts,
|
|
25269
|
-
annotated,
|
|
25270
|
-
input,
|
|
25271
|
-
issue2,
|
|
25272
|
-
issue2.path
|
|
25273
|
-
);
|
|
25274
|
-
}
|
|
25275
|
-
const inspectOptions = {
|
|
25276
|
-
depth: 0,
|
|
25277
|
-
colors: $.enabled
|
|
25278
|
-
};
|
|
25279
|
-
return print(inspectOptions, groupCounts, annotated);
|
|
25280
|
-
}
|
|
25281
|
-
__name(formatZodError, "formatZodError");
|
|
25282
26235
|
function toUrlPath(filePath) {
|
|
25283
26236
|
assert$1(
|
|
25284
26237
|
!/^[a-z]:/i.test(filePath),
|
|
@@ -25324,4 +26277,4 @@ safe-buffer/index.js:
|
|
|
25324
26277
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
25325
26278
|
*/
|
|
25326
26279
|
|
|
25327
|
-
export { ARTIFACTS_EVENT_TYPES, BunPackageManager,
|
|
26280
|
+
export { ARTIFACTS_EVENT_TYPES, BunPackageManager, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, convertConfigToBindings, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractBindingsOfType, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBindings, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isUnsafeBindingType, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, printBindings, renderError, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validateBindingRemoteSetting, validatePagesConfig, writeOutput };
|