@cloudflare/workers-utils 0.26.0 → 0.28.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.
- package/dist/browser.d.mts +1 -1
- package/dist/browser.mjs +2 -2
- package/dist/{chunk-OTBYAUQ6.mjs → chunk-34VZWBGB.mjs} +2 -2
- package/dist/{chunk-OC543JY3.mjs → chunk-53IMCORZ.mjs} +1 -1
- package/dist/{chunk-ELQRF72O.mjs → chunk-J6JRMPLM.mjs} +1 -1
- package/dist/{chunk-DDRU76YD.mjs → chunk-Q72B4Q5Z.mjs} +5 -1
- package/dist/{chunk-27EBTAT2.mjs → chunk-Y3JVLYM6.mjs} +17 -5
- package/dist/{chunk-TJ6ANXA2.mjs → chunk-Z62CVNHJ.mjs} +1 -1
- package/dist/{config-D5W7gaPI.d.mts → config-BadLPAp8.d.mts} +30 -16
- package/dist/fs-helpers.mjs +2 -2
- package/dist/global-wrangler-config-path.mjs +3 -3
- package/dist/index.d.mts +117 -5
- package/dist/index.mjs +16052 -4369
- package/dist/metafile-esm.json +1 -1
- package/dist/open-PBXRGS4R.mjs +607 -0
- package/dist/prometheus-metrics.mjs +2 -2
- package/dist/test-helpers/index.d.mts +1 -1
- package/dist/test-helpers/index.mjs +12 -4
- package/package.json +5 -3
package/dist/browser.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TailConsumer, aK as WorkerMetadata, R as RawConfig } from './config-
|
|
1
|
+
import { T as TailConsumer, aK as WorkerMetadata, R as RawConfig } from './config-BadLPAp8.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-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { constructWranglerConfig } from './chunk-J6JRMPLM.mjs';
|
|
2
|
+
import './chunk-Q72B4Q5Z.mjs';
|
|
@@ -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-
|
|
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
|
|
|
@@ -2702,17 +2702,29 @@ __name(up, "up");
|
|
|
2702
2702
|
|
|
2703
2703
|
// ../../node_modules/.pnpm/empathic@2.0.0/node_modules/empathic/find.mjs
|
|
2704
2704
|
function file(name, options) {
|
|
2705
|
-
let
|
|
2705
|
+
let dir2, tmp;
|
|
2706
2706
|
let start = options && options.cwd || "";
|
|
2707
|
-
for (
|
|
2707
|
+
for (dir2 of up(start, options)) {
|
|
2708
2708
|
try {
|
|
2709
|
-
tmp = join(
|
|
2709
|
+
tmp = join(dir2, name);
|
|
2710
2710
|
if (statSync(tmp).isFile()) return tmp;
|
|
2711
2711
|
} catch {
|
|
2712
2712
|
}
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
2715
|
__name(file, "file");
|
|
2716
|
+
function dir(name, options) {
|
|
2717
|
+
let dir2, tmp;
|
|
2718
|
+
let start = options && options.cwd || "";
|
|
2719
|
+
for (dir2 of up(start, options)) {
|
|
2720
|
+
try {
|
|
2721
|
+
tmp = join(dir2, name);
|
|
2722
|
+
if (statSync(tmp).isDirectory()) return tmp;
|
|
2723
|
+
} catch {
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
__name(dir, "dir");
|
|
2716
2728
|
|
|
2717
2729
|
// ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
|
|
2718
2730
|
function dedent(templ) {
|
|
@@ -3179,4 +3191,4 @@ smol-toml/dist/index.js:
|
|
|
3179
3191
|
*)
|
|
3180
3192
|
*/
|
|
3181
3193
|
|
|
3182
|
-
export { APIError, CommandLineArgsError, DeprecationError, ENVIRONMENT_TAG_PREFIX, FatalError, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, JsonFriendlyFatalError, MissingConfigError, PATH_TO_DEPLOY_CONFIG, ParseError, SERVICE_TAG_PREFIX, UserError, applyEdits, configFileName, configFormat, createFatalError, dedent, dist_default, experimental_readRawConfig, findWranglerConfig, format2 as format, formatConfigSnippet, indexLocation, isRedirectedConfig, isRedirectedRawConfig, modify, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation };
|
|
3194
|
+
export { APIError, CommandLineArgsError, DeprecationError, ENVIRONMENT_TAG_PREFIX, FatalError, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, JsonFriendlyFatalError, MissingConfigError, PATH_TO_DEPLOY_CONFIG, ParseError, SERVICE_TAG_PREFIX, UserError, applyEdits, configFileName, configFormat, createFatalError, dedent, dir, dist_default, experimental_readRawConfig, findWranglerConfig, format2 as format, formatConfigSnippet, indexLocation, isRedirectedConfig, isRedirectedRawConfig, modify, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, searchLocation };
|
|
@@ -286,6 +286,7 @@ type Logger = {
|
|
|
286
286
|
warn: typeof console.warn;
|
|
287
287
|
error: typeof console.error;
|
|
288
288
|
};
|
|
289
|
+
console?<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
|
|
289
290
|
};
|
|
290
291
|
|
|
291
292
|
type ApiCredentials = {
|
|
@@ -530,7 +531,7 @@ interface CfWorkflow {
|
|
|
530
531
|
}
|
|
531
532
|
interface CfQueue {
|
|
532
533
|
binding: string;
|
|
533
|
-
queue_name
|
|
534
|
+
queue_name?: string | typeof INHERIT_SYMBOL;
|
|
534
535
|
delivery_delay?: number;
|
|
535
536
|
remote?: boolean;
|
|
536
537
|
raw?: boolean;
|
|
@@ -595,7 +596,7 @@ interface CfHelloWorld {
|
|
|
595
596
|
}
|
|
596
597
|
interface CfFlagship {
|
|
597
598
|
binding: string;
|
|
598
|
-
app_id
|
|
599
|
+
app_id?: string | typeof INHERIT_SYMBOL;
|
|
599
600
|
remote?: boolean;
|
|
600
601
|
}
|
|
601
602
|
interface CfWorkerLoader {
|
|
@@ -659,7 +660,7 @@ interface CfAnalyticsEngineDataset {
|
|
|
659
660
|
}
|
|
660
661
|
interface CfDispatchNamespace {
|
|
661
662
|
binding: string;
|
|
662
|
-
namespace
|
|
663
|
+
namespace?: string | typeof INHERIT_SYMBOL;
|
|
663
664
|
outbound?: {
|
|
664
665
|
service: string;
|
|
665
666
|
environment?: string;
|
|
@@ -811,7 +812,6 @@ interface CfWorkerInit {
|
|
|
811
812
|
}
|
|
812
813
|
interface CfWorkerContext {
|
|
813
814
|
env: string | undefined;
|
|
814
|
-
useServiceEnvironments: boolean | undefined;
|
|
815
815
|
zone: string | undefined;
|
|
816
816
|
host: string | undefined;
|
|
817
817
|
routes: Route[] | undefined;
|
|
@@ -1519,7 +1519,6 @@ interface StartDevWorkerInput {
|
|
|
1519
1519
|
};
|
|
1520
1520
|
legacy?: {
|
|
1521
1521
|
site?: Hook<Config["site"], [Config]>;
|
|
1522
|
-
useServiceEnvironments?: boolean;
|
|
1523
1522
|
};
|
|
1524
1523
|
unsafe?: Omit<CfUnsafe, "bindings">;
|
|
1525
1524
|
assets?: string;
|
|
@@ -1552,7 +1551,7 @@ type Entry = {
|
|
|
1552
1551
|
/**
|
|
1553
1552
|
* Wrangler configuration types. The JSDoc on these fields is also the source
|
|
1554
1553
|
* of truth for the equivalent fields in `@cloudflare/config`
|
|
1555
|
-
* (`packages/config/src/types.ts` — `
|
|
1554
|
+
* (`packages/config/src/types.ts` — `WorkerConfig` — and the binding option
|
|
1556
1555
|
* interfaces in `packages/config/src/config.ts`). When editing prose here,
|
|
1557
1556
|
* mirror the changes there.
|
|
1558
1557
|
*/
|
|
@@ -2438,7 +2437,7 @@ interface EnvironmentNonInheritable {
|
|
|
2438
2437
|
/** The binding name used to refer to the Queue in the Worker. */
|
|
2439
2438
|
binding: string;
|
|
2440
2439
|
/** The name of this Queue. */
|
|
2441
|
-
queue
|
|
2440
|
+
queue?: string;
|
|
2442
2441
|
/** The number of seconds to wait before delivering a message */
|
|
2443
2442
|
delivery_delay?: number;
|
|
2444
2443
|
/** Whether the Queue producer should be remote or not in local development */
|
|
@@ -2865,7 +2864,7 @@ interface EnvironmentNonInheritable {
|
|
|
2865
2864
|
/** The binding name used to refer to the bound service. */
|
|
2866
2865
|
binding: string;
|
|
2867
2866
|
/** The namespace to bind to. */
|
|
2868
|
-
namespace
|
|
2867
|
+
namespace?: string;
|
|
2869
2868
|
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
2870
2869
|
outbound?: DispatchNamespaceOutbound;
|
|
2871
2870
|
/** Whether the Dispatch Namespace should be remote or not in local development */
|
|
@@ -2956,7 +2955,7 @@ interface EnvironmentNonInheritable {
|
|
|
2956
2955
|
/** The binding name used to refer to the bound Flagship service. */
|
|
2957
2956
|
binding: string;
|
|
2958
2957
|
/** The Flagship app ID to bind to. */
|
|
2959
|
-
app_id
|
|
2958
|
+
app_id?: string;
|
|
2960
2959
|
/** Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote. */
|
|
2961
2960
|
remote?: boolean;
|
|
2962
2961
|
}[];
|
|
@@ -3213,13 +3212,6 @@ interface ComputedFields {
|
|
|
3213
3212
|
targetEnvironment: string | undefined;
|
|
3214
3213
|
}
|
|
3215
3214
|
interface ConfigFields<Dev extends RawDevConfig> {
|
|
3216
|
-
/**
|
|
3217
|
-
* A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
|
|
3218
|
-
* These have been superseded by Services, but there may be projects that won't
|
|
3219
|
-
* (or can't) use them. If you're using a legacy environment, you can set this
|
|
3220
|
-
* to `true` to enable it.
|
|
3221
|
-
*/
|
|
3222
|
-
legacy_env: boolean;
|
|
3223
3215
|
/**
|
|
3224
3216
|
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
3225
3217
|
*
|
|
@@ -3244,6 +3236,15 @@ interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
3244
3236
|
dependencies_instrumentation: {
|
|
3245
3237
|
/** Whether dependency instrumentation is enabled. Defaults to `true`. */
|
|
3246
3238
|
enabled: boolean;
|
|
3239
|
+
/**
|
|
3240
|
+
* An optional list of package name patterns to exclude from the
|
|
3241
|
+
* collected dependency metadata.
|
|
3242
|
+
*
|
|
3243
|
+
* Each entry can be an exact package name (e.g. `"lodash"`) or a glob
|
|
3244
|
+
* pattern using `*` as a wildcard (e.g. `"@internal/*"` to exclude all
|
|
3245
|
+
* packages under the `@internal` scope).
|
|
3246
|
+
*/
|
|
3247
|
+
exclude_packages?: string[];
|
|
3247
3248
|
} | undefined;
|
|
3248
3249
|
/**
|
|
3249
3250
|
* Options to configure the development server that your worker will use.
|
|
@@ -3339,6 +3340,19 @@ interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
3339
3340
|
* @nonInheritable
|
|
3340
3341
|
*/
|
|
3341
3342
|
keep_vars?: boolean;
|
|
3343
|
+
/**
|
|
3344
|
+
* The inbound email addresses handled by the Worker being deployed.
|
|
3345
|
+
*
|
|
3346
|
+
* Each entry is a literal recipient address (e.g. `"support@example.com"`)
|
|
3347
|
+
* or a `*@domain` catch-all (e.g. `"*@example.com"`). Every entry creates an
|
|
3348
|
+
* Email Routing rule whose action routes mail to this Worker.
|
|
3349
|
+
*
|
|
3350
|
+
* This field is top-level only and applies to every environment of the
|
|
3351
|
+
* Worker; it cannot be set under `env.*`.
|
|
3352
|
+
*
|
|
3353
|
+
* @nonInheritable
|
|
3354
|
+
*/
|
|
3355
|
+
addresses?: string[];
|
|
3342
3356
|
}
|
|
3343
3357
|
interface PagesConfigFields {
|
|
3344
3358
|
/**
|
package/dist/fs-helpers.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { isDirectory, removeDir, removeDirSync } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { isDirectory, removeDir, removeDirSync } from './chunk-53IMCORZ.mjs';
|
|
2
|
+
import './chunk-Q72B4Q5Z.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { getGlobalConfigPath, getGlobalWranglerCachePath } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
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-
|
|
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-
|
|
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-BadLPAp8.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-BadLPAp8.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';
|
|
@@ -102,7 +102,6 @@ declare function getBindingTypeFriendlyName(bindingType: Binding["type"]): strin
|
|
|
102
102
|
type NormalizeAndValidateConfigArgs = {
|
|
103
103
|
name?: string;
|
|
104
104
|
env?: string;
|
|
105
|
-
"legacy-env"?: boolean;
|
|
106
105
|
"dispatch-namespace"?: string;
|
|
107
106
|
remote?: boolean;
|
|
108
107
|
localProtocol?: string;
|
|
@@ -541,6 +540,8 @@ type VariableNames =
|
|
|
541
540
|
| "WRANGLER_AUTH_URL"
|
|
542
541
|
/** Custom OAuth client ID (usually auto-configured). */
|
|
543
542
|
| "WRANGLER_CLIENT_ID"
|
|
543
|
+
/** Custom OAuth client ID for the `cf` CLI's OAuth app (usually auto-configured). */
|
|
544
|
+
| "CLOUDFLARE_CLIENT_ID"
|
|
544
545
|
/** Custom token URL (usually auto-configured). */
|
|
545
546
|
| "WRANGLER_TOKEN_URL"
|
|
546
547
|
/** Custom token revocation URL (usually auto-configured). */
|
|
@@ -648,6 +649,38 @@ declare function isCompatDate(str: string): str is CompatDate;
|
|
|
648
649
|
*/
|
|
649
650
|
declare function getTodaysCompatDate(): CompatDate;
|
|
650
651
|
|
|
652
|
+
/**
|
|
653
|
+
* A file-backed key/value cache scoped to a consumer's cache directory.
|
|
654
|
+
*
|
|
655
|
+
* The mechanism is generic (JSON blobs keyed by file name); the only
|
|
656
|
+
* consumer-specific input is the logger used for debug output, so the whole
|
|
657
|
+
* bundle is built by {@link createConfigCache}. Wrangler wraps this with its
|
|
658
|
+
* logger singleton in `src/config-cache.ts`; `@cloudflare/workers-auth` builds
|
|
659
|
+
* its own instance with the logger injected into `createWranglerAuth`.
|
|
660
|
+
*/
|
|
661
|
+
interface ConfigCache {
|
|
662
|
+
getCacheFolder: () => string;
|
|
663
|
+
getConfigCache: <T>(fileName: string) => Partial<T>;
|
|
664
|
+
saveToConfigCache: <T>(fileName: string, newValues: Partial<T>) => void;
|
|
665
|
+
purgeConfigCaches: () => void;
|
|
666
|
+
}
|
|
667
|
+
interface ConfigCacheOptions {
|
|
668
|
+
/**
|
|
669
|
+
* Namespace for the cache directory, so different Cloudflare CLIs get
|
|
670
|
+
* isolated caches (`<node_modules>/.cache/<namespace>` or
|
|
671
|
+
* `.<namespace>/cache`). Defaults to `"wrangler"` for backward compatibility.
|
|
672
|
+
*
|
|
673
|
+
* `purgeConfigCaches()` deletes the whole cache folder, so a non-default
|
|
674
|
+
* namespace also ensures e.g. `cf login`/`logout` never wipes wrangler's
|
|
675
|
+
* cache.
|
|
676
|
+
*/
|
|
677
|
+
namespace?: string;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Build a file-backed config cache bound to the given logger.
|
|
681
|
+
*/
|
|
682
|
+
declare function createConfigCache(logger: Logger, options?: ConfigCacheOptions): ConfigCache;
|
|
683
|
+
|
|
651
684
|
/**
|
|
652
685
|
* A short-lived directory. Automatically removed when the process exits, but
|
|
653
686
|
* can be removed earlier by calling `remove()`.
|
|
@@ -753,6 +786,76 @@ type NpmVersionCheckResult = {
|
|
|
753
786
|
*/
|
|
754
787
|
declare function fetchLatestNpmVersion(name: string, version: string): Promise<NpmVersionCheckResult>;
|
|
755
788
|
|
|
789
|
+
/**
|
|
790
|
+
* Returns whether the process can handle interactive input (e.g. hotkeys).
|
|
791
|
+
*
|
|
792
|
+
* A process is considered interactive when **both** conditions are met:
|
|
793
|
+
* - It is **not** running in a Cloudflare CI environment (Pages or Workers CI).
|
|
794
|
+
* - `stdin` and `stdout` are connected to a TTY (not piped from/to another process).
|
|
795
|
+
*
|
|
796
|
+
* Note: generic CI environments (e.g. GitHub Actions) do **not** disable interactivity,
|
|
797
|
+
* because a real PTY may still be attached and hotkeys should still work.
|
|
798
|
+
*
|
|
799
|
+
* Use this for features that require a TTY but should remain functional in generic CI:
|
|
800
|
+
* - Registering hotkeys (e.g. `x` to exit `wrangler dev`)
|
|
801
|
+
* - Enabling raw mode / keypress handling
|
|
802
|
+
* - Showing animated spinners or progress indicators
|
|
803
|
+
* - Reading secrets from an interactive prompt vs stdin
|
|
804
|
+
*
|
|
805
|
+
* Use {@link isNonInteractiveOrCI} instead when user input should be suppressed
|
|
806
|
+
* in **all** CI environments.
|
|
807
|
+
*
|
|
808
|
+
* @returns `true` if the process is interactive, `false` otherwise.
|
|
809
|
+
*/
|
|
810
|
+
declare function isInteractive(): boolean;
|
|
811
|
+
/**
|
|
812
|
+
* Returns whether the process should not prompt the user.
|
|
813
|
+
*
|
|
814
|
+
* Returns `true` when the process is non-interactive (no TTY) **or** running
|
|
815
|
+
* in any CI environment (detected via `ci-info`). This is stricter than
|
|
816
|
+
* {@link isInteractive} which only checks for Cloudflare-specific CI,
|
|
817
|
+
* because user prompts should never appear in CI even when a PTY is attached.
|
|
818
|
+
*
|
|
819
|
+
* Use this for anything that should be suppressed or adapted in CI:
|
|
820
|
+
* - User prompts (confirmations, text input, select dialogs)
|
|
821
|
+
* - OAuth login flows
|
|
822
|
+
* - Output format decisions (JSON in CI, pretty when interactive)
|
|
823
|
+
* - Banner / decoration display
|
|
824
|
+
* - Redacting sensitive info (account names, emails) in CI logs
|
|
825
|
+
* - Writing config changes back to disk (e.g. provisioned resource IDs)
|
|
826
|
+
*
|
|
827
|
+
* @returns `true` if the process is non-interactive or running in CI.
|
|
828
|
+
*/
|
|
829
|
+
declare function isNonInteractiveOrCI(): boolean;
|
|
830
|
+
/**
|
|
831
|
+
* Whether the process is running in any CI environment (per `ci-info`).
|
|
832
|
+
*
|
|
833
|
+
* Distinct from {@link isNonInteractiveOrCI}: this ignores TTY state, so it is
|
|
834
|
+
* `true` only for genuine CI, not for merely non-interactive contexts (agents,
|
|
835
|
+
* piped commands). Used for behaviour that should key off CI specifically — e.g.
|
|
836
|
+
* redacting account names / emails in public CI logs while still showing them to
|
|
837
|
+
* non-interactive local tooling.
|
|
838
|
+
*
|
|
839
|
+
* Exposed from this package (rather than having consumers `import "ci-info"`
|
|
840
|
+
* directly) so the value flows through the mockable `ci-info` boundary and
|
|
841
|
+
* consumers don't take a fresh, unmockable dependency on it.
|
|
842
|
+
*/
|
|
843
|
+
declare function isCI(): boolean;
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Wrapper around the `open` package that gracefully handles environments where
|
|
847
|
+
* a browser opener (e.g. `xdg-open` on Linux) is unavailable. In those cases
|
|
848
|
+
* the URL is printed so the user can copy-paste it manually, rather than
|
|
849
|
+
* crashing with a confusing "file not found" error.
|
|
850
|
+
*
|
|
851
|
+
* The consumer's `logger` is passed in rather than imported: this package is
|
|
852
|
+
* shared across CLIs and has no logger singleton of its own.
|
|
853
|
+
*
|
|
854
|
+
* @param url the URL to point the browser at
|
|
855
|
+
* @param logger the consumer's logger, used to surface the manual-open fallback
|
|
856
|
+
*/
|
|
857
|
+
declare function openInBrowser(url: string, logger: Logger): Promise<void>;
|
|
858
|
+
|
|
756
859
|
declare function retryOnAPIFailure<T>(action: () => T | Promise<T>, logger: Logger, backoff?: number, attempts?: number, abortSignal?: AbortSignal): Promise<T>;
|
|
757
860
|
|
|
758
861
|
declare function formatTime(duration: number): string;
|
|
@@ -796,7 +899,7 @@ declare function getHostFromUrl(urlLike: string): string | undefined;
|
|
|
796
899
|
*/
|
|
797
900
|
interface PackageManager {
|
|
798
901
|
/** The package manager identifier. */
|
|
799
|
-
type: "npm" | "yarn" | "pnpm" | "bun";
|
|
902
|
+
type: "npm" | "yarn" | "pnpm" | "bun" | "nub";
|
|
800
903
|
/** The command used to execute packages (e.g. `npx`, `pnpm`, `bunx`). */
|
|
801
904
|
npx: string;
|
|
802
905
|
/** The command segments used to download and execute packages (e.g. `["npx"]`, `["pnpm", "dlx"]`). */
|
|
@@ -840,6 +943,15 @@ declare const BunPackageManager: {
|
|
|
840
943
|
readonly dlx: ["bunx"];
|
|
841
944
|
readonly lockFiles: ["bun.lockb", "bun.lock"];
|
|
842
945
|
};
|
|
946
|
+
/**
|
|
947
|
+
* Manage packages using nub.
|
|
948
|
+
*/
|
|
949
|
+
declare const NubPackageManager: {
|
|
950
|
+
readonly type: "nub";
|
|
951
|
+
readonly npx: "nubx";
|
|
952
|
+
readonly dlx: ["nubx"];
|
|
953
|
+
readonly lockFiles: ["nub.lock"];
|
|
954
|
+
};
|
|
843
955
|
|
|
844
956
|
/**
|
|
845
957
|
* Checks whether the provided worker name is valid, this means that:
|
|
@@ -909,4 +1021,4 @@ declare function getWorkerNameFromProject(projectPath: string): string;
|
|
|
909
1021
|
*/
|
|
910
1022
|
declare const friendlyBindingNames: Record<ConfigBindingFieldName, string>;
|
|
911
1023
|
|
|
912
|
-
export { APIError, Binding, type BindingLocalSupport, BunPackageManager, CommandLineArgsError, type CompatDate, Config, type ConfigBindingFieldName, type ConfigBindingOptions, 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, 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, isCompatDate, isDockerfile, isOptionalProperty, isPackageInstalled, isPagesConfig, isRedirectedConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, toValidWorkerName, validatePagesConfig };
|
|
1024
|
+
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 };
|