@cloudflare/workers-utils 0.31.0 → 0.31.2
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TailConsumer,
|
|
1
|
+
import { T as TailConsumer, aO as WorkerMetadata, R as RawConfig } from './config-CFrqMEcY.mjs';
|
|
2
2
|
import { AssetConfig } from '@cloudflare/workers-shared';
|
|
3
3
|
import { Cloudflare } from 'cloudflare';
|
|
4
4
|
import 'node:url';
|
|
@@ -210,13 +210,10 @@ declare const getLocalExplorerEnabledFromEnv: () => boolean;
|
|
|
210
210
|
* `unsafeObservability` Miniflare option, which makes core attach the trace
|
|
211
211
|
* collector to each user worker.
|
|
212
212
|
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* on from the Local Explorer's Observability tab (Vite dev), which reloads the
|
|
218
|
-
* runtime with capture enabled. The explorer UI itself (`X_LOCAL_EXPLORER`)
|
|
219
|
-
* stays on by default so the tab is always available.
|
|
213
|
+
* Defaults to `true` so the Local Explorer's Observability tab captures traces
|
|
214
|
+
* and logs out of the box. Set `X_LOCAL_OBSERVABILITY=false` to opt out — for
|
|
215
|
+
* example if the extra per-worker services (collector + streaming tail) cause
|
|
216
|
+
* trouble in a multi-process dev-registry setup.
|
|
220
217
|
*/
|
|
221
218
|
declare const getLocalObservabilityEnabledFromEnv: () => boolean;
|
|
222
219
|
/**
|
|
@@ -2094,11 +2091,11 @@ interface EnvironmentInheritable {
|
|
|
2094
2091
|
*/
|
|
2095
2092
|
exports: Exports;
|
|
2096
2093
|
/**
|
|
2097
|
-
*
|
|
2094
|
+
* Definitions that trigger a Worker from a schedule or a Cloudflare event.
|
|
2098
2095
|
*
|
|
2099
|
-
*
|
|
2096
|
+
* More details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
2100
2097
|
*
|
|
2101
|
-
* More details
|
|
2098
|
+
* More details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/
|
|
2102
2099
|
*
|
|
2103
2100
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
2104
2101
|
*
|
|
@@ -2106,7 +2103,8 @@ interface EnvironmentInheritable {
|
|
|
2106
2103
|
* @inheritable
|
|
2107
2104
|
*/
|
|
2108
2105
|
triggers: {
|
|
2109
|
-
crons
|
|
2106
|
+
crons?: string[];
|
|
2107
|
+
events?: ArtifactsEventTrigger[];
|
|
2110
2108
|
};
|
|
2111
2109
|
/**
|
|
2112
2110
|
* Specify limits for runtime behavior.
|
|
@@ -2293,6 +2291,19 @@ type DurableObjectBindings = {
|
|
|
2293
2291
|
/** The service environment of the script_name to bind to */
|
|
2294
2292
|
environment?: string;
|
|
2295
2293
|
}[];
|
|
2294
|
+
declare const ARTIFACTS_EVENT_TYPES: readonly ["cf.artifacts.repo.created", "cf.artifacts.repo.deleted", "cf.artifacts.repo.forked", "cf.artifacts.repo.imported", "cf.artifacts.repo.pushed", "cf.artifacts.repo.cloned", "cf.artifacts.repo.fetched", "cf.artifacts.repo.token.created", "cf.artifacts.repo.token.revoked"];
|
|
2295
|
+
type ArtifactsEventType = (typeof ARTIFACTS_EVENT_TYPES)[number];
|
|
2296
|
+
type ArtifactsEventTrigger = {
|
|
2297
|
+
type: ArtifactsEventType;
|
|
2298
|
+
filter?: {
|
|
2299
|
+
namespace?: string;
|
|
2300
|
+
repo_name?: string;
|
|
2301
|
+
};
|
|
2302
|
+
targets: {
|
|
2303
|
+
type: "workflow";
|
|
2304
|
+
workflow_name: string;
|
|
2305
|
+
}[];
|
|
2306
|
+
};
|
|
2296
2307
|
type WorkflowBinding = {
|
|
2297
2308
|
/** The name of the binding used to refer to the Workflow */
|
|
2298
2309
|
binding: string;
|
|
@@ -3493,4 +3504,4 @@ interface EnvironmentMap {
|
|
|
3493
3504
|
}
|
|
3494
3505
|
declare const defaultWranglerConfig: Config;
|
|
3495
3506
|
|
|
3496
|
-
export { type
|
|
3507
|
+
export { type CfBrowserBinding as $, ARTIFACTS_EVENT_TYPES as A, type Binding as B, type ComputedFields as C, type DurableObjectExport as D, type Exports as E, type DispatchNamespaceOutbound as F, type Assets as G, type CacheOptions as H, type DockerConfiguration as I, type ContainerEngine as J, type CfScriptFormat as K, type Logger as L, type CfModuleType as M, type CfModule as N, type Observability as O, type PreviewsConfig as P, type CfVars as Q, type RawConfig as R, type StreamingTailConsumer as S, type TailConsumer as T, type UserLimits as U, type CfKvNamespace as V, type WorkerEntrypointExport as W, type CfSendEmailBindings as X, type CfWasmModuleBindings as Y, type ZoneIdRoute as Z, type CfTextBlobBindings as _, type RedirectedRawConfig as a, type Trigger as a$, type CfAIBinding as a0, type CfImagesBinding as a1, type CfMediaBinding as a2, type CfStreamBinding as a3, type CfVersionMetadataBinding as a4, type CfDataBlobBindings as a5, type CfDurableObject as a6, type CfWorkflow as a7, type CfQueue as a8, type CfR2Bucket as a9, type CfUnsafe as aA, type CfDurableObjectMigrations as aB, type CfExports as aC, type CfPlacement as aD, type CfTailConsumer as aE, type CfUserLimits as aF, type CfWorkerInit as aG, type CfWorkerContext as aH, type CfWorkerSourceMap as aI, type Json as aJ, type AssetConfigMetadata as aK, type AssetsOptions as aL, type ValidatedAssetsOptions as aM, type LegacyAssetPaths as aN, type WorkerMetadata as aO, type ExportsReconciliationEntryBase as aP, type ExportsReconciliationInfo as aQ, type ExportsReconciliationWarning as aR, type ExportsReconciliationErrorDetail as aS, type ExportsReconciliationRename as aT, type ExportsReconciliationTransfer as aU, type ExportsReconciliationTransferPending as aV, type ExportsReconciliationResult as aW, type ServiceMetadataRes as aX, type ServiceFetch as aY, type File as aZ, type BinaryFile as a_, type CfD1Database as aa, type CfVectorize as ab, type CfAISearchNamespace as ac, type CfAISearch as ad, type CfWebSearch as ae, type CfAgentMemory as af, type CfSecretsStoreSecrets as ag, type CfArtifacts as ah, type CfHelloWorld as ai, type CfFlagship as aj, type CfWorkerLoader as ak, type CfRateLimit as al, type CfHyperdrive as am, type CfDevPluginCfg as an, type CfService as ao, type CfVpcService as ap, type CfVpcNetwork as aq, type CfAnalyticsEngineDataset as ar, type CfDispatchNamespace as as, type CfMTlsCertificate as at, type CfLogfwdr as au, type CfLogfwdrBinding as av, type CfAssetsBinding as aw, type CfPipeline as ax, type CfUnsafeBinding as ay, type CfCapnp as az, type Config as b, parseRetryAfterMs as b$, type CfAccount as b0, type HookValues as b1, type Hook as b2, type AsyncHook as b3, type LogLevel as b4, type NodeJSCompatMode as b5, type StartDevWorkerInput as b6, type Entry as b7, INHERIT_SYMBOL as b8, SERVICE_TAG_PREFIX as b9, getSubdomainMixedStateCheckDisabled as bA, getCloudflareLoadDevVarsFromDotEnv as bB, getCloudflareIncludeProcessEnvFromEnv as bC, getTraceHeader as bD, getDisableConfigWatching as bE, getWranglerHideBanner as bF, getCloudflareEnv as bG, getOpenNextDeployFromEnv as bH, getLocalExplorerEnabledFromEnv as bI, getLocalObservabilityEnabledFromEnv as bJ, getBrowserRenderingHeadfulFromEnv as bK, getCfFetchEnabledFromEnv as bL, getCfFetchPathFromEnv as bM, getWranglerCacheDirFromEnv as bN, getCloudflaredPathFromEnv as bO, type ApiCredentials as bP, type FetchResult as bQ, type FetchResultFetcher as bR, type FetchListResultFetcher as bS, type FetchPagedListResultFetcher as bT, performApiFetchBase as bU, fetchInternalBase as bV, fetchResultBase as bW, fetchListResultBase as bX, truncate as bY, isWAFBlockResponse as bZ, parseRetryAfterValue as b_, ENVIRONMENT_TAG_PREFIX as ba, PATH_TO_DEPLOY_CONFIG as bb, JSON_CONFIG_FORMATS as bc, getC3CommandFromEnv as bd, getWranglerSendMetricsFromEnv as be, getWranglerSendErrorReportsFromEnv as bf, getCloudflareApiEnvironmentFromEnv as bg, type ComplianceConfig as bh, COMPLIANCE_REGION_CONFIG_PUBLIC as bi, COMPLIANCE_REGION_CONFIG_UNKNOWN as bj, getCloudflareComplianceRegion as bk, getCloudflareApiBaseUrl as bl, getComplianceRegionSubdomain as bm, getSanitizeLogs as bn, getOutputFileDirectoryFromEnv as bo, getOutputFilePathFromEnv as bp, getCIMatchTag as bq, getCIOverrideName as br, getCIOverrideNetworkModeHost as bs, getCIGeneratePreviewAlias as bt, getWorkersCIBranchName as bu, getBuildConditionsFromEnv as bv, getBuildPlatformFromEnv as bw, getRegistryPath as bx, getD1ExtraLocationChoices as by, getDockerPath as bz, type WorkerMetadataBinding as c, extractWAFBlockRayId as c0, extractAccountTag as c1, hasMorePages as c2, renderError as c3, addAuthorizationHeader as c4, throwFetchError as c5, fetchKVGetValueBase as c6, type FetchKVGetValueFetcher as c7, hasCursor as c8, maybeAddTraceHeader as c9, type Route as d, type RawDevConfig as e, type ConfigFields as f, type RawEnvironment as g, defaultWranglerConfig as h, LOGGER_LEVELS as i, type LoggerLevel as j, type Environment as k, type LocalS3Credentials as l, type ZoneNameRoute as m, type CustomDomainRoute as n, type CloudchamberConfig as o, type ContainerApp as p, type DurableObjectMigration as q, type DurableObjectExportStorage as r, type ConfiguredExport as s, type DurableObjectBindings as t, type ArtifactsEventType as u, type ArtifactsEventTrigger as v, type WorkflowBinding as w, type EnvironmentNonInheritable as x, type Rule as y, type ConfigModuleRuleType 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 WorkerMetadataBinding, L as Logger, d as Route } from './config-
|
|
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-CFrqMEcY.mjs';
|
|
2
|
+
export { A as ARTIFACTS_EVENT_TYPES, bP as ApiCredentials, v as ArtifactsEventTrigger, u as ArtifactsEventType, aK as AssetConfigMetadata, G as Assets, aL as AssetsOptions, b3 as AsyncHook, a_ as BinaryFile, bi as COMPLIANCE_REGION_CONFIG_PUBLIC, bj as COMPLIANCE_REGION_CONFIG_UNKNOWN, H as CacheOptions, a0 as CfAIBinding, ad as CfAISearch, ac as CfAISearchNamespace, b0 as CfAccount, af as CfAgentMemory, ar as CfAnalyticsEngineDataset, ah as CfArtifacts, aw as CfAssetsBinding, $ as CfBrowserBinding, az as CfCapnp, aa as CfD1Database, a5 as CfDataBlobBindings, an as CfDevPluginCfg, as as CfDispatchNamespace, a6 as CfDurableObject, aB as CfDurableObjectMigrations, aC as CfExports, aj as CfFlagship, ai as CfHelloWorld, am as CfHyperdrive, a1 as CfImagesBinding, V as CfKvNamespace, au as CfLogfwdr, av as CfLogfwdrBinding, at as CfMTlsCertificate, a2 as CfMediaBinding, N as CfModule, M as CfModuleType, ax as CfPipeline, aD as CfPlacement, a8 as CfQueue, a9 as CfR2Bucket, al as CfRateLimit, K as CfScriptFormat, ag as CfSecretsStoreSecrets, X as CfSendEmailBindings, ao as CfService, a3 as CfStreamBinding, aE as CfTailConsumer, _ as CfTextBlobBindings, aA as CfUnsafe, ay as CfUnsafeBinding, aF as CfUserLimits, Q as CfVars, ab as CfVectorize, a4 as CfVersionMetadataBinding, aq as CfVpcNetwork, ap as CfVpcService, Y as CfWasmModuleBindings, ae as CfWebSearch, aH as CfWorkerContext, aG as CfWorkerInit, ak as CfWorkerLoader, aI as CfWorkerSourceMap, a7 as CfWorkflow, o as CloudchamberConfig, bh as ComplianceConfig, f as ConfigFields, z as ConfigModuleRuleType, s as ConfiguredExport, p as ContainerApp, J as ContainerEngine, n as CustomDomainRoute, F as DispatchNamespaceOutbound, I as DockerConfiguration, t as DurableObjectBindings, r as DurableObjectExportStorage, q as DurableObjectMigration, ba as ENVIRONMENT_TAG_PREFIX, b7 as Entry, k as Environment, x as EnvironmentNonInheritable, aP as ExportsReconciliationEntryBase, aS as ExportsReconciliationErrorDetail, aQ as ExportsReconciliationInfo, aT as ExportsReconciliationRename, aW as ExportsReconciliationResult, aU as ExportsReconciliationTransfer, aV as ExportsReconciliationTransferPending, aR as ExportsReconciliationWarning, c7 as FetchKVGetValueFetcher, bS as FetchListResultFetcher, bT as FetchPagedListResultFetcher, bQ as FetchResult, bR as FetchResultFetcher, aZ as File, b2 as Hook, b1 as HookValues, b8 as INHERIT_SYMBOL, bc as JSON_CONFIG_FORMATS, aJ as Json, i as LOGGER_LEVELS, aN as LegacyAssetPaths, l as LocalS3Credentials, b4 as LogLevel, j as LoggerLevel, b5 as NodeJSCompatMode, O as Observability, bb as PATH_TO_DEPLOY_CONFIG, P as PreviewsConfig, e as RawDevConfig, g as RawEnvironment, a as RedirectedRawConfig, y as Rule, b9 as SERVICE_TAG_PREFIX, aY as ServiceFetch, aX as ServiceMetadataRes, b6 as StartDevWorkerInput, S as StreamingTailConsumer, T as TailConsumer, a$ as Trigger, U as UserLimits, aM as ValidatedAssetsOptions, aO as WorkerMetadata, w as WorkflowBinding, Z as ZoneIdRoute, m as ZoneNameRoute, c4 as addAuthorizationHeader, h as defaultWranglerConfig, c1 as extractAccountTag, c0 as extractWAFBlockRayId, bV as fetchInternalBase, c6 as fetchKVGetValueBase, bX as fetchListResultBase, bW as fetchResultBase, bK as getBrowserRenderingHeadfulFromEnv, bv as getBuildConditionsFromEnv, bw as getBuildPlatformFromEnv, bd as getC3CommandFromEnv, bt as getCIGeneratePreviewAlias, bq as getCIMatchTag, br as getCIOverrideName, bs as getCIOverrideNetworkModeHost, bL as getCfFetchEnabledFromEnv, bM as getCfFetchPathFromEnv, bl as getCloudflareApiBaseUrl, bg as getCloudflareApiEnvironmentFromEnv, bk as getCloudflareComplianceRegion, bG as getCloudflareEnv, bC as getCloudflareIncludeProcessEnvFromEnv, bB as getCloudflareLoadDevVarsFromDotEnv, bO as getCloudflaredPathFromEnv, bm as getComplianceRegionSubdomain, by as getD1ExtraLocationChoices, bE as getDisableConfigWatching, bz as getDockerPath, bI as getLocalExplorerEnabledFromEnv, bJ as getLocalObservabilityEnabledFromEnv, bH as getOpenNextDeployFromEnv, bo as getOutputFileDirectoryFromEnv, bp as getOutputFilePathFromEnv, bx as getRegistryPath, bn as getSanitizeLogs, bA as getSubdomainMixedStateCheckDisabled, bD as getTraceHeader, bu as getWorkersCIBranchName, bN as getWranglerCacheDirFromEnv, bF as getWranglerHideBanner, bf as getWranglerSendErrorReportsFromEnv, be as getWranglerSendMetricsFromEnv, c8 as hasCursor, c2 as hasMorePages, bZ as isWAFBlockResponse, c9 as maybeAddTraceHeader, b$ as parseRetryAfterMs, b_ as parseRetryAfterValue, bU as performApiFetchBase, c3 as renderError, c5 as throwFetchError, bY as truncate } from './config-CFrqMEcY.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';
|
package/dist/index.mjs
CHANGED
|
@@ -1617,6 +1617,19 @@ var require_update_check = __commonJS({
|
|
|
1617
1617
|
}
|
|
1618
1618
|
});
|
|
1619
1619
|
|
|
1620
|
+
// src/config/environment.ts
|
|
1621
|
+
var ARTIFACTS_EVENT_TYPES = [
|
|
1622
|
+
"cf.artifacts.repo.created",
|
|
1623
|
+
"cf.artifacts.repo.deleted",
|
|
1624
|
+
"cf.artifacts.repo.forked",
|
|
1625
|
+
"cf.artifacts.repo.imported",
|
|
1626
|
+
"cf.artifacts.repo.pushed",
|
|
1627
|
+
"cf.artifacts.repo.cloned",
|
|
1628
|
+
"cf.artifacts.repo.fetched",
|
|
1629
|
+
"cf.artifacts.repo.token.created",
|
|
1630
|
+
"cf.artifacts.repo.token.revoked"
|
|
1631
|
+
];
|
|
1632
|
+
|
|
1620
1633
|
// src/config/durable-object-exports.ts
|
|
1621
1634
|
function getDurableObjectExports(exports) {
|
|
1622
1635
|
return partitionExports(exports)["durable-object"];
|
|
@@ -16996,7 +17009,7 @@ var getLocalExplorerEnabledFromEnv = getBooleanEnvironmentVariableFactory({
|
|
|
16996
17009
|
});
|
|
16997
17010
|
var getLocalObservabilityEnabledFromEnv = getBooleanEnvironmentVariableFactory({
|
|
16998
17011
|
variableName: "X_LOCAL_OBSERVABILITY",
|
|
16999
|
-
defaultValue:
|
|
17012
|
+
defaultValue: true
|
|
17000
17013
|
});
|
|
17001
17014
|
var getBrowserRenderingHeadfulFromEnv = getBooleanEnvironmentVariableFactory({
|
|
17002
17015
|
variableName: "X_BROWSER_HEADFUL",
|
|
@@ -18653,7 +18666,10 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
18653
18666
|
rawEnv,
|
|
18654
18667
|
envName,
|
|
18655
18668
|
"containers",
|
|
18656
|
-
|
|
18669
|
+
// `name` is inheritable, so a named environment that doesn't redeclare it
|
|
18670
|
+
// still runs under the top level Worker name — fall back to it so the
|
|
18671
|
+
// generated container name isn't built from `undefined`.
|
|
18672
|
+
validateContainerApp(envName, rawEnv.name ?? rawConfig?.name, configPath),
|
|
18657
18673
|
void 0
|
|
18658
18674
|
),
|
|
18659
18675
|
send_email: notInheritable(
|
|
@@ -19123,11 +19139,14 @@ var validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv
|
|
|
19123
19139
|
[]
|
|
19124
19140
|
);
|
|
19125
19141
|
}, "validateAndNormalizeRules");
|
|
19142
|
+
var ARTIFACTS_EVENT_TYPE_SET = new Set(
|
|
19143
|
+
ARTIFACTS_EVENT_TYPES
|
|
19144
|
+
);
|
|
19126
19145
|
var validateTriggers = /* @__PURE__ */ __name((diagnostics, triggersFieldName, triggersValue) => {
|
|
19127
19146
|
if (triggersValue === void 0 || triggersValue === null) {
|
|
19128
19147
|
return true;
|
|
19129
19148
|
}
|
|
19130
|
-
if (typeof triggersValue !== "object") {
|
|
19149
|
+
if (typeof triggersValue !== "object" || Array.isArray(triggersValue)) {
|
|
19131
19150
|
diagnostics.errors.push(
|
|
19132
19151
|
`Expected "${triggersFieldName}" to be of type object but got ${JSON.stringify(
|
|
19133
19152
|
triggersValue
|
|
@@ -19142,11 +19161,83 @@ var validateTriggers = /* @__PURE__ */ __name((diagnostics, triggersFieldName, t
|
|
|
19142
19161
|
);
|
|
19143
19162
|
isValid = false;
|
|
19144
19163
|
}
|
|
19164
|
+
if (hasProperty(triggersValue, "events") && !Array.isArray(triggersValue.events)) {
|
|
19165
|
+
diagnostics.errors.push(
|
|
19166
|
+
`Expected "${triggersFieldName}.events" to be of type array, but got ${JSON.stringify(triggersValue)}.`
|
|
19167
|
+
);
|
|
19168
|
+
isValid = false;
|
|
19169
|
+
} else if (hasProperty(triggersValue, "events") && Array.isArray(triggersValue.events)) {
|
|
19170
|
+
for (const [eventIndex, event] of triggersValue.events.entries()) {
|
|
19171
|
+
const eventFieldName = `${triggersFieldName}.events[${eventIndex}]`;
|
|
19172
|
+
if (typeof event !== "object" || event === null || Array.isArray(event)) {
|
|
19173
|
+
diagnostics.errors.push(
|
|
19174
|
+
`Expected "${eventFieldName}" to be of type object, but got ${JSON.stringify(event)}.`
|
|
19175
|
+
);
|
|
19176
|
+
isValid = false;
|
|
19177
|
+
continue;
|
|
19178
|
+
}
|
|
19179
|
+
if (!isRequiredProperty(event, "type", "string") || !ARTIFACTS_EVENT_TYPE_SET.has(event.type)) {
|
|
19180
|
+
diagnostics.errors.push(
|
|
19181
|
+
`Expected "${eventFieldName}.type" to be a supported Artifacts event type, but got ${JSON.stringify(event.type)}.`
|
|
19182
|
+
);
|
|
19183
|
+
isValid = false;
|
|
19184
|
+
}
|
|
19185
|
+
if (hasProperty(event, "filter") && event.filter !== void 0) {
|
|
19186
|
+
if (typeof event.filter !== "object" || event.filter === null || Array.isArray(event.filter)) {
|
|
19187
|
+
diagnostics.errors.push(
|
|
19188
|
+
`Expected "${eventFieldName}.filter" to be of type object, but got ${JSON.stringify(event.filter)}.`
|
|
19189
|
+
);
|
|
19190
|
+
isValid = false;
|
|
19191
|
+
} else {
|
|
19192
|
+
for (const [filterName, filterValue] of Object.entries(
|
|
19193
|
+
event.filter
|
|
19194
|
+
)) {
|
|
19195
|
+
if (filterName !== "namespace" && filterName !== "repo_name" || typeof filterValue !== "string") {
|
|
19196
|
+
diagnostics.errors.push(
|
|
19197
|
+
`Expected "${eventFieldName}.filter" to contain only string "namespace" and "repo_name" fields, but got ${JSON.stringify(event.filter)}.`
|
|
19198
|
+
);
|
|
19199
|
+
isValid = false;
|
|
19200
|
+
break;
|
|
19201
|
+
}
|
|
19202
|
+
}
|
|
19203
|
+
}
|
|
19204
|
+
}
|
|
19205
|
+
if (!Array.isArray(event.targets) || event.targets.length === 0) {
|
|
19206
|
+
diagnostics.errors.push(
|
|
19207
|
+
`Expected "${eventFieldName}.targets" to be a non-empty array, but got ${JSON.stringify(event.targets)}.`
|
|
19208
|
+
);
|
|
19209
|
+
isValid = false;
|
|
19210
|
+
} else {
|
|
19211
|
+
for (const [targetIndex, target] of event.targets.entries()) {
|
|
19212
|
+
const targetFieldName = `${eventFieldName}.targets[${targetIndex}]`;
|
|
19213
|
+
if (typeof target !== "object" || target === null || Array.isArray(target) || target.type !== "workflow" || typeof target.workflow_name !== "string" || target.workflow_name.length === 0) {
|
|
19214
|
+
diagnostics.errors.push(
|
|
19215
|
+
`Expected "${targetFieldName}" to be a workflow target with a non-empty "workflow_name", but got ${JSON.stringify(target)}.`
|
|
19216
|
+
);
|
|
19217
|
+
isValid = false;
|
|
19218
|
+
continue;
|
|
19219
|
+
}
|
|
19220
|
+
validateAdditionalProperties(
|
|
19221
|
+
diagnostics,
|
|
19222
|
+
targetFieldName,
|
|
19223
|
+
Object.keys(target),
|
|
19224
|
+
["type", "workflow_name"]
|
|
19225
|
+
);
|
|
19226
|
+
}
|
|
19227
|
+
}
|
|
19228
|
+
validateAdditionalProperties(
|
|
19229
|
+
diagnostics,
|
|
19230
|
+
eventFieldName,
|
|
19231
|
+
Object.keys(event),
|
|
19232
|
+
["type", "filter", "targets"]
|
|
19233
|
+
);
|
|
19234
|
+
}
|
|
19235
|
+
}
|
|
19145
19236
|
isValid = validateAdditionalProperties(
|
|
19146
19237
|
diagnostics,
|
|
19147
19238
|
triggersFieldName,
|
|
19148
19239
|
Object.keys(triggersValue),
|
|
19149
|
-
["crons"]
|
|
19240
|
+
["crons", "events"]
|
|
19150
19241
|
) && isValid;
|
|
19151
19242
|
return isValid;
|
|
19152
19243
|
}, "validateTriggers");
|
|
@@ -22393,14 +22484,34 @@ var validateObservability = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
22393
22484
|
["enabled", "head_sampling_rate", "destinations", "persist"]
|
|
22394
22485
|
) && isValid;
|
|
22395
22486
|
}
|
|
22396
|
-
|
|
22487
|
+
validateHeadSamplingRate(
|
|
22488
|
+
diagnostics,
|
|
22489
|
+
field,
|
|
22490
|
+
"head_sampling_rate",
|
|
22491
|
+
val?.head_sampling_rate
|
|
22492
|
+
);
|
|
22493
|
+
validateHeadSamplingRate(
|
|
22494
|
+
diagnostics,
|
|
22495
|
+
field,
|
|
22496
|
+
"logs.head_sampling_rate",
|
|
22497
|
+
val?.logs?.head_sampling_rate
|
|
22498
|
+
);
|
|
22499
|
+
validateHeadSamplingRate(
|
|
22500
|
+
diagnostics,
|
|
22501
|
+
field,
|
|
22502
|
+
"traces.head_sampling_rate",
|
|
22503
|
+
val?.traces?.head_sampling_rate
|
|
22504
|
+
);
|
|
22505
|
+
return isValid;
|
|
22506
|
+
}, "validateObservability");
|
|
22507
|
+
function validateHeadSamplingRate(diagnostics, container, key, samplingRate) {
|
|
22397
22508
|
if (samplingRate && (samplingRate < 0 || samplingRate > 1)) {
|
|
22398
22509
|
diagnostics.errors.push(
|
|
22399
|
-
`"${
|
|
22510
|
+
`"${container}.${key}" must be a value between 0 and 1.`
|
|
22400
22511
|
);
|
|
22401
22512
|
}
|
|
22402
|
-
|
|
22403
|
-
|
|
22513
|
+
}
|
|
22514
|
+
__name(validateHeadSamplingRate, "validateHeadSamplingRate");
|
|
22404
22515
|
var validateCache = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
22405
22516
|
if (value === void 0) {
|
|
22406
22517
|
return true;
|
|
@@ -24970,4 +25081,4 @@ safe-buffer/index.js:
|
|
|
24970
25081
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
24971
25082
|
*/
|
|
24972
25083
|
|
|
24973
|
-
export { BunPackageManager, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, _forceColour, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, formatZodError, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getPackagePath, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkerName, getWorkerNameFromProject, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHiddenDirPath, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasDurableObjectExports, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, renderError, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validatePagesConfig };
|
|
25084
|
+
export { ARTIFACTS_EVENT_TYPES, BunPackageManager, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, _forceColour, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, formatZodError, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getDurableObjectExports, getEnvironmentVariableFactory, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getPackagePath, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkerName, getWorkerNameFromProject, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHiddenDirPath, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasDurableObjectExports, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, renderError, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validatePagesConfig };
|