@cloudflare/deploy-helpers 0.9.2 → 0.10.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/{chunk-ZV7SJ2MZ.mjs → chunk-PXVCTRCA.mjs} +2 -359
- package/dist/create-worker-upload-form.mjs +1 -1
- package/dist/index.d.mts +12 -67
- package/dist/index.mjs +82 -907
- package/dist/metafile-esm.json +1 -1
- package/package.json +4 -4
|
@@ -2,368 +2,11 @@ import { __name } from './chunk-Q72B4Q5Z.mjs';
|
|
|
2
2
|
import assert from 'node:assert';
|
|
3
3
|
import { readFileSync } from 'node:fs';
|
|
4
4
|
import path, { resolve } from 'node:path';
|
|
5
|
-
import { UserError, INHERIT_SYMBOL } from '@cloudflare/workers-utils';
|
|
5
|
+
import { UserError, extractBindingsOfType, INHERIT_SYMBOL, isUnsafeBindingType } from '@cloudflare/workers-utils';
|
|
6
6
|
import { FormData } from 'undici';
|
|
7
7
|
import { spawnSync } from 'node:child_process';
|
|
8
8
|
import { sync } from 'command-exists';
|
|
9
9
|
|
|
10
|
-
// src/deploy/helpers/binding-utils.ts
|
|
11
|
-
function assertNever(_value) {
|
|
12
|
-
}
|
|
13
|
-
__name(assertNever, "assertNever");
|
|
14
|
-
function convertConfigToBindings(config, options) {
|
|
15
|
-
const { usePreviewIds = false, pages = false } = options ?? {};
|
|
16
|
-
const output = {};
|
|
17
|
-
const configIterable = Object.entries(config);
|
|
18
|
-
for (const [type, info] of configIterable) {
|
|
19
|
-
if (info === void 0) {
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
switch (type) {
|
|
23
|
-
case "vars": {
|
|
24
|
-
for (const [key, value] of Object.entries(info)) {
|
|
25
|
-
if (typeof value === "string") {
|
|
26
|
-
output[key] = { type: "plain_text", value };
|
|
27
|
-
} else {
|
|
28
|
-
output[key] = { type: "json", value };
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
case "kv_namespaces": {
|
|
34
|
-
for (const { binding, ...x } of info) {
|
|
35
|
-
output[binding] = {
|
|
36
|
-
type: "kv_namespace",
|
|
37
|
-
...x,
|
|
38
|
-
id: usePreviewIds ? x.preview_id ?? x.id : x.id
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
case "send_email": {
|
|
44
|
-
if (pages) {
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
for (const {
|
|
48
|
-
name,
|
|
49
|
-
destination_address,
|
|
50
|
-
allowed_destination_addresses,
|
|
51
|
-
allowed_sender_addresses,
|
|
52
|
-
remote
|
|
53
|
-
} of info) {
|
|
54
|
-
const shared = {
|
|
55
|
-
type: "send_email",
|
|
56
|
-
allowed_sender_addresses,
|
|
57
|
-
remote
|
|
58
|
-
};
|
|
59
|
-
if (destination_address !== void 0) {
|
|
60
|
-
output[name] = { ...shared, destination_address };
|
|
61
|
-
} else if (allowed_destination_addresses !== void 0) {
|
|
62
|
-
output[name] = { ...shared, allowed_destination_addresses };
|
|
63
|
-
} else {
|
|
64
|
-
output[name] = shared;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
case "wasm_modules": {
|
|
70
|
-
if (pages) {
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
for (const [key, value] of Object.entries(info)) {
|
|
74
|
-
if (typeof value === "string") {
|
|
75
|
-
output[key] = { type: "wasm_module", source: { path: value } };
|
|
76
|
-
} else {
|
|
77
|
-
output[key] = { type: "wasm_module", source: { contents: value } };
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
case "text_blobs": {
|
|
83
|
-
if (pages) {
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
for (const [key, value] of Object.entries(info)) {
|
|
87
|
-
output[key] = { type: "text_blob", source: { path: value } };
|
|
88
|
-
}
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
case "data_blobs": {
|
|
92
|
-
if (pages) {
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
for (const [key, value] of Object.entries(info)) {
|
|
96
|
-
if (typeof value === "string") {
|
|
97
|
-
output[key] = { type: "data_blob", source: { path: value } };
|
|
98
|
-
} else {
|
|
99
|
-
output[key] = { type: "data_blob", source: { contents: value } };
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
case "browser": {
|
|
105
|
-
const { binding, ...x } = info;
|
|
106
|
-
output[binding] = { type: "browser", ...x };
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
case "durable_objects": {
|
|
110
|
-
for (const { name, ...x } of info.bindings ?? []) {
|
|
111
|
-
output[name] = { type: "durable_object_namespace", ...x };
|
|
112
|
-
}
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case "workflows": {
|
|
116
|
-
for (const { binding, ...x } of info) {
|
|
117
|
-
output[binding] = { type: "workflow", ...x };
|
|
118
|
-
}
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
case "queues": {
|
|
122
|
-
for (const { binding, ...x } of info.producers ?? []) {
|
|
123
|
-
output[binding] = {
|
|
124
|
-
type: "queue",
|
|
125
|
-
queue_name: x.queue,
|
|
126
|
-
...x
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
case "r2_buckets": {
|
|
132
|
-
for (const { binding, ...x } of info) {
|
|
133
|
-
output[binding] = {
|
|
134
|
-
type: "r2_bucket",
|
|
135
|
-
...x,
|
|
136
|
-
bucket_name: usePreviewIds ? x.preview_bucket_name ?? x.bucket_name : x.bucket_name
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
case "d1_databases": {
|
|
142
|
-
for (const { binding, ...x } of info) {
|
|
143
|
-
output[binding] = {
|
|
144
|
-
type: "d1",
|
|
145
|
-
...x,
|
|
146
|
-
database_id: usePreviewIds ? x.preview_database_id ?? x.database_id : x.database_id
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
case "services": {
|
|
152
|
-
for (const { binding, ...x } of info) {
|
|
153
|
-
output[binding] = { type: "service", ...x };
|
|
154
|
-
}
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
case "analytics_engine_datasets": {
|
|
158
|
-
for (const { binding, ...x } of info) {
|
|
159
|
-
output[binding] = { type: "analytics_engine", ...x };
|
|
160
|
-
}
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
case "dispatch_namespaces": {
|
|
164
|
-
if (pages) {
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
for (const { binding, ...x } of info) {
|
|
168
|
-
output[binding] = { type: "dispatch_namespace", ...x };
|
|
169
|
-
}
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
case "mtls_certificates": {
|
|
173
|
-
for (const { binding, ...x } of info) {
|
|
174
|
-
output[binding] = { type: "mtls_certificate", ...x };
|
|
175
|
-
}
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
case "logfwdr": {
|
|
179
|
-
if (pages) {
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
for (const { name, ...x } of info.bindings ?? []) {
|
|
183
|
-
output[name] = { type: "logfwdr", ...x };
|
|
184
|
-
}
|
|
185
|
-
break;
|
|
186
|
-
}
|
|
187
|
-
case "ai": {
|
|
188
|
-
const { binding, ...x } = info;
|
|
189
|
-
output[binding] = { type: "ai", ...x };
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
case "images": {
|
|
193
|
-
const { binding, ...x } = info;
|
|
194
|
-
output[binding] = { type: "images", ...x };
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
case "stream": {
|
|
198
|
-
const { binding, ...x } = info;
|
|
199
|
-
output[binding] = { type: "stream", ...x };
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
case "version_metadata": {
|
|
203
|
-
const { binding, ...x } = info;
|
|
204
|
-
output[binding] = { type: "version_metadata", ...x };
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
case "hyperdrive": {
|
|
208
|
-
for (const { binding, ...x } of info) {
|
|
209
|
-
output[binding] = { type: "hyperdrive", ...x };
|
|
210
|
-
}
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
case "vectorize": {
|
|
214
|
-
for (const { binding, ...x } of info) {
|
|
215
|
-
output[binding] = { type: "vectorize", ...x };
|
|
216
|
-
}
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
case "ai_search_namespaces": {
|
|
220
|
-
for (const { binding, ...x } of info) {
|
|
221
|
-
output[binding] = { type: "ai_search_namespace", ...x };
|
|
222
|
-
}
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
case "ai_search": {
|
|
226
|
-
for (const { binding, ...x } of info) {
|
|
227
|
-
output[binding] = { type: "ai_search", ...x };
|
|
228
|
-
}
|
|
229
|
-
break;
|
|
230
|
-
}
|
|
231
|
-
case "websearch": {
|
|
232
|
-
const { binding, ...x } = info;
|
|
233
|
-
output[binding] = { type: "websearch", ...x };
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
case "agent_memory": {
|
|
237
|
-
for (const { binding, ...x } of info) {
|
|
238
|
-
output[binding] = { type: "agent_memory", ...x };
|
|
239
|
-
}
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
case "unsafe": {
|
|
243
|
-
if (pages) {
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
for (const { type: unsafeType, name, ...data } of info.bindings ?? []) {
|
|
247
|
-
output[name] = { type: `unsafe_${unsafeType}`, ...data };
|
|
248
|
-
}
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
case "assets": {
|
|
252
|
-
if (pages) {
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
if (info.binding) {
|
|
256
|
-
output[info.binding] = { type: "assets" };
|
|
257
|
-
}
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
case "pipelines": {
|
|
261
|
-
if (pages) {
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
for (const { binding, ...x } of info) {
|
|
265
|
-
output[binding] = { type: "pipeline", ...x };
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
268
|
-
}
|
|
269
|
-
case "secrets_store_secrets": {
|
|
270
|
-
for (const { binding, ...x } of info) {
|
|
271
|
-
output[binding] = { type: "secrets_store_secret", ...x };
|
|
272
|
-
}
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
case "artifacts": {
|
|
276
|
-
for (const { binding, ...x } of info) {
|
|
277
|
-
output[binding] = { type: "artifacts", ...x };
|
|
278
|
-
}
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
case "unsafe_hello_world": {
|
|
282
|
-
if (pages) {
|
|
283
|
-
break;
|
|
284
|
-
}
|
|
285
|
-
for (const { binding, ...x } of info) {
|
|
286
|
-
output[binding] = { type: "unsafe_hello_world", ...x };
|
|
287
|
-
}
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
case "flagship": {
|
|
291
|
-
for (const { binding, ...x } of info) {
|
|
292
|
-
output[binding] = { type: "flagship", ...x };
|
|
293
|
-
}
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
case "ratelimits": {
|
|
297
|
-
for (const { name, ...x } of info) {
|
|
298
|
-
output[name] = { type: "ratelimit", ...x };
|
|
299
|
-
}
|
|
300
|
-
break;
|
|
301
|
-
}
|
|
302
|
-
case "worker_loaders": {
|
|
303
|
-
for (const { binding, ...x } of info) {
|
|
304
|
-
output[binding] = { type: "worker_loader", ...x };
|
|
305
|
-
}
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
case "vpc_services": {
|
|
309
|
-
for (const { binding, ...x } of info) {
|
|
310
|
-
output[binding] = { type: "vpc_service", ...x };
|
|
311
|
-
}
|
|
312
|
-
break;
|
|
313
|
-
}
|
|
314
|
-
case "vpc_networks": {
|
|
315
|
-
for (const { binding, ...x } of info) {
|
|
316
|
-
output[binding] = { type: "vpc_network", ...x };
|
|
317
|
-
}
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
case "media": {
|
|
321
|
-
const { binding, ...x } = info;
|
|
322
|
-
output[binding] = { type: "media", ...x };
|
|
323
|
-
break;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return output;
|
|
328
|
-
}
|
|
329
|
-
__name(convertConfigToBindings, "convertConfigToBindings");
|
|
330
|
-
function isUnsafeBindingType(type) {
|
|
331
|
-
return type.startsWith("unsafe_");
|
|
332
|
-
}
|
|
333
|
-
__name(isUnsafeBindingType, "isUnsafeBindingType");
|
|
334
|
-
var nameBindings = [
|
|
335
|
-
"durable_object_namespace",
|
|
336
|
-
"logfwdr",
|
|
337
|
-
"ratelimit",
|
|
338
|
-
"unsafe_ratelimit",
|
|
339
|
-
"send_email"
|
|
340
|
-
];
|
|
341
|
-
function getBindingKey(type) {
|
|
342
|
-
if (nameBindings.includes(type)) {
|
|
343
|
-
return "name";
|
|
344
|
-
}
|
|
345
|
-
return "binding";
|
|
346
|
-
}
|
|
347
|
-
__name(getBindingKey, "getBindingKey");
|
|
348
|
-
function extractBindingsOfType(type, bindings) {
|
|
349
|
-
return Object.entries(bindings ?? {}).filter(
|
|
350
|
-
(binding) => binding[1].type === type
|
|
351
|
-
).map((binding) => ({
|
|
352
|
-
...binding[1],
|
|
353
|
-
[getBindingKey(type)]: binding[0]
|
|
354
|
-
}));
|
|
355
|
-
}
|
|
356
|
-
__name(extractBindingsOfType, "extractBindingsOfType");
|
|
357
|
-
function getBindings(config, options) {
|
|
358
|
-
if (!config) {
|
|
359
|
-
return {};
|
|
360
|
-
}
|
|
361
|
-
return convertConfigToBindings(config, {
|
|
362
|
-
usePreviewIds: false,
|
|
363
|
-
pages: options?.pages
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
__name(getBindings, "getBindings");
|
|
367
10
|
function handleUnsafeCapnp(capnp) {
|
|
368
11
|
if (capnp.compiled_schema) {
|
|
369
12
|
return readFileSync(resolve(capnp.compiled_schema));
|
|
@@ -1172,4 +815,4 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
1172
815
|
}
|
|
1173
816
|
__name(createWorkerUploadForm, "createWorkerUploadForm");
|
|
1174
817
|
|
|
1175
|
-
export {
|
|
818
|
+
export { createWorkerUploadForm, fromMimeType, handleUnsafeCapnp, moduleTypeMimeType };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './chunk-
|
|
1
|
+
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './chunk-PXVCTRCA.mjs';
|
|
2
2
|
import './chunk-Q72B4Q5Z.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { S as SharedDeployVersionsProps, D as DeployProps, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment } from './context-nFHuelHB.mjs';
|
|
2
2
|
export { b as DeployHelpersContext, i as initDeployHelpersContext } from './context-nFHuelHB.mjs';
|
|
3
3
|
import * as _cloudflare_workers_utils from '@cloudflare/workers-utils';
|
|
4
|
-
import { Config, AssetsOptions, ComplianceConfig, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding as Binding$1, RawConfig,
|
|
4
|
+
import { CfModule, Config, AssetsOptions, ComplianceConfig, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding as Binding$1, RawConfig, CfCapnp, CfScriptFormat, ParseError, WorkerMetadataBinding, CfUserLimits, TailConsumer, StreamingTailConsumer, Observability, CfWorkerInit, ExportsReconciliationErrorDetail, ExportsReconciliationResult, StartDevWorkerInput, CacheOptions, PreviewsConfig } from '@cloudflare/workers-utils';
|
|
5
5
|
import { ContainerNormalizedConfig, ImageURIConfig } from '@cloudflare/containers-shared';
|
|
6
6
|
import { FormData } from 'undici';
|
|
7
7
|
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './create-worker-upload-form.mjs';
|
|
8
8
|
import { Options } from '@cspotcode/source-map-support';
|
|
9
9
|
import Protocol from 'devtools-protocol';
|
|
10
|
-
import { NodeJSCompatMode
|
|
10
|
+
import { NodeJSCompatMode } from 'miniflare';
|
|
11
|
+
|
|
12
|
+
interface BundleSize {
|
|
13
|
+
size: number;
|
|
14
|
+
gzipSize: number;
|
|
15
|
+
}
|
|
16
|
+
declare function getSize(modules: Pick<CfModule, "content">[]): Promise<BundleSize>;
|
|
17
|
+
declare function printBundleSize({ size, gzipSize }: BundleSize): void;
|
|
11
18
|
|
|
12
19
|
type AssetManifest = {
|
|
13
20
|
[path: string]: {
|
|
@@ -60,6 +67,7 @@ type DeployResult = {
|
|
|
60
67
|
workerTag: string | null;
|
|
61
68
|
assetUploadStats?: AssetUploadStats;
|
|
62
69
|
targets?: string[];
|
|
70
|
+
bundleSize?: BundleSize;
|
|
63
71
|
};
|
|
64
72
|
declare function deploy(props: DeployProps, config: Config, buildResult: WorkerBuildResult, callbacks: DeployCallbacks): Promise<DeployResult>;
|
|
65
73
|
|
|
@@ -70,6 +78,7 @@ type VersionsUploadResult = {
|
|
|
70
78
|
assetUploadStats?: AssetUploadStats;
|
|
71
79
|
versionPreviewUrl?: string | undefined;
|
|
72
80
|
versionPreviewAliasUrl?: string | undefined;
|
|
81
|
+
bundleSize?: BundleSize;
|
|
73
82
|
};
|
|
74
83
|
declare function versionsUpload(props: VersionsUploadProps, config: Config, buildResult: WorkerBuildResult, callbacks: VersionsUploadCallbacks): Promise<VersionsUploadResult>;
|
|
75
84
|
|
|
@@ -419,41 +428,6 @@ declare function parseBulkInputToObject(input?: string, includeNull?: false): Pr
|
|
|
419
428
|
/** Override for callers that need nullable */
|
|
420
429
|
declare function parseBulkInputToObject(input?: string, includeNull?: true): Promise<BulkInputNullableResult | undefined>;
|
|
421
430
|
|
|
422
|
-
interface ConvertBindingsOptions {
|
|
423
|
-
/**
|
|
424
|
-
* Use preview IDs (preview_id, preview_bucket_name, preview_database_id) instead of production IDs when resolving a binding ID.
|
|
425
|
-
* This means that the rest of Wrangler does not need to be aware of preview IDs, and can just use regular IDs.
|
|
426
|
-
*/
|
|
427
|
-
usePreviewIds?: boolean;
|
|
428
|
-
/**
|
|
429
|
-
* Exclude bindings that Pages doesn't support
|
|
430
|
-
*/
|
|
431
|
-
pages?: boolean;
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Convert Config to the Record<string, Binding> format for consistent internal use.
|
|
435
|
-
*/
|
|
436
|
-
declare function convertConfigToBindings(config: Partial<Pick<Config, ConfigBindingFieldName>>, options?: ConvertBindingsOptions): Record<string, Binding$1>;
|
|
437
|
-
declare function isUnsafeBindingType(type: string): type is `unsafe_${string}`;
|
|
438
|
-
/**
|
|
439
|
-
* What configuration key does this binding use for referring to it's binding name?
|
|
440
|
-
*/
|
|
441
|
-
declare const nameBindings: readonly ["durable_object_namespace", "logfwdr", "ratelimit", "unsafe_ratelimit", "send_email"];
|
|
442
|
-
type FlatBinding<Type> = Extract<Binding$1, {
|
|
443
|
-
type: Type;
|
|
444
|
-
}> & (Type extends (typeof nameBindings)[number] ? {
|
|
445
|
-
name: string;
|
|
446
|
-
} : {
|
|
447
|
-
binding: string;
|
|
448
|
-
});
|
|
449
|
-
declare function extractBindingsOfType<Type extends Binding$1["type"]>(type: Type, bindings: Record<string, Binding$1> | undefined): FlatBinding<Type>[];
|
|
450
|
-
/**
|
|
451
|
-
* Get bindings from a Config object in the standard Record<string, Binding> format.
|
|
452
|
-
*/
|
|
453
|
-
declare function getBindings(config: Config | undefined, options?: {
|
|
454
|
-
pages?: boolean;
|
|
455
|
-
}): Record<string, Binding$1>;
|
|
456
|
-
|
|
457
431
|
declare function handleUnsafeCapnp(capnp: CfCapnp): Buffer;
|
|
458
432
|
|
|
459
433
|
/**
|
|
@@ -494,11 +468,6 @@ declare function maybeRetrieveFileSourceMap(filePath?: string): ReturnType<Retri
|
|
|
494
468
|
declare function getSourceMappedStack(details: Protocol.Runtime.ExceptionDetails): string;
|
|
495
469
|
declare function getSourceMappedString(value: string, retrieveSourceMap?: RetrieveSourceMapFunction): string;
|
|
496
470
|
|
|
497
|
-
declare function printBundleSize(main: {
|
|
498
|
-
name: string;
|
|
499
|
-
content: string;
|
|
500
|
-
}, modules: CfModule[]): Promise<void>;
|
|
501
|
-
|
|
502
471
|
/**
|
|
503
472
|
* Computes and validates the Node.js compatibility mode we are running.
|
|
504
473
|
*
|
|
@@ -792,30 +761,6 @@ declare function checkRemoteSecretsOverride(config: Config, scriptName: string,
|
|
|
792
761
|
declare function confirmLatestDeploymentOverwrite(config: Config, accountId: string, scriptName: string): Promise<boolean>;
|
|
793
762
|
declare function printVersions(versions: ApiVersion[], traffic: Map<VersionId, Percentage>): void;
|
|
794
763
|
|
|
795
|
-
type PrintContext = {
|
|
796
|
-
log?: (message: string) => void;
|
|
797
|
-
registry?: WorkerRegistry | null;
|
|
798
|
-
local?: boolean;
|
|
799
|
-
isMultiWorker?: boolean;
|
|
800
|
-
remoteBindingsDisabled?: boolean;
|
|
801
|
-
name?: string;
|
|
802
|
-
provisioning?: boolean;
|
|
803
|
-
warnIfNoBindings?: boolean;
|
|
804
|
-
unsafeMetadata?: Record<string, unknown>;
|
|
805
|
-
};
|
|
806
|
-
/**
|
|
807
|
-
* Print all the bindings a worker would have access to.
|
|
808
|
-
* Accepts StartDevWorkerInput["bindings"] format
|
|
809
|
-
*/
|
|
810
|
-
declare function printBindings(bindings: StartDevWorkerInput["bindings"], tailConsumers?: CfTailConsumer[], streamingTailConsumers?: CfTailConsumer[], containers?: ContainerApp[], context?: PrintContext): void;
|
|
811
|
-
/**
|
|
812
|
-
* Validates the user's `remote` setting for a given binding against the
|
|
813
|
-
* binding type's local-development capabilities (sourced from
|
|
814
|
-
* {@link getBindingLocalSupport}). Throws `UserError` for invalid combinations
|
|
815
|
-
* and emits warnings for valid-but-noteworthy ones.
|
|
816
|
-
*/
|
|
817
|
-
declare function warnOrError(type: Binding$1["type"], remote: boolean | undefined): void;
|
|
818
|
-
|
|
819
764
|
declare const hashFile: (filepath: string) => string;
|
|
820
765
|
|
|
821
766
|
declare const decodeJwtPayload: (token: string) => any;
|
|
@@ -1246,4 +1191,4 @@ type DrawConnectedChildBoxOptions = {
|
|
|
1246
1191
|
*/
|
|
1247
1192
|
declare function drawConnectedChildBox(contentLines: string[], options?: DrawConnectedChildBoxOptions): string;
|
|
1248
1193
|
|
|
1249
|
-
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, type BulkInputNullableResult, type BulkInputResult, type Consumer, type ConsumerSettings, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, type NonVersionedScriptSettings, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewCallbacks, type PreviewDefaults, type PreviewDefaultsPatch, type PreviewDeleteArgs, type PreviewDeploymentModule, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type PreviewSettingsArgs, type PreviewSettingsUpdateArgs, type Producer, type PullRequestMetadata, type PurgeQueueBody, type PurgeQueueResponse, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, type VersionsUploadCallbacks, VersionsUploadProps, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, WorkerBuildResult, type Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewDefaults, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite,
|
|
1194
|
+
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, type BulkInputNullableResult, type BulkInputResult, type BundleSize, type Consumer, type ConsumerSettings, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, type NonVersionedScriptSettings, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewCallbacks, type PreviewDefaults, type PreviewDefaultsPatch, type PreviewDeleteArgs, type PreviewDeploymentModule, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type PreviewSettingsArgs, type PreviewSettingsUpdateArgs, type Producer, type PullRequestMetadata, type PurgeQueueBody, type PurgeQueueResponse, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, type VersionsUploadCallbacks, VersionsUploadProps, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, WorkerBuildResult, type Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewDefaults, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, editWorkerPreviewDefaults, ensureQueuesExistByConfig, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatPreviewsSettings, generatePreviewAlias, getBindingValue, getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getWorkerPreviewDefaults, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, handleUnsafeCapnp, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, mergeDeep, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, preview, previewContainerAppName, previewDelete, previewSettingsGet, previewSettingsUpdate, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|