@supacloud/cli 0.64.2 → 0.64.4
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 +2 -0
- package/dist/index.js +251 -61
- package/package.json +4 -4
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -213194,6 +213194,61 @@ var Delete = _Object_2({
|
|
|
213194
213194
|
path: String3()
|
|
213195
213195
|
});
|
|
213196
213196
|
var Edit = Union3([Insert2, Update2, Delete]);
|
|
213197
|
+
// node_modules/@supacloud/delivery/src/worker-execution.ts
|
|
213198
|
+
var closed = { additionalProperties: false };
|
|
213199
|
+
var positive = (maximum) => Integer2({ minimum: 1, maximum });
|
|
213200
|
+
var WorkerExecutionGroupSchema = _Object_2({
|
|
213201
|
+
name: String3({ pattern: "^[a-z][a-z0-9-]{0,47}$" }),
|
|
213202
|
+
target: String3({ pattern: "^[a-z][a-z0-9-]{0,53}$" }),
|
|
213203
|
+
workloadClass: Union3([Literal2("interactive"), Literal2("batch")]),
|
|
213204
|
+
executor: Literal2("pgflow-queue"),
|
|
213205
|
+
runtime: Literal2("bun"),
|
|
213206
|
+
queue: String3({ pattern: "^scw_[a-z0-9_]{1,40}$" }),
|
|
213207
|
+
taskKey: String3({ pattern: "^[a-z][a-z0-9_.-]{0,99}$" }),
|
|
213208
|
+
definitionVersion: String3({ pattern: "^[1-9][0-9]{0,8}$" }),
|
|
213209
|
+
replicas: positive(16),
|
|
213210
|
+
maxReplicas: positive(16),
|
|
213211
|
+
concurrencyPerReplica: positive(32),
|
|
213212
|
+
resources: _Object_2({
|
|
213213
|
+
cpuLimit: Number3({ minimum: 0.1, maximum: 64, multipleOf: 0.1 }),
|
|
213214
|
+
memoryLimitMiB: Integer2({ minimum: 64, maximum: 262144 })
|
|
213215
|
+
}, closed),
|
|
213216
|
+
database: _Object_2({
|
|
213217
|
+
engineConnectionsPerReplica: positive(16),
|
|
213218
|
+
handlerConnectionsPerReplica: positive(16)
|
|
213219
|
+
}, closed),
|
|
213220
|
+
lifecycle: _Object_2({
|
|
213221
|
+
executionTimeoutSeconds: positive(3500),
|
|
213222
|
+
visibilityTimeoutSeconds: Integer2({ minimum: 15, maximum: 3600 }),
|
|
213223
|
+
shutdownGraceSeconds: positive(300)
|
|
213224
|
+
}, closed),
|
|
213225
|
+
retry: _Object_2({ maxAttempts: Integer2({ minimum: 1, maximum: 10 }) }, closed),
|
|
213226
|
+
admission: _Object_2({ maxOutstandingOperations: positive(1e6) }, closed)
|
|
213227
|
+
}, closed);
|
|
213228
|
+
var WorkerExecutionSchema = _Object_2({
|
|
213229
|
+
groups: _Array_(WorkerExecutionGroupSchema, { minItems: 1, maxItems: 32 })
|
|
213230
|
+
}, closed);
|
|
213231
|
+
function parseWorkerExecutionGroup(value) {
|
|
213232
|
+
if (!Check3(WorkerExecutionGroupSchema, value) || value.replicas > value.maxReplicas || !value.queue.endsWith(`_v${value.definitionVersion}`) || value.lifecycle.visibilityTimeoutSeconds < value.lifecycle.executionTimeoutSeconds + value.lifecycle.shutdownGraceSeconds + 30) {
|
|
213233
|
+
throw new Error("WORKER_EXECUTION_INVALID");
|
|
213234
|
+
}
|
|
213235
|
+
return structuredClone(value);
|
|
213236
|
+
}
|
|
213237
|
+
function validateWorkerExecution(groups) {
|
|
213238
|
+
const names = new Set, targets = new Set, queues = new Set, routes = new Set;
|
|
213239
|
+
for (const candidate of groups) {
|
|
213240
|
+
const group = parseWorkerExecutionGroup(candidate);
|
|
213241
|
+
const route = `${group.taskKey}:${group.definitionVersion}`;
|
|
213242
|
+
if (names.has(group.name) || targets.has(group.target) || queues.has(group.queue) || routes.has(route)) {
|
|
213243
|
+
throw new Error("WORKER_EXECUTION_CONFLICT");
|
|
213244
|
+
}
|
|
213245
|
+
names.add(group.name);
|
|
213246
|
+
targets.add(group.target);
|
|
213247
|
+
queues.add(group.queue);
|
|
213248
|
+
routes.add(route);
|
|
213249
|
+
}
|
|
213250
|
+
}
|
|
213251
|
+
|
|
213197
213252
|
// node_modules/@supacloud/delivery/src/delivery-schema.ts
|
|
213198
213253
|
var objectOptions = { additionalProperties: false };
|
|
213199
213254
|
var reference = String3({ minLength: 1, maxLength: 128, pattern: "^[A-Za-z][A-Za-z0-9_.:/-]*$" });
|
|
@@ -213206,6 +213261,7 @@ var DeliveryFilePathSchema = String3({
|
|
|
213206
213261
|
});
|
|
213207
213262
|
var DeliveryOptionsSchema = _Object_2({
|
|
213208
213263
|
version: Literal2(1),
|
|
213264
|
+
execution: Optional2(WorkerExecutionSchema),
|
|
213209
213265
|
targets: Optional2(_Array_(_Object_2({
|
|
213210
213266
|
name: String3({ pattern: "^[a-z][a-z0-9-]{0,62}$" }),
|
|
213211
213267
|
kind,
|
|
@@ -213278,6 +213334,7 @@ var DeliveryTargetSchema = _Object_2({
|
|
|
213278
213334
|
name: String3(),
|
|
213279
213335
|
kind,
|
|
213280
213336
|
isolation,
|
|
213337
|
+
execution: Optional2(WorkerExecutionGroupSchema),
|
|
213281
213338
|
roots: _Array_(String3()),
|
|
213282
213339
|
modules: _Array_(_Object_2({
|
|
213283
213340
|
name: String3(),
|
|
@@ -213376,7 +213433,7 @@ async function readBoundedOwned(root, path, maximum) {
|
|
|
213376
213433
|
}
|
|
213377
213434
|
|
|
213378
213435
|
// node_modules/@supacloud/delivery/src/delivery-build-schema.ts
|
|
213379
|
-
var
|
|
213436
|
+
var closed2 = { additionalProperties: false };
|
|
213380
213437
|
var digest2 = String3({ pattern: "^[a-f0-9]{64}$" });
|
|
213381
213438
|
var DeliveryObjectSchema = _Object_2({
|
|
213382
213439
|
name: String3({ pattern: "^[a-z][a-z0-9-]{0,62}$" }),
|
|
@@ -213386,15 +213443,17 @@ var DeliveryObjectSchema = _Object_2({
|
|
|
213386
213443
|
entryKind: Union3([
|
|
213387
213444
|
Literal2("compiled-module-factory"),
|
|
213388
213445
|
Literal2("bun-http-application"),
|
|
213389
|
-
Literal2("bun-worker-application")
|
|
213446
|
+
Literal2("bun-worker-application"),
|
|
213447
|
+
Literal2("go-worker-application"),
|
|
213448
|
+
Literal2("scriptc-worker-application")
|
|
213390
213449
|
]),
|
|
213391
213450
|
runtimeImports: _Array_(String3()),
|
|
213392
213451
|
files: _Array_(_Object_2({
|
|
213393
213452
|
path: DeliveryFilePathSchema,
|
|
213394
213453
|
sha256: digest2,
|
|
213395
213454
|
bytes: Integer2({ minimum: 0 })
|
|
213396
|
-
},
|
|
213397
|
-
},
|
|
213455
|
+
}, closed2), { minItems: 1 })
|
|
213456
|
+
}, closed2);
|
|
213398
213457
|
var DeliveryBuildManifestSchema = _Object_2({
|
|
213399
213458
|
schemaVersion: Literal2(1),
|
|
213400
213459
|
producer: Literal2("@supacloud/compiler/delivery-build-v1"),
|
|
@@ -213405,9 +213464,9 @@ var DeliveryBuildManifestSchema = _Object_2({
|
|
|
213405
213464
|
method: String3(),
|
|
213406
213465
|
path: String3(),
|
|
213407
213466
|
target: String3()
|
|
213408
|
-
},
|
|
213409
|
-
jobs: _Array_(_Object_2({ name: String3(), target: String3() },
|
|
213410
|
-
},
|
|
213467
|
+
}, closed2)),
|
|
213468
|
+
jobs: _Array_(_Object_2({ name: String3(), target: String3() }, closed2))
|
|
213469
|
+
}, closed2);
|
|
213411
213470
|
var resultFields = {
|
|
213412
213471
|
diagnostics: _Array_(DeliveryDiagnosticSchema),
|
|
213413
213472
|
written: _Array_(String3()),
|
|
@@ -213421,13 +213480,13 @@ var DeliveryBuildResultSchema = Union3([
|
|
|
213421
213480
|
changedTargets: _Array_(String3()),
|
|
213422
213481
|
unchangedTargets: _Array_(String3()),
|
|
213423
213482
|
removedTargets: _Array_(String3())
|
|
213424
|
-
},
|
|
213483
|
+
}, closed2),
|
|
213425
213484
|
_Object_2({
|
|
213426
213485
|
...resultFields,
|
|
213427
213486
|
written: _Array_(String3(), { maxItems: 0 }),
|
|
213428
213487
|
ok: Literal2(false),
|
|
213429
213488
|
manifest: Null2()
|
|
213430
|
-
},
|
|
213489
|
+
}, closed2)
|
|
213431
213490
|
]);
|
|
213432
213491
|
function deliveryObjectDigest(object) {
|
|
213433
213492
|
return digest(canonical({
|
|
@@ -213439,6 +213498,15 @@ function deliveryObjectDigest(object) {
|
|
|
213439
213498
|
function parseDeliveryBuildManifest(value) {
|
|
213440
213499
|
if (!Check3(DeliveryBuildManifestSchema, value))
|
|
213441
213500
|
throw new Error("Invalid delivery build manifest.");
|
|
213501
|
+
validateWorkerExecution(value.plan.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
213502
|
+
if (value.plan.targets.reduce((count, target) => count + (target.execution?.replicas ?? 1), 0) > 32) {
|
|
213503
|
+
throw new Error("Invalid delivery replica count.");
|
|
213504
|
+
}
|
|
213505
|
+
for (const target of value.plan.targets) {
|
|
213506
|
+
if (target.execution && (target.kind !== "jobs" || target.isolation !== "process" || target.execution.target !== target.name || target.jobs.length !== 1 || target.jobs[0]?.name !== target.execution.taskKey || value.objects.find((object) => object.name === target.name)?.entryKind !== "bun-worker-application")) {
|
|
213507
|
+
throw new Error("Invalid delivery execution binding.");
|
|
213508
|
+
}
|
|
213509
|
+
}
|
|
213442
213510
|
if (new Set(value.objects.map((item) => item.name)).size !== value.objects.length) {
|
|
213443
213511
|
throw new Error("Duplicate delivery object owner.");
|
|
213444
213512
|
}
|
|
@@ -213447,7 +213515,7 @@ function parseDeliveryBuildManifest(value) {
|
|
|
213447
213515
|
}
|
|
213448
213516
|
for (const object of value.objects) {
|
|
213449
213517
|
const target = value.plan.targets.find((target) => target.name === object.name);
|
|
213450
|
-
if (
|
|
213518
|
+
if (["bun-worker-application", "go-worker-application", "scriptc-worker-application"].includes(object.entryKind) && target?.kind !== "jobs" || object.entryKind === "bun-http-application" && target?.kind === "jobs") {
|
|
213451
213519
|
throw new Error("Delivery executable kind does not match its target.");
|
|
213452
213520
|
}
|
|
213453
213521
|
if (new Set(object.files.map((file) => file.path)).size !== object.files.length || !object.files.some((file) => file.path === object.entrypoint) || deliveryObjectDigest(object) !== object.objectId) {
|
|
@@ -213516,7 +213584,6 @@ async function readVerifiedDeliveryFiles(root, object, target, selectedPaths) {
|
|
|
213516
213584
|
}
|
|
213517
213585
|
return retained;
|
|
213518
213586
|
}
|
|
213519
|
-
|
|
213520
213587
|
// node_modules/@supacloud/delivery/src/application-release.ts
|
|
213521
213588
|
var ApplicationIdSchema = String3({ pattern: "^[A-Za-z0-9_-]{1,64}$" });
|
|
213522
213589
|
var ApplicationReleaseIdSchema = String3({ pattern: "^[a-f0-9]{64}$" });
|
|
@@ -213531,7 +213598,8 @@ var ApplicationReleaseRecordSchema = _Object_2({
|
|
|
213531
213598
|
name: String3({ pattern: "^[a-z][a-z0-9-]{0,62}$" }),
|
|
213532
213599
|
object_id: ApplicationReleaseIdSchema,
|
|
213533
213600
|
kind: Union3([Literal2("http"), Literal2("worker")]),
|
|
213534
|
-
entrypoint: Literal2("bundle/index.js")
|
|
213601
|
+
entrypoint: Literal2("bundle/index.js"),
|
|
213602
|
+
execution: Optional2(WorkerExecutionGroupSchema)
|
|
213535
213603
|
}, { additionalProperties: false }), { minItems: 1, maxItems: 32 })
|
|
213536
213604
|
}, { additionalProperties: false });
|
|
213537
213605
|
function applicationReleaseId(projectRef, applicationId, manifestSha256) {
|
|
@@ -213546,6 +213614,13 @@ function parseApplicationReleaseRecord(candidate) {
|
|
|
213546
213614
|
if (!Check3(ApplicationReleaseRecordSchema, candidate) || applicationReleaseId(candidate.project_ref, candidate.application_id, candidate.manifest_sha256) !== candidate.release_id || !Number.isFinite(Date.parse(candidate.created_at)) || new Date(candidate.created_at).toISOString() !== candidate.created_at || new Set(candidate.targets.map((target) => target.name)).size !== candidate.targets.length) {
|
|
213547
213615
|
throw new Error("Invalid application release record.");
|
|
213548
213616
|
}
|
|
213617
|
+
validateWorkerExecution(candidate.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
213618
|
+
if (candidate.targets.reduce((count, target) => count + (target.execution?.replicas ?? 1), 0) > 32) {
|
|
213619
|
+
throw new Error("Invalid application replica count.");
|
|
213620
|
+
}
|
|
213621
|
+
if (candidate.targets.some((target) => target.execution && (target.kind !== "worker" || target.execution.target !== target.name))) {
|
|
213622
|
+
throw new Error("Invalid application execution binding.");
|
|
213623
|
+
}
|
|
213549
213624
|
return candidate;
|
|
213550
213625
|
}
|
|
213551
213626
|
|
|
@@ -213603,7 +213678,9 @@ var APPLICATION_RESERVED_ENVIRONMENT_NAMES = new Set([
|
|
|
213603
213678
|
"SUPACLOUD_ACTIVATION_ID",
|
|
213604
213679
|
"SUPACLOUD_ENVIRONMENT_ID",
|
|
213605
213680
|
"SUPACLOUD_TARGET",
|
|
213606
|
-
"SUPACLOUD_OBJECT_ID"
|
|
213681
|
+
"SUPACLOUD_OBJECT_ID",
|
|
213682
|
+
"SUPACLOUD_WORKER_EXECUTION",
|
|
213683
|
+
"SUPACLOUD_WORKER_REPLICA"
|
|
213607
213684
|
]);
|
|
213608
213685
|
function assertTargets(targets) {
|
|
213609
213686
|
const names = new Set, usedHosts = new Set;
|
|
@@ -239852,12 +239929,77 @@ var init_value2 = __esm2(() => {
|
|
|
239852
239929
|
init_repair2();
|
|
239853
239930
|
init_shared();
|
|
239854
239931
|
});
|
|
239932
|
+
function parseWorkerExecutionGroup2(value) {
|
|
239933
|
+
if (!Check22(WorkerExecutionGroupSchema2, value) || value.replicas > value.maxReplicas || !value.queue.endsWith(`_v${value.definitionVersion}`) || value.lifecycle.visibilityTimeoutSeconds < value.lifecycle.executionTimeoutSeconds + value.lifecycle.shutdownGraceSeconds + 30) {
|
|
239934
|
+
throw new Error("WORKER_EXECUTION_INVALID");
|
|
239935
|
+
}
|
|
239936
|
+
return structuredClone(value);
|
|
239937
|
+
}
|
|
239938
|
+
function validateWorkerExecution2(groups) {
|
|
239939
|
+
const names = new Set, targets = new Set, queues = new Set, routes = new Set;
|
|
239940
|
+
for (const candidate of groups) {
|
|
239941
|
+
const group = parseWorkerExecutionGroup2(candidate);
|
|
239942
|
+
const route = `${group.taskKey}:${group.definitionVersion}`;
|
|
239943
|
+
if (names.has(group.name) || targets.has(group.target) || queues.has(group.queue) || routes.has(route)) {
|
|
239944
|
+
throw new Error("WORKER_EXECUTION_CONFLICT");
|
|
239945
|
+
}
|
|
239946
|
+
names.add(group.name);
|
|
239947
|
+
targets.add(group.target);
|
|
239948
|
+
queues.add(group.queue);
|
|
239949
|
+
routes.add(route);
|
|
239950
|
+
}
|
|
239951
|
+
}
|
|
239952
|
+
var closed3;
|
|
239953
|
+
var positive2 = (maximum) => Integer4({ minimum: 1, maximum });
|
|
239954
|
+
var WorkerExecutionGroupSchema2;
|
|
239955
|
+
var WorkerExecutionSchema2;
|
|
239956
|
+
var init_worker_execution = __esm2(() => {
|
|
239957
|
+
init_build();
|
|
239958
|
+
init_value2();
|
|
239959
|
+
closed3 = { additionalProperties: false };
|
|
239960
|
+
WorkerExecutionGroupSchema2 = _Object_3({
|
|
239961
|
+
name: String22({ pattern: "^[a-z][a-z0-9-]{0,47}$" }),
|
|
239962
|
+
target: String22({ pattern: "^[a-z][a-z0-9-]{0,53}$" }),
|
|
239963
|
+
workloadClass: Union4([Literal3("interactive"), Literal3("batch")]),
|
|
239964
|
+
executor: Literal3("pgflow-queue"),
|
|
239965
|
+
runtime: Literal3("bun"),
|
|
239966
|
+
queue: String22({ pattern: "^scw_[a-z0-9_]{1,40}$" }),
|
|
239967
|
+
taskKey: String22({ pattern: "^[a-z][a-z0-9_.-]{0,99}$" }),
|
|
239968
|
+
definitionVersion: String22({ pattern: "^[1-9][0-9]{0,8}$" }),
|
|
239969
|
+
replicas: positive2(16),
|
|
239970
|
+
maxReplicas: positive2(16),
|
|
239971
|
+
concurrencyPerReplica: positive2(32),
|
|
239972
|
+
resources: _Object_3({
|
|
239973
|
+
cpuLimit: Number22({ minimum: 0.1, maximum: 64, multipleOf: 0.1 }),
|
|
239974
|
+
memoryLimitMiB: Integer4({ minimum: 64, maximum: 262144 })
|
|
239975
|
+
}, closed3),
|
|
239976
|
+
database: _Object_3({
|
|
239977
|
+
engineConnectionsPerReplica: positive2(16),
|
|
239978
|
+
handlerConnectionsPerReplica: positive2(16)
|
|
239979
|
+
}, closed3),
|
|
239980
|
+
lifecycle: _Object_3({
|
|
239981
|
+
executionTimeoutSeconds: positive2(3500),
|
|
239982
|
+
visibilityTimeoutSeconds: Integer4({ minimum: 15, maximum: 3600 }),
|
|
239983
|
+
shutdownGraceSeconds: positive2(300)
|
|
239984
|
+
}, closed3),
|
|
239985
|
+
retry: _Object_3({ maxAttempts: Integer4({ minimum: 1, maximum: 10 }) }, closed3),
|
|
239986
|
+
admission: _Object_3({ maxOutstandingOperations: positive2(1e6) }, closed3)
|
|
239987
|
+
}, closed3);
|
|
239988
|
+
WorkerExecutionSchema2 = _Object_3({
|
|
239989
|
+
groups: _Array_2(WorkerExecutionGroupSchema2, { minItems: 1, maxItems: 32 })
|
|
239990
|
+
}, closed3);
|
|
239991
|
+
});
|
|
239855
239992
|
function parseDeliveryOptions(value) {
|
|
239856
239993
|
if (value === undefined)
|
|
239857
239994
|
return { version: 1 };
|
|
239858
239995
|
if (!Check22(DeliveryOptionsSchema2, value))
|
|
239859
239996
|
throw new DeliveryConfigurationError;
|
|
239860
239997
|
const migrations = value.build?.migrations ?? [];
|
|
239998
|
+
try {
|
|
239999
|
+
validateWorkerExecution2(value.execution?.groups ?? []);
|
|
240000
|
+
} catch {
|
|
240001
|
+
throw new DeliveryConfigurationError;
|
|
240002
|
+
}
|
|
239861
240003
|
if (new Set(migrations.map((item) => item.version)).size !== migrations.length || new Set(migrations.map((item) => item.source)).size !== migrations.length || migrations.some((item) => BigInt(item.version) > 9223372036854775807n || !/\.sql$/i.test(item.source) || item.source.split("/").includes("node_modules"))) {
|
|
239862
240004
|
throw new DeliveryConfigurationError;
|
|
239863
240005
|
}
|
|
@@ -239885,6 +240027,7 @@ var DeliveryConfigurationError;
|
|
|
239885
240027
|
var init_delivery_schema = __esm2(() => {
|
|
239886
240028
|
init_build();
|
|
239887
240029
|
init_value2();
|
|
240030
|
+
init_worker_execution();
|
|
239888
240031
|
objectOptions2 = { additionalProperties: false };
|
|
239889
240032
|
reference2 = String22({ minLength: 1, maxLength: 128, pattern: "^[A-Za-z][A-Za-z0-9_.:/-]*$" });
|
|
239890
240033
|
references2 = _Array_2(reference2, { uniqueItems: true });
|
|
@@ -239896,6 +240039,7 @@ var init_delivery_schema = __esm2(() => {
|
|
|
239896
240039
|
});
|
|
239897
240040
|
DeliveryOptionsSchema2 = _Object_3({
|
|
239898
240041
|
version: Literal3(1),
|
|
240042
|
+
execution: Optional4(WorkerExecutionSchema2),
|
|
239899
240043
|
targets: Optional4(_Array_2(_Object_3({
|
|
239900
240044
|
name: String22({ pattern: "^[a-z][a-z0-9-]{0,62}$" }),
|
|
239901
240045
|
kind: kind3,
|
|
@@ -239968,6 +240112,7 @@ var init_delivery_schema = __esm2(() => {
|
|
|
239968
240112
|
name: String22(),
|
|
239969
240113
|
kind: kind3,
|
|
239970
240114
|
isolation: isolation2,
|
|
240115
|
+
execution: Optional4(WorkerExecutionGroupSchema2),
|
|
239971
240116
|
roots: _Array_2(String22()),
|
|
239972
240117
|
modules: _Array_2(_Object_3({
|
|
239973
240118
|
name: String22(),
|
|
@@ -240175,6 +240320,12 @@ function deliveryObjectDigest2(object) {
|
|
|
240175
240320
|
function parseDeliveryBuildManifest2(value) {
|
|
240176
240321
|
if (!Check22(DeliveryBuildManifestSchema2, value))
|
|
240177
240322
|
throw new Error("Invalid delivery build manifest.");
|
|
240323
|
+
validateWorkerExecution2(value.plan.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
240324
|
+
for (const target of value.plan.targets) {
|
|
240325
|
+
if (target.execution && (target.kind !== "jobs" || target.isolation !== "process" || target.execution.target !== target.name || target.jobs.length !== 1 || target.jobs[0]?.name !== target.execution.taskKey || value.objects.find((object) => object.name === target.name)?.entryKind !== "bun-worker-application")) {
|
|
240326
|
+
throw new Error("Invalid delivery execution binding.");
|
|
240327
|
+
}
|
|
240328
|
+
}
|
|
240178
240329
|
if (new Set(value.objects.map((item) => item.name)).size !== value.objects.length) {
|
|
240179
240330
|
throw new Error("Duplicate delivery object owner.");
|
|
240180
240331
|
}
|
|
@@ -240204,7 +240355,7 @@ function parseDeliveryBuildResult(value) {
|
|
|
240204
240355
|
parseDeliveryBuildManifest2(value.manifest);
|
|
240205
240356
|
return value;
|
|
240206
240357
|
}
|
|
240207
|
-
var
|
|
240358
|
+
var closed22;
|
|
240208
240359
|
var digest22;
|
|
240209
240360
|
var DeliveryObjectSchema2;
|
|
240210
240361
|
var DeliveryBuildManifestSchema2;
|
|
@@ -240215,7 +240366,8 @@ var init_delivery_build_schema = __esm2(() => {
|
|
|
240215
240366
|
init_value2();
|
|
240216
240367
|
init_delivery_schema();
|
|
240217
240368
|
init_delivery_files();
|
|
240218
|
-
|
|
240369
|
+
init_worker_execution();
|
|
240370
|
+
closed22 = { additionalProperties: false };
|
|
240219
240371
|
digest22 = String22({ pattern: "^[a-f0-9]{64}$" });
|
|
240220
240372
|
DeliveryObjectSchema2 = _Object_3({
|
|
240221
240373
|
name: String22({ pattern: "^[a-z][a-z0-9-]{0,62}$" }),
|
|
@@ -240232,8 +240384,8 @@ var init_delivery_build_schema = __esm2(() => {
|
|
|
240232
240384
|
path: DeliveryFilePathSchema2,
|
|
240233
240385
|
sha256: digest22,
|
|
240234
240386
|
bytes: Integer4({ minimum: 0 })
|
|
240235
|
-
},
|
|
240236
|
-
},
|
|
240387
|
+
}, closed22), { minItems: 1 })
|
|
240388
|
+
}, closed22);
|
|
240237
240389
|
DeliveryBuildManifestSchema2 = _Object_3({
|
|
240238
240390
|
schemaVersion: Literal3(1),
|
|
240239
240391
|
producer: Literal3("@supacloud/compiler/delivery-build-v1"),
|
|
@@ -240244,9 +240396,9 @@ var init_delivery_build_schema = __esm2(() => {
|
|
|
240244
240396
|
method: String22(),
|
|
240245
240397
|
path: String22(),
|
|
240246
240398
|
target: String22()
|
|
240247
|
-
},
|
|
240248
|
-
jobs: _Array_2(_Object_3({ name: String22(), target: String22() },
|
|
240249
|
-
},
|
|
240399
|
+
}, closed22)),
|
|
240400
|
+
jobs: _Array_2(_Object_3({ name: String22(), target: String22() }, closed22))
|
|
240401
|
+
}, closed22);
|
|
240250
240402
|
resultFields2 = {
|
|
240251
240403
|
diagnostics: _Array_2(DeliveryDiagnosticSchema2),
|
|
240252
240404
|
written: _Array_2(String22()),
|
|
@@ -240260,13 +240412,13 @@ var init_delivery_build_schema = __esm2(() => {
|
|
|
240260
240412
|
changedTargets: _Array_2(String22()),
|
|
240261
240413
|
unchangedTargets: _Array_2(String22()),
|
|
240262
240414
|
removedTargets: _Array_2(String22())
|
|
240263
|
-
},
|
|
240415
|
+
}, closed22),
|
|
240264
240416
|
_Object_3({
|
|
240265
240417
|
...resultFields2,
|
|
240266
240418
|
written: _Array_2(String22(), { maxItems: 0 }),
|
|
240267
240419
|
ok: Literal3(false),
|
|
240268
240420
|
manifest: Null3()
|
|
240269
|
-
},
|
|
240421
|
+
}, closed22)
|
|
240270
240422
|
]);
|
|
240271
240423
|
});
|
|
240272
240424
|
function createContextPack(graph, subject) {
|
|
@@ -240621,7 +240773,7 @@ function serializedExecutionSnapshot(graph) {
|
|
|
240621
240773
|
parseExecutionSnapshot(wire);
|
|
240622
240774
|
return json;
|
|
240623
240775
|
}
|
|
240624
|
-
var
|
|
240776
|
+
var closed32;
|
|
240625
240777
|
var text2;
|
|
240626
240778
|
var kind22;
|
|
240627
240779
|
var SnapshotSchema;
|
|
@@ -240632,7 +240784,7 @@ var init_execution_snapshot = __esm2(() => {
|
|
|
240632
240784
|
init_build();
|
|
240633
240785
|
init_value2();
|
|
240634
240786
|
init_inspect();
|
|
240635
|
-
|
|
240787
|
+
closed32 = { additionalProperties: false };
|
|
240636
240788
|
text2 = String22({ minLength: 1, maxLength: 512, pattern: "^[^\\u0000-\\u001f\\u007f]+$" });
|
|
240637
240789
|
kind22 = Union4([Literal3("route"), Literal3("command"), Literal3("job")]);
|
|
240638
240790
|
SnapshotSchema = _Object_3({
|
|
@@ -240643,12 +240795,12 @@ var init_execution_snapshot = __esm2(() => {
|
|
|
240643
240795
|
name: text2,
|
|
240644
240796
|
command: Optional4(text2),
|
|
240645
240797
|
stages: _Array_2(text2)
|
|
240646
|
-
},
|
|
240647
|
-
commandAliases: _Array_2(_Object_3({ module: text2, name: text2, alias: text2 },
|
|
240798
|
+
}, closed32)),
|
|
240799
|
+
commandAliases: _Array_2(_Object_3({ module: text2, name: text2, alias: text2 }, closed32)),
|
|
240648
240800
|
contexts: _Array_2(_Object_3({
|
|
240649
240801
|
subject: text2,
|
|
240650
240802
|
aliases: _Array_2(text2),
|
|
240651
|
-
modules: _Array_2(_Object_3({ name: text2, file: Optional4(text2) },
|
|
240803
|
+
modules: _Array_2(_Object_3({ name: text2, file: Optional4(text2) }, closed32)),
|
|
240652
240804
|
files: _Array_2(text2),
|
|
240653
240805
|
diagnostics: _Array_2(_Object_3({
|
|
240654
240806
|
code: text2,
|
|
@@ -240658,10 +240810,10 @@ var init_execution_snapshot = __esm2(() => {
|
|
|
240658
240810
|
repair: Optional4(_Object_3({
|
|
240659
240811
|
type: text2,
|
|
240660
240812
|
readiness: Union4([Literal3("preview"), Literal3("input-required"), Literal3("manual")])
|
|
240661
|
-
},
|
|
240662
|
-
},
|
|
240663
|
-
},
|
|
240664
|
-
},
|
|
240813
|
+
}, closed32))
|
|
240814
|
+
}, closed32))
|
|
240815
|
+
}, closed32))
|
|
240816
|
+
}, closed32);
|
|
240665
240817
|
indices = _Array_2(Integer4({ minimum: 0 }));
|
|
240666
240818
|
WireSnapshotSchema = _Object_3({
|
|
240667
240819
|
version: Literal3(1),
|
|
@@ -240676,8 +240828,8 @@ var init_execution_snapshot = __esm2(() => {
|
|
|
240676
240828
|
modules: indices,
|
|
240677
240829
|
files: indices,
|
|
240678
240830
|
diagnostics: indices
|
|
240679
|
-
},
|
|
240680
|
-
},
|
|
240831
|
+
}, closed32))
|
|
240832
|
+
}, closed32);
|
|
240681
240833
|
});
|
|
240682
240834
|
function safeSourceFile(file) {
|
|
240683
240835
|
return !file.startsWith("/") && !file.startsWith("\\") && !/^[A-Za-z][A-Za-z0-9+.-]*:/.test(file) && !file.split(/[\\/]/).includes("..");
|
|
@@ -240713,7 +240865,7 @@ var APPLICATION_DEVELOPMENT_SCHEMA = "supacloud.application-development.v1";
|
|
|
240713
240865
|
var APPLICATION_DEVELOPMENT_ARCHIVE_MAX_BYTES = 524288;
|
|
240714
240866
|
var APPLICATION_DEVELOPMENT_LIMITS;
|
|
240715
240867
|
var DevelopmentContractError;
|
|
240716
|
-
var
|
|
240868
|
+
var closed4;
|
|
240717
240869
|
var text22;
|
|
240718
240870
|
var texts;
|
|
240719
240871
|
var count;
|
|
@@ -240746,13 +240898,13 @@ var init_application_development = __esm2(() => {
|
|
|
240746
240898
|
this.name = "DevelopmentContractError";
|
|
240747
240899
|
}
|
|
240748
240900
|
};
|
|
240749
|
-
|
|
240901
|
+
closed4 = { additionalProperties: false };
|
|
240750
240902
|
text22 = String22({ minLength: 1, maxLength: 512, pattern: "^[^\\u0000-\\u001f\\u007f]+$" });
|
|
240751
240903
|
texts = _Array_2(text22);
|
|
240752
240904
|
count = Integer4({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });
|
|
240753
240905
|
mode = Union4([Literal3("required"), Literal3("none")]);
|
|
240754
240906
|
operations2 = _Array_2(Union4([Literal3("read"), Literal3("write"), Literal3("publish"), Literal3("consume")]));
|
|
240755
|
-
resourceUse = _Object_3({ resource: text22, operations: operations2 },
|
|
240907
|
+
resourceUse = _Object_3({ resource: text22, operations: operations2 }, closed4);
|
|
240756
240908
|
schemaKind = Optional4(Union4([Literal3("opaque"), Literal3("declared")]));
|
|
240757
240909
|
stage = Union4([
|
|
240758
240910
|
Union4([Literal3("commandExecutor"), Literal3("jobExecutor"), Literal3("authorize"), Literal3("idempotency"), Literal3("transaction"), Literal3("handler"), Literal3("audit")]),
|
|
@@ -240777,7 +240929,7 @@ var init_application_development = __esm2(() => {
|
|
|
240777
240929
|
jobs: texts,
|
|
240778
240930
|
queries: texts,
|
|
240779
240931
|
resources: texts
|
|
240780
|
-
},
|
|
240932
|
+
}, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.modules }),
|
|
240781
240933
|
routes: _Array_2(_Object_3({
|
|
240782
240934
|
module: text22,
|
|
240783
240935
|
method: Union4([Literal3("GET"), Literal3("POST"), Literal3("PUT"), Literal3("PATCH"), Literal3("DELETE"), Literal3("HEAD"), Literal3("OPTIONS")]),
|
|
@@ -240793,8 +240945,8 @@ var init_application_development = __esm2(() => {
|
|
|
240793
240945
|
headers: schemaKind,
|
|
240794
240946
|
cookie: schemaKind,
|
|
240795
240947
|
response: schemaKind
|
|
240796
|
-
},
|
|
240797
|
-
},
|
|
240948
|
+
}, closed4))
|
|
240949
|
+
}, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.routes }),
|
|
240798
240950
|
commands: _Array_2(_Object_3({
|
|
240799
240951
|
module: text22,
|
|
240800
240952
|
name: text22,
|
|
@@ -240803,28 +240955,28 @@ var init_application_development = __esm2(() => {
|
|
|
240803
240955
|
idempotency: mode,
|
|
240804
240956
|
audit: Optional4(text22),
|
|
240805
240957
|
resources: _Array_2(resourceUse)
|
|
240806
|
-
},
|
|
240958
|
+
}, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.commands }),
|
|
240807
240959
|
jobs: _Array_2(_Object_3({
|
|
240808
240960
|
module: text22,
|
|
240809
240961
|
name: text22,
|
|
240810
240962
|
mode: Optional4(Union4([Literal3("task"), Literal3("workflow")])),
|
|
240811
240963
|
resources: _Array_2(resourceUse)
|
|
240812
|
-
},
|
|
240813
|
-
resources: _Array_2(_Object_3({ name: text22, kind: Union4([Literal3("database"), Literal3("bucket"), Literal3("queue"), Literal3("config"), Literal3("secret")]) },
|
|
240964
|
+
}, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.jobs }),
|
|
240965
|
+
resources: _Array_2(_Object_3({ name: text22, kind: Union4([Literal3("database"), Literal3("bucket"), Literal3("queue"), Literal3("config"), Literal3("secret")]) }, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.resources }),
|
|
240814
240966
|
resourceUses: _Array_2(_Object_3({
|
|
240815
240967
|
module: text22,
|
|
240816
240968
|
owner: text22,
|
|
240817
240969
|
ownerKind: Union4([Literal3("command"), Literal3("job")]),
|
|
240818
240970
|
resource: text22,
|
|
240819
240971
|
operations: operations2
|
|
240820
|
-
},
|
|
240972
|
+
}, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.resourceUses }),
|
|
240821
240973
|
executionPlans: _Array_2(_Object_3({
|
|
240822
240974
|
module: text22,
|
|
240823
240975
|
kind: Union4([Literal3("route"), Literal3("command"), Literal3("job")]),
|
|
240824
240976
|
name: text22,
|
|
240825
240977
|
command: Optional4(text22),
|
|
240826
240978
|
stages: _Array_2(stage)
|
|
240827
|
-
},
|
|
240979
|
+
}, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.plans }),
|
|
240828
240980
|
diagnostics: _Array_2(_Object_3({
|
|
240829
240981
|
code: text22,
|
|
240830
240982
|
severity: Union4([Literal3("error"), Literal3("warn")]),
|
|
@@ -240833,8 +240985,8 @@ var init_application_development = __esm2(() => {
|
|
|
240833
240985
|
repair: Optional4(_Object_3({
|
|
240834
240986
|
type: Union4([Literal3("set_command_mode"), Literal3("add_module_import"), Literal3("add_provider"), Literal3("mark_optional_dependency"), Literal3("change_provider_scope"), Literal3("add_command_permission"), Literal3("add_route_parameter_binding"), Literal3("remove_route_body_binding")]),
|
|
240835
240987
|
readiness: Union4([Literal3("preview"), Literal3("input-required"), Literal3("manual")])
|
|
240836
|
-
},
|
|
240837
|
-
},
|
|
240988
|
+
}, closed4))
|
|
240989
|
+
}, closed4), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.diagnostics }),
|
|
240838
240990
|
omitted: _Object_3({
|
|
240839
240991
|
modules: count,
|
|
240840
240992
|
providers: count,
|
|
@@ -240845,7 +240997,7 @@ var init_application_development = __esm2(() => {
|
|
|
240845
240997
|
resourceUses: count,
|
|
240846
240998
|
plans: count,
|
|
240847
240999
|
diagnostics: count
|
|
240848
|
-
},
|
|
241000
|
+
}, closed4),
|
|
240849
241001
|
limits: _Object_3({
|
|
240850
241002
|
outputBytes: Literal3(APPLICATION_DEVELOPMENT_LIMITS.outputBytes),
|
|
240851
241003
|
modules: Literal3(APPLICATION_DEVELOPMENT_LIMITS.modules),
|
|
@@ -240857,8 +241009,8 @@ var init_application_development = __esm2(() => {
|
|
|
240857
241009
|
resourceUses: Literal3(APPLICATION_DEVELOPMENT_LIMITS.resourceUses),
|
|
240858
241010
|
plans: Literal3(APPLICATION_DEVELOPMENT_LIMITS.plans),
|
|
240859
241011
|
diagnostics: Literal3(APPLICATION_DEVELOPMENT_LIMITS.diagnostics)
|
|
240860
|
-
},
|
|
240861
|
-
},
|
|
241012
|
+
}, closed4)
|
|
241013
|
+
}, closed4);
|
|
240862
241014
|
});
|
|
240863
241015
|
function parseApplicationDevelopmentContext(input) {
|
|
240864
241016
|
try {
|
|
@@ -241038,6 +241190,7 @@ var init_application_release = __esm2(() => {
|
|
|
241038
241190
|
init_build();
|
|
241039
241191
|
init_value2();
|
|
241040
241192
|
init_delivery_files();
|
|
241193
|
+
init_worker_execution();
|
|
241041
241194
|
ApplicationIdSchema3 = String22({ pattern: "^[A-Za-z0-9_-]{1,64}$" });
|
|
241042
241195
|
ApplicationReleaseIdSchema3 = String22({ pattern: "^[a-f0-9]{64}$" });
|
|
241043
241196
|
ApplicationReleaseRecordSchema3 = _Object_3({
|
|
@@ -241051,7 +241204,8 @@ var init_application_release = __esm2(() => {
|
|
|
241051
241204
|
name: String22({ pattern: "^[a-z][a-z0-9-]{0,62}$" }),
|
|
241052
241205
|
object_id: ApplicationReleaseIdSchema3,
|
|
241053
241206
|
kind: Union4([Literal3("http"), Literal3("worker")]),
|
|
241054
|
-
entrypoint: Literal3("bundle/index.js")
|
|
241207
|
+
entrypoint: Literal3("bundle/index.js"),
|
|
241208
|
+
execution: Optional4(WorkerExecutionGroupSchema2)
|
|
241055
241209
|
}, { additionalProperties: false }), { minItems: 1, maxItems: 32 })
|
|
241056
241210
|
}, { additionalProperties: false });
|
|
241057
241211
|
});
|
|
@@ -241122,7 +241276,9 @@ var init_application_configuration = __esm2(() => {
|
|
|
241122
241276
|
"SUPACLOUD_ACTIVATION_ID",
|
|
241123
241277
|
"SUPACLOUD_ENVIRONMENT_ID",
|
|
241124
241278
|
"SUPACLOUD_TARGET",
|
|
241125
|
-
"SUPACLOUD_OBJECT_ID"
|
|
241279
|
+
"SUPACLOUD_OBJECT_ID",
|
|
241280
|
+
"SUPACLOUD_WORKER_EXECUTION",
|
|
241281
|
+
"SUPACLOUD_WORKER_REPLICA"
|
|
241126
241282
|
]);
|
|
241127
241283
|
});
|
|
241128
241284
|
var ApplicationActivationIdSchema3;
|
|
@@ -241229,6 +241385,7 @@ var init_delivery_migration_archive = __esm2(() => {
|
|
|
241229
241385
|
var init_delivery_migration_plan = () => {};
|
|
241230
241386
|
var init_src = __esm2(() => {
|
|
241231
241387
|
init_delivery_artifact();
|
|
241388
|
+
init_worker_execution();
|
|
241232
241389
|
init_application_activation();
|
|
241233
241390
|
init_application_release();
|
|
241234
241391
|
init_application_configuration();
|
|
@@ -245166,6 +245323,17 @@ function createDeliveryPlan(graph, input) {
|
|
|
245166
245323
|
}
|
|
245167
245324
|
}
|
|
245168
245325
|
}
|
|
245326
|
+
for (const group of options.execution?.groups ?? []) {
|
|
245327
|
+
const target = targets.get(group.target);
|
|
245328
|
+
if (!target || target.kind !== "jobs" || target.isolation !== "process" || target.jobs.length !== 1 || target.jobs[0]?.name !== group.taskKey || !options.build?.workerApplications?.some((item) => item.target === group.target)) {
|
|
245329
|
+
fail("delivery-execution-binding-invalid", `Execution group "${group.name}" requires one matching compiled Job and a Worker host.`, "Bind one versioned queue/task to one process-isolated jobs target with build.workerApplications.");
|
|
245330
|
+
} else {
|
|
245331
|
+
target.execution = group;
|
|
245332
|
+
}
|
|
245333
|
+
}
|
|
245334
|
+
if ([...targets.values()].reduce((count, target) => count + (target.execution?.replicas ?? 1), 0) > 32) {
|
|
245335
|
+
fail("delivery-execution-replica-limit", "A release supports at most 32 runtime targets including replicas.", "Reduce the replica count or split independent applications.");
|
|
245336
|
+
}
|
|
245169
245337
|
const canonicalDiagnostics = [...new Map(diagnostics.map((item) => [JSON.stringify(item), item])).values()].sort((a, b) => compare2(JSON.stringify(a), JSON.stringify(b)));
|
|
245170
245338
|
if (canonicalDiagnostics.some((item) => item.severity === "error")) {
|
|
245171
245339
|
return parseDeliveryPlanResult({ ok: false, plan: null, diagnostics: canonicalDiagnostics, written: [] });
|
|
@@ -245244,7 +245412,7 @@ function renderDeliveryTarget(graph, target, options) {
|
|
|
245244
245412
|
init_delivery_files2();
|
|
245245
245413
|
init_build();
|
|
245246
245414
|
init_value2();
|
|
245247
|
-
var
|
|
245415
|
+
var closed5 = { additionalProperties: false };
|
|
245248
245416
|
var requestSchema = _Object_3({
|
|
245249
245417
|
parentPid: Integer4({ minimum: 1 }),
|
|
245250
245418
|
name: String22(),
|
|
@@ -245252,15 +245420,15 @@ var requestSchema = _Object_3({
|
|
|
245252
245420
|
project: String22(),
|
|
245253
245421
|
generatedDirectory: String22(),
|
|
245254
245422
|
options: DeliveryOptionsSchema2
|
|
245255
|
-
},
|
|
245423
|
+
}, closed5);
|
|
245256
245424
|
var responseSchema2 = Union4([
|
|
245257
245425
|
_Object_3({
|
|
245258
245426
|
ok: Literal3(true),
|
|
245259
245427
|
files: _Array_2(Tuple3([DeliveryFilePathSchema2, String22({ pattern: "^[A-Za-z0-9+/]*={0,2}$" })])),
|
|
245260
245428
|
inputs: _Array_2(Tuple3([String22(), String22({ pattern: "^[a-f0-9]{64}$" })])),
|
|
245261
245429
|
runtimeImports: _Array_2(String22())
|
|
245262
|
-
},
|
|
245263
|
-
_Object_3({ ok: Literal3(false) },
|
|
245430
|
+
}, closed5),
|
|
245431
|
+
_Object_3({ ok: Literal3(false) }, closed5)
|
|
245264
245432
|
]);
|
|
245265
245433
|
function parseDeliveryBundleResponse(input) {
|
|
245266
245434
|
if (!Check22(responseSchema2, input))
|
|
@@ -245489,6 +245657,7 @@ function renderDeliveryWorkerEntry(generatedDirectory, hostPath) {
|
|
|
245489
245657
|
const specifier = relativeImportPath(generatedDirectory, hostPath);
|
|
245490
245658
|
return `
|
|
245491
245659
|
import deliveryProcess from "node:process";
|
|
245660
|
+
import { isDeepStrictEqual as deliveryPolicyEqual } from "node:util";
|
|
245492
245661
|
import { createDeliveryWorker } from ${JSON.stringify(specifier)};
|
|
245493
245662
|
${renderDeliveryRuntimeIdentity()}
|
|
245494
245663
|
|
|
@@ -245496,6 +245665,8 @@ interface DeliveryWorkerHost {
|
|
|
245496
245665
|
start(): void | Promise<void>;
|
|
245497
245666
|
close(): void | Promise<void>;
|
|
245498
245667
|
failure?: Promise<never>;
|
|
245668
|
+
execution?: unknown;
|
|
245669
|
+
health?(): Promise<{ ready: boolean; active: number; completed: number; failed: number; timedOut: number }>;
|
|
245499
245670
|
}
|
|
245500
245671
|
|
|
245501
245672
|
{
|
|
@@ -245507,6 +245678,7 @@ interface DeliveryWorkerHost {
|
|
|
245507
245678
|
let closing: Promise<void> | undefined;
|
|
245508
245679
|
let deadline: ReturnType<typeof setTimeout> | undefined;
|
|
245509
245680
|
let keepAlive: ReturnType<typeof setInterval> | undefined;
|
|
245681
|
+
let healthPending = false;
|
|
245510
245682
|
const finish = (failed: boolean) => {
|
|
245511
245683
|
clearTimeout(deadline);
|
|
245512
245684
|
clearInterval(keepAlive);
|
|
@@ -245567,6 +245739,13 @@ interface DeliveryWorkerHost {
|
|
|
245567
245739
|
const candidate = await createHost(createCompiledModules(), { signal: lifecycle.signal });
|
|
245568
245740
|
if (!candidate || typeof candidate.close !== "function") throw new Error("Invalid delivery worker host.");
|
|
245569
245741
|
host = candidate;
|
|
245742
|
+
const execution = deliveryProcess.env.SUPACLOUD_WORKER_EXECUTION;
|
|
245743
|
+
if (execution) {
|
|
245744
|
+
const expected: unknown = JSON.parse(Buffer.from(execution, "base64").toString("utf8"));
|
|
245745
|
+
if (!deliveryPolicyEqual(host.execution, expected) || typeof host.health !== "function" || !host.failure) {
|
|
245746
|
+
throw new Error("Delivery worker execution policy was not adopted.");
|
|
245747
|
+
}
|
|
245748
|
+
}
|
|
245570
245749
|
if (typeof host.start !== "function") throw new Error("Invalid delivery worker host.");
|
|
245571
245750
|
if (host.failure !== undefined) {
|
|
245572
245751
|
if (!host.failure || typeof host.failure.then !== "function") throw new Error("Invalid worker failure signal.");
|
|
@@ -245578,7 +245757,18 @@ interface DeliveryWorkerHost {
|
|
|
245578
245757
|
await finishShutdown();
|
|
245579
245758
|
} else {
|
|
245580
245759
|
running = true;
|
|
245581
|
-
|
|
245760
|
+
const health = async () => {
|
|
245761
|
+
if (!execution || !host?.health || healthPending || lifecycle.signal.aborted) return;
|
|
245762
|
+
healthPending = true;
|
|
245763
|
+
try {
|
|
245764
|
+
const status = await host.health();
|
|
245765
|
+
console.log(JSON.stringify({ event: "delivery-worker-health", identity, observedAt: new Date().toISOString(), ...status }));
|
|
245766
|
+
} catch {
|
|
245767
|
+
console.log(JSON.stringify({ event: "delivery-worker-health", identity, observedAt: new Date().toISOString(), ready: false }));
|
|
245768
|
+
} finally { healthPending = false; }
|
|
245769
|
+
};
|
|
245770
|
+
keepAlive = setInterval(() => { void health(); }, execution ? 5000 : 1000);
|
|
245771
|
+
await health();
|
|
245582
245772
|
console.log(JSON.stringify({ event: "delivery-worker-started", ...(identity ? { identity } : {}) }));
|
|
245583
245773
|
}
|
|
245584
245774
|
} catch {
|
|
@@ -246666,7 +246856,7 @@ var starter_metadata_default = {
|
|
|
246666
246856
|
generatedBy: "supacloud/starter-metadata-v1",
|
|
246667
246857
|
packages: {
|
|
246668
246858
|
compiler: {
|
|
246669
|
-
version: "0.
|
|
246859
|
+
version: "0.32.0"
|
|
246670
246860
|
},
|
|
246671
246861
|
app: {
|
|
246672
246862
|
version: "0.22.0",
|
|
@@ -254397,7 +254587,7 @@ function registerRemoteDevTools(server2, options = {}) {
|
|
|
254397
254587
|
// package.json
|
|
254398
254588
|
var package_default = {
|
|
254399
254589
|
name: "@supacloud/cli",
|
|
254400
|
-
version: "0.64.
|
|
254590
|
+
version: "0.64.4",
|
|
254401
254591
|
description: "Project-scoped CLI for SupaCloud users",
|
|
254402
254592
|
type: "module",
|
|
254403
254593
|
main: "./dist/index.js",
|
|
@@ -254432,14 +254622,14 @@ var package_default = {
|
|
|
254432
254622
|
},
|
|
254433
254623
|
dependencies: {
|
|
254434
254624
|
"@sinclair/typebox": "^0.34.52",
|
|
254435
|
-
"@supacloud/compiler": "^0.
|
|
254436
|
-
"@supacloud/delivery": "0.
|
|
254625
|
+
"@supacloud/compiler": "^0.32.0",
|
|
254626
|
+
"@supacloud/delivery": "0.6.0",
|
|
254437
254627
|
"@supacloud/db": "^0.2.0",
|
|
254438
254628
|
fflate: "^0.8.3",
|
|
254439
254629
|
typebox: "1.3.34"
|
|
254440
254630
|
},
|
|
254441
254631
|
overrides: {
|
|
254442
|
-
"@supacloud/delivery": "0.
|
|
254632
|
+
"@supacloud/delivery": "0.6.0"
|
|
254443
254633
|
},
|
|
254444
254634
|
devDependencies: {
|
|
254445
254635
|
"@supacloud/elysia": "^0.23.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/cli",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.4",
|
|
4
4
|
"description": "Project-scoped CLI for SupaCloud users",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@sinclair/typebox": "^0.34.52",
|
|
38
|
-
"@supacloud/compiler": "^0.
|
|
39
|
-
"@supacloud/delivery": "0.
|
|
38
|
+
"@supacloud/compiler": "^0.32.0",
|
|
39
|
+
"@supacloud/delivery": "0.6.0",
|
|
40
40
|
"@supacloud/db": "^0.2.0",
|
|
41
41
|
"fflate": "^0.8.3",
|
|
42
42
|
"typebox": "1.3.34"
|
|
43
43
|
},
|
|
44
44
|
"overrides": {
|
|
45
|
-
"@supacloud/delivery": "0.
|
|
45
|
+
"@supacloud/delivery": "0.6.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@supacloud/elysia": "^0.23.1",
|