@cloudflare/workers-utils 0.33.1 → 0.34.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 +1 -1
- package/dist/chunk-QFKPUV4H.mjs +13 -13
- package/dist/{chunk-IV7UMGT2.mjs → chunk-QKX75RGI.mjs} +1 -1
- package/dist/{config-CRUFg2tu.d.mts → config-BnUbzrPY.d.mts} +28 -6
- package/dist/index.d.mts +156 -7
- package/dist/index.mjs +271 -70
- package/dist/metafile-esm.json +1 -1
- package/dist/open-PBXRGS4R.mjs +3 -3
- package/dist/test-helpers/index.d.mts +1 -1
- package/package.json +2 -2
package/dist/browser.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { be as TailConsumer, bi as WorkerMetadata, R as RawConfig } from './config-BnUbzrPY.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-
|
|
1
|
+
export { constructWranglerConfig } from './chunk-QKX75RGI.mjs';
|
|
2
2
|
import './chunk-Q72B4Q5Z.mjs';
|
package/dist/chunk-QFKPUV4H.mjs
CHANGED
|
@@ -8,15 +8,15 @@ function hasKnownExportType(entry) {
|
|
|
8
8
|
return type === "durable-object" || type === "worker";
|
|
9
9
|
}
|
|
10
10
|
__name(hasKnownExportType, "hasKnownExportType");
|
|
11
|
-
function partitionExports(exports) {
|
|
11
|
+
function partitionExports(exports$1) {
|
|
12
12
|
const partitioned = {
|
|
13
13
|
"durable-object": {},
|
|
14
14
|
worker: {}
|
|
15
15
|
};
|
|
16
|
-
if (exports === void 0) {
|
|
16
|
+
if (exports$1 === void 0) {
|
|
17
17
|
return partitioned;
|
|
18
18
|
}
|
|
19
|
-
for (const [name, entry] of Object.entries(exports)) {
|
|
19
|
+
for (const [name, entry] of Object.entries(exports$1)) {
|
|
20
20
|
if (!hasKnownExportType(entry)) {
|
|
21
21
|
continue;
|
|
22
22
|
}
|
|
@@ -27,20 +27,20 @@ function partitionExports(exports) {
|
|
|
27
27
|
__name(partitionExports, "partitionExports");
|
|
28
28
|
|
|
29
29
|
// src/config/durable-object-exports.ts
|
|
30
|
-
function getDurableObjectExports(exports) {
|
|
31
|
-
return partitionExports(exports)["durable-object"];
|
|
30
|
+
function getDurableObjectExports(exports$1) {
|
|
31
|
+
return partitionExports(exports$1)["durable-object"];
|
|
32
32
|
}
|
|
33
33
|
__name(getDurableObjectExports, "getDurableObjectExports");
|
|
34
|
-
function hasDurableObjectExports(exports) {
|
|
35
|
-
return Object.keys(getDurableObjectExports(exports)).length > 0;
|
|
34
|
+
function hasDurableObjectExports(exports$1) {
|
|
35
|
+
return Object.keys(getDurableObjectExports(exports$1)).length > 0;
|
|
36
36
|
}
|
|
37
37
|
__name(hasDurableObjectExports, "hasDurableObjectExports");
|
|
38
38
|
|
|
39
39
|
// src/config/containers.ts
|
|
40
|
-
function getContainerNameToClassNameMap(exports) {
|
|
40
|
+
function getContainerNameToClassNameMap(exports$1) {
|
|
41
41
|
const containerNameToClassName = /* @__PURE__ */ new Map();
|
|
42
42
|
for (const [className, entry] of Object.entries(
|
|
43
|
-
getDurableObjectExports(exports)
|
|
43
|
+
getDurableObjectExports(exports$1)
|
|
44
44
|
)) {
|
|
45
45
|
if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) {
|
|
46
46
|
containerNameToClassName.set(entry.container, className);
|
|
@@ -49,20 +49,20 @@ function getContainerNameToClassNameMap(exports) {
|
|
|
49
49
|
return containerNameToClassName;
|
|
50
50
|
}
|
|
51
51
|
__name(getContainerNameToClassNameMap, "getContainerNameToClassNameMap");
|
|
52
|
-
function resolveContainerClassName(container, exports) {
|
|
52
|
+
function resolveContainerClassName(container, exports$1) {
|
|
53
53
|
if (container.class_name !== void 0) {
|
|
54
54
|
return container.class_name;
|
|
55
55
|
}
|
|
56
56
|
if (container.name === void 0) {
|
|
57
57
|
return void 0;
|
|
58
58
|
}
|
|
59
|
-
return getContainerNameToClassNameMap(exports).get(container.name);
|
|
59
|
+
return getContainerNameToClassNameMap(exports$1).get(container.name);
|
|
60
60
|
}
|
|
61
61
|
__name(resolveContainerClassName, "resolveContainerClassName");
|
|
62
|
-
function getContainerDurableObjectClassNames(containers, exports) {
|
|
62
|
+
function getContainerDurableObjectClassNames(containers, exports$1) {
|
|
63
63
|
const classNames = /* @__PURE__ */ new Set();
|
|
64
64
|
for (const container of containers ?? []) {
|
|
65
|
-
const className = resolveContainerClassName(container, exports);
|
|
65
|
+
const className = resolveContainerClassName(container, exports$1);
|
|
66
66
|
if (className !== void 0) {
|
|
67
67
|
classNames.add(className);
|
|
68
68
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { URLSearchParams } from 'node:url';
|
|
2
|
-
import { RequestInit, Response as Response$1,
|
|
2
|
+
import { RequestInit, Headers, Response as Response$1, MockAgent } from 'undici';
|
|
3
3
|
import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
|
|
4
4
|
|
|
5
5
|
interface FetchError {
|
|
@@ -555,7 +555,6 @@ interface CfWorkflow {
|
|
|
555
555
|
class_name: string;
|
|
556
556
|
binding: string;
|
|
557
557
|
script_name?: string;
|
|
558
|
-
remote?: boolean;
|
|
559
558
|
raw?: boolean;
|
|
560
559
|
limits?: {
|
|
561
560
|
steps?: number;
|
|
@@ -1291,7 +1290,12 @@ type Trigger = {
|
|
|
1291
1290
|
cron: string;
|
|
1292
1291
|
} | ({
|
|
1293
1292
|
type: "queue-consumer";
|
|
1294
|
-
} & Omit<QueueConsumer, "type">)
|
|
1293
|
+
} & Omit<QueueConsumer, "type">) | {
|
|
1294
|
+
type: "connect";
|
|
1295
|
+
protocol: "tcp";
|
|
1296
|
+
port: number;
|
|
1297
|
+
address?: string;
|
|
1298
|
+
};
|
|
1295
1299
|
type BindingOmit<T> = Omit<T, "binding">;
|
|
1296
1300
|
type NameOmit<T> = Omit<T, "name">;
|
|
1297
1301
|
type Binding = {
|
|
@@ -2366,8 +2370,6 @@ type WorkflowBinding = {
|
|
|
2366
2370
|
class_name: string;
|
|
2367
2371
|
/** The script where the Workflow is defined (if it's external to this Worker) */
|
|
2368
2372
|
script_name?: string;
|
|
2369
|
-
/** Whether the Workflow should be remote or not in local development */
|
|
2370
|
-
remote?: boolean;
|
|
2371
2373
|
/** Optional limits for the Workflow */
|
|
2372
2374
|
limits?: {
|
|
2373
2375
|
/** Maximum number of steps a Workflow instance can execute */
|
|
@@ -2565,6 +2567,26 @@ interface EnvironmentNonInheritable {
|
|
|
2565
2567
|
retry_delay?: number;
|
|
2566
2568
|
}[];
|
|
2567
2569
|
};
|
|
2570
|
+
/**
|
|
2571
|
+
* Specifies raw sockets that this Worker should listen on.
|
|
2572
|
+
* Each entry opens a listening socket on the
|
|
2573
|
+
* given port that delivers incoming connections directly to the Worker's
|
|
2574
|
+
* `connect(socket, env, ctx)` handler.
|
|
2575
|
+
*
|
|
2576
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2577
|
+
* and so must be specified in every named environment.
|
|
2578
|
+
*
|
|
2579
|
+
* @default []
|
|
2580
|
+
* @nonInheritable
|
|
2581
|
+
*/
|
|
2582
|
+
connect: {
|
|
2583
|
+
/** The transport protocol to listen for. */
|
|
2584
|
+
protocol: "tcp";
|
|
2585
|
+
/** The port to listen on. */
|
|
2586
|
+
port: number;
|
|
2587
|
+
/** The address to bind to. Defaults to `127.0.0.1`. */
|
|
2588
|
+
address?: string;
|
|
2589
|
+
}[];
|
|
2568
2590
|
/**
|
|
2569
2591
|
* Specifies R2 buckets that are bound to this Worker environment.
|
|
2570
2592
|
*
|
|
@@ -3566,4 +3588,4 @@ interface EnvironmentMap {
|
|
|
3566
3588
|
}
|
|
3567
3589
|
declare const defaultWranglerConfig: Config;
|
|
3568
3590
|
|
|
3569
|
-
export { type
|
|
3591
|
+
export { type CfPipeline as $, ARTIFACTS_EVENT_TYPES as A, type Binding as B, type ComputedFields as C, type DurableObjectExport as D, type Exports as E, type CfCapnp as F, type CfD1Database as G, type CfDataBlobBindings as H, type CfDevPluginCfg as I, type CfDispatchNamespace as J, type CfDurableObject as K, type Logger as L, type CfDurableObjectMigrations as M, type CfExports as N, type CfFlagship as O, type CfHelloWorld as P, type CfHyperdrive as Q, type RawConfig as R, type CfImagesBinding as S, type CfKvNamespace as T, type CfLogfwdr as U, type CfLogfwdrBinding as V, type WorkerEntrypointExport as W, type CfMTlsCertificate as X, type CfMediaBinding as Y, type CfModule as Z, type CfModuleType as _, type RedirectedRawConfig as a, type LocalS3Credentials as a$, type CfPlacement as a0, type CfQueue as a1, type CfR2Bucket as a2, type CfRateLimit as a3, type CfScriptFormat as a4, type CfSecretsStoreSecrets as a5, type CfSendEmailBindings as a6, type CfService as a7, type CfStreamBinding as a8, type CfTailConsumer as a9, type DurableObjectExportStorage as aA, type DurableObjectMigration as aB, ENVIRONMENT_TAG_PREFIX as aC, type Entry as aD, type Environment as aE, type EnvironmentNonInheritable as aF, type ExportsReconciliationEntryBase as aG, type ExportsReconciliationErrorDetail as aH, type ExportsReconciliationInfo as aI, type ExportsReconciliationRename as aJ, type ExportsReconciliationResult as aK, type ExportsReconciliationTransfer as aL, type ExportsReconciliationTransferPending as aM, type ExportsReconciliationWarning as aN, type FetchKVGetValueFetcher as aO, type FetchListResultFetcher as aP, type FetchPagedListResultFetcher as aQ, type FetchResult as aR, type FetchResultFetcher as aS, type File as aT, type Hook as aU, type HookValues as aV, INHERIT_SYMBOL as aW, JSON_CONFIG_FORMATS as aX, type Json as aY, LOGGER_LEVELS as aZ, type LegacyAssetPaths as a_, type CfTextBlobBindings as aa, type CfUnsafe as ab, type CfUnsafeBinding as ac, type CfUserLimits as ad, type CfVars as ae, type CfVectorize as af, type CfVersionMetadataBinding as ag, type CfVpcNetwork as ah, type CfVpcService as ai, type CfWasmModuleBindings as aj, type CfWebSearch as ak, type CfWorkerContext as al, type CfWorkerInit as am, type CfWorkerLoader as an, type CfWorkerSourceMap as ao, type CfWorkflow as ap, type CloudchamberConfig as aq, type ComplianceConfig as ar, type ConfigFields as as, type ConfigModuleRuleType as at, type ConfiguredExport as au, type ContainerEngine as av, type CustomDomainRoute as aw, type DispatchNamespaceOutbound as ax, type DockerConfiguration as ay, type DurableObjectBindings as az, type Config as b, getWranglerHideBanner as b$, type LogLevel as b0, type LoggerLevel as b1, type NodeJSCompatMode as b2, type Observability as b3, PATH_TO_DEPLOY_CONFIG as b4, type PreviewsConfig as b5, type RawDevConfig as b6, type RawEnvironment as b7, type Rule as b8, SERVICE_TAG_PREFIX as b9, getCIOverrideName as bA, getCIOverrideNetworkModeHost as bB, getCfFetchEnabledFromEnv as bC, getCfFetchPathFromEnv as bD, getCloudflareApiBaseUrl as bE, getCloudflareApiEnvironmentFromEnv as bF, getCloudflareComplianceRegion as bG, getCloudflareEnv as bH, getCloudflareIncludeProcessEnvFromEnv as bI, getCloudflareLoadDevVarsFromDotEnv as bJ, getCloudflaredPathFromEnv as bK, getComplianceRegionSubdomain as bL, getD1ExtraLocationChoices as bM, getDisableConfigWatching as bN, getDockerPath as bO, getLocalExplorerEnabledFromEnv as bP, getLocalObservabilityEnabledFromEnv as bQ, getNoSkillsUpdatePromptsFromEnv as bR, getOpenNextDeployFromEnv as bS, getOutputFileDirectoryFromEnv as bT, getOutputFilePathFromEnv as bU, getRegistryPath as bV, getSanitizeLogs as bW, getSubdomainMixedStateCheckDisabled as bX, getTraceHeader as bY, getWorkersCIBranchName as bZ, getWranglerCacheDirFromEnv as b_, type ServiceFetch as ba, type ServiceMetadataRes as bb, type StartDevWorkerInput as bc, type StreamingTailConsumer as bd, type TailConsumer as be, type Trigger as bf, type UserLimits as bg, type ValidatedAssetsOptions as bh, type WorkerMetadata as bi, type WorkflowBinding as bj, type ZoneIdRoute as bk, type ZoneNameRoute as bl, addAuthorizationHeader as bm, defaultWranglerConfig as bn, extractAccountTag as bo, extractWAFBlockRayId as bp, fetchInternalBase as bq, fetchKVGetValueBase as br, fetchListResultBase as bs, fetchResultBase as bt, getBrowserRenderingHeadfulFromEnv as bu, getBuildConditionsFromEnv as bv, getBuildPlatformFromEnv as bw, getC3CommandFromEnv as bx, getCIGeneratePreviewAlias as by, getCIMatchTag as bz, type ContainerApp as c, getWranglerSendErrorReportsFromEnv as c0, getWranglerSendMetricsFromEnv as c1, hasCursor as c2, hasMorePages as c3, isDoNotTrackEnabled as c4, isWAFBlockResponse as c5, maybeAddTraceHeader as c6, parseRetryAfterMs as c7, parseRetryAfterValue as c8, performApiFetchBase as c9, renderError as ca, throwFetchError as cb, truncate as cc, type WorkerMetadataBinding as d, type Route as e, type Access as f, type ApiCredentials as g, type ArtifactsEventTrigger as h, type ArtifactsEventType as i, type AssetConfigMetadata as j, type Assets as k, type AssetsOptions as l, type AsyncHook as m, type BinaryFile as n, COMPLIANCE_REGION_CONFIG_PUBLIC as o, COMPLIANCE_REGION_CONFIG_UNKNOWN as p, type CacheOptions as q, type CfAIBinding as r, type CfAISearch as s, type CfAISearchNamespace as t, type CfAccount as u, type CfAgentMemory as v, type CfAnalyticsEngineDataset as w, type CfArtifacts as x, type CfAssetsBinding as y, type CfBrowserBinding as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ComputedFields, B as Binding, R as RawConfig, b as Config, E as Exports, D as DurableObjectExport, W as WorkerEntrypointExport, c as ContainerApp, d as WorkerMetadataBinding, L as Logger, e as Route } from './config-
|
|
2
|
-
export { A as ARTIFACTS_EVENT_TYPES,
|
|
1
|
+
import { C as ComputedFields, B as Binding, R as RawConfig, b as Config, E as Exports, D as DurableObjectExport, W as WorkerEntrypointExport, c as ContainerApp, d as WorkerMetadataBinding, L as Logger, e as Route } from './config-BnUbzrPY.mjs';
|
|
2
|
+
export { A as ARTIFACTS_EVENT_TYPES, f as Access, g as ApiCredentials, h as ArtifactsEventTrigger, i as ArtifactsEventType, j as AssetConfigMetadata, k as Assets, l as AssetsOptions, m as AsyncHook, n as BinaryFile, o as COMPLIANCE_REGION_CONFIG_PUBLIC, p as COMPLIANCE_REGION_CONFIG_UNKNOWN, q as CacheOptions, r as CfAIBinding, s as CfAISearch, t as CfAISearchNamespace, u as CfAccount, v as CfAgentMemory, w as CfAnalyticsEngineDataset, x as CfArtifacts, y as CfAssetsBinding, z as CfBrowserBinding, F as CfCapnp, G as CfD1Database, H as CfDataBlobBindings, I as CfDevPluginCfg, J as CfDispatchNamespace, K as CfDurableObject, M as CfDurableObjectMigrations, N as CfExports, O as CfFlagship, P as CfHelloWorld, Q as CfHyperdrive, S as CfImagesBinding, T as CfKvNamespace, U as CfLogfwdr, V as CfLogfwdrBinding, X as CfMTlsCertificate, Y as CfMediaBinding, Z as CfModule, _ as CfModuleType, $ as CfPipeline, a0 as CfPlacement, a1 as CfQueue, a2 as CfR2Bucket, a3 as CfRateLimit, a4 as CfScriptFormat, a5 as CfSecretsStoreSecrets, a6 as CfSendEmailBindings, a7 as CfService, a8 as CfStreamBinding, a9 as CfTailConsumer, aa as CfTextBlobBindings, ab as CfUnsafe, ac as CfUnsafeBinding, ad as CfUserLimits, ae as CfVars, af as CfVectorize, ag as CfVersionMetadataBinding, ah as CfVpcNetwork, ai as CfVpcService, aj as CfWasmModuleBindings, ak as CfWebSearch, al as CfWorkerContext, am as CfWorkerInit, an as CfWorkerLoader, ao as CfWorkerSourceMap, ap as CfWorkflow, aq as CloudchamberConfig, ar as ComplianceConfig, as as ConfigFields, at as ConfigModuleRuleType, au as ConfiguredExport, av as ContainerEngine, aw as CustomDomainRoute, ax as DispatchNamespaceOutbound, ay as DockerConfiguration, az as DurableObjectBindings, aA as DurableObjectExportStorage, aB as DurableObjectMigration, aC as ENVIRONMENT_TAG_PREFIX, aD as Entry, aE as Environment, aF as EnvironmentNonInheritable, aG as ExportsReconciliationEntryBase, aH as ExportsReconciliationErrorDetail, aI as ExportsReconciliationInfo, aJ as ExportsReconciliationRename, aK as ExportsReconciliationResult, aL as ExportsReconciliationTransfer, aM as ExportsReconciliationTransferPending, aN as ExportsReconciliationWarning, aO as FetchKVGetValueFetcher, aP as FetchListResultFetcher, aQ as FetchPagedListResultFetcher, aR as FetchResult, aS as FetchResultFetcher, aT as File, aU as Hook, aV as HookValues, aW as INHERIT_SYMBOL, aX as JSON_CONFIG_FORMATS, aY as Json, aZ as LOGGER_LEVELS, a_ as LegacyAssetPaths, a$ as LocalS3Credentials, b0 as LogLevel, b1 as LoggerLevel, b2 as NodeJSCompatMode, b3 as Observability, b4 as PATH_TO_DEPLOY_CONFIG, b5 as PreviewsConfig, b6 as RawDevConfig, b7 as RawEnvironment, a as RedirectedRawConfig, b8 as Rule, b9 as SERVICE_TAG_PREFIX, ba as ServiceFetch, bb as ServiceMetadataRes, bc as StartDevWorkerInput, bd as StreamingTailConsumer, be as TailConsumer, bf as Trigger, bg as UserLimits, bh as ValidatedAssetsOptions, bi as WorkerMetadata, bj as WorkflowBinding, bk as ZoneIdRoute, bl as ZoneNameRoute, bm as addAuthorizationHeader, bn as defaultWranglerConfig, bo as extractAccountTag, bp as extractWAFBlockRayId, bq as fetchInternalBase, br as fetchKVGetValueBase, bs as fetchListResultBase, bt as fetchResultBase, bu as getBrowserRenderingHeadfulFromEnv, bv as getBuildConditionsFromEnv, bw as getBuildPlatformFromEnv, bx as getC3CommandFromEnv, by as getCIGeneratePreviewAlias, bz as getCIMatchTag, bA as getCIOverrideName, bB as getCIOverrideNetworkModeHost, bC as getCfFetchEnabledFromEnv, bD as getCfFetchPathFromEnv, bE as getCloudflareApiBaseUrl, bF as getCloudflareApiEnvironmentFromEnv, bG as getCloudflareComplianceRegion, bH as getCloudflareEnv, bI as getCloudflareIncludeProcessEnvFromEnv, bJ as getCloudflareLoadDevVarsFromDotEnv, bK as getCloudflaredPathFromEnv, bL as getComplianceRegionSubdomain, bM as getD1ExtraLocationChoices, bN as getDisableConfigWatching, bO as getDockerPath, bP as getLocalExplorerEnabledFromEnv, bQ as getLocalObservabilityEnabledFromEnv, bR as getNoSkillsUpdatePromptsFromEnv, bS as getOpenNextDeployFromEnv, bT as getOutputFileDirectoryFromEnv, bU as getOutputFilePathFromEnv, bV as getRegistryPath, bW as getSanitizeLogs, bX as getSubdomainMixedStateCheckDisabled, bY as getTraceHeader, bZ as getWorkersCIBranchName, b_ as getWranglerCacheDirFromEnv, b$ as getWranglerHideBanner, c0 as getWranglerSendErrorReportsFromEnv, c1 as getWranglerSendMetricsFromEnv, c2 as hasCursor, c3 as hasMorePages, c4 as isDoNotTrackEnabled, c5 as isWAFBlockResponse, c6 as maybeAddTraceHeader, c7 as parseRetryAfterMs, c8 as parseRetryAfterValue, c9 as performApiFetchBase, ca as renderError, cb as throwFetchError, cc as truncate } from './config-BnUbzrPY.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';
|
|
@@ -462,11 +462,14 @@ declare function assertNever(_value: never): void;
|
|
|
462
462
|
/**
|
|
463
463
|
* Resolves the filesystem path for an installed npm package.
|
|
464
464
|
*
|
|
465
|
-
* Tries
|
|
466
|
-
* 1. `require.resolve("<pkg>/package.json")`
|
|
467
|
-
* 2. `require.resolve("<pkg>")`
|
|
465
|
+
* Tries three strategies in order:
|
|
466
|
+
* 1. `require.resolve("<pkg>/package.json")` — works when the package exports its `package.json`
|
|
467
|
+
* 2. `require.resolve("<pkg>")` — fallback for packages that don't export `package.json`
|
|
468
|
+
* 3. Direct `node_modules` filesystem lookup — fallback for ESM-only packages whose exports
|
|
469
|
+
* map has no `"require"` or `"default"` condition (and no `"./package.json"` export),
|
|
470
|
+
* which makes them invisible to `require.resolve`
|
|
468
471
|
*
|
|
469
|
-
* @param packageName - The npm package name to resolve
|
|
472
|
+
* @param packageName - The npm package name to resolve (supports scoped packages like `@scope/pkg`)
|
|
470
473
|
* @param projectPath - The project directory to resolve from
|
|
471
474
|
* @returns The resolved directory path, or `undefined` if the package is not installed
|
|
472
475
|
*/
|
|
@@ -979,6 +982,152 @@ declare function isCI(): boolean;
|
|
|
979
982
|
*/
|
|
980
983
|
declare function openInBrowser(url: string, logger: Logger): Promise<void>;
|
|
981
984
|
|
|
985
|
+
/**
|
|
986
|
+
* Write an entry to the output file.
|
|
987
|
+
*
|
|
988
|
+
* Control whether (and where) to write this file by setting either
|
|
989
|
+
* `WRANGLER_OUTPUT_FILE_DIRECTORY` or `WRANGLER_OUTPUT_FILE_PATH`.
|
|
990
|
+
*
|
|
991
|
+
* @param entry The structured output entry to append.
|
|
992
|
+
* @returns Nothing.
|
|
993
|
+
*/
|
|
994
|
+
declare function writeOutput(entry: OutputEntry): void;
|
|
995
|
+
/**
|
|
996
|
+
* Clear the cached output file path.
|
|
997
|
+
*
|
|
998
|
+
* @returns Nothing.
|
|
999
|
+
*/
|
|
1000
|
+
declare function clearOutputFilePath(): void;
|
|
1001
|
+
interface OutputEntryBase<T extends string> {
|
|
1002
|
+
version: number;
|
|
1003
|
+
type: T;
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* All the different types of entry that can be written to the output file.
|
|
1007
|
+
*/
|
|
1008
|
+
type OutputEntry = OutputEntrySession | OutputEntryDeployment | OutputEntryPreview | OutputEntryPagesDeployment | OutputEntryVersionUpload | OutputEntryVersionDeployment | OutputEntryPagesDeploymentDetailed | OutputEntryCommandFailed | OutputEntryAutoConfig;
|
|
1009
|
+
interface OutputEntrySession extends OutputEntryBase<"wrangler-session"> {
|
|
1010
|
+
version: 1;
|
|
1011
|
+
/** The semver version string taken from Wrangler's package.json. */
|
|
1012
|
+
wrangler_version: string;
|
|
1013
|
+
/** The arguments passed to Wrangler. */
|
|
1014
|
+
command_line_args: string[];
|
|
1015
|
+
/** The absolute path to a file that contains debug logs for this Wrangler instance. */
|
|
1016
|
+
log_file_path: string;
|
|
1017
|
+
}
|
|
1018
|
+
interface OutputEntryDeployment extends OutputEntryBase<"deploy"> {
|
|
1019
|
+
version: 1;
|
|
1020
|
+
/** The name of the Worker. */
|
|
1021
|
+
worker_name: string | null;
|
|
1022
|
+
/** The GUID that identifies the Worker. This never changes even if the name is changed. */
|
|
1023
|
+
worker_tag: string | null;
|
|
1024
|
+
/** A GUID that identifies this deployed version of the Worker. This version is associated with an automatically created deployment, with this version set at 100%. */
|
|
1025
|
+
version_id: string | null;
|
|
1026
|
+
/** A list of URLs that represent the HTTP triggers associated with this deployment */
|
|
1027
|
+
targets: string[] | undefined;
|
|
1028
|
+
/** set if the worker's name was overridden */
|
|
1029
|
+
worker_name_overridden: boolean;
|
|
1030
|
+
/** wrangler environment used */
|
|
1031
|
+
wrangler_environment: string | undefined;
|
|
1032
|
+
}
|
|
1033
|
+
interface OutputEntryPreview extends OutputEntryBase<"preview"> {
|
|
1034
|
+
version: 1;
|
|
1035
|
+
/** The name of the Worker. */
|
|
1036
|
+
worker_name: string | null;
|
|
1037
|
+
/** The ID of the Preview resource. */
|
|
1038
|
+
preview_id: string;
|
|
1039
|
+
/** The human-readable name of the Preview resource. */
|
|
1040
|
+
preview_name: string;
|
|
1041
|
+
/** The slug of the Preview resource. */
|
|
1042
|
+
preview_slug: string;
|
|
1043
|
+
/** A list of URLs associated with the Preview resource. */
|
|
1044
|
+
preview_urls: string[] | undefined;
|
|
1045
|
+
/** The ID of the Preview deployment resource. */
|
|
1046
|
+
deployment_id: string;
|
|
1047
|
+
/** A list of URLs associated with the Preview deployment. */
|
|
1048
|
+
deployment_urls: string[] | undefined;
|
|
1049
|
+
}
|
|
1050
|
+
interface OutputEntryAutoConfig extends OutputEntryBase<"autoconfig"> {
|
|
1051
|
+
version: 1;
|
|
1052
|
+
/** The command that triggered autoconfig */
|
|
1053
|
+
command: "setup" | "deploy";
|
|
1054
|
+
/** The summary of the autoconfig process */
|
|
1055
|
+
summary: {
|
|
1056
|
+
wranglerConfig?: {
|
|
1057
|
+
name?: string;
|
|
1058
|
+
compatibility_date?: string;
|
|
1059
|
+
};
|
|
1060
|
+
[key: string]: unknown;
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
interface OutputEntryPagesDeployment extends OutputEntryBase<"pages-deploy"> {
|
|
1064
|
+
version: 1;
|
|
1065
|
+
/** The name of the Pages project. */
|
|
1066
|
+
pages_project: string | null;
|
|
1067
|
+
/** A GUID that identifies this Pages deployment. */
|
|
1068
|
+
deployment_id: string | null;
|
|
1069
|
+
/** The URL associated with this deployment */
|
|
1070
|
+
url: string | undefined;
|
|
1071
|
+
}
|
|
1072
|
+
interface OutputEntryPagesDeploymentDetailed extends OutputEntryBase<"pages-deploy-detailed"> {
|
|
1073
|
+
version: 1;
|
|
1074
|
+
/** The name of the Pages project. */
|
|
1075
|
+
pages_project: string | null;
|
|
1076
|
+
/** A GUID that identifies this Pages deployment. */
|
|
1077
|
+
deployment_id: string | null;
|
|
1078
|
+
/** The URL associated with this deployment */
|
|
1079
|
+
url: string | undefined;
|
|
1080
|
+
/** The Alias url, if it exists */
|
|
1081
|
+
alias: string | undefined;
|
|
1082
|
+
/** The environment being deployed to */
|
|
1083
|
+
environment: "production" | "preview";
|
|
1084
|
+
/** The production branch of the pages project */
|
|
1085
|
+
production_branch: string;
|
|
1086
|
+
deployment_trigger: {
|
|
1087
|
+
metadata: {
|
|
1088
|
+
/** Commit hash of the deployment trigger metadata for the pages project */
|
|
1089
|
+
commit_hash: string;
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
interface OutputEntryVersionUpload extends OutputEntryBase<"version-upload"> {
|
|
1094
|
+
version: 1;
|
|
1095
|
+
/** The name of the Worker. */
|
|
1096
|
+
worker_name: string | null;
|
|
1097
|
+
/** The GUID that identifies the Worker. This never changes even if the name is changed. */
|
|
1098
|
+
worker_tag: string | null;
|
|
1099
|
+
/** A GUID that identifies this uploaded, but not yet deployed, version of the Worker. This version will need to be "deployed" to receive traffic. */
|
|
1100
|
+
version_id: string | null;
|
|
1101
|
+
/** The preview URL associated with this version upload */
|
|
1102
|
+
preview_url: string | undefined;
|
|
1103
|
+
/** The ephemeral aliased preview URL associated with this version upload */
|
|
1104
|
+
preview_alias_url: string | undefined;
|
|
1105
|
+
/** set if the worker's name was overridden */
|
|
1106
|
+
worker_name_overridden: boolean;
|
|
1107
|
+
/** wrangler environment used */
|
|
1108
|
+
wrangler_environment: string | undefined;
|
|
1109
|
+
}
|
|
1110
|
+
interface OutputEntryVersionDeployment extends OutputEntryBase<"version-deploy"> {
|
|
1111
|
+
version: 1;
|
|
1112
|
+
/** The name of the Worker. */
|
|
1113
|
+
worker_name: string | null;
|
|
1114
|
+
/** The GUID that identifies the Worker. This never changes even if the name is changed. */
|
|
1115
|
+
worker_tag: string | null;
|
|
1116
|
+
/** The ID of the gradual rollout deployment. */
|
|
1117
|
+
deployment_id: string;
|
|
1118
|
+
/** The percentage of traffic that goes to each version. */
|
|
1119
|
+
version_traffic: Map<string, number>;
|
|
1120
|
+
}
|
|
1121
|
+
interface OutputEntryCommandFailed extends OutputEntryBase<"command-failed"> {
|
|
1122
|
+
version: 1;
|
|
1123
|
+
/** The code in the error. */
|
|
1124
|
+
code: number | undefined;
|
|
1125
|
+
/** The message in the error. */
|
|
1126
|
+
message: string | undefined;
|
|
1127
|
+
/** How many milliseconds to retry the operation after if available. */
|
|
1128
|
+
retry_after_ms: number | undefined;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
982
1131
|
declare function retryOnAPIFailure<T>(action: () => T | Promise<T>, logger: Logger, backoff?: number, attempts?: number, abortSignal?: AbortSignal): Promise<T>;
|
|
983
1132
|
|
|
984
1133
|
declare function formatTime(duration: number): string;
|
|
@@ -1167,4 +1316,4 @@ declare function toUrlPath(filePath: string): UrlPath;
|
|
|
1167
1316
|
*/
|
|
1168
1317
|
declare const friendlyBindingNames: Record<ConfigBindingFieldName, string>;
|
|
1169
1318
|
|
|
1170
|
-
export { APIError, Binding, type BindingLocalSupport, BunPackageManager, CommandLineArgsError, type CompatDate, Config, type ConfigBindingFieldName, type ConfigBindingOptions, type ConfigCache, type ConfigCacheOptions, ContainerApp, DEFAULT_COMPAT_DATE, DeprecationError, Diagnostics, DurableObjectExport, type EphemeralDirectory, type ExportType, Exports, FatalError, JsonFriendlyFatalError, type Location, Logger, type Message, MissingConfigError, NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, 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, type UrlPath, UserError, WorkerEntrypointExport, WorkerMetadataBinding, YarnPackageManager, _forceColour, assertNever, bucketFormatMessage, checkWorkerNameValidity, configFileName, configFormat, createConfigCache, createFatalError, experimental_patchConfig, experimental_readRawConfig, fetchLatestNpmVersion, findWranglerConfig, formatConfigSnippet, formatTime, formatZodError, friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getTodaysCompatDate, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasDurableObjectExports, hasProperty, indexLocation, isCI, isCompatDate, isDockerfile, isInteractive, isNodejsCompatDefaultOn, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRedirectedConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, openInBrowser, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveNodejsCompat, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, stripRedundantNodejsCompatFlags, sweepStaleWranglerTmpDirs, toUrlPath, toValidWorkerName, validatePagesConfig };
|
|
1319
|
+
export { APIError, Binding, type BindingLocalSupport, BunPackageManager, CommandLineArgsError, type CompatDate, Config, type ConfigBindingFieldName, type ConfigBindingOptions, type ConfigCache, type ConfigCacheOptions, ContainerApp, DEFAULT_COMPAT_DATE, DeprecationError, Diagnostics, DurableObjectExport, type EphemeralDirectory, type ExportType, Exports, FatalError, JsonFriendlyFatalError, type Location, Logger, type Message, MissingConfigError, NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, type NormalizeAndValidateConfigArgs, NpmPackageManager, type NpmVersionCheckResult, NubPackageManager, type OutputEntry, type PackageJSON, type PackageManager, ParseError, type ParseFile, type PartitionedExports, PatchConfigError, PnpmPackageManager, RawConfig, type ResolveConfigPathOptions, Route, type TelemetryMessage, type Tunnel, type TunnelOptions, type UrlPath, UserError, WorkerEntrypointExport, WorkerMetadataBinding, YarnPackageManager, _forceColour, assertNever, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, configFileName, configFormat, createConfigCache, createFatalError, experimental_patchConfig, experimental_readRawConfig, fetchLatestNpmVersion, findWranglerConfig, formatConfigSnippet, formatTime, formatZodError, friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getTodaysCompatDate, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasDurableObjectExports, hasProperty, indexLocation, isCI, isCompatDate, isDockerfile, isInteractive, isNodejsCompatDefaultOn, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRedirectedConfig, isRequiredProperty, isValidR2BucketName, mapWorkerMetadataBindings, normalizeAndValidateConfig, openInBrowser, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveNodejsCompat, resolveWranglerConfigPath, retryOnAPIFailure, searchLocation, spawnCloudflared, startTunnel, stripRedundantNodejsCompatFlags, sweepStaleWranglerTmpDirs, toUrlPath, toValidWorkerName, validatePagesConfig, writeOutput };
|