wrangler 4.117.0 → 4.118.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.
@@ -38414,7 +38414,7 @@ function toUrlPath(filePath) {
38414
38414
  );
38415
38415
  return filePath.replace(/\\/g, "/");
38416
38416
  }
38417
- 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; 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, 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;
38417
+ 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;
38418
38418
  var init_dist = __esm({
38419
38419
  "../workers-utils/dist/index.mjs"() {
38420
38420
  init_import_meta_url();
@@ -40026,6 +40026,17 @@ var init_dist = __esm({
40026
40026
  };
40027
40027
  }
40028
40028
  });
40029
+ ARTIFACTS_EVENT_TYPES = [
40030
+ "cf.artifacts.repo.created",
40031
+ "cf.artifacts.repo.deleted",
40032
+ "cf.artifacts.repo.forked",
40033
+ "cf.artifacts.repo.imported",
40034
+ "cf.artifacts.repo.pushed",
40035
+ "cf.artifacts.repo.cloned",
40036
+ "cf.artifacts.repo.fetched",
40037
+ "cf.artifacts.repo.token.created",
40038
+ "cf.artifacts.repo.token.revoked"
40039
+ ];
40029
40040
  __name(getDurableObjectExports, "getDurableObjectExports");
40030
40041
  __name2(getDurableObjectExports, "getDurableObjectExports");
40031
40042
  __name(hasDurableObjectExports, "hasDurableObjectExports");
@@ -51798,7 +51809,7 @@ var init_dist = __esm({
51798
51809
  });
51799
51810
  getLocalObservabilityEnabledFromEnv = getBooleanEnvironmentVariableFactory({
51800
51811
  variableName: "X_LOCAL_OBSERVABILITY",
51801
- defaultValue: false
51812
+ defaultValue: true
51802
51813
  });
51803
51814
  getBrowserRenderingHeadfulFromEnv = getBooleanEnvironmentVariableFactory({
51804
51815
  variableName: "X_BROWSER_HEADFUL",
@@ -52369,11 +52380,14 @@ var init_dist = __esm({
52369
52380
  []
52370
52381
  );
52371
52382
  }, "validateAndNormalizeRules");
52383
+ ARTIFACTS_EVENT_TYPE_SET = new Set(
52384
+ ARTIFACTS_EVENT_TYPES
52385
+ );
52372
52386
  validateTriggers = /* @__PURE__ */ __name2((diagnostics, triggersFieldName, triggersValue) => {
52373
52387
  if (triggersValue === void 0 || triggersValue === null) {
52374
52388
  return true;
52375
52389
  }
52376
- if (typeof triggersValue !== "object") {
52390
+ if (typeof triggersValue !== "object" || Array.isArray(triggersValue)) {
52377
52391
  diagnostics.errors.push(
52378
52392
  `Expected "${triggersFieldName}" to be of type object but got ${JSON.stringify(
52379
52393
  triggersValue
@@ -52388,11 +52402,83 @@ var init_dist = __esm({
52388
52402
  );
52389
52403
  isValid = false;
52390
52404
  }
52405
+ if (hasProperty(triggersValue, "events") && !Array.isArray(triggersValue.events)) {
52406
+ diagnostics.errors.push(
52407
+ `Expected "${triggersFieldName}.events" to be of type array, but got ${JSON.stringify(triggersValue)}.`
52408
+ );
52409
+ isValid = false;
52410
+ } else if (hasProperty(triggersValue, "events") && Array.isArray(triggersValue.events)) {
52411
+ for (const [eventIndex, event] of triggersValue.events.entries()) {
52412
+ const eventFieldName = `${triggersFieldName}.events[${eventIndex}]`;
52413
+ if (typeof event !== "object" || event === null || Array.isArray(event)) {
52414
+ diagnostics.errors.push(
52415
+ `Expected "${eventFieldName}" to be of type object, but got ${JSON.stringify(event)}.`
52416
+ );
52417
+ isValid = false;
52418
+ continue;
52419
+ }
52420
+ if (!isRequiredProperty(event, "type", "string") || !ARTIFACTS_EVENT_TYPE_SET.has(event.type)) {
52421
+ diagnostics.errors.push(
52422
+ `Expected "${eventFieldName}.type" to be a supported Artifacts event type, but got ${JSON.stringify(event.type)}.`
52423
+ );
52424
+ isValid = false;
52425
+ }
52426
+ if (hasProperty(event, "filter") && event.filter !== void 0) {
52427
+ if (typeof event.filter !== "object" || event.filter === null || Array.isArray(event.filter)) {
52428
+ diagnostics.errors.push(
52429
+ `Expected "${eventFieldName}.filter" to be of type object, but got ${JSON.stringify(event.filter)}.`
52430
+ );
52431
+ isValid = false;
52432
+ } else {
52433
+ for (const [filterName, filterValue] of Object.entries(
52434
+ event.filter
52435
+ )) {
52436
+ if (filterName !== "namespace" && filterName !== "repo_name" || typeof filterValue !== "string") {
52437
+ diagnostics.errors.push(
52438
+ `Expected "${eventFieldName}.filter" to contain only string "namespace" and "repo_name" fields, but got ${JSON.stringify(event.filter)}.`
52439
+ );
52440
+ isValid = false;
52441
+ break;
52442
+ }
52443
+ }
52444
+ }
52445
+ }
52446
+ if (!Array.isArray(event.targets) || event.targets.length === 0) {
52447
+ diagnostics.errors.push(
52448
+ `Expected "${eventFieldName}.targets" to be a non-empty array, but got ${JSON.stringify(event.targets)}.`
52449
+ );
52450
+ isValid = false;
52451
+ } else {
52452
+ for (const [targetIndex, target] of event.targets.entries()) {
52453
+ const targetFieldName = `${eventFieldName}.targets[${targetIndex}]`;
52454
+ if (typeof target !== "object" || target === null || Array.isArray(target) || target.type !== "workflow" || typeof target.workflow_name !== "string" || target.workflow_name.length === 0) {
52455
+ diagnostics.errors.push(
52456
+ `Expected "${targetFieldName}" to be a workflow target with a non-empty "workflow_name", but got ${JSON.stringify(target)}.`
52457
+ );
52458
+ isValid = false;
52459
+ continue;
52460
+ }
52461
+ validateAdditionalProperties(
52462
+ diagnostics,
52463
+ targetFieldName,
52464
+ Object.keys(target),
52465
+ ["type", "workflow_name"]
52466
+ );
52467
+ }
52468
+ }
52469
+ validateAdditionalProperties(
52470
+ diagnostics,
52471
+ eventFieldName,
52472
+ Object.keys(event),
52473
+ ["type", "filter", "targets"]
52474
+ );
52475
+ }
52476
+ }
52391
52477
  isValid = validateAdditionalProperties(
52392
52478
  diagnostics,
52393
52479
  triggersFieldName,
52394
52480
  Object.keys(triggersValue),
52395
- ["crons"]
52481
+ ["crons", "events"]
52396
52482
  ) && isValid;
52397
52483
  return isValid;
52398
52484
  }, "validateTriggers");
@@ -57493,7 +57579,7 @@ var name, version2;
57493
57579
  var init_package = __esm({
57494
57580
  "package.json"() {
57495
57581
  name = "wrangler";
57496
- version2 = "4.117.0";
57582
+ version2 = "4.118.0";
57497
57583
  }
57498
57584
  });
57499
57585
 
@@ -120205,6 +120291,25 @@ function requireApiToken(options) {
120205
120291
  }
120206
120292
  return credentials;
120207
120293
  }
120294
+ function validateAccountId(accountId, source) {
120295
+ if (!ACCOUNT_ID_PATTERN.test(accountId)) {
120296
+ throw new UserError(
120297
+ `Invalid account ID "${accountId}" ${source}. Account IDs may only contain alphanumeric characters, hyphens, and underscores.`,
120298
+ { telemetryMessage: "user account id invalid characters" }
120299
+ );
120300
+ }
120301
+ return accountId;
120302
+ }
120303
+ function getCloudflareAccountIdFromEnv() {
120304
+ const accountId = readCloudflareAccountIdFromEnv();
120305
+ if (!accountId) {
120306
+ return void 0;
120307
+ }
120308
+ return validateAccountId(
120309
+ accountId,
120310
+ "set in the `CLOUDFLARE_ACCOUNT_ID` environment variable"
120311
+ );
120312
+ }
120208
120313
  function clearAccessCaches() {
120209
120314
  for (const key of Object.keys(headersCache)) {
120210
120315
  delete headersCache[key];
@@ -122712,9 +122817,9 @@ function scrubEncryptedCredentials(options) {
122712
122817
  }
122713
122818
  return { backendAvailable: false, encryptedFileExisted };
122714
122819
  }
122715
- var import_undici2, hasWarnedAboutDeprecatedV1ApiToken, getCloudflareAPITokenFromEnv, getCloudflareGlobalAuthKeyFromEnv, getCloudflareGlobalAuthEmailFromEnv, getAuthDomainFromEnv, getAuthUrlFromEnv, getTokenUrlFromEnv, getRevokeUrlFromEnv, getCloudflareAccountIdFromEnv, getAccessClientIdFromEnv, getAccessClientSecretFromEnv, getCfAuthorizationTokenFromEnv, getCloudflareAuthUseKeyringFromEnv, headersCache, usesAccessCache, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET, generateAuthUrl, POW_MAX_ITERATIONS, TEMPORARY_TERMS_URLS, TEMPORARY_TERMS_PROMPT, TEMPORARY_TERMS_NOTICE, TEMPORARY_TERMS_ERROR, esm_default3, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, RESERVED_PROFILE_NAMES, TomlError2, DATE_TIME_RE2, TomlDate2, INT_REGEX2, FLOAT_REGEX2, LEADING_ZERO2, ESCAPE_REGEX2, ESC_MAP2, KEY_PART_RE2, BARE_KEY2, dist_default2, FILE_FORMATS, USER_AUTH_CONFIG_PATH, FileCredentialStore, KEY_LENGTH_BYTES, IV_LENGTH_BYTES, TAG_LENGTH_BYTES, ALGORITHM_LABEL, CIPHER_NAME, EncryptedFileCredentialStore, PINNED_KEYRING_VERSION, npmRunner, cachedBindingPathByDir, entryFactoryOverride, runner, cachedProbeResult, LinuxSecretToolKeyProvider, SECURITY_EXIT_ITEM_NOT_FOUND, runner2, MacSecurityKeyProvider, NapiKeyringKeyProvider, testProviderFactory, sessionFlags;
122716
- var init_chunk_PBW6773T = __esm({
122717
- "../workers-auth/dist/chunk-PBW6773T.mjs"() {
122820
+ var import_undici2, hasWarnedAboutDeprecatedV1ApiToken, getCloudflareAPITokenFromEnv, getCloudflareGlobalAuthKeyFromEnv, getCloudflareGlobalAuthEmailFromEnv, ACCOUNT_ID_PATTERN, getAuthDomainFromEnv, getAuthUrlFromEnv, getTokenUrlFromEnv, getRevokeUrlFromEnv, readCloudflareAccountIdFromEnv, getAccessClientIdFromEnv, getAccessClientSecretFromEnv, getCfAuthorizationTokenFromEnv, getCloudflareAuthUseKeyringFromEnv, headersCache, usesAccessCache, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET, generateAuthUrl, POW_MAX_ITERATIONS, TEMPORARY_TERMS_URLS, TEMPORARY_TERMS_PROMPT, TEMPORARY_TERMS_NOTICE, TEMPORARY_TERMS_ERROR, esm_default3, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, RESERVED_PROFILE_NAMES, TomlError2, DATE_TIME_RE2, TomlDate2, INT_REGEX2, FLOAT_REGEX2, LEADING_ZERO2, ESCAPE_REGEX2, ESC_MAP2, KEY_PART_RE2, BARE_KEY2, dist_default2, FILE_FORMATS, USER_AUTH_CONFIG_PATH, FileCredentialStore, KEY_LENGTH_BYTES, IV_LENGTH_BYTES, TAG_LENGTH_BYTES, ALGORITHM_LABEL, CIPHER_NAME, EncryptedFileCredentialStore, PINNED_KEYRING_VERSION, npmRunner, cachedBindingPathByDir, entryFactoryOverride, runner, cachedProbeResult, LinuxSecretToolKeyProvider, SECURITY_EXIT_ITEM_NOT_FOUND, runner2, MacSecurityKeyProvider, NapiKeyringKeyProvider, testProviderFactory, sessionFlags;
122821
+ var init_chunk_7ZPLVMOI = __esm({
122822
+ "../workers-auth/dist/chunk-7ZPLVMOI.mjs"() {
122718
122823
  init_import_meta_url();
122719
122824
  init_chunk_O6YSETKJ();
122720
122825
  init_dist();
@@ -122740,6 +122845,9 @@ var init_chunk_PBW6773T = __esm({
122740
122845
  __name4(getAPIToken, "getAPIToken");
122741
122846
  __name(requireApiToken, "requireApiToken");
122742
122847
  __name4(requireApiToken, "requireApiToken");
122848
+ ACCOUNT_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
122849
+ __name(validateAccountId, "validateAccountId");
122850
+ __name4(validateAccountId, "validateAccountId");
122743
122851
  getAuthDomainFromEnv = getEnvironmentVariableFactory({
122744
122852
  variableName: "WRANGLER_AUTH_DOMAIN",
122745
122853
  defaultValue: /* @__PURE__ */ __name4(() => getCloudflareApiEnvironmentFromEnv() === "staging" ? "dash.staging.cloudflare.com" : "dash.cloudflare.com", "defaultValue")
@@ -122756,10 +122864,12 @@ var init_chunk_PBW6773T = __esm({
122756
122864
  variableName: "WRANGLER_REVOKE_URL",
122757
122865
  defaultValue: /* @__PURE__ */ __name4(() => `https://${getAuthDomainFromEnv()}/oauth2/revoke`, "defaultValue")
122758
122866
  });
122759
- getCloudflareAccountIdFromEnv = getEnvironmentVariableFactory({
122867
+ readCloudflareAccountIdFromEnv = getEnvironmentVariableFactory({
122760
122868
  variableName: "CLOUDFLARE_ACCOUNT_ID",
122761
122869
  deprecatedName: "CF_ACCOUNT_ID"
122762
122870
  });
122871
+ __name(getCloudflareAccountIdFromEnv, "getCloudflareAccountIdFromEnv");
122872
+ __name4(getCloudflareAccountIdFromEnv, "getCloudflareAccountIdFromEnv");
122763
122873
  getAccessClientIdFromEnv = getEnvironmentVariableFactory({
122764
122874
  variableName: "CLOUDFLARE_ACCESS_CLIENT_ID"
122765
122875
  });
@@ -123751,7 +123861,7 @@ ${codeblock}`, options);
123751
123861
  var init_dist2 = __esm({
123752
123862
  "../workers-auth/dist/index.mjs"() {
123753
123863
  init_import_meta_url();
123754
- init_chunk_PBW6773T();
123864
+ init_chunk_7ZPLVMOI();
123755
123865
  }
123756
123866
  });
123757
123867
  function createPreferences(getConfigPath2) {
@@ -124299,7 +124409,10 @@ Alternatively, try running \`${descriptor.commands.login}\` to re-authenticate.`
124299
124409
  return temporaryAccount.account.id;
124300
124410
  }
124301
124411
  if (config5.account_id) {
124302
- return config5.account_id;
124412
+ return validateAccountId(
124413
+ config5.account_id,
124414
+ `set as \`account_id\` in your ${descriptor.getConfigFileLabel()} file`
124415
+ );
124303
124416
  }
124304
124417
  const envAccountId = getCloudflareAccountIdFromEnv();
124305
124418
  if (envAccountId) {
@@ -124648,10 +124761,10 @@ function createAuthConfigFileHelpers(deps) {
124648
124761
  };
124649
124762
  }
124650
124763
  var millisecondsInMinute, minutesInYear, minutesInMonth, minutesInDay, constructFromSymbol, defaultOptions2, formatDistanceLocale, formatDistance, dateFormats, timeFormats, dateTimeFormats, formatLong, formatRelativeLocale, formatRelative, eraValues, quarterValues, monthValues, dayValues, dayPeriodValues, formattingDayPeriodValues, ordinalNumber, localize, matchOrdinalNumberPattern, parseOrdinalNumberPattern, matchEraPatterns, parseEraPatterns, matchQuarterPatterns, parseQuarterPatterns, matchMonthPatterns, parseMonthPatterns, matchDayPatterns, parseDayPatterns, matchDayPeriodPatterns, parseDayPeriodPatterns, match, enUS, MEMBERSHIPS_INACCESSIBLE_CODES, DIRECTORY_BINDINGS_FILE, ENCRYPTED_PROFILE_CONFIG_EXTENSION;
124651
- var init_chunk_RTFTHYPD = __esm({
124652
- "../workers-auth/dist/chunk-RTFTHYPD.mjs"() {
124764
+ var init_chunk_CEH7NWR7 = __esm({
124765
+ "../workers-auth/dist/chunk-CEH7NWR7.mjs"() {
124653
124766
  init_import_meta_url();
124654
- init_chunk_PBW6773T();
124767
+ init_chunk_7ZPLVMOI();
124655
124768
  init_chunk_O6YSETKJ();
124656
124769
  init_dist();
124657
124770
  __name(createPreferences, "createPreferences");
@@ -125165,7 +125278,7 @@ var DefaultScopes, DefaultScopeKeys, WRANGLER_KEYRING_SERVICE_NAME, WRANGLER_CLI
125165
125278
  var init_wrangler = __esm({
125166
125279
  "../workers-auth/dist/wrangler/index.mjs"() {
125167
125280
  init_import_meta_url();
125168
- init_chunk_RTFTHYPD();
125281
+ init_chunk_CEH7NWR7();
125169
125282
  init_chunk_O6YSETKJ();
125170
125283
  init_dist();
125171
125284
  DefaultScopes = {
@@ -140870,6 +140983,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
140870
140983
  }
140871
140984
  async function triggersDeploy(props) {
140872
140985
  const { config: config22, accountId, scriptName, routes, crons } = props;
140986
+ validateEventTriggerTargets(config22, scriptName);
140873
140987
  const routesOnly = [];
140874
140988
  const customDomainsOnly = [];
140875
140989
  for (const route of routes) {
@@ -140883,6 +140997,7 @@ async function triggersDeploy(props) {
140883
140997
  const workerUrl = `/accounts/${accountId}/workers/scripts/${scriptName}`;
140884
140998
  const uploadMs = Date.now() - start;
140885
140999
  const deployments = [];
141000
+ const workflowDeployments = [];
140886
141001
  const hasWorkflowsDefinedInThisScript = config22.workflows.some(
140887
141002
  (workflow) => isWorkflowDefinedInThisScript(workflow, scriptName)
140888
141003
  );
@@ -140976,7 +141091,7 @@ ${dashLink}`, {
140976
141091
  }
140977
141092
  return { targets: routesOnly.map((route) => renderRoute(route)) };
140978
141093
  },
140979
- (error512) => ({ targets: [], error: error512 })
141094
+ (error512) => ({ category: "Routes", targets: [], error: error512 })
140980
141095
  )
140981
141096
  );
140982
141097
  }
@@ -140987,7 +141102,10 @@ ${dashLink}`, {
140987
141102
  workerUrl,
140988
141103
  accountId,
140989
141104
  customDomainsOnly
140990
- ).catch((error512) => ({ targets: [], error: error512 }))
141105
+ ).then(
141106
+ (result) => ({ ...result, category: "Custom domains" }),
141107
+ (error512) => ({ category: "Custom domains", targets: [], error: error512 })
141108
+ )
140991
141109
  );
140992
141110
  }
140993
141111
  if (crons) {
@@ -141003,7 +141121,7 @@ ${dashLink}`, {
141003
141121
  () => ({
141004
141122
  targets: crons.map((trigger) => `schedule: ${trigger}`)
141005
141123
  }),
141006
- (error512) => ({ targets: [], error: error512 })
141124
+ (error512) => ({ category: "Cron schedules", targets: [], error: error512 })
141007
141125
  )
141008
141126
  );
141009
141127
  }
@@ -141023,7 +141141,14 @@ ${dashLink}`, {
141023
141141
  scriptName,
141024
141142
  config22
141025
141143
  );
141026
- deployments.push(...consumerUpdates);
141144
+ deployments.push(
141145
+ ...consumerUpdates.map(
141146
+ (update) => update.then((result) => ({
141147
+ ...result,
141148
+ category: "Queue consumers"
141149
+ }))
141150
+ )
141151
+ );
141027
141152
  }
141028
141153
  if (config22.workflows?.length) {
141029
141154
  for (const workflow of config22.workflows) {
@@ -141046,8 +141171,9 @@ ${dashLink}`, {
141046
141171
  }
141047
141172
  continue;
141048
141173
  }
141049
- deployments.push(
141050
- fetchResult(
141174
+ workflowDeployments.push({
141175
+ name: workflow.name,
141176
+ deployment: fetchResult(
141051
141177
  config22,
141052
141178
  `/accounts/${accountId}/workflows/${workflow.name}`,
141053
141179
  {
@@ -141065,11 +141191,15 @@ ${dashLink}`, {
141065
141191
  }
141066
141192
  }
141067
141193
  ).then(
141068
- () => ({ targets: [`workflow: ${workflow.name}`] }),
141194
+ () => ({
141195
+ category: "Workflows",
141196
+ targets: [`workflow: ${workflow.name}`]
141197
+ }),
141069
141198
  (error512) => {
141070
141199
  if (error512 instanceof APIError && error512.code === WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE && workflow.schedules) {
141071
141200
  error512.preventReport();
141072
141201
  return {
141202
+ category: "Workflows",
141073
141203
  targets: [],
141074
141204
  error: new UserError(
141075
141205
  `Workflow "${workflow.name}" has "schedules" configured, but scheduled Workflows require a paid Workers plan.`,
@@ -141080,12 +141210,85 @@ ${dashLink}`, {
141080
141210
  )
141081
141211
  };
141082
141212
  }
141083
- return { targets: [], error: error512 };
141213
+ return {
141214
+ category: "Workflows",
141215
+ resource: `Workflow "${workflow.name}"`,
141216
+ targets: [],
141217
+ error: error512
141218
+ };
141084
141219
  }
141085
141220
  )
141086
- );
141221
+ });
141087
141222
  }
141088
141223
  }
141224
+ const completedWorkflowDeployments = await Promise.all(
141225
+ workflowDeployments.map(async ({ name: name2, deployment }) => ({
141226
+ name: name2,
141227
+ deployment: await deployment
141228
+ }))
141229
+ );
141230
+ deployments.push(
141231
+ ...completedWorkflowDeployments.map(
141232
+ ({ deployment }) => Promise.resolve(deployment)
141233
+ )
141234
+ );
141235
+ const eventTriggers = config22.triggers?.events;
141236
+ const targetedWorkflowNames = new Set(
141237
+ eventTriggers?.flatMap(
141238
+ (event) => event.targets.map((target) => target.workflow_name)
141239
+ ) ?? []
141240
+ );
141241
+ const failedTargetedWorkflowNames = completedWorkflowDeployments.filter(
141242
+ ({ name: name2, deployment }) => deployment.error !== void 0 && targetedWorkflowNames.has(name2)
141243
+ ).map(({ name: name2 }) => name2);
141244
+ if (eventTriggers !== void 0 && failedTargetedWorkflowNames.length === 0) {
141245
+ deployments.push(
141246
+ fetchResult(
141247
+ config22,
141248
+ `/accounts/${accountId}/triggers/${encodeURIComponent(scriptName)}`,
141249
+ {
141250
+ method: "PUT",
141251
+ body: JSON.stringify(
141252
+ eventTriggers.map((event) => ({
141253
+ ...event,
141254
+ targets: event.targets.map((target) => ({
141255
+ ...target,
141256
+ script_name: scriptName
141257
+ }))
141258
+ }))
141259
+ ),
141260
+ headers: { "Content-Type": "application/json" }
141261
+ }
141262
+ ).then(
141263
+ () => ({
141264
+ category: "Event triggers",
141265
+ resource: `Worker "${scriptName}"`,
141266
+ targets: [`event triggers: ${eventTriggers.length}`]
141267
+ }),
141268
+ (error512) => ({
141269
+ category: "Event triggers",
141270
+ resource: `Worker "${scriptName}"`,
141271
+ targets: [],
141272
+ error: error512
141273
+ })
141274
+ )
141275
+ );
141276
+ } else if (eventTriggers !== void 0) {
141277
+ const workflowLabel = failedTargetedWorkflowNames.length === 1 ? "Workflow" : "Workflows";
141278
+ const failedWorkflows = failedTargetedWorkflowNames.map((name2) => `"${name2}"`).join(", ");
141279
+ deployments.push(
141280
+ Promise.resolve({
141281
+ category: "Event triggers",
141282
+ targets: [],
141283
+ error: new UserError(
141284
+ `Not updated because ${workflowLabel} ${failedWorkflows} failed to deploy.`,
141285
+ {
141286
+ telemetryMessage: "triggers deploy event update skipped after workflow failure"
141287
+ }
141288
+ )
141289
+ })
141290
+ );
141291
+ }
141089
141292
  const completedDeployments = await Promise.all(deployments);
141090
141293
  const deployMs = Date.now() - start - uploadMs;
141091
141294
  const workerName = scriptName;
@@ -141101,7 +141304,9 @@ ${dashLink}`, {
141101
141304
  } else {
141102
141305
  logger.log("No targets deployed for", workerName, formatTime(deployMs));
141103
141306
  }
141104
- const errors = completedDeployments.map((deployment) => deployment.error).filter((error512) => error512 !== void 0);
141307
+ const failedDeployments = completedDeployments.filter(
141308
+ (deployment) => deployment.error !== void 0
141309
+ );
141105
141310
  try {
141106
141311
  await applyEmailRoutingAddresses({
141107
141312
  config: config22,
@@ -141110,22 +141315,46 @@ ${dashLink}`, {
141110
141315
  workerTag: props.workerTag
141111
141316
  });
141112
141317
  } catch (error512) {
141113
- if (errors.length === 0) {
141318
+ if (failedDeployments.length === 0) {
141114
141319
  throw error512;
141115
141320
  }
141116
- errors.push(error512 instanceof Error ? error512 : new Error(String(error512)));
141117
- }
141118
- if (errors.length > 0) {
141321
+ failedDeployments.push({
141322
+ category: "Email routing",
141323
+ targets: [],
141324
+ error: error512 instanceof Error ? error512 : new Error(String(error512))
141325
+ });
141326
+ }
141327
+ if (failedDeployments.length > 0) {
141328
+ const failuresByCategory = /* @__PURE__ */ new Map();
141329
+ for (const deployment of failedDeployments) {
141330
+ const category = deployment.category ?? "Other triggers";
141331
+ const categoryDeployments = failuresByCategory.get(category) ?? [];
141332
+ categoryDeployments.push(deployment);
141333
+ failuresByCategory.set(category, categoryDeployments);
141334
+ }
141335
+ const errors = failedDeployments.map((deployment) => deployment.error);
141336
+ const formattedFailures = [...failuresByCategory].map(([category, categoryDeployments]) => {
141337
+ const messages = categoryDeployments.map((deployment) => {
141338
+ const resource = deployment.resource ? `${deployment.resource}: ` : "";
141339
+ const lines = [` - ${resource}${deployment.error.message}`];
141340
+ if (deployment.error instanceof APIError) {
141341
+ lines.push(
141342
+ ...deployment.error.notes.map((note) => ` - ${note.text}`)
141343
+ );
141344
+ }
141345
+ return lines.join("\n");
141346
+ }).join("\n");
141347
+ return ` ${category}:
141348
+ ${messages}`;
141349
+ }).join("\n\n");
141119
141350
  throw new UserError(
141120
- `Some triggers failed to deploy for ${workerName}:
141121
- ` + errors.map((error512) => ` - ${error512.message}`).join("\n"),
141351
+ `Trigger configuration for "${workerName}" was only partially updated:
141352
+
141353
+ ${formattedFailures}
141354
+
141355
+ Successful trigger changes were not rolled back.`,
141122
141356
  {
141123
- // Preserve the original errors (with stacks and subclass info) for
141124
- // debugging, while still presenting a single aggregated message.
141125
141357
  cause: new AggregateError(errors),
141126
- // Aggregate the inner telemetry labels into a single deterministic,
141127
- // low-cardinality label so failures still group meaningfully. Non-
141128
- // UserError causes contribute a generic "non-user error" marker.
141129
141358
  telemetryMessage: `triggers deploy partial failure: ${aggregateTelemetryMessages(errors)}`
141130
141359
  }
141131
141360
  );
@@ -141274,6 +141503,25 @@ async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes,
141274
141503
  previewsInSync: before.previews_enabled === after.previews_enabled
141275
141504
  };
141276
141505
  }
141506
+ function validateEventTriggerTargets(config22, scriptName) {
141507
+ for (const event of config22.triggers?.events ?? []) {
141508
+ for (const target of event.targets) {
141509
+ const isDefinedByThisWorker = config22.workflows.some(
141510
+ (workflow) => workflow.name === target.workflow_name && isWorkflowDefinedInThisScript(workflow, scriptName)
141511
+ );
141512
+ if (!isDefinedByThisWorker) {
141513
+ throw new UserError(
141514
+ `Event trigger "${event.type}" targets Workflow "${target.workflow_name}", but that Workflow is not defined by this Worker.
141515
+
141516
+ Add it to the "workflows" configuration or remove the event trigger target.`,
141517
+ {
141518
+ telemetryMessage: "triggers deploy event target workflow not defined"
141519
+ }
141520
+ );
141521
+ }
141522
+ }
141523
+ }
141524
+ }
141277
141525
  function isWorkflowDefinedInThisScript(workflow, scriptName) {
141278
141526
  return workflow.script_name === void 0 || workflow.script_name === scriptName;
141279
141527
  }
@@ -148317,6 +148565,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
148317
148565
  );
148318
148566
  }
148319
148567
  if (props.command === "deploy") {
148568
+ validateEventTriggerTargets(config22, name2);
148320
148569
  validateRoutes2(props.routes, props.assetsOptions);
148321
148570
  assert32__default.default(
148322
148571
  !config22.site || config22.site.bucket,
@@ -153553,6 +153802,8 @@ var init_dist8 = __esm({
153553
153802
  __name3(validateSubdomainMixedState, "validateSubdomainMixedState");
153554
153803
  __name(subdomainDeploy, "subdomainDeploy");
153555
153804
  __name3(subdomainDeploy, "subdomainDeploy");
153805
+ __name(validateEventTriggerTargets, "validateEventTriggerTargets");
153806
+ __name3(validateEventTriggerTargets, "validateEventTriggerTargets");
153556
153807
  __name(isWorkflowDefinedInThisScript, "isWorkflowDefinedInThisScript");
153557
153808
  __name3(isWorkflowDefinedInThisScript, "isWorkflowDefinedInThisScript");
153558
153809
  MAX_ROUTES_RULES = 100;
@@ -178059,6 +178310,13 @@ var init_BaseController = __esm({
178059
178310
  async teardown() {
178060
178311
  this.#tearingDown = true;
178061
178312
  }
178313
+ /**
178314
+ * Whether `teardown()` has been called, which subclasses should check before
178315
+ * starting any new work.
178316
+ */
178317
+ get tearingDown() {
178318
+ return this.#tearingDown;
178319
+ }
178062
178320
  emitErrorEvent(event) {
178063
178321
  if (this.#tearingDown) {
178064
178322
  logger2.debug("Suppressing error event during teardown");
@@ -178363,7 +178621,7 @@ var CF_KEYRING_SERVICE_NAME, CF_CLI_NAME, CF_OAUTH_CALLBACK_URL, CF_CONSENT_PAGE
178363
178621
  var init_cf = __esm({
178364
178622
  "../workers-auth/dist/cf/index.mjs"() {
178365
178623
  init_import_meta_url();
178366
- init_chunk_RTFTHYPD();
178624
+ init_chunk_CEH7NWR7();
178367
178625
  init_chunk_O6YSETKJ();
178368
178626
  init_dist();
178369
178627
  CF_KEYRING_SERVICE_NAME = "cloudflare";
@@ -182743,7 +183001,7 @@ var init_dist12 = __esm({
182743
183001
  init_wrapper();
182744
183002
  init_create_worker_upload_form();
182745
183003
  import_undici8 = __toESM(require_undici(), 1);
182746
- version4 = "0.0.5";
183004
+ version4 = "0.0.6";
182747
183005
  NoDefaultValueProvided2 = class extends UserError {
182748
183006
  static {
182749
183007
  __name(this, "NoDefaultValueProvided");
@@ -211510,7 +211768,7 @@ and that at least one include rule is provided.
211510
211768
  `;
211511
211769
  }
211512
211770
  }
211513
- 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, 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, 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;
211771
+ 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;
211514
211772
  var init_dist14 = __esm({
211515
211773
  "../pages-functions/dist/index.mjs"() {
211516
211774
  init_import_meta_url();
@@ -233703,6 +233961,17 @@ ${captureLines}` : capture.stack;
233703
233961
  return null;
233704
233962
  };
233705
233963
  } });
233964
+ ARTIFACTS_EVENT_TYPES2 = [
233965
+ "cf.artifacts.repo.created",
233966
+ "cf.artifacts.repo.deleted",
233967
+ "cf.artifacts.repo.forked",
233968
+ "cf.artifacts.repo.imported",
233969
+ "cf.artifacts.repo.pushed",
233970
+ "cf.artifacts.repo.cloned",
233971
+ "cf.artifacts.repo.fetched",
233972
+ "cf.artifacts.repo.token.created",
233973
+ "cf.artifacts.repo.token.revoked"
233974
+ ];
233706
233975
  __name(getDurableObjectExports2, "getDurableObjectExports");
233707
233976
  __name6(getDurableObjectExports2, "getDurableObjectExports");
233708
233977
  __name(hasDurableObjectExports2, "hasDurableObjectExports");
@@ -245501,9 +245770,10 @@ ${captureLines}` : capture.stack;
245501
245770
  validateAndNormalizeRules2 = /* @__PURE__ */ __name6((diagnostics, topLevelEnv, rawEnv, envName) => {
245502
245771
  return inheritable2(diagnostics, topLevelEnv, rawEnv, "rules", validateRules2(envName), []);
245503
245772
  }, "validateAndNormalizeRules");
245773
+ ARTIFACTS_EVENT_TYPE_SET2 = new Set(ARTIFACTS_EVENT_TYPES2);
245504
245774
  validateTriggers2 = /* @__PURE__ */ __name6((diagnostics, triggersFieldName, triggersValue) => {
245505
245775
  if (triggersValue === void 0 || triggersValue === null) return true;
245506
- if (typeof triggersValue !== "object") {
245776
+ if (typeof triggersValue !== "object" || Array.isArray(triggersValue)) {
245507
245777
  diagnostics.errors.push(`Expected "${triggersFieldName}" to be of type object but got ${JSON.stringify(triggersValue)}.`);
245508
245778
  return false;
245509
245779
  }
@@ -245512,7 +245782,49 @@ ${captureLines}` : capture.stack;
245512
245782
  diagnostics.errors.push(`Expected "${triggersFieldName}.crons" to be of type array, but got ${JSON.stringify(triggersValue)}.`);
245513
245783
  isValid = false;
245514
245784
  }
245515
- isValid = validateAdditionalProperties2(diagnostics, triggersFieldName, Object.keys(triggersValue), ["crons"]) && isValid;
245785
+ if (hasProperty2(triggersValue, "events") && !Array.isArray(triggersValue.events)) {
245786
+ diagnostics.errors.push(`Expected "${triggersFieldName}.events" to be of type array, but got ${JSON.stringify(triggersValue)}.`);
245787
+ isValid = false;
245788
+ } else if (hasProperty2(triggersValue, "events") && Array.isArray(triggersValue.events)) for (const [eventIndex, event] of triggersValue.events.entries()) {
245789
+ const eventFieldName = `${triggersFieldName}.events[${eventIndex}]`;
245790
+ if (typeof event !== "object" || event === null || Array.isArray(event)) {
245791
+ diagnostics.errors.push(`Expected "${eventFieldName}" to be of type object, but got ${JSON.stringify(event)}.`);
245792
+ isValid = false;
245793
+ continue;
245794
+ }
245795
+ if (!isRequiredProperty2(event, "type", "string") || !ARTIFACTS_EVENT_TYPE_SET2.has(event.type)) {
245796
+ diagnostics.errors.push(`Expected "${eventFieldName}.type" to be a supported Artifacts event type, but got ${JSON.stringify(event.type)}.`);
245797
+ isValid = false;
245798
+ }
245799
+ if (hasProperty2(event, "filter") && event.filter !== void 0) {
245800
+ if (typeof event.filter !== "object" || event.filter === null || Array.isArray(event.filter)) {
245801
+ diagnostics.errors.push(`Expected "${eventFieldName}.filter" to be of type object, but got ${JSON.stringify(event.filter)}.`);
245802
+ isValid = false;
245803
+ } else for (const [filterName, filterValue] of Object.entries(event.filter)) if (filterName !== "namespace" && filterName !== "repo_name" || typeof filterValue !== "string") {
245804
+ diagnostics.errors.push(`Expected "${eventFieldName}.filter" to contain only string "namespace" and "repo_name" fields, but got ${JSON.stringify(event.filter)}.`);
245805
+ isValid = false;
245806
+ break;
245807
+ }
245808
+ }
245809
+ if (!Array.isArray(event.targets) || event.targets.length === 0) {
245810
+ diagnostics.errors.push(`Expected "${eventFieldName}.targets" to be a non-empty array, but got ${JSON.stringify(event.targets)}.`);
245811
+ isValid = false;
245812
+ } else for (const [targetIndex, target] of event.targets.entries()) {
245813
+ const targetFieldName = `${eventFieldName}.targets[${targetIndex}]`;
245814
+ if (typeof target !== "object" || target === null || Array.isArray(target) || target.type !== "workflow" || typeof target.workflow_name !== "string" || target.workflow_name.length === 0) {
245815
+ diagnostics.errors.push(`Expected "${targetFieldName}" to be a workflow target with a non-empty "workflow_name", but got ${JSON.stringify(target)}.`);
245816
+ isValid = false;
245817
+ continue;
245818
+ }
245819
+ validateAdditionalProperties2(diagnostics, targetFieldName, Object.keys(target), ["type", "workflow_name"]);
245820
+ }
245821
+ validateAdditionalProperties2(diagnostics, eventFieldName, Object.keys(event), [
245822
+ "type",
245823
+ "filter",
245824
+ "targets"
245825
+ ]);
245826
+ }
245827
+ isValid = validateAdditionalProperties2(diagnostics, triggersFieldName, Object.keys(triggersValue), ["crons", "events"]) && isValid;
245516
245828
  return isValid;
245517
245829
  }, "validateTriggers");
245518
245830
  validateRules2 = /* @__PURE__ */ __name6((envName) => (diagnostics, field, envValue, config22) => {
@@ -254382,14 +254694,22 @@ var init_navigator_user_agent = __esm({
254382
254694
  // src/utils/debounce.ts
254383
254695
  function debounce(fn3, delayMs = 100) {
254384
254696
  let crrTimeoutId;
254385
- return () => {
254697
+ const debounced = /* @__PURE__ */ __name(() => {
254386
254698
  if (crrTimeoutId) {
254387
254699
  clearTimeout(crrTimeoutId);
254388
254700
  }
254389
254701
  crrTimeoutId = setTimeout(() => {
254702
+ crrTimeoutId = void 0;
254390
254703
  fn3();
254391
254704
  }, delayMs);
254705
+ }, "debounced");
254706
+ debounced.cancel = () => {
254707
+ if (crrTimeoutId) {
254708
+ clearTimeout(crrTimeoutId);
254709
+ crrTimeoutId = void 0;
254710
+ }
254392
254711
  };
254712
+ return debounced;
254393
254713
  }
254394
254714
  var init_debounce = __esm({
254395
254715
  "src/utils/debounce.ts"() {
@@ -254437,20 +254757,70 @@ var init_BundlerController = __esm({
254437
254757
  }
254438
254758
  #currentBundle;
254439
254759
  #customBuildWatcher;
254760
+ #debouncedCustomBuild;
254440
254761
  // Handle aborting in-flight custom builds as new ones come in from the filesystem watcher
254441
254762
  #customBuildAborter = new AbortController();
254442
- #activeCustomBuilds = /* @__PURE__ */ new Set();
254443
- #startCustomBuildRun(config5, filePath) {
254444
- const buildPromise = this.#runCustomBuild(config5, filePath);
254445
- this.#activeCustomBuilds.add(buildPromise);
254446
- void buildPromise.finally(() => this.#activeCustomBuilds.delete(buildPromise)).catch(() => {
254447
- });
254448
- return buildPromise;
254449
- }
254450
- async #runCustomBuild(config5, filePath) {
254763
+ /**
254764
+ * The custom build that is waiting for the in-flight one to finish, if any.
254765
+ *
254766
+ * Only the most recent request is kept. A custom build always builds from
254767
+ * whatever is on disk when it runs, so an earlier queued request would just
254768
+ * repeat the same work.
254769
+ */
254770
+ #pendingCustomBuild;
254771
+ /**
254772
+ * The promise for the loop that is currently working through
254773
+ * `#pendingCustomBuild`, or `undefined` if no loop is running.
254774
+ */
254775
+ #customBuildDrain;
254776
+ /**
254777
+ * Queue a custom build, superseding any build that is in-flight or waiting.
254778
+ *
254779
+ * Custom builds are run one at a time. Running them concurrently lets two
254780
+ * builds write to the same output files at once, and the user's build command
254781
+ * is unlikely to expect that.
254782
+ *
254783
+ * @returns a promise that resolves once the queue has been drained.
254784
+ */
254785
+ #scheduleCustomBuild(config5, filePath) {
254786
+ if (this.tearingDown) {
254787
+ return Promise.resolve();
254788
+ }
254451
254789
  this.#customBuildAborter.abort();
254452
254790
  this.#customBuildAborter = new AbortController();
254453
- const buildAborter = this.#customBuildAborter;
254791
+ this.#pendingCustomBuild = {
254792
+ config: config5,
254793
+ filePath,
254794
+ buildAborter: this.#customBuildAborter
254795
+ };
254796
+ if (this.#customBuildDrain === void 0) {
254797
+ const drain3 = this.#drainCustomBuilds();
254798
+ this.#customBuildDrain = drain3;
254799
+ void drain3.catch(() => {
254800
+ });
254801
+ }
254802
+ return this.#customBuildDrain;
254803
+ }
254804
+ async #drainCustomBuilds() {
254805
+ await Promise.resolve();
254806
+ try {
254807
+ while (this.#pendingCustomBuild !== void 0) {
254808
+ const next = this.#pendingCustomBuild;
254809
+ this.#pendingCustomBuild = void 0;
254810
+ if (next.buildAborter.signal.aborted) {
254811
+ continue;
254812
+ }
254813
+ await this.#runCustomBuild(
254814
+ next.config,
254815
+ next.filePath,
254816
+ next.buildAborter
254817
+ );
254818
+ }
254819
+ } finally {
254820
+ this.#customBuildDrain = void 0;
254821
+ }
254822
+ }
254823
+ async #runCustomBuild(config5, filePath, buildAborter) {
254454
254824
  const relativeFile = path31__namespace.default.relative(config5.projectRoot, config5.entrypoint) || ".";
254455
254825
  logger2.log(`The file ${filePath} changed, restarting build...`);
254456
254826
  this.emitBundleStartEvent(config5);
@@ -254517,7 +254887,7 @@ var init_BundlerController = __esm({
254517
254887
  doBindings,
254518
254888
  workflowBindings,
254519
254889
  jsxFactory: config5.build.jsxFactory,
254520
- jsxFragment: config5.build.jsxFactory,
254890
+ jsxFragment: config5.build.jsxFragment,
254521
254891
  tsconfig: config5.build.tsconfig,
254522
254892
  minify: config5.build.minify,
254523
254893
  keepNames: config5.build.keepNames ?? true,
@@ -254585,14 +254955,17 @@ var init_BundlerController = __esm({
254585
254955
  async #startCustomBuild(config5) {
254586
254956
  await this.#customBuildWatcher?.close();
254587
254957
  this.#customBuildWatcher = void 0;
254958
+ this.#debouncedCustomBuild?.cancel();
254959
+ this.#debouncedCustomBuild = void 0;
254960
+ this.#pendingCustomBuild = void 0;
254588
254961
  this.#customBuildAborter?.abort();
254589
- if (!config5.build?.custom?.command) {
254962
+ if (this.tearingDown || !config5.build?.custom?.command) {
254590
254963
  return;
254591
254964
  }
254592
254965
  const pathsToWatch = config5.build.custom.watch;
254593
254966
  assert32__default.default(pathsToWatch, "config.build.custom.watch");
254594
254967
  if (config5.dev.watch === false) {
254595
- await this.#startCustomBuildRun(config5, String(pathsToWatch));
254968
+ await this.#scheduleCustomBuild(config5, String(pathsToWatch));
254596
254969
  return;
254597
254970
  }
254598
254971
  this.#customBuildWatcher = watch(pathsToWatch, {
@@ -254601,17 +254974,25 @@ var init_BundlerController = __esm({
254601
254974
  ignoreInitial: true
254602
254975
  });
254603
254976
  this.#customBuildWatcher.on("ready", () => {
254604
- void this.#startCustomBuildRun(config5, String(pathsToWatch));
254977
+ void this.#scheduleCustomBuild(config5, String(pathsToWatch));
254978
+ });
254979
+ let lastChangedPath = String(pathsToWatch);
254980
+ const debouncedCustomBuild = debounce(() => {
254981
+ void this.#scheduleCustomBuild(config5, lastChangedPath);
254982
+ });
254983
+ this.#debouncedCustomBuild = debouncedCustomBuild;
254984
+ this.#customBuildWatcher.on("all", (_event, filePath) => {
254985
+ lastChangedPath = filePath;
254986
+ debouncedCustomBuild();
254605
254987
  });
254606
- this.#customBuildWatcher.on(
254607
- "all",
254608
- (_event, filePath) => void this.#startCustomBuildRun(config5, filePath)
254609
- );
254610
254988
  }
254611
254989
  #bundlerCleanup;
254612
254990
  #bundleBuildAborter = new AbortController();
254613
254991
  async #startBundle(config5) {
254614
254992
  await this.#bundlerCleanup?.();
254993
+ if (this.tearingDown) {
254994
+ return;
254995
+ }
254615
254996
  this.#bundleBuildAborter.abort();
254616
254997
  this.#bundleBuildAborter = new AbortController();
254617
254998
  const buildAborter = this.#bundleBuildAborter;
@@ -254711,14 +255092,24 @@ var init_BundlerController = __esm({
254711
255092
  );
254712
255093
  }
254713
255094
  #assetsWatcher;
255095
+ #debouncedRefreshBundle;
254714
255096
  async #ensureWatchingAssets(config5) {
254715
255097
  await this.#assetsWatcher?.close();
254716
255098
  this.#assetsWatcher = void 0;
255099
+ this.#debouncedRefreshBundle?.cancel();
255100
+ this.#debouncedRefreshBundle = void 0;
255101
+ if (this.tearingDown) {
255102
+ return;
255103
+ }
254717
255104
  const debouncedRefreshBundle = debounce(() => {
255105
+ if (this.tearingDown) {
255106
+ return;
255107
+ }
254718
255108
  if (this.#currentBundle) {
254719
255109
  this.emitBundleCompleteEvent(config5, this.#currentBundle);
254720
255110
  }
254721
255111
  });
255112
+ this.#debouncedRefreshBundle = debouncedRefreshBundle;
254722
255113
  if (config5.dev.watch !== false && config5.assets?.directory) {
254723
255114
  const assetsDir = config5.assets.directory;
254724
255115
  const watcher = watch(assetsDir, {
@@ -254754,6 +255145,10 @@ Watcher error: ${err.message}`
254754
255145
  }
254755
255146
  #tmpDir;
254756
255147
  onConfigUpdate(event) {
255148
+ if (this.tearingDown) {
255149
+ logger2.debug("Ignoring config update during teardown");
255150
+ return;
255151
+ }
254757
255152
  this.#tmpDir?.remove();
254758
255153
  try {
254759
255154
  this.#tmpDir = getWranglerTmpDir(event.config.projectRoot, "dev");
@@ -254797,12 +255192,8 @@ Watcher error: ${err.message}`
254797
255192
  async teardown() {
254798
255193
  logger2.debug("BundlerController teardown beginning...");
254799
255194
  await super.teardown();
255195
+ this.#pendingCustomBuild = void 0;
254800
255196
  this.#customBuildAborter?.abort();
254801
- const activeCustomBuilds = Array.from(
254802
- this.#activeCustomBuilds,
254803
- (build6) => build6.catch(() => {
254804
- })
254805
- );
254806
255197
  this.#bundleBuildAborter?.abort();
254807
255198
  await Promise.all([
254808
255199
  // Must run before `#tmpDir.remove()` so that the esbuild watcher
@@ -254811,9 +255202,12 @@ Watcher error: ${err.message}`
254811
255202
  // ...middleware-loader.entry.ts" during teardown.
254812
255203
  this.#bundlerCleanup?.(),
254813
255204
  this.#customBuildWatcher?.close(),
254814
- ...activeCustomBuilds,
255205
+ this.#customBuildDrain?.catch(() => {
255206
+ }),
254815
255207
  this.#assetsWatcher?.close()
254816
255208
  ]);
255209
+ this.#debouncedCustomBuild?.cancel();
255210
+ this.#debouncedRefreshBundle?.cancel();
254817
255211
  this.#tmpDir?.remove();
254818
255212
  logger2.debug("BundlerController teardown complete");
254819
255213
  }
@@ -263877,18 +264271,38 @@ var init_containers = __esm({
263877
264271
  owner: "Product: Cloudchamber"
263878
264272
  },
263879
264273
  behaviour: {
263880
- printBanner: /* @__PURE__ */ __name(() => !isNonInteractiveOrCI(), "printBanner")
264274
+ printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
263881
264275
  },
263882
264276
  args: {
263883
264277
  ID: {
263884
264278
  describe: "ID of the container to view",
263885
264279
  type: "string",
263886
264280
  demandOption: true
264281
+ },
264282
+ json: {
264283
+ describe: "Return output as JSON",
264284
+ type: "boolean",
264285
+ default: false
263887
264286
  }
263888
264287
  },
263889
264288
  positionalArgs: ["ID"],
263890
264289
  async handler(args, { config: config5 }) {
263891
264290
  await fillOpenAPIConfiguration(config5, containersScope);
264291
+ if (args.json) {
264292
+ try {
264293
+ const application = await ApplicationsService.getApplication(args.ID);
264294
+ logger2.json(application);
264295
+ return;
264296
+ } catch (err) {
264297
+ if (err instanceof UserError) {
264298
+ throw err;
264299
+ }
264300
+ const message = err instanceof Error ? err.message : "Unknown error";
264301
+ throw new JsonFriendlyFatalError(JSON.stringify({ error: message }), {
264302
+ telemetryMessage: "containers info json output failed"
264303
+ });
264304
+ }
264305
+ }
263892
264306
  await infoCommand(args);
263893
264307
  }
263894
264308
  });
@@ -417555,6 +417969,7 @@ var init_triggers = __esm({
417555
417969
  sendMetrics: config5.send_metrics
417556
417970
  });
417557
417971
  const props = resolveTriggersInput(args, config5);
417972
+ validateEventTriggerTargets(config5, props.scriptName);
417558
417973
  if (args.dryRun) {
417559
417974
  logger2.log(`--dry-run: exiting now.`);
417560
417975
  return;