@cloudflare/workers-utils 0.24.0 → 0.25.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/{chunk-ULVYGN52.mjs → chunk-66IS76LR.mjs} +23 -1
- package/dist/{config-8UymS5SL.d.mts → config-B_-PmLum.d.mts} +153 -1
- package/dist/index.d.mts +35 -7
- package/dist/index.mjs +307 -42
- package/dist/metafile-esm.json +1 -1
- package/dist/test-helpers/index.d.mts +1 -1
- package/dist/test-helpers/index.mjs +1 -1
- package/package.json +1 -1
package/dist/browser.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TailConsumer,
|
|
1
|
+
import { T as TailConsumer, aK as WorkerMetadata, R as RawConfig } from './config-B_-PmLum.mjs';
|
|
2
2
|
import { AssetConfig } from '@cloudflare/workers-shared';
|
|
3
3
|
import { Cloudflare } from 'cloudflare';
|
|
4
4
|
import 'node:url';
|
|
@@ -2,6 +2,22 @@ import { __name } from './chunk-DCOBXSFB.mjs';
|
|
|
2
2
|
import fs, { readFileSync as readFileSync$1, statSync, existsSync } from 'node:fs';
|
|
3
3
|
import path, { resolve, isAbsolute, dirname, join } from 'node:path';
|
|
4
4
|
|
|
5
|
+
// src/config/exports.ts
|
|
6
|
+
function partitionExports(exports) {
|
|
7
|
+
const partitioned = {
|
|
8
|
+
"durable-object": {},
|
|
9
|
+
worker: {}
|
|
10
|
+
};
|
|
11
|
+
if (exports === void 0) {
|
|
12
|
+
return partitioned;
|
|
13
|
+
}
|
|
14
|
+
for (const [name, entry] of Object.entries(exports)) {
|
|
15
|
+
partitioned[entry.type][name] = entry;
|
|
16
|
+
}
|
|
17
|
+
return partitioned;
|
|
18
|
+
}
|
|
19
|
+
__name(partitionExports, "partitionExports");
|
|
20
|
+
|
|
5
21
|
// src/errors.ts
|
|
6
22
|
var UserError = class extends Error {
|
|
7
23
|
static {
|
|
@@ -2360,6 +2376,12 @@ var APIError = class extends ParseError {
|
|
|
2360
2376
|
#status;
|
|
2361
2377
|
code;
|
|
2362
2378
|
accountTag;
|
|
2379
|
+
/**
|
|
2380
|
+
* Optional structured metadata hoisted from the first `FetchError.meta`
|
|
2381
|
+
* on the v4 response envelope. Consumers can inspect this to render
|
|
2382
|
+
* endpoint-specific structured error payloads.
|
|
2383
|
+
*/
|
|
2384
|
+
meta;
|
|
2363
2385
|
constructor({ status, ...rest }) {
|
|
2364
2386
|
super(rest);
|
|
2365
2387
|
this.name = this.constructor.name;
|
|
@@ -3185,4 +3207,4 @@ smol-toml/dist/index.js:
|
|
|
3185
3207
|
*)
|
|
3186
3208
|
*/
|
|
3187
3209
|
|
|
3188
|
-
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, isDirectory, isRedirectedConfig, isRedirectedRawConfig, modify, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, removeDir, removeDirSync, resolveWranglerConfigPath, searchLocation };
|
|
3210
|
+
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, isDirectory, isRedirectedConfig, isRedirectedRawConfig, modify, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, removeDir, removeDirSync, resolveWranglerConfigPath, searchLocation };
|
|
@@ -7,6 +7,18 @@ interface FetchError {
|
|
|
7
7
|
documentation_url?: string;
|
|
8
8
|
message: string;
|
|
9
9
|
error_chain?: FetchError[];
|
|
10
|
+
/**
|
|
11
|
+
* Optional structured error metadata returned alongside the message. The
|
|
12
|
+
* Cloudflare v4 envelope permits a `meta` object whose shape varies by
|
|
13
|
+
* endpoint; consumers are expected to validate the shape at use site
|
|
14
|
+
* before relying on any field.
|
|
15
|
+
*
|
|
16
|
+
* Known usage: declarative DO exports reconciliation returns `meta.details`
|
|
17
|
+
* as an array of per-class errors.
|
|
18
|
+
*/
|
|
19
|
+
meta?: {
|
|
20
|
+
details?: unknown;
|
|
21
|
+
} & Record<string, unknown>;
|
|
10
22
|
}
|
|
11
23
|
|
|
12
24
|
/**
|
|
@@ -709,6 +721,12 @@ interface CfDurableObjectMigrations {
|
|
|
709
721
|
deleted_classes?: string[];
|
|
710
722
|
}[];
|
|
711
723
|
}
|
|
724
|
+
/**
|
|
725
|
+
* The declarative `exports` map keyed by class name.
|
|
726
|
+
*
|
|
727
|
+
* Durable Objects can only be configured by `exports` or `migrations`, not both.
|
|
728
|
+
*/
|
|
729
|
+
type CfExports = Exports;
|
|
712
730
|
type CfPlacement = {
|
|
713
731
|
mode: "smart";
|
|
714
732
|
hint?: string;
|
|
@@ -754,6 +772,11 @@ interface CfWorkerInit {
|
|
|
754
772
|
class_name: string;
|
|
755
773
|
}[] | undefined;
|
|
756
774
|
migrations: CfDurableObjectMigrations | undefined;
|
|
775
|
+
/**
|
|
776
|
+
* Declarative exports configuration. Durable Object entries are sent instead
|
|
777
|
+
* of `migrations`.
|
|
778
|
+
*/
|
|
779
|
+
exports: CfExports | undefined;
|
|
757
780
|
compatibility_date: string | undefined;
|
|
758
781
|
compatibility_flags: string[] | undefined;
|
|
759
782
|
keepVars: boolean | undefined;
|
|
@@ -1067,6 +1090,7 @@ type WorkerMetadataPut = {
|
|
|
1067
1090
|
compatibility_flags?: string[];
|
|
1068
1091
|
usage_model?: "bundled" | "unbound";
|
|
1069
1092
|
migrations?: CfDurableObjectMigrations;
|
|
1093
|
+
exports?: CfExports;
|
|
1070
1094
|
capnp_schema?: string;
|
|
1071
1095
|
bindings: WorkerMetadataBinding[];
|
|
1072
1096
|
keep_bindings?: (WorkerMetadataBinding["type"] | "secret_text" | "secret_key")[];
|
|
@@ -1089,6 +1113,62 @@ type WorkerMetadataVersionsPost = WorkerMetadataPut & {
|
|
|
1089
1113
|
annotations?: Record<string, string>;
|
|
1090
1114
|
};
|
|
1091
1115
|
type WorkerMetadata = WorkerMetadataPut | WorkerMetadataVersionsPost;
|
|
1116
|
+
/**
|
|
1117
|
+
* Structured per-class entry returned by the declarative exports
|
|
1118
|
+
* reconciliation flow.
|
|
1119
|
+
*
|
|
1120
|
+
* The same shape is used for both successful info entries (under
|
|
1121
|
+
* `exports_reconciliation.info[]`) and blocking errors (under the v4 error
|
|
1122
|
+
* envelope's `meta.details[]`). The `scenario` tag is the stable, machine-
|
|
1123
|
+
* readable identifier of which reconciliation case produced the entry.
|
|
1124
|
+
*/
|
|
1125
|
+
type ExportsReconciliationEntryBase = {
|
|
1126
|
+
class: string;
|
|
1127
|
+
scenario: string;
|
|
1128
|
+
message: string;
|
|
1129
|
+
namespace_id?: string;
|
|
1130
|
+
};
|
|
1131
|
+
type ExportsReconciliationInfo = ExportsReconciliationEntryBase & {
|
|
1132
|
+
/**
|
|
1133
|
+
* Workers in the account that still bind to the source class name and must
|
|
1134
|
+
* be redeployed before the tombstone is safe to remove.
|
|
1135
|
+
*/
|
|
1136
|
+
referencing_scripts?: string[];
|
|
1137
|
+
};
|
|
1138
|
+
type ExportsReconciliationWarning = ExportsReconciliationEntryBase;
|
|
1139
|
+
type ExportsReconciliationErrorDetail = ExportsReconciliationEntryBase & {
|
|
1140
|
+
suggestion?: string;
|
|
1141
|
+
referencing_scripts?: string[];
|
|
1142
|
+
};
|
|
1143
|
+
type ExportsReconciliationRename = {
|
|
1144
|
+
from: string;
|
|
1145
|
+
to: string;
|
|
1146
|
+
};
|
|
1147
|
+
type ExportsReconciliationTransfer = {
|
|
1148
|
+
class: string;
|
|
1149
|
+
to: string;
|
|
1150
|
+
phase: "committed";
|
|
1151
|
+
};
|
|
1152
|
+
type ExportsReconciliationTransferPending = {
|
|
1153
|
+
class: string;
|
|
1154
|
+
from: string;
|
|
1155
|
+
};
|
|
1156
|
+
/**
|
|
1157
|
+
* The customer-visible summary of a successful exports reconciliation,
|
|
1158
|
+
* embedded in the upload response under `exports_reconciliation`. All arrays
|
|
1159
|
+
* are present, and are empty when there are no entries to report.
|
|
1160
|
+
*/
|
|
1161
|
+
type ExportsReconciliationResult = {
|
|
1162
|
+
created: string[];
|
|
1163
|
+
updated: string[];
|
|
1164
|
+
deleted: string[];
|
|
1165
|
+
renamed: ExportsReconciliationRename[];
|
|
1166
|
+
transferred: ExportsReconciliationTransfer[];
|
|
1167
|
+
transfer_pending: ExportsReconciliationTransferPending[];
|
|
1168
|
+
warnings: ExportsReconciliationWarning[];
|
|
1169
|
+
info: ExportsReconciliationInfo[];
|
|
1170
|
+
removable_entries: string[];
|
|
1171
|
+
};
|
|
1092
1172
|
type ServiceMetadataRes = {
|
|
1093
1173
|
id: string;
|
|
1094
1174
|
default_environment: {
|
|
@@ -1312,6 +1392,7 @@ interface StartDevWorkerInput {
|
|
|
1312
1392
|
type: "plain_text";
|
|
1313
1393
|
}>>;
|
|
1314
1394
|
migrations?: DurableObjectMigration[];
|
|
1395
|
+
exports?: Exports;
|
|
1315
1396
|
containers?: ContainerApp[];
|
|
1316
1397
|
/** The triggers which will cause the worker's exported default handlers to be called. */
|
|
1317
1398
|
triggers?: Trigger[];
|
|
@@ -1753,6 +1834,66 @@ type DurableObjectMigration = {
|
|
|
1753
1834
|
/** The Durable Objects being removed. */
|
|
1754
1835
|
deleted_classes?: string[];
|
|
1755
1836
|
};
|
|
1837
|
+
/**
|
|
1838
|
+
* Storage backend for a declarative Durable Object export. See
|
|
1839
|
+
* {@link DurableObjectExport}.
|
|
1840
|
+
*/
|
|
1841
|
+
type DurableObjectExportStorage = "sqlite" | "legacy-kv";
|
|
1842
|
+
/**
|
|
1843
|
+
* A single declarative Durable Object export entry in the `exports` config
|
|
1844
|
+
* map. `type` is reserved for the export kind. `state` carries the Durable
|
|
1845
|
+
* Object lifecycle and defaults to `"created"` (live) when omitted.
|
|
1846
|
+
*
|
|
1847
|
+
* Mutually exclusive with {@link DurableObjectMigration} at the config-
|
|
1848
|
+
* validation boundary.
|
|
1849
|
+
*
|
|
1850
|
+
* - `created` (default, live): `storage` is required.
|
|
1851
|
+
* - `deleted` (tombstone): retire a provisioned namespace whose class has
|
|
1852
|
+
* been removed from code.
|
|
1853
|
+
* - `renamed` (tombstone): rewrite a provisioned namespace's class name to
|
|
1854
|
+
* `renamed_to`. The target name must also appear as a live (state
|
|
1855
|
+
* `"created"`) `durable-object` entry in the same map.
|
|
1856
|
+
* - `transferred` (tombstone): hand ownership of the namespace to another
|
|
1857
|
+
* script in the same account (`transferred_to`). Two-phase commit;
|
|
1858
|
+
* the target must first deploy an `expecting-transfer` entry naming this
|
|
1859
|
+
* script via `transfer_from`.
|
|
1860
|
+
* - `expecting-transfer` (live): receiving side of a two-phase transfer;
|
|
1861
|
+
* `storage` and `transfer_from` are both required.
|
|
1862
|
+
*/
|
|
1863
|
+
type DurableObjectExport = {
|
|
1864
|
+
type: "durable-object";
|
|
1865
|
+
state?: "created";
|
|
1866
|
+
storage: DurableObjectExportStorage;
|
|
1867
|
+
} | {
|
|
1868
|
+
type: "durable-object";
|
|
1869
|
+
state: "deleted";
|
|
1870
|
+
} | {
|
|
1871
|
+
type: "durable-object";
|
|
1872
|
+
state: "renamed";
|
|
1873
|
+
renamed_to: string;
|
|
1874
|
+
} | {
|
|
1875
|
+
type: "durable-object";
|
|
1876
|
+
state: "transferred";
|
|
1877
|
+
transferred_to: string;
|
|
1878
|
+
} | {
|
|
1879
|
+
type: "durable-object";
|
|
1880
|
+
state: "expecting-transfer";
|
|
1881
|
+
storage: DurableObjectExportStorage;
|
|
1882
|
+
transfer_from: string;
|
|
1883
|
+
};
|
|
1884
|
+
interface WorkerEntrypointExport {
|
|
1885
|
+
type: "worker";
|
|
1886
|
+
cache?: {
|
|
1887
|
+
/** Whether cache is enabled for this entrypoint. */
|
|
1888
|
+
enabled: boolean;
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
type ConfiguredExport = DurableObjectExport | WorkerEntrypointExport;
|
|
1892
|
+
/**
|
|
1893
|
+
* The declarative `exports` map keyed by export name. Durable Object exports
|
|
1894
|
+
* are mutually exclusive with `migrations` at the wrangler config layer.
|
|
1895
|
+
*/
|
|
1896
|
+
type Exports = Record<string, ConfiguredExport>;
|
|
1756
1897
|
/**
|
|
1757
1898
|
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
|
1758
1899
|
* that can be inherited (and overridden) from the top-level environment.
|
|
@@ -1894,6 +2035,15 @@ interface EnvironmentInheritable {
|
|
|
1894
2035
|
* @inheritable
|
|
1895
2036
|
*/
|
|
1896
2037
|
migrations: DurableObjectMigration[];
|
|
2038
|
+
/**
|
|
2039
|
+
* Declarative exports configuration — a map of class name to export configuration.
|
|
2040
|
+
*
|
|
2041
|
+
* The configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.
|
|
2042
|
+
*
|
|
2043
|
+
* @default {}
|
|
2044
|
+
* @inheritable
|
|
2045
|
+
*/
|
|
2046
|
+
exports: Exports;
|
|
1897
2047
|
/**
|
|
1898
2048
|
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
|
1899
2049
|
*
|
|
@@ -2977,6 +3127,8 @@ interface Observability {
|
|
|
2977
3127
|
interface CacheOptions {
|
|
2978
3128
|
/** If cache is enabled for this Worker */
|
|
2979
3129
|
enabled: boolean;
|
|
3130
|
+
/** Whether cached assets may be reused across Worker versions. */
|
|
3131
|
+
cross_version_cache?: boolean;
|
|
2980
3132
|
}
|
|
2981
3133
|
type DockerConfiguration = {
|
|
2982
3134
|
/** Socket used by miniflare to communicate with Docker */
|
|
@@ -3249,4 +3401,4 @@ interface EnvironmentMap {
|
|
|
3249
3401
|
}
|
|
3250
3402
|
declare const defaultWranglerConfig: Config;
|
|
3251
3403
|
|
|
3252
|
-
export { type
|
|
3404
|
+
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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ComputedFields, B as Binding, R as RawConfig, b as Config, W as WorkerMetadataBinding, L as Logger,
|
|
2
|
-
export {
|
|
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-B_-PmLum.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-B_-PmLum.mjs';
|
|
3
3
|
import * as jsoncParser from 'jsonc-parser';
|
|
4
4
|
export { constructWranglerConfig } from './browser.mjs';
|
|
5
5
|
export { Counter, MetricsRegistry } from './prometheus-metrics.mjs';
|
|
@@ -93,10 +93,6 @@ declare const bucketFormatMessage = "Bucket names must begin and end with an alp
|
|
|
93
93
|
* These are the keys used in Wrangler's config file
|
|
94
94
|
*/
|
|
95
95
|
type ConfigBindingFieldName = "data_blobs" | "durable_objects" | "kv_namespaces" | "send_email" | "queues" | "d1_databases" | "vectorize" | "ai_search_namespaces" | "ai_search" | "websearch" | "agent_memory" | "hyperdrive" | "r2_buckets" | "logfwdr" | "services" | "analytics_engine_datasets" | "text_blobs" | "browser" | "ai" | "images" | "stream" | "media" | "version_metadata" | "unsafe" | "vars" | "wasm_modules" | "dispatch_namespaces" | "mtls_certificates" | "workflows" | "pipelines" | "secrets_store_secrets" | "artifacts" | "ratelimits" | "assets" | "unsafe_hello_world" | "flagship" | "worker_loaders" | "vpc_services" | "vpc_networks";
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated new code should use getBindingTypeFriendlyName() instead
|
|
98
|
-
*/
|
|
99
|
-
declare const friendlyBindingNames: Record<ConfigBindingFieldName, string>;
|
|
100
96
|
/**
|
|
101
97
|
* Get a friendly name for a binding type, handling unsafe bindings
|
|
102
98
|
*/
|
|
@@ -142,6 +138,13 @@ declare function normalizeAndValidateConfig(rawConfig: RawConfig, configPath: st
|
|
|
142
138
|
*/
|
|
143
139
|
declare function isDockerfile(imagePath: string, configPath: string | undefined): boolean;
|
|
144
140
|
|
|
141
|
+
type ExportType = Exports[string]["type"];
|
|
142
|
+
interface PartitionedExports {
|
|
143
|
+
"durable-object": Record<string, DurableObjectExport>;
|
|
144
|
+
worker: Record<string, WorkerEntrypointExport>;
|
|
145
|
+
}
|
|
146
|
+
declare function partitionExports(exports: Exports | undefined): PartitionedExports;
|
|
147
|
+
|
|
145
148
|
type ConfigBindingOptions = Pick<Config, "ai" | "browser" | "d1_databases" | "dispatch_namespaces" | "durable_objects" | "queues" | "r2_buckets" | "services" | "kv_namespaces" | "mtls_certificates" | "vectorize" | "workflows" | "vpc_services">;
|
|
146
149
|
|
|
147
150
|
declare function configFormat(configPath: string | undefined): "json" | "jsonc" | "toml" | "none";
|
|
@@ -163,6 +166,12 @@ declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, options?
|
|
|
163
166
|
redirected: boolean;
|
|
164
167
|
};
|
|
165
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Returns a map of exports that are only of type "durable-object".
|
|
171
|
+
*/
|
|
172
|
+
declare function getDurableObjectExports(exports: Config["exports"] | undefined): Record<string, DurableObjectExport>;
|
|
173
|
+
declare function hasDurableObjectExports(exports: Config["exports"] | undefined): boolean;
|
|
174
|
+
|
|
166
175
|
declare const experimental_patchConfig: (configPath: string,
|
|
167
176
|
/**
|
|
168
177
|
* if you want to add something new, e.g. a binding, you can just provide that {kv_namespace:[{binding:"KV"}]}
|
|
@@ -265,6 +274,14 @@ declare class APIError extends ParseError {
|
|
|
265
274
|
#private;
|
|
266
275
|
code?: number;
|
|
267
276
|
accountTag?: string;
|
|
277
|
+
/**
|
|
278
|
+
* Optional structured metadata hoisted from the first `FetchError.meta`
|
|
279
|
+
* on the v4 response envelope. Consumers can inspect this to render
|
|
280
|
+
* endpoint-specific structured error payloads.
|
|
281
|
+
*/
|
|
282
|
+
meta?: {
|
|
283
|
+
details?: unknown;
|
|
284
|
+
} & Record<string, unknown>;
|
|
268
285
|
constructor({ status, ...rest }: MessageInit & {
|
|
269
286
|
status?: number;
|
|
270
287
|
});
|
|
@@ -485,6 +502,12 @@ type VariableNames =
|
|
|
485
502
|
| "CLOUDFLARE_ACCESS_CLIENT_ID"
|
|
486
503
|
/** Cloudflare Access Service Token Client Secret. Used with CLOUDFLARE_ACCESS_CLIENT_ID. */
|
|
487
504
|
| "CLOUDFLARE_ACCESS_CLIENT_SECRET"
|
|
505
|
+
/**
|
|
506
|
+
* Store OAuth credentials in the OS keychain instead of a plaintext TOML
|
|
507
|
+
* file. Overrides the persistent `keyring_enabled` preference written by
|
|
508
|
+
* `wrangler login --use-keyring`.
|
|
509
|
+
*/
|
|
510
|
+
| "CLOUDFLARE_AUTH_USE_KEYRING"
|
|
488
511
|
/** Enable the local explorer UI at /cdn-cgi/explorer (experimental, default: false). */
|
|
489
512
|
| "X_LOCAL_EXPLORER"
|
|
490
513
|
/** Open the browser in headful (visible) mode when using the Browser Run API in local dev (default: false). */
|
|
@@ -902,4 +925,9 @@ declare function getWorkerName(projectOrWorkerName: string | undefined, projectP
|
|
|
902
925
|
*/
|
|
903
926
|
declare function getWorkerNameFromProject(projectPath: string): string;
|
|
904
927
|
|
|
905
|
-
|
|
928
|
+
/**
|
|
929
|
+
* @deprecated new code should use getBindingTypeFriendlyName() instead
|
|
930
|
+
*/
|
|
931
|
+
declare const friendlyBindingNames: Record<ConfigBindingFieldName, string>;
|
|
932
|
+
|
|
933
|
+
export { APIError, Binding, type BindingLocalSupport, BunPackageManager, CommandLineArgsError, type CompatDate, Config, type ConfigBindingFieldName, type ConfigBindingOptions, DeprecationError, Diagnostics, DurableObjectExport, type EphemeralDirectory, type ExportType, Exports, FatalError, type GetGlobalConfigPathOptions, 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, getGlobalConfigPath, getGlobalWranglerConfigPath, getHostFromRoute, getHostFromUrl, getTodaysCompatDate, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasDurableObjectExports, hasProperty, indexLocation, isCompatDate, isDirectory, isDockerfile, isOptionalProperty, isPagesConfig, isRedirectedConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, removeDir, removeDirSync, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, toValidWorkerName, validatePagesConfig };
|