@cloudflare/workers-utils 0.31.0 → 0.31.1

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.
@@ -1,4 +1,4 @@
1
- import { T as TailConsumer, aL as WorkerMetadata, R as RawConfig } from './config-StQFc4Vs.mjs';
1
+ import { T as TailConsumer, aO as WorkerMetadata, R as RawConfig } from './config-CFrqMEcY.mjs';
2
2
  import { AssetConfig } from '@cloudflare/workers-shared';
3
3
  import { Cloudflare } from 'cloudflare';
4
4
  import 'node:url';
@@ -210,13 +210,10 @@ declare const getLocalExplorerEnabledFromEnv: () => boolean;
210
210
  * `unsafeObservability` Miniflare option, which makes core attach the trace
211
211
  * collector to each user worker.
212
212
  *
213
- * Temporarily defaults to `false` for release: defaulting it on attaches extra
214
- * per-worker services (collector + streaming tail) that destabilise the
215
- * multi-process dev-registry scenario on Windows (workerd socket "fetch
216
- * failed"). Capture is now opt-in — set `X_LOCAL_OBSERVABILITY=true`, or turn it
217
- * on from the Local Explorer's Observability tab (Vite dev), which reloads the
218
- * runtime with capture enabled. The explorer UI itself (`X_LOCAL_EXPLORER`)
219
- * stays on by default so the tab is always available.
213
+ * Defaults to `true` so the Local Explorer's Observability tab captures traces
214
+ * and logs out of the box. Set `X_LOCAL_OBSERVABILITY=false` to opt out — for
215
+ * example if the extra per-worker services (collector + streaming tail) cause
216
+ * trouble in a multi-process dev-registry setup.
220
217
  */
221
218
  declare const getLocalObservabilityEnabledFromEnv: () => boolean;
222
219
  /**
@@ -2094,11 +2091,11 @@ interface EnvironmentInheritable {
2094
2091
  */
2095
2092
  exports: Exports;
2096
2093
  /**
2097
- * "Cron" definitions to trigger a Worker's "scheduled" function.
2094
+ * Definitions that trigger a Worker from a schedule or a Cloudflare event.
2098
2095
  *
2099
- * Lets you call Workers periodically, much like a cron job.
2096
+ * More details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers
2100
2097
  *
2101
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
2098
+ * More details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/
2102
2099
  *
2103
2100
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
2104
2101
  *
@@ -2106,7 +2103,8 @@ interface EnvironmentInheritable {
2106
2103
  * @inheritable
2107
2104
  */
2108
2105
  triggers: {
2109
- crons: string[] | undefined;
2106
+ crons?: string[];
2107
+ events?: ArtifactsEventTrigger[];
2110
2108
  };
2111
2109
  /**
2112
2110
  * Specify limits for runtime behavior.
@@ -2293,6 +2291,19 @@ type DurableObjectBindings = {
2293
2291
  /** The service environment of the script_name to bind to */
2294
2292
  environment?: string;
2295
2293
  }[];
2294
+ declare const ARTIFACTS_EVENT_TYPES: readonly ["cf.artifacts.repo.created", "cf.artifacts.repo.deleted", "cf.artifacts.repo.forked", "cf.artifacts.repo.imported", "cf.artifacts.repo.pushed", "cf.artifacts.repo.cloned", "cf.artifacts.repo.fetched", "cf.artifacts.repo.token.created", "cf.artifacts.repo.token.revoked"];
2295
+ type ArtifactsEventType = (typeof ARTIFACTS_EVENT_TYPES)[number];
2296
+ type ArtifactsEventTrigger = {
2297
+ type: ArtifactsEventType;
2298
+ filter?: {
2299
+ namespace?: string;
2300
+ repo_name?: string;
2301
+ };
2302
+ targets: {
2303
+ type: "workflow";
2304
+ workflow_name: string;
2305
+ }[];
2306
+ };
2296
2307
  type WorkflowBinding = {
2297
2308
  /** The name of the binding used to refer to the Workflow */
2298
2309
  binding: string;
@@ -3493,4 +3504,4 @@ interface EnvironmentMap {
3493
3504
  }
3494
3505
  declare const defaultWranglerConfig: Config;
3495
3506
 
3496
- export { type CfMediaBinding as $, type Assets as A, type Binding as B, type ComputedFields as C, type DurableObjectExport as D, type Exports as E, type DockerConfiguration as F, type ContainerEngine as G, type CfScriptFormat as H, type CfModuleType as I, type CfModule as J, type CfVars as K, type Logger as L, type CfKvNamespace as M, type CfSendEmailBindings as N, type Observability as O, type PreviewsConfig as P, type CfWasmModuleBindings as Q, type RawConfig as R, type StreamingTailConsumer as S, type TailConsumer as T, type UserLimits as U, type CfTextBlobBindings as V, type WorkerEntrypointExport as W, type CfBrowserBinding as X, type CfAIBinding as Y, type ZoneIdRoute as Z, type CfImagesBinding as _, type RedirectedRawConfig as a, type Hook as a$, type CfStreamBinding as a0, type CfVersionMetadataBinding as a1, type CfDataBlobBindings as a2, type CfDurableObject as a3, type CfWorkflow as a4, type CfQueue as a5, type CfR2Bucket as a6, type CfD1Database as a7, type CfVectorize as a8, type CfAISearchNamespace as a9, type CfPlacement as aA, type CfTailConsumer as aB, type CfUserLimits as aC, type CfWorkerInit as aD, type CfWorkerContext as aE, type CfWorkerSourceMap as aF, type Json as aG, type AssetConfigMetadata as aH, type AssetsOptions as aI, type ValidatedAssetsOptions as aJ, type LegacyAssetPaths as aK, type WorkerMetadata as aL, type ExportsReconciliationEntryBase as aM, type ExportsReconciliationInfo as aN, type ExportsReconciliationWarning as aO, type ExportsReconciliationErrorDetail as aP, type ExportsReconciliationRename as aQ, type ExportsReconciliationTransfer as aR, type ExportsReconciliationTransferPending as aS, type ExportsReconciliationResult as aT, type ServiceMetadataRes as aU, type ServiceFetch as aV, type File as aW, type BinaryFile as aX, type Trigger as aY, type CfAccount as aZ, type HookValues as a_, type CfAISearch as aa, type CfWebSearch as ab, type CfAgentMemory as ac, type CfSecretsStoreSecrets as ad, type CfArtifacts as ae, type CfHelloWorld as af, type CfFlagship as ag, type CfWorkerLoader as ah, type CfRateLimit as ai, type CfHyperdrive as aj, type CfDevPluginCfg as ak, type CfService as al, type CfVpcService as am, type CfVpcNetwork as an, type CfAnalyticsEngineDataset as ao, type CfDispatchNamespace as ap, type CfMTlsCertificate as aq, type CfLogfwdr as ar, type CfLogfwdrBinding as as, type CfAssetsBinding as at, type CfPipeline as au, type CfUnsafeBinding as av, type CfCapnp as aw, type CfUnsafe as ax, type CfDurableObjectMigrations as ay, type CfExports as az, type Config as b, hasMorePages as b$, type AsyncHook as b0, type LogLevel as b1, type NodeJSCompatMode as b2, type StartDevWorkerInput as b3, type Entry as b4, INHERIT_SYMBOL as b5, SERVICE_TAG_PREFIX as b6, ENVIRONMENT_TAG_PREFIX as b7, PATH_TO_DEPLOY_CONFIG as b8, JSON_CONFIG_FORMATS as b9, getTraceHeader as bA, getDisableConfigWatching as bB, getWranglerHideBanner as bC, getCloudflareEnv as bD, getOpenNextDeployFromEnv as bE, getLocalExplorerEnabledFromEnv as bF, getLocalObservabilityEnabledFromEnv as bG, getBrowserRenderingHeadfulFromEnv as bH, getCfFetchEnabledFromEnv as bI, getCfFetchPathFromEnv as bJ, getWranglerCacheDirFromEnv as bK, getCloudflaredPathFromEnv as bL, type ApiCredentials as bM, type FetchResult as bN, type FetchResultFetcher as bO, type FetchListResultFetcher as bP, type FetchPagedListResultFetcher as bQ, performApiFetchBase as bR, fetchInternalBase as bS, fetchResultBase as bT, fetchListResultBase as bU, truncate as bV, isWAFBlockResponse as bW, parseRetryAfterValue as bX, parseRetryAfterMs as bY, extractWAFBlockRayId as bZ, extractAccountTag as b_, getC3CommandFromEnv as ba, getWranglerSendMetricsFromEnv as bb, getWranglerSendErrorReportsFromEnv as bc, getCloudflareApiEnvironmentFromEnv as bd, type ComplianceConfig as be, COMPLIANCE_REGION_CONFIG_PUBLIC as bf, COMPLIANCE_REGION_CONFIG_UNKNOWN as bg, getCloudflareComplianceRegion as bh, getCloudflareApiBaseUrl as bi, getComplianceRegionSubdomain as bj, getSanitizeLogs as bk, getOutputFileDirectoryFromEnv as bl, getOutputFilePathFromEnv as bm, getCIMatchTag as bn, getCIOverrideName as bo, getCIOverrideNetworkModeHost as bp, getCIGeneratePreviewAlias as bq, getWorkersCIBranchName as br, getBuildConditionsFromEnv as bs, getBuildPlatformFromEnv as bt, getRegistryPath as bu, getD1ExtraLocationChoices as bv, getDockerPath as bw, getSubdomainMixedStateCheckDisabled as bx, getCloudflareLoadDevVarsFromDotEnv as by, getCloudflareIncludeProcessEnvFromEnv as bz, type WorkerMetadataBinding as c, renderError as c0, addAuthorizationHeader as c1, throwFetchError as c2, fetchKVGetValueBase as c3, type FetchKVGetValueFetcher as c4, hasCursor as c5, maybeAddTraceHeader as c6, type Route as d, type RawDevConfig as e, type ConfigFields as f, type RawEnvironment as g, defaultWranglerConfig as h, LOGGER_LEVELS as i, type LoggerLevel as j, type Environment as k, type LocalS3Credentials as l, type ZoneNameRoute as m, type CustomDomainRoute as n, type CloudchamberConfig as o, type ContainerApp as p, type DurableObjectMigration as q, type DurableObjectExportStorage as r, type ConfiguredExport as s, type DurableObjectBindings as t, type WorkflowBinding as u, type EnvironmentNonInheritable as v, type Rule as w, type ConfigModuleRuleType as x, type DispatchNamespaceOutbound as y, type CacheOptions as z };
3507
+ export { type CfBrowserBinding as $, ARTIFACTS_EVENT_TYPES as A, type Binding as B, type ComputedFields as C, type DurableObjectExport as D, type Exports as E, type DispatchNamespaceOutbound as F, type Assets as G, type CacheOptions as H, type DockerConfiguration as I, type ContainerEngine as J, type CfScriptFormat as K, type Logger as L, type CfModuleType as M, type CfModule as N, type Observability as O, type PreviewsConfig as P, type CfVars as Q, type RawConfig as R, type StreamingTailConsumer as S, type TailConsumer as T, type UserLimits as U, type CfKvNamespace as V, type WorkerEntrypointExport as W, type CfSendEmailBindings as X, type CfWasmModuleBindings as Y, type ZoneIdRoute as Z, type CfTextBlobBindings as _, type RedirectedRawConfig as a, type Trigger as a$, type CfAIBinding as a0, type CfImagesBinding as a1, type CfMediaBinding as a2, type CfStreamBinding as a3, type CfVersionMetadataBinding as a4, type CfDataBlobBindings as a5, type CfDurableObject as a6, type CfWorkflow as a7, type CfQueue as a8, type CfR2Bucket as a9, type CfUnsafe as aA, type CfDurableObjectMigrations as aB, type CfExports as aC, type CfPlacement as aD, type CfTailConsumer as aE, type CfUserLimits as aF, type CfWorkerInit as aG, type CfWorkerContext as aH, type CfWorkerSourceMap as aI, type Json as aJ, type AssetConfigMetadata as aK, type AssetsOptions as aL, type ValidatedAssetsOptions as aM, type LegacyAssetPaths as aN, type WorkerMetadata as aO, type ExportsReconciliationEntryBase as aP, type ExportsReconciliationInfo as aQ, type ExportsReconciliationWarning as aR, type ExportsReconciliationErrorDetail as aS, type ExportsReconciliationRename as aT, type ExportsReconciliationTransfer as aU, type ExportsReconciliationTransferPending as aV, type ExportsReconciliationResult as aW, type ServiceMetadataRes as aX, type ServiceFetch as aY, type File as aZ, type BinaryFile as a_, type CfD1Database as aa, type CfVectorize as ab, type CfAISearchNamespace as ac, type CfAISearch as ad, type CfWebSearch as ae, type CfAgentMemory as af, type CfSecretsStoreSecrets as ag, type CfArtifacts as ah, type CfHelloWorld as ai, type CfFlagship as aj, type CfWorkerLoader as ak, type CfRateLimit as al, type CfHyperdrive as am, type CfDevPluginCfg as an, type CfService as ao, type CfVpcService as ap, type CfVpcNetwork as aq, type CfAnalyticsEngineDataset as ar, type CfDispatchNamespace as as, type CfMTlsCertificate as at, type CfLogfwdr as au, type CfLogfwdrBinding as av, type CfAssetsBinding as aw, type CfPipeline as ax, type CfUnsafeBinding as ay, type CfCapnp as az, type Config as b, parseRetryAfterMs as b$, type CfAccount as b0, type HookValues as b1, type Hook as b2, type AsyncHook as b3, type LogLevel as b4, type NodeJSCompatMode as b5, type StartDevWorkerInput as b6, type Entry as b7, INHERIT_SYMBOL as b8, SERVICE_TAG_PREFIX as b9, getSubdomainMixedStateCheckDisabled as bA, getCloudflareLoadDevVarsFromDotEnv as bB, getCloudflareIncludeProcessEnvFromEnv as bC, getTraceHeader as bD, getDisableConfigWatching as bE, getWranglerHideBanner as bF, getCloudflareEnv as bG, getOpenNextDeployFromEnv as bH, getLocalExplorerEnabledFromEnv as bI, getLocalObservabilityEnabledFromEnv as bJ, getBrowserRenderingHeadfulFromEnv as bK, getCfFetchEnabledFromEnv as bL, getCfFetchPathFromEnv as bM, getWranglerCacheDirFromEnv as bN, getCloudflaredPathFromEnv as bO, type ApiCredentials as bP, type FetchResult as bQ, type FetchResultFetcher as bR, type FetchListResultFetcher as bS, type FetchPagedListResultFetcher as bT, performApiFetchBase as bU, fetchInternalBase as bV, fetchResultBase as bW, fetchListResultBase as bX, truncate as bY, isWAFBlockResponse as bZ, parseRetryAfterValue as b_, ENVIRONMENT_TAG_PREFIX as ba, PATH_TO_DEPLOY_CONFIG as bb, JSON_CONFIG_FORMATS as bc, getC3CommandFromEnv as bd, getWranglerSendMetricsFromEnv as be, getWranglerSendErrorReportsFromEnv as bf, getCloudflareApiEnvironmentFromEnv as bg, type ComplianceConfig as bh, COMPLIANCE_REGION_CONFIG_PUBLIC as bi, COMPLIANCE_REGION_CONFIG_UNKNOWN as bj, getCloudflareComplianceRegion as bk, getCloudflareApiBaseUrl as bl, getComplianceRegionSubdomain as bm, getSanitizeLogs as bn, getOutputFileDirectoryFromEnv as bo, getOutputFilePathFromEnv as bp, getCIMatchTag as bq, getCIOverrideName as br, getCIOverrideNetworkModeHost as bs, getCIGeneratePreviewAlias as bt, getWorkersCIBranchName as bu, getBuildConditionsFromEnv as bv, getBuildPlatformFromEnv as bw, getRegistryPath as bx, getD1ExtraLocationChoices as by, getDockerPath as bz, type WorkerMetadataBinding as c, extractWAFBlockRayId as c0, extractAccountTag as c1, hasMorePages as c2, renderError as c3, addAuthorizationHeader as c4, throwFetchError as c5, fetchKVGetValueBase as c6, type FetchKVGetValueFetcher as c7, hasCursor as c8, maybeAddTraceHeader as c9, type Route as d, type RawDevConfig as e, type ConfigFields as f, type RawEnvironment as g, defaultWranglerConfig as h, LOGGER_LEVELS as i, type LoggerLevel as j, type Environment as k, type LocalS3Credentials as l, type ZoneNameRoute as m, type CustomDomainRoute as n, type CloudchamberConfig as o, type ContainerApp as p, type DurableObjectMigration as q, type DurableObjectExportStorage as r, type ConfiguredExport as s, type DurableObjectBindings as t, type ArtifactsEventType as u, type ArtifactsEventTrigger as v, type WorkflowBinding as w, type EnvironmentNonInheritable as x, type Rule as y, type ConfigModuleRuleType as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ComputedFields, B as Binding, R as RawConfig, b as Config, E as Exports, D as DurableObjectExport, W as WorkerEntrypointExport, c as WorkerMetadataBinding, L as Logger, d as Route } from './config-StQFc4Vs.mjs';
2
- export { bM as ApiCredentials, aH as AssetConfigMetadata, A as Assets, aI as AssetsOptions, b0 as AsyncHook, aX as BinaryFile, bf as COMPLIANCE_REGION_CONFIG_PUBLIC, bg as COMPLIANCE_REGION_CONFIG_UNKNOWN, z as CacheOptions, Y as CfAIBinding, aa as CfAISearch, a9 as CfAISearchNamespace, aZ as CfAccount, ac as CfAgentMemory, ao as CfAnalyticsEngineDataset, ae as CfArtifacts, at as CfAssetsBinding, X as CfBrowserBinding, aw as CfCapnp, a7 as CfD1Database, a2 as CfDataBlobBindings, ak as CfDevPluginCfg, ap as CfDispatchNamespace, a3 as CfDurableObject, ay as CfDurableObjectMigrations, az as CfExports, ag as CfFlagship, af as CfHelloWorld, aj as CfHyperdrive, _ as CfImagesBinding, M as CfKvNamespace, ar as CfLogfwdr, as as CfLogfwdrBinding, aq as CfMTlsCertificate, $ as CfMediaBinding, J as CfModule, I as CfModuleType, au as CfPipeline, aA as CfPlacement, a5 as CfQueue, a6 as CfR2Bucket, ai as CfRateLimit, H as CfScriptFormat, ad as CfSecretsStoreSecrets, N as CfSendEmailBindings, al as CfService, a0 as CfStreamBinding, aB as CfTailConsumer, V as CfTextBlobBindings, ax as CfUnsafe, av as CfUnsafeBinding, aC as CfUserLimits, K as CfVars, a8 as CfVectorize, a1 as CfVersionMetadataBinding, an as CfVpcNetwork, am as CfVpcService, Q as CfWasmModuleBindings, ab as CfWebSearch, aE as CfWorkerContext, aD as CfWorkerInit, ah as CfWorkerLoader, aF as CfWorkerSourceMap, a4 as CfWorkflow, o as CloudchamberConfig, be as ComplianceConfig, f as ConfigFields, x as ConfigModuleRuleType, s as ConfiguredExport, p as ContainerApp, G as ContainerEngine, n as CustomDomainRoute, y as DispatchNamespaceOutbound, F as DockerConfiguration, t as DurableObjectBindings, r as DurableObjectExportStorage, q as DurableObjectMigration, b7 as ENVIRONMENT_TAG_PREFIX, b4 as Entry, k as Environment, v as EnvironmentNonInheritable, aM as ExportsReconciliationEntryBase, aP as ExportsReconciliationErrorDetail, aN as ExportsReconciliationInfo, aQ as ExportsReconciliationRename, aT as ExportsReconciliationResult, aR as ExportsReconciliationTransfer, aS as ExportsReconciliationTransferPending, aO as ExportsReconciliationWarning, c4 as FetchKVGetValueFetcher, bP as FetchListResultFetcher, bQ as FetchPagedListResultFetcher, bN as FetchResult, bO as FetchResultFetcher, aW as File, a$ as Hook, a_ as HookValues, b5 as INHERIT_SYMBOL, b9 as JSON_CONFIG_FORMATS, aG as Json, i as LOGGER_LEVELS, aK as LegacyAssetPaths, l as LocalS3Credentials, b1 as LogLevel, j as LoggerLevel, b2 as NodeJSCompatMode, O as Observability, b8 as PATH_TO_DEPLOY_CONFIG, P as PreviewsConfig, e as RawDevConfig, g as RawEnvironment, a as RedirectedRawConfig, w as Rule, b6 as SERVICE_TAG_PREFIX, aV as ServiceFetch, aU as ServiceMetadataRes, b3 as StartDevWorkerInput, S as StreamingTailConsumer, T as TailConsumer, aY as Trigger, U as UserLimits, aJ as ValidatedAssetsOptions, aL as WorkerMetadata, u as WorkflowBinding, Z as ZoneIdRoute, m as ZoneNameRoute, c1 as addAuthorizationHeader, h as defaultWranglerConfig, b_ as extractAccountTag, bZ as extractWAFBlockRayId, bS as fetchInternalBase, c3 as fetchKVGetValueBase, bU as fetchListResultBase, bT as fetchResultBase, bH as getBrowserRenderingHeadfulFromEnv, bs as getBuildConditionsFromEnv, bt as getBuildPlatformFromEnv, ba as getC3CommandFromEnv, bq as getCIGeneratePreviewAlias, bn as getCIMatchTag, bo as getCIOverrideName, bp as getCIOverrideNetworkModeHost, bI as getCfFetchEnabledFromEnv, bJ as getCfFetchPathFromEnv, bi as getCloudflareApiBaseUrl, bd as getCloudflareApiEnvironmentFromEnv, bh as getCloudflareComplianceRegion, bD as getCloudflareEnv, bz as getCloudflareIncludeProcessEnvFromEnv, by as getCloudflareLoadDevVarsFromDotEnv, bL as getCloudflaredPathFromEnv, bj as getComplianceRegionSubdomain, bv as getD1ExtraLocationChoices, bB as getDisableConfigWatching, bw as getDockerPath, bF as getLocalExplorerEnabledFromEnv, bG as getLocalObservabilityEnabledFromEnv, bE as getOpenNextDeployFromEnv, bl as getOutputFileDirectoryFromEnv, bm as getOutputFilePathFromEnv, bu as getRegistryPath, bk as getSanitizeLogs, bx as getSubdomainMixedStateCheckDisabled, bA as getTraceHeader, br as getWorkersCIBranchName, bK as getWranglerCacheDirFromEnv, bC as getWranglerHideBanner, bc as getWranglerSendErrorReportsFromEnv, bb as getWranglerSendMetricsFromEnv, c5 as hasCursor, b$ as hasMorePages, bW as isWAFBlockResponse, c6 as maybeAddTraceHeader, bY as parseRetryAfterMs, bX as parseRetryAfterValue, bR as performApiFetchBase, c0 as renderError, c2 as throwFetchError, bV as truncate } from './config-StQFc4Vs.mjs';
1
+ import { C as ComputedFields, B as Binding, R as RawConfig, b as Config, E as Exports, D as DurableObjectExport, W as WorkerEntrypointExport, c as WorkerMetadataBinding, L as Logger, d as Route } from './config-CFrqMEcY.mjs';
2
+ export { A as ARTIFACTS_EVENT_TYPES, bP as ApiCredentials, v as ArtifactsEventTrigger, u as ArtifactsEventType, aK as AssetConfigMetadata, G as Assets, aL as AssetsOptions, b3 as AsyncHook, a_ as BinaryFile, bi as COMPLIANCE_REGION_CONFIG_PUBLIC, bj as COMPLIANCE_REGION_CONFIG_UNKNOWN, H as CacheOptions, a0 as CfAIBinding, ad as CfAISearch, ac as CfAISearchNamespace, b0 as CfAccount, af as CfAgentMemory, ar as CfAnalyticsEngineDataset, ah as CfArtifacts, aw as CfAssetsBinding, $ as CfBrowserBinding, az as CfCapnp, aa as CfD1Database, a5 as CfDataBlobBindings, an as CfDevPluginCfg, as as CfDispatchNamespace, a6 as CfDurableObject, aB as CfDurableObjectMigrations, aC as CfExports, aj as CfFlagship, ai as CfHelloWorld, am as CfHyperdrive, a1 as CfImagesBinding, V as CfKvNamespace, au as CfLogfwdr, av as CfLogfwdrBinding, at as CfMTlsCertificate, a2 as CfMediaBinding, N as CfModule, M as CfModuleType, ax as CfPipeline, aD as CfPlacement, a8 as CfQueue, a9 as CfR2Bucket, al as CfRateLimit, K as CfScriptFormat, ag as CfSecretsStoreSecrets, X as CfSendEmailBindings, ao as CfService, a3 as CfStreamBinding, aE as CfTailConsumer, _ as CfTextBlobBindings, aA as CfUnsafe, ay as CfUnsafeBinding, aF as CfUserLimits, Q as CfVars, ab as CfVectorize, a4 as CfVersionMetadataBinding, aq as CfVpcNetwork, ap as CfVpcService, Y as CfWasmModuleBindings, ae as CfWebSearch, aH as CfWorkerContext, aG as CfWorkerInit, ak as CfWorkerLoader, aI as CfWorkerSourceMap, a7 as CfWorkflow, o as CloudchamberConfig, bh as ComplianceConfig, f as ConfigFields, z as ConfigModuleRuleType, s as ConfiguredExport, p as ContainerApp, J as ContainerEngine, n as CustomDomainRoute, F as DispatchNamespaceOutbound, I as DockerConfiguration, t as DurableObjectBindings, r as DurableObjectExportStorage, q as DurableObjectMigration, ba as ENVIRONMENT_TAG_PREFIX, b7 as Entry, k as Environment, x as EnvironmentNonInheritable, aP as ExportsReconciliationEntryBase, aS as ExportsReconciliationErrorDetail, aQ as ExportsReconciliationInfo, aT as ExportsReconciliationRename, aW as ExportsReconciliationResult, aU as ExportsReconciliationTransfer, aV as ExportsReconciliationTransferPending, aR as ExportsReconciliationWarning, c7 as FetchKVGetValueFetcher, bS as FetchListResultFetcher, bT as FetchPagedListResultFetcher, bQ as FetchResult, bR as FetchResultFetcher, aZ as File, b2 as Hook, b1 as HookValues, b8 as INHERIT_SYMBOL, bc as JSON_CONFIG_FORMATS, aJ as Json, i as LOGGER_LEVELS, aN as LegacyAssetPaths, l as LocalS3Credentials, b4 as LogLevel, j as LoggerLevel, b5 as NodeJSCompatMode, O as Observability, bb as PATH_TO_DEPLOY_CONFIG, P as PreviewsConfig, e as RawDevConfig, g as RawEnvironment, a as RedirectedRawConfig, y as Rule, b9 as SERVICE_TAG_PREFIX, aY as ServiceFetch, aX as ServiceMetadataRes, b6 as StartDevWorkerInput, S as StreamingTailConsumer, T as TailConsumer, a$ as Trigger, U as UserLimits, aM as ValidatedAssetsOptions, aO as WorkerMetadata, w as WorkflowBinding, Z as ZoneIdRoute, m as ZoneNameRoute, c4 as addAuthorizationHeader, h as defaultWranglerConfig, c1 as extractAccountTag, c0 as extractWAFBlockRayId, bV as fetchInternalBase, c6 as fetchKVGetValueBase, bX as fetchListResultBase, bW as fetchResultBase, bK as getBrowserRenderingHeadfulFromEnv, bv as getBuildConditionsFromEnv, bw as getBuildPlatformFromEnv, bd as getC3CommandFromEnv, bt as getCIGeneratePreviewAlias, bq as getCIMatchTag, br as getCIOverrideName, bs as getCIOverrideNetworkModeHost, bL as getCfFetchEnabledFromEnv, bM as getCfFetchPathFromEnv, bl as getCloudflareApiBaseUrl, bg as getCloudflareApiEnvironmentFromEnv, bk as getCloudflareComplianceRegion, bG as getCloudflareEnv, bC as getCloudflareIncludeProcessEnvFromEnv, bB as getCloudflareLoadDevVarsFromDotEnv, bO as getCloudflaredPathFromEnv, bm as getComplianceRegionSubdomain, by as getD1ExtraLocationChoices, bE as getDisableConfigWatching, bz as getDockerPath, bI as getLocalExplorerEnabledFromEnv, bJ as getLocalObservabilityEnabledFromEnv, bH as getOpenNextDeployFromEnv, bo as getOutputFileDirectoryFromEnv, bp as getOutputFilePathFromEnv, bx as getRegistryPath, bn as getSanitizeLogs, bA as getSubdomainMixedStateCheckDisabled, bD as getTraceHeader, bu as getWorkersCIBranchName, bN as getWranglerCacheDirFromEnv, bF as getWranglerHideBanner, bf as getWranglerSendErrorReportsFromEnv, be as getWranglerSendMetricsFromEnv, c8 as hasCursor, c2 as hasMorePages, bZ as isWAFBlockResponse, c9 as maybeAddTraceHeader, b$ as parseRetryAfterMs, b_ as parseRetryAfterValue, bU as performApiFetchBase, c3 as renderError, c5 as throwFetchError, bY as truncate } from './config-CFrqMEcY.mjs';
3
3
  import * as jsoncParser from 'jsonc-parser';
4
4
  export { constructWranglerConfig } from './browser.mjs';
5
5
  export { GetGlobalConfigPathOptions, getGlobalConfigPath, getGlobalWranglerCachePath } from './global-wrangler-config-path.mjs';
package/dist/index.mjs CHANGED
@@ -1617,6 +1617,19 @@ var require_update_check = __commonJS({
1617
1617
  }
1618
1618
  });
1619
1619
 
1620
+ // src/config/environment.ts
1621
+ var ARTIFACTS_EVENT_TYPES = [
1622
+ "cf.artifacts.repo.created",
1623
+ "cf.artifacts.repo.deleted",
1624
+ "cf.artifacts.repo.forked",
1625
+ "cf.artifacts.repo.imported",
1626
+ "cf.artifacts.repo.pushed",
1627
+ "cf.artifacts.repo.cloned",
1628
+ "cf.artifacts.repo.fetched",
1629
+ "cf.artifacts.repo.token.created",
1630
+ "cf.artifacts.repo.token.revoked"
1631
+ ];
1632
+
1620
1633
  // src/config/durable-object-exports.ts
1621
1634
  function getDurableObjectExports(exports) {
1622
1635
  return partitionExports(exports)["durable-object"];
@@ -16996,7 +17009,7 @@ var getLocalExplorerEnabledFromEnv = getBooleanEnvironmentVariableFactory({
16996
17009
  });
16997
17010
  var getLocalObservabilityEnabledFromEnv = getBooleanEnvironmentVariableFactory({
16998
17011
  variableName: "X_LOCAL_OBSERVABILITY",
16999
- defaultValue: false
17012
+ defaultValue: true
17000
17013
  });
17001
17014
  var getBrowserRenderingHeadfulFromEnv = getBooleanEnvironmentVariableFactory({
17002
17015
  variableName: "X_BROWSER_HEADFUL",
@@ -18653,7 +18666,10 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
18653
18666
  rawEnv,
18654
18667
  envName,
18655
18668
  "containers",
18656
- validateContainerApp(envName, rawEnv.name, configPath),
18669
+ // `name` is inheritable, so a named environment that doesn't redeclare it
18670
+ // still runs under the top level Worker name — fall back to it so the
18671
+ // generated container name isn't built from `undefined`.
18672
+ validateContainerApp(envName, rawEnv.name ?? rawConfig?.name, configPath),
18657
18673
  void 0
18658
18674
  ),
18659
18675
  send_email: notInheritable(
@@ -19123,11 +19139,14 @@ var validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv
19123
19139
  []
19124
19140
  );
19125
19141
  }, "validateAndNormalizeRules");
19142
+ var ARTIFACTS_EVENT_TYPE_SET = new Set(
19143
+ ARTIFACTS_EVENT_TYPES
19144
+ );
19126
19145
  var validateTriggers = /* @__PURE__ */ __name((diagnostics, triggersFieldName, triggersValue) => {
19127
19146
  if (triggersValue === void 0 || triggersValue === null) {
19128
19147
  return true;
19129
19148
  }
19130
- if (typeof triggersValue !== "object") {
19149
+ if (typeof triggersValue !== "object" || Array.isArray(triggersValue)) {
19131
19150
  diagnostics.errors.push(
19132
19151
  `Expected "${triggersFieldName}" to be of type object but got ${JSON.stringify(
19133
19152
  triggersValue
@@ -19142,11 +19161,83 @@ var validateTriggers = /* @__PURE__ */ __name((diagnostics, triggersFieldName, t
19142
19161
  );
19143
19162
  isValid = false;
19144
19163
  }
19164
+ if (hasProperty(triggersValue, "events") && !Array.isArray(triggersValue.events)) {
19165
+ diagnostics.errors.push(
19166
+ `Expected "${triggersFieldName}.events" to be of type array, but got ${JSON.stringify(triggersValue)}.`
19167
+ );
19168
+ isValid = false;
19169
+ } else if (hasProperty(triggersValue, "events") && Array.isArray(triggersValue.events)) {
19170
+ for (const [eventIndex, event] of triggersValue.events.entries()) {
19171
+ const eventFieldName = `${triggersFieldName}.events[${eventIndex}]`;
19172
+ if (typeof event !== "object" || event === null || Array.isArray(event)) {
19173
+ diagnostics.errors.push(
19174
+ `Expected "${eventFieldName}" to be of type object, but got ${JSON.stringify(event)}.`
19175
+ );
19176
+ isValid = false;
19177
+ continue;
19178
+ }
19179
+ if (!isRequiredProperty(event, "type", "string") || !ARTIFACTS_EVENT_TYPE_SET.has(event.type)) {
19180
+ diagnostics.errors.push(
19181
+ `Expected "${eventFieldName}.type" to be a supported Artifacts event type, but got ${JSON.stringify(event.type)}.`
19182
+ );
19183
+ isValid = false;
19184
+ }
19185
+ if (hasProperty(event, "filter") && event.filter !== void 0) {
19186
+ if (typeof event.filter !== "object" || event.filter === null || Array.isArray(event.filter)) {
19187
+ diagnostics.errors.push(
19188
+ `Expected "${eventFieldName}.filter" to be of type object, but got ${JSON.stringify(event.filter)}.`
19189
+ );
19190
+ isValid = false;
19191
+ } else {
19192
+ for (const [filterName, filterValue] of Object.entries(
19193
+ event.filter
19194
+ )) {
19195
+ if (filterName !== "namespace" && filterName !== "repo_name" || typeof filterValue !== "string") {
19196
+ diagnostics.errors.push(
19197
+ `Expected "${eventFieldName}.filter" to contain only string "namespace" and "repo_name" fields, but got ${JSON.stringify(event.filter)}.`
19198
+ );
19199
+ isValid = false;
19200
+ break;
19201
+ }
19202
+ }
19203
+ }
19204
+ }
19205
+ if (!Array.isArray(event.targets) || event.targets.length === 0) {
19206
+ diagnostics.errors.push(
19207
+ `Expected "${eventFieldName}.targets" to be a non-empty array, but got ${JSON.stringify(event.targets)}.`
19208
+ );
19209
+ isValid = false;
19210
+ } else {
19211
+ for (const [targetIndex, target] of event.targets.entries()) {
19212
+ const targetFieldName = `${eventFieldName}.targets[${targetIndex}]`;
19213
+ if (typeof target !== "object" || target === null || Array.isArray(target) || target.type !== "workflow" || typeof target.workflow_name !== "string" || target.workflow_name.length === 0) {
19214
+ diagnostics.errors.push(
19215
+ `Expected "${targetFieldName}" to be a workflow target with a non-empty "workflow_name", but got ${JSON.stringify(target)}.`
19216
+ );
19217
+ isValid = false;
19218
+ continue;
19219
+ }
19220
+ validateAdditionalProperties(
19221
+ diagnostics,
19222
+ targetFieldName,
19223
+ Object.keys(target),
19224
+ ["type", "workflow_name"]
19225
+ );
19226
+ }
19227
+ }
19228
+ validateAdditionalProperties(
19229
+ diagnostics,
19230
+ eventFieldName,
19231
+ Object.keys(event),
19232
+ ["type", "filter", "targets"]
19233
+ );
19234
+ }
19235
+ }
19145
19236
  isValid = validateAdditionalProperties(
19146
19237
  diagnostics,
19147
19238
  triggersFieldName,
19148
19239
  Object.keys(triggersValue),
19149
- ["crons"]
19240
+ ["crons", "events"]
19150
19241
  ) && isValid;
19151
19242
  return isValid;
19152
19243
  }, "validateTriggers");
@@ -24970,4 +25061,4 @@ safe-buffer/index.js:
24970
25061
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
24971
25062
  */
24972
25063
 
24973
- export { BunPackageManager, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, _forceColour, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, formatZodError, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getPackagePath, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkerName, getWorkerNameFromProject, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHiddenDirPath, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasDurableObjectExports, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, renderError, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validatePagesConfig };
25064
+ export { ARTIFACTS_EVENT_TYPES, BunPackageManager, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, _forceColour, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, formatZodError, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getPackagePath, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkerName, getWorkerNameFromProject, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHiddenDirPath, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasDurableObjectExports, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, renderError, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validatePagesConfig };