@cloudflare/workers-utils 0.27.0 → 0.29.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.
@@ -1,4 +1,4 @@
1
- import { T as TailConsumer, aK as WorkerMetadata, R as RawConfig } from './config-CkPlrcrD.mjs';
1
+ import { T as TailConsumer, aL as WorkerMetadata, R as RawConfig } from './config-BEcnaWpD.mjs';
2
2
  import { AssetConfig } from '@cloudflare/workers-shared';
3
3
  import { Cloudflare } from 'cloudflare';
4
4
  import 'node:url';
package/dist/browser.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { constructWranglerConfig } from './chunk-ELQRF72O.mjs';
2
- import './chunk-DDRU76YD.mjs';
1
+ export { constructWranglerConfig } from './chunk-J6JRMPLM.mjs';
2
+ import './chunk-Q72B4Q5Z.mjs';
@@ -1,5 +1,5 @@
1
- import { isDirectory } from './chunk-OC543JY3.mjs';
2
- import { __name } from './chunk-DDRU76YD.mjs';
1
+ import { isDirectory } from './chunk-53IMCORZ.mjs';
2
+ import { __name } from './chunk-Q72B4Q5Z.mjs';
3
3
  import os from 'node:os';
4
4
  import path from 'node:path';
5
5
 
@@ -1,4 +1,4 @@
1
- import { __name } from './chunk-DDRU76YD.mjs';
1
+ import { __name } from './chunk-Q72B4Q5Z.mjs';
2
2
  import { readFileSync as readFileSync$1, statSync, existsSync } from 'node:fs';
3
3
  import path, { resolve, isAbsolute, dirname, join } from 'node:path';
4
4
 
@@ -2382,10 +2382,20 @@ var APIError = class extends ParseError {
2382
2382
  * endpoint-specific structured error payloads.
2383
2383
  */
2384
2384
  meta;
2385
- constructor({ status, ...rest }) {
2385
+ /**
2386
+ * Optional number of milliseconds the API asked us to wait before retrying,
2387
+ * derived from the response's `Retry-After` header (if present).
2388
+ */
2389
+ retryAfterMs;
2390
+ constructor({
2391
+ status,
2392
+ retryAfterMs,
2393
+ ...rest
2394
+ }) {
2386
2395
  super(rest);
2387
2396
  this.name = this.constructor.name;
2388
2397
  this.#status = status;
2398
+ this.retryAfterMs = retryAfterMs;
2389
2399
  }
2390
2400
  get status() {
2391
2401
  return this.#status;
@@ -1,4 +1,4 @@
1
- import { __name } from './chunk-DDRU76YD.mjs';
1
+ import { __name } from './chunk-Q72B4Q5Z.mjs';
2
2
  import fs from 'node:fs';
3
3
 
4
4
  function isDirectory(path) {
@@ -1,4 +1,4 @@
1
- import { __name } from './chunk-DDRU76YD.mjs';
1
+ import { __name } from './chunk-Q72B4Q5Z.mjs';
2
2
  import assert from 'node:assert';
3
3
 
4
4
  function isCompatDate(str) {
@@ -14,6 +14,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
14
14
  var __commonJS = (cb, mod) => function __require2() {
15
15
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
16
  };
17
+ var __export = (target, all) => {
18
+ for (var name in all)
19
+ __defProp(target, name, { get: all[name], enumerable: true });
20
+ };
17
21
  var __copyProps = (to, from, except, desc) => {
18
22
  if (from && typeof from === "object" || typeof from === "function") {
19
23
  for (let key of __getOwnPropNames(from))
@@ -31,4 +35,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
35
  mod
32
36
  ));
33
37
 
34
- export { __commonJS, __name, __require, __toESM };
38
+ export { __commonJS, __export, __name, __require, __toESM };
@@ -1,4 +1,4 @@
1
- import { __name } from './chunk-DDRU76YD.mjs';
1
+ import { __name } from './chunk-Q72B4Q5Z.mjs';
2
2
 
3
3
  // src/prometheus-metrics.ts
4
4
  var MetricsRegistry = class {
@@ -204,6 +204,21 @@ declare const getOpenNextDeployFromEnv: () => string | undefined;
204
204
  * `X_LOCAL_EXPLORER` enables the local explorer UI at /cdn-cgi/explorer.
205
205
  */
206
206
  declare const getLocalExplorerEnabledFromEnv: () => boolean;
207
+ /**
208
+ * `X_LOCAL_OBSERVABILITY` turns on local-dev observability capture. Both
209
+ * `wrangler dev` and the Vite plugin read it and pass it through as the one
210
+ * `unsafeObservability` Miniflare option, which makes core attach the trace
211
+ * collector to each user worker.
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.
220
+ */
221
+ declare const getLocalObservabilityEnabledFromEnv: () => boolean;
207
222
  /**
208
223
  * `X_BROWSER_HEADFUL` opens the browser in headful (visible) mode when using the
209
224
  * Browser Run API in local development.
@@ -286,6 +301,7 @@ type Logger = {
286
301
  warn: typeof console.warn;
287
302
  error: typeof console.error;
288
303
  };
304
+ console?<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
289
305
  };
290
306
 
291
307
  type ApiCredentials = {
@@ -316,11 +332,22 @@ declare function performApiFetchBase(complianceConfig: ComplianceConfig, resourc
316
332
  declare function fetchInternalBase<ResponseType>(complianceConfig: ComplianceConfig, resource: string, init: RequestInit | undefined, userAgent: string, logger: Logger, queryParams?: URLSearchParams, abortSignal?: AbortSignal, credentials?: ApiCredentials): Promise<{
317
333
  response: ResponseType;
318
334
  status: number;
335
+ retryAfterMs?: number;
319
336
  }>;
320
337
  declare function fetchResultBase<ResponseType>(complianceConfig: ComplianceConfig, resource: string, init: RequestInit | undefined, userAgent: string, logger: Logger, queryParams?: URLSearchParams, abortSignal?: AbortSignal, credentials?: ApiCredentials): Promise<ResponseType>;
321
338
  declare function fetchListResultBase<ResponseType>(complianceConfig: ComplianceConfig, resource: string, init: RequestInit | undefined, userAgent: string, logger: Logger, queryParams?: URLSearchParams, credentials?: ApiCredentials): Promise<ResponseType[]>;
322
339
  declare function truncate(text: string, maxLength: number): string;
323
340
  declare function isWAFBlockResponse(headers: Headers): boolean;
341
+ /**
342
+ * Parses a `Retry-After` header value (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
343
+ * into milliseconds to wait before retrying, or `undefined` if absent/unparsable.
344
+ *
345
+ * Per the HTTP spec, `Retry-After` may either be a number of delay-seconds,
346
+ * or an HTTP-date after which the request may be retried.
347
+ */
348
+ declare function parseRetryAfterValue(retryAfter: string | null | undefined): number | undefined;
349
+ /** Same as {@link parseRetryAfterValue}, reading the value from a `Headers` object. */
350
+ declare function parseRetryAfterMs(headers: Headers): number | undefined;
324
351
  declare function extractWAFBlockRayId(headers: Headers): string | undefined;
325
352
  declare function extractAccountTag(resource: string): string | undefined;
326
353
  interface PageResultInfo {
@@ -336,7 +363,7 @@ declare function renderError(err: FetchError | {
336
363
  documentation_url?: string;
337
364
  }, level?: number): string;
338
365
  declare function addAuthorizationHeader(headers: Headers, auth: ApiCredentials, overrideExisting?: boolean): void;
339
- declare function throwFetchError(resource: string, response: FetchResult<unknown>, status: number): never;
366
+ declare function throwFetchError(resource: string, response: FetchResult<unknown>, status: number, retryAfterMs?: number): never;
340
367
  /**
341
368
  * Fetch a raw KV value from the Cloudflare API.
342
369
  *
@@ -530,7 +557,7 @@ interface CfWorkflow {
530
557
  }
531
558
  interface CfQueue {
532
559
  binding: string;
533
- queue_name: string;
560
+ queue_name?: string | typeof INHERIT_SYMBOL;
534
561
  delivery_delay?: number;
535
562
  remote?: boolean;
536
563
  raw?: boolean;
@@ -541,6 +568,11 @@ interface CfR2Bucket {
541
568
  jurisdiction?: string;
542
569
  remote?: boolean;
543
570
  raw?: boolean;
571
+ /** Settings that only apply to local development */
572
+ local_dev?: {
573
+ /** EXPERIMENTAL: credentials for the local S3-compatible endpoint */
574
+ experimental_s3_credentials?: LocalS3Credentials;
575
+ };
544
576
  }
545
577
  interface CfD1Database {
546
578
  binding: string;
@@ -595,7 +627,7 @@ interface CfHelloWorld {
595
627
  }
596
628
  interface CfFlagship {
597
629
  binding: string;
598
- app_id: string;
630
+ app_id?: string | typeof INHERIT_SYMBOL;
599
631
  remote?: boolean;
600
632
  }
601
633
  interface CfWorkerLoader {
@@ -659,7 +691,7 @@ interface CfAnalyticsEngineDataset {
659
691
  }
660
692
  interface CfDispatchNamespace {
661
693
  binding: string;
662
- namespace: string;
694
+ namespace?: string | typeof INHERIT_SYMBOL;
663
695
  outbound?: {
664
696
  service: string;
665
697
  environment?: string;
@@ -1550,7 +1582,7 @@ type Entry = {
1550
1582
  /**
1551
1583
  * Wrangler configuration types. The JSDoc on these fields is also the source
1552
1584
  * of truth for the equivalent fields in `@cloudflare/config`
1553
- * (`packages/config/src/types.ts` — `UserConfig` — and the binding option
1585
+ * (`packages/config/src/types.ts` — `WorkerConfig` — and the binding option
1554
1586
  * interfaces in `packages/config/src/config.ts`). When editing prose here,
1555
1587
  * mirror the changes there.
1556
1588
  */
@@ -1564,6 +1596,11 @@ type Entry = {
1564
1596
  interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
1565
1597
  }
1566
1598
  type SimpleRoute = string;
1599
+ /** AWS SigV4 credentials for miniflare's local S3-compatible endpoint */
1600
+ interface LocalS3Credentials {
1601
+ accessKeyId: string;
1602
+ secretAccessKey: string;
1603
+ }
1567
1604
  type ZoneIdRoute = {
1568
1605
  pattern: string;
1569
1606
  zone_id: string;
@@ -2436,7 +2473,7 @@ interface EnvironmentNonInheritable {
2436
2473
  /** The binding name used to refer to the Queue in the Worker. */
2437
2474
  binding: string;
2438
2475
  /** The name of this Queue. */
2439
- queue: string;
2476
+ queue?: string;
2440
2477
  /** The number of seconds to wait before delivering a message */
2441
2478
  delivery_delay?: number;
2442
2479
  /** Whether the Queue producer should be remote or not in local development */
@@ -2486,6 +2523,16 @@ interface EnvironmentNonInheritable {
2486
2523
  jurisdiction?: string;
2487
2524
  /** Whether the R2 bucket should be remote or not in local development */
2488
2525
  remote?: boolean;
2526
+ /** Settings that only apply to local development */
2527
+ local_dev?: {
2528
+ /**
2529
+ * EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible
2530
+ * endpoint. When set, the bucket is served at
2531
+ * `/cdn-cgi/local/r2/s3/<bucket-name>` during local development.
2532
+ * Ignored when the bucket runs remotely.
2533
+ */
2534
+ experimental_s3_credentials?: LocalS3Credentials;
2535
+ };
2489
2536
  }[];
2490
2537
  /**
2491
2538
  * Specifies D1 databases that are bound to this Worker environment.
@@ -2863,7 +2910,7 @@ interface EnvironmentNonInheritable {
2863
2910
  /** The binding name used to refer to the bound service. */
2864
2911
  binding: string;
2865
2912
  /** The namespace to bind to. */
2866
- namespace: string;
2913
+ namespace?: string;
2867
2914
  /** Details about the outbound Worker which will handle outbound requests from your namespace */
2868
2915
  outbound?: DispatchNamespaceOutbound;
2869
2916
  /** Whether the Dispatch Namespace should be remote or not in local development */
@@ -2954,7 +3001,7 @@ interface EnvironmentNonInheritable {
2954
3001
  /** The binding name used to refer to the bound Flagship service. */
2955
3002
  binding: string;
2956
3003
  /** The Flagship app ID to bind to. */
2957
- app_id: string;
3004
+ app_id?: string;
2958
3005
  /** Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote. */
2959
3006
  remote?: boolean;
2960
3007
  }[];
@@ -3235,6 +3282,15 @@ interface ConfigFields<Dev extends RawDevConfig> {
3235
3282
  dependencies_instrumentation: {
3236
3283
  /** Whether dependency instrumentation is enabled. Defaults to `true`. */
3237
3284
  enabled: boolean;
3285
+ /**
3286
+ * An optional list of package name patterns to exclude from the
3287
+ * collected dependency metadata.
3288
+ *
3289
+ * Each entry can be an exact package name (e.g. `"lodash"`) or a glob
3290
+ * pattern using `*` as a wildcard (e.g. `"@internal/*"` to exclude all
3291
+ * packages under the `@internal` scope).
3292
+ */
3293
+ exclude_packages?: string[];
3238
3294
  } | undefined;
3239
3295
  /**
3240
3296
  * Options to configure the development server that your worker will use.
@@ -3330,6 +3386,19 @@ interface ConfigFields<Dev extends RawDevConfig> {
3330
3386
  * @nonInheritable
3331
3387
  */
3332
3388
  keep_vars?: boolean;
3389
+ /**
3390
+ * The inbound email addresses handled by the Worker being deployed.
3391
+ *
3392
+ * Each entry is a literal recipient address (e.g. `"support@example.com"`)
3393
+ * or a `*@domain` catch-all (e.g. `"*@example.com"`). Every entry creates an
3394
+ * Email Routing rule whose action routes mail to this Worker.
3395
+ *
3396
+ * This field is top-level only and applies to every environment of the
3397
+ * Worker; it cannot be set under `env.*`.
3398
+ *
3399
+ * @nonInheritable
3400
+ */
3401
+ addresses?: string[];
3333
3402
  }
3334
3403
  interface PagesConfigFields {
3335
3404
  /**
@@ -3424,4 +3493,4 @@ interface EnvironmentMap {
3424
3493
  }
3425
3494
  declare const defaultWranglerConfig: Config;
3426
3495
 
3427
- export { type CfStreamBinding as $, type Assets as A, type Binding as B, type ComputedFields as C, type DurableObjectExport as D, type Exports as E, type ContainerEngine as F, type CfScriptFormat as G, type CfModuleType as H, type CfModule as I, type CfVars as J, type CfKvNamespace as K, type Logger as L, type CfSendEmailBindings as M, type CfWasmModuleBindings as N, type Observability as O, type PreviewsConfig as P, type CfTextBlobBindings as Q, type RawConfig as R, type StreamingTailConsumer as S, type TailConsumer as T, type UserLimits as U, type CfBrowserBinding as V, type WorkerEntrypointExport as W, type CfAIBinding as X, type CfImagesBinding as Y, type ZoneIdRoute as Z, type CfMediaBinding as _, type RedirectedRawConfig as a, type AsyncHook as a$, type CfVersionMetadataBinding as a0, type CfDataBlobBindings as a1, type CfDurableObject as a2, type CfWorkflow as a3, type CfQueue as a4, type CfR2Bucket as a5, type CfD1Database as a6, type CfVectorize as a7, type CfAISearchNamespace as a8, type CfAISearch as a9, type CfTailConsumer as aA, type CfUserLimits as aB, type CfWorkerInit as aC, type CfWorkerContext as aD, type CfWorkerSourceMap as aE, type Json as aF, type AssetConfigMetadata as aG, type AssetsOptions as aH, type ValidatedAssetsOptions as aI, type LegacyAssetPaths as aJ, type WorkerMetadata as aK, type ExportsReconciliationEntryBase as aL, type ExportsReconciliationInfo as aM, type ExportsReconciliationWarning as aN, type ExportsReconciliationErrorDetail as aO, type ExportsReconciliationRename as aP, type ExportsReconciliationTransfer as aQ, type ExportsReconciliationTransferPending as aR, type ExportsReconciliationResult as aS, type ServiceMetadataRes as aT, type ServiceFetch as aU, type File as aV, type BinaryFile as aW, type Trigger as aX, type CfAccount as aY, type HookValues as aZ, type Hook as a_, type CfWebSearch as aa, type CfAgentMemory as ab, type CfSecretsStoreSecrets as ac, type CfArtifacts as ad, type CfHelloWorld as ae, type CfFlagship as af, type CfWorkerLoader as ag, type CfRateLimit as ah, type CfHyperdrive as ai, type CfDevPluginCfg as aj, type CfService as ak, type CfVpcService as al, type CfVpcNetwork as am, type CfAnalyticsEngineDataset as an, type CfDispatchNamespace as ao, type CfMTlsCertificate as ap, type CfLogfwdr as aq, type CfLogfwdrBinding as ar, type CfAssetsBinding as as, type CfPipeline as at, type CfUnsafeBinding as au, type CfCapnp as av, type CfUnsafe as aw, type CfDurableObjectMigrations as ax, type CfExports as ay, type CfPlacement as az, type Config as b, fetchKVGetValueBase as b$, type LogLevel as b0, type NodeJSCompatMode as b1, type StartDevWorkerInput as b2, type Entry as b3, INHERIT_SYMBOL as b4, SERVICE_TAG_PREFIX as b5, ENVIRONMENT_TAG_PREFIX as b6, PATH_TO_DEPLOY_CONFIG as b7, JSON_CONFIG_FORMATS as b8, getC3CommandFromEnv as b9, getDisableConfigWatching as bA, getWranglerHideBanner as bB, getCloudflareEnv as bC, getOpenNextDeployFromEnv as bD, getLocalExplorerEnabledFromEnv as bE, getBrowserRenderingHeadfulFromEnv as bF, getCfFetchEnabledFromEnv as bG, getCfFetchPathFromEnv as bH, getWranglerCacheDirFromEnv as bI, getCloudflaredPathFromEnv as bJ, type ApiCredentials as bK, type FetchResult as bL, type FetchResultFetcher as bM, type FetchListResultFetcher as bN, type FetchPagedListResultFetcher as bO, performApiFetchBase as bP, fetchInternalBase as bQ, fetchResultBase as bR, fetchListResultBase as bS, truncate as bT, isWAFBlockResponse as bU, extractWAFBlockRayId as bV, extractAccountTag as bW, hasMorePages as bX, renderError as bY, addAuthorizationHeader as bZ, throwFetchError as b_, getWranglerSendMetricsFromEnv as ba, getWranglerSendErrorReportsFromEnv as bb, getCloudflareApiEnvironmentFromEnv as bc, type ComplianceConfig as bd, COMPLIANCE_REGION_CONFIG_PUBLIC as be, COMPLIANCE_REGION_CONFIG_UNKNOWN as bf, getCloudflareComplianceRegion as bg, getCloudflareApiBaseUrl as bh, getComplianceRegionSubdomain as bi, getSanitizeLogs as bj, getOutputFileDirectoryFromEnv as bk, getOutputFilePathFromEnv as bl, getCIMatchTag as bm, getCIOverrideName as bn, getCIOverrideNetworkModeHost as bo, getCIGeneratePreviewAlias as bp, getWorkersCIBranchName as bq, getBuildConditionsFromEnv as br, getBuildPlatformFromEnv as bs, getRegistryPath as bt, getD1ExtraLocationChoices as bu, getDockerPath as bv, getSubdomainMixedStateCheckDisabled as bw, getCloudflareLoadDevVarsFromDotEnv as bx, getCloudflareIncludeProcessEnvFromEnv as by, getTraceHeader as bz, type WorkerMetadataBinding as c, type FetchKVGetValueFetcher as c0, hasCursor as c1, maybeAddTraceHeader as c2, 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 ZoneNameRoute as l, type CustomDomainRoute as m, type CloudchamberConfig as n, type ContainerApp as o, type DurableObjectMigration as p, type DurableObjectExportStorage as q, type ConfiguredExport as r, type DurableObjectBindings as s, type WorkflowBinding as t, type EnvironmentNonInheritable as u, type Rule as v, type ConfigModuleRuleType as w, type DispatchNamespaceOutbound as x, type CacheOptions as y, type DockerConfiguration as z };
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 };
@@ -1,2 +1,2 @@
1
- export { isDirectory, removeDir, removeDirSync } from './chunk-OC543JY3.mjs';
2
- import './chunk-DDRU76YD.mjs';
1
+ export { isDirectory, removeDir, removeDirSync } from './chunk-53IMCORZ.mjs';
2
+ import './chunk-Q72B4Q5Z.mjs';
@@ -1,3 +1,3 @@
1
- export { getGlobalConfigPath, getGlobalWranglerCachePath } from './chunk-OTBYAUQ6.mjs';
2
- import './chunk-OC543JY3.mjs';
3
- import './chunk-DDRU76YD.mjs';
1
+ export { getGlobalConfigPath, getGlobalWranglerCachePath } from './chunk-34VZWBGB.mjs';
2
+ import './chunk-53IMCORZ.mjs';
3
+ import './chunk-Q72B4Q5Z.mjs';
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-CkPlrcrD.mjs';
2
- export { bK as ApiCredentials, aG as AssetConfigMetadata, A as Assets, aH as AssetsOptions, a$ as AsyncHook, aW as BinaryFile, be as COMPLIANCE_REGION_CONFIG_PUBLIC, bf as COMPLIANCE_REGION_CONFIG_UNKNOWN, y as CacheOptions, X as CfAIBinding, a9 as CfAISearch, a8 as CfAISearchNamespace, aY as CfAccount, ab as CfAgentMemory, an as CfAnalyticsEngineDataset, ad as CfArtifacts, as as CfAssetsBinding, V as CfBrowserBinding, av as CfCapnp, a6 as CfD1Database, a1 as CfDataBlobBindings, aj as CfDevPluginCfg, ao as CfDispatchNamespace, a2 as CfDurableObject, ax as CfDurableObjectMigrations, ay as CfExports, af as CfFlagship, ae as CfHelloWorld, ai as CfHyperdrive, Y as CfImagesBinding, K as CfKvNamespace, aq as CfLogfwdr, ar as CfLogfwdrBinding, ap as CfMTlsCertificate, _ as CfMediaBinding, I as CfModule, H as CfModuleType, at as CfPipeline, az as CfPlacement, a4 as CfQueue, a5 as CfR2Bucket, ah as CfRateLimit, G as CfScriptFormat, ac as CfSecretsStoreSecrets, M as CfSendEmailBindings, ak as CfService, $ as CfStreamBinding, aA as CfTailConsumer, Q as CfTextBlobBindings, aw as CfUnsafe, au as CfUnsafeBinding, aB as CfUserLimits, J as CfVars, a7 as CfVectorize, a0 as CfVersionMetadataBinding, am as CfVpcNetwork, al as CfVpcService, N as CfWasmModuleBindings, aa as CfWebSearch, aD as CfWorkerContext, aC as CfWorkerInit, ag as CfWorkerLoader, aE as CfWorkerSourceMap, a3 as CfWorkflow, n as CloudchamberConfig, bd as ComplianceConfig, f as ConfigFields, w as ConfigModuleRuleType, r as ConfiguredExport, o as ContainerApp, F as ContainerEngine, m as CustomDomainRoute, x as DispatchNamespaceOutbound, z as DockerConfiguration, s as DurableObjectBindings, q as DurableObjectExportStorage, p as DurableObjectMigration, b6 as ENVIRONMENT_TAG_PREFIX, b3 as Entry, k as Environment, u as EnvironmentNonInheritable, aL as ExportsReconciliationEntryBase, aO as ExportsReconciliationErrorDetail, aM as ExportsReconciliationInfo, aP as ExportsReconciliationRename, aS as ExportsReconciliationResult, aQ as ExportsReconciliationTransfer, aR as ExportsReconciliationTransferPending, aN as ExportsReconciliationWarning, c0 as FetchKVGetValueFetcher, bN as FetchListResultFetcher, bO as FetchPagedListResultFetcher, bL as FetchResult, bM as FetchResultFetcher, aV as File, a_ as Hook, aZ as HookValues, b4 as INHERIT_SYMBOL, b8 as JSON_CONFIG_FORMATS, aF as Json, i as LOGGER_LEVELS, aJ as LegacyAssetPaths, b0 as LogLevel, j as LoggerLevel, b1 as NodeJSCompatMode, O as Observability, b7 as PATH_TO_DEPLOY_CONFIG, P as PreviewsConfig, e as RawDevConfig, g as RawEnvironment, a as RedirectedRawConfig, v as Rule, b5 as SERVICE_TAG_PREFIX, aU as ServiceFetch, aT as ServiceMetadataRes, b2 as StartDevWorkerInput, S as StreamingTailConsumer, T as TailConsumer, aX as Trigger, U as UserLimits, aI as ValidatedAssetsOptions, aK as WorkerMetadata, t as WorkflowBinding, Z as ZoneIdRoute, l as ZoneNameRoute, bZ as addAuthorizationHeader, h as defaultWranglerConfig, bW as extractAccountTag, bV as extractWAFBlockRayId, bQ as fetchInternalBase, b$ as fetchKVGetValueBase, bS as fetchListResultBase, bR as fetchResultBase, bF as getBrowserRenderingHeadfulFromEnv, br as getBuildConditionsFromEnv, bs as getBuildPlatformFromEnv, b9 as getC3CommandFromEnv, bp as getCIGeneratePreviewAlias, bm as getCIMatchTag, bn as getCIOverrideName, bo as getCIOverrideNetworkModeHost, bG as getCfFetchEnabledFromEnv, bH as getCfFetchPathFromEnv, bh as getCloudflareApiBaseUrl, bc as getCloudflareApiEnvironmentFromEnv, bg as getCloudflareComplianceRegion, bC as getCloudflareEnv, by as getCloudflareIncludeProcessEnvFromEnv, bx as getCloudflareLoadDevVarsFromDotEnv, bJ as getCloudflaredPathFromEnv, bi as getComplianceRegionSubdomain, bu as getD1ExtraLocationChoices, bA as getDisableConfigWatching, bv as getDockerPath, bE as getLocalExplorerEnabledFromEnv, bD as getOpenNextDeployFromEnv, bk as getOutputFileDirectoryFromEnv, bl as getOutputFilePathFromEnv, bt as getRegistryPath, bj as getSanitizeLogs, bw as getSubdomainMixedStateCheckDisabled, bz as getTraceHeader, bq as getWorkersCIBranchName, bI as getWranglerCacheDirFromEnv, bB as getWranglerHideBanner, bb as getWranglerSendErrorReportsFromEnv, ba as getWranglerSendMetricsFromEnv, c1 as hasCursor, bX as hasMorePages, bU as isWAFBlockResponse, c2 as maybeAddTraceHeader, bP as performApiFetchBase, bY as renderError, b_ as throwFetchError, bT as truncate } from './config-CkPlrcrD.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-BEcnaWpD.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-BEcnaWpD.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';
@@ -283,8 +283,14 @@ declare class APIError extends ParseError {
283
283
  meta?: {
284
284
  details?: unknown;
285
285
  } & Record<string, unknown>;
286
- constructor({ status, ...rest }: MessageInit & {
286
+ /**
287
+ * Optional number of milliseconds the API asked us to wait before retrying,
288
+ * derived from the response's `Retry-After` header (if present).
289
+ */
290
+ retryAfterMs?: number;
291
+ constructor({ status, retryAfterMs, ...rest }: MessageInit & {
287
292
  status?: number;
293
+ retryAfterMs?: number;
288
294
  });
289
295
  get status(): number | undefined;
290
296
  isGatewayError(): boolean;
@@ -560,6 +566,8 @@ type VariableNames =
560
566
  | "CLOUDFLARE_AUTH_USE_KEYRING"
561
567
  /** Enable the local explorer UI at /cdn-cgi/explorer (experimental, default: false). */
562
568
  | "X_LOCAL_EXPLORER"
569
+ /** Enable local-dev observability capture (experimental, default: false). */
570
+ | "X_LOCAL_OBSERVABILITY"
563
571
  /** Open the browser in headful (visible) mode when using the Browser Run API in local dev (default: false). */
564
572
  | "X_BROWSER_HEADFUL"
565
573
  /** Override command used by `wrangler init` (default: "create cloudflare"). */
@@ -899,7 +907,7 @@ declare function getHostFromUrl(urlLike: string): string | undefined;
899
907
  */
900
908
  interface PackageManager {
901
909
  /** The package manager identifier. */
902
- type: "npm" | "yarn" | "pnpm" | "bun";
910
+ type: "npm" | "yarn" | "pnpm" | "bun" | "nub";
903
911
  /** The command used to execute packages (e.g. `npx`, `pnpm`, `bunx`). */
904
912
  npx: string;
905
913
  /** The command segments used to download and execute packages (e.g. `["npx"]`, `["pnpm", "dlx"]`). */
@@ -943,6 +951,15 @@ declare const BunPackageManager: {
943
951
  readonly dlx: ["bunx"];
944
952
  readonly lockFiles: ["bun.lockb", "bun.lock"];
945
953
  };
954
+ /**
955
+ * Manage packages using nub.
956
+ */
957
+ declare const NubPackageManager: {
958
+ readonly type: "nub";
959
+ readonly npx: "nubx";
960
+ readonly dlx: ["nubx"];
961
+ readonly lockFiles: ["nub.lock"];
962
+ };
946
963
 
947
964
  /**
948
965
  * Checks whether the provided worker name is valid, this means that:
@@ -1012,4 +1029,4 @@ declare function getWorkerNameFromProject(projectPath: string): string;
1012
1029
  */
1013
1030
  declare const friendlyBindingNames: Record<ConfigBindingFieldName, string>;
1014
1031
 
1015
- export { APIError, Binding, type BindingLocalSupport, BunPackageManager, CommandLineArgsError, type CompatDate, Config, type ConfigBindingFieldName, type ConfigBindingOptions, type ConfigCache, type ConfigCacheOptions, DeprecationError, Diagnostics, DurableObjectExport, type EphemeralDirectory, type ExportType, Exports, FatalError, JsonFriendlyFatalError, type Location, Logger, type Message, MissingConfigError, type NormalizeAndValidateConfigArgs, NpmPackageManager, type NpmVersionCheckResult, type PackageJSON, type PackageManager, ParseError, type ParseFile, type PartitionedExports, PatchConfigError, PnpmPackageManager, RawConfig, type ResolveConfigPathOptions, Route, type TelemetryMessage, type Tunnel, type TunnelOptions, UserError, WorkerEntrypointExport, WorkerMetadataBinding, YarnPackageManager, assertNever, bucketFormatMessage, checkWorkerNameValidity, configFileName, configFormat, createConfigCache, createFatalError, experimental_patchConfig, experimental_readRawConfig, fetchLatestNpmVersion, findWranglerConfig, formatConfigSnippet, formatTime, friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getTodaysCompatDate, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasDurableObjectExports, hasProperty, indexLocation, isCI, isCompatDate, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRedirectedConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, openInBrowser, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, toValidWorkerName, validatePagesConfig };
1032
+ export { APIError, Binding, type BindingLocalSupport, BunPackageManager, CommandLineArgsError, type CompatDate, Config, type ConfigBindingFieldName, type ConfigBindingOptions, type ConfigCache, type ConfigCacheOptions, DeprecationError, Diagnostics, DurableObjectExport, type EphemeralDirectory, type ExportType, Exports, FatalError, JsonFriendlyFatalError, type Location, Logger, type Message, MissingConfigError, type NormalizeAndValidateConfigArgs, NpmPackageManager, type NpmVersionCheckResult, NubPackageManager, type PackageJSON, type PackageManager, ParseError, type ParseFile, type PartitionedExports, PatchConfigError, PnpmPackageManager, RawConfig, type ResolveConfigPathOptions, Route, type TelemetryMessage, type Tunnel, type TunnelOptions, UserError, WorkerEntrypointExport, WorkerMetadataBinding, YarnPackageManager, assertNever, bucketFormatMessage, checkWorkerNameValidity, configFileName, configFormat, createConfigCache, createFatalError, experimental_patchConfig, experimental_readRawConfig, fetchLatestNpmVersion, findWranglerConfig, formatConfigSnippet, formatTime, friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getTodaysCompatDate, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasDurableObjectExports, hasProperty, indexLocation, isCI, isCompatDate, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRedirectedConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, openInBrowser, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, toValidWorkerName, validatePagesConfig };