devflare 1.0.0-next.50 → 1.0.0-next.52
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/README.md +3 -0
- package/dist/_chunks/{account-BI3WZMDy.js → account-Csog80ie.js} +1 -1
- package/dist/_chunks/{build-e0KR38-4.js → build-Ccza8VQz.js} +1 -1
- package/dist/_chunks/{build-artifacts-DU5V0J0Z.js → build-artifacts-BNssqhxE.js} +3 -3
- package/dist/_chunks/{cli-DuUz10Mn.js → cli-CqIDn-Hy.js} +22 -14
- package/dist/_chunks/{command-utils-DA0Qx9_K.js → command-utils-_bGRraDR.js} +1 -1
- package/dist/_chunks/{compiler-Zw16C9Pi.js → compiler-BtLp9T9N.js} +19 -8
- package/dist/_chunks/{config-Brju62xy.js → config-QU8UEWmA.js} +2 -2
- package/dist/_chunks/{config-path-DaL1ylZ_.js → config-path-1yI7BiDU.js} +1 -1
- package/dist/_chunks/{deploy-B-Kku1Vk.js → deploy-aifBaMVv.js} +5 -5
- package/dist/_chunks/{dev-D4e_RRZn.js → dev-DF_3baGr.js} +21 -9
- package/dist/_chunks/{doctor-jm_K4dxL.js → doctor-tR9kGT_Z.js} +2 -2
- package/dist/_chunks/{family-_9-mGSfO.js → family-DKPp4wqj.js} +1 -1
- package/dist/_chunks/{loader-Cr0_OWPy.js → loader-OQ2AWpqm.js} +23 -3
- package/dist/_chunks/{local-secrets-DMPkmOn3.js → local-secrets-CYoHfvQ1.js} +1 -1
- package/dist/_chunks/{local-workflow-entrypoints-Cq_WJajd.js → local-workflow-entrypoints-8d_mXh8T.js} +1 -1
- package/dist/_chunks/{login-FjTAAQbi.js → login-rVWUZOKC.js} +1 -1
- package/dist/_chunks/{preview-resources-CGMBjsYB.js → preview-resources-DRWR0gaB.js} +2 -2
- package/dist/_chunks/{previews-C7hs9-BT.js → previews-BxNq8Y_J.js} +6 -6
- package/dist/_chunks/{productions-T9Als4fE.js → productions-DXQ045cq.js} +98 -5
- package/dist/_chunks/{routes-BFYCqHb-.js → routes-B6XiI8Sa.js} +23 -5
- package/dist/_chunks/{schema-normalization-BCwTLTGp.js → schema-normalization-GjhTATHL.js} +11 -5
- package/dist/_chunks/{secrets-DIpJGe6C.js → secrets-qT1JaBGt.js} +1 -1
- package/dist/_chunks/{tail-IY-ijYmv.js → tail-CuWI04BL.js} +2 -2
- package/dist/_chunks/{types-DoKsMYfm.js → types-BquPXsFg.js} +3 -3
- package/dist/_chunks/{vite-CGtVNf5E.js → vite-D_wLDGBs.js} +4 -4
- package/dist/_chunks/{worker-BEZI4od1.js → worker-DEF-e8LL.js} +4 -4
- package/dist/bridge/miniflare.d.ts +3 -0
- package/dist/bridge/miniflare.d.ts.map +1 -1
- package/dist/browser.d.ts +294 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/cli/commands/productions.d.ts.map +1 -1
- package/dist/cli/help-pages/pages/productions.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config/compiler/bindings.d.ts.map +1 -1
- package/dist/config/compiler/types.d.ts +11 -0
- package/dist/config/compiler/types.d.ts.map +1 -1
- package/dist/config/compiler.d.ts.map +1 -1
- package/dist/config/schema-bindings.d.ts +62 -0
- package/dist/config/schema-bindings.d.ts.map +1 -1
- package/dist/config/schema-env.d.ts +192 -0
- package/dist/config/schema-env.d.ts.map +1 -1
- package/dist/config/schema-normalization.d.ts +2 -0
- package/dist/config/schema-normalization.d.ts.map +1 -1
- package/dist/config/schema-runtime.d.ts +49 -0
- package/dist/config/schema-runtime.d.ts.map +1 -1
- package/dist/config/schema-types-bindings-platform.d.ts +12 -0
- package/dist/config/schema-types-bindings-platform.d.ts.map +1 -1
- package/dist/config/schema-types-bindings-resources.d.ts +35 -0
- package/dist/config/schema-types-bindings-resources.d.ts.map +1 -1
- package/dist/config/schema-types-runtime-server.d.ts +122 -0
- package/dist/config/schema-types-runtime-server.d.ts.map +1 -0
- package/dist/config/schema-types-runtime.d.ts +28 -32
- package/dist/config/schema-types-runtime.d.ts.map +1 -1
- package/dist/config/schema-types.d.ts +35 -1
- package/dist/config/schema-types.d.ts.map +1 -1
- package/dist/config/schema.d.ts +367 -2
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/dev-server/miniflare-bindings.d.ts +9 -0
- package/dist/dev-server/miniflare-bindings.d.ts.map +1 -1
- package/dist/dev-server/miniflare-dev-config.d.ts.map +1 -1
- package/dist/dev-server/miniflare-worker-config.d.ts +12 -1
- package/dist/dev-server/miniflare-worker-config.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/sveltekit/index.js +3 -3
- package/dist/test/index.js +18 -8
- package/dist/test/simple-context-mfconfig.d.ts.map +1 -1
- package/dist/test/simple-context-startup.d.ts.map +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { r as loadConfig, t as ConfigNotFoundError } from "./loader-
|
|
1
|
+
import { r as loadConfig, t as ConfigNotFoundError } from "./loader-OQ2AWpqm.js";
|
|
2
2
|
import { t as account } from "./cloudflare-BaloqI3H.js";
|
|
3
3
|
import { a as cyanBold, d as green, f as logLine, g as yellow, h as whiteDim, l as formatLabelValue, m as red, n as bold, o as dim, p as logTable, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
4
4
|
import { i as findFiles } from "./glob-CmQOvunB.js";
|
|
5
|
-
import { i as resolveNamedSelection, r as resolveCloudflareAccountId, t as asOptionalString } from "./command-utils-
|
|
5
|
+
import { i as resolveNamedSelection, r as resolveCloudflareAccountId, t as asOptionalString } from "./command-utils-_bGRraDR.js";
|
|
6
6
|
import { t as getDependencies } from "./dependencies-C2oxFjU_.js";
|
|
7
|
-
import { i as collectConfiguredWorkerFamilies } from "./family-
|
|
7
|
+
import { i as collectConfiguredWorkerFamilies } from "./family-DKPp4wqj.js";
|
|
8
8
|
//#region src/cli/commands/productions.ts
|
|
9
9
|
const CLI_API_OPTIONS = { timeout: 1e4 };
|
|
10
10
|
const PRODUCTION_SUBCOMMANDS = [
|
|
11
11
|
"list",
|
|
12
12
|
"versions",
|
|
13
|
+
"deployments",
|
|
13
14
|
"rollback",
|
|
14
15
|
"delete"
|
|
15
16
|
];
|
|
@@ -23,6 +24,10 @@ function shortenVersionId(versionId, length = 12) {
|
|
|
23
24
|
function selectDeploymentVersionId(deployment) {
|
|
24
25
|
return deployment.versions.find((version) => version.percentage === 100)?.versionId ?? deployment.versions[0]?.versionId;
|
|
25
26
|
}
|
|
27
|
+
function formatDeploymentSplit(deployment) {
|
|
28
|
+
if (deployment.versions.length === 0) return "N/A";
|
|
29
|
+
return deployment.versions.map((version) => `${version.percentage}% → ${shortenVersionId(version.versionId, 8)}`).join(", ");
|
|
30
|
+
}
|
|
26
31
|
function getWorkerVersionTimestamp(version) {
|
|
27
32
|
return version.metadata.modifiedOn ?? version.metadata.createdOn;
|
|
28
33
|
}
|
|
@@ -282,7 +287,7 @@ function showProductionOverview(logger, context, rows, theme) {
|
|
|
282
287
|
titleAccent: "green"
|
|
283
288
|
});
|
|
284
289
|
logLine(logger);
|
|
285
|
-
logLine(logger, dim("Use `devflare productions versions` for recent production versions, or `rollback` / `delete` to mutate one Worker.", theme));
|
|
290
|
+
logLine(logger, dim("Use `devflare productions versions` for recent production versions, `deployments` for the full deployment history, or `rollback` / `delete` to mutate one Worker.", theme));
|
|
286
291
|
logLine(logger);
|
|
287
292
|
}
|
|
288
293
|
function showWorkerVersions(logger, overviews, theme) {
|
|
@@ -309,6 +314,82 @@ function showWorkerVersions(logger, overviews, theme) {
|
|
|
309
314
|
}
|
|
310
315
|
logLine(logger);
|
|
311
316
|
}
|
|
317
|
+
function buildDeploymentColumns(theme) {
|
|
318
|
+
return [
|
|
319
|
+
{
|
|
320
|
+
label: "Deployed",
|
|
321
|
+
width: 19,
|
|
322
|
+
value: (row) => whiteDim(formatRecordDate(row.createdOn), theme)
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
label: "Deployment",
|
|
326
|
+
width: 12,
|
|
327
|
+
value: (row) => shortenVersionId(row.deploymentId, 11)
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
label: "Strategy",
|
|
331
|
+
width: 12,
|
|
332
|
+
value: (row) => row.strategy || dim("N/A", theme)
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
label: "Traffic split",
|
|
336
|
+
width: 28,
|
|
337
|
+
value: (row) => row.split
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
label: "Source",
|
|
341
|
+
width: 12,
|
|
342
|
+
value: (row) => row.source || dim("N/A", theme)
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
label: "Triggered by",
|
|
346
|
+
width: 18,
|
|
347
|
+
value: (row) => row.triggeredBy ? whiteDim(row.triggeredBy, theme) : dim("N/A", theme)
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
label: "Message",
|
|
351
|
+
value: (row) => row.message ? row.message : dim("N/A", theme)
|
|
352
|
+
}
|
|
353
|
+
];
|
|
354
|
+
}
|
|
355
|
+
async function loadWorkerDeploymentHistory(accountId, workerName, apiOptions) {
|
|
356
|
+
return {
|
|
357
|
+
workerName,
|
|
358
|
+
rows: [...await account.workerDeployments(accountId, workerName, apiOptions)].sort((left, right) => right.createdOn.getTime() - left.createdOn.getTime()).map((deployment) => ({
|
|
359
|
+
createdOn: deployment.createdOn,
|
|
360
|
+
deploymentId: deployment.id,
|
|
361
|
+
strategy: deployment.strategy,
|
|
362
|
+
split: formatDeploymentSplit(deployment),
|
|
363
|
+
source: deployment.source,
|
|
364
|
+
message: deployment.message,
|
|
365
|
+
triggeredBy: deployment.triggeredBy ?? deployment.authorEmail
|
|
366
|
+
}))
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
function showWorkerDeployments(logger, overviews, theme) {
|
|
370
|
+
logLine(logger);
|
|
371
|
+
if (overviews.length === 0) {
|
|
372
|
+
logLine(logger, dim("No production deployments were found for the current selection.", theme));
|
|
373
|
+
logLine(logger);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
for (const [index, overview] of overviews.entries()) {
|
|
377
|
+
if (index > 0) logLine(logger);
|
|
378
|
+
logLine(logger, `${bold("worker", theme)} ${green(overview.workerName, theme)}`);
|
|
379
|
+
if (overview.rows.length === 0) {
|
|
380
|
+
logLine(logger, dim("No production deployments were found for this Worker.", theme));
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
logTable(logger, {
|
|
384
|
+
title: "Deployments",
|
|
385
|
+
rows: overview.rows,
|
|
386
|
+
columns: buildDeploymentColumns(theme),
|
|
387
|
+
theme,
|
|
388
|
+
titleAccent: "cyan"
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
logLine(logger);
|
|
392
|
+
}
|
|
312
393
|
async function runRollback(context, parsed, options, logger, theme) {
|
|
313
394
|
if (!context.workerName) {
|
|
314
395
|
logger.error("A worker name is required for production rollback.");
|
|
@@ -357,6 +438,9 @@ async function runDelete(context, parsed, logger) {
|
|
|
357
438
|
logger.warn("Devflare deleted the Worker script only. Review any shared account resources separately before cleaning them up.");
|
|
358
439
|
return { exitCode: 0 };
|
|
359
440
|
}
|
|
441
|
+
function resolveSelectedWorkerNames(context, selectedFamilies) {
|
|
442
|
+
return Array.from(new Set(context.workerName ? [context.workerName] : selectedFamilies.map((family) => family.baseName))).sort((left, right) => left.localeCompare(right));
|
|
443
|
+
}
|
|
360
444
|
async function runProductionsCommand(parsed, logger, options) {
|
|
361
445
|
if (!await account.isAuthenticated()) {
|
|
362
446
|
logger.error("Not authenticated with Cloudflare");
|
|
@@ -381,7 +465,7 @@ async function runProductionsCommand(parsed, logger, options) {
|
|
|
381
465
|
}] : [];
|
|
382
466
|
switch (subcommand) {
|
|
383
467
|
case "versions": {
|
|
384
|
-
const workerNames =
|
|
468
|
+
const workerNames = resolveSelectedWorkerNames(context, selectedFamilies);
|
|
385
469
|
if (workerNames.length === 0) {
|
|
386
470
|
logger.error("No production Workers could be resolved. Use --worker or run inside a configured package.");
|
|
387
471
|
return { exitCode: 1 };
|
|
@@ -389,6 +473,15 @@ async function runProductionsCommand(parsed, logger, options) {
|
|
|
389
473
|
showWorkerVersions(logger, await Promise.all(workerNames.map((workerName) => loadWorkerVersionOverview(context.accountId, workerName, CLI_API_OPTIONS))), theme);
|
|
390
474
|
return { exitCode: 0 };
|
|
391
475
|
}
|
|
476
|
+
case "deployments": {
|
|
477
|
+
const workerNames = resolveSelectedWorkerNames(context, selectedFamilies);
|
|
478
|
+
if (workerNames.length === 0) {
|
|
479
|
+
logger.error("No production Workers could be resolved. Use --worker or run inside a configured package.");
|
|
480
|
+
return { exitCode: 1 };
|
|
481
|
+
}
|
|
482
|
+
showWorkerDeployments(logger, await Promise.all(workerNames.map((workerName) => loadWorkerDeploymentHistory(context.accountId, workerName, CLI_API_OPTIONS))), theme);
|
|
483
|
+
return { exitCode: 0 };
|
|
484
|
+
}
|
|
392
485
|
case "rollback": return runRollback(context, parsed, options, logger, theme);
|
|
393
486
|
case "delete": return runDelete(context, parsed, logger);
|
|
394
487
|
default:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as configSchema } from "./loader-
|
|
2
|
-
import { _ as normalizeSecretsStoreBinding, c as normalizeFlagshipBinding, f as normalizeMediaBinding, g as normalizeR2Binding, h as normalizeQueueProducer, i as normalizeArtifactsBinding, l as normalizeHyperdriveBinding, m as normalizePipelineBinding, n as getLocalKVNamespaceIdentifier, o as normalizeDOBinding, p as normalizeMtlsCertificateBinding, s as normalizeDispatchNamespaceBinding, t as getLocalD1DatabaseIdentifier, u as normalizeImagesBinding, v as normalizeStreamBinding, x as normalizeWorkflowBinding } from "./schema-normalization-
|
|
1
|
+
import { d as configSchema } from "./loader-OQ2AWpqm.js";
|
|
2
|
+
import { _ as normalizeSecretsStoreBinding, c as normalizeFlagshipBinding, f as normalizeMediaBinding, g as normalizeR2Binding, h as normalizeQueueProducer, i as normalizeArtifactsBinding, l as normalizeHyperdriveBinding, m as normalizePipelineBinding, n as getLocalKVNamespaceIdentifier, o as normalizeDOBinding, p as normalizeMtlsCertificateBinding, s as normalizeDispatchNamespaceBinding, t as getLocalD1DatabaseIdentifier, u as normalizeImagesBinding, v as normalizeStreamBinding, x as normalizeWorkflowBinding } from "./schema-normalization-GjhTATHL.js";
|
|
3
3
|
import { n as findDurableObjectClasses } from "./durable-object-DMtH0XYX.js";
|
|
4
4
|
import { r as SUPPORTED_WORKER_EXTENSIONS, t as transformWorkerEntrypoint } from "./worker-entrypoint-CQW77lG8.js";
|
|
5
5
|
import { a as findFilesSync, i as findFiles, t as DEFAULT_DO_PATTERN } from "./glob-CmQOvunB.js";
|
|
@@ -11,7 +11,13 @@ import { dirname as dirname$1, join as join$1, resolve as resolve$1 } from "path
|
|
|
11
11
|
function buildQueueProducers(bindings) {
|
|
12
12
|
if (!bindings.queues?.producers) return;
|
|
13
13
|
const producers = {};
|
|
14
|
-
for (const [bindingName, producer] of Object.entries(bindings.queues.producers))
|
|
14
|
+
for (const [bindingName, producer] of Object.entries(bindings.queues.producers)) {
|
|
15
|
+
const normalized = normalizeQueueProducer(producer);
|
|
16
|
+
producers[bindingName] = {
|
|
17
|
+
queueName: normalized.queue,
|
|
18
|
+
...normalized.deliveryDelay !== void 0 && { deliveryDelay: normalized.deliveryDelay }
|
|
19
|
+
};
|
|
20
|
+
}
|
|
15
21
|
return producers;
|
|
16
22
|
}
|
|
17
23
|
function buildQueueConsumers(bindings) {
|
|
@@ -154,7 +160,8 @@ function buildSendEmailConfig(bindings) {
|
|
|
154
160
|
name,
|
|
155
161
|
...binding.destinationAddress && { destination_address: binding.destinationAddress },
|
|
156
162
|
...binding.allowedDestinationAddresses && { allowed_destination_addresses: binding.allowedDestinationAddresses },
|
|
157
|
-
...binding.allowedSenderAddresses && { allowed_sender_addresses: binding.allowedSenderAddresses }
|
|
163
|
+
...binding.allowedSenderAddresses && { allowed_sender_addresses: binding.allowedSenderAddresses },
|
|
164
|
+
...binding.remote !== void 0 && { remote: binding.remote }
|
|
158
165
|
})) };
|
|
159
166
|
}
|
|
160
167
|
/**
|
|
@@ -173,6 +180,17 @@ function buildTailConsumersConfig(config) {
|
|
|
173
180
|
const tails = config.tailConsumers.map((consumer) => typeof consumer === "string" ? consumer : consumer.service);
|
|
174
181
|
return tails.length > 0 ? tails : void 0;
|
|
175
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Translate the top-level `streamingTailConsumers` config into Miniflare's
|
|
185
|
+
* per-worker `streamingTails` option (an array of service designators). This is
|
|
186
|
+
* the streaming twin of {@link buildTailConsumersConfig}; the same
|
|
187
|
+
* present-only-when-the-consumer-Worker-is-run-locally delivery semantics apply.
|
|
188
|
+
*/
|
|
189
|
+
function buildStreamingTailConsumersConfig(config) {
|
|
190
|
+
if (!config.streamingTailConsumers || config.streamingTailConsumers.length === 0) return;
|
|
191
|
+
const streamingTails = config.streamingTailConsumers.map((consumer) => typeof consumer === "string" ? consumer : consumer.service);
|
|
192
|
+
return streamingTails.length > 0 ? streamingTails : void 0;
|
|
193
|
+
}
|
|
176
194
|
//#endregion
|
|
177
195
|
//#region src/test/resolve-service-bindings.ts
|
|
178
196
|
function getBunRuntime() {
|
|
@@ -830,4 +848,4 @@ async function discoverRoutes(cwd, config) {
|
|
|
830
848
|
};
|
|
831
849
|
}
|
|
832
850
|
//#endregion
|
|
833
|
-
export { buildSendEmailConfig as C,
|
|
851
|
+
export { buildSendEmailConfig as C, buildVersionMetadataConfig as D, buildTailConsumersConfig as E, buildWorkerLoadersConfig as O, buildSecretsStoreConfig as S, buildStreamingTailConsumersConfig as T, buildMtlsCertificatesConfig as _, hasServiceBindings as a, buildQueueProducers as b, buildAiSearchInstancesConfig as c, buildArtifactsConfig as d, buildDispatchNamespacesConfig as f, buildMediaConfig as g, buildImagesConfig as h, hasCrossWorkerDOs as i, buildWorkflowsConfig as k, buildAiSearchNamespacesConfig as l, buildHyperdrivesConfig as m, getRouteDirectoryCandidate as n, resolveDOBindings as o, buildFlagshipConfig as p, clearBundleCache as r, resolveServiceBindings as s, discoverRoutes as t, buildAnalyticsEngineConfig as u, buildPipelinesConfig as v, buildStreamConfig as w, buildRateLimitsConfig as x, buildQueueConsumers as y };
|
|
@@ -20,7 +20,8 @@ const queueConsumerSchema = z.object({
|
|
|
20
20
|
maxRetries: z.number().optional(),
|
|
21
21
|
deadLetterQueue: z.string().optional(),
|
|
22
22
|
maxConcurrency: z.number().optional(),
|
|
23
|
-
retryDelay: z.number().optional()
|
|
23
|
+
retryDelay: z.number().optional(),
|
|
24
|
+
visibilityTimeoutMs: z.number().optional()
|
|
24
25
|
});
|
|
25
26
|
/**
|
|
26
27
|
* Queue producer binding schema.
|
|
@@ -28,7 +29,8 @@ const queueConsumerSchema = z.object({
|
|
|
28
29
|
*/
|
|
29
30
|
const queueProducerSchema = z.union([z.string(), z.object({
|
|
30
31
|
queue: z.string().min(1),
|
|
31
|
-
remote: z.boolean().optional()
|
|
32
|
+
remote: z.boolean().optional(),
|
|
33
|
+
deliveryDelay: z.number().optional()
|
|
32
34
|
}).strict()]);
|
|
33
35
|
/**
|
|
34
36
|
* Queues configuration for producers and consumers.
|
|
@@ -76,6 +78,7 @@ const serviceBindingKeys = new Set([
|
|
|
76
78
|
"environment",
|
|
77
79
|
"entrypoint",
|
|
78
80
|
"remote",
|
|
81
|
+
"props",
|
|
79
82
|
"__ref"
|
|
80
83
|
]);
|
|
81
84
|
function isServiceBindingValue(val) {
|
|
@@ -85,12 +88,13 @@ function isServiceBindingValue(val) {
|
|
|
85
88
|
if (obj.environment !== void 0 && (typeof obj.environment !== "string" || obj.environment.trim().length === 0)) return false;
|
|
86
89
|
if (obj.entrypoint !== void 0 && (typeof obj.entrypoint !== "string" || obj.entrypoint.trim().length === 0)) return false;
|
|
87
90
|
if (obj.remote !== void 0 && typeof obj.remote !== "boolean") return false;
|
|
91
|
+
if (obj.props !== void 0 && (typeof obj.props !== "object" || obj.props === null || Array.isArray(obj.props))) return false;
|
|
88
92
|
if (typeof val === "object") {
|
|
89
93
|
for (const key of Object.keys(obj)) if (!serviceBindingKeys.has(key)) return false;
|
|
90
94
|
}
|
|
91
95
|
return true;
|
|
92
96
|
}
|
|
93
|
-
const serviceBindingSchema = z.custom(isServiceBindingValue, { message: "Expected service binding object with { service: string, environment?: string, entrypoint?: string, remote?: boolean } or ref().worker" });
|
|
97
|
+
const serviceBindingSchema = z.custom(isServiceBindingValue, { message: "Expected service binding object with { service: string, environment?: string, entrypoint?: string, remote?: boolean, props?: Record<string, unknown> } or ref().worker" });
|
|
94
98
|
/**
|
|
95
99
|
* AI binding configuration.
|
|
96
100
|
* Provides access to Cloudflare Workers AI for inference.
|
|
@@ -176,7 +180,8 @@ const analyticsBindingSchema = z.object({ dataset: z.string() });
|
|
|
176
180
|
const sendEmailBindingSchema = z.object({
|
|
177
181
|
destinationAddress: z.string().optional(),
|
|
178
182
|
allowedDestinationAddresses: z.array(z.string()).optional(),
|
|
179
|
-
allowedSenderAddresses: z.array(z.string()).optional()
|
|
183
|
+
allowedSenderAddresses: z.array(z.string()).optional(),
|
|
184
|
+
remote: z.boolean().optional()
|
|
180
185
|
}).refine((binding) => {
|
|
181
186
|
return !(binding.destinationAddress && binding.allowedDestinationAddresses);
|
|
182
187
|
}, {
|
|
@@ -484,7 +489,8 @@ function normalizeQueueProducer(config) {
|
|
|
484
489
|
if (typeof config === "string") return { queue: config };
|
|
485
490
|
return {
|
|
486
491
|
queue: config.queue,
|
|
487
|
-
...config.remote !== void 0 && { remote: config.remote }
|
|
492
|
+
...config.remote !== void 0 && { remote: config.remote },
|
|
493
|
+
...config.deliveryDelay !== void 0 && { deliveryDelay: config.deliveryDelay }
|
|
488
494
|
};
|
|
489
495
|
}
|
|
490
496
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as listLocalSecrets, o as writeLocalSecret, r as deleteLocalSecret } from "./local-secrets-
|
|
1
|
+
import { i as listLocalSecrets, o as writeLocalSecret, r as deleteLocalSecret } from "./local-secrets-CYoHfvQ1.js";
|
|
2
2
|
//#region src/cli/commands/secrets.ts
|
|
3
3
|
function getStringOption(options, key) {
|
|
4
4
|
const value = options[key];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as loadConfig } from "./loader-
|
|
1
|
+
import { r as loadConfig } from "./loader-OQ2AWpqm.js";
|
|
2
2
|
import { p as getApiToken } from "./api-TzdliH-6.js";
|
|
3
3
|
import { d as green, f as logLine, g as yellow, h as whiteDim, m as red, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
4
|
-
import { r as resolveCloudflareAccountId, t as asOptionalString } from "./command-utils-
|
|
4
|
+
import { r as resolveCloudflareAccountId, t as asOptionalString } from "./command-utils-_bGRraDR.js";
|
|
5
5
|
//#region src/cli/commands/tail.ts
|
|
6
6
|
const CLOUDFLARE_API_BASE = "https://api.cloudflare.com/client/v4";
|
|
7
7
|
const TAIL_SUBPROTOCOL = "trace-v1";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as loadConfig } from "./loader-
|
|
2
|
-
import { o as normalizeDOBinding } from "./schema-normalization-
|
|
1
|
+
import { r as loadConfig } from "./loader-OQ2AWpqm.js";
|
|
2
|
+
import { o as normalizeDOBinding } from "./schema-normalization-GjhTATHL.js";
|
|
3
3
|
import { n as bold, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
4
4
|
import { n as findDurableObjectClasses } from "./durable-object-DMtH0XYX.js";
|
|
5
5
|
import { i as findFiles, n as DEFAULT_ENTRYPOINT_PATTERN, t as DEFAULT_DO_PATTERN } from "./glob-CmQOvunB.js";
|
|
6
6
|
import { n as discoverEntrypointsAsync, t as resolvePackageSpecifier } from "./resolve-package-qizBfCIm.js";
|
|
7
7
|
import { t as getDependencies } from "./dependencies-C2oxFjU_.js";
|
|
8
|
-
import { r as resolveConfigCandidatePath } from "./config-path-
|
|
8
|
+
import { r as resolveConfigCandidatePath } from "./config-path-1yI7BiDU.js";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
import { dirname, relative, resolve } from "pathe";
|
|
11
11
|
//#region src/cli/commands/type-generation/discovery.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as resolveConfigEnvVars } from "./preview-C3Cdr8an.js";
|
|
2
|
-
import { i as resolveConfigPath, o as loadResolvedConfig, r as loadConfig, s as resolveResources, u as resolveConfigForEnvironment } from "./loader-
|
|
3
|
-
import { o as normalizeDOBinding } from "./schema-normalization-
|
|
4
|
-
import { c as writeWranglerConfig, i as isolateViteBuildOutputPaths, n as compileConfig, o as rebaseWranglerConfigPaths, r as compileToProgrammaticConfig, t as compileBuildConfig } from "./compiler-
|
|
2
|
+
import { i as resolveConfigPath, o as loadResolvedConfig, r as loadConfig, s as resolveResources, u as resolveConfigForEnvironment } from "./loader-OQ2AWpqm.js";
|
|
3
|
+
import { o as normalizeDOBinding } from "./schema-normalization-GjhTATHL.js";
|
|
4
|
+
import { c as writeWranglerConfig, i as isolateViteBuildOutputPaths, n as compileConfig, o as rebaseWranglerConfigPaths, r as compileToProgrammaticConfig, t as compileBuildConfig } from "./compiler-BtLp9T9N.js";
|
|
5
5
|
import { h as resolveFetchHandler, i as assertExplicit2ArgStyle } from "./runtime-DL-Nz3k8.js";
|
|
6
|
-
import { s as resolveServiceBindings, t as discoverRoutes } from "./routes-
|
|
6
|
+
import { s as resolveServiceBindings, t as discoverRoutes } from "./routes-B6XiI8Sa.js";
|
|
7
7
|
import { n as findDurableObjectClasses } from "./durable-object-DMtH0XYX.js";
|
|
8
8
|
import { r as SUPPORTED_WORKER_EXTENSIONS } from "./worker-entrypoint-CQW77lG8.js";
|
|
9
9
|
import { i as findFiles, t as DEFAULT_DO_PATTERN } from "./glob-CmQOvunB.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as loadConfig } from "./loader-
|
|
2
|
-
import { o as normalizeDOBinding } from "./schema-normalization-
|
|
1
|
+
import { r as loadConfig } from "./loader-OQ2AWpqm.js";
|
|
2
|
+
import { o as normalizeDOBinding } from "./schema-normalization-GjhTATHL.js";
|
|
3
3
|
import { t as account } from "./cloudflare-BaloqI3H.js";
|
|
4
4
|
import { d as green, f as logLine, g as yellow, h as whiteDim, n as bold, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
5
|
-
import { r as resolveCloudflareAccountId, t as asOptionalString } from "./command-utils-
|
|
6
|
-
import { n as formatSupportedConfigFilenames, r as resolveConfigCandidatePath, t as findConfigPathsUnderDirectory } from "./config-path-
|
|
5
|
+
import { r as resolveCloudflareAccountId, t as asOptionalString } from "./command-utils-_bGRraDR.js";
|
|
6
|
+
import { n as formatSupportedConfigFilenames, r as resolveConfigCandidatePath, t as findConfigPathsUnderDirectory } from "./config-path-1yI7BiDU.js";
|
|
7
7
|
import { basename, dirname, relative, resolve } from "pathe";
|
|
8
8
|
import MagicString from "magic-string";
|
|
9
9
|
//#region src/cli/commands/worker.ts
|
|
@@ -91,6 +91,8 @@ export interface MiniflareOptions {
|
|
|
91
91
|
}>;
|
|
92
92
|
/** Tail consumer service names (cross-Worker tail delivery) */
|
|
93
93
|
tailConsumers?: string[];
|
|
94
|
+
/** Streaming tail consumer service names (cross-Worker streaming tail delivery) */
|
|
95
|
+
streamingTailConsumers?: string[];
|
|
94
96
|
/** Artifacts bindings */
|
|
95
97
|
artifacts?: Record<string, {
|
|
96
98
|
namespace: string;
|
|
@@ -105,6 +107,7 @@ export interface MiniflareOptions {
|
|
|
105
107
|
destinationAddress?: string;
|
|
106
108
|
allowedDestinationAddresses?: string[];
|
|
107
109
|
allowedSenderAddresses?: string[];
|
|
110
|
+
remote?: boolean;
|
|
108
111
|
}>;
|
|
109
112
|
/** Environment variables */
|
|
110
113
|
bindings?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"miniflare.d.ts","sourceRoot":"","sources":["../../src/bridge/miniflare.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,WAAW,CAA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