wrangler 4.120.0 → 4.121.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.
@@ -34775,6 +34775,16 @@ function assertOneOf(choices, value) {
34775
34775
  );
34776
34776
  }
34777
34777
  }
34778
+ function isDoNotTrackEnabled() {
34779
+ const value = getDoNotTrackFromEnv()?.toLowerCase();
34780
+ return value === "1" || value === "true";
34781
+ }
34782
+ function getWranglerSendMetricsFromEnv() {
34783
+ if (isDoNotTrackEnabled()) {
34784
+ return false;
34785
+ }
34786
+ return getWranglerSendMetricsVariableFromEnv();
34787
+ }
34778
34788
  function getComplianceRegionSubdomain(complianceConfig) {
34779
34789
  return getCloudflareComplianceRegion(complianceConfig) === "fedramp_high" ? ".fed" : "";
34780
34790
  }
@@ -38995,7 +39005,7 @@ function toUrlPath(filePath) {
38995
39005
  );
38996
39006
  return filePath.replace(/\\/g, "/");
38997
39007
  }
38998
- var import_undici, require_vendors, require_ci_info, require_command_exists, require_command_exists2, require_ini, require_strip_json_comments, require_utils2, require_deep_extend, require_minimist, require_rc, require_registry_url, require_safe_buffer, require_base64, require_registry_auth_token, require_update_check, ARTIFACTS_EVENT_TYPES; exports.unstable_defaultWranglerConfig = void 0; exports.experimental_patchConfig = void 0; var getJSONPath, PatchConfigError, external_exports, core_exports2, _a, NEVER, $brand, $ZodAsyncError, $ZodEncodeError, globalConfig, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, initializer, $ZodError, $ZodRealError, _parse, parse4, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, encode, _decode, decode, _encodeAsync, encodeAsync, _decodeAsync, decodeAsync, _safeEncode, safeEncode, _safeDecode, safeDecode, _safeEncodeAsync, safeEncodeAsync, _safeDecodeAsync, safeDecodeAsync, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, httpProtocol, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, Doc, version, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodPreprocess, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, locales_exports, error, error2, error3, error4, error5, error6, error7, error8, error9, error10, error11, error12, error13, error14, error15, error16, error17, error18, error19, error20, error21, error22, error23, error24, error25, error26, error27, capitalizeFirstCharacter, error28, error29, error30, error31, error32, error33, error34, error35, error36, error37, error38, error39, error40, error41, error42, error43, error44, error45, error46, error47, error48, error49, error50, _a2, $output, $input, $ZodRegistry, globalRegistry, TimePrecision, createToJSONSchemaMethod, createStandardJSONSchemaMethod, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, JSONSchemaGenerator, json_schema_exports, schemas_exports2, checks_exports2, iso_exports, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, initializer2, ZodError, ZodRealError, parse22, parseAsync2, safeParse2, safeParseAsync2, encode2, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, _installedGroups, ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodXor, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodCodec, ZodPreprocess, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodFunction, ZodCustom, describe2, meta2, stringbool, ZodIssueCode, ZodFirstPartyTypeKind, z, RECOGNIZED_KEYS, coerce_exports, SENSITIVE_STEP_OUTPUT, MAX_WORKFLOW_NAME_LENGTH, ALLOWED_STRING_ID_PATTERN, ALLOWED_WORKFLOW_INSTANCE_ID_REGEX, ALLOWED_WORKFLOW_NAME_REGEX, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getWranglerSendErrorReportsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getWorkersCIBranchName, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getD1ExtraLocationChoices, getDockerPath, getSubdomainMixedStateCheckDisabled, getCloudflareLoadDevVarsFromDotEnv, getCloudflareIncludeProcessEnvFromEnv, getTraceHeader, getDisableConfigWatching, getWranglerHideBanner, getCloudflareEnv, getOpenNextDeployFromEnv, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getBrowserRenderingHeadfulFromEnv, getWranglerCacheDirFromEnv, getCloudflaredPathFromEnv, Diagnostics, appendEnvName, isString, isValidName, isValidDateTimeStringFormat, isStringArray, isOneOf, all, isMutuallyExclusiveWith, isBoolean, validateRequiredProperty, validateAtLeastOnePropertyRequired, validateOptionalProperty, validateTypedArray, validateOptionalTypedArray, isRequiredProperty, isOptionalProperty, hasProperty, validateAdditionalProperties, getBindingNames, isBindingList, isNamespaceList, isRecord, validateUniqueNameProperty, bucketFormatMessage, friendlyBindingNames, bindingTypeFriendlyNames, ENGLISH, ALLOWED_INSTANCE_TYPES, isRoute, isRouteArray, validateTailConsumers, validateStreamingTailConsumers, validateAndNormalizeRules, ARTIFACTS_EVENT_TYPE_SET, validateTriggers, validateRules, validateRule, validateDefines, validateVars, validateSecrets, validateBindingsProperty, validateUnsafeSettings, validateDurableObjectBinding, workflowNameFormatMessage, validateWorkflowBinding, validateCflogfwdrObject, validateCflogfwdrBinding, validateAssetsConfig, validateNamedSimpleBinding, validateAIBinding, validateVersionMetadataBinding, validateUnsafeBinding, validateBindingArray, validateCloudchamberConfig, validateKVBinding, validateSendEmailBinding, validateQueueBinding, validateR2Binding, validateD1Binding, validateVectorizeBinding, validateAISearchNamespaceBinding, validateAISearchBinding, validateAgentMemoryBinding, validateHyperdriveBinding, validateVpcServiceBinding, validateVpcNetworkBinding, validateBindingsHaveUniqueNames, validateServiceBinding, validateAnalyticsEngineBinding, validateWorkerNamespaceBinding, validateMTlsCertificateBinding, validateConsumer, validateCompatibilityDate, validatePipelineBinding, validateSecretsStoreSecretBinding, validateArtifactsBinding, validateHelloWorldBinding, validateFlagshipBinding, validateWorkerLoaderBinding, validateRateLimitBinding, validatePreviewsConfig, validateMigrations, VALID_EXPORT_STORAGES, JS_IDENTIFIER_RE, validateExports, validateObservability, validateCache, validatePythonModules, BINDING_LOCAL_SUPPORT, supportedPagesConfigFields, import_ci_info, arrayFormatter, signals, processOk, kExitEmitter, global2, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process3, onExit, load, unload, STALE_WRANGLER_TMP_DIR_MS, sweptTmpRoots, import_command_exists, UPDATE_SERVICE_URL, CLOUDFLARED_VERSION_PATTERN, GITHUB_RELEASE_BASE, TUNNEL_STARTUP_TIMEOUT_MS, TUNNEL_FORCE_KILL_TIMEOUT_MS, DEFAULT_TUNNEL_EXPIRY_MS, DEFAULT_TUNNEL_EXTENSION_MS, DEFAULT_TUNNEL_MAX_REMAINING_MS, DEFAULT_TUNNEL_REMINDER_INTERVAL_MS, QUICK_TUNNEL_URL_REGEX, import_update_check, UPDATE_CHECK_TIMEOUT_MS, TIMED_OUT, LOGGER_LEVELS, MAX_ATTEMPTS, MAX_RETRY_AFTER_MS, NpmPackageManager, PnpmPackageManager, YarnPackageManager, BunPackageManager, NubPackageManager, invalidWorkerNameCharsRegex, invalidWorkerNameStartEndRegex, workerNameLengthLimit, FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY, $, dim, red, green, yellow, blue, magenta, cyan, originalEnabled, kMessages, kActual, kGroupId, groupColours, GroupCountsMap, friendlyBindingNames2;
39008
+ var import_undici, require_vendors, require_ci_info, require_command_exists, require_command_exists2, require_ini, require_strip_json_comments, require_utils2, require_deep_extend, require_minimist, require_rc, require_registry_url, require_safe_buffer, require_base64, require_registry_auth_token, require_update_check, ARTIFACTS_EVENT_TYPES; exports.unstable_defaultWranglerConfig = void 0; exports.experimental_patchConfig = void 0; var getJSONPath, PatchConfigError, external_exports, core_exports2, _a, NEVER, $brand, $ZodAsyncError, $ZodEncodeError, globalConfig, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, initializer, $ZodError, $ZodRealError, _parse, parse4, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, encode, _decode, decode, _encodeAsync, encodeAsync, _decodeAsync, decodeAsync, _safeEncode, safeEncode, _safeDecode, safeDecode, _safeEncodeAsync, safeEncodeAsync, _safeDecodeAsync, safeDecodeAsync, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, httpProtocol, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, Doc, version, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodPreprocess, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, locales_exports, error, error2, error3, error4, error5, error6, error7, error8, error9, error10, error11, error12, error13, error14, error15, error16, error17, error18, error19, error20, error21, error22, error23, error24, error25, error26, error27, capitalizeFirstCharacter, error28, error29, error30, error31, error32, error33, error34, error35, error36, error37, error38, error39, error40, error41, error42, error43, error44, error45, error46, error47, error48, error49, error50, _a2, $output, $input, $ZodRegistry, globalRegistry, TimePrecision, createToJSONSchemaMethod, createStandardJSONSchemaMethod, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, JSONSchemaGenerator, json_schema_exports, schemas_exports2, checks_exports2, iso_exports, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, initializer2, ZodError, ZodRealError, parse22, parseAsync2, safeParse2, safeParseAsync2, encode2, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, _installedGroups, ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber, ZodNumberFormat, ZodBoolean, ZodBigInt, ZodBigIntFormat, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodDate, ZodArray, ZodObject, ZodUnion, ZodXor, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodEnum, ZodLiteral, ZodFile, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch, ZodNaN, ZodPipe, ZodCodec, ZodPreprocess, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodPromise, ZodFunction, ZodCustom, describe2, meta2, stringbool, ZodIssueCode, ZodFirstPartyTypeKind, z, RECOGNIZED_KEYS, coerce_exports, SENSITIVE_STEP_OUTPUT, MAX_WORKFLOW_NAME_LENGTH, ALLOWED_STRING_ID_PATTERN, ALLOWED_WORKFLOW_INSTANCE_ID_REGEX, ALLOWED_WORKFLOW_NAME_REGEX, getC3CommandFromEnv, getDoNotTrackFromEnv, getWranglerSendMetricsVariableFromEnv, getWranglerSendErrorReportsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getWorkersCIBranchName, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getD1ExtraLocationChoices, getDockerPath, getSubdomainMixedStateCheckDisabled, getCloudflareLoadDevVarsFromDotEnv, getCloudflareIncludeProcessEnvFromEnv, getTraceHeader, getDisableConfigWatching, getWranglerHideBanner, getCloudflareEnv, getOpenNextDeployFromEnv, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getBrowserRenderingHeadfulFromEnv, getWranglerCacheDirFromEnv, getCloudflaredPathFromEnv, Diagnostics, appendEnvName, isString, isValidName, isValidDateTimeStringFormat, isStringArray, isOneOf, all, isMutuallyExclusiveWith, isBoolean, validateRequiredProperty, validateAtLeastOnePropertyRequired, validateOptionalProperty, validateTypedArray, validateOptionalTypedArray, isRequiredProperty, isOptionalProperty, hasProperty, validateAdditionalProperties, getBindingNames, isBindingList, isNamespaceList, isRecord, validateUniqueNameProperty, bucketFormatMessage, friendlyBindingNames, bindingTypeFriendlyNames, ENGLISH, ALLOWED_INSTANCE_TYPES, isRoute, isRouteArray, validateTailConsumers, validateStreamingTailConsumers, validateAndNormalizeRules, ARTIFACTS_EVENT_TYPE_SET, validateTriggers, validateRules, validateRule, validateDefines, validateVars, validateSecrets, validateBindingsProperty, validateUnsafeSettings, validateDurableObjectBinding, workflowNameFormatMessage, validateWorkflowBinding, validateCflogfwdrObject, validateCflogfwdrBinding, validateAssetsConfig, validateNamedSimpleBinding, validateAIBinding, validateVersionMetadataBinding, validateUnsafeBinding, validateBindingArray, validateCloudchamberConfig, validateKVBinding, validateSendEmailBinding, validateQueueBinding, validateR2Binding, validateD1Binding, validateVectorizeBinding, validateAISearchNamespaceBinding, validateAISearchBinding, validateAgentMemoryBinding, validateHyperdriveBinding, validateVpcServiceBinding, validateVpcNetworkBinding, validateBindingsHaveUniqueNames, validateServiceBinding, validateAnalyticsEngineBinding, validateWorkerNamespaceBinding, validateMTlsCertificateBinding, validateConsumer, validateCompatibilityDate, validatePipelineBinding, validateSecretsStoreSecretBinding, validateArtifactsBinding, validateHelloWorldBinding, validateFlagshipBinding, validateWorkerLoaderBinding, validateRateLimitBinding, validatePreviewsConfig, validateMigrations, VALID_EXPORT_STORAGES, JS_IDENTIFIER_RE, validateExports, validateObservability, validateCache, validatePythonModules, BINDING_LOCAL_SUPPORT, supportedPagesConfigFields, import_ci_info, arrayFormatter, signals, processOk, kExitEmitter, global2, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process3, onExit, load, unload, STALE_WRANGLER_TMP_DIR_MS, sweptTmpRoots, import_command_exists, UPDATE_SERVICE_URL, CLOUDFLARED_VERSION_PATTERN, GITHUB_RELEASE_BASE, TUNNEL_STARTUP_TIMEOUT_MS, TUNNEL_FORCE_KILL_TIMEOUT_MS, DEFAULT_TUNNEL_EXPIRY_MS, DEFAULT_TUNNEL_EXTENSION_MS, DEFAULT_TUNNEL_MAX_REMAINING_MS, DEFAULT_TUNNEL_REMINDER_INTERVAL_MS, QUICK_TUNNEL_URL_REGEX, import_update_check, UPDATE_CHECK_TIMEOUT_MS, TIMED_OUT, LOGGER_LEVELS, MAX_ATTEMPTS, MAX_RETRY_AFTER_MS, NpmPackageManager, PnpmPackageManager, YarnPackageManager, BunPackageManager, NubPackageManager, invalidWorkerNameCharsRegex, invalidWorkerNameStartEndRegex, workerNameLengthLimit, FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY, $, dim, red, green, yellow, blue, magenta, cyan, originalEnabled, kMessages, kActual, kGroupId, groupColours, GroupCountsMap, friendlyBindingNames2;
38999
39009
  var init_dist = __esm({
39000
39010
  "../workers-utils/dist/index.mjs"() {
39001
39011
  init_import_meta_url();
@@ -52260,9 +52270,16 @@ var init_dist = __esm({
52260
52270
  variableName: "WRANGLER_C3_COMMAND",
52261
52271
  defaultValue: /* @__PURE__ */ __name2(() => "create cloudflare", "defaultValue")
52262
52272
  });
52263
- getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({
52273
+ getDoNotTrackFromEnv = getEnvironmentVariableFactory({
52274
+ variableName: "DO_NOT_TRACK"
52275
+ });
52276
+ __name(isDoNotTrackEnabled, "isDoNotTrackEnabled");
52277
+ __name2(isDoNotTrackEnabled, "isDoNotTrackEnabled");
52278
+ getWranglerSendMetricsVariableFromEnv = getBooleanEnvironmentVariableFactory({
52264
52279
  variableName: "WRANGLER_SEND_METRICS"
52265
52280
  });
52281
+ __name(getWranglerSendMetricsFromEnv, "getWranglerSendMetricsFromEnv");
52282
+ __name2(getWranglerSendMetricsFromEnv, "getWranglerSendMetricsFromEnv");
52266
52283
  getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
52267
52284
  variableName: "WRANGLER_SEND_ERROR_REPORTS",
52268
52285
  defaultValue: false
@@ -58174,7 +58191,7 @@ var name, version2;
58174
58191
  var init_package = __esm({
58175
58192
  "package.json"() {
58176
58193
  name = "wrangler";
58177
- version2 = "4.120.0";
58194
+ version2 = "4.121.0";
58178
58195
  }
58179
58196
  });
58180
58197
 
@@ -142938,11 +142955,15 @@ async function getMigrationsToUpload(scriptName, props) {
142938
142955
  suppressNotFoundError(err);
142939
142956
  }
142940
142957
  } else {
142941
- const scripts = await fetchResult(
142942
- config22,
142943
- `/accounts/${accountId}/workers/scripts`
142944
- );
142945
- script = scripts.find(({ id }) => id === scriptName);
142958
+ try {
142959
+ const serviceMetadata = await fetchResult(
142960
+ config22,
142961
+ `/accounts/${accountId}/workers/services/${scriptName}`
142962
+ );
142963
+ script = serviceMetadata.default_environment.script;
142964
+ } catch (err) {
142965
+ suppressNotFoundError(err);
142966
+ }
142946
142967
  }
142947
142968
  if (script?.migration_tag) {
142948
142969
  const scriptMigrationTag = script.migration_tag;
@@ -150590,7 +150611,7 @@ async function deletePreview(config22, accountId, workerName, previewIdentifier)
150590
150611
  }
150591
150612
  );
150592
150613
  }
150593
- async function getPreviewDeployment(config22, accountId, workerName, previewIdentifier, deploymentIdentifier) {
150614
+ async function getPreviewDeployment(config22, accountId, workerName, previewIdentifier, deploymentIdentifier = "latest") {
150594
150615
  return fetchResult(
150595
150616
  config22,
150596
150617
  `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
@@ -150613,6 +150634,19 @@ async function createPreviewDeployment(config22, accountId, workerName, previewI
150613
150634
  queryParams
150614
150635
  );
150615
150636
  }
150637
+ async function patchPreviewDeployment(config22, accountId, workerName, previewIdentifier, env7, annotations, deploymentIdentifier = "latest") {
150638
+ return fetchResult(
150639
+ config22,
150640
+ `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
150641
+ previewIdentifier
150642
+ )}/deployments/${encodeURIComponent(deploymentIdentifier)}`,
150643
+ {
150644
+ method: "PATCH",
150645
+ headers: { "Content-Type": "application/merge-patch+json" },
150646
+ body: JSON.stringify({ env: env7, annotations })
150647
+ }
150648
+ );
150649
+ }
150616
150650
  async function getWorkerPreviewDefaults(config22, accountId, workerName) {
150617
150651
  const worker = await fetchResult(
150618
150652
  config22,
@@ -150632,6 +150666,25 @@ async function editWorkerPreviewDefaults(config22, accountId, workerName, previe
150632
150666
  );
150633
150667
  return worker.preview_defaults ?? {};
150634
150668
  }
150669
+ async function getPreviewBaseConfig(config22, accountId, workerName) {
150670
+ const worker = await fetchResult(
150671
+ config22,
150672
+ `/accounts/${accountId}/workers/workers/${workerName}`
150673
+ );
150674
+ return worker.previews_base_config ?? {};
150675
+ }
150676
+ async function patchPreviewBaseConfig(config22, accountId, workerName, previewBaseConfig) {
150677
+ const worker = await fetchResult(
150678
+ config22,
150679
+ `/accounts/${accountId}/workers/workers/${workerName}`,
150680
+ {
150681
+ method: "PATCH",
150682
+ headers: { "Content-Type": "application/merge-patch+json" },
150683
+ body: JSON.stringify({ previews_base_config: previewBaseConfig })
150684
+ }
150685
+ );
150686
+ return worker.previews_base_config ?? {};
150687
+ }
150635
150688
  function getBranchName2() {
150636
150689
  const workersCIBranch = getWorkersCIBranchName();
150637
150690
  if (workersCIBranch) {
@@ -150936,168 +150989,6 @@ function assemblePreviewDefaults(config22) {
150936
150989
  }
150937
150990
  return previewDefaults;
150938
150991
  }
150939
- function stripAnsi4(str) {
150940
- return str.replace(/\x1b\[[0-9;]*m/g, "");
150941
- }
150942
- function visibleLength(str) {
150943
- return stripAnsi4(str).length;
150944
- }
150945
- function padToVisibleWidth(str, width) {
150946
- const visible = visibleLength(str);
150947
- return str + " ".repeat(Math.max(0, width - visible));
150948
- }
150949
- function drawBox(contentLines, options = {}) {
150950
- const lines = [...contentLines, ...options.footerLines ?? []];
150951
- const maxContentWidth = Math.max(
150952
- ...lines.map((line) => visibleLength(line)),
150953
- 0
150954
- );
150955
- const boxWidth = maxContentWidth + 4;
150956
- const horizontalLine = BOX.horizontal.repeat(boxWidth - 2);
150957
- const topBorder = `${BOX.topLeft}${horizontalLine}${BOX.topRight}`;
150958
- const bottomBorder = options.connectToChild ? `${BOX.bottomLeft}${BOX.horizontal}${BOX.bottomLeftWithConnector}${BOX.horizontal.repeat(boxWidth - 4)}${BOX.bottomRight}` : `${BOX.bottomLeft}${horizontalLine}${BOX.bottomRight}`;
150959
- const paddedLines = lines.map((line) => {
150960
- const paddedContent = padToVisibleWidth(line, maxContentWidth);
150961
- return `${BOX.vertical} ${paddedContent} ${BOX.vertical}`;
150962
- });
150963
- return [topBorder, ...paddedLines, bottomBorder].join("\n");
150964
- }
150965
- function drawConnectedChildBox(contentLines, options = {}) {
150966
- const indent = options.indent ?? " ";
150967
- const lines = [...contentLines, ...options.footerLines ?? []];
150968
- const maxContentWidth = lines.length > 0 ? Math.max(...lines.map((line) => visibleLength(line))) : 0;
150969
- const boxWidth = maxContentWidth + 4;
150970
- const horizontalLine = BOX.horizontal.repeat(boxWidth - 2);
150971
- const topBorder = `${BOX.topLeft}${horizontalLine}${BOX.topRight}`;
150972
- const bottomBorder = `${BOX.bottomLeft}${horizontalLine}${BOX.bottomRight}`;
150973
- const paddedLines = lines.map((line) => {
150974
- const paddedContent = padToVisibleWidth(line, maxContentWidth);
150975
- return `${BOX.vertical} ${paddedContent} ${BOX.vertical}`;
150976
- });
150977
- const connectorIndex = options.connectorLineIndex ?? Math.floor(paddedLines.length / 2);
150978
- const result = [];
150979
- result.push(`${indent}${BOX.vertical}`);
150980
- result.push(`${indent}${BOX.vertical} ${topBorder}`);
150981
- paddedLines.forEach((line, index) => {
150982
- if (index === connectorIndex) {
150983
- result.push(
150984
- `${indent}${BOX.bottomLeft}${BOX.horizontal}${BOX.connectorRight}${line.slice(1)}`
150985
- );
150986
- } else if (index < connectorIndex) {
150987
- result.push(`${indent}${BOX.vertical} ${line}`);
150988
- } else {
150989
- result.push(`${indent} ${line}`);
150990
- }
150991
- });
150992
- result.push(`${indent} ${bottomBorder}`);
150993
- return result.join("\n");
150994
- }
150995
- function getFriendlyBindingType(bindingType) {
150996
- return getBindingTypeFriendlyName(
150997
- bindingType
150998
- );
150999
- }
151000
- function formatAlignedRows(rows, indent = " ") {
151001
- const labelWidth = Math.max(...rows.map(([label]) => label.length));
151002
- const valueWidth = Math.max(...rows.map(([, value]) => value.length));
151003
- return rows.map(([label, value, fromConfig]) => {
151004
- const marker = fromConfig ? CONFIG_MARKER : " ";
151005
- const coloredLabel = source_default.cyan(padToVisibleWidth(label, labelWidth));
151006
- return `${indent}${coloredLabel} ${padToVisibleWidth(
151007
- value,
151008
- valueWidth
151009
- )} ${marker}`;
151010
- });
151011
- }
151012
- function formatBindings(env7, indent = " ", options = {}) {
151013
- const showSourceMarker = options.showSourceMarker ?? true;
151014
- const entries2 = Object.entries(env7);
151015
- if (entries2.length === 0) {
151016
- return [`${indent}${source_default.dim("(none)")}`];
151017
- }
151018
- const nameWidth = Math.max(...entries2.map(([name2]) => name2.length));
151019
- const typeWidth = Math.max(
151020
- ...entries2.map(
151021
- ([, binding]) => visibleLength(getFriendlyBindingType(binding.type))
151022
- )
151023
- );
151024
- const valueWidth = Math.max(
151025
- ...entries2.map(([, binding]) => getBindingValue(binding).length)
151026
- );
151027
- return entries2.map(([name2, binding]) => {
151028
- const value = getBindingValue(binding);
151029
- const friendlyType = getFriendlyBindingType(binding.type);
151030
- const coloredName = source_default.cyan(padToVisibleWidth(name2, nameWidth));
151031
- const dimType = source_default.dim(padToVisibleWidth(friendlyType, typeWidth));
151032
- if (showSourceMarker) {
151033
- const marker = binding.fromConfig ? CONFIG_MARKER : " ";
151034
- return `${indent}${coloredName} ${dimType} ${padToVisibleWidth(
151035
- value,
151036
- valueWidth
151037
- )} ${marker}`;
151038
- }
151039
- return `${indent}${coloredName} ${dimType} ${padToVisibleWidth(
151040
- value,
151041
- valueWidth
151042
- )}`;
151043
- });
151044
- }
151045
- function formatPreviewsSettings(workerName, previewDefaults) {
151046
- const lines = [];
151047
- lines.push(`${source_default.bold.hex("#FFA500")("Worker:")} ${workerName}`);
151048
- lines.push("");
151049
- lines.push(` ${source_default.bold.underline("Previews settings")}`);
151050
- lines.push("");
151051
- const settingsRows = [];
151052
- if (previewDefaults.observability && typeof previewDefaults.observability === "object") {
151053
- const enabledLabel = previewDefaults.observability.enabled ? "enabled" : "disabled";
151054
- const sampling = typeof previewDefaults.observability.head_sampling_rate === "number" ? `, ${previewDefaults.observability.head_sampling_rate.toFixed(
151055
- 1
151056
- )} sampling` : "";
151057
- settingsRows.push(["observability", `${enabledLabel}${sampling}`]);
151058
- }
151059
- if (typeof previewDefaults.logpush === "boolean") {
151060
- settingsRows.push([
151061
- "logpush",
151062
- previewDefaults.logpush ? "enabled" : "disabled"
151063
- ]);
151064
- }
151065
- if (typeof previewDefaults.limits?.cpu_ms === "number" || typeof previewDefaults.limits?.subrequests === "number") {
151066
- const limitParts = [
151067
- typeof previewDefaults.limits?.cpu_ms === "number" ? `cpu_ms: ${previewDefaults.limits.cpu_ms}` : void 0,
151068
- typeof previewDefaults.limits?.subrequests === "number" ? `subrequests: ${previewDefaults.limits.subrequests}` : void 0
151069
- ].filter((value) => value !== void 0);
151070
- settingsRows.push(["limits", limitParts.join(", ")]);
151071
- }
151072
- if (typeof previewDefaults.placement?.mode === "string") {
151073
- settingsRows.push(["placement", previewDefaults.placement.mode]);
151074
- }
151075
- if (previewDefaults.cache !== void 0) {
151076
- settingsRows.push([
151077
- "cache",
151078
- previewDefaults.cache.enabled ? "enabled" : "disabled"
151079
- ]);
151080
- }
151081
- if (settingsRows.length > 0) {
151082
- const labelWidth = Math.max(...settingsRows.map(([label]) => label.length));
151083
- for (const [label, value] of settingsRows) {
151084
- lines.push(
151085
- ` ${source_default.cyan(padToVisibleWidth(label, labelWidth))} ${value}`
151086
- );
151087
- }
151088
- }
151089
- lines.push("");
151090
- lines.push(source_default.bold(" Bindings"));
151091
- const env7 = Object.fromEntries(
151092
- Object.entries(previewDefaults.env ?? {}).map(([name2, binding]) => [
151093
- name2,
151094
- { ...binding, fromConfig: false }
151095
- ])
151096
- );
151097
- lines.push(...formatBindings(env7));
151098
- lines.push("");
151099
- return drawBox(lines);
151100
- }
151101
150992
  function toBase64(content) {
151102
150993
  return Buffer.from(content).toString("base64");
151103
150994
  }
@@ -151259,216 +151150,28 @@ async function assemblePreviewDeploymentSettings(config22, buildResult, accountI
151259
151150
  }
151260
151151
  return request22;
151261
151152
  }
151262
- function buildMergedScriptLevel(config22, previewResource) {
151263
- const previews = config22.previews;
151264
- const result = {};
151265
- const configHasObservability = previews?.observability !== void 0 || config22.observability !== void 0;
151266
- const configHasLogpush = previews?.logpush !== void 0 || config22.logpush !== void 0;
151267
- if (previewResource.observability !== void 0) {
151268
- result.observability = {
151269
- enabled: previewResource.observability.enabled,
151270
- head_sampling_rate: previewResource.observability.head_sampling_rate,
151271
- fromConfig: configHasObservability
151272
- };
151273
- }
151274
- if (previewResource.logpush !== void 0) {
151275
- result.logpush = {
151276
- value: previewResource.logpush,
151277
- fromConfig: configHasLogpush
151278
- };
151279
- }
151280
- if (previewResource.tail_consumers && previewResource.tail_consumers.length > 0) {
151281
- result.tail_consumers = previewResource.tail_consumers;
151282
- }
151283
- return result;
151284
- }
151285
- function buildMergedVersionLevel(config22, deployment) {
151286
- const previews = config22.previews;
151287
- const configBindingNames = new Set(
151288
- Object.keys(extractConfigBindings(config22))
151289
- );
151290
- const result = { env: {} };
151291
- if (deployment.compatibility_date) {
151292
- result.compatibility_date = {
151293
- value: deployment.compatibility_date,
151294
- fromConfig: !!config22.compatibility_date
151295
- };
151296
- }
151297
- if (deployment.compatibility_flags && deployment.compatibility_flags.length > 0) {
151298
- result.compatibility_flags = {
151299
- value: deployment.compatibility_flags,
151300
- fromConfig: !!(config22.compatibility_flags && config22.compatibility_flags.length > 0)
151301
- };
151302
- }
151303
- if (deployment.limits?.cpu_ms !== void 0 || deployment.limits?.subrequests !== void 0) {
151304
- result.limits = {
151305
- value: {
151306
- ...deployment.limits?.cpu_ms !== void 0 && {
151307
- cpu_ms: deployment.limits.cpu_ms
151308
- },
151309
- ...deployment.limits?.subrequests !== void 0 && {
151310
- subrequests: deployment.limits.subrequests
151311
- }
151312
- },
151313
- fromConfig: !!(previews?.limits !== void 0 || config22.limits !== void 0)
151314
- };
151315
- }
151316
- if (deployment.placement?.mode) {
151317
- result.placement = {
151318
- value: { mode: deployment.placement.mode },
151319
- fromConfig: !!config22.placement?.mode
151320
- };
151321
- }
151322
- if (deployment.cache !== void 0) {
151323
- result.cache = {
151324
- value: deployment.cache,
151325
- fromConfig: previews?.cache !== void 0 || config22.cache !== void 0
151326
- };
151327
- }
151328
- if (config22.assets) {
151329
- result.assets = {
151330
- value: {
151331
- directory: config22.assets.directory,
151332
- binding: config22.assets.binding,
151333
- html_handling: config22.assets.html_handling,
151334
- not_found_handling: config22.assets.not_found_handling,
151335
- run_worker_first: config22.assets.run_worker_first
151336
- },
151337
- fromConfig: true
151338
- };
151153
+ function formatUrlLines(label, urls) {
151154
+ if (urls === void 0 || urls.length === 0) {
151155
+ return [];
151339
151156
  }
151340
- for (const [name2, binding] of Object.entries(deployment.env ?? {})) {
151341
- result.env[name2] = { ...binding, fromConfig: configBindingNames.has(name2) };
151157
+ const firstUrl = urls[0];
151158
+ if (urls.length === 1 && firstUrl !== void 0) {
151159
+ return [`${source_default.bold(`${label} URL:`)} ${source_default.underline(firstUrl)}`];
151342
151160
  }
151343
- return result;
151161
+ return [
151162
+ source_default.bold(`${label} URLs:`),
151163
+ ...urls.map((url32) => ` ${source_default.underline(url32)}`)
151164
+ ];
151344
151165
  }
151345
- function formatPreviewResource(previewResource, scriptLevel, isNew, configName) {
151166
+ function formatPreviewDeploymentSummary(previewResource, deployment, isNew) {
151346
151167
  const statusLabel = isNew ? source_default.green("(new)") : source_default.dim("(updated)");
151347
- const obsEnabled = scriptLevel.observability?.enabled ?? false;
151348
- const obsRate = scriptLevel.observability?.head_sampling_rate;
151349
- const formattedRate = obsRate !== void 0 ? obsRate.toFixed(1) : void 0;
151350
- const obsValue = obsEnabled ? `enabled${formattedRate !== void 0 ? `, ${formattedRate} sampling` : ""}` : "disabled";
151351
- const lines = [
151168
+ return [
151352
151169
  `${source_default.bold("Preview:")} ${previewResource.name} ${statusLabel}`,
151170
+ ...formatUrlLines("Preview", previewResource.urls),
151353
151171
  "",
151354
- ...(previewResource.urls ?? []).map(
151355
- (url32) => ` ${source_default.bold.underline(url32)}`
151356
- )
151357
- ];
151358
- const settingsRows = [];
151359
- if (scriptLevel.observability !== void 0) {
151360
- settingsRows.push([
151361
- "observability",
151362
- obsValue,
151363
- scriptLevel.observability.fromConfig
151364
- ]);
151365
- }
151366
- if (scriptLevel.logpush !== void 0) {
151367
- settingsRows.push([
151368
- "logpush",
151369
- scriptLevel.logpush.value ? "enabled" : "disabled",
151370
- scriptLevel.logpush.fromConfig
151371
- ]);
151372
- }
151373
- if (scriptLevel.tail_consumers && scriptLevel.tail_consumers.length > 0) {
151374
- settingsRows.push([
151375
- "tail_consumers",
151376
- scriptLevel.tail_consumers.map((tc) => tc.name).join(", "),
151377
- false
151378
- ]);
151379
- }
151380
- if (settingsRows.length > 0) {
151381
- lines.push("");
151382
- lines.push(...formatAlignedRows(settingsRows));
151383
- }
151384
- const hasConfigValues = settingsRows.some(([, , fromConfig]) => fromConfig);
151385
- const footerLines = hasConfigValues ? ["", source_default.hex("#FFA500")(`\u25C6 from ${configName}`)] : void 0;
151386
- return drawBox(lines, { footerLines, connectToChild: true });
151387
- }
151388
- function formatDeploymentResource(deployment, versionLevel, configName) {
151389
- const lines = [
151390
- `${source_default.bold("Deployment:")} ${deployment.id}`,
151391
- "",
151392
- ...(deployment.urls ?? []).map((url32) => ` ${source_default.bold.underline(url32)}`)
151393
- ];
151394
- const settingsRows = [];
151395
- if (versionLevel.compatibility_date) {
151396
- settingsRows.push([
151397
- "compatibility_date",
151398
- versionLevel.compatibility_date.value,
151399
- versionLevel.compatibility_date.fromConfig
151400
- ]);
151401
- }
151402
- if (versionLevel.compatibility_flags) {
151403
- settingsRows.push([
151404
- "compatibility_flags",
151405
- versionLevel.compatibility_flags.value.join(", "),
151406
- versionLevel.compatibility_flags.fromConfig
151407
- ]);
151408
- }
151409
- if (versionLevel.limits?.value?.cpu_ms !== void 0 || versionLevel.limits?.value?.subrequests !== void 0) {
151410
- const limitParts = [
151411
- versionLevel.limits?.value?.cpu_ms !== void 0 ? `cpu_ms: ${versionLevel.limits.value.cpu_ms}` : void 0,
151412
- versionLevel.limits?.value?.subrequests !== void 0 ? `subrequests: ${versionLevel.limits.value.subrequests}` : void 0
151413
- ].filter((value) => value !== void 0);
151414
- settingsRows.push([
151415
- "limits",
151416
- limitParts.join(", "),
151417
- versionLevel.limits.fromConfig
151418
- ]);
151419
- }
151420
- if (versionLevel.placement) {
151421
- settingsRows.push([
151422
- "placement",
151423
- versionLevel.placement.value.mode,
151424
- versionLevel.placement.fromConfig
151425
- ]);
151426
- }
151427
- if (versionLevel.cache !== void 0) {
151428
- settingsRows.push([
151429
- "cache",
151430
- versionLevel.cache.value?.enabled ? "enabled" : "disabled",
151431
- versionLevel.cache.fromConfig
151432
- ]);
151433
- }
151434
- if (settingsRows.length > 0) {
151435
- lines.push("");
151436
- lines.push(...formatAlignedRows(settingsRows));
151437
- }
151438
- if (versionLevel.assets) {
151439
- lines.push("");
151440
- lines.push(source_default.bold(" Assets"));
151441
- const assetsRows = [];
151442
- const assets = versionLevel.assets.value;
151443
- const fromConfig = versionLevel.assets.fromConfig;
151444
- if (assets.directory) {
151445
- assetsRows.push(["directory", assets.directory, fromConfig]);
151446
- }
151447
- if (assets.binding) {
151448
- assetsRows.push(["binding", assets.binding, fromConfig]);
151449
- }
151450
- if (assets.html_handling) {
151451
- assetsRows.push(["html_handling", assets.html_handling, fromConfig]);
151452
- }
151453
- if (assets.not_found_handling) {
151454
- assetsRows.push([
151455
- "not_found_handling",
151456
- assets.not_found_handling,
151457
- fromConfig
151458
- ]);
151459
- }
151460
- if (assets.run_worker_first !== void 0) {
151461
- const value = typeof assets.run_worker_first === "boolean" ? String(assets.run_worker_first) : assets.run_worker_first.join(", ");
151462
- assetsRows.push(["run_worker_first", value, fromConfig]);
151463
- }
151464
- lines.push(...formatAlignedRows(assetsRows, " "));
151465
- }
151466
- lines.push("");
151467
- lines.push(source_default.bold(" Bindings"));
151468
- lines.push(...formatBindings(versionLevel.env));
151469
- const hasConfigValues = settingsRows.some(([, , fromConfig]) => fromConfig) || versionLevel.assets?.fromConfig || Object.values(versionLevel.env).some((binding) => binding.fromConfig);
151470
- const footerLines = hasConfigValues ? ["", source_default.hex("#FFA500")(`\u25C6 from ${configName}`)] : void 0;
151471
- return drawConnectedChildBox(lines, { footerLines, indent: " " });
151172
+ `${source_default.bold("Deployment ID:")} ${deployment.id}`,
151173
+ ...formatUrlLines("Deployment", deployment.urls)
151174
+ ].join("\n");
151472
151175
  }
151473
151176
  function logMissingPreviewsBindingsWarning(topLevelBindings, remotePreviewDefaultBindings, localPreviewBindings) {
151474
151177
  const availableBindingNames = /* @__PURE__ */ new Set([
@@ -151571,18 +151274,9 @@ async function preview(accountId, args, config22, buildResult, assetsOptions) {
151571
151274
  JSON.stringify({ preview: previewResource, deployment }, null, 2)
151572
151275
  );
151573
151276
  } else {
151574
- const scriptLevel = buildMergedScriptLevel(config22, previewResource);
151575
- const versionLevel = buildMergedVersionLevel(config22, deployment);
151576
- const configName = configFileName(config22.configPath);
151577
151277
  logger.log(
151578
- formatPreviewResource(
151579
- previewResource,
151580
- scriptLevel,
151581
- isNewPreview,
151582
- configName
151583
- )
151278
+ formatPreviewDeploymentSummary(previewResource, deployment, isNewPreview)
151584
151279
  );
151585
- logger.log(formatDeploymentResource(deployment, versionLevel, configName));
151586
151280
  const topLevelBindings = getBindings(config22);
151587
151281
  if (Object.keys(topLevelBindings).length > 0) {
151588
151282
  const previewDefaults = await getWorkerPreviewDefaults(
@@ -151626,6 +151320,168 @@ This will delete all deployments associated with this Preview.`
151626
151320
  logger.log(`
151627
151321
  \u2728 Preview "${previewName}" deleted successfully.`);
151628
151322
  }
151323
+ function stripAnsi4(str) {
151324
+ return str.replace(/\x1b\[[0-9;]*m/g, "");
151325
+ }
151326
+ function visibleLength(str) {
151327
+ return stripAnsi4(str).length;
151328
+ }
151329
+ function padToVisibleWidth(str, width) {
151330
+ const visible = visibleLength(str);
151331
+ return str + " ".repeat(Math.max(0, width - visible));
151332
+ }
151333
+ function drawBox(contentLines, options = {}) {
151334
+ const lines = [...contentLines, ...options.footerLines ?? []];
151335
+ const maxContentWidth = Math.max(
151336
+ ...lines.map((line) => visibleLength(line)),
151337
+ 0
151338
+ );
151339
+ const boxWidth = maxContentWidth + 4;
151340
+ const horizontalLine = BOX.horizontal.repeat(boxWidth - 2);
151341
+ const topBorder = `${BOX.topLeft}${horizontalLine}${BOX.topRight}`;
151342
+ const bottomBorder = options.connectToChild ? `${BOX.bottomLeft}${BOX.horizontal}${BOX.bottomLeftWithConnector}${BOX.horizontal.repeat(boxWidth - 4)}${BOX.bottomRight}` : `${BOX.bottomLeft}${horizontalLine}${BOX.bottomRight}`;
151343
+ const paddedLines = lines.map((line) => {
151344
+ const paddedContent = padToVisibleWidth(line, maxContentWidth);
151345
+ return `${BOX.vertical} ${paddedContent} ${BOX.vertical}`;
151346
+ });
151347
+ return [topBorder, ...paddedLines, bottomBorder].join("\n");
151348
+ }
151349
+ function drawConnectedChildBox(contentLines, options = {}) {
151350
+ const indent = options.indent ?? " ";
151351
+ const lines = [...contentLines, ...options.footerLines ?? []];
151352
+ const maxContentWidth = lines.length > 0 ? Math.max(...lines.map((line) => visibleLength(line))) : 0;
151353
+ const boxWidth = maxContentWidth + 4;
151354
+ const horizontalLine = BOX.horizontal.repeat(boxWidth - 2);
151355
+ const topBorder = `${BOX.topLeft}${horizontalLine}${BOX.topRight}`;
151356
+ const bottomBorder = `${BOX.bottomLeft}${horizontalLine}${BOX.bottomRight}`;
151357
+ const paddedLines = lines.map((line) => {
151358
+ const paddedContent = padToVisibleWidth(line, maxContentWidth);
151359
+ return `${BOX.vertical} ${paddedContent} ${BOX.vertical}`;
151360
+ });
151361
+ const connectorIndex = options.connectorLineIndex ?? Math.floor(paddedLines.length / 2);
151362
+ const result = [];
151363
+ result.push(`${indent}${BOX.vertical}`);
151364
+ result.push(`${indent}${BOX.vertical} ${topBorder}`);
151365
+ paddedLines.forEach((line, index) => {
151366
+ if (index === connectorIndex) {
151367
+ result.push(
151368
+ `${indent}${BOX.bottomLeft}${BOX.horizontal}${BOX.connectorRight}${line.slice(1)}`
151369
+ );
151370
+ } else if (index < connectorIndex) {
151371
+ result.push(`${indent}${BOX.vertical} ${line}`);
151372
+ } else {
151373
+ result.push(`${indent} ${line}`);
151374
+ }
151375
+ });
151376
+ result.push(`${indent} ${bottomBorder}`);
151377
+ return result.join("\n");
151378
+ }
151379
+ function getFriendlyBindingType(bindingType) {
151380
+ return getBindingTypeFriendlyName(
151381
+ bindingType
151382
+ );
151383
+ }
151384
+ function formatAlignedRows(rows, indent = " ") {
151385
+ const labelWidth = Math.max(...rows.map(([label]) => label.length));
151386
+ const valueWidth = Math.max(...rows.map(([, value]) => value.length));
151387
+ return rows.map(([label, value, fromConfig]) => {
151388
+ const marker = fromConfig ? CONFIG_MARKER : " ";
151389
+ const coloredLabel = source_default.cyan(padToVisibleWidth(label, labelWidth));
151390
+ return `${indent}${coloredLabel} ${padToVisibleWidth(
151391
+ value,
151392
+ valueWidth
151393
+ )} ${marker}`;
151394
+ });
151395
+ }
151396
+ function formatBindings(env7, indent = " ", options = {}) {
151397
+ const showSourceMarker = options.showSourceMarker ?? true;
151398
+ const entries2 = Object.entries(env7);
151399
+ if (entries2.length === 0) {
151400
+ return [`${indent}${source_default.dim("(none)")}`];
151401
+ }
151402
+ const nameWidth = Math.max(...entries2.map(([name2]) => name2.length));
151403
+ const typeWidth = Math.max(
151404
+ ...entries2.map(
151405
+ ([, binding]) => visibleLength(getFriendlyBindingType(binding.type))
151406
+ )
151407
+ );
151408
+ const valueWidth = Math.max(
151409
+ ...entries2.map(([, binding]) => getBindingValue(binding).length)
151410
+ );
151411
+ return entries2.map(([name2, binding]) => {
151412
+ const value = getBindingValue(binding);
151413
+ const friendlyType = getFriendlyBindingType(binding.type);
151414
+ const coloredName = source_default.cyan(padToVisibleWidth(name2, nameWidth));
151415
+ const dimType = source_default.dim(padToVisibleWidth(friendlyType, typeWidth));
151416
+ if (showSourceMarker) {
151417
+ const marker = binding.fromConfig ? CONFIG_MARKER : " ";
151418
+ return `${indent}${coloredName} ${dimType} ${padToVisibleWidth(
151419
+ value,
151420
+ valueWidth
151421
+ )} ${marker}`;
151422
+ }
151423
+ return `${indent}${coloredName} ${dimType} ${padToVisibleWidth(
151424
+ value,
151425
+ valueWidth
151426
+ )}`;
151427
+ });
151428
+ }
151429
+ function formatPreviewsSettings(workerName, previewDefaults) {
151430
+ const lines = [];
151431
+ lines.push(`${source_default.bold.hex("#FFA500")("Worker:")} ${workerName}`);
151432
+ lines.push("");
151433
+ lines.push(` ${source_default.bold.underline("Previews settings")}`);
151434
+ lines.push("");
151435
+ const settingsRows = [];
151436
+ if (previewDefaults.observability && typeof previewDefaults.observability === "object") {
151437
+ const enabledLabel = previewDefaults.observability.enabled ? "enabled" : "disabled";
151438
+ const sampling = typeof previewDefaults.observability.head_sampling_rate === "number" ? `, ${previewDefaults.observability.head_sampling_rate.toFixed(
151439
+ 1
151440
+ )} sampling` : "";
151441
+ settingsRows.push(["observability", `${enabledLabel}${sampling}`]);
151442
+ }
151443
+ if (typeof previewDefaults.logpush === "boolean") {
151444
+ settingsRows.push([
151445
+ "logpush",
151446
+ previewDefaults.logpush ? "enabled" : "disabled"
151447
+ ]);
151448
+ }
151449
+ if (typeof previewDefaults.limits?.cpu_ms === "number" || typeof previewDefaults.limits?.subrequests === "number") {
151450
+ const limitParts = [
151451
+ typeof previewDefaults.limits?.cpu_ms === "number" ? `cpu_ms: ${previewDefaults.limits.cpu_ms}` : void 0,
151452
+ typeof previewDefaults.limits?.subrequests === "number" ? `subrequests: ${previewDefaults.limits.subrequests}` : void 0
151453
+ ].filter((value) => value !== void 0);
151454
+ settingsRows.push(["limits", limitParts.join(", ")]);
151455
+ }
151456
+ if (typeof previewDefaults.placement?.mode === "string") {
151457
+ settingsRows.push(["placement", previewDefaults.placement.mode]);
151458
+ }
151459
+ if (previewDefaults.cache !== void 0) {
151460
+ settingsRows.push([
151461
+ "cache",
151462
+ previewDefaults.cache.enabled ? "enabled" : "disabled"
151463
+ ]);
151464
+ }
151465
+ if (settingsRows.length > 0) {
151466
+ const labelWidth = Math.max(...settingsRows.map(([label]) => label.length));
151467
+ for (const [label, value] of settingsRows) {
151468
+ lines.push(
151469
+ ` ${source_default.cyan(padToVisibleWidth(label, labelWidth))} ${value}`
151470
+ );
151471
+ }
151472
+ }
151473
+ lines.push("");
151474
+ lines.push(source_default.bold(" Bindings"));
151475
+ const env7 = Object.fromEntries(
151476
+ Object.entries(previewDefaults.env ?? {}).map(([name2, binding]) => [
151477
+ name2,
151478
+ { ...binding, fromConfig: false }
151479
+ ])
151480
+ );
151481
+ lines.push(...formatBindings(env7));
151482
+ lines.push("");
151483
+ return drawBox(lines);
151484
+ }
151629
151485
  function mergeDeep2(target, source) {
151630
151486
  if (typeof target !== "object" || target === null) {
151631
151487
  return source;
@@ -168883,10 +168739,16 @@ ${mountedAssetRoutes.map((route) => {
168883
168739
  __name3(getPreviewDeployment, "getPreviewDeployment");
168884
168740
  __name(createPreviewDeployment, "createPreviewDeployment");
168885
168741
  __name3(createPreviewDeployment, "createPreviewDeployment");
168742
+ __name(patchPreviewDeployment, "patchPreviewDeployment");
168743
+ __name3(patchPreviewDeployment, "patchPreviewDeployment");
168886
168744
  __name(getWorkerPreviewDefaults, "getWorkerPreviewDefaults");
168887
168745
  __name3(getWorkerPreviewDefaults, "getWorkerPreviewDefaults");
168888
168746
  __name(editWorkerPreviewDefaults, "editWorkerPreviewDefaults");
168889
168747
  __name3(editWorkerPreviewDefaults, "editWorkerPreviewDefaults");
168748
+ __name(getPreviewBaseConfig, "getPreviewBaseConfig");
168749
+ __name3(getPreviewBaseConfig, "getPreviewBaseConfig");
168750
+ __name(patchPreviewBaseConfig, "patchPreviewBaseConfig");
168751
+ __name3(patchPreviewBaseConfig, "patchPreviewBaseConfig");
168890
168752
  __name(getBranchName2, "getBranchName2");
168891
168753
  __name3(getBranchName2, "getBranchName");
168892
168754
  __name(shouldUseCIMetadataFallback, "shouldUseCIMetadataFallback");
@@ -168905,6 +168767,24 @@ ${mountedAssetRoutes.map((route) => {
168905
168767
  __name3(assemblePreviewScriptSettings, "assemblePreviewScriptSettings");
168906
168768
  __name(assemblePreviewDefaults, "assemblePreviewDefaults");
168907
168769
  __name3(assemblePreviewDefaults, "assemblePreviewDefaults");
168770
+ __name(toBase64, "toBase64");
168771
+ __name3(toBase64, "toBase64");
168772
+ __name(getPreviewMigrationsToUpload, "getPreviewMigrationsToUpload");
168773
+ __name3(getPreviewMigrationsToUpload, "getPreviewMigrationsToUpload");
168774
+ __name(buildResultToDeploymentModules, "buildResultToDeploymentModules");
168775
+ __name3(buildResultToDeploymentModules, "buildResultToDeploymentModules");
168776
+ __name(assemblePreviewDeploymentSettings, "assemblePreviewDeploymentSettings");
168777
+ __name3(assemblePreviewDeploymentSettings, "assemblePreviewDeploymentSettings");
168778
+ __name(formatUrlLines, "formatUrlLines");
168779
+ __name3(formatUrlLines, "formatUrlLines");
168780
+ __name(formatPreviewDeploymentSummary, "formatPreviewDeploymentSummary");
168781
+ __name3(formatPreviewDeploymentSummary, "formatPreviewDeploymentSummary");
168782
+ __name(logMissingPreviewsBindingsWarning, "logMissingPreviewsBindingsWarning");
168783
+ __name3(logMissingPreviewsBindingsWarning, "logMissingPreviewsBindingsWarning");
168784
+ __name(preview, "preview");
168785
+ __name3(preview, "preview");
168786
+ __name(previewDelete, "previewDelete");
168787
+ __name3(previewDelete, "previewDelete");
168908
168788
  BOX = {
168909
168789
  topLeft: "\u256D",
168910
168790
  topRight: "\u256E",
@@ -168934,28 +168814,6 @@ ${mountedAssetRoutes.map((route) => {
168934
168814
  __name3(formatBindings, "formatBindings");
168935
168815
  __name(formatPreviewsSettings, "formatPreviewsSettings");
168936
168816
  __name3(formatPreviewsSettings, "formatPreviewsSettings");
168937
- __name(toBase64, "toBase64");
168938
- __name3(toBase64, "toBase64");
168939
- __name(getPreviewMigrationsToUpload, "getPreviewMigrationsToUpload");
168940
- __name3(getPreviewMigrationsToUpload, "getPreviewMigrationsToUpload");
168941
- __name(buildResultToDeploymentModules, "buildResultToDeploymentModules");
168942
- __name3(buildResultToDeploymentModules, "buildResultToDeploymentModules");
168943
- __name(assemblePreviewDeploymentSettings, "assemblePreviewDeploymentSettings");
168944
- __name3(assemblePreviewDeploymentSettings, "assemblePreviewDeploymentSettings");
168945
- __name(buildMergedScriptLevel, "buildMergedScriptLevel");
168946
- __name3(buildMergedScriptLevel, "buildMergedScriptLevel");
168947
- __name(buildMergedVersionLevel, "buildMergedVersionLevel");
168948
- __name3(buildMergedVersionLevel, "buildMergedVersionLevel");
168949
- __name(formatPreviewResource, "formatPreviewResource");
168950
- __name3(formatPreviewResource, "formatPreviewResource");
168951
- __name(formatDeploymentResource, "formatDeploymentResource");
168952
- __name3(formatDeploymentResource, "formatDeploymentResource");
168953
- __name(logMissingPreviewsBindingsWarning, "logMissingPreviewsBindingsWarning");
168954
- __name3(logMissingPreviewsBindingsWarning, "logMissingPreviewsBindingsWarning");
168955
- __name(preview, "preview");
168956
- __name3(preview, "preview");
168957
- __name(previewDelete, "previewDelete");
168958
- __name3(previewDelete, "previewDelete");
168959
168817
  __name(mergeDeep2, "mergeDeep");
168960
168818
  __name3(mergeDeep2, "mergeDeep");
168961
168819
  __name(isObject22, "isObject2");
@@ -178526,7 +178384,7 @@ function workflowEntry({
178526
178384
  script_name: scriptName,
178527
178385
  remote,
178528
178386
  limits
178529
- }, remoteProxyConnectionString, compatibilityFlags) {
178387
+ }, remoteProxyConnectionString) {
178530
178388
  const stepLimit = limits?.steps;
178531
178389
  if (!remoteProxyConnectionString || !remote) {
178532
178390
  return [
@@ -178535,8 +178393,7 @@ function workflowEntry({
178535
178393
  name: name2,
178536
178394
  className,
178537
178395
  scriptName,
178538
- ...stepLimit !== void 0 && { stepLimit },
178539
- compatibilityFlags
178396
+ ...stepLimit !== void 0 && { stepLimit }
178540
178397
  }
178541
178398
  ];
178542
178399
  }
@@ -178547,8 +178404,7 @@ function workflowEntry({
178547
178404
  className,
178548
178405
  scriptName,
178549
178406
  remoteProxyConnectionString,
178550
- ...stepLimit !== void 0 && { stepLimit },
178551
- compatibilityFlags
178407
+ ...stepLimit !== void 0 && { stepLimit }
178552
178408
  }
178553
178409
  ];
178554
178410
  }
@@ -178899,11 +178755,7 @@ function buildMiniflareBindingOptions(config5, remoteProxyConnectionString) {
178899
178755
  );
178900
178756
  }
178901
178757
  }
178902
- return workflowEntry(
178903
- workflow,
178904
- remoteProxyConnectionString,
178905
- config5.compatibilityFlags
178906
- );
178758
+ return workflowEntry(workflow, remoteProxyConnectionString);
178907
178759
  })
178908
178760
  ),
178909
178761
  secretsStoreSecrets: Object.fromEntries(
@@ -179054,6 +178906,7 @@ function buildAssetOptions(config5) {
179054
178906
  assets: {
179055
178907
  directory: config5.assets.directory,
179056
178908
  binding: config5.assets.binding,
178909
+ run_worker_first: config5.assets.run_worker_first,
179057
178910
  routerConfig: config5.assets.routerConfig,
179058
178911
  assetConfig: config5.assets.assetConfig
179059
178912
  }
@@ -179089,6 +178942,7 @@ async function buildMiniflareOptions(log2, config5, proxyToUserWorkerAuthenticat
179089
178942
  const resourceTmpPath = getDefaultProjectTmpPath(config5.projectRoot);
179090
178943
  const assetOptions = buildAssetOptions(config5);
179091
178944
  const options = {
178945
+ rootPath: config5.projectRoot,
179092
178946
  host: config5.initialIp,
179093
178947
  port: config5.initialPort,
179094
178948
  publicUrl: config5.publicUrl,
@@ -183982,7 +183836,7 @@ var init_dist12 = __esm({
183982
183836
  init_wrapper();
183983
183837
  init_create_worker_upload_form();
183984
183838
  import_undici8 = __toESM(require_undici(), 1);
183985
- version4 = "0.0.8";
183839
+ version4 = "0.0.10";
183986
183840
  NoDefaultValueProvided2 = class extends UserError {
183987
183841
  static {
183988
183842
  __name(this, "NoDefaultValueProvided");
@@ -184019,7 +183873,7 @@ var init_dist12 = __esm({
184019
183873
  createProxyWorker() {
184020
183874
  if (this._torndown || this.proxyWorker) return;
184021
183875
  assert32__default.default(this.latestConfig !== void 0);
184022
- const proxyWorker = new miniflare.Miniflare({
183876
+ const proxyWorker = new miniflare.Miniflare(miniflare.convertV4MiniflareOptions({
184023
183877
  host: this.latestConfig.server.hostname,
184024
183878
  port: this.latestConfig.server.port,
184025
183879
  https: this.latestConfig.server.secure,
@@ -184051,7 +183905,7 @@ var init_dist12 = __esm({
184051
183905
  verbose: logger3.loggerLevel === "debug",
184052
183906
  log: new ProxyControllerLogger(castLogLevel2(logger3.loggerLevel), { prefix: logger3.loggerLevel === "debug" ? "remote-bindings-ProxyWorker" : "remote-bindings" }, this.localServerReady.promise),
184053
183907
  handleStructuredLogs: handleStructuredLogs2
184054
- });
183908
+ }));
184055
183909
  this.proxyWorker = proxyWorker;
184056
183910
  proxyWorker.ready.then((url7) => {
184057
183911
  assert32__default.default(url7);
@@ -200109,6 +199963,21 @@ var init_zod = __esm({
200109
199963
  function isParsedUnsafeBinding(binding) {
200110
199964
  return binding.type.startsWith("unsafe:");
200111
199965
  }
199966
+ function validateSingletonBindings(env7, ctx) {
199967
+ const seen = /* @__PURE__ */ new Set();
199968
+ const duplicates = /* @__PURE__ */ new Set();
199969
+ for (const binding of Object.values(env7)) {
199970
+ const type = binding.type;
199971
+ if (SINGLETON_BINDING_TYPES.has(type)) {
199972
+ if (seen.has(type)) duplicates.add(type);
199973
+ seen.add(type);
199974
+ }
199975
+ }
199976
+ if (duplicates.size > 0) ctx.addIssue({
199977
+ code: "custom",
199978
+ message: `${listFormatter.format([...duplicates].sort())} bindings can only be defined once`
199979
+ });
199980
+ }
200112
199981
  function generateTypes({ configPath, packageName = "@cloudflare/config" }) {
200113
199982
  return import_dist.dedent`
200114
199983
  /* eslint-disable */
@@ -202739,7 +202608,7 @@ async function loadAndValidateConfig(configPath, ctx, options) {
202739
202608
  dependencies
202740
202609
  };
202741
202610
  }
202742
- var __getOwnPropNames4, __commonJS4, AssetsSchema, KnownBindingSchema, UnsafeBindingSchema, BindingSchema, CacheSchema, SINGLETON_BINDING_TYPES, listFormatter, EnvSchema, ExportSchema, LimitsSchema, ObservabilitySchema, PlacementSchema, TailConsumerSchema, TriggerSchema, UnsafeSchema, BaseWorkerSchema, InputWorkerSchema, SettingsSchema, ConfigExportSchema, SETTINGS_EXPORT_NAME, ConfigExportsSchema, ModuleTypeSchema, ManifestSchema, require_dist2, import_dist, __defProp5, __name5, UserError2, FatalError2, JsonFriendlyFatalError2, CharacterCodes2, ParseOptions2, ScanError2, SyntaxKind2, parse24, ParseErrorCode2, TomlError3, DATE_TIME_RE3, TomlDate3, INT_REGEX3, FLOAT_REGEX3, LEADING_ZERO3, ESCAPE_REGEX3, ESC_MAP3, KEY_PART_RE3, BARE_KEY3, dist_default5, ParseError2, units2, UNSUPPORTED_BOMS2, PATH_TO_DEPLOY_CONFIG2, esm_default6, CF_WORKER_SCHEME, CF_WORKER_TYPE, CF_ATTR, CF_NO_CACHE_VALUE, CF_NO_CACHE_QUERY_KEY, RE_NODE_MODULES, depsStore, deregister;
202611
+ var __getOwnPropNames4, __commonJS4, AssetsSchema, BrowserBindingSchema, WorkerBindingSchema, D1BindingSchema, KVBindingSchema, QueueBindingSchema, R2BindingSchema, FlagshipBindingSchema, HyperdriveBindingSchema, KnownBindingSchema, UnsafeBindingSchema, BindingSchema, CacheSchema, SINGLETON_BINDING_TYPES, listFormatter, EnvSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, DurableObjectExpectingTransferExportSchema, WorkerEntrypointExportSchema, ExportSchema, LimitsSchema, ObservabilitySchema, PlacementSchema, TailConsumerSchema, TriggerSchema, UnsafeSchema, BaseWorkerSchema, InputWorkerSchema, SettingsSchema, ConfigExportSchema, SETTINGS_EXPORT_NAME, ConfigExportsSchema, ModuleTypeSchema, ManifestSchema, require_dist2, import_dist, __defProp5, __name5, UserError2, FatalError2, JsonFriendlyFatalError2, CharacterCodes2, ParseOptions2, ScanError2, SyntaxKind2, parse24, ParseErrorCode2, TomlError3, DATE_TIME_RE3, TomlDate3, INT_REGEX3, FLOAT_REGEX3, LEADING_ZERO3, ESCAPE_REGEX3, ESC_MAP3, KEY_PART_RE3, BARE_KEY3, dist_default5, ParseError2, units2, UNSUPPORTED_BOMS2, PATH_TO_DEPLOY_CONFIG2, esm_default6, CF_WORKER_SCHEME, CF_WORKER_TYPE, CF_ATTR, CF_NO_CACHE_VALUE, CF_NO_CACHE_QUERY_KEY, RE_NODE_MODULES, depsStore, deregister;
202743
202612
  var init_dist13 = __esm({
202744
202613
  "../config/dist/index.mjs"() {
202745
202614
  init_import_meta_url();
@@ -202763,6 +202632,50 @@ var init_dist13 = __esm({
202763
202632
  ]).optional(),
202764
202633
  runWorkerFirst: union3([array3(string6()), boolean6()]).optional()
202765
202634
  });
202635
+ BrowserBindingSchema = strictObject3({
202636
+ type: literal3("browser"),
202637
+ remote: boolean6().optional()
202638
+ });
202639
+ WorkerBindingSchema = strictObject3({
202640
+ type: literal3("worker"),
202641
+ workerName: string6(),
202642
+ exportName: string6().optional(),
202643
+ props: record3(string6(), unknown3()).optional(),
202644
+ remote: boolean6().optional()
202645
+ });
202646
+ D1BindingSchema = strictObject3({
202647
+ type: literal3("d1"),
202648
+ name: string6().optional(),
202649
+ id: string6().optional(),
202650
+ remote: boolean6().optional()
202651
+ });
202652
+ KVBindingSchema = strictObject3({
202653
+ type: literal3("kv"),
202654
+ id: string6().optional(),
202655
+ remote: boolean6().optional()
202656
+ });
202657
+ QueueBindingSchema = strictObject3({
202658
+ type: literal3("queue"),
202659
+ name: string6().optional(),
202660
+ deliveryDelay: number6().optional(),
202661
+ remote: boolean6().optional()
202662
+ });
202663
+ R2BindingSchema = strictObject3({
202664
+ type: literal3("r2"),
202665
+ name: string6().optional(),
202666
+ jurisdiction: string6().optional(),
202667
+ remote: boolean6().optional()
202668
+ });
202669
+ FlagshipBindingSchema = strictObject3({
202670
+ type: literal3("flagship"),
202671
+ id: string6().optional(),
202672
+ remote: boolean6().optional()
202673
+ });
202674
+ HyperdriveBindingSchema = strictObject3({
202675
+ type: literal3("hyperdrive"),
202676
+ id: string6(),
202677
+ localConnectionString: string6().optional()
202678
+ });
202766
202679
  KnownBindingSchema = discriminatedUnion3("type", [
202767
202680
  strictObject3({
202768
202681
  type: literal3("agent-memory"),
@@ -202793,16 +202706,8 @@ var init_dist13 = __esm({
202793
202706
  remote: boolean6().optional()
202794
202707
  }),
202795
202708
  strictObject3({ type: literal3("assets") }),
202796
- strictObject3({
202797
- type: literal3("browser"),
202798
- remote: boolean6().optional()
202799
- }),
202800
- strictObject3({
202801
- type: literal3("d1"),
202802
- name: string6().optional(),
202803
- id: string6().optional(),
202804
- remote: boolean6().optional()
202805
- }),
202709
+ BrowserBindingSchema,
202710
+ D1BindingSchema,
202806
202711
  strictObject3({
202807
202712
  type: literal3("dispatch-namespace"),
202808
202713
  namespace: string6().optional(),
@@ -202817,16 +202722,8 @@ var init_dist13 = __esm({
202817
202722
  workerName: string6(),
202818
202723
  exportName: string6()
202819
202724
  }),
202820
- strictObject3({
202821
- type: literal3("flagship"),
202822
- id: string6().optional(),
202823
- remote: boolean6().optional()
202824
- }),
202825
- strictObject3({
202826
- type: literal3("hyperdrive"),
202827
- id: string6(),
202828
- localConnectionString: string6().optional()
202829
- }),
202725
+ FlagshipBindingSchema,
202726
+ HyperdriveBindingSchema,
202830
202727
  strictObject3({
202831
202728
  type: literal3("images"),
202832
202729
  remote: boolean6().optional()
@@ -202835,11 +202732,7 @@ var init_dist13 = __esm({
202835
202732
  type: literal3("json"),
202836
202733
  value: json3()
202837
202734
  }),
202838
- strictObject3({
202839
- type: literal3("kv"),
202840
- id: string6().optional(),
202841
- remote: boolean6().optional()
202842
- }),
202735
+ KVBindingSchema,
202843
202736
  strictObject3({
202844
202737
  type: literal3("logfwdr"),
202845
202738
  destination: string6()
@@ -202858,12 +202751,7 @@ var init_dist13 = __esm({
202858
202751
  name: string6(),
202859
202752
  remote: boolean6().optional()
202860
202753
  }),
202861
- strictObject3({
202862
- type: literal3("queue"),
202863
- name: string6().optional(),
202864
- deliveryDelay: number6().optional(),
202865
- remote: boolean6().optional()
202866
- }),
202754
+ QueueBindingSchema,
202867
202755
  strictObject3({
202868
202756
  type: literal3("rate-limit"),
202869
202757
  namespace: string6(),
@@ -202872,12 +202760,7 @@ var init_dist13 = __esm({
202872
202760
  period: union3([literal3(10), literal3(60)])
202873
202761
  })
202874
202762
  }),
202875
- strictObject3({
202876
- type: literal3("r2"),
202877
- name: string6().optional(),
202878
- jurisdiction: string6().optional(),
202879
- remote: boolean6().optional()
202880
- }),
202763
+ R2BindingSchema,
202881
202764
  strictObject3({ type: literal3("secret") }),
202882
202765
  strictObject3({
202883
202766
  type: literal3("secrets-store-secret"),
@@ -202926,13 +202809,7 @@ var init_dist13 = __esm({
202926
202809
  type: literal3("web-search"),
202927
202810
  remote: boolean6().optional()
202928
202811
  }),
202929
- strictObject3({
202930
- type: literal3("worker"),
202931
- workerName: string6(),
202932
- exportName: string6().optional(),
202933
- props: record3(string6(), unknown3()).optional(),
202934
- remote: boolean6().optional()
202935
- }),
202812
+ WorkerBindingSchema,
202936
202813
  strictObject3({ type: literal3("worker-loader") })
202937
202814
  ]);
202938
202815
  UnsafeBindingSchema = looseObject3({
@@ -202969,51 +202846,44 @@ var init_dist13 = __esm({
202969
202846
  "web-search"
202970
202847
  ]);
202971
202848
  listFormatter = new Intl.ListFormat("en-US");
202972
- EnvSchema = record3(string6(), BindingSchema).superRefine((env7, ctx) => {
202973
- const seen = /* @__PURE__ */ new Set();
202974
- const duplicates = /* @__PURE__ */ new Set();
202975
- for (const binding of Object.values(env7)) {
202976
- const type = binding.type;
202977
- if (SINGLETON_BINDING_TYPES.has(type)) {
202978
- if (seen.has(type)) duplicates.add(type);
202979
- seen.add(type);
202980
- }
202981
- }
202982
- if (duplicates.size > 0) ctx.addIssue({
202983
- code: "custom",
202984
- message: `${listFormatter.format([...duplicates].sort())} bindings can only be defined once`
202985
- });
202986
- }).optional();
202849
+ __name(validateSingletonBindings, "validateSingletonBindings");
202850
+ EnvSchema = record3(string6(), BindingSchema).superRefine(validateSingletonBindings).optional();
202851
+ DurableObjectCreatedExportSchema = strictObject3({
202852
+ type: literal3("durable-object"),
202853
+ state: literal3("created").optional(),
202854
+ storage: _enum5(["sqlite", "legacy-kv"])
202855
+ });
202856
+ DurableObjectDeletedExportSchema = strictObject3({
202857
+ type: literal3("durable-object"),
202858
+ state: literal3("deleted")
202859
+ });
202860
+ DurableObjectRenamedExportSchema = strictObject3({
202861
+ type: literal3("durable-object"),
202862
+ state: literal3("renamed"),
202863
+ renamedTo: string6()
202864
+ });
202865
+ DurableObjectTransferredExportSchema = strictObject3({
202866
+ type: literal3("durable-object"),
202867
+ state: literal3("transferred"),
202868
+ transferredTo: string6()
202869
+ });
202870
+ DurableObjectExpectingTransferExportSchema = strictObject3({
202871
+ type: literal3("durable-object"),
202872
+ state: literal3("expecting-transfer"),
202873
+ storage: _enum5(["sqlite", "legacy-kv"]),
202874
+ transferFrom: string6()
202875
+ });
202876
+ WorkerEntrypointExportSchema = strictObject3({
202877
+ type: literal3("worker"),
202878
+ cache: strictObject3({ enabled: boolean6() }).optional()
202879
+ });
202987
202880
  ExportSchema = union3([
202988
- strictObject3({
202989
- type: literal3("durable-object"),
202990
- state: literal3("created").optional(),
202991
- storage: _enum5(["sqlite", "legacy-kv"])
202992
- }),
202993
- strictObject3({
202994
- type: literal3("durable-object"),
202995
- state: literal3("deleted")
202996
- }),
202997
- strictObject3({
202998
- type: literal3("durable-object"),
202999
- state: literal3("renamed"),
203000
- renamedTo: string6()
203001
- }),
203002
- strictObject3({
203003
- type: literal3("durable-object"),
203004
- state: literal3("transferred"),
203005
- transferredTo: string6()
203006
- }),
203007
- strictObject3({
203008
- type: literal3("durable-object"),
203009
- state: literal3("expecting-transfer"),
203010
- storage: _enum5(["sqlite", "legacy-kv"]),
203011
- transferFrom: string6()
203012
- }),
203013
- strictObject3({
203014
- type: literal3("worker"),
203015
- cache: strictObject3({ enabled: boolean6() }).optional()
203016
- })
202881
+ DurableObjectCreatedExportSchema,
202882
+ DurableObjectDeletedExportSchema,
202883
+ DurableObjectRenamedExportSchema,
202884
+ DurableObjectTransferredExportSchema,
202885
+ DurableObjectExpectingTransferExportSchema,
202886
+ WorkerEntrypointExportSchema
203017
202887
  ]);
203018
202888
  LimitsSchema = strictObject3({
203019
202889
  cpuMs: number6().optional(),
@@ -210227,6 +210097,14 @@ function getProcessEnv2(variableName, choices) {
210227
210097
  function assertOneOf2(choices, value) {
210228
210098
  if (Array.isArray(choices) && !choices.includes(value)) throw new UserError3(`Expected ${JSON.stringify(value)} to be one of ${JSON.stringify(choices)}`, { telemetryMessage: false });
210229
210099
  }
210100
+ function isDoNotTrackEnabled2() {
210101
+ const value = getDoNotTrackFromEnv2()?.toLowerCase();
210102
+ return value === "1" || value === "true";
210103
+ }
210104
+ function getWranglerSendMetricsFromEnv2() {
210105
+ if (isDoNotTrackEnabled2()) return false;
210106
+ return getWranglerSendMetricsVariableFromEnv2();
210107
+ }
210230
210108
  function getComplianceRegionSubdomain2(complianceConfig) {
210231
210109
  return getCloudflareComplianceRegion2(complianceConfig) === "fedramp_high" ? ".fed" : "";
210232
210110
  }
@@ -212752,7 +212630,7 @@ and that at least one include rule is provided.
212752
212630
  `;
212753
212631
  }
212754
212632
  }
212755
- var UserError3, FatalError3, JsonFriendlyFatalError3, CharacterCodes3, ParseOptions3, ScanError3, SyntaxKind3, parse2$1, ParseErrorCode3, TomlError4, DATE_TIME_RE4, TomlDate4, INT_REGEX4, FLOAT_REGEX4, LEADING_ZERO4, ESCAPE_REGEX4, ESC_MAP4, KEY_PART_RE4, BARE_KEY4, dist_default6, ParseError3, APIError4, units3, UNSUPPORTED_BOMS3, PATH_TO_DEPLOY_CONFIG3, esm_default7, require_symbols2, require_timers2, require_errors2, require_constants$4, require_tree2, require_util$5, require_stats2, require_diagnostics2, require_request$1, require_wrap_handler2, require_dispatcher2, require_unwrap_handler2, require_dispatcher_base2, require_connect2, require_utils$1, require_constants$3, require_llhttp_wasm2, require_llhttp_simd_wasm2, require_constants$2, require_global$1, require_encoding3, require_infra2, require_data_url2, require_runtime_features2, require_webidl2, require_util$4, require_formdata2, require_formdata_parser2, require_promise2, require_body2, require_client_h12, require_client_h22, require_client2, require_fixed_queue2, require_pool_base2, require_pool2, require_balanced_pool2, require_round_robin_pool2, require_agent3, require_socks5_utils2, require_socks5_client2, require_socks5_proxy_agent2, require_proxy_agent2, require_env_http_proxy_agent2, require_retry_handler2, require_retry_agent2, require_h2c_client2, require_readable2, require_api_request2, require_abort_signal2, require_api_stream2, require_api_pipeline2, require_api_upgrade2, require_api_connect2, require_api2, require_mock_errors2, require_mock_symbols2, require_mock_utils2, require_mock_interceptor2, require_mock_client2, require_mock_call_history2, require_mock_pool2, require_pending_interceptors_formatter2, require_mock_agent2, require_snapshot_utils2, require_snapshot_recorder2, require_snapshot_agent2, require_global3, require_decorator_handler2, require_redirect_handler2, require_redirect2, require_response_error2, require_retry2, require_dump2, require_dns2, require_cache$2, require_date4, require_cache_handler2, require_memory_cache_store2, require_cache_revalidation_handler2, require_cache$1, require_decompress2, require_deduplication_handler2, require_deduplicate2, require_sqlite_cache_store2, require_headers2, require_response2, require_request3, require_subresource_integrity2, require_fetch2, require_util$3, require_cache4, require_cachestorage2, require_constants$1, require_util$2, require_parse3, require_cookies2, require_events2, require_constants8, require_util$1, require_frame2, require_connection2, require_permessage_deflate3, require_receiver3, require_sender3, require_websocket3, require_websocketerror2, require_websocketstream2, require_util10, require_eventsource_stream2, require_eventsource2, require_undici2, import_undici9, require_vendors3, require_ci_info3, require_command_exists5, require_command_exists22, require_ini2, require_strip_json_comments2, require_utils5, require_deep_extend2, require_minimist2, require_rc2, require_registry_url2, require_safe_buffer2, require_base642, require_registry_auth_token2, require_update_check2, ARTIFACTS_EVENT_TYPES2, defaultWranglerConfig2, external_exports4, core_exports23, _a8, NEVER4, $brand4, $ZodAsyncError4, $ZodEncodeError4, globalConfig4, util_exports5, EVALUATING4, captureStackTrace4, allowsEval4, getParsedType4, propertyKeyTypes4, primitiveTypes4, NUMBER_FORMAT_RANGES4, BIGINT_FORMAT_RANGES4, Class5, initializer6, $ZodError4, $ZodRealError4, _parse4, parse11, _parseAsync4, parseAsync6, _safeParse4, safeParse6, _safeParseAsync4, safeParseAsync6, _encode4, encode7, _decode4, decode6, _encodeAsync4, encodeAsync6, _decodeAsync4, decodeAsync6, _safeEncode4, safeEncode6, _safeDecode4, safeDecode6, _safeEncodeAsync4, safeEncodeAsync6, _safeDecodeAsync4, safeDecodeAsync6, regexes_exports4, cuid7, cuid26, ulid6, xid6, ksuid6, nanoid6, duration6, extendedDuration4, guid6, uuid9, uuid45, uuid64, uuid74, email6, html5Email4, rfc5322Email4, unicodeEmail4, idnEmail4, browserEmail4, _emoji6, ipv46, ipv66, mac6, cidrv46, cidrv66, base647, base64url6, hostname6, domain4, httpProtocol4, e1646, dateSource4, date10, string8, bigint8, integer4, number8, boolean8, _null8, _undefined8, lowercase4, uppercase4, hex6, md5_hex4, md5_base644, md5_base64url4, sha1_hex4, sha1_base644, sha1_base64url4, sha256_hex4, sha256_base644, sha256_base64url4, sha384_hex4, sha384_base644, sha384_base64url4, sha512_hex4, sha512_base644, sha512_base64url4, $ZodCheck4, numericOriginMap4, $ZodCheckLessThan4, $ZodCheckGreaterThan4, $ZodCheckMultipleOf4, $ZodCheckNumberFormat4, $ZodCheckBigIntFormat4, $ZodCheckMaxSize4, $ZodCheckMinSize4, $ZodCheckSizeEquals4, $ZodCheckMaxLength4, $ZodCheckMinLength4, $ZodCheckLengthEquals4, $ZodCheckStringFormat4, $ZodCheckRegex4, $ZodCheckLowerCase4, $ZodCheckUpperCase4, $ZodCheckIncludes4, $ZodCheckStartsWith4, $ZodCheckEndsWith4, $ZodCheckProperty4, $ZodCheckMimeType4, $ZodCheckOverwrite4, Doc4, version6, $ZodType4, $ZodString4, $ZodStringFormat4, $ZodGUID4, $ZodUUID4, $ZodEmail4, $ZodURL4, $ZodEmoji4, $ZodNanoID4, $ZodCUID5, $ZodCUID24, $ZodULID4, $ZodXID4, $ZodKSUID4, $ZodISODateTime4, $ZodISODate4, $ZodISOTime4, $ZodISODuration4, $ZodIPv44, $ZodIPv64, $ZodMAC4, $ZodCIDRv44, $ZodCIDRv64, $ZodBase644, $ZodBase64URL4, $ZodE1644, $ZodJWT4, $ZodCustomStringFormat4, $ZodNumber4, $ZodNumberFormat4, $ZodBoolean4, $ZodBigInt4, $ZodBigIntFormat4, $ZodSymbol4, $ZodUndefined4, $ZodNull4, $ZodAny4, $ZodUnknown4, $ZodNever4, $ZodVoid4, $ZodDate4, $ZodArray4, $ZodObject4, $ZodObjectJIT4, $ZodUnion4, $ZodXor4, $ZodDiscriminatedUnion4, $ZodIntersection4, $ZodTuple4, $ZodRecord4, $ZodMap4, $ZodSet4, $ZodEnum4, $ZodLiteral4, $ZodFile4, $ZodTransform4, $ZodOptional4, $ZodExactOptional4, $ZodNullable4, $ZodDefault4, $ZodPrefault4, $ZodNonOptional4, $ZodSuccess4, $ZodCatch4, $ZodNaN4, $ZodPipe4, $ZodCodec4, $ZodPreprocess4, $ZodReadonly4, $ZodTemplateLiteral4, $ZodFunction4, $ZodPromise4, $ZodLazy4, $ZodCustom4, locales_exports4, error110, error211, error311, error411, error510, error610, error710, error810, error910, error1010, error113, error123, error133, error143, error153, error163, error173, error183, error193, error203, error213, error223, error233, error243, error253, error263, error273, capitalizeFirstCharacter4, error283, error293, error303, error313, error323, error333, error343, error353, error363, error373, error383, error393, error403, error413, error423, error433, error443, error453, error463, error473, error483, error493, error503, _a23, $output4, $input4, $ZodRegistry4, globalRegistry4, TimePrecision4, createToJSONSchemaMethod4, createStandardJSONSchemaMethod4, formatMap4, stringProcessor4, numberProcessor4, booleanProcessor4, bigintProcessor4, symbolProcessor4, nullProcessor4, undefinedProcessor4, voidProcessor4, neverProcessor4, anyProcessor4, unknownProcessor4, dateProcessor4, enumProcessor4, literalProcessor4, nanProcessor4, templateLiteralProcessor4, fileProcessor4, successProcessor4, customProcessor4, functionProcessor4, transformProcessor4, mapProcessor4, setProcessor4, arrayProcessor4, objectProcessor4, unionProcessor4, intersectionProcessor4, tupleProcessor4, recordProcessor4, nullableProcessor4, nonoptionalProcessor4, defaultProcessor4, prefaultProcessor4, catchProcessor4, pipeProcessor4, readonlyProcessor4, promiseProcessor4, optionalProcessor4, lazyProcessor4, allProcessors4, JSONSchemaGenerator4, json_schema_exports4, schemas_exports23, checks_exports23, iso_exports4, ZodISODateTime4, ZodISODate4, ZodISOTime4, ZodISODuration4, initializer23, ZodError4, ZodRealError4, parse25, parseAsync23, safeParse23, safeParseAsync23, encode23, decode23, encodeAsync23, decodeAsync23, safeEncode23, safeDecode23, safeEncodeAsync23, safeDecodeAsync23, _installedGroups4, ZodType4, _ZodString4, ZodString4, ZodStringFormat4, ZodEmail4, ZodGUID4, ZodUUID4, ZodURL4, ZodEmoji4, ZodNanoID4, ZodCUID5, ZodCUID24, ZodULID4, ZodXID4, ZodKSUID4, ZodIPv44, ZodMAC4, ZodIPv64, ZodCIDRv44, ZodCIDRv64, ZodBase644, ZodBase64URL4, ZodE1644, ZodJWT4, ZodCustomStringFormat4, ZodNumber4, ZodNumberFormat4, ZodBoolean4, ZodBigInt4, ZodBigIntFormat4, ZodSymbol4, ZodUndefined4, ZodNull4, ZodAny4, ZodUnknown4, ZodNever4, ZodVoid4, ZodDate4, ZodArray4, ZodObject4, ZodUnion4, ZodXor4, ZodDiscriminatedUnion4, ZodIntersection4, ZodTuple4, ZodRecord4, ZodMap4, ZodSet4, ZodEnum4, ZodLiteral4, ZodFile4, ZodTransform4, ZodOptional4, ZodExactOptional4, ZodNullable4, ZodDefault4, ZodPrefault4, ZodNonOptional4, ZodSuccess4, ZodCatch4, ZodNaN4, ZodPipe4, ZodCodec4, ZodPreprocess4, ZodReadonly4, ZodTemplateLiteral4, ZodLazy4, ZodPromise4, ZodFunction4, ZodCustom4, describe23, meta23, stringbool4, ZodIssueCode4, ZodFirstPartyTypeKind4, z5, RECOGNIZED_KEYS4, coerce_exports4, SENSITIVE_STEP_OUTPUT2, MAX_WORKFLOW_NAME_LENGTH2, ALLOWED_WORKFLOW_NAME_REGEX2, getCloudflareApiEnvironmentFromEnv2, getCloudflareComplianceRegionFromEnv2, getCloudflareComplianceRegion2, getCloudflareApiBaseUrlFromEnv2, getCloudflareApiBaseUrl2, getCIOverrideName2, getTraceHeader2, getCloudflareEnv2, getWranglerCacheDirFromEnv2, getCloudflaredPathFromEnv2, Diagnostics3, appendEnvName2, isString3, isValidName2, isValidDateTimeStringFormat2, isStringArray2, isOneOf2, all2, isMutuallyExclusiveWith2, isBoolean2, validateRequiredProperty2, validateAtLeastOnePropertyRequired2, validateOptionalProperty2, validateTypedArray2, validateOptionalTypedArray2, isRequiredProperty2, isOptionalProperty2, hasProperty2, validateAdditionalProperties2, getBindingNames2, isBindingList2, isNamespaceList2, isRecord3, validateUniqueNameProperty2, bucketFormatMessage2, friendlyBindingNames3, bindingTypeFriendlyNames2, ENGLISH2, ALLOWED_INSTANCE_TYPES2, isRoute2, isRouteArray2, validateTailConsumers2, validateStreamingTailConsumers2, validateAndNormalizeRules2, ARTIFACTS_EVENT_TYPE_SET2, validateTriggers2, validateRules2, validateRule2, validateDefines2, validateVars2, validateSecrets2, validateBindingsProperty2, validateUnsafeSettings2, validateDurableObjectBinding3, workflowNameFormatMessage2, validateWorkflowBinding2, validateCflogfwdrObject2, validateCflogfwdrBinding2, validateAssetsConfig2, validateNamedSimpleBinding2, validateAIBinding2, validateVersionMetadataBinding2, validateUnsafeBinding2, validateBindingArray2, validateCloudchamberConfig2, validateKVBinding2, validateSendEmailBinding2, validateQueueBinding2, validateR2Binding2, validateD1Binding2, validateVectorizeBinding2, validateAISearchNamespaceBinding2, validateAISearchBinding2, validateAgentMemoryBinding2, validateHyperdriveBinding2, validateVpcServiceBinding2, validateVpcNetworkBinding2, validateBindingsHaveUniqueNames2, validateServiceBinding2, validateAnalyticsEngineBinding2, validateWorkerNamespaceBinding2, validateMTlsCertificateBinding2, validateConsumer2, validateCompatibilityDate2, validatePipelineBinding2, validateSecretsStoreSecretBinding2, validateArtifactsBinding2, validateHelloWorldBinding2, validateFlagshipBinding2, validateWorkerLoaderBinding2, validateRateLimitBinding2, validatePreviewsConfig2, validateMigrations2, VALID_EXPORT_STORAGES2, JS_IDENTIFIER_RE2, validateExports2, validateObservability2, validateCache2, validatePythonModules2, BINDING_LOCAL_SUPPORT2, supportedPagesConfigFields2, import_ci_info5, arrayFormatter2, signals3, processOk3, kExitEmitter3, global4, ObjectDefineProperty3, Emitter3, SignalExitBase3, signalExitWrap3, SignalExitFallback3, SignalExit3, process32, onExit4, load3, unload3, STALE_WRANGLER_TMP_DIR_MS2, sweptTmpRoots2, import_command_exists3, UPDATE_SERVICE_URL2, CLOUDFLARED_VERSION_PATTERN2, GITHUB_RELEASE_BASE2, TUNNEL_STARTUP_TIMEOUT_MS2, TUNNEL_FORCE_KILL_TIMEOUT_MS2, DEFAULT_TUNNEL_EXPIRY_MS2, DEFAULT_TUNNEL_EXTENSION_MS2, DEFAULT_TUNNEL_MAX_REMAINING_MS2, DEFAULT_TUNNEL_REMINDER_INTERVAL_MS2, QUICK_TUNNEL_URL_REGEX2, import_update_check3, UPDATE_CHECK_TIMEOUT_MS2, TIMED_OUT2, MAX_ATTEMPTS2, MAX_RETRY_AFTER_MS2, invalidWorkerNameCharsRegex2, invalidWorkerNameStartEndRegex2, workerNameLengthLimit2, FORCE_COLOR2, NODE_DISABLE_COLORS2, NO_COLOR2, TERM2, isTTY2, $4, dim3, red3, green3, yellow3, blue3, magenta2, cyan2, originalEnabled2, kMessages2, kActual2, kGroupId2, groupColours2, GroupCountsMap2, validParamNameRegExp, PagesFunctionsErrorCode, PagesFunctionsError, PagesFunctionsBuildError, reservedKeywordRegex, validIdentifierRegex, MAX_FUNCTIONS_ROUTES_RULES, MAX_FUNCTIONS_ROUTES_RULE_LENGTH, ROUTES_SPEC_VERSION, RoutesValidationError;
212633
+ var UserError3, FatalError3, JsonFriendlyFatalError3, CharacterCodes3, ParseOptions3, ScanError3, SyntaxKind3, parse2$1, ParseErrorCode3, TomlError4, DATE_TIME_RE4, TomlDate4, INT_REGEX4, FLOAT_REGEX4, LEADING_ZERO4, ESCAPE_REGEX4, ESC_MAP4, KEY_PART_RE4, BARE_KEY4, dist_default6, ParseError3, APIError4, units3, UNSUPPORTED_BOMS3, PATH_TO_DEPLOY_CONFIG3, esm_default7, require_symbols2, require_timers2, require_errors2, require_constants$4, require_tree2, require_util$5, require_stats2, require_diagnostics2, require_request$1, require_wrap_handler2, require_dispatcher2, require_unwrap_handler2, require_dispatcher_base2, require_connect2, require_utils$1, require_constants$3, require_llhttp_wasm2, require_llhttp_simd_wasm2, require_constants$2, require_global$1, require_encoding3, require_infra2, require_data_url2, require_runtime_features2, require_webidl2, require_util$4, require_formdata2, require_formdata_parser2, require_promise2, require_body2, require_client_h12, require_client_h22, require_client2, require_fixed_queue2, require_pool_base2, require_pool2, require_balanced_pool2, require_round_robin_pool2, require_agent3, require_socks5_utils2, require_socks5_client2, require_socks5_proxy_agent2, require_proxy_agent2, require_env_http_proxy_agent2, require_retry_handler2, require_retry_agent2, require_h2c_client2, require_readable2, require_api_request2, require_abort_signal2, require_api_stream2, require_api_pipeline2, require_api_upgrade2, require_api_connect2, require_api2, require_mock_errors2, require_mock_symbols2, require_mock_utils2, require_mock_interceptor2, require_mock_client2, require_mock_call_history2, require_mock_pool2, require_pending_interceptors_formatter2, require_mock_agent2, require_snapshot_utils2, require_snapshot_recorder2, require_snapshot_agent2, require_global3, require_decorator_handler2, require_redirect_handler2, require_redirect2, require_response_error2, require_retry2, require_dump2, require_dns2, require_cache$2, require_date4, require_cache_handler2, require_memory_cache_store2, require_cache_revalidation_handler2, require_cache$1, require_decompress2, require_deduplication_handler2, require_deduplicate2, require_sqlite_cache_store2, require_headers2, require_response2, require_request3, require_subresource_integrity2, require_fetch2, require_util$3, require_cache4, require_cachestorage2, require_constants$1, require_util$2, require_parse3, require_cookies2, require_events2, require_constants8, require_util$1, require_frame2, require_connection2, require_permessage_deflate3, require_receiver3, require_sender3, require_websocket3, require_websocketerror2, require_websocketstream2, require_util10, require_eventsource_stream2, require_eventsource2, require_undici2, import_undici9, require_vendors3, require_ci_info3, require_command_exists5, require_command_exists22, require_ini2, require_strip_json_comments2, require_utils5, require_deep_extend2, require_minimist2, require_rc2, require_registry_url2, require_safe_buffer2, require_base642, require_registry_auth_token2, require_update_check2, ARTIFACTS_EVENT_TYPES2, defaultWranglerConfig2, external_exports4, core_exports23, _a8, NEVER4, $brand4, $ZodAsyncError4, $ZodEncodeError4, globalConfig4, util_exports5, EVALUATING4, captureStackTrace4, allowsEval4, getParsedType4, propertyKeyTypes4, primitiveTypes4, NUMBER_FORMAT_RANGES4, BIGINT_FORMAT_RANGES4, Class5, initializer6, $ZodError4, $ZodRealError4, _parse4, parse11, _parseAsync4, parseAsync6, _safeParse4, safeParse6, _safeParseAsync4, safeParseAsync6, _encode4, encode7, _decode4, decode6, _encodeAsync4, encodeAsync6, _decodeAsync4, decodeAsync6, _safeEncode4, safeEncode6, _safeDecode4, safeDecode6, _safeEncodeAsync4, safeEncodeAsync6, _safeDecodeAsync4, safeDecodeAsync6, regexes_exports4, cuid7, cuid26, ulid6, xid6, ksuid6, nanoid6, duration6, extendedDuration4, guid6, uuid9, uuid45, uuid64, uuid74, email6, html5Email4, rfc5322Email4, unicodeEmail4, idnEmail4, browserEmail4, _emoji6, ipv46, ipv66, mac6, cidrv46, cidrv66, base647, base64url6, hostname6, domain4, httpProtocol4, e1646, dateSource4, date10, string8, bigint8, integer4, number8, boolean8, _null8, _undefined8, lowercase4, uppercase4, hex6, md5_hex4, md5_base644, md5_base64url4, sha1_hex4, sha1_base644, sha1_base64url4, sha256_hex4, sha256_base644, sha256_base64url4, sha384_hex4, sha384_base644, sha384_base64url4, sha512_hex4, sha512_base644, sha512_base64url4, $ZodCheck4, numericOriginMap4, $ZodCheckLessThan4, $ZodCheckGreaterThan4, $ZodCheckMultipleOf4, $ZodCheckNumberFormat4, $ZodCheckBigIntFormat4, $ZodCheckMaxSize4, $ZodCheckMinSize4, $ZodCheckSizeEquals4, $ZodCheckMaxLength4, $ZodCheckMinLength4, $ZodCheckLengthEquals4, $ZodCheckStringFormat4, $ZodCheckRegex4, $ZodCheckLowerCase4, $ZodCheckUpperCase4, $ZodCheckIncludes4, $ZodCheckStartsWith4, $ZodCheckEndsWith4, $ZodCheckProperty4, $ZodCheckMimeType4, $ZodCheckOverwrite4, Doc4, version6, $ZodType4, $ZodString4, $ZodStringFormat4, $ZodGUID4, $ZodUUID4, $ZodEmail4, $ZodURL4, $ZodEmoji4, $ZodNanoID4, $ZodCUID5, $ZodCUID24, $ZodULID4, $ZodXID4, $ZodKSUID4, $ZodISODateTime4, $ZodISODate4, $ZodISOTime4, $ZodISODuration4, $ZodIPv44, $ZodIPv64, $ZodMAC4, $ZodCIDRv44, $ZodCIDRv64, $ZodBase644, $ZodBase64URL4, $ZodE1644, $ZodJWT4, $ZodCustomStringFormat4, $ZodNumber4, $ZodNumberFormat4, $ZodBoolean4, $ZodBigInt4, $ZodBigIntFormat4, $ZodSymbol4, $ZodUndefined4, $ZodNull4, $ZodAny4, $ZodUnknown4, $ZodNever4, $ZodVoid4, $ZodDate4, $ZodArray4, $ZodObject4, $ZodObjectJIT4, $ZodUnion4, $ZodXor4, $ZodDiscriminatedUnion4, $ZodIntersection4, $ZodTuple4, $ZodRecord4, $ZodMap4, $ZodSet4, $ZodEnum4, $ZodLiteral4, $ZodFile4, $ZodTransform4, $ZodOptional4, $ZodExactOptional4, $ZodNullable4, $ZodDefault4, $ZodPrefault4, $ZodNonOptional4, $ZodSuccess4, $ZodCatch4, $ZodNaN4, $ZodPipe4, $ZodCodec4, $ZodPreprocess4, $ZodReadonly4, $ZodTemplateLiteral4, $ZodFunction4, $ZodPromise4, $ZodLazy4, $ZodCustom4, locales_exports4, error110, error211, error311, error411, error510, error610, error710, error810, error910, error1010, error113, error123, error133, error143, error153, error163, error173, error183, error193, error203, error213, error223, error233, error243, error253, error263, error273, capitalizeFirstCharacter4, error283, error293, error303, error313, error323, error333, error343, error353, error363, error373, error383, error393, error403, error413, error423, error433, error443, error453, error463, error473, error483, error493, error503, _a23, $output4, $input4, $ZodRegistry4, globalRegistry4, TimePrecision4, createToJSONSchemaMethod4, createStandardJSONSchemaMethod4, formatMap4, stringProcessor4, numberProcessor4, booleanProcessor4, bigintProcessor4, symbolProcessor4, nullProcessor4, undefinedProcessor4, voidProcessor4, neverProcessor4, anyProcessor4, unknownProcessor4, dateProcessor4, enumProcessor4, literalProcessor4, nanProcessor4, templateLiteralProcessor4, fileProcessor4, successProcessor4, customProcessor4, functionProcessor4, transformProcessor4, mapProcessor4, setProcessor4, arrayProcessor4, objectProcessor4, unionProcessor4, intersectionProcessor4, tupleProcessor4, recordProcessor4, nullableProcessor4, nonoptionalProcessor4, defaultProcessor4, prefaultProcessor4, catchProcessor4, pipeProcessor4, readonlyProcessor4, promiseProcessor4, optionalProcessor4, lazyProcessor4, allProcessors4, JSONSchemaGenerator4, json_schema_exports4, schemas_exports23, checks_exports23, iso_exports4, ZodISODateTime4, ZodISODate4, ZodISOTime4, ZodISODuration4, initializer23, ZodError4, ZodRealError4, parse25, parseAsync23, safeParse23, safeParseAsync23, encode23, decode23, encodeAsync23, decodeAsync23, safeEncode23, safeDecode23, safeEncodeAsync23, safeDecodeAsync23, _installedGroups4, ZodType4, _ZodString4, ZodString4, ZodStringFormat4, ZodEmail4, ZodGUID4, ZodUUID4, ZodURL4, ZodEmoji4, ZodNanoID4, ZodCUID5, ZodCUID24, ZodULID4, ZodXID4, ZodKSUID4, ZodIPv44, ZodMAC4, ZodIPv64, ZodCIDRv44, ZodCIDRv64, ZodBase644, ZodBase64URL4, ZodE1644, ZodJWT4, ZodCustomStringFormat4, ZodNumber4, ZodNumberFormat4, ZodBoolean4, ZodBigInt4, ZodBigIntFormat4, ZodSymbol4, ZodUndefined4, ZodNull4, ZodAny4, ZodUnknown4, ZodNever4, ZodVoid4, ZodDate4, ZodArray4, ZodObject4, ZodUnion4, ZodXor4, ZodDiscriminatedUnion4, ZodIntersection4, ZodTuple4, ZodRecord4, ZodMap4, ZodSet4, ZodEnum4, ZodLiteral4, ZodFile4, ZodTransform4, ZodOptional4, ZodExactOptional4, ZodNullable4, ZodDefault4, ZodPrefault4, ZodNonOptional4, ZodSuccess4, ZodCatch4, ZodNaN4, ZodPipe4, ZodCodec4, ZodPreprocess4, ZodReadonly4, ZodTemplateLiteral4, ZodLazy4, ZodPromise4, ZodFunction4, ZodCustom4, describe23, meta23, stringbool4, ZodIssueCode4, ZodFirstPartyTypeKind4, z5, RECOGNIZED_KEYS4, coerce_exports4, SENSITIVE_STEP_OUTPUT2, MAX_WORKFLOW_NAME_LENGTH2, ALLOWED_WORKFLOW_NAME_REGEX2, getDoNotTrackFromEnv2, getWranglerSendMetricsVariableFromEnv2, getCloudflareApiEnvironmentFromEnv2, getCloudflareComplianceRegionFromEnv2, getCloudflareComplianceRegion2, getCloudflareApiBaseUrlFromEnv2, getCloudflareApiBaseUrl2, getCIOverrideName2, getTraceHeader2, getCloudflareEnv2, getWranglerCacheDirFromEnv2, getCloudflaredPathFromEnv2, Diagnostics3, appendEnvName2, isString3, isValidName2, isValidDateTimeStringFormat2, isStringArray2, isOneOf2, all2, isMutuallyExclusiveWith2, isBoolean2, validateRequiredProperty2, validateAtLeastOnePropertyRequired2, validateOptionalProperty2, validateTypedArray2, validateOptionalTypedArray2, isRequiredProperty2, isOptionalProperty2, hasProperty2, validateAdditionalProperties2, getBindingNames2, isBindingList2, isNamespaceList2, isRecord3, validateUniqueNameProperty2, bucketFormatMessage2, friendlyBindingNames3, bindingTypeFriendlyNames2, ENGLISH2, ALLOWED_INSTANCE_TYPES2, isRoute2, isRouteArray2, validateTailConsumers2, validateStreamingTailConsumers2, validateAndNormalizeRules2, ARTIFACTS_EVENT_TYPE_SET2, validateTriggers2, validateRules2, validateRule2, validateDefines2, validateVars2, validateSecrets2, validateBindingsProperty2, validateUnsafeSettings2, validateDurableObjectBinding3, workflowNameFormatMessage2, validateWorkflowBinding2, validateCflogfwdrObject2, validateCflogfwdrBinding2, validateAssetsConfig2, validateNamedSimpleBinding2, validateAIBinding2, validateVersionMetadataBinding2, validateUnsafeBinding2, validateBindingArray2, validateCloudchamberConfig2, validateKVBinding2, validateSendEmailBinding2, validateQueueBinding2, validateR2Binding2, validateD1Binding2, validateVectorizeBinding2, validateAISearchNamespaceBinding2, validateAISearchBinding2, validateAgentMemoryBinding2, validateHyperdriveBinding2, validateVpcServiceBinding2, validateVpcNetworkBinding2, validateBindingsHaveUniqueNames2, validateServiceBinding2, validateAnalyticsEngineBinding2, validateWorkerNamespaceBinding2, validateMTlsCertificateBinding2, validateConsumer2, validateCompatibilityDate2, validatePipelineBinding2, validateSecretsStoreSecretBinding2, validateArtifactsBinding2, validateHelloWorldBinding2, validateFlagshipBinding2, validateWorkerLoaderBinding2, validateRateLimitBinding2, validatePreviewsConfig2, validateMigrations2, VALID_EXPORT_STORAGES2, JS_IDENTIFIER_RE2, validateExports2, validateObservability2, validateCache2, validatePythonModules2, BINDING_LOCAL_SUPPORT2, supportedPagesConfigFields2, import_ci_info5, arrayFormatter2, signals3, processOk3, kExitEmitter3, global4, ObjectDefineProperty3, Emitter3, SignalExitBase3, signalExitWrap3, SignalExitFallback3, SignalExit3, process32, onExit4, load3, unload3, STALE_WRANGLER_TMP_DIR_MS2, sweptTmpRoots2, import_command_exists3, UPDATE_SERVICE_URL2, CLOUDFLARED_VERSION_PATTERN2, GITHUB_RELEASE_BASE2, TUNNEL_STARTUP_TIMEOUT_MS2, TUNNEL_FORCE_KILL_TIMEOUT_MS2, DEFAULT_TUNNEL_EXPIRY_MS2, DEFAULT_TUNNEL_EXTENSION_MS2, DEFAULT_TUNNEL_MAX_REMAINING_MS2, DEFAULT_TUNNEL_REMINDER_INTERVAL_MS2, QUICK_TUNNEL_URL_REGEX2, import_update_check3, UPDATE_CHECK_TIMEOUT_MS2, TIMED_OUT2, MAX_ATTEMPTS2, MAX_RETRY_AFTER_MS2, invalidWorkerNameCharsRegex2, invalidWorkerNameStartEndRegex2, workerNameLengthLimit2, FORCE_COLOR2, NODE_DISABLE_COLORS2, NO_COLOR2, TERM2, isTTY2, $4, dim3, red3, green3, yellow3, blue3, magenta2, cyan2, originalEnabled2, kMessages2, kActual2, kGroupId2, groupColours2, GroupCountsMap2, validParamNameRegExp, PagesFunctionsErrorCode, PagesFunctionsError, PagesFunctionsBuildError, reservedKeywordRegex, validIdentifierRegex, MAX_FUNCTIONS_ROUTES_RULES, MAX_FUNCTIONS_ROUTES_RULE_LENGTH, ROUTES_SPEC_VERSION, RoutesValidationError;
212756
212634
  var init_dist14 = __esm({
212757
212635
  "../pages-functions/dist/index.mjs"() {
212758
212636
  init_import_meta_url();
@@ -246767,6 +246645,12 @@ ${captureLines}` : capture.stack;
246767
246645
  __name6(getProcessEnv2, "getProcessEnv");
246768
246646
  __name(assertOneOf2, "assertOneOf");
246769
246647
  __name6(assertOneOf2, "assertOneOf");
246648
+ getDoNotTrackFromEnv2 = getEnvironmentVariableFactory2({ variableName: "DO_NOT_TRACK" });
246649
+ __name(isDoNotTrackEnabled2, "isDoNotTrackEnabled");
246650
+ __name6(isDoNotTrackEnabled2, "isDoNotTrackEnabled");
246651
+ getWranglerSendMetricsVariableFromEnv2 = getBooleanEnvironmentVariableFactory2({ variableName: "WRANGLER_SEND_METRICS" });
246652
+ __name(getWranglerSendMetricsFromEnv2, "getWranglerSendMetricsFromEnv");
246653
+ __name6(getWranglerSendMetricsFromEnv2, "getWranglerSendMetricsFromEnv");
246770
246654
  getCloudflareApiEnvironmentFromEnv2 = getEnvironmentVariableFactory2({
246771
246655
  variableName: "WRANGLER_API_ENVIRONMENT",
246772
246656
  defaultValue: /* @__PURE__ */ __name6(() => "production", "defaultValue"),
@@ -252139,7 +252023,7 @@ async function bundleWorker(entry, destination, {
252139
252023
  entry = result2.entry;
252140
252024
  inject.push(...result2.inject ?? []);
252141
252025
  }
252142
- if (watch2) {
252026
+ if (watch2 && bundle) {
252143
252027
  inject.push(path31__namespace.resolve(getBasePath(), "templates/modules-watch-stub.js"));
252144
252028
  }
252145
252029
  const aliasPlugin = {
@@ -266649,16 +266533,18 @@ var init_std = __esm({
266649
266533
  async function usingLocalSecretsStoreSecretAPI(persistTo, config5, storeId, secretName, closure) {
266650
266534
  const persist = getLocalPersistencePath(persistTo, config5);
266651
266535
  const resourcePersistencePath = getDefaultPersistRoot(persist);
266652
- const mf = new miniflare.Miniflare({
266653
- script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
266654
- resourcePersistencePath,
266655
- secretsStoreSecrets: {
266656
- SECRET: {
266657
- store_id: storeId,
266658
- secret_name: secretName
266536
+ const mf = new miniflare.Miniflare(
266537
+ miniflare.convertV4MiniflareOptions({
266538
+ script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
266539
+ resourcePersistencePath,
266540
+ secretsStoreSecrets: {
266541
+ SECRET: {
266542
+ store_id: storeId,
266543
+ secret_name: secretName
266544
+ }
266659
266545
  }
266660
- }
266661
- });
266546
+ })
266547
+ );
266662
266548
  const namespace = await mf.getSecretsStoreSecretAPI("SECRET");
266663
266549
  try {
266664
266550
  return await closure(namespace());
@@ -270319,12 +270205,12 @@ async function generateRuntimeTypes({ compatibilityDate, compatibilityFlags = []
270319
270205
  };
270320
270206
  }
270321
270207
  async function generate({ compatibilityDate, compatibilityFlags = [] }) {
270322
- const mf = new miniflare.Miniflare({
270208
+ const mf = new miniflare.Miniflare(miniflare.convertV4MiniflareOptions({
270323
270209
  compatibilityDate: "2024-01-01",
270324
270210
  compatibilityFlags: ["nodejs_compat", "rtti_api"],
270325
270211
  modules: true,
270326
270212
  script: (await fs$1__namespace.readFile(require2.resolve("workerd/worker.mjs"))).toString()
270327
- });
270213
+ }));
270328
270214
  const path89 = `http://dummy.com/${compatibilityDate}${compatibilityFlags.length ? `+${compatibilityFlags.join("+")}` : ""}`;
270329
270215
  try {
270330
270216
  const res = await mf.dispatchFetch(path89);
@@ -279486,11 +279372,13 @@ var init_ProxyController = __esm({
279486
279372
  proxyWorkerOptions
279487
279373
  );
279488
279374
  const willInstantiateMiniflareInstance = !this.proxyWorker || proxyWorkerOptionsChanged;
279489
- this.proxyWorker ??= new miniflare.Miniflare(proxyWorkerOptions);
279375
+ this.proxyWorker ??= new miniflare.Miniflare(
279376
+ miniflare.convertV4MiniflareOptions(proxyWorkerOptions)
279377
+ );
279490
279378
  this.proxyWorkerOptions = proxyWorkerOptions;
279491
279379
  if (proxyWorkerOptionsChanged) {
279492
279380
  logger2.debug("ProxyWorker miniflare options changed, reinstantiating...");
279493
- void this.proxyWorker.setOptions(proxyWorkerOptions).catch((error111) => {
279381
+ void this.proxyWorker.setOptions(miniflare.convertV4MiniflareOptions(proxyWorkerOptions)).catch((error111) => {
279494
279382
  this.emitErrorEvent("Failed to start ProxyWorker", error111);
279495
279383
  });
279496
279384
  this.ready = createDeferred(this.ready);
@@ -284987,11 +284875,13 @@ async function getKVNamespaceId({ namespace, preview: preview2, binding, "namesp
284987
284875
  async function usingLocalNamespace(persistTo, config5, namespaceId, closure) {
284988
284876
  const persist = getLocalPersistencePath(persistTo, config5);
284989
284877
  const resourcePersistencePath = getDefaultPersistRoot(persist);
284990
- const mf = new miniflare.Miniflare({
284991
- script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
284992
- resourcePersistencePath,
284993
- kvNamespaces: { NAMESPACE: namespaceId }
284994
- });
284878
+ const mf = new miniflare.Miniflare(
284879
+ miniflare.convertV4MiniflareOptions({
284880
+ script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
284881
+ resourcePersistencePath,
284882
+ kvNamespaces: { NAMESPACE: namespaceId }
284883
+ })
284884
+ );
284995
284885
  const namespace = await mf.getKVNamespace("NAMESPACE");
284996
284886
  try {
284997
284887
  return await closure(namespace);
@@ -286112,19 +286002,20 @@ async function analyseBundleProfile(workerBundle) {
286112
286002
  { telemetryMessage: "check startup service worker format unsupported" }
286113
286003
  );
286114
286004
  }
286115
- const mf = new miniflare.Miniflare({
286116
- name: "profiler",
286117
- compatibilityDate: metadata2.compatibility_date,
286118
- compatibilityFlags: metadata2.compatibility_flags,
286119
- modulesRoot: "/",
286120
- modules: [
286121
- {
286122
- type: "ESModule",
286123
- // Make sure the entrypoint path doesn't conflict with a user worker module
286124
- path: crypto2.randomUUID(),
286125
- contents: (
286126
- /* javascript */
286127
- `
286005
+ const mf = new miniflare.Miniflare(
286006
+ miniflare.convertV4MiniflareOptions({
286007
+ name: "profiler",
286008
+ compatibilityDate: metadata2.compatibility_date,
286009
+ compatibilityFlags: metadata2.compatibility_flags,
286010
+ modulesRoot: "/",
286011
+ modules: [
286012
+ {
286013
+ type: "ESModule",
286014
+ // Make sure the entrypoint path doesn't conflict with a user worker module
286015
+ path: crypto2.randomUUID(),
286016
+ contents: (
286017
+ /* javascript */
286018
+ `
286128
286019
  async function startup() {
286129
286020
  await import("${metadata2.main_module}");
286130
286021
  }
@@ -286135,12 +286026,13 @@ async function analyseBundleProfile(workerBundle) {
286135
286026
  }
286136
286027
  }
286137
286028
  `
286138
- )
286139
- },
286140
- ...await convertWorkerBundleToModules(workerBundle)
286141
- ],
286142
- inspectorPort: 0
286143
- });
286029
+ )
286030
+ },
286031
+ ...await convertWorkerBundleToModules(workerBundle)
286032
+ ],
286033
+ inspectorPort: 0
286034
+ })
286035
+ );
286144
286036
  await mf.ready;
286145
286037
  const inspectorUrl = await mf.getInspectorURL();
286146
286038
  const ws = new import_websocket.default(new URL("/core:user:profiler", inspectorUrl.href));
@@ -302004,7 +301896,7 @@ var init_constants6 = __esm({
302004
301896
  DEFAULT_MIGRATION_PATH = "./migrations";
302005
301897
  DEFAULT_MIGRATION_TABLE = "d1_migrations";
302006
301898
  LOCATION_CHOICES = ["weur", "eeur", "apac", "oc", "wnam", "enam"];
302007
- JURISDICTION_CHOICES = ["eu", "fedramp"];
301899
+ JURISDICTION_CHOICES = ["eu", "fedramp", "us"];
302008
301900
  D1_DOCS_URL = "https://developers.cloudflare.com/d1/";
302009
301901
  }
302010
301902
  });
@@ -302107,6 +301999,7 @@ var init_create7 = __esm({
302107
301999
  The location to restrict the D1 database to run and store data within to comply with local regulations. Note that if jurisdictions are set, the location hint is ignored. Options:
302108
302000
  eu: The European Union
302109
302001
  fedramp: FedRAMP-compliant data centers
302002
+ us: The United States
302110
302003
  `
302111
302004
  },
302112
302005
  ...sharedResourceCreationArgs
@@ -302641,12 +302534,14 @@ async function executeLocally({
302641
302534
  logger2.log(
302642
302535
  "\u{1F300} To execute on your remote database, add a --remote flag to your wrangler command."
302643
302536
  );
302644
- const mf = new miniflare.Miniflare({
302645
- modules: true,
302646
- script: "",
302647
- resourcePersistencePath,
302648
- d1Databases: { DATABASE: id }
302649
- });
302537
+ const mf = new miniflare.Miniflare(
302538
+ miniflare.convertV4MiniflareOptions({
302539
+ modules: true,
302540
+ script: "",
302541
+ resourcePersistencePath,
302542
+ d1Databases: { DATABASE: id }
302543
+ })
302544
+ );
302650
302545
  const db = await mf.getD1Database("DATABASE");
302651
302546
  const sql = input.file ? readFileSync(input.file) : input.command;
302652
302547
  const queries = splitSqlQuery(sql);
@@ -303117,12 +303012,14 @@ async function exportLocal(config5, name2, output, tables, noSchema, noData) {
303117
303012
  logger2.log(
303118
303013
  "\u{1F300} To export your remote database, add a --remote flag to your wrangler command."
303119
303014
  );
303120
- const mf = new miniflare.Miniflare({
303121
- modules: true,
303122
- script: "export default {}",
303123
- resourcePersistencePath,
303124
- d1Databases: { DATABASE: id }
303125
- });
303015
+ const mf = new miniflare.Miniflare(
303016
+ miniflare.convertV4MiniflareOptions({
303017
+ modules: true,
303018
+ script: "export default {}",
303019
+ resourcePersistencePath,
303020
+ d1Databases: { DATABASE: id }
303021
+ })
303022
+ );
303126
303023
  const db = await mf.getD1Database("DATABASE");
303127
303024
  logger2.log(`\u{1F300} Exporting SQL to ${output}...`);
303128
303025
  try {
@@ -365679,15 +365576,17 @@ var init_flagship = __esm({
365679
365576
  async function usingLocalHelloWorldBinding(persistTo, config5, closure) {
365680
365577
  const persist = getLocalPersistencePath(persistTo, config5);
365681
365578
  const resourcePersistencePath = getDefaultPersistRoot(persist);
365682
- const mf = new miniflare.Miniflare({
365683
- script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
365684
- resourcePersistencePath,
365685
- helloWorld: {
365686
- BINDING: {
365687
- enable_timer: false
365579
+ const mf = new miniflare.Miniflare(
365580
+ miniflare.convertV4MiniflareOptions({
365581
+ script: 'addEventListener("fetch", (e) => e.respondWith(new Response(null, { status: 404 })))',
365582
+ resourcePersistencePath,
365583
+ helloWorld: {
365584
+ BINDING: {
365585
+ enable_timer: false
365586
+ }
365688
365587
  }
365689
- }
365690
- });
365588
+ })
365589
+ );
365691
365590
  const binding = await mf.getHelloWorldBinding("BINDING");
365692
365591
  try {
365693
365592
  return await closure(binding);
@@ -367941,7 +367840,28 @@ Expected an array of strings or objects with a "name" key.
367941
367840
  });
367942
367841
 
367943
367842
  // src/metrics/commands.ts
367944
- var telemetryNamespace, metricsAlias, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, logTelemetryStatus;
367843
+ function resolveTelemetryStatus(sendMetrics) {
367844
+ if (isDoNotTrackEnabled()) {
367845
+ return { enabled: false, source: "DO_NOT_TRACK" };
367846
+ }
367847
+ const sendMetricsEnv = getWranglerSendMetricsFromEnv();
367848
+ if (sendMetricsEnv !== void 0) {
367849
+ return { enabled: sendMetricsEnv, source: "WRANGLER_SEND_METRICS" };
367850
+ }
367851
+ if (sendMetrics !== void 0) {
367852
+ return { enabled: sendMetrics, source: "wrangler config" };
367853
+ }
367854
+ const savedConfig = readMetricsConfig();
367855
+ return { enabled: savedConfig.permission?.enabled ?? true };
367856
+ }
367857
+ function logTelemetryStatus(enabled, source) {
367858
+ const sourceMessage = source === void 0 ? "" : ` (set by ${source})`;
367859
+ logger2.log(
367860
+ `Status: ${enabled ? source_default.green("Enabled") : source_default.red("Disabled")}${sourceMessage}
367861
+ `
367862
+ );
367863
+ }
367864
+ var telemetryNamespace, metricsAlias, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand;
367945
367865
  var init_commands4 = __esm({
367946
367866
  "src/metrics/commands.ts"() {
367947
367867
  init_import_meta_url();
@@ -367988,12 +367908,20 @@ var init_commands4 = __esm({
367988
367908
  behaviour: {
367989
367909
  suggestSkillsAfterHandler: true
367990
367910
  },
367991
- async handler() {
367911
+ async handler(_4, { config: config5 }) {
367992
367912
  updateMetricsPermission(true);
367993
- logTelemetryStatus(true);
367994
- logger2.log(
367995
- "Wrangler is now collecting telemetry about your usage. Thank you for helping make Wrangler better \u{1F9E1}\n"
367996
- );
367913
+ const telemetry = resolveTelemetryStatus(config5.send_metrics);
367914
+ logTelemetryStatus(telemetry.enabled, telemetry.source);
367915
+ if (telemetry.enabled) {
367916
+ logger2.log(
367917
+ "Wrangler is now collecting telemetry about your usage. Thank you for helping make Wrangler better \u{1F9E1}\n"
367918
+ );
367919
+ } else {
367920
+ logger2.log(
367921
+ `Telemetry has been enabled in Wrangler's global configuration, but remains disabled because it is overridden by ${telemetry.source}.
367922
+ `
367923
+ );
367924
+ }
367997
367925
  }
367998
367926
  });
367999
367927
  telemetryStatusCommand = createCommand({
@@ -368006,28 +367934,15 @@ var init_commands4 = __esm({
368006
367934
  suggestSkillsAfterHandler: true
368007
367935
  },
368008
367936
  async handler(_4, { config: config5 }) {
368009
- const savedConfig = readMetricsConfig();
368010
- const sendMetricsEnv = getWranglerSendMetricsFromEnv();
368011
- if (config5.send_metrics !== void 0 || sendMetricsEnv !== void 0) {
368012
- const resolvedPermission = sendMetricsEnv ?? config5.send_metrics;
368013
- logger2.log(
368014
- `Status: ${resolvedPermission ? source_default.green("Enabled") : source_default.red("Disabled")} (set by ${sendMetricsEnv !== void 0 ? "environment variable" : "wrangler.toml"})
368015
- `
368016
- );
368017
- } else {
368018
- logTelemetryStatus(savedConfig.permission?.enabled ?? true);
368019
- }
367937
+ const telemetry = resolveTelemetryStatus(config5.send_metrics);
367938
+ logTelemetryStatus(telemetry.enabled, telemetry.source);
368020
367939
  logger2.log(
368021
367940
  "To configure telemetry globally on this machine, you can run `wrangler telemetry disable / enable`.\nYou can override this for individual projects with the environment variable `WRANGLER_SEND_METRICS=true/false`.\nLearn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md\n"
368022
367941
  );
368023
367942
  }
368024
367943
  });
368025
- logTelemetryStatus = /* @__PURE__ */ __name((enabled) => {
368026
- logger2.log(
368027
- `Status: ${enabled ? source_default.green("Enabled") : source_default.red("Disabled")}
368028
- `
368029
- );
368030
- }, "logTelemetryStatus");
367944
+ __name(resolveTelemetryStatus, "resolveTelemetryStatus");
367945
+ __name(logTelemetryStatus, "logTelemetryStatus");
368031
367946
  }
368032
367947
  });
368033
367948
 
@@ -412211,100 +412126,288 @@ var init_update8 = __esm({
412211
412126
  }
412212
412127
  });
412213
412128
 
412214
- // src/preview/commands.ts
412215
- async function handlePreviewCommand(args, { config: config5 }) {
412216
- const accountId = await requireAuth(config5);
412217
- const entry = await getEntry({ script: args.script }, config5, "deploy");
412218
- const destination = getWranglerTmpDir(entry.projectRoot, "preview");
412219
- const buildResult = await buildWorker(
412220
- {
412221
- entry,
412222
- name: config5.name,
412223
- compatibilityDate: config5.compatibility_date,
412224
- compatibilityFlags: config5.compatibility_flags,
412225
- uploadSourceMaps: config5.upload_source_maps,
412226
- jsxFactory: config5.jsx_factory,
412227
- jsxFragment: config5.jsx_fragment,
412228
- tsconfig: config5.tsconfig,
412229
- minify: config5.minify,
412230
- noBundle: config5.no_bundle ?? false,
412231
- defines: config5.previews?.define ?? {},
412232
- alias: { ...config5.alias },
412233
- doBindings: config5.previews?.durable_objects?.bindings ?? [],
412234
- workflowBindings: config5.previews?.workflows ?? [],
412235
- destination,
412236
- outdir: void 0,
412237
- metafile: void 0
412238
- },
412239
- config5
412240
- );
412241
- const assetsOptions = getAssetsOptions({
412242
- args: { assets: void 0, script: args.script },
412243
- config: config5
412244
- });
412245
- const { preview: previewResource, deployment } = await preview(
412246
- accountId,
412247
- args,
412248
- config5,
412249
- buildResult,
412250
- assetsOptions
412251
- );
412252
- cleanupDestination(destination);
412253
- writeOutput({
412254
- type: "preview",
412255
- version: 1,
412256
- worker_name: previewResource.worker_name,
412257
- preview_id: previewResource.id,
412258
- preview_name: previewResource.name,
412259
- preview_slug: previewResource.slug,
412260
- preview_urls: previewResource.urls,
412261
- deployment_id: deployment.id,
412262
- deployment_urls: deployment.urls
412263
- });
412264
- }
412265
- async function handlePreviewDeleteCommand(args, { config: config5 }) {
412266
- const accountId = await requireAuth(config5);
412267
- await previewDelete(accountId, args, config5);
412129
+ // src/preview/base-config/index.ts
412130
+ var previewBaseConfigNamespace;
412131
+ var init_base_config = __esm({
412132
+ "src/preview/base-config/index.ts"() {
412133
+ init_import_meta_url();
412134
+ init_create_command();
412135
+ previewBaseConfigNamespace = createNamespace({
412136
+ metadata: {
412137
+ description: "Manage the Preview base config shared by Worker Previews",
412138
+ owner: "Workers: Deploy and Config",
412139
+ category: "Compute & AI",
412140
+ status: "private beta"
412141
+ }
412142
+ });
412143
+ }
412144
+ });
412145
+
412146
+ // src/preview/base-config/secrets/index.ts
412147
+ function rejectUnsupportedPreviewArgs(args) {
412148
+ for (const flag of ["name", "tag", "message"]) {
412149
+ if (args[flag] !== void 0) {
412150
+ throw new CommandLineArgsError(`Unknown argument: ${flag}`, {
412151
+ telemetryMessage: "preview base-config unsupported flag"
412152
+ });
412153
+ }
412154
+ }
412155
+ if (args.ignoreDefaults === true) {
412156
+ throw new CommandLineArgsError("Unknown argument: ignore-defaults", {
412157
+ telemetryMessage: "preview base-config unsupported flag"
412158
+ });
412159
+ }
412268
412160
  }
412269
- var init_commands9 = __esm({
412270
- "src/preview/commands.ts"() {
412161
+ var previewBaseConfigSecretNamespace;
412162
+ var init_secrets4 = __esm({
412163
+ "src/preview/base-config/secrets/index.ts"() {
412271
412164
  init_import_meta_url();
412272
- init_dist8();
412273
412165
  init_dist();
412274
- init_assets5();
412275
- init_entry();
412276
- init_maybe_build_worker();
412277
- init_merge_config_args();
412278
- init_output();
412279
- init_user3();
412280
- __name(handlePreviewCommand, "handlePreviewCommand");
412281
- __name(handlePreviewDeleteCommand, "handlePreviewDeleteCommand");
412166
+ init_create_command();
412167
+ previewBaseConfigSecretNamespace = createNamespace({
412168
+ metadata: {
412169
+ description: "Manage secrets on the Preview base config",
412170
+ owner: "Workers: Deploy and Config",
412171
+ category: "Compute & AI",
412172
+ status: "private beta"
412173
+ }
412174
+ });
412175
+ __name(rejectUnsupportedPreviewArgs, "rejectUnsupportedPreviewArgs");
412282
412176
  }
412283
412177
  });
412284
412178
 
412285
- // src/preview/secret.ts
412286
- function isSecretBinding(binding) {
412287
- return binding.type === "secret_text";
412179
+ // src/preview/secrets/index.ts
412180
+ function resolvePreviewName(args) {
412181
+ const previewName = args.name ?? getBranchName2();
412182
+ if (!previewName) {
412183
+ throw new UserError(
412184
+ "Could not determine Preview name. No git branch detected. Please provide a Preview name using --name <preview-name>.",
412185
+ { telemetryMessage: "preview secret command missing preview name" }
412186
+ );
412187
+ }
412188
+ return previewName;
412288
412189
  }
412289
412190
  function toSecretBindingsPatch(secrets) {
412290
412191
  return Object.fromEntries(
412291
412192
  Object.entries(secrets).map(([name2, text]) => [
412292
412193
  name2,
412293
- { type: "secret_text", text }
412194
+ text === null ? null : { type: "secret_text", text }
412294
412195
  ])
412295
412196
  );
412296
412197
  }
412198
+ function noPreviewDeploymentPatchMessage(previewName) {
412199
+ return `There are currently no deployments for the Preview "${previewName}". Please create a Preview deployment before modifying a secret.`;
412200
+ }
412201
+ function noPreviewDeploymentListMessage(previewName) {
412202
+ return `There are currently no deployments for the Preview "${previewName}". Please create a Preview deployment.`;
412203
+ }
412204
+ function previewNotFoundMessage(previewName) {
412205
+ return `The Preview "${previewName}" was not found. Please check the Preview name, or create it with \`wrangler preview\`.`;
412206
+ }
412207
+ async function patchPreviewDeploymentSecrets(config5, accountId, workerName, previewName, env7, annotation, telemetryMessages) {
412208
+ try {
412209
+ return await patchPreviewDeployment(
412210
+ config5,
412211
+ accountId,
412212
+ workerName,
412213
+ previewName,
412214
+ env7,
412215
+ {
412216
+ "workers/message": annotation.message,
412217
+ "workers/tag": annotation.tag
412218
+ }
412219
+ );
412220
+ } catch (e9) {
412221
+ if (e9 instanceof APIError) {
412222
+ if (e9.code === NO_PREVIEW_DEPLOYMENT_PATCH_ERR_CODE) {
412223
+ throw new UserError(noPreviewDeploymentPatchMessage(previewName), {
412224
+ telemetryMessage: telemetryMessages.noDeployment
412225
+ });
412226
+ }
412227
+ if (e9.code === PREVIEW_NOT_FOUND_ERR_CODE) {
412228
+ throw new UserError(previewNotFoundMessage(previewName), {
412229
+ telemetryMessage: telemetryMessages.previewNotFound
412230
+ });
412231
+ }
412232
+ }
412233
+ throw e9;
412234
+ }
412235
+ }
412236
+ var previewSecretNamespace, NO_PREVIEW_DEPLOYMENT_PATCH_ERR_CODE, NO_PREVIEW_DEPLOYMENT_GET_ERR_CODE, PREVIEW_NOT_FOUND_ERR_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE;
412237
+ var init_secrets5 = __esm({
412238
+ "src/preview/secrets/index.ts"() {
412239
+ init_import_meta_url();
412240
+ init_dist8();
412241
+ init_dist();
412242
+ init_create_command();
412243
+ previewSecretNamespace = createNamespace({
412244
+ metadata: {
412245
+ description: "Manage secrets for Worker Previews",
412246
+ owner: "Workers: Deploy and Config",
412247
+ category: "Compute & AI",
412248
+ status: "private beta"
412249
+ }
412250
+ });
412251
+ __name(resolvePreviewName, "resolvePreviewName");
412252
+ __name(toSecretBindingsPatch, "toSecretBindingsPatch");
412253
+ NO_PREVIEW_DEPLOYMENT_PATCH_ERR_CODE = 10032;
412254
+ NO_PREVIEW_DEPLOYMENT_GET_ERR_CODE = 10222;
412255
+ PREVIEW_NOT_FOUND_ERR_CODE = 10025;
412256
+ NO_ACTIVE_PREVIEW_URLS_MESSAGE = "Note: This Preview deployment has no active URLs. To get one, enable Preview Deployments on workers.dev or a custom domain. See https://developers.cloudflare.com/workers/previews/custom-domains/ for more information";
412257
+ __name(noPreviewDeploymentPatchMessage, "noPreviewDeploymentPatchMessage");
412258
+ __name(noPreviewDeploymentListMessage, "noPreviewDeploymentListMessage");
412259
+ __name(previewNotFoundMessage, "previewNotFoundMessage");
412260
+ __name(patchPreviewDeploymentSecrets, "patchPreviewDeploymentSecrets");
412261
+ }
412262
+ });
412263
+
412264
+ // src/preview/base-config/secrets/bulk.ts
412265
+ var previewBaseConfigSecretBulkCommand;
412266
+ var init_bulk2 = __esm({
412267
+ "src/preview/base-config/secrets/bulk.ts"() {
412268
+ init_import_meta_url();
412269
+ init_dist8();
412270
+ init_create_command();
412271
+ init_logger();
412272
+ init_secret();
412273
+ init_user3();
412274
+ init_secrets5();
412275
+ init_secrets4();
412276
+ previewBaseConfigSecretBulkCommand = createCommand({
412277
+ metadata: {
412278
+ description: "Upload multiple secrets to the Preview base config",
412279
+ owner: "Workers: Deploy and Config",
412280
+ category: "Compute & AI",
412281
+ status: "private beta"
412282
+ },
412283
+ positionalArgs: ["file"],
412284
+ args: {
412285
+ file: {
412286
+ describe: "The file of key-value pairs to upload, as JSON or .env format",
412287
+ type: "string"
412288
+ },
412289
+ "worker-name": {
412290
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
412291
+ type: "string",
412292
+ requiresArg: true
412293
+ }
412294
+ },
412295
+ behaviour: {
412296
+ suggestSkillsAfterHandler: true
412297
+ },
412298
+ validateArgs: rejectUnsupportedPreviewArgs,
412299
+ handler: /* @__PURE__ */ __name(async function previewBaseConfigSecretBulkHandler(args, { config: config5 }) {
412300
+ const workerName = resolveWorkerName(args, config5);
412301
+ const accountId = await requireAuth(config5);
412302
+ logger2.log(
412303
+ `\u{1F300} Processing the secrets for the Preview base config on the Worker "${workerName}"${args.env ? ` (${args.env})` : ""}`
412304
+ );
412305
+ const result = await parseBulkInputToObject(args.file, true);
412306
+ if (!result) {
412307
+ logger2.error("\u{1F6A8} No content found in file, or piped input.");
412308
+ return;
412309
+ }
412310
+ const { content } = result;
412311
+ const created = Object.keys(content).filter(
412312
+ (name2) => content[name2] !== null
412313
+ );
412314
+ const deleted = Object.keys(content).filter(
412315
+ (name2) => content[name2] === null
412316
+ );
412317
+ await patchPreviewBaseConfig(config5, accountId, workerName, {
412318
+ env: toSecretBindingsPatch(content)
412319
+ });
412320
+ for (const name2 of deleted) {
412321
+ logger2.log(`\u{1F4A5} Successfully deleted secret for key: ${name2}`);
412322
+ }
412323
+ for (const name2 of created) {
412324
+ logger2.log(`\u2728 Successfully created secret for key: ${name2}`);
412325
+ }
412326
+ logger2.log(
412327
+ `\u2728 Success! Updated Preview base config for the Worker "${workerName}" with ${created.length} created and ${deleted.length} deleted secrets.`
412328
+ );
412329
+ }, "previewBaseConfigSecretBulkHandler")
412330
+ });
412331
+ }
412332
+ });
412333
+
412334
+ // src/preview/base-config/secrets/delete.ts
412335
+ var previewBaseConfigSecretDeleteCommand;
412336
+ var init_delete16 = __esm({
412337
+ "src/preview/base-config/secrets/delete.ts"() {
412338
+ init_import_meta_url();
412339
+ init_dist8();
412340
+ init_create_command();
412341
+ init_dialogs();
412342
+ init_logger();
412343
+ init_user3();
412344
+ init_secrets4();
412345
+ previewBaseConfigSecretDeleteCommand = createCommand({
412346
+ metadata: {
412347
+ description: "Delete a secret variable from the Preview base config",
412348
+ owner: "Workers: Deploy and Config",
412349
+ category: "Compute & AI",
412350
+ status: "private beta"
412351
+ },
412352
+ positionalArgs: ["key"],
412353
+ args: {
412354
+ key: {
412355
+ describe: "The secret name to delete",
412356
+ type: "string",
412357
+ demandOption: true
412358
+ },
412359
+ "skip-confirmation": {
412360
+ describe: "Skip the confirmation prompt",
412361
+ type: "boolean",
412362
+ default: false,
412363
+ alias: "y"
412364
+ },
412365
+ "worker-name": {
412366
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
412367
+ type: "string",
412368
+ requiresArg: true
412369
+ }
412370
+ },
412371
+ behaviour: {
412372
+ suggestSkillsAfterHandler: true
412373
+ },
412374
+ validateArgs: rejectUnsupportedPreviewArgs,
412375
+ handler: /* @__PURE__ */ __name(async function previewBaseConfigSecretDeleteHandler(args, { config: config5 }) {
412376
+ const workerName = resolveWorkerName(args, config5);
412377
+ const accountId = await requireAuth(config5);
412378
+ if (args.skipConfirmation || await confirm2(
412379
+ `Are you sure you want to permanently delete the secret ${args.key} on the Preview base config for the Worker ${workerName}${args.env ? ` (${args.env})` : ""}?`
412380
+ )) {
412381
+ logger2.log(
412382
+ `\u{1F300} Deleting the secret ${args.key} on the Preview base config for the Worker ${workerName}${args.env ? ` (${args.env})` : ""}`
412383
+ );
412384
+ await patchPreviewBaseConfig(config5, accountId, workerName, {
412385
+ env: { [args.key]: null }
412386
+ });
412387
+ logger2.log(
412388
+ `\u2728 Success! Updated Preview base config for the Worker "${workerName}" with deleted secret ${args.key}.`
412389
+ );
412390
+ }
412391
+ }, "previewBaseConfigSecretDeleteHandler")
412392
+ });
412393
+ }
412394
+ });
412395
+
412396
+ // src/preview/base-config/secrets/list.ts
412397
+ function isSecretBinding(binding) {
412398
+ return binding.type === "secret_text";
412399
+ }
412297
412400
  function extractSecretSummaries(env7) {
412298
412401
  return Object.entries(env7 ?? {}).filter(([, binding]) => binding !== null && isSecretBinding(binding)).map(([name2]) => ({ name: name2, type: "secret_text" }));
412299
412402
  }
412300
- function formatPreviewSecrets(workerName, env7) {
412403
+ function formatBaseConfigSecrets(workerName, env7) {
412301
412404
  const secrets = Object.entries(env7 ?? {}).filter(
412302
412405
  ([, binding]) => binding !== null && isSecretBinding(binding)
412303
412406
  );
412304
412407
  const lines = [];
412305
412408
  lines.push(`${source_default.bold.hex("#FFA500")("Worker:")} ${workerName}`);
412306
412409
  lines.push("");
412307
- lines.push(` ${source_default.bold.underline("Previews settings")}`);
412410
+ lines.push(` ${source_default.bold.underline("Preview base config")}`);
412308
412411
  lines.push("");
412309
412412
  lines.push(source_default.bold(" Secrets"));
412310
412413
  if (secrets.length === 0) {
@@ -412326,144 +412429,178 @@ function formatPreviewSecrets(workerName, env7) {
412326
412429
  lines.push("");
412327
412430
  return drawBox(lines);
412328
412431
  }
412329
- async function handlePreviewSecretPutCommand(args, { config: config5 }) {
412330
- const workerName = resolveWorkerName(args, config5);
412331
- const accountId = await requireAuth(config5);
412332
- const secretValue = trimTrailingWhitespace(
412333
- process.stdin.isTTY ? await prompt2("Enter a secret value:", { isSecret: true }) : await readFromStdin()
412334
- );
412335
- const updatedPreviewDefaults = await editWorkerPreviewDefaults(
412336
- config5,
412337
- accountId,
412338
- workerName,
412339
- {
412340
- env: toSecretBindingsPatch({ [args.key]: secretValue })
412341
- }
412342
- );
412343
- logger2.log(
412344
- `
412345
- \u2728 Secret "${args.key}" added to Previews settings for Worker ${source_default.bold.cyan(workerName)}.`
412346
- );
412347
- logger2.log(formatPreviewSecrets(workerName, updatedPreviewDefaults.env));
412348
- }
412349
- async function handlePreviewSecretDeleteCommand(args, { config: config5 }) {
412350
- const workerName = resolveWorkerName(args, config5);
412351
- const accountId = await requireAuth(config5);
412352
- if (!args.skipConfirmation) {
412353
- const confirmed = await confirm2(
412354
- `Are you sure you want to delete the secret "${args.key}" from Previews settings for Worker ${source_default.bold.cyan(workerName)}?`
412355
- );
412356
- if (!confirmed) {
412357
- logger2.log("Aborted.");
412358
- return;
412359
- }
412360
- }
412361
- const updatedPreviewDefaults = await editWorkerPreviewDefaults(
412362
- config5,
412363
- accountId,
412364
- workerName,
412365
- {
412366
- env: {
412367
- [args.key]: null
412368
- }
412369
- }
412370
- );
412371
- logger2.log(
412372
- `
412373
- \u2728 Secret "${args.key}" deleted from Previews settings for Worker ${source_default.bold.cyan(workerName)}.`
412374
- );
412375
- logger2.log(formatPreviewSecrets(workerName, updatedPreviewDefaults.env));
412376
- }
412377
- async function handlePreviewSecretListCommand(args, { config: config5 }) {
412378
- const workerName = resolveWorkerName(args, config5);
412379
- const accountId = await requireAuth(config5);
412380
- const previewDefaults = await getWorkerPreviewDefaults(
412381
- config5,
412382
- accountId,
412383
- workerName
412384
- );
412385
- const secrets = extractSecretSummaries(previewDefaults.env);
412386
- if (args.json) {
412387
- logger2.log(JSON.stringify(secrets, null, 2));
412388
- return;
412389
- }
412390
- logger2.log(formatPreviewSecrets(workerName, previewDefaults.env));
412391
- }
412392
- async function handlePreviewSecretBulkCommand(args, { config: config5 }) {
412393
- const workerName = resolveWorkerName(args, config5);
412394
- const accountId = await requireAuth(config5);
412395
- const result = await parseBulkInputToObject(args.file);
412396
- if (!result) {
412397
- logger2.error("No content found in file, or piped input.");
412398
- return;
412399
- }
412400
- const { content } = result;
412401
- const secretCount = Object.keys(content).length;
412402
- const source = args.file ? `file "${args.file}"` : "stdin";
412403
- const updatedPreviewDefaults = await editWorkerPreviewDefaults(
412404
- config5,
412405
- accountId,
412406
- workerName,
412407
- {
412408
- env: toSecretBindingsPatch(content)
412409
- }
412410
- );
412411
- logger2.log(
412412
- `
412413
- \u2728 Uploaded ${secretCount} secrets from ${source} to Previews settings for Worker ${source_default.bold.cyan(workerName)}.`
412414
- );
412415
- logger2.log(formatPreviewSecrets(workerName, updatedPreviewDefaults.env));
412416
- }
412417
- var init_secret3 = __esm({
412418
- "src/preview/secret.ts"() {
412432
+ var previewBaseConfigSecretListCommand;
412433
+ var init_list21 = __esm({
412434
+ "src/preview/base-config/secrets/list.ts"() {
412419
412435
  init_import_meta_url();
412420
412436
  init_dist8();
412421
412437
  init_dist();
412422
412438
  init_source();
412423
- init_dialogs();
412439
+ init_create_command();
412424
412440
  init_logger();
412425
- init_secret();
412426
412441
  init_user3();
412427
- init_std();
412442
+ init_secrets4();
412428
412443
  __name(isSecretBinding, "isSecretBinding");
412429
- __name(toSecretBindingsPatch, "toSecretBindingsPatch");
412430
412444
  __name(extractSecretSummaries, "extractSecretSummaries");
412431
- __name(formatPreviewSecrets, "formatPreviewSecrets");
412432
- __name(handlePreviewSecretPutCommand, "handlePreviewSecretPutCommand");
412433
- __name(handlePreviewSecretDeleteCommand, "handlePreviewSecretDeleteCommand");
412434
- __name(handlePreviewSecretListCommand, "handlePreviewSecretListCommand");
412435
- __name(handlePreviewSecretBulkCommand, "handlePreviewSecretBulkCommand");
412445
+ __name(formatBaseConfigSecrets, "formatBaseConfigSecrets");
412446
+ previewBaseConfigSecretListCommand = createCommand({
412447
+ metadata: {
412448
+ description: "List all secrets on the Preview base config",
412449
+ owner: "Workers: Deploy and Config",
412450
+ category: "Compute & AI",
412451
+ status: "private beta"
412452
+ },
412453
+ args: {
412454
+ "worker-name": {
412455
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
412456
+ type: "string",
412457
+ requiresArg: true
412458
+ },
412459
+ json: {
412460
+ describe: "Return output as JSON",
412461
+ type: "boolean",
412462
+ default: false
412463
+ }
412464
+ },
412465
+ behaviour: {
412466
+ printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner"),
412467
+ suggestSkillsAfterHandler: /* @__PURE__ */ __name((args) => args.json !== true, "suggestSkillsAfterHandler")
412468
+ },
412469
+ validateArgs: rejectUnsupportedPreviewArgs,
412470
+ handler: /* @__PURE__ */ __name(async function previewBaseConfigSecretListHandler(args, { config: config5 }) {
412471
+ const workerName = resolveWorkerName(args, config5);
412472
+ const accountId = await requireAuth(config5);
412473
+ const baseConfig = await getPreviewBaseConfig(
412474
+ config5,
412475
+ accountId,
412476
+ workerName
412477
+ );
412478
+ const secrets = extractSecretSummaries(baseConfig.env);
412479
+ if (args.json) {
412480
+ logger2.log(JSON.stringify(secrets, null, 2));
412481
+ return;
412482
+ }
412483
+ logger2.log(formatBaseConfigSecrets(workerName, baseConfig.env));
412484
+ }, "previewBaseConfigSecretListHandler")
412485
+ });
412436
412486
  }
412437
412487
  });
412438
412488
 
412439
- // src/preview/settings.ts
412440
- async function handlePreviewSettingsUpdateCommand(args, { config: config5 }) {
412441
- const accountId = await requireAuth(config5);
412442
- await previewSettingsUpdate(accountId, args, config5);
412443
- }
412444
- async function handlePreviewSettingsCommand(args, { config: config5 }) {
412445
- const accountId = await requireAuth(config5);
412446
- await previewSettingsGet(accountId, args, config5);
412447
- }
412448
- var init_settings19 = __esm({
412449
- "src/preview/settings.ts"() {
412489
+ // src/preview/base-config/secrets/put.ts
412490
+ var previewBaseConfigSecretPutCommand;
412491
+ var init_put = __esm({
412492
+ "src/preview/base-config/secrets/put.ts"() {
412493
+ init_import_meta_url();
412494
+ init_dist8();
412495
+ init_create_command();
412496
+ init_dialogs();
412497
+ init_logger();
412498
+ init_user3();
412499
+ init_std();
412500
+ init_secrets5();
412501
+ init_secrets4();
412502
+ previewBaseConfigSecretPutCommand = createCommand({
412503
+ metadata: {
412504
+ description: "Create or update a secret variable on the Preview base config",
412505
+ owner: "Workers: Deploy and Config",
412506
+ category: "Compute & AI",
412507
+ status: "private beta"
412508
+ },
412509
+ positionalArgs: ["key"],
412510
+ args: {
412511
+ key: {
412512
+ describe: "The secret name to be accessible in the Worker",
412513
+ type: "string",
412514
+ demandOption: true
412515
+ },
412516
+ "worker-name": {
412517
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
412518
+ type: "string",
412519
+ requiresArg: true
412520
+ }
412521
+ },
412522
+ behaviour: {
412523
+ suggestSkillsAfterHandler: true
412524
+ },
412525
+ validateArgs: rejectUnsupportedPreviewArgs,
412526
+ handler: /* @__PURE__ */ __name(async function previewBaseConfigSecretPutHandler(args, { config: config5 }) {
412527
+ const workerName = resolveWorkerName(args, config5);
412528
+ const accountId = await requireAuth(config5);
412529
+ const secretValue = trimTrailingWhitespace(
412530
+ process.stdin.isTTY ? await prompt2("Enter a secret value:", { isSecret: true }) : await readFromStdin()
412531
+ );
412532
+ logger2.log(
412533
+ `\u{1F300} Creating the secret for the Preview base config on the Worker "${workerName}"${args.env ? ` (${args.env})` : ""}`
412534
+ );
412535
+ await patchPreviewBaseConfig(config5, accountId, workerName, {
412536
+ env: toSecretBindingsPatch({ [args.key]: secretValue })
412537
+ });
412538
+ logger2.log(
412539
+ `\u2728 Success! Updated Preview base config for the Worker "${workerName}" with secret ${args.key}.`
412540
+ );
412541
+ }, "previewBaseConfigSecretPutHandler")
412542
+ });
412543
+ }
412544
+ });
412545
+
412546
+ // src/preview/delete.ts
412547
+ var previewDeleteCommand;
412548
+ var init_delete17 = __esm({
412549
+ "src/preview/delete.ts"() {
412450
412550
  init_import_meta_url();
412451
412551
  init_dist8();
412552
+ init_create_command();
412452
412553
  init_user3();
412453
- __name(handlePreviewSettingsUpdateCommand, "handlePreviewSettingsUpdateCommand");
412454
- __name(handlePreviewSettingsCommand, "handlePreviewSettingsCommand");
412554
+ previewDeleteCommand = createCommand({
412555
+ metadata: {
412556
+ description: "Delete a Preview and all its deployments",
412557
+ owner: "Workers: Deploy and Config",
412558
+ category: "Compute & AI",
412559
+ status: "private beta"
412560
+ },
412561
+ args: {
412562
+ name: {
412563
+ describe: "Name of the Preview to delete (defaults to current git branch)",
412564
+ type: "string",
412565
+ requiresArg: true
412566
+ },
412567
+ "skip-confirmation": {
412568
+ describe: "Skip the confirmation prompt",
412569
+ type: "boolean",
412570
+ default: false,
412571
+ alias: "y"
412572
+ },
412573
+ "worker-name": {
412574
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
412575
+ type: "string",
412576
+ requiresArg: true
412577
+ }
412578
+ },
412579
+ behaviour: {
412580
+ suggestSkillsAfterHandler: true
412581
+ },
412582
+ handler: /* @__PURE__ */ __name(async function previewDeleteHandler(args, { config: config5 }) {
412583
+ const accountId = await requireAuth(config5);
412584
+ await previewDelete(accountId, args, config5);
412585
+ }, "previewDeleteHandler")
412586
+ });
412455
412587
  }
412456
412588
  });
412457
412589
 
412458
- // src/preview/index.ts
412459
- var previewCommand, previewDeleteCommand, previewSettingsUpdateCommand, previewSettingsCommand, previewSecretNamespace, previewSecretPutCommand, previewSecretDeleteCommand, previewSecretListCommand, previewSecretBulkCommand;
412590
+ // src/preview/preview.ts
412591
+ var previewCommand;
412460
412592
  var init_preview2 = __esm({
412461
- "src/preview/index.ts"() {
412593
+ "src/preview/preview.ts"() {
412462
412594
  init_import_meta_url();
412595
+ init_dist8();
412596
+ init_dist();
412597
+ init_assets5();
412463
412598
  init_create_command();
412464
- init_commands9();
412465
- init_secret3();
412466
- init_settings19();
412599
+ init_entry();
412600
+ init_maybe_build_worker();
412601
+ init_merge_config_args();
412602
+ init_output();
412603
+ init_user3();
412467
412604
  previewCommand = createCommand({
412468
412605
  metadata: {
412469
412606
  description: "\u{1F440} Create a Preview deployment of the current Worker",
@@ -412514,18 +412651,198 @@ var init_preview2 = __esm({
412514
412651
  printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner"),
412515
412652
  suggestSkillsAfterHandler: /* @__PURE__ */ __name((args) => args.json !== true, "suggestSkillsAfterHandler")
412516
412653
  },
412517
- handler: handlePreviewCommand
412654
+ handler: /* @__PURE__ */ __name(async function previewHandler(args, { config: config5 }) {
412655
+ const accountId = await requireAuth(config5);
412656
+ const entry = await getEntry({ script: args.script }, config5, "deploy");
412657
+ const destination = getWranglerTmpDir(entry.projectRoot, "preview");
412658
+ const buildResult = await buildWorker(
412659
+ {
412660
+ entry,
412661
+ name: config5.name,
412662
+ compatibilityDate: config5.compatibility_date,
412663
+ compatibilityFlags: config5.compatibility_flags,
412664
+ uploadSourceMaps: config5.upload_source_maps,
412665
+ jsxFactory: config5.jsx_factory,
412666
+ jsxFragment: config5.jsx_fragment,
412667
+ tsconfig: config5.tsconfig,
412668
+ minify: config5.minify,
412669
+ noBundle: config5.no_bundle ?? false,
412670
+ defines: config5.previews?.define ?? {},
412671
+ alias: { ...config5.alias },
412672
+ doBindings: config5.previews?.durable_objects?.bindings ?? [],
412673
+ workflowBindings: config5.previews?.workflows ?? [],
412674
+ destination,
412675
+ outdir: void 0,
412676
+ metafile: void 0
412677
+ },
412678
+ config5
412679
+ );
412680
+ const assetsOptions = getAssetsOptions({
412681
+ args: { assets: void 0, script: args.script },
412682
+ config: config5
412683
+ });
412684
+ const { preview: previewResource, deployment } = await preview(
412685
+ accountId,
412686
+ args,
412687
+ config5,
412688
+ buildResult,
412689
+ assetsOptions
412690
+ );
412691
+ cleanupDestination(destination);
412692
+ writeOutput({
412693
+ type: "preview",
412694
+ version: 1,
412695
+ worker_name: previewResource.worker_name,
412696
+ preview_id: previewResource.id,
412697
+ preview_name: previewResource.name,
412698
+ preview_slug: previewResource.slug,
412699
+ preview_urls: previewResource.urls,
412700
+ deployment_id: deployment.id,
412701
+ deployment_urls: deployment.urls
412702
+ });
412703
+ }, "previewHandler")
412518
412704
  });
412519
- previewDeleteCommand = createCommand({
412705
+ }
412706
+ });
412707
+
412708
+ // src/preview/secrets/bulk.ts
412709
+ var previewSecretBulkCommand;
412710
+ var init_bulk3 = __esm({
412711
+ "src/preview/secrets/bulk.ts"() {
412712
+ init_import_meta_url();
412713
+ init_dist8();
412714
+ init_source();
412715
+ init_create_command();
412716
+ init_logger();
412717
+ init_secret();
412718
+ init_user3();
412719
+ init_secrets5();
412720
+ previewSecretBulkCommand = createCommand({
412520
412721
  metadata: {
412521
- description: "Delete a Preview and all its deployments",
412722
+ description: "Upload multiple secrets to a Worker Preview and create a new deployment",
412522
412723
  owner: "Workers: Deploy and Config",
412523
412724
  category: "Compute & AI",
412524
412725
  status: "private beta"
412525
412726
  },
412727
+ positionalArgs: ["file"],
412526
412728
  args: {
412729
+ file: {
412730
+ describe: "The file of key-value pairs to upload, as JSON or .env format",
412731
+ type: "string"
412732
+ },
412527
412733
  name: {
412528
- describe: "Name of the Preview to delete (defaults to current git branch)",
412734
+ describe: "Name of the Preview (defaults to current git branch)",
412735
+ type: "string",
412736
+ requiresArg: true
412737
+ },
412738
+ message: {
412739
+ describe: "A descriptive message for this Preview deployment",
412740
+ type: "string",
412741
+ requiresArg: true
412742
+ },
412743
+ tag: {
412744
+ describe: "A tag for this Preview deployment",
412745
+ type: "string",
412746
+ requiresArg: true
412747
+ },
412748
+ "worker-name": {
412749
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
412750
+ type: "string",
412751
+ requiresArg: true
412752
+ }
412753
+ },
412754
+ behaviour: {
412755
+ suggestSkillsAfterHandler: true
412756
+ },
412757
+ handler: /* @__PURE__ */ __name(async function previewSecretBulkHandler(args, { config: config5 }) {
412758
+ const workerName = resolveWorkerName(args, config5);
412759
+ const previewName = resolvePreviewName(args);
412760
+ const accountId = await requireAuth(config5);
412761
+ logger2.log(
412762
+ `\u{1F300} Processing the secrets for the Preview "${previewName}" on the Worker "${workerName}"${args.env ? ` (${args.env})` : ""}`
412763
+ );
412764
+ const result = await parseBulkInputToObject(args.file, true);
412765
+ if (!result) {
412766
+ logger2.error("\u{1F6A8} No content found in file, or piped input.");
412767
+ return;
412768
+ }
412769
+ const { content } = result;
412770
+ const created = Object.keys(content).filter(
412771
+ (name2) => content[name2] !== null
412772
+ );
412773
+ const deleted = Object.keys(content).filter(
412774
+ (name2) => content[name2] === null
412775
+ );
412776
+ const deployment = await patchPreviewDeploymentSecrets(
412777
+ config5,
412778
+ accountId,
412779
+ workerName,
412780
+ previewName,
412781
+ toSecretBindingsPatch(content),
412782
+ {
412783
+ message: args.message ?? `Created ${created.length} and deleted ${deleted.length} secrets`,
412784
+ tag: args.tag
412785
+ },
412786
+ {
412787
+ noDeployment: "preview secret bulk no preview deployment",
412788
+ previewNotFound: "preview secret bulk preview not found"
412789
+ }
412790
+ );
412791
+ for (const name2 of deleted) {
412792
+ logger2.log(`\u{1F4A5} Successfully deleted secret for key: ${name2}`);
412793
+ }
412794
+ for (const name2 of created) {
412795
+ logger2.log(`\u2728 Successfully created secret for key: ${name2}`);
412796
+ }
412797
+ const liveUrls = deployment.urls ?? [];
412798
+ logger2.log(
412799
+ `\u2728 Success! Created Preview deployment ${deployment.id} with ${created.length} created and ${deleted.length} deleted secrets.` + (liveUrls.length > 0 ? `
412800
+ \u27A1\uFE0F Your Preview "${previewName}" is now live at ${liveUrls.map((url7) => source_default.bold.underline(url7)).join(", ")}` : `
412801
+ ${NO_ACTIVE_PREVIEW_URLS_MESSAGE}`)
412802
+ );
412803
+ }, "previewSecretBulkHandler")
412804
+ });
412805
+ }
412806
+ });
412807
+
412808
+ // src/preview/secrets/delete.ts
412809
+ var previewSecretDeleteCommand;
412810
+ var init_delete18 = __esm({
412811
+ "src/preview/secrets/delete.ts"() {
412812
+ init_import_meta_url();
412813
+ init_dist8();
412814
+ init_source();
412815
+ init_create_command();
412816
+ init_dialogs();
412817
+ init_logger();
412818
+ init_user3();
412819
+ init_secrets5();
412820
+ previewSecretDeleteCommand = createCommand({
412821
+ metadata: {
412822
+ description: "Delete a secret variable from a Worker Preview and create a new deployment",
412823
+ owner: "Workers: Deploy and Config",
412824
+ category: "Compute & AI",
412825
+ status: "private beta"
412826
+ },
412827
+ positionalArgs: ["key"],
412828
+ args: {
412829
+ key: {
412830
+ describe: "The secret name to delete",
412831
+ type: "string",
412832
+ demandOption: true
412833
+ },
412834
+ name: {
412835
+ describe: "Name of the Preview (defaults to current git branch)",
412836
+ type: "string",
412837
+ requiresArg: true
412838
+ },
412839
+ message: {
412840
+ describe: "A descriptive message for this Preview deployment",
412841
+ type: "string",
412842
+ requiresArg: true
412843
+ },
412844
+ tag: {
412845
+ describe: "A tag for this Preview deployment",
412529
412846
  type: "string",
412530
412847
  requiresArg: true
412531
412848
  },
@@ -412544,8 +412861,255 @@ var init_preview2 = __esm({
412544
412861
  behaviour: {
412545
412862
  suggestSkillsAfterHandler: true
412546
412863
  },
412547
- handler: handlePreviewDeleteCommand
412864
+ handler: /* @__PURE__ */ __name(async function previewSecretDeleteHandler(args, { config: config5 }) {
412865
+ const workerName = resolveWorkerName(args, config5);
412866
+ const previewName = resolvePreviewName(args);
412867
+ const accountId = await requireAuth(config5);
412868
+ if (args.skipConfirmation || await confirm2(
412869
+ `Are you sure you want to permanently delete the secret ${args.key} on the Preview "${previewName}" for the Worker ${workerName}${args.env ? ` (${args.env})` : ""}?`
412870
+ )) {
412871
+ logger2.log(
412872
+ `\u{1F300} Deleting the secret ${args.key} on the Preview "${previewName}" for the Worker ${workerName}${args.env ? ` (${args.env})` : ""}`
412873
+ );
412874
+ const deployment = await patchPreviewDeploymentSecrets(
412875
+ config5,
412876
+ accountId,
412877
+ workerName,
412878
+ previewName,
412879
+ { [args.key]: null },
412880
+ {
412881
+ message: args.message ?? `Deleted secret "${args.key}"`,
412882
+ tag: args.tag
412883
+ },
412884
+ {
412885
+ noDeployment: "preview secret delete no preview deployment",
412886
+ previewNotFound: "preview secret delete preview not found"
412887
+ }
412888
+ );
412889
+ const liveUrls = deployment.urls ?? [];
412890
+ logger2.log(
412891
+ `\u2728 Success! Created Preview deployment ${deployment.id} with deleted secret ${args.key}.` + (liveUrls.length > 0 ? `
412892
+ \u27A1\uFE0F Your Preview "${previewName}" is now live at ${liveUrls.map((url7) => source_default.bold.underline(url7)).join(", ")}` : `
412893
+ ${NO_ACTIVE_PREVIEW_URLS_MESSAGE}`)
412894
+ );
412895
+ }
412896
+ }, "previewSecretDeleteHandler")
412548
412897
  });
412898
+ }
412899
+ });
412900
+
412901
+ // src/preview/secrets/list.ts
412902
+ function isSecretBinding2(binding) {
412903
+ return binding.type === "secret_text";
412904
+ }
412905
+ function extractSecretSummaries2(env7) {
412906
+ return Object.entries(env7 ?? {}).filter(([, binding]) => binding !== null && isSecretBinding2(binding)).map(([name2]) => ({ name: name2, type: "secret_text" }));
412907
+ }
412908
+ function formatPreviewSecrets(workerName, previewName, env7) {
412909
+ const secrets = Object.entries(env7 ?? {}).filter(
412910
+ ([, binding]) => binding !== null && isSecretBinding2(binding)
412911
+ );
412912
+ const lines = [];
412913
+ lines.push(`${source_default.bold.hex("#FFA500")("Worker:")} ${workerName}`);
412914
+ lines.push(`${source_default.bold.hex("#FFA500")("Preview:")} ${previewName}`);
412915
+ lines.push("");
412916
+ lines.push(` ${source_default.bold.underline("Latest Preview deployment")}`);
412917
+ lines.push("");
412918
+ lines.push(source_default.bold(" Secrets"));
412919
+ if (secrets.length === 0) {
412920
+ lines.push(` ${source_default.dim("(none)")}`);
412921
+ lines.push("");
412922
+ return drawBox(lines);
412923
+ }
412924
+ const typeLabel = getBindingTypeFriendlyName("secret_text");
412925
+ const nameWidth = Math.max(...secrets.map(([name2]) => name2.length));
412926
+ const typeWidth = visibleLength(typeLabel);
412927
+ const valueWidth = Math.max(
412928
+ ...secrets.map(([, binding]) => getBindingValue(binding).length)
412929
+ );
412930
+ for (const [name2, binding] of secrets) {
412931
+ lines.push(
412932
+ ` ${source_default.cyan(padToVisibleWidth(name2, nameWidth))} ${source_default.dim(padToVisibleWidth(typeLabel, typeWidth))} ${padToVisibleWidth(getBindingValue(binding), valueWidth)}`
412933
+ );
412934
+ }
412935
+ lines.push("");
412936
+ return drawBox(lines);
412937
+ }
412938
+ var previewSecretListCommand;
412939
+ var init_list22 = __esm({
412940
+ "src/preview/secrets/list.ts"() {
412941
+ init_import_meta_url();
412942
+ init_dist8();
412943
+ init_dist();
412944
+ init_source();
412945
+ init_create_command();
412946
+ init_logger();
412947
+ init_user3();
412948
+ init_secrets5();
412949
+ __name(isSecretBinding2, "isSecretBinding");
412950
+ __name(extractSecretSummaries2, "extractSecretSummaries");
412951
+ __name(formatPreviewSecrets, "formatPreviewSecrets");
412952
+ previewSecretListCommand = createCommand({
412953
+ metadata: {
412954
+ description: "List all secrets on a Worker Preview's latest deployment",
412955
+ owner: "Workers: Deploy and Config",
412956
+ category: "Compute & AI",
412957
+ status: "private beta"
412958
+ },
412959
+ args: {
412960
+ name: {
412961
+ describe: "Name of the Preview (defaults to current git branch)",
412962
+ type: "string",
412963
+ requiresArg: true
412964
+ },
412965
+ json: {
412966
+ describe: "Return output as JSON",
412967
+ type: "boolean",
412968
+ default: false
412969
+ },
412970
+ "worker-name": {
412971
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
412972
+ type: "string",
412973
+ requiresArg: true
412974
+ }
412975
+ },
412976
+ behaviour: {
412977
+ printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner"),
412978
+ suggestSkillsAfterHandler: /* @__PURE__ */ __name((args) => args.json !== true, "suggestSkillsAfterHandler")
412979
+ },
412980
+ handler: /* @__PURE__ */ __name(async function previewSecretListHandler(args, { config: config5 }) {
412981
+ const workerName = resolveWorkerName(args, config5);
412982
+ const previewName = resolvePreviewName(args);
412983
+ const accountId = await requireAuth(config5);
412984
+ let deployment;
412985
+ try {
412986
+ deployment = await getPreviewDeployment(
412987
+ config5,
412988
+ accountId,
412989
+ workerName,
412990
+ previewName
412991
+ );
412992
+ } catch (e9) {
412993
+ if (e9 instanceof APIError) {
412994
+ if (e9.code === NO_PREVIEW_DEPLOYMENT_GET_ERR_CODE) {
412995
+ throw new UserError(noPreviewDeploymentListMessage(previewName), {
412996
+ telemetryMessage: "preview secret list no preview deployment"
412997
+ });
412998
+ }
412999
+ if (e9.code === PREVIEW_NOT_FOUND_ERR_CODE) {
413000
+ throw new UserError(previewNotFoundMessage(previewName), {
413001
+ telemetryMessage: "preview secret list preview not found"
413002
+ });
413003
+ }
413004
+ }
413005
+ throw e9;
413006
+ }
413007
+ const secrets = extractSecretSummaries2(deployment.env);
413008
+ if (args.json) {
413009
+ logger2.log(JSON.stringify(secrets, null, 2));
413010
+ return;
413011
+ }
413012
+ logger2.log(formatPreviewSecrets(workerName, previewName, deployment.env));
413013
+ }, "previewSecretListHandler")
413014
+ });
413015
+ }
413016
+ });
413017
+
413018
+ // src/preview/secrets/put.ts
413019
+ var previewSecretPutCommand;
413020
+ var init_put2 = __esm({
413021
+ "src/preview/secrets/put.ts"() {
413022
+ init_import_meta_url();
413023
+ init_dist8();
413024
+ init_source();
413025
+ init_create_command();
413026
+ init_dialogs();
413027
+ init_logger();
413028
+ init_user3();
413029
+ init_std();
413030
+ init_secrets5();
413031
+ previewSecretPutCommand = createCommand({
413032
+ metadata: {
413033
+ description: "Create or update a secret variable on a Worker Preview and create a new deployment",
413034
+ owner: "Workers: Deploy and Config",
413035
+ category: "Compute & AI",
413036
+ status: "private beta"
413037
+ },
413038
+ positionalArgs: ["key"],
413039
+ args: {
413040
+ key: {
413041
+ describe: "The secret name to be accessible in the Worker",
413042
+ type: "string",
413043
+ demandOption: true
413044
+ },
413045
+ name: {
413046
+ describe: "Name of the Preview (defaults to current git branch)",
413047
+ type: "string",
413048
+ requiresArg: true
413049
+ },
413050
+ message: {
413051
+ describe: "A descriptive message for this Preview deployment",
413052
+ type: "string",
413053
+ requiresArg: true
413054
+ },
413055
+ tag: {
413056
+ describe: "A tag for this Preview deployment",
413057
+ type: "string",
413058
+ requiresArg: true
413059
+ },
413060
+ "worker-name": {
413061
+ describe: "Name of the Worker to target (defaults to the name in your local config file)",
413062
+ type: "string",
413063
+ requiresArg: true
413064
+ }
413065
+ },
413066
+ behaviour: {
413067
+ suggestSkillsAfterHandler: true
413068
+ },
413069
+ handler: /* @__PURE__ */ __name(async function previewSecretPutHandler(args, { config: config5 }) {
413070
+ const workerName = resolveWorkerName(args, config5);
413071
+ const previewName = resolvePreviewName(args);
413072
+ const accountId = await requireAuth(config5);
413073
+ const secretValue = trimTrailingWhitespace(
413074
+ process.stdin.isTTY ? await prompt2("Enter a secret value:", { isSecret: true }) : await readFromStdin()
413075
+ );
413076
+ logger2.log(
413077
+ `\u{1F300} Creating the secret for the Preview "${previewName}" on the Worker "${workerName}"${args.env ? ` (${args.env})` : ""}`
413078
+ );
413079
+ const deployment = await patchPreviewDeploymentSecrets(
413080
+ config5,
413081
+ accountId,
413082
+ workerName,
413083
+ previewName,
413084
+ toSecretBindingsPatch({ [args.key]: secretValue }),
413085
+ {
413086
+ message: args.message ?? `Updated secret "${args.key}"`,
413087
+ tag: args.tag
413088
+ },
413089
+ {
413090
+ noDeployment: "preview secret put no preview deployment",
413091
+ previewNotFound: "preview secret put preview not found"
413092
+ }
413093
+ );
413094
+ const liveUrls = deployment.urls ?? [];
413095
+ logger2.log(
413096
+ `\u2728 Success! Created Preview deployment ${deployment.id} with secret ${args.key}.` + (liveUrls.length > 0 ? `
413097
+ \u27A1\uFE0F Your Preview "${previewName}" is now live at ${liveUrls.map((url7) => source_default.bold.underline(url7)).join(", ")}` : `
413098
+ ${NO_ACTIVE_PREVIEW_URLS_MESSAGE}`)
413099
+ );
413100
+ }, "previewSecretPutHandler")
413101
+ });
413102
+ }
413103
+ });
413104
+
413105
+ // src/preview/settings.ts
413106
+ var previewSettingsUpdateCommand, previewSettingsCommand;
413107
+ var init_settings19 = __esm({
413108
+ "src/preview/settings.ts"() {
413109
+ init_import_meta_url();
413110
+ init_dist8();
413111
+ init_create_command();
413112
+ init_user3();
412549
413113
  previewSettingsUpdateCommand = createCommand({
412550
413114
  metadata: {
412551
413115
  description: "Update the Worker's Previews settings using the contents of the Wrangler config file",
@@ -412569,7 +413133,10 @@ var init_preview2 = __esm({
412569
413133
  behaviour: {
412570
413134
  suggestSkillsAfterHandler: true
412571
413135
  },
412572
- handler: handlePreviewSettingsUpdateCommand
413136
+ handler: /* @__PURE__ */ __name(async function previewSettingsUpdateHandler(args, { config: config5 }) {
413137
+ const accountId = await requireAuth(config5);
413138
+ await previewSettingsUpdate(accountId, args, config5);
413139
+ }, "previewSettingsUpdateHandler")
412573
413140
  });
412574
413141
  previewSettingsCommand = createCommand({
412575
413142
  metadata: {
@@ -412594,127 +413161,17 @@ var init_preview2 = __esm({
412594
413161
  printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner"),
412595
413162
  suggestSkillsAfterHandler: /* @__PURE__ */ __name((args) => args.json !== true, "suggestSkillsAfterHandler")
412596
413163
  },
412597
- handler: handlePreviewSettingsCommand
412598
- });
412599
- previewSecretNamespace = createNamespace({
412600
- metadata: {
412601
- description: "Manage secrets for Worker Previews",
412602
- owner: "Workers: Deploy and Config",
412603
- category: "Compute & AI",
412604
- status: "private beta"
412605
- }
412606
- });
412607
- previewSecretPutCommand = createCommand({
412608
- metadata: {
412609
- description: "Create or update a secret in the Worker's Previews settings",
412610
- owner: "Workers: Deploy and Config",
412611
- category: "Compute & AI",
412612
- status: "private beta"
412613
- },
412614
- positionalArgs: ["key"],
412615
- args: {
412616
- key: {
412617
- describe: "The secret name to be accessible in the Worker",
412618
- type: "string",
412619
- demandOption: true
412620
- },
412621
- "worker-name": {
412622
- describe: "Name of the Worker to target (defaults to the name in your local config file)",
412623
- type: "string",
412624
- requiresArg: true
412625
- }
412626
- },
412627
- behaviour: {
412628
- suggestSkillsAfterHandler: true
412629
- },
412630
- handler: handlePreviewSecretPutCommand
412631
- });
412632
- previewSecretDeleteCommand = createCommand({
412633
- metadata: {
412634
- description: "Delete a secret from the Worker's Previews settings",
412635
- owner: "Workers: Deploy and Config",
412636
- category: "Compute & AI",
412637
- status: "private beta"
412638
- },
412639
- positionalArgs: ["key"],
412640
- args: {
412641
- key: {
412642
- describe: "The secret name to delete",
412643
- type: "string",
412644
- demandOption: true
412645
- },
412646
- "skip-confirmation": {
412647
- describe: "Skip the confirmation prompt",
412648
- type: "boolean",
412649
- default: false,
412650
- alias: "y"
412651
- },
412652
- "worker-name": {
412653
- describe: "Name of the Worker to target (defaults to the name in your local config file)",
412654
- type: "string",
412655
- requiresArg: true
412656
- }
412657
- },
412658
- behaviour: {
412659
- suggestSkillsAfterHandler: true
412660
- },
412661
- handler: handlePreviewSecretDeleteCommand
412662
- });
412663
- previewSecretListCommand = createCommand({
412664
- metadata: {
412665
- description: "List all secrets in the Worker's Previews settings",
412666
- owner: "Workers: Deploy and Config",
412667
- category: "Compute & AI",
412668
- status: "private beta"
412669
- },
412670
- args: {
412671
- json: {
412672
- describe: "Return output as JSON",
412673
- type: "boolean",
412674
- default: false
412675
- },
412676
- "worker-name": {
412677
- describe: "Name of the Worker to target (defaults to the name in your local config file)",
412678
- type: "string",
412679
- requiresArg: true
412680
- }
412681
- },
412682
- behaviour: {
412683
- printBanner: /* @__PURE__ */ __name((args) => args.json !== true, "printBanner"),
412684
- suggestSkillsAfterHandler: /* @__PURE__ */ __name((args) => args.json !== true, "suggestSkillsAfterHandler")
412685
- },
412686
- handler: handlePreviewSecretListCommand
412687
- });
412688
- previewSecretBulkCommand = createCommand({
412689
- metadata: {
412690
- description: "Upload multiple secrets to the Worker's Previews settings",
412691
- owner: "Workers: Deploy and Config",
412692
- category: "Compute & AI",
412693
- status: "private beta"
412694
- },
412695
- positionalArgs: ["file"],
412696
- args: {
412697
- file: {
412698
- describe: "The file of key-value pairs to upload, as JSON or .env format",
412699
- type: "string"
412700
- },
412701
- "worker-name": {
412702
- describe: "Name of the Worker to target (defaults to the name in your local config file)",
412703
- type: "string",
412704
- requiresArg: true
412705
- }
412706
- },
412707
- behaviour: {
412708
- suggestSkillsAfterHandler: true
412709
- },
412710
- handler: handlePreviewSecretBulkCommand
413164
+ handler: /* @__PURE__ */ __name(async function previewSettingsHandler(args, { config: config5 }) {
413165
+ const accountId = await requireAuth(config5);
413166
+ await previewSettingsGet(accountId, args, config5);
413167
+ }, "previewSettingsHandler")
412711
413168
  });
412712
413169
  }
412713
413170
  });
412714
413171
 
412715
413172
  // src/queues/cli/commands/index.ts
412716
413173
  var queuesNamespace;
412717
- var init_commands10 = __esm({
413174
+ var init_commands9 = __esm({
412718
413175
  "src/queues/cli/commands/index.ts"() {
412719
413176
  init_import_meta_url();
412720
413177
  init_create_command();
@@ -413058,7 +413515,7 @@ function mapHttpConsumerForDisplay(consumer) {
413058
413515
  };
413059
413516
  }
413060
413517
  var queuesConsumerHttpListCommand;
413061
- var init_list21 = __esm({
413518
+ var init_list23 = __esm({
413062
413519
  "src/queues/cli/commands/consumer/http-pull/list.ts"() {
413063
413520
  init_import_meta_url();
413064
413521
  init_create_command();
@@ -413151,7 +413608,7 @@ function mapWorkerConsumerForDisplay(consumer) {
413151
413608
  };
413152
413609
  }
413153
413610
  var queuesConsumerWorkerListCommand;
413154
- var init_list22 = __esm({
413611
+ var init_list24 = __esm({
413155
413612
  "src/queues/cli/commands/consumer/worker/list.ts"() {
413156
413613
  init_import_meta_url();
413157
413614
  init_create_command();
@@ -413200,14 +413657,14 @@ var init_list22 = __esm({
413200
413657
 
413201
413658
  // src/queues/cli/commands/consumer/list.ts
413202
413659
  var queuesConsumerListCommand;
413203
- var init_list23 = __esm({
413660
+ var init_list25 = __esm({
413204
413661
  "src/queues/cli/commands/consumer/list.ts"() {
413205
413662
  init_import_meta_url();
413206
413663
  init_create_command();
413207
413664
  init_logger();
413208
413665
  init_client14();
413209
- init_list21();
413210
- init_list22();
413666
+ init_list23();
413667
+ init_list24();
413211
413668
  queuesConsumerListCommand = createCommand({
413212
413669
  metadata: {
413213
413670
  description: "List consumers for a queue",
@@ -413546,7 +414003,7 @@ var init_create17 = __esm({
413546
414003
 
413547
414004
  // src/queues/cli/commands/delete.ts
413548
414005
  var queuesDeleteCommand;
413549
- var init_delete16 = __esm({
414006
+ var init_delete19 = __esm({
413550
414007
  "src/queues/cli/commands/delete.ts"() {
413551
414008
  init_import_meta_url();
413552
414009
  init_create_command();
@@ -413639,7 +414096,7 @@ curl "https://api.cloudflare.com/client/v4/accounts/${accountId || "<add your ac
413639
414096
 
413640
414097
  // src/queues/cli/commands/list.ts
413641
414098
  var queuesListCommand;
413642
- var init_list24 = __esm({
414099
+ var init_list26 = __esm({
413643
414100
  "src/queues/cli/commands/list.ts"() {
413644
414101
  init_import_meta_url();
413645
414102
  init_create_command();
@@ -413823,6 +414280,7 @@ var init_subscription_types = __esm({
413823
414280
  EventSourceType = /* @__PURE__ */ ((EventSourceType2) => {
413824
414281
  EventSourceType2["ARTIFACTS"] = "artifacts";
413825
414282
  EventSourceType2["ARTIFACTS_REPO"] = "artifacts.repo";
414283
+ EventSourceType2["EMAIL_SENDING"] = "email.sending";
413826
414284
  EventSourceType2["IMAGES"] = "images";
413827
414285
  EventSourceType2["KV"] = "kv";
413828
414286
  EventSourceType2["R2"] = "r2";
@@ -413844,6 +414302,24 @@ function parseSourceArgument(source, args) {
413844
414302
  return { type: "artifacts" /* ARTIFACTS */ };
413845
414303
  case "artifacts.repo" /* ARTIFACTS_REPO */:
413846
414304
  return { type: "artifacts.repo" /* ARTIFACTS_REPO */ };
414305
+ case "email.sending" /* EMAIL_SENDING */:
414306
+ if (!args.zoneId) {
414307
+ throw new UserError(
414308
+ `--zone-id is required when using source '${"email.sending" /* EMAIL_SENDING */}'`,
414309
+ { telemetryMessage: "queues subscription create missing zone id" }
414310
+ );
414311
+ }
414312
+ if (!args.domain) {
414313
+ throw new UserError(
414314
+ `--domain is required when using source '${"email.sending" /* EMAIL_SENDING */}'`,
414315
+ { telemetryMessage: "queues subscription create missing domain" }
414316
+ );
414317
+ }
414318
+ return {
414319
+ type: "email.sending" /* EMAIL_SENDING */,
414320
+ zone_id: args.zoneId,
414321
+ domain: args.domain
414322
+ };
413847
414323
  case "images" /* IMAGES */:
413848
414324
  return { type: "images" /* IMAGES */ };
413849
414325
  case "kv" /* KV */:
@@ -413951,13 +414427,23 @@ var init_create18 = __esm({
413951
414427
  "workflow-name": {
413952
414428
  describe: "Workflow name (required for workflows.workflow source)",
413953
414429
  type: "string"
414430
+ },
414431
+ "zone-id": {
414432
+ describe: "Zone ID (required for email.sending source)",
414433
+ type: "string"
414434
+ },
414435
+ domain: {
414436
+ describe: "Sending domain \u2014 zone apex or verified subdomain (required for email.sending source)",
414437
+ type: "string"
413954
414438
  }
413955
414439
  },
413956
414440
  async handler(args, { config: config5 }) {
413957
414441
  const source = parseSourceArgument(args.source, {
413958
414442
  modelName: args.modelName,
413959
414443
  workerName: args.workerName,
413960
- workflowName: args.workflowName
414444
+ workflowName: args.workflowName,
414445
+ zoneId: args.zoneId,
414446
+ domain: args.domain
413961
414447
  });
413962
414448
  const events8 = args.events.split(",").map((event) => event.trim()).filter(Boolean);
413963
414449
  if (events8.length === 0) {
@@ -413992,7 +414478,7 @@ var init_create18 = __esm({
413992
414478
 
413993
414479
  // src/queues/cli/commands/subscription/delete.ts
413994
414480
  var queuesSubscriptionDeleteCommand;
413995
- var init_delete17 = __esm({
414481
+ var init_delete20 = __esm({
413996
414482
  "src/queues/cli/commands/subscription/delete.ts"() {
413997
414483
  init_import_meta_url();
413998
414484
  init_create_command();
@@ -414055,6 +414541,8 @@ function getSourceType(source) {
414055
414541
  }
414056
414542
  function getSourceResource(source) {
414057
414543
  switch (source.type) {
414544
+ case "email.sending" /* EMAIL_SENDING */:
414545
+ return source.domain;
414058
414546
  case "workersAi.model" /* WORKERS_AI_MODEL */:
414059
414547
  return source.model_name;
414060
414548
  case "workersBuilds.worker" /* WORKERS_BUILDS_WORKER */:
@@ -414142,7 +414630,7 @@ var init_get13 = __esm({
414142
414630
 
414143
414631
  // src/queues/cli/commands/subscription/list.ts
414144
414632
  var queuesSubscriptionListCommand;
414145
- var init_list25 = __esm({
414633
+ var init_list27 = __esm({
414146
414634
  "src/queues/cli/commands/subscription/list.ts"() {
414147
414635
  init_import_meta_url();
414148
414636
  init_create_command();
@@ -417270,7 +417758,7 @@ function logBulkProgress2(label, index, total) {
417270
417758
  );
417271
417759
  }
417272
417760
  var formatNumber2;
417273
- var init_bulk2 = __esm({
417761
+ var init_bulk4 = __esm({
417274
417762
  "src/r2/helpers/bulk.ts"() {
417275
417763
  init_import_meta_url();
417276
417764
  init_dist();
@@ -417363,10 +417851,11 @@ async function deleteR2Object(complianceConfig, accountId, bucketName, objectNam
417363
417851
  async function usingLocalBucket(persistTo, config5, bucketName, closure) {
417364
417852
  const persist = getLocalPersistencePath(persistTo, config5);
417365
417853
  const resourcePersistencePath = getDefaultPersistRoot(persist);
417366
- const mf = new miniflare.Miniflare({
417367
- modules: true,
417368
- // TODO(soon): import `reduceError()` from `miniflare:shared`
417369
- script: `
417854
+ const mf = new miniflare.Miniflare(
417855
+ miniflare.convertV4MiniflareOptions({
417856
+ modules: true,
417857
+ // TODO(soon): import `reduceError()` from `miniflare:shared`
417858
+ script: `
417370
417859
  function reduceError(e) {
417371
417860
  return {
417372
417861
  name: e?.name,
@@ -417394,9 +417883,10 @@ async function usingLocalBucket(persistTo, config5, bucketName, closure) {
417394
417883
  }
417395
417884
  }
417396
417885
  }`,
417397
- resourcePersistencePath,
417398
- r2Buckets: { BUCKET: bucketName }
417399
- });
417886
+ resourcePersistencePath,
417887
+ r2Buckets: { BUCKET: bucketName }
417888
+ })
417889
+ );
417400
417890
  const bucket = await mf.getR2Bucket("BUCKET");
417401
417891
  try {
417402
417892
  return await closure(bucket, mf);
@@ -417460,7 +417950,7 @@ var init_object3 = __esm({
417460
417950
  init_logger();
417461
417951
  init_user3();
417462
417952
  init_is_local();
417463
- init_bulk2();
417953
+ init_bulk4();
417464
417954
  init_misc2();
417465
417955
  init_object2();
417466
417956
  r2ObjectNamespace = createNamespace({
@@ -419863,7 +420353,7 @@ To run this tunnel, configure its ingress rules in the Cloudflare dashboard, the
419863
420353
 
419864
420354
  // src/tunnel/delete.ts
419865
420355
  var tunnelDeleteCommand;
419866
- var init_delete18 = __esm({
420356
+ var init_delete21 = __esm({
419867
420357
  "src/tunnel/delete.ts"() {
419868
420358
  init_import_meta_url();
419869
420359
  init_create_command();
@@ -419974,7 +420464,7 @@ Tunnel Information:`);
419974
420464
 
419975
420465
  // src/tunnel/list.ts
419976
420466
  var tunnelListCommand;
419977
- var init_list26 = __esm({
420467
+ var init_list28 = __esm({
419978
420468
  "src/tunnel/list.ts"() {
419979
420469
  init_import_meta_url();
419980
420470
  init_create_command();
@@ -420555,7 +421045,7 @@ var init_create20 = __esm({
420555
421045
 
420556
421046
  // src/turnstile/delete.ts
420557
421047
  var turnstileWidgetDeleteCommand;
420558
- var init_delete19 = __esm({
421048
+ var init_delete22 = __esm({
420559
421049
  "src/turnstile/delete.ts"() {
420560
421050
  init_import_meta_url();
420561
421051
  init_dist();
@@ -420700,7 +421190,7 @@ function widgetRowForTable(widget) {
420700
421190
  };
420701
421191
  }
420702
421192
  var turnstileWidgetListCommand;
420703
- var init_list27 = __esm({
421193
+ var init_list29 = __esm({
420704
421194
  "src/turnstile/list.ts"() {
420705
421195
  init_import_meta_url();
420706
421196
  init_dist();
@@ -421088,7 +421578,7 @@ var init_whoami = __esm({
421088
421578
 
421089
421579
  // src/user/commands.ts
421090
421580
  var oauthArgs, loginCommand, logoutCommand, whoamiCommand, authNamespace, authTokenCommand, authKeyringCommand;
421091
- var init_commands11 = __esm({
421581
+ var init_commands10 = __esm({
421092
421582
  "src/user/commands.ts"() {
421093
421583
  init_import_meta_url();
421094
421584
  init_dist2();
@@ -421459,7 +421949,7 @@ var init_profiles3 = __esm({
421459
421949
  init_dist();
421460
421950
  init_create_command();
421461
421951
  init_logger();
421462
- init_commands11();
421952
+ init_commands10();
421463
421953
  init_user2();
421464
421954
  __name(assertNoEnvCredentials, "assertNoEnvCredentials");
421465
421955
  __name(rejectProfileFlag, "rejectProfileFlag");
@@ -422209,7 +422699,7 @@ var init_createMetadataIndex = __esm({
422209
422699
 
422210
422700
  // src/vectorize/delete.ts
422211
422701
  var vectorizeDeleteCommand;
422212
- var init_delete20 = __esm({
422702
+ var init_delete23 = __esm({
422213
422703
  "src/vectorize/delete.ts"() {
422214
422704
  init_import_meta_url();
422215
422705
  init_create_command();
@@ -422653,7 +423143,7 @@ var init_insert = __esm({
422653
423143
 
422654
423144
  // src/vectorize/list.ts
422655
423145
  var vectorizeListCommand;
422656
- var init_list28 = __esm({
423146
+ var init_list30 = __esm({
422657
423147
  "src/vectorize/list.ts"() {
422658
423148
  init_import_meta_url();
422659
423149
  init_create_command();
@@ -423879,7 +424369,7 @@ function formatTrigger(trigger) {
423879
424369
  }
423880
424370
  }
423881
424371
  var BLANK_INPUT3, VERSION_LIST_LIMIT, versionsListCommand;
423882
- var init_list29 = __esm({
424372
+ var init_list31 = __esm({
423883
424373
  "src/versions/list.ts"() {
423884
424374
  init_import_meta_url();
423885
424375
  init_dist3();
@@ -423964,7 +424454,7 @@ function getDeploymentSource(deployment) {
423964
424454
  });
423965
424455
  }
423966
424456
  var BLANK_INPUT4, deploymentsListCommand;
423967
- var init_list30 = __esm({
424457
+ var init_list32 = __esm({
423968
424458
  "src/versions/deployments/list.ts"() {
423969
424459
  init_import_meta_url();
423970
424460
  init_dist3();
@@ -423975,7 +424465,7 @@ var init_list30 = __esm({
423975
424465
  init_user3();
423976
424466
  init_render_labelled_values();
423977
424467
  init_api2();
423978
- init_list29();
424468
+ init_list31();
423979
424469
  BLANK_INPUT4 = "-";
423980
424470
  deploymentsListCommand = createCommand({
423981
424471
  metadata: {
@@ -424082,7 +424572,7 @@ var init_status3 = __esm({
424082
424572
  init_user3();
424083
424573
  init_render_labelled_values();
424084
424574
  init_api2();
424085
- init_list30();
424575
+ init_list32();
424086
424576
  BLANK_INPUT5 = "-";
424087
424577
  deploymentsStatusCommand = createCommand({
424088
424578
  metadata: {
@@ -424439,7 +424929,7 @@ async function patchLatestWorkerVersionWithSecrets({
424439
424929
  }
424440
424930
  }
424441
424931
  var versionsSecretNamespace, NO_VERSIONS_ERR_CODE, NO_VERSIONS_MESSAGE;
424442
- var init_secrets4 = __esm({
424932
+ var init_secrets6 = __esm({
424443
424933
  "src/versions/secrets/index.ts"() {
424444
424934
  init_import_meta_url();
424445
424935
  init_dist();
@@ -424461,7 +424951,7 @@ var init_secrets4 = __esm({
424461
424951
 
424462
424952
  // src/versions/secrets/bulk.ts
424463
424953
  var versionsSecretBulkCommand;
424464
- var init_bulk3 = __esm({
424954
+ var init_bulk5 = __esm({
424465
424955
  "src/versions/secrets/bulk.ts"() {
424466
424956
  init_import_meta_url();
424467
424957
  init_dist();
@@ -424471,7 +424961,7 @@ var init_bulk3 = __esm({
424471
424961
  init_secret();
424472
424962
  init_user3();
424473
424963
  init_getLegacyScriptName();
424474
- init_secrets4();
424964
+ init_secrets6();
424475
424965
  versionsSecretBulkCommand = createCommand({
424476
424966
  metadata: {
424477
424967
  description: "Create or update a secret variable for a Worker",
@@ -424560,7 +425050,7 @@ var init_bulk3 = __esm({
424560
425050
 
424561
425051
  // src/versions/secrets/delete.ts
424562
425052
  var versionsSecretDeleteCommand;
424563
- var init_delete21 = __esm({
425053
+ var init_delete24 = __esm({
424564
425054
  "src/versions/secrets/delete.ts"() {
424565
425055
  init_import_meta_url();
424566
425056
  init_dist();
@@ -424569,7 +425059,7 @@ var init_delete21 = __esm({
424569
425059
  init_logger();
424570
425060
  init_user3();
424571
425061
  init_getLegacyScriptName();
424572
- init_secrets4();
425062
+ init_secrets6();
424573
425063
  versionsSecretDeleteCommand = createCommand({
424574
425064
  metadata: {
424575
425065
  description: "Delete a secret variable from a Worker",
@@ -424648,7 +425138,7 @@ var init_delete21 = __esm({
424648
425138
 
424649
425139
  // src/versions/secrets/list.ts
424650
425140
  var versionsSecretsListCommand;
424651
- var init_list31 = __esm({
425141
+ var init_list33 = __esm({
424652
425142
  "src/versions/secrets/list.ts"() {
424653
425143
  init_import_meta_url();
424654
425144
  init_dist();
@@ -424748,7 +425238,7 @@ var init_list31 = __esm({
424748
425238
 
424749
425239
  // src/versions/secrets/put.ts
424750
425240
  var versionsSecretPutCommand;
424751
- var init_put = __esm({
425241
+ var init_put3 = __esm({
424752
425242
  "src/versions/secrets/put.ts"() {
424753
425243
  init_import_meta_url();
424754
425244
  init_dist();
@@ -424759,7 +425249,7 @@ var init_put = __esm({
424759
425249
  init_user3();
424760
425250
  init_getLegacyScriptName();
424761
425251
  init_std();
424762
- init_secrets4();
425252
+ init_secrets6();
424763
425253
  versionsSecretPutCommand = createCommand({
424764
425254
  metadata: {
424765
425255
  description: "Create or update a secret variable for a Worker",
@@ -424955,7 +425445,7 @@ var init_view3 = __esm({
424955
425445
  init_print_bindings();
424956
425446
  init_render_labelled_values();
424957
425447
  init_api2();
424958
- init_list29();
425448
+ init_list31();
424959
425449
  BLANK_INPUT6 = "-";
424960
425450
  versionsViewCommand = createCommand({
424961
425451
  metadata: {
@@ -425555,7 +426045,7 @@ var init_create22 = __esm({
425555
426045
 
425556
426046
  // src/vpc/delete.ts
425557
426047
  var vpcServiceDeleteCommand;
425558
- var init_delete22 = __esm({
426048
+ var init_delete25 = __esm({
425559
426049
  "src/vpc/delete.ts"() {
425560
426050
  init_import_meta_url();
425561
426051
  init_create_command();
@@ -425621,7 +426111,7 @@ var init_get16 = __esm({
425621
426111
 
425622
426112
  // src/vpc/list.ts
425623
426113
  var vpcServiceListCommand;
425624
- var init_list32 = __esm({
426114
+ var init_list34 = __esm({
425625
426115
  "src/vpc/list.ts"() {
425626
426116
  init_import_meta_url();
425627
426117
  init_create_command();
@@ -425913,7 +426403,7 @@ var init_local = __esm({
425913
426403
 
425914
426404
  // src/workflows/commands/delete.ts
425915
426405
  var workflowsDeleteCommand;
425916
- var init_delete23 = __esm({
426406
+ var init_delete26 = __esm({
425917
426407
  "src/workflows/commands/delete.ts"() {
425918
426408
  init_import_meta_url();
425919
426409
  init_cfetch();
@@ -429165,7 +429655,7 @@ var init_describe2 = __esm({
429165
429655
 
429166
429656
  // src/workflows/commands/instances/list.ts
429167
429657
  var workflowsInstancesListCommand;
429168
- var init_list33 = __esm({
429658
+ var init_list35 = __esm({
429169
429659
  "src/workflows/commands/instances/list.ts"() {
429170
429660
  init_import_meta_url();
429171
429661
  init_cfetch();
@@ -429720,7 +430210,7 @@ var init_terminate_all = __esm({
429720
430210
 
429721
430211
  // src/workflows/commands/list.ts
429722
430212
  var workflowsListCommand;
429723
- var init_list34 = __esm({
430213
+ var init_list36 = __esm({
429724
430214
  "src/workflows/commands/list.ts"() {
429725
430215
  init_import_meta_url();
429726
430216
  init_cfetch();
@@ -430170,6 +430660,30 @@ function createCLIParser(argv) {
430170
430660
  {
430171
430661
  command: "wrangler preview secret bulk",
430172
430662
  definition: previewSecretBulkCommand
430663
+ },
430664
+ {
430665
+ command: "wrangler preview base-config",
430666
+ definition: previewBaseConfigNamespace
430667
+ },
430668
+ {
430669
+ command: "wrangler preview base-config secret",
430670
+ definition: previewBaseConfigSecretNamespace
430671
+ },
430672
+ {
430673
+ command: "wrangler preview base-config secret put",
430674
+ definition: previewBaseConfigSecretPutCommand
430675
+ },
430676
+ {
430677
+ command: "wrangler preview base-config secret delete",
430678
+ definition: previewBaseConfigSecretDeleteCommand
430679
+ },
430680
+ {
430681
+ command: "wrangler preview base-config secret list",
430682
+ definition: previewBaseConfigSecretListCommand
430683
+ },
430684
+ {
430685
+ command: "wrangler preview base-config secret bulk",
430686
+ definition: previewBaseConfigSecretBulkCommand
430173
430687
  }
430174
430688
  ]);
430175
430689
  registry5.registerNamespace("preview");
@@ -432056,29 +432570,42 @@ var init_src2 = __esm({
432056
432570
  init_get12();
432057
432571
  init_list20();
432058
432572
  init_update8();
432573
+ init_base_config();
432574
+ init_secrets4();
432575
+ init_bulk2();
432576
+ init_delete16();
432577
+ init_list21();
432578
+ init_put();
432579
+ init_delete17();
432059
432580
  init_preview2();
432060
- init_commands10();
432581
+ init_secrets5();
432582
+ init_bulk3();
432583
+ init_delete18();
432584
+ init_list22();
432585
+ init_put2();
432586
+ init_settings19();
432587
+ init_commands9();
432061
432588
  init_consumer();
432062
432589
  init_http_pull();
432063
432590
  init_add();
432064
- init_list21();
432065
- init_remove();
432066
432591
  init_list23();
432592
+ init_remove();
432593
+ init_list25();
432067
432594
  init_worker();
432068
432595
  init_add2();
432069
- init_list22();
432596
+ init_list24();
432070
432597
  init_remove2();
432071
432598
  init_create17();
432072
- init_delete16();
432599
+ init_delete19();
432073
432600
  init_info3();
432074
- init_list24();
432601
+ init_list26();
432075
432602
  init_pause_resume();
432076
432603
  init_purge2();
432077
432604
  init_subscription();
432078
432605
  init_create18();
432079
- init_delete17();
432606
+ init_delete20();
432080
432607
  init_get13();
432081
- init_list25();
432608
+ init_list27();
432082
432609
  init_update9();
432083
432610
  init_update10();
432084
432611
  init_r22();
@@ -432102,27 +432629,27 @@ var init_src2 = __esm({
432102
432629
  init_tail2();
432103
432630
  init_triggers();
432104
432631
  init_create19();
432105
- init_delete18();
432632
+ init_delete21();
432106
432633
  init_tunnel();
432107
432634
  init_info4();
432108
- init_list26();
432635
+ init_list28();
432109
432636
  init_quick_start();
432110
432637
  init_run();
432111
432638
  init_create20();
432112
- init_delete19();
432639
+ init_delete22();
432113
432640
  init_get14();
432114
432641
  init_turnstile2();
432115
- init_list27();
432642
+ init_list29();
432116
432643
  init_update11();
432117
432644
  init_type_generation();
432118
- init_commands11();
432645
+ init_commands10();
432119
432646
  init_profiles3();
432120
432647
  init_constants4();
432121
432648
  init_did_you_mean();
432122
432649
  init_log_file();
432123
432650
  init_create21();
432124
432651
  init_createMetadataIndex();
432125
- init_delete20();
432652
+ init_delete23();
432126
432653
  init_deleteByIds();
432127
432654
  init_deleteMetadataIndex();
432128
432655
  init_get15();
@@ -432130,7 +432657,7 @@ var init_src2 = __esm({
432130
432657
  init_vectorize2();
432131
432658
  init_info5();
432132
432659
  init_insert();
432133
- init_list28();
432660
+ init_list30();
432134
432661
  init_listMetadataIndex();
432135
432662
  init_listVectors();
432136
432663
  init_query();
@@ -432138,38 +432665,38 @@ var init_src2 = __esm({
432138
432665
  init_versions8();
432139
432666
  init_deploy5();
432140
432667
  init_deployments5();
432141
- init_list30();
432668
+ init_list32();
432142
432669
  init_status3();
432143
432670
  init_view2();
432144
- init_list29();
432145
- init_rollback();
432146
- init_secrets4();
432147
- init_bulk3();
432148
- init_delete21();
432149
432671
  init_list31();
432150
- init_put();
432672
+ init_rollback();
432673
+ init_secrets6();
432674
+ init_bulk5();
432675
+ init_delete24();
432676
+ init_list33();
432677
+ init_put3();
432151
432678
  init_upload5();
432152
432679
  init_view3();
432153
432680
  init_create22();
432154
- init_delete22();
432681
+ init_delete25();
432155
432682
  init_get16();
432156
432683
  init_vpc();
432157
- init_list32();
432684
+ init_list34();
432158
432685
  init_update12();
432159
432686
  init_websearch();
432160
432687
  init_search3();
432161
432688
  init_workflows2();
432162
- init_delete23();
432689
+ init_delete26();
432163
432690
  init_describe();
432164
432691
  init_describe2();
432165
- init_list33();
432692
+ init_list35();
432166
432693
  init_pause();
432167
432694
  init_restart();
432168
432695
  init_resume();
432169
432696
  init_send_event2();
432170
432697
  init_terminate();
432171
432698
  init_terminate_all();
432172
- init_list34();
432699
+ init_list36();
432173
432700
  init_trigger();
432174
432701
  init_wrangler_banner();
432175
432702
  if (proxy) {
@@ -433862,12 +434389,13 @@ var init_LocalRuntimeController = __esm({
433862
434389
  if (id !== this.#currentBundleId) {
433863
434390
  return;
433864
434391
  }
434392
+ const miniflareOptions = miniflare.convertV4MiniflareOptions(options);
433865
434393
  if (this.#mf === void 0) {
433866
434394
  logger2.log(source_default.dim("\u2394 Starting local server..."));
433867
- this.#mf = new miniflare.Miniflare(options);
434395
+ this.#mf = new miniflare.Miniflare(miniflareOptions);
433868
434396
  } else {
433869
434397
  logger2.log(source_default.dim("\u2394 Reloading local server..."));
433870
- await this.#mf.setOptions(options);
434398
+ await this.#mf.setOptions(miniflareOptions);
433871
434399
  logger2.log(source_default.dim("\u2394 Local server updated and ready"));
433872
434400
  }
433873
434401
  const userWorkerUrl = await this.#mf.ready;
@@ -434158,12 +434686,13 @@ var init_MultiworkerRuntimeController = __esm({
434158
434686
  return;
434159
434687
  }
434160
434688
  const mergedMfOptions = ensureMatchingSql(this.#mergedMfOptions());
434689
+ const miniflareOptions = miniflare.convertV4MiniflareOptions(mergedMfOptions);
434161
434690
  if (this.#mf === void 0) {
434162
434691
  logger2.log(source_default.dim("\u2394 Starting local server..."));
434163
- this.#mf = new miniflare.Miniflare(mergedMfOptions);
434692
+ this.#mf = new miniflare.Miniflare(miniflareOptions);
434164
434693
  } else {
434165
434694
  logger2.log(source_default.dim("\u2394 Reloading local server..."));
434166
- await this.#mf.setOptions(mergedMfOptions);
434695
+ await this.#mf.setOptions(miniflareOptions);
434167
434696
  logger2.log(source_default.dim("\u2394 Local server updated and ready"));
434168
434697
  }
434169
434698
  const userWorkerUrl = await this.#mf.ready;
@@ -439189,6 +439718,59 @@ function createTestHarness(options) {
439189
439718
  return normalizedConfig;
439190
439719
  }
439191
439720
  __name(normalizeInlineWorkerConfig, "normalizeInlineWorkerConfig");
439721
+ function resolveWorkerConfig(input, root) {
439722
+ if ("config" in input) {
439723
+ return normalizeInlineWorkerConfig(input.config, root);
439724
+ }
439725
+ const configPath = resolvePath3(root, input.configPath);
439726
+ if (input.prebuiltWorkerDir === void 0) {
439727
+ return configPath;
439728
+ }
439729
+ const config5 = runWithLogLevel(
439730
+ "none",
439731
+ () => readConfig({ config: configPath, env: input.env })
439732
+ );
439733
+ if (config5.main === void 0) {
439734
+ throw new UserError(
439735
+ "The `prebuiltWorkerDir` option only loads a prebuilt Worker script. This Wrangler config is assets-only, so the test harness loads its assets from `assets.directory` instead. Remove `prebuiltWorkerDir` from the test harness configuration.",
439736
+ {
439737
+ telemetryMessage: "test harness prebuilt assets only worker unsupported"
439738
+ }
439739
+ );
439740
+ }
439741
+ const prebuiltWorkerDir = resolvePath3(root, input.prebuiltWorkerDir);
439742
+ const envOption = input.env ? ` --env ${JSON.stringify(input.env)}` : "";
439743
+ const commandConfigPath = typeof input.configPath === "string" ? input.configPath : path31__namespace.default.relative(root, configPath) || ".";
439744
+ const commandOutDir = typeof input.prebuiltWorkerDir === "string" ? input.prebuiltWorkerDir : path31__namespace.default.relative(root, prebuiltWorkerDir) || ".";
439745
+ const buildCommand3 = `wrangler deploy --dry-run --config ${JSON.stringify(commandConfigPath)}${envOption} --outdir ${JSON.stringify(commandOutDir)}`;
439746
+ if (!fs6__namespace.default.existsSync(prebuiltWorkerDir)) {
439747
+ throw new UserError(
439748
+ `The \`prebuiltWorkerDir\` directory "${commandOutDir}" does not exist. Build the Worker first by running \`${buildCommand3}\`.`,
439749
+ { telemetryMessage: "test harness prebuilt directory missing" }
439750
+ );
439751
+ }
439752
+ let main2 = config5.main;
439753
+ if (main2 !== void 0) {
439754
+ const outputFileName = config5.no_bundle ? path31__namespace.default.basename(main2) : `${path31__namespace.default.parse(main2).name}.js`;
439755
+ main2 = path31__namespace.default.join(prebuiltWorkerDir, outputFileName);
439756
+ if (!fs6__namespace.default.existsSync(main2)) {
439757
+ const commandEntrypoint = path31__namespace.default.join(commandOutDir, outputFileName);
439758
+ throw new UserError(
439759
+ `Could not find the prebuilt Worker entrypoint at "${commandEntrypoint}". Run \`${buildCommand3}\` before starting the test harness.`,
439760
+ { telemetryMessage: "test harness prebuilt entrypoint missing" }
439761
+ );
439762
+ }
439763
+ }
439764
+ return {
439765
+ ...config5,
439766
+ main: main2,
439767
+ base_dir: prebuiltWorkerDir,
439768
+ no_bundle: true,
439769
+ find_additional_modules: true,
439770
+ build: { ...config5.build, command: void 0 }
439771
+ };
439772
+ }
439773
+ __name(resolveWorkerConfig, "resolveWorkerConfig");
439192
439774
  function resolveWorkerInputs(serverOptions) {
439193
439775
  if (serverOptions.workers.length === 0) {
439194
439776
  throw new Error("Test harness requires at least one worker.");
@@ -439210,7 +439792,7 @@ function createTestHarness(options) {
439210
439792
  bindings2[key] = { type: "service", service: value };
439211
439793
  }
439212
439794
  return {
439213
- config: "config" in input ? normalizeInlineWorkerConfig(input.config, root) : resolvePath3(root, input.configPath),
439795
+ config: resolveWorkerConfig(input, root),
439214
439796
  env: "env" in input ? input.env : void 0,
439215
439797
  bindings: bindings2,
439216
439798
  dev: {
@@ -439885,11 +440467,13 @@ var init_test_harness = __esm({
439885
440467
  init_dist8();
439886
440468
  init_dist();
439887
440469
  init_introspection();
440470
+ init_config4();
439888
440471
  init_helpers6();
439889
440472
  init_splitter();
439890
440473
  init_utils9();
439891
440474
  init_node_compat();
439892
440475
  init_class_names_sqlite();
440476
+ init_logger();
439893
440477
  init_user3();
439894
440478
  init_DevEnv();
439895
440479
  init_MultiworkerRuntimeController();
@@ -440000,7 +440584,7 @@ async function getPlatformProxy(options = {}) {
440000
440584
  options,
440001
440585
  remoteProxyConnectionString: remoteProxySession?.remoteProxyConnectionString
440002
440586
  });
440003
- const mf = new miniflare.Miniflare(miniflareOptions);
440587
+ const mf = new miniflare.Miniflare(miniflare.convertV4MiniflareOptions(miniflareOptions));
440004
440588
  const bindings2 = await mf.getBindings();
440005
440589
  const cf2 = await mf.getCf();
440006
440590
  deepFreeze(cf2);
@@ -440089,6 +440673,7 @@ async function getMiniflareOptionsFromConfig(args) {
440089
440673
  const projectRoot = config5.userConfigPath ? path31__namespace.default.dirname(config5.userConfigPath) : process.cwd();
440090
440674
  const resourceTmpPath = getDefaultProjectTmpPath(projectRoot);
440091
440675
  const miniflareOptions = {
440676
+ rootPath: projectRoot,
440092
440677
  workers: [
440093
440678
  {
440094
440679
  script: "",
@@ -440163,6 +440748,7 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env7, options) {
440163
440748
  );
440164
440749
  const sitesAssetPaths = getSiteAssetPaths(config5);
440165
440750
  const sitesOptions = buildSitesOptions({ legacyAssetPaths: sitesAssetPaths });
440751
+ const projectRoot = config5.userConfigPath ? path31__namespace.default.dirname(config5.userConfigPath) : process.cwd();
440166
440752
  const hasAssetsDirectory = config5.assets?.directory || options?.overrides?.assets?.directory;
440167
440753
  const processedAssetOptions = hasAssetsDirectory ? getAssetsOptions({
440168
440754
  args: {
@@ -440175,6 +440761,7 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env7, options) {
440175
440761
  }) : void 0;
440176
440762
  const assetOptions = processedAssetOptions ? buildAssetOptions({ assets: processedAssetOptions }) : {};
440177
440763
  const workerOptions = {
440764
+ rootPath: projectRoot,
440178
440765
  compatibilityDate: config5.compatibility_date,
440179
440766
  compatibilityFlags: config5.compatibility_flags,
440180
440767
  modulesRules,