@cloudflare/workers-utils 0.40.1 → 0.41.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.
@@ -1759,10 +1759,11 @@ type ContainerApp = {
1759
1759
  image?: string;
1760
1760
  /**
1761
1761
  * Named images available to a Durable Object-managed container through
1762
- * `ctx.container.images` and
1763
- * `env.EXPERIMENTAL_CLOUDFLARE_CONTAINER_IMAGES[className]`.
1762
+ * `ctx.container.images`.
1764
1763
  *
1765
1764
  * Only supported when `scheduling_policy` is `"durable_object"`.
1765
+ * When omitted, run `wrangler deploy` to provision the application before
1766
+ * uploading versions. Version deployments use its existing application.
1766
1767
  */
1767
1768
  images?: Record<string, DurableObjectContainerImage>;
1768
1769
  /**
@@ -1,4 +1,4 @@
1
- export { q as COMPLIANCE_REGION_CONFIG_PUBLIC, r as COMPLIANCE_REGION_CONFIG_UNKNOWN, f as ComplianceConfig, bF as getCloudflareApiBaseUrl, bH as getCloudflareComplianceRegion, bI as getCloudflareContainerRegistry, bN as getComplianceRegionSubdomain } from './compliance-Bwzfy2P3.mjs';
1
+ export { q as COMPLIANCE_REGION_CONFIG_PUBLIC, r as COMPLIANCE_REGION_CONFIG_UNKNOWN, f as ComplianceConfig, bF as getCloudflareApiBaseUrl, bH as getCloudflareComplianceRegion, bI as getCloudflareContainerRegistry, bN as getComplianceRegionSubdomain } from './compliance-CLyWFvPo.mjs';
2
2
  import 'node:url';
3
3
  import 'undici';
4
4
  import '@cloudflare/workers-shared';
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 ContainerApp, d as WorkerMetadataBinding, e as CfTailConsumer, L as Logger, A as ApiCredentials, f as ComplianceConfig, g as Route } from './compliance-Bwzfy2P3.mjs';
2
- export { h as ARTIFACTS_EVENT_TYPES, i as Access, j as ArtifactsEventTrigger, k as ArtifactsEventType, l as AssetConfigMetadata, m as Assets, n as AssetsOptions, o as AsyncHook, p as BinaryFile, q as COMPLIANCE_REGION_CONFIG_PUBLIC, r as COMPLIANCE_REGION_CONFIG_UNKNOWN, s as CacheOptions, t as CfAIBinding, u as CfAISearch, v as CfAISearchNamespace, w as CfAccount, x as CfAgentMemory, y as CfAnalyticsEngineDataset, z as CfArtifacts, F as CfAssetsBinding, G as CfBrowserBinding, H as CfCapnp, I as CfD1Database, J as CfDataBlobBindings, K as CfDevPluginCfg, M as CfDispatchNamespace, N as CfDurableObject, O as CfDurableObjectMigrations, P as CfExports, Q as CfFlagship, S as CfHelloWorld, T as CfHyperdrive, U as CfImagesBinding, V as CfKvNamespace, X as CfLogfwdr, Y as CfLogfwdrBinding, Z as CfMTlsCertificate, _ as CfMediaBinding, $ as CfModule, a0 as CfModuleType, a1 as CfPipeline, a2 as CfPlacement, a3 as CfQueue, a4 as CfR2Bucket, a5 as CfRateLimit, a6 as CfScriptFormat, a7 as CfSecretsStoreSecrets, a8 as CfSendEmailBindings, a9 as CfService, aa as CfStreamBinding, ab as CfTextBlobBindings, ac as CfUnsafe, ad as CfUnsafeBinding, ae as CfUserLimits, af as CfVars, ag as CfVectorize, ah as CfVersionMetadataBinding, ai as CfVpcNetwork, aj as CfVpcService, ak as CfWasmModuleBindings, al as CfWorkerContext, am as CfWorkerInit, an as CfWorkerLoader, ao as CfWorkerSourceMap, ap as CfWorkflow, aq as CloudchamberConfig, ar as ConfigFields, as as ConfigModuleRuleType, at as ConfiguredExport, au as ContainerEngine, av as ContainerObservability, aw as CustomDomainRoute, ax as DispatchNamespaceOutbound, ay as DockerConfiguration, az as DurableObjectBindings, aA as DurableObjectContainerImage, aB as DurableObjectExportStorage, aC as DurableObjectMigration, aD as ENVIRONMENT_TAG_PREFIX, aE as Entry, aF as Environment, aG as EnvironmentNonInheritable, aH as ExportsReconciliationEntryBase, aI as ExportsReconciliationErrorDetail, aJ as ExportsReconciliationInfo, aK as ExportsReconciliationRename, aL as ExportsReconciliationResult, aM as ExportsReconciliationTransfer, aN as ExportsReconciliationTransferPending, aO as ExportsReconciliationWarning, aP as FetchKVGetValueFetcher, aQ as FetchListResultFetcher, aR as FetchPagedListResultFetcher, aS as FetchResult, aT as FetchResultFetcher, aU as File, aV as Hook, aW as HookValues, aX as INHERIT_SYMBOL, aY as JSON_CONFIG_FORMATS, aZ as Json, a_ as LOGGER_LEVELS, a$ as LegacyAssetPaths, b0 as LocalS3Credentials, b1 as LogLevel, b2 as LoggerLevel, b3 as NodeJSCompatMode, b4 as Observability, b5 as PATH_TO_DEPLOY_CONFIG, b6 as PreviewsConfig, b7 as RawDevConfig, b8 as RawEnvironment, a as RedirectedRawConfig, b9 as Rule, ba as SERVICE_TAG_PREFIX, bb as ServiceFetch, bc as ServiceMetadataRes, bd as StartDevWorkerInput, be as StreamingTailConsumer, bf as TailConsumer, bg as Trigger, bh as UserLimits, bi as ValidatedAssetsOptions, bj as WorkerMetadata, bk as WorkflowBinding, bl as ZoneIdRoute, bm as ZoneNameRoute, bn as addAuthorizationHeader, bo as defaultWranglerConfig, bp as extractAccountTag, bq as extractWAFBlockRayId, br as fetchInternalBase, bs as fetchKVGetValueBase, bt as fetchListResultBase, bu as fetchResultBase, bv as getBrowserRenderingHeadfulFromEnv, bw as getBuildConditionsFromEnv, bx as getBuildPlatformFromEnv, by as getC3CommandFromEnv, bz as getCIGeneratePreviewAlias, bA as getCIMatchTag, bB as getCIOverrideName, bC as getCIOverrideNetworkModeHost, bD as getCfFetchEnabledFromEnv, bE as getCfFetchPathFromEnv, bF as getCloudflareApiBaseUrl, bG as getCloudflareApiEnvironmentFromEnv, bH as getCloudflareComplianceRegion, bI as getCloudflareContainerRegistry, bJ as getCloudflareEnv, bK as getCloudflareIncludeProcessEnvFromEnv, bL as getCloudflareLoadDevVarsFromDotEnv, bM as getCloudflaredPathFromEnv, bN as getComplianceRegionSubdomain, bO as getD1ExtraLocationChoices, bP as getDisableConfigWatching, bQ as getLocalExplorerEnabledFromEnv, bR as getLocalObservabilityEnabledFromEnv, bS as getNoSkillsUpdatePromptsFromEnv, bT as getOpenNextDeployFromEnv, bU as getOutputFileDirectoryFromEnv, bV as getOutputFilePathFromEnv, bW as getRegistryPath, bX as getSanitizeLogs, bY as getSubdomainMixedStateCheckDisabled, bZ as getTraceHeader, b_ as getWorkersCIBranchName, b$ as getWranglerCacheDirFromEnv, c0 as getWranglerHideBanner, c1 as getWranglerSendErrorReportsFromEnv, c2 as getWranglerSendMetricsFromEnv, c3 as hasCursor, c4 as hasMorePages, c5 as isDoNotTrackEnabled, c6 as isWAFBlockResponse, c7 as maybeAddTraceHeader, c8 as parseRetryAfterMs, c9 as parseRetryAfterValue, ca as performApiFetchBase, cb as renderError, cc as throwFetchError, cd as truncate } from './compliance-Bwzfy2P3.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 ContainerApp, d as WorkerMetadataBinding, e as CfTailConsumer, L as Logger, A as ApiCredentials, f as ComplianceConfig, g as Route } from './compliance-CLyWFvPo.mjs';
2
+ export { h as ARTIFACTS_EVENT_TYPES, i as Access, j as ArtifactsEventTrigger, k as ArtifactsEventType, l as AssetConfigMetadata, m as Assets, n as AssetsOptions, o as AsyncHook, p as BinaryFile, q as COMPLIANCE_REGION_CONFIG_PUBLIC, r as COMPLIANCE_REGION_CONFIG_UNKNOWN, s as CacheOptions, t as CfAIBinding, u as CfAISearch, v as CfAISearchNamespace, w as CfAccount, x as CfAgentMemory, y as CfAnalyticsEngineDataset, z as CfArtifacts, F as CfAssetsBinding, G as CfBrowserBinding, H as CfCapnp, I as CfD1Database, J as CfDataBlobBindings, K as CfDevPluginCfg, M as CfDispatchNamespace, N as CfDurableObject, O as CfDurableObjectMigrations, P as CfExports, Q as CfFlagship, S as CfHelloWorld, T as CfHyperdrive, U as CfImagesBinding, V as CfKvNamespace, X as CfLogfwdr, Y as CfLogfwdrBinding, Z as CfMTlsCertificate, _ as CfMediaBinding, $ as CfModule, a0 as CfModuleType, a1 as CfPipeline, a2 as CfPlacement, a3 as CfQueue, a4 as CfR2Bucket, a5 as CfRateLimit, a6 as CfScriptFormat, a7 as CfSecretsStoreSecrets, a8 as CfSendEmailBindings, a9 as CfService, aa as CfStreamBinding, ab as CfTextBlobBindings, ac as CfUnsafe, ad as CfUnsafeBinding, ae as CfUserLimits, af as CfVars, ag as CfVectorize, ah as CfVersionMetadataBinding, ai as CfVpcNetwork, aj as CfVpcService, ak as CfWasmModuleBindings, al as CfWorkerContext, am as CfWorkerInit, an as CfWorkerLoader, ao as CfWorkerSourceMap, ap as CfWorkflow, aq as CloudchamberConfig, ar as ConfigFields, as as ConfigModuleRuleType, at as ConfiguredExport, au as ContainerEngine, av as ContainerObservability, aw as CustomDomainRoute, ax as DispatchNamespaceOutbound, ay as DockerConfiguration, az as DurableObjectBindings, aA as DurableObjectContainerImage, aB as DurableObjectExportStorage, aC as DurableObjectMigration, aD as ENVIRONMENT_TAG_PREFIX, aE as Entry, aF as Environment, aG as EnvironmentNonInheritable, aH as ExportsReconciliationEntryBase, aI as ExportsReconciliationErrorDetail, aJ as ExportsReconciliationInfo, aK as ExportsReconciliationRename, aL as ExportsReconciliationResult, aM as ExportsReconciliationTransfer, aN as ExportsReconciliationTransferPending, aO as ExportsReconciliationWarning, aP as FetchKVGetValueFetcher, aQ as FetchListResultFetcher, aR as FetchPagedListResultFetcher, aS as FetchResult, aT as FetchResultFetcher, aU as File, aV as Hook, aW as HookValues, aX as INHERIT_SYMBOL, aY as JSON_CONFIG_FORMATS, aZ as Json, a_ as LOGGER_LEVELS, a$ as LegacyAssetPaths, b0 as LocalS3Credentials, b1 as LogLevel, b2 as LoggerLevel, b3 as NodeJSCompatMode, b4 as Observability, b5 as PATH_TO_DEPLOY_CONFIG, b6 as PreviewsConfig, b7 as RawDevConfig, b8 as RawEnvironment, a as RedirectedRawConfig, b9 as Rule, ba as SERVICE_TAG_PREFIX, bb as ServiceFetch, bc as ServiceMetadataRes, bd as StartDevWorkerInput, be as StreamingTailConsumer, bf as TailConsumer, bg as Trigger, bh as UserLimits, bi as ValidatedAssetsOptions, bj as WorkerMetadata, bk as WorkflowBinding, bl as ZoneIdRoute, bm as ZoneNameRoute, bn as addAuthorizationHeader, bo as defaultWranglerConfig, bp as extractAccountTag, bq as extractWAFBlockRayId, br as fetchInternalBase, bs as fetchKVGetValueBase, bt as fetchListResultBase, bu as fetchResultBase, bv as getBrowserRenderingHeadfulFromEnv, bw as getBuildConditionsFromEnv, bx as getBuildPlatformFromEnv, by as getC3CommandFromEnv, bz as getCIGeneratePreviewAlias, bA as getCIMatchTag, bB as getCIOverrideName, bC as getCIOverrideNetworkModeHost, bD as getCfFetchEnabledFromEnv, bE as getCfFetchPathFromEnv, bF as getCloudflareApiBaseUrl, bG as getCloudflareApiEnvironmentFromEnv, bH as getCloudflareComplianceRegion, bI as getCloudflareContainerRegistry, bJ as getCloudflareEnv, bK as getCloudflareIncludeProcessEnvFromEnv, bL as getCloudflareLoadDevVarsFromDotEnv, bM as getCloudflaredPathFromEnv, bN as getComplianceRegionSubdomain, bO as getD1ExtraLocationChoices, bP as getDisableConfigWatching, bQ as getLocalExplorerEnabledFromEnv, bR as getLocalObservabilityEnabledFromEnv, bS as getNoSkillsUpdatePromptsFromEnv, bT as getOpenNextDeployFromEnv, bU as getOutputFileDirectoryFromEnv, bV as getOutputFilePathFromEnv, bW as getRegistryPath, bX as getSanitizeLogs, bY as getSubdomainMixedStateCheckDisabled, bZ as getTraceHeader, b_ as getWorkersCIBranchName, b$ as getWranglerCacheDirFromEnv, c0 as getWranglerHideBanner, c1 as getWranglerSendErrorReportsFromEnv, c2 as getWranglerSendMetricsFromEnv, c3 as hasCursor, c4 as hasMorePages, c5 as isDoNotTrackEnabled, c6 as isWAFBlockResponse, c7 as maybeAddTraceHeader, c8 as parseRetryAfterMs, c9 as parseRetryAfterValue, ca as performApiFetchBase, cb as renderError, cc as throwFetchError, cd as truncate } from './compliance-CLyWFvPo.mjs';
3
3
  import * as jsoncParser from 'jsonc-parser';
4
4
  import { UserError, TelemetryMessage } from './errors.mjs';
5
5
  export { CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, createFatalError } from './errors.mjs';
@@ -153,8 +153,6 @@ interface PartitionedExports {
153
153
  }
154
154
  declare function partitionExports(exports: Exports | undefined): PartitionedExports;
155
155
 
156
- /** Temporary Wrangler-owned image map until native Container image metadata is available. */
157
- declare const CONTAINER_IMAGES_BINDING = "EXPERIMENTAL_CLOUDFLARE_CONTAINER_IMAGES";
158
156
  type DurableObjectContainerApp = ContainerApp & {
159
157
  name: string;
160
158
  scheduling_policy: "durable_object";
@@ -1307,9 +1305,53 @@ type UrlPath = DiscriminatedPath<"UrlPath">;
1307
1305
  */
1308
1306
  declare function toUrlPath(filePath: string): UrlPath;
1309
1307
 
1308
+ type D1MigrationFile = {
1309
+ name: string;
1310
+ filePath: string;
1311
+ };
1312
+ type GetD1MigrationFilesOptions = {
1313
+ projectPath: string;
1314
+ migrationsDir?: string;
1315
+ migrationsPattern?: string;
1316
+ };
1317
+ /**
1318
+ * Discover D1 migration files under `projectPath` using the same glob rules as
1319
+ * Wrangler (`migrations_dir` / `migrations_pattern`).
1320
+ *
1321
+ * @param options.projectPath Directory the glob is resolved against (usually
1322
+ * the directory containing the Wrangler config).
1323
+ * @param options.migrationsDir Directory of migrations, relative to
1324
+ * `projectPath`. Defaults to `./migrations`.
1325
+ * @param options.migrationsPattern Glob relative to `projectPath`. Defaults to
1326
+ * `${migrationsDir}/*.sql`. Must start with `${migrationsDir}/` unless
1327
+ * `migrationsDir` is `"."`.
1328
+ * @returns Matching files sorted by {@link compareMigrationPaths}. `name` is
1329
+ * the path relative to `migrationsDir` with forward slashes.
1330
+ */
1331
+ declare function getD1MigrationFiles(options: GetD1MigrationFilesOptions): D1MigrationFile[];
1332
+ /**
1333
+ * Normalize a relative path or glob into a canonical form for string-prefix
1334
+ * comparisons:
1335
+ *
1336
+ * - Backslashes flipped to forward slashes.
1337
+ * - Leading `./` and `//` runs collapsed (via `path.posix.normalize`).
1338
+ * - Trailing `/` stripped (`normalize("foo/")` keeps it; we don't want it).
1339
+ */
1340
+ declare function normalizeRelativePath(p: string): string;
1341
+ /**
1342
+ * Compare two migration paths by the leading integer of each path
1343
+ * segment, falling back to lex order on ties. Numbered files sort before
1344
+ * unnumbered ones.
1345
+ *
1346
+ * Numeric ordering matters for users with inconsistently-padded numeric
1347
+ * prefixes (`1_a.sql`, `9_b.sql`, `10_c.sql`); a pure lex sort would put
1348
+ * `10_c.sql` between `1_a.sql` and `9_b.sql`.
1349
+ */
1350
+ declare function compareMigrationPaths(a: string, b: string): number;
1351
+
1310
1352
  /**
1311
1353
  * @deprecated new code should use getBindingTypeFriendlyName() instead
1312
1354
  */
1313
1355
  declare const friendlyBindingNames: Record<ConfigBindingFieldName, string>;
1314
1356
 
1315
- export { APIError, ApiCredentials, Binding, type BindingLocalSupport, BunPackageManager, CONTAINER_IMAGES_BINDING, CfTailConsumer, CompatDate, ComplianceConfig, Config, type ConfigBindingFieldName, type ConfigBindingOptions, type ConfigCache, type ConfigCacheOptions, ContainerApp, type ConvertBindingsOptions, DEFAULT_COMPAT_DATE, Diagnostics, type DurableObjectContainerApp, DurableObjectExport, type EphemeralDirectory, type ExportType, Exports, type Location, Logger, type Message, type NormalizeAndValidateConfigArgs, NpmPackageManager, type NpmVersionCheckResult, NubPackageManager, type OutputEntry, type PackageJSON, type PackageManager, ParseError, type ParseFile, type PartitionedExports, PatchConfigError, PnpmPackageManager, type PrintBindingsOptions, RawConfig, type ResolveConfigPathOptions, type ResolvedDurableObjectContainerApp, Route, TelemetryMessage, type Tunnel, type TunnelOptions, type UrlPath, UserError, WorkerEntrypointExport, WorkerMetadataBinding, YarnPackageManager, assertNever, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, configFileName, configFormat, convertConfigToBindings, createConfigCache, experimental_patchConfig, experimental_readRawConfig, extractBindingsOfType, fetchLatestNpmVersion, findWranglerConfig, formatConfigSnippet, formatTime, friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBindings, getBooleanEnvironmentVariableFactory, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectClassNameToUseSQLiteMap, getDurableObjectContainerApps, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getResolvedDurableObjectContainerApps, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasDurableObjectExports, hasProperty, indexLocation, isCI, isDockerfile, isDurableObjectContainerApp, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRedirectedConfig, isRequiredProperty, isUnsafeBindingType, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, openInBrowser, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, printBindings, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveNamedTunnel, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, toUrlPath, toValidWorkerName, validateBindingRemoteSetting, validateDurableObjectContainerApplications, validatePagesConfig, writeOutput };
1357
+ export { APIError, ApiCredentials, Binding, type BindingLocalSupport, BunPackageManager, CfTailConsumer, CompatDate, ComplianceConfig, Config, type ConfigBindingFieldName, type ConfigBindingOptions, type ConfigCache, type ConfigCacheOptions, ContainerApp, type ConvertBindingsOptions, type D1MigrationFile, DEFAULT_COMPAT_DATE, Diagnostics, type DurableObjectContainerApp, DurableObjectExport, type EphemeralDirectory, type ExportType, Exports, type GetD1MigrationFilesOptions, type Location, Logger, type Message, type NormalizeAndValidateConfigArgs, NpmPackageManager, type NpmVersionCheckResult, NubPackageManager, type OutputEntry, type PackageJSON, type PackageManager, ParseError, type ParseFile, type PartitionedExports, PatchConfigError, PnpmPackageManager, type PrintBindingsOptions, RawConfig, type ResolveConfigPathOptions, type ResolvedDurableObjectContainerApp, Route, TelemetryMessage, type Tunnel, type TunnelOptions, type UrlPath, UserError, WorkerEntrypointExport, WorkerMetadataBinding, YarnPackageManager, assertNever, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, compareMigrationPaths, configFileName, configFormat, convertConfigToBindings, createConfigCache, experimental_patchConfig, experimental_readRawConfig, extractBindingsOfType, fetchLatestNpmVersion, findWranglerConfig, formatConfigSnippet, formatTime, friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBindings, getBooleanEnvironmentVariableFactory, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getD1MigrationFiles, getDurableObjectClassNameToUseSQLiteMap, getDurableObjectContainerApps, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getResolvedDurableObjectContainerApps, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasDurableObjectExports, hasProperty, indexLocation, isCI, isDockerfile, isDurableObjectContainerApp, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRedirectedConfig, isRequiredProperty, isUnsafeBindingType, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, normalizeRelativePath, openInBrowser, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, printBindings, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveNamedTunnel, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, toUrlPath, toValidWorkerName, validateBindingRemoteSetting, validateDurableObjectContainerApplications, validatePagesConfig, writeOutput };