@cloudflare/workers-utils 0.43.0 → 0.45.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 +2399 -3
- package/dist/browser.mjs +482 -2
- package/dist/{chunk-C6O4ION7.mjs → chunk-2Q77CKVU.mjs} +3 -1
- package/dist/{chunk-Z62CVNHJ.mjs → chunk-6G6FCMPX.mjs} +4 -1
- package/dist/{chunk-FLRJ77A6.mjs → chunk-AUSY7DKT.mjs} +6 -3
- package/dist/{chunk-IYSONYTF.mjs → chunk-FR75DWDU.mjs} +7 -5
- package/dist/{chunk-MCNIGVAF.mjs → chunk-M3RITKR3.mjs} +4 -1
- package/dist/{chunk-53IMCORZ.mjs → chunk-MIA26B4M.mjs} +3 -1
- package/dist/{chunk-34VZWBGB.mjs → chunk-MV2OJK3L.mjs} +4 -2
- package/dist/{chunk-WO2IAW6M.mjs → chunk-OWPFSLY6.mjs} +4 -1
- package/dist/{chunk-OWXQB7GP.mjs → chunk-PWC7WAOU.mjs} +4 -1
- package/dist/{chunk-3IYLA2JH.mjs → chunk-QSRIB43D.mjs} +5 -2
- package/dist/{chunk-Q72B4Q5Z.mjs → chunk-U6NEESU5.mjs} +6 -3
- package/dist/compatibility-date.mjs +5 -2
- package/dist/{compliance-DzwHmPKm.d.mts → compliance-CADarBwY.d.mts} +589 -514
- package/dist/compliance.d.mts +1 -1
- package/dist/compliance.mjs +10 -7
- package/dist/docker-path.mjs +6 -3
- package/dist/errors.mjs +5 -2
- package/dist/fs-helpers.mjs +5 -2
- package/dist/global-wrangler-config-path.mjs +6 -3
- package/dist/index.d.mts +48 -9
- package/dist/index.mjs +716 -37
- package/dist/local-env.mjs +4 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/{open-PBXRGS4R.mjs → open-PCXX3ZDZ.mjs} +3 -1
- package/dist/prometheus-metrics.mjs +5 -2
- package/dist/test-helpers/index.d.mts +1 -1
- package/dist/test-helpers/index.mjs +8 -5
- package/dist/zod-format.mjs +5 -2
- package/package.json +4 -4
- package/dist/chunk-DKSA7K25.mjs +0 -468
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import { __commonJS, __name, __require, __toESM } from './chunk-Q72B4Q5Z.mjs';
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
export { MetricsRegistry } from './chunk-6G6FCMPX.mjs';
|
|
3
|
+
import { external_exports } from './chunk-PWC7WAOU.mjs';
|
|
4
|
+
export { formatZodError } from './chunk-PWC7WAOU.mjs';
|
|
5
|
+
import { isRedirectedRawConfig, configFileName, formatConfigSnippet, partitionExports, getDurableObjectExports, getContainerNameToClassNameMap, parsePackageJSON, readFileSync, ParseError, parseJSON, APIError, isLiveDurableObjectExport, dir, parseTOML, modify, applyEdits, format, stringify, parseJSONC } from './chunk-AUSY7DKT.mjs';
|
|
6
|
+
export { APIError, ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, PATH_TO_DEPLOY_CONFIG, ParseError, SERVICE_TAG_PREFIX, configFileName, configFormat, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectClassNameToUseSQLiteMap, getDurableObjectContainerApps, getDurableObjectExports, getResolvedDurableObjectContainerApps, hasDurableObjectExports, indexLocation, isDurableObjectContainerApp, isLiveDurableObjectExport, isRedirectedConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveWranglerConfigPath, searchLocation, validateDurableObjectContainerApplications } from './chunk-AUSY7DKT.mjs';
|
|
7
|
+
export { NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, getTodaysCompatDate, isCompatDate, isNodejsCompatDefaultOn, resolveNodejsCompat, stripRedundantNodejsCompatFlags } from './chunk-2Q77CKVU.mjs';
|
|
8
|
+
import { getCloudflareEnv, getCloudflareContainerRegistry, getCloudflareApiBaseUrl, getTraceHeader, getCloudflaredPathFromEnv, getOutputFilePathFromEnv, getOutputFileDirectoryFromEnv, getCIOverrideName, getWranglerCacheDirFromEnv } from './chunk-FR75DWDU.mjs';
|
|
9
|
+
export { COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareContainerRegistry, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getNoSkillsUpdatePromptsFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, isDoNotTrackEnabled } from './chunk-FR75DWDU.mjs';
|
|
10
|
+
import { dedent } from './chunk-M3RITKR3.mjs';
|
|
11
|
+
export { getBooleanEnvironmentVariableFactory, getDockerPath, getEnvironmentVariableFactory } from './chunk-QSRIB43D.mjs';
|
|
12
|
+
import { UserError, FatalError } from './chunk-OWPFSLY6.mjs';
|
|
13
|
+
export { CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, UserError, createFatalError } from './chunk-OWPFSLY6.mjs';
|
|
14
|
+
import { getGlobalConfigPath } from './chunk-MV2OJK3L.mjs';
|
|
15
|
+
export { getGlobalConfigPath, getGlobalWranglerCachePath } from './chunk-MV2OJK3L.mjs';
|
|
16
|
+
import { isDirectory, removeDirSync } from './chunk-MIA26B4M.mjs';
|
|
17
|
+
export { isDirectory, removeDir, removeDirSync } from './chunk-MIA26B4M.mjs';
|
|
18
|
+
import { __commonJS, __name, __require, __toESM } from './chunk-U6NEESU5.mjs';
|
|
20
19
|
import fs2, { statSync, accessSync, constants, writeFileSync, renameSync, existsSync, unlinkSync, mkdirSync, chmodSync, readFileSync as readFileSync$1, appendFileSync } from 'node:fs';
|
|
21
20
|
import assert from 'node:assert';
|
|
22
21
|
import * as path from 'node:path';
|
|
@@ -31,6 +30,8 @@ import { arch } from 'node:os';
|
|
|
31
30
|
import * as timersPromises from 'node:timers/promises';
|
|
32
31
|
import { setTimeout as setTimeout$1 } from 'node:timers/promises';
|
|
33
32
|
|
|
33
|
+
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
34
|
+
|
|
34
35
|
// ../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json
|
|
35
36
|
var require_vendors = __commonJS({
|
|
36
37
|
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports$1, module) {
|
|
@@ -2551,11 +2552,13 @@ var defaultWranglerConfig = {
|
|
|
2551
2552
|
containers: void 0,
|
|
2552
2553
|
send_email: [],
|
|
2553
2554
|
browser: void 0,
|
|
2555
|
+
analytics: void 0,
|
|
2554
2556
|
unsafe: {},
|
|
2555
2557
|
mtls_certificates: [],
|
|
2556
2558
|
tail_consumers: void 0,
|
|
2557
2559
|
streaming_tail_consumers: void 0,
|
|
2558
2560
|
pipelines: [],
|
|
2561
|
+
k2: [],
|
|
2559
2562
|
vpc_services: [],
|
|
2560
2563
|
vpc_networks: []
|
|
2561
2564
|
};
|
|
@@ -3061,6 +3064,7 @@ var friendlyBindingNames = {
|
|
|
3061
3064
|
analytics_engine_datasets: "Analytics Engine Dataset",
|
|
3062
3065
|
text_blobs: "Text Blob",
|
|
3063
3066
|
browser: "Browser Run",
|
|
3067
|
+
analytics: "Analytics SQL",
|
|
3064
3068
|
ai: "AI",
|
|
3065
3069
|
images: "Images",
|
|
3066
3070
|
stream: "Stream",
|
|
@@ -3073,6 +3077,7 @@ var friendlyBindingNames = {
|
|
|
3073
3077
|
mtls_certificates: "mTLS Certificate",
|
|
3074
3078
|
workflows: "Workflow",
|
|
3075
3079
|
pipelines: "Pipeline",
|
|
3080
|
+
k2: "K2 Stream",
|
|
3076
3081
|
secrets_store_secrets: "Secrets Store Secret",
|
|
3077
3082
|
artifacts: "Artifacts",
|
|
3078
3083
|
ratelimits: "Rate Limit",
|
|
@@ -3093,6 +3098,7 @@ var bindingTypeFriendlyNames = {
|
|
|
3093
3098
|
wasm_module: "Wasm Module",
|
|
3094
3099
|
text_blob: "Text Blob",
|
|
3095
3100
|
browser: "Browser Run",
|
|
3101
|
+
analytics: "Analytics SQL",
|
|
3096
3102
|
ai: "AI",
|
|
3097
3103
|
images: "Images",
|
|
3098
3104
|
stream: "Stream",
|
|
@@ -3114,6 +3120,7 @@ var bindingTypeFriendlyNames = {
|
|
|
3114
3120
|
dispatch_namespace: "Dispatch Namespace",
|
|
3115
3121
|
mtls_certificate: "mTLS Certificate",
|
|
3116
3122
|
pipeline: "Pipeline",
|
|
3123
|
+
k2: "K2 Stream",
|
|
3117
3124
|
secrets_store_secret: "Secrets Store Secret",
|
|
3118
3125
|
artifacts: "Artifacts",
|
|
3119
3126
|
logfwdr: "logfwdr",
|
|
@@ -4214,18 +4221,22 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
4214
4221
|
validateDefines(envName),
|
|
4215
4222
|
{}
|
|
4216
4223
|
),
|
|
4217
|
-
durable_objects:
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
bindings: []
|
|
4227
|
-
|
|
4228
|
-
|
|
4224
|
+
durable_objects: (() => {
|
|
4225
|
+
const durableObjects = notInheritable(
|
|
4226
|
+
diagnostics,
|
|
4227
|
+
topLevelEnv,
|
|
4228
|
+
rawConfig,
|
|
4229
|
+
rawEnv,
|
|
4230
|
+
envName,
|
|
4231
|
+
"durable_objects",
|
|
4232
|
+
validateDurableObjectsProperty(envName, true),
|
|
4233
|
+
{ bindings: [] }
|
|
4234
|
+
);
|
|
4235
|
+
return {
|
|
4236
|
+
...durableObjects,
|
|
4237
|
+
bindings: durableObjects.bindings ?? []
|
|
4238
|
+
};
|
|
4239
|
+
})(),
|
|
4229
4240
|
workflows: notInheritable(
|
|
4230
4241
|
diagnostics,
|
|
4231
4242
|
topLevelEnv,
|
|
@@ -4477,6 +4488,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
4477
4488
|
validateNamedSimpleBinding(envName),
|
|
4478
4489
|
void 0
|
|
4479
4490
|
),
|
|
4491
|
+
analytics: notInheritable(
|
|
4492
|
+
diagnostics,
|
|
4493
|
+
topLevelEnv,
|
|
4494
|
+
rawConfig,
|
|
4495
|
+
rawEnv,
|
|
4496
|
+
envName,
|
|
4497
|
+
"analytics",
|
|
4498
|
+
validateNamedSimpleBinding(envName),
|
|
4499
|
+
void 0
|
|
4500
|
+
),
|
|
4480
4501
|
ai: notInheritable(
|
|
4481
4502
|
diagnostics,
|
|
4482
4503
|
topLevelEnv,
|
|
@@ -4527,6 +4548,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
4527
4548
|
validateBindingArray(envName, validatePipelineBinding),
|
|
4528
4549
|
[]
|
|
4529
4550
|
),
|
|
4551
|
+
k2: notInheritable(
|
|
4552
|
+
diagnostics,
|
|
4553
|
+
topLevelEnv,
|
|
4554
|
+
rawConfig,
|
|
4555
|
+
rawEnv,
|
|
4556
|
+
envName,
|
|
4557
|
+
"k2",
|
|
4558
|
+
validateBindingArray(envName, validateK2Binding),
|
|
4559
|
+
[]
|
|
4560
|
+
),
|
|
4530
4561
|
secrets_store_secrets: notInheritable(
|
|
4531
4562
|
diagnostics,
|
|
4532
4563
|
topLevelEnv,
|
|
@@ -5106,6 +5137,85 @@ Please add a binding for each to "${fieldPath}.bindings":
|
|
|
5106
5137
|
}
|
|
5107
5138
|
return isValid;
|
|
5108
5139
|
}, "validateBindingsProperty");
|
|
5140
|
+
var DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS = 24 * 60 * 60;
|
|
5141
|
+
var MILLISECOND_PRECISION_TOLERANCE = 1e-6;
|
|
5142
|
+
var validateDurableObjectsProperty = /* @__PURE__ */ __name((envName, allowMissingBindings = false, allowCodeUpdateStrategy = true) => (diagnostics, field, value, config) => {
|
|
5143
|
+
const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
|
|
5144
|
+
if (value === void 0) {
|
|
5145
|
+
return true;
|
|
5146
|
+
}
|
|
5147
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
5148
|
+
diagnostics.errors.push(
|
|
5149
|
+
`The field "${fieldPath}" should be an object but got ${JSON.stringify(value)}.`
|
|
5150
|
+
);
|
|
5151
|
+
return false;
|
|
5152
|
+
}
|
|
5153
|
+
validateAdditionalProperties(
|
|
5154
|
+
diagnostics,
|
|
5155
|
+
fieldPath,
|
|
5156
|
+
Object.keys(value),
|
|
5157
|
+
allowCodeUpdateStrategy ? ["bindings", "code_update_strategy"] : ["bindings"]
|
|
5158
|
+
);
|
|
5159
|
+
const bindingsContainer = allowMissingBindings && !hasProperty(value, "bindings") ? { ...value, bindings: [] } : value;
|
|
5160
|
+
let isValid = validateBindingsProperty(
|
|
5161
|
+
envName,
|
|
5162
|
+
validateDurableObjectBinding
|
|
5163
|
+
)(diagnostics, field, bindingsContainer, config);
|
|
5164
|
+
if (!allowCodeUpdateStrategy) {
|
|
5165
|
+
return isValid;
|
|
5166
|
+
}
|
|
5167
|
+
if (!hasProperty(value, "code_update_strategy") || value.code_update_strategy === void 0) {
|
|
5168
|
+
return isValid;
|
|
5169
|
+
}
|
|
5170
|
+
const strategy = value.code_update_strategy;
|
|
5171
|
+
const strategyPath = `${fieldPath}.code_update_strategy`;
|
|
5172
|
+
if (typeof strategy !== "object" || strategy === null || Array.isArray(strategy)) {
|
|
5173
|
+
diagnostics.errors.push(
|
|
5174
|
+
`The field "${strategyPath}" should be an object but got ${JSON.stringify(strategy)}.`
|
|
5175
|
+
);
|
|
5176
|
+
return false;
|
|
5177
|
+
}
|
|
5178
|
+
validateAdditionalProperties(
|
|
5179
|
+
diagnostics,
|
|
5180
|
+
strategyPath,
|
|
5181
|
+
Object.keys(strategy),
|
|
5182
|
+
["mode", "max_delay"]
|
|
5183
|
+
);
|
|
5184
|
+
isValid = validateRequiredProperty(
|
|
5185
|
+
diagnostics,
|
|
5186
|
+
strategyPath,
|
|
5187
|
+
"mode",
|
|
5188
|
+
hasProperty(strategy, "mode") ? strategy.mode : void 0,
|
|
5189
|
+
"string",
|
|
5190
|
+
["immediate", "deferred"]
|
|
5191
|
+
) && isValid;
|
|
5192
|
+
const maxDelay = hasProperty(strategy, "max_delay") ? strategy.max_delay : void 0;
|
|
5193
|
+
const maxDelayHasValidType = validateOptionalProperty(
|
|
5194
|
+
diagnostics,
|
|
5195
|
+
strategyPath,
|
|
5196
|
+
"max_delay",
|
|
5197
|
+
maxDelay,
|
|
5198
|
+
"number"
|
|
5199
|
+
);
|
|
5200
|
+
isValid = maxDelayHasValidType && isValid;
|
|
5201
|
+
if (maxDelayHasValidType && typeof maxDelay === "number" && (!Number.isFinite(maxDelay) || maxDelay < 0 || maxDelay > DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS)) {
|
|
5202
|
+
diagnostics.errors.push(
|
|
5203
|
+
`Expected "${strategyPath}.max_delay" to be between 0 and ${DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS} seconds but got ${JSON.stringify(maxDelay)}.`
|
|
5204
|
+
);
|
|
5205
|
+
isValid = false;
|
|
5206
|
+
}
|
|
5207
|
+
if (maxDelayHasValidType && typeof maxDelay === "number" && Number.isFinite(maxDelay) && maxDelay >= 0 && maxDelay <= DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS) {
|
|
5208
|
+
const milliseconds = maxDelay * 1e3;
|
|
5209
|
+
const roundedMilliseconds = Math.round(milliseconds);
|
|
5210
|
+
if (maxDelay > 0 && roundedMilliseconds === 0 || Math.abs(milliseconds - roundedMilliseconds) > MILLISECOND_PRECISION_TOLERANCE) {
|
|
5211
|
+
diagnostics.errors.push(
|
|
5212
|
+
`Expected "${strategyPath}.max_delay" to use millisecond precision but got ${JSON.stringify(maxDelay)}.`
|
|
5213
|
+
);
|
|
5214
|
+
isValid = false;
|
|
5215
|
+
}
|
|
5216
|
+
}
|
|
5217
|
+
return isValid;
|
|
5218
|
+
}, "validateDurableObjectsProperty");
|
|
5109
5219
|
var validateUnsafeSettings = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {
|
|
5110
5220
|
const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;
|
|
5111
5221
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
@@ -5665,6 +5775,7 @@ var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
5665
5775
|
"data_blob",
|
|
5666
5776
|
"text_blob",
|
|
5667
5777
|
"browser",
|
|
5778
|
+
"analytics",
|
|
5668
5779
|
"ai",
|
|
5669
5780
|
"ai_search_namespace",
|
|
5670
5781
|
"ai_search",
|
|
@@ -5677,6 +5788,7 @@ var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
5677
5788
|
"logfwdr",
|
|
5678
5789
|
"mtls_certificate",
|
|
5679
5790
|
"pipeline",
|
|
5791
|
+
"k2",
|
|
5680
5792
|
"worker_loader",
|
|
5681
5793
|
"vpc_service",
|
|
5682
5794
|
"flagship",
|
|
@@ -7627,6 +7739,38 @@ var validatePipelineBinding = /* @__PURE__ */ __name((diagnostics, field, value)
|
|
|
7627
7739
|
]);
|
|
7628
7740
|
return isValid;
|
|
7629
7741
|
}, "validatePipelineBinding");
|
|
7742
|
+
var validateK2Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
7743
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
7744
|
+
diagnostics.errors.push(
|
|
7745
|
+
`"${field}" bindings should be objects, but got ${JSON.stringify(value)}`
|
|
7746
|
+
);
|
|
7747
|
+
return false;
|
|
7748
|
+
}
|
|
7749
|
+
let isValid = true;
|
|
7750
|
+
if (!isRequiredProperty(value, "binding", "string")) {
|
|
7751
|
+
diagnostics.errors.push(`"${field}" must have a string "binding" field.`);
|
|
7752
|
+
isValid = false;
|
|
7753
|
+
}
|
|
7754
|
+
if (!isRequiredProperty(value, "stream", "string")) {
|
|
7755
|
+
diagnostics.errors.push(`"${field}" must have a string "stream" field.`);
|
|
7756
|
+
isValid = false;
|
|
7757
|
+
}
|
|
7758
|
+
if (!isRemoteValid(value, field, diagnostics)) {
|
|
7759
|
+
isValid = false;
|
|
7760
|
+
}
|
|
7761
|
+
if ("remote" in value && value.remote === false) {
|
|
7762
|
+
diagnostics.errors.push(
|
|
7763
|
+
`"${field}" does not support \`remote: false\`. K2 bindings always access remote resources; omit "remote" or set \`remote: true\`.`
|
|
7764
|
+
);
|
|
7765
|
+
isValid = false;
|
|
7766
|
+
}
|
|
7767
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
7768
|
+
"binding",
|
|
7769
|
+
"stream",
|
|
7770
|
+
"remote"
|
|
7771
|
+
]);
|
|
7772
|
+
return isValid;
|
|
7773
|
+
}, "validateK2Binding");
|
|
7630
7774
|
var validateSecretsStoreSecretBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
7631
7775
|
if (typeof value !== "object" || value === null) {
|
|
7632
7776
|
diagnostics.errors.push(
|
|
@@ -7917,11 +8061,13 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
7917
8061
|
"streaming_tail_consumers",
|
|
7918
8062
|
"unsafe",
|
|
7919
8063
|
"browser",
|
|
8064
|
+
"analytics",
|
|
7920
8065
|
"ai",
|
|
7921
8066
|
"images",
|
|
7922
8067
|
"stream",
|
|
7923
8068
|
"media",
|
|
7924
8069
|
"pipelines",
|
|
8070
|
+
"k2",
|
|
7925
8071
|
"secrets_store_secrets",
|
|
7926
8072
|
"artifacts",
|
|
7927
8073
|
"unsafe_hello_world",
|
|
@@ -7955,7 +8101,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
7955
8101
|
previews,
|
|
7956
8102
|
`${field}.placement`
|
|
7957
8103
|
);
|
|
7958
|
-
isValid =
|
|
8104
|
+
isValid = validateDurableObjectsProperty(envName, false, false)(
|
|
7959
8105
|
diagnostics,
|
|
7960
8106
|
`${field}.durable_objects`,
|
|
7961
8107
|
previews.durable_objects,
|
|
@@ -8071,6 +8217,14 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
8071
8217
|
void 0
|
|
8072
8218
|
) && isValid;
|
|
8073
8219
|
}
|
|
8220
|
+
if (previews.analytics !== void 0) {
|
|
8221
|
+
isValid = validateNamedSimpleBinding(envName)(
|
|
8222
|
+
diagnostics,
|
|
8223
|
+
`${field}.analytics`,
|
|
8224
|
+
previews.analytics,
|
|
8225
|
+
void 0
|
|
8226
|
+
) && isValid;
|
|
8227
|
+
}
|
|
8074
8228
|
if (previews.ai !== void 0) {
|
|
8075
8229
|
isValid = validateAIBinding(envName)(
|
|
8076
8230
|
diagnostics,
|
|
@@ -8115,6 +8269,12 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
8115
8269
|
previews.secrets_store_secrets,
|
|
8116
8270
|
void 0
|
|
8117
8271
|
) && isValid;
|
|
8272
|
+
isValid = validateBindingArray(envName, validateK2Binding)(
|
|
8273
|
+
diagnostics,
|
|
8274
|
+
`${field}.k2`,
|
|
8275
|
+
previews.k2,
|
|
8276
|
+
void 0
|
|
8277
|
+
) && isValid;
|
|
8118
8278
|
isValid = validateBindingArray(envName, validateArtifactsBinding)(
|
|
8119
8279
|
diagnostics,
|
|
8120
8280
|
`${field}.artifacts`,
|
|
@@ -9213,6 +9373,11 @@ function isDockerfile(imagePath, configPath) {
|
|
|
9213
9373
|
}
|
|
9214
9374
|
__name(isDockerfile, "isDockerfile");
|
|
9215
9375
|
|
|
9376
|
+
// src/assert-never.ts
|
|
9377
|
+
function assertNever(_value) {
|
|
9378
|
+
}
|
|
9379
|
+
__name(assertNever, "assertNever");
|
|
9380
|
+
|
|
9216
9381
|
// src/config/binding-local-support.ts
|
|
9217
9382
|
var BINDING_LOCAL_SUPPORT = {
|
|
9218
9383
|
plain_text: "local-only",
|
|
@@ -9250,6 +9415,7 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
9250
9415
|
mtls_certificate: "remote",
|
|
9251
9416
|
dispatch_namespace: "remote",
|
|
9252
9417
|
// Reach out to the @cloudflare/wrangler team before adding anything here
|
|
9418
|
+
k2: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
9253
9419
|
ai: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
9254
9420
|
ai_search: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
9255
9421
|
ai_search_namespace: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
@@ -9257,7 +9423,8 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
9257
9423
|
artifacts: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
9258
9424
|
vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
9259
9425
|
vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
9260
|
-
agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
|
|
9426
|
+
agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
9427
|
+
analytics: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
|
|
9261
9428
|
};
|
|
9262
9429
|
function getBindingLocalSupport(type) {
|
|
9263
9430
|
if (type in BINDING_LOCAL_SUPPORT) {
|
|
@@ -9311,8 +9478,6 @@ function validateBindingRemoteSetting(type, remote, warn) {
|
|
|
9311
9478
|
);
|
|
9312
9479
|
}
|
|
9313
9480
|
return;
|
|
9314
|
-
default:
|
|
9315
|
-
assertNever(support);
|
|
9316
9481
|
}
|
|
9317
9482
|
}
|
|
9318
9483
|
__name(validateBindingRemoteSetting, "validateBindingRemoteSetting");
|
|
@@ -9533,6 +9698,479 @@ function findFileUp(name, startDir, lastDir) {
|
|
|
9533
9698
|
}
|
|
9534
9699
|
__name(findFileUp, "findFileUp");
|
|
9535
9700
|
|
|
9701
|
+
// src/map-worker-metadata-bindings.ts
|
|
9702
|
+
function mapWorkerMetadataBindings(bindings) {
|
|
9703
|
+
return bindings.filter((binding) => binding.type !== "secret_text").reduce((configObj, binding) => {
|
|
9704
|
+
switch (binding.type) {
|
|
9705
|
+
case "plain_text":
|
|
9706
|
+
{
|
|
9707
|
+
configObj.vars = {
|
|
9708
|
+
...configObj.vars ?? {},
|
|
9709
|
+
[binding.name]: binding.text
|
|
9710
|
+
};
|
|
9711
|
+
}
|
|
9712
|
+
break;
|
|
9713
|
+
case "json":
|
|
9714
|
+
{
|
|
9715
|
+
configObj.vars = {
|
|
9716
|
+
...configObj.vars ?? {},
|
|
9717
|
+
[binding.name]: binding.json
|
|
9718
|
+
};
|
|
9719
|
+
}
|
|
9720
|
+
break;
|
|
9721
|
+
case "kv_namespace":
|
|
9722
|
+
{
|
|
9723
|
+
configObj.kv_namespaces = [
|
|
9724
|
+
...configObj.kv_namespaces ?? [],
|
|
9725
|
+
{ id: binding.namespace_id, binding: binding.name }
|
|
9726
|
+
];
|
|
9727
|
+
}
|
|
9728
|
+
break;
|
|
9729
|
+
case "durable_object_namespace":
|
|
9730
|
+
{
|
|
9731
|
+
configObj.durable_objects = {
|
|
9732
|
+
bindings: [
|
|
9733
|
+
...configObj.durable_objects?.bindings ?? [],
|
|
9734
|
+
{
|
|
9735
|
+
name: binding.name,
|
|
9736
|
+
class_name: binding.class_name,
|
|
9737
|
+
script_name: binding.script_name,
|
|
9738
|
+
environment: binding.environment
|
|
9739
|
+
}
|
|
9740
|
+
]
|
|
9741
|
+
};
|
|
9742
|
+
}
|
|
9743
|
+
break;
|
|
9744
|
+
case "d1":
|
|
9745
|
+
{
|
|
9746
|
+
configObj.d1_databases = [
|
|
9747
|
+
...configObj.d1_databases ?? [],
|
|
9748
|
+
{
|
|
9749
|
+
binding: binding.name,
|
|
9750
|
+
database_id: binding.id
|
|
9751
|
+
}
|
|
9752
|
+
];
|
|
9753
|
+
}
|
|
9754
|
+
break;
|
|
9755
|
+
case "browser":
|
|
9756
|
+
{
|
|
9757
|
+
configObj.browser = {
|
|
9758
|
+
binding: binding.name
|
|
9759
|
+
};
|
|
9760
|
+
}
|
|
9761
|
+
break;
|
|
9762
|
+
case "analytics":
|
|
9763
|
+
{
|
|
9764
|
+
configObj.analytics = {
|
|
9765
|
+
binding: binding.name
|
|
9766
|
+
};
|
|
9767
|
+
}
|
|
9768
|
+
break;
|
|
9769
|
+
case "ai":
|
|
9770
|
+
{
|
|
9771
|
+
configObj.ai = {
|
|
9772
|
+
binding: binding.name
|
|
9773
|
+
};
|
|
9774
|
+
}
|
|
9775
|
+
break;
|
|
9776
|
+
case "images":
|
|
9777
|
+
{
|
|
9778
|
+
configObj.images = {
|
|
9779
|
+
binding: binding.name
|
|
9780
|
+
};
|
|
9781
|
+
}
|
|
9782
|
+
break;
|
|
9783
|
+
case "stream":
|
|
9784
|
+
{
|
|
9785
|
+
configObj.stream = {
|
|
9786
|
+
binding: binding.name
|
|
9787
|
+
};
|
|
9788
|
+
}
|
|
9789
|
+
break;
|
|
9790
|
+
case "media":
|
|
9791
|
+
{
|
|
9792
|
+
configObj.media = {
|
|
9793
|
+
binding: binding.name
|
|
9794
|
+
};
|
|
9795
|
+
}
|
|
9796
|
+
break;
|
|
9797
|
+
case "r2_bucket":
|
|
9798
|
+
{
|
|
9799
|
+
configObj.r2_buckets = [
|
|
9800
|
+
...configObj.r2_buckets ?? [],
|
|
9801
|
+
{
|
|
9802
|
+
binding: binding.name,
|
|
9803
|
+
bucket_name: binding.bucket_name,
|
|
9804
|
+
jurisdiction: binding.jurisdiction
|
|
9805
|
+
}
|
|
9806
|
+
];
|
|
9807
|
+
}
|
|
9808
|
+
break;
|
|
9809
|
+
case "secrets_store_secret":
|
|
9810
|
+
{
|
|
9811
|
+
configObj.secrets_store_secrets = [
|
|
9812
|
+
...configObj.secrets_store_secrets ?? [],
|
|
9813
|
+
{
|
|
9814
|
+
binding: binding.name,
|
|
9815
|
+
store_id: binding.store_id,
|
|
9816
|
+
secret_name: binding.secret_name
|
|
9817
|
+
}
|
|
9818
|
+
];
|
|
9819
|
+
}
|
|
9820
|
+
break;
|
|
9821
|
+
case "artifacts":
|
|
9822
|
+
{
|
|
9823
|
+
configObj.artifacts = [
|
|
9824
|
+
...configObj.artifacts ?? [],
|
|
9825
|
+
{
|
|
9826
|
+
binding: binding.name,
|
|
9827
|
+
namespace: binding.namespace
|
|
9828
|
+
}
|
|
9829
|
+
];
|
|
9830
|
+
}
|
|
9831
|
+
break;
|
|
9832
|
+
case "unsafe_hello_world": {
|
|
9833
|
+
configObj.unsafe_hello_world = [
|
|
9834
|
+
...configObj.unsafe_hello_world ?? [],
|
|
9835
|
+
{
|
|
9836
|
+
binding: binding.name,
|
|
9837
|
+
enable_timer: binding.enable_timer
|
|
9838
|
+
}
|
|
9839
|
+
];
|
|
9840
|
+
break;
|
|
9841
|
+
}
|
|
9842
|
+
case "flagship": {
|
|
9843
|
+
configObj.flagship = [
|
|
9844
|
+
...configObj.flagship ?? [],
|
|
9845
|
+
{
|
|
9846
|
+
binding: binding.name,
|
|
9847
|
+
app_id: binding.app_id
|
|
9848
|
+
}
|
|
9849
|
+
];
|
|
9850
|
+
break;
|
|
9851
|
+
}
|
|
9852
|
+
case "service":
|
|
9853
|
+
{
|
|
9854
|
+
configObj.services = [
|
|
9855
|
+
...configObj.services ?? [],
|
|
9856
|
+
{
|
|
9857
|
+
binding: binding.name,
|
|
9858
|
+
service: binding.service,
|
|
9859
|
+
environment: binding.environment,
|
|
9860
|
+
entrypoint: binding.entrypoint
|
|
9861
|
+
}
|
|
9862
|
+
];
|
|
9863
|
+
}
|
|
9864
|
+
break;
|
|
9865
|
+
case "analytics_engine":
|
|
9866
|
+
{
|
|
9867
|
+
configObj.analytics_engine_datasets = [
|
|
9868
|
+
...configObj.analytics_engine_datasets ?? [],
|
|
9869
|
+
{ binding: binding.name, dataset: binding.dataset }
|
|
9870
|
+
];
|
|
9871
|
+
}
|
|
9872
|
+
break;
|
|
9873
|
+
case "dispatch_namespace":
|
|
9874
|
+
{
|
|
9875
|
+
configObj.dispatch_namespaces = [
|
|
9876
|
+
...configObj.dispatch_namespaces ?? [],
|
|
9877
|
+
{
|
|
9878
|
+
binding: binding.name,
|
|
9879
|
+
namespace: binding.namespace,
|
|
9880
|
+
...binding.outbound && {
|
|
9881
|
+
outbound: {
|
|
9882
|
+
service: binding.outbound.worker.service,
|
|
9883
|
+
environment: binding.outbound.worker.environment,
|
|
9884
|
+
parameters: binding.outbound.params?.map((p) => p.name) ?? []
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
}
|
|
9888
|
+
];
|
|
9889
|
+
}
|
|
9890
|
+
break;
|
|
9891
|
+
case "logfwdr":
|
|
9892
|
+
{
|
|
9893
|
+
configObj.logfwdr = {
|
|
9894
|
+
bindings: [
|
|
9895
|
+
...configObj.logfwdr?.bindings ?? [],
|
|
9896
|
+
{ name: binding.name, destination: binding.destination }
|
|
9897
|
+
]
|
|
9898
|
+
};
|
|
9899
|
+
}
|
|
9900
|
+
break;
|
|
9901
|
+
case "wasm_module":
|
|
9902
|
+
{
|
|
9903
|
+
configObj.wasm_modules = {
|
|
9904
|
+
...configObj.wasm_modules ?? {},
|
|
9905
|
+
[binding.name]: binding.part
|
|
9906
|
+
};
|
|
9907
|
+
}
|
|
9908
|
+
break;
|
|
9909
|
+
case "text_blob":
|
|
9910
|
+
{
|
|
9911
|
+
configObj.text_blobs = {
|
|
9912
|
+
...configObj.text_blobs ?? {},
|
|
9913
|
+
[binding.name]: binding.part
|
|
9914
|
+
};
|
|
9915
|
+
}
|
|
9916
|
+
break;
|
|
9917
|
+
case "data_blob":
|
|
9918
|
+
{
|
|
9919
|
+
configObj.data_blobs = {
|
|
9920
|
+
...configObj.data_blobs ?? {},
|
|
9921
|
+
[binding.name]: binding.part
|
|
9922
|
+
};
|
|
9923
|
+
}
|
|
9924
|
+
break;
|
|
9925
|
+
case "secret_text":
|
|
9926
|
+
break;
|
|
9927
|
+
case "version_metadata": {
|
|
9928
|
+
{
|
|
9929
|
+
configObj.version_metadata = {
|
|
9930
|
+
binding: binding.name
|
|
9931
|
+
};
|
|
9932
|
+
}
|
|
9933
|
+
break;
|
|
9934
|
+
}
|
|
9935
|
+
case "send_email": {
|
|
9936
|
+
configObj.send_email = [
|
|
9937
|
+
...configObj.send_email ?? [],
|
|
9938
|
+
{
|
|
9939
|
+
name: binding.name,
|
|
9940
|
+
destination_address: binding.destination_address,
|
|
9941
|
+
allowed_destination_addresses: binding.allowed_destination_addresses,
|
|
9942
|
+
allowed_sender_addresses: binding.allowed_sender_addresses
|
|
9943
|
+
}
|
|
9944
|
+
];
|
|
9945
|
+
break;
|
|
9946
|
+
}
|
|
9947
|
+
case "queue":
|
|
9948
|
+
configObj.queues ??= { producers: [] };
|
|
9949
|
+
configObj.queues.producers = [
|
|
9950
|
+
...configObj.queues.producers ?? [],
|
|
9951
|
+
{
|
|
9952
|
+
binding: binding.name,
|
|
9953
|
+
queue: binding.queue_name,
|
|
9954
|
+
delivery_delay: binding.delivery_delay
|
|
9955
|
+
}
|
|
9956
|
+
];
|
|
9957
|
+
break;
|
|
9958
|
+
case "vectorize":
|
|
9959
|
+
configObj.vectorize = [
|
|
9960
|
+
...configObj.vectorize ?? [],
|
|
9961
|
+
{
|
|
9962
|
+
binding: binding.name,
|
|
9963
|
+
index_name: binding.index_name
|
|
9964
|
+
}
|
|
9965
|
+
];
|
|
9966
|
+
break;
|
|
9967
|
+
case "ai_search_namespace":
|
|
9968
|
+
configObj.ai_search_namespaces = [
|
|
9969
|
+
...configObj.ai_search_namespaces ?? [],
|
|
9970
|
+
{
|
|
9971
|
+
binding: binding.name,
|
|
9972
|
+
namespace: binding.namespace
|
|
9973
|
+
}
|
|
9974
|
+
];
|
|
9975
|
+
break;
|
|
9976
|
+
case "ai_search":
|
|
9977
|
+
configObj.ai_search = [
|
|
9978
|
+
...configObj.ai_search ?? [],
|
|
9979
|
+
{
|
|
9980
|
+
binding: binding.name,
|
|
9981
|
+
instance_name: binding.instance_name
|
|
9982
|
+
}
|
|
9983
|
+
];
|
|
9984
|
+
break;
|
|
9985
|
+
case "agent_memory": {
|
|
9986
|
+
configObj.agent_memory = [
|
|
9987
|
+
...configObj.agent_memory ?? [],
|
|
9988
|
+
{
|
|
9989
|
+
binding: binding.name,
|
|
9990
|
+
namespace: binding.namespace
|
|
9991
|
+
}
|
|
9992
|
+
];
|
|
9993
|
+
break;
|
|
9994
|
+
}
|
|
9995
|
+
case "hyperdrive":
|
|
9996
|
+
configObj.hyperdrive = [
|
|
9997
|
+
...configObj.hyperdrive ?? [],
|
|
9998
|
+
{
|
|
9999
|
+
binding: binding.name,
|
|
10000
|
+
id: binding.id
|
|
10001
|
+
}
|
|
10002
|
+
];
|
|
10003
|
+
break;
|
|
10004
|
+
case "mtls_certificate":
|
|
10005
|
+
configObj.mtls_certificates = [
|
|
10006
|
+
...configObj.mtls_certificates ?? [],
|
|
10007
|
+
{
|
|
10008
|
+
binding: binding.name,
|
|
10009
|
+
certificate_id: binding.certificate_id
|
|
10010
|
+
}
|
|
10011
|
+
];
|
|
10012
|
+
break;
|
|
10013
|
+
case "pipelines":
|
|
10014
|
+
configObj.pipelines = [
|
|
10015
|
+
...configObj.pipelines ?? [],
|
|
10016
|
+
{
|
|
10017
|
+
binding: binding.name,
|
|
10018
|
+
// NOTE: stream is the primary field, but we also support pipeline for backward compatibility
|
|
10019
|
+
...binding.stream && { stream: binding.stream },
|
|
10020
|
+
...binding.pipeline && { pipeline: binding.pipeline }
|
|
10021
|
+
}
|
|
10022
|
+
];
|
|
10023
|
+
break;
|
|
10024
|
+
case "k2":
|
|
10025
|
+
configObj.k2 = [
|
|
10026
|
+
...configObj.k2 ?? [],
|
|
10027
|
+
{ binding: binding.name, stream: binding.stream }
|
|
10028
|
+
];
|
|
10029
|
+
break;
|
|
10030
|
+
case "assets":
|
|
10031
|
+
configObj.assets = {
|
|
10032
|
+
binding: binding.name
|
|
10033
|
+
// Note: we currently don't get all the assets information from the
|
|
10034
|
+
// API, so here we are only able to set the name of the binding
|
|
10035
|
+
// hopefully in the future we can properly fully support the binding
|
|
10036
|
+
};
|
|
10037
|
+
break;
|
|
10038
|
+
case "inherit":
|
|
10039
|
+
configObj.unsafe = {
|
|
10040
|
+
bindings: [...configObj.unsafe?.bindings ?? [], binding],
|
|
10041
|
+
metadata: configObj.unsafe?.metadata ?? void 0
|
|
10042
|
+
};
|
|
10043
|
+
break;
|
|
10044
|
+
case "workflow":
|
|
10045
|
+
{
|
|
10046
|
+
configObj.workflows = [
|
|
10047
|
+
...configObj.workflows ?? [],
|
|
10048
|
+
{
|
|
10049
|
+
binding: binding.name,
|
|
10050
|
+
name: binding.workflow_name,
|
|
10051
|
+
class_name: binding.class_name,
|
|
10052
|
+
script_name: binding.script_name
|
|
10053
|
+
}
|
|
10054
|
+
];
|
|
10055
|
+
}
|
|
10056
|
+
break;
|
|
10057
|
+
case "worker_loader":
|
|
10058
|
+
{
|
|
10059
|
+
configObj.worker_loaders = [
|
|
10060
|
+
...configObj.worker_loaders ?? [],
|
|
10061
|
+
{
|
|
10062
|
+
binding: binding.name
|
|
10063
|
+
}
|
|
10064
|
+
];
|
|
10065
|
+
}
|
|
10066
|
+
break;
|
|
10067
|
+
case "ratelimit":
|
|
10068
|
+
{
|
|
10069
|
+
configObj.ratelimits = [
|
|
10070
|
+
...configObj.ratelimits ?? [],
|
|
10071
|
+
{
|
|
10072
|
+
name: binding.name,
|
|
10073
|
+
namespace_id: binding.namespace_id,
|
|
10074
|
+
simple: {
|
|
10075
|
+
limit: binding.simple.limit,
|
|
10076
|
+
period: binding.simple.period
|
|
10077
|
+
}
|
|
10078
|
+
}
|
|
10079
|
+
];
|
|
10080
|
+
}
|
|
10081
|
+
break;
|
|
10082
|
+
case "vpc_service":
|
|
10083
|
+
{
|
|
10084
|
+
configObj.vpc_services = [
|
|
10085
|
+
...configObj.vpc_services ?? [],
|
|
10086
|
+
{
|
|
10087
|
+
binding: binding.name,
|
|
10088
|
+
service_id: binding.service_id
|
|
10089
|
+
}
|
|
10090
|
+
];
|
|
10091
|
+
}
|
|
10092
|
+
break;
|
|
10093
|
+
case "vpc_network":
|
|
10094
|
+
{
|
|
10095
|
+
if (binding.tunnel_id !== void 0) {
|
|
10096
|
+
configObj.vpc_networks = [
|
|
10097
|
+
...configObj.vpc_networks ?? [],
|
|
10098
|
+
{ binding: binding.name, tunnel_id: binding.tunnel_id }
|
|
10099
|
+
];
|
|
10100
|
+
} else if (binding.network_id !== void 0) {
|
|
10101
|
+
configObj.vpc_networks = [
|
|
10102
|
+
...configObj.vpc_networks ?? [],
|
|
10103
|
+
{ binding: binding.name, network_id: binding.network_id }
|
|
10104
|
+
];
|
|
10105
|
+
}
|
|
10106
|
+
}
|
|
10107
|
+
break;
|
|
10108
|
+
default: {
|
|
10109
|
+
configObj.unsafe = {
|
|
10110
|
+
bindings: [...configObj.unsafe?.bindings ?? [], binding],
|
|
10111
|
+
metadata: configObj.unsafe?.metadata ?? void 0
|
|
10112
|
+
};
|
|
10113
|
+
}
|
|
10114
|
+
}
|
|
10115
|
+
return configObj;
|
|
10116
|
+
}, {});
|
|
10117
|
+
}
|
|
10118
|
+
__name(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
|
|
10119
|
+
|
|
10120
|
+
// src/default-compat-date.ts
|
|
10121
|
+
var DEFAULT_COMPAT_DATE = "2026-09-30";
|
|
10122
|
+
|
|
10123
|
+
// src/construct-wrangler-config.ts
|
|
10124
|
+
function constructWranglerConfig(config) {
|
|
10125
|
+
const mappedBindings = mapWorkerMetadataBindings(config.bindings);
|
|
10126
|
+
const durableObjectClassNames = config.bindings.filter(
|
|
10127
|
+
(binding) => binding.type === "durable_object_namespace" && binding.script_name === config.name
|
|
10128
|
+
).map(
|
|
10129
|
+
(durableObject) => durableObject.class_name
|
|
10130
|
+
);
|
|
10131
|
+
const allRoutes = [
|
|
10132
|
+
...config.routes.map((r2) => ({
|
|
10133
|
+
pattern: r2.pattern,
|
|
10134
|
+
zone_name: r2.zone_name
|
|
10135
|
+
})),
|
|
10136
|
+
...config.domains.map((c) => ({
|
|
10137
|
+
pattern: c.hostname,
|
|
10138
|
+
zone_name: c.zone_name,
|
|
10139
|
+
custom_domain: true,
|
|
10140
|
+
enabled: c.enabled,
|
|
10141
|
+
previews_enabled: c.previews_enabled
|
|
10142
|
+
}))
|
|
10143
|
+
];
|
|
10144
|
+
return {
|
|
10145
|
+
name: config.name,
|
|
10146
|
+
main: config.entrypoint,
|
|
10147
|
+
workers_dev: config.subdomain.enabled,
|
|
10148
|
+
preview_urls: config.subdomain.previews_enabled,
|
|
10149
|
+
compatibility_date: config.compatibility_date ?? DEFAULT_COMPAT_DATE,
|
|
10150
|
+
compatibility_flags: config.compatibility_flags,
|
|
10151
|
+
...allRoutes.length ? { routes: allRoutes } : {},
|
|
10152
|
+
placement: config.placement?.mode === "smart" ? { mode: "smart" } : void 0,
|
|
10153
|
+
limits: config.limits,
|
|
10154
|
+
...durableObjectClassNames.length && config.migration_tag ? {
|
|
10155
|
+
migrations: [
|
|
10156
|
+
{
|
|
10157
|
+
tag: config.migration_tag,
|
|
10158
|
+
new_classes: durableObjectClassNames
|
|
10159
|
+
}
|
|
10160
|
+
]
|
|
10161
|
+
} : {},
|
|
10162
|
+
...config.schedules.length ? {
|
|
10163
|
+
triggers: {
|
|
10164
|
+
crons: config.schedules.map((scheduled) => scheduled.cron)
|
|
10165
|
+
}
|
|
10166
|
+
} : {},
|
|
10167
|
+
tail_consumers: config.tail_consumers ?? void 0,
|
|
10168
|
+
observability: config.observability,
|
|
10169
|
+
...mappedBindings
|
|
10170
|
+
};
|
|
10171
|
+
}
|
|
10172
|
+
__name(constructWranglerConfig, "constructWranglerConfig");
|
|
10173
|
+
|
|
9536
10174
|
// src/binding-utils.ts
|
|
9537
10175
|
function assertNever2(_value) {
|
|
9538
10176
|
}
|
|
@@ -9632,6 +10270,11 @@ function convertConfigToBindings(config, options) {
|
|
|
9632
10270
|
output[binding] = { type: "browser", ...x };
|
|
9633
10271
|
break;
|
|
9634
10272
|
}
|
|
10273
|
+
case "analytics": {
|
|
10274
|
+
const { binding, ...x } = info;
|
|
10275
|
+
output[binding] = { type: "analytics", ...x };
|
|
10276
|
+
break;
|
|
10277
|
+
}
|
|
9635
10278
|
case "durable_objects": {
|
|
9636
10279
|
for (const { name, ...x } of info.bindings ?? []) {
|
|
9637
10280
|
output[name] = { type: "durable_object_namespace", ...x };
|
|
@@ -9787,6 +10430,15 @@ function convertConfigToBindings(config, options) {
|
|
|
9787
10430
|
}
|
|
9788
10431
|
break;
|
|
9789
10432
|
}
|
|
10433
|
+
case "k2": {
|
|
10434
|
+
if (pages) {
|
|
10435
|
+
break;
|
|
10436
|
+
}
|
|
10437
|
+
for (const { binding, ...x } of info) {
|
|
10438
|
+
output[binding] = { type: "k2", ...x };
|
|
10439
|
+
}
|
|
10440
|
+
break;
|
|
10441
|
+
}
|
|
9790
10442
|
case "secrets_store_secrets": {
|
|
9791
10443
|
for (const { binding, ...x } of info) {
|
|
9792
10444
|
output[binding] = { type: "secrets_store_secret", ...x };
|
|
@@ -9944,6 +10596,7 @@ function printBindings(bindings, options) {
|
|
|
9944
10596
|
);
|
|
9945
10597
|
const text_blobs = extractBindingsOfType("text_blob", bindings);
|
|
9946
10598
|
const browser = extractBindingsOfType("browser", bindings);
|
|
10599
|
+
const analytics = extractBindingsOfType("analytics", bindings);
|
|
9947
10600
|
const images = extractBindingsOfType("images", bindings);
|
|
9948
10601
|
const stream = extractBindingsOfType("stream", bindings);
|
|
9949
10602
|
const ai = extractBindingsOfType("ai", bindings);
|
|
@@ -9961,6 +10614,7 @@ function printBindings(bindings, options) {
|
|
|
9961
10614
|
);
|
|
9962
10615
|
const mtls_certificates = extractBindingsOfType("mtls_certificate", bindings);
|
|
9963
10616
|
const pipelines = extractBindingsOfType("pipeline", bindings);
|
|
10617
|
+
const k2 = extractBindingsOfType("k2", bindings);
|
|
9964
10618
|
const ratelimits = extractBindingsOfType("ratelimit", bindings);
|
|
9965
10619
|
const assets = extractBindingsOfType("assets", bindings);
|
|
9966
10620
|
const unsafe_hello_world = extractBindingsOfType(
|
|
@@ -10340,6 +10994,18 @@ function printBindings(bindings, options) {
|
|
|
10340
10994
|
}))
|
|
10341
10995
|
);
|
|
10342
10996
|
}
|
|
10997
|
+
if (analytics.length > 0) {
|
|
10998
|
+
output.push(
|
|
10999
|
+
...analytics.map(({ binding, remote }) => ({
|
|
11000
|
+
name: binding,
|
|
11001
|
+
type: getBindingTypeFriendlyName("analytics"),
|
|
11002
|
+
value: void 0,
|
|
11003
|
+
mode: getMode({
|
|
11004
|
+
isSimulatedLocally: (remote === true || remote === void 0) && !context.remoteBindingsDisabled ? false : void 0
|
|
11005
|
+
})
|
|
11006
|
+
}))
|
|
11007
|
+
);
|
|
11008
|
+
}
|
|
10343
11009
|
if (images.length > 0) {
|
|
10344
11010
|
output.push(
|
|
10345
11011
|
...images.map(({ binding, remote }) => ({
|
|
@@ -10402,6 +11068,19 @@ function printBindings(bindings, options) {
|
|
|
10402
11068
|
)
|
|
10403
11069
|
);
|
|
10404
11070
|
}
|
|
11071
|
+
if (k2.length > 0) {
|
|
11072
|
+
output.push(
|
|
11073
|
+
...k2.map(({ binding, stream: k2Stream }) => ({
|
|
11074
|
+
name: binding,
|
|
11075
|
+
type: getBindingTypeFriendlyName("k2"),
|
|
11076
|
+
value: k2Stream,
|
|
11077
|
+
mode: getMode({
|
|
11078
|
+
// K2 always writes to the real stream; `remote: false` is rejected during validation.
|
|
11079
|
+
isSimulatedLocally: context.remoteBindingsDisabled ? void 0 : false
|
|
11080
|
+
})
|
|
11081
|
+
}))
|
|
11082
|
+
);
|
|
11083
|
+
}
|
|
10405
11084
|
if (ratelimits.length > 0) {
|
|
10406
11085
|
output.push(
|
|
10407
11086
|
...ratelimits.map(({ name, simple }) => ({
|
|
@@ -12452,7 +13131,7 @@ var LOGGER_LEVELS = {
|
|
|
12452
13131
|
// src/open-in-browser.ts
|
|
12453
13132
|
async function openInBrowser(url, logger) {
|
|
12454
13133
|
try {
|
|
12455
|
-
const { default: open } = await import('./open-
|
|
13134
|
+
const { default: open } = await import('./open-PCXX3ZDZ.mjs');
|
|
12456
13135
|
const childProcess = await open(url);
|
|
12457
13136
|
childProcess.on("error", (err) => {
|
|
12458
13137
|
handleBrowserOpenError(url, err, logger);
|
|
@@ -12859,4 +13538,4 @@ safe-buffer/index.js:
|
|
|
12859
13538
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
12860
13539
|
*/
|
|
12861
13540
|
|
|
12862
|
-
export { ARTIFACTS_EVENT_TYPES, BunPackageManager, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, compareMigrationPaths, convertConfigToBindings, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractBindingsOfType, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBindings, getD1MigrationFiles, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isUnsafeBindingType, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, normalizeRelativePath, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, printBindings, renderError, resolveNamedTunnel, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validateBindingRemoteSetting, validatePagesConfig, writeOutput };
|
|
13541
|
+
export { ARTIFACTS_EVENT_TYPES, BunPackageManager, DEFAULT_COMPAT_DATE, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, addAuthorizationHeader, assertNever, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, compareMigrationPaths, constructWranglerConfig, convertConfigToBindings, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractBindingsOfType, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBindings, getD1MigrationFiles, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isUnsafeBindingType, isValidR2BucketName, isWAFBlockResponse, mapWorkerMetadataBindings, maybeAddTraceHeader, normalizeAndValidateConfig, normalizeRelativePath, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, printBindings, renderError, resolveNamedTunnel, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validateBindingRemoteSetting, validatePagesConfig, writeOutput };
|