@prisma/composer 0.3.0-dev.9 → 0.3.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/{app-config-bsTo57A8-BfG21wAI.d.mts → app-config-Dw3r7sUa-D3dr8rg2.d.mts} +4 -4
- package/dist/{app-config-bsTo57A8-BfG21wAI.d.mts.map → app-config-Dw3r7sUa-D3dr8rg2.d.mts.map} +1 -1
- package/dist/bin.mjs +32 -56
- package/dist/bin.mjs.map +1 -1
- package/dist/{casts-DpaahrlC-C5XMnP9S.mjs → casts-Ci5rYYaR.mjs} +2 -2
- package/dist/casts-Ci5rYYaR.mjs.map +1 -0
- package/dist/casts.mjs +1 -1
- package/dist/config-121C4hAb.d.mts +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/deploy-121C4hAb.d.mts +1 -0
- package/dist/{deploy-C4DxNkJ9-D73lmBqy.mjs → deploy-H3PKi0ZR-Chgm12Bn.mjs} +3 -3
- package/dist/{deploy-C4DxNkJ9-D73lmBqy.mjs.map → deploy-H3PKi0ZR-Chgm12Bn.mjs.map} +1 -1
- package/dist/deploy.d.mts +2 -2
- package/dist/deploy.mjs +1 -1
- package/dist/{dist-BdvFDCLV.mjs → dist-BkSJOwTm.mjs} +76 -12
- package/dist/dist-BkSJOwTm.mjs.map +1 -0
- package/dist/{graph-DgbALPDo-BEHF94BN.mjs → graph-CP16cJyH-D5IW87Y-.mjs} +41 -60
- package/dist/graph-CP16cJyH-D5IW87Y-.mjs.map +1 -0
- package/dist/{graph-DDpXh7S8-b-93BcHn.d.mts → graph-DUSgjmzA-DhtkTqoz.d.mts} +3 -3
- package/dist/graph-DUSgjmzA-DhtkTqoz.d.mts.map +1 -0
- package/dist/{graph-types-C3FOaaXm-C6_rGzfn.d.mts → graph-types-BcbVhojU-C3fhxjPK.d.mts} +87 -87
- package/dist/graph-types-BcbVhojU-C3fhxjPK.d.mts.map +1 -0
- package/dist/index-BFBNz7Aw.d.mts +32 -0
- package/dist/index-BFBNz7Aw.d.mts.map +1 -0
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +3 -4
- package/dist/local-target.d.mts +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/local-target.mjs.map +1 -1
- package/dist/{nextjs-DLyeRR7M-D47aMmfr.d.mts → nextjs-DLyeRR7M-DwnBjryZ.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-D47aMmfr.d.mts.map → nextjs-DLyeRR7M-DwnBjryZ.d.mts.map} +1 -1
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node.d.mts +2 -2
- package/dist/report.d.mts +2 -2
- package/dist/report.mjs +0 -4
- package/dist/report.mjs.map +1 -1
- package/dist/service-rpc.d.mts +5 -15
- package/dist/service-rpc.d.mts.map +1 -1
- package/dist/service-rpc.mjs +4 -6
- package/dist/service-rpc.mjs.map +1 -1
- package/dist/testing.d.mts +11 -17
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +20 -12
- package/dist/testing.mjs.map +1 -1
- package/package.json +11 -12
- package/dist/arktype.d.mts +0 -16
- package/dist/arktype.d.mts.map +0 -1
- package/dist/arktype.mjs +0 -22
- package/dist/arktype.mjs.map +0 -1
- package/dist/casts-DpaahrlC-C5XMnP9S.mjs.map +0 -1
- package/dist/config-DUzvB5cQ.d.mts +0 -1
- package/dist/deploy-DUzvB5cQ.d.mts +0 -1
- package/dist/dist-BdvFDCLV.mjs.map +0 -1
- package/dist/graph-DDpXh7S8-b-93BcHn.d.mts.map +0 -1
- package/dist/graph-DgbALPDo-BEHF94BN.mjs.map +0 -1
- package/dist/graph-types-C3FOaaXm-C6_rGzfn.d.mts.map +0 -1
- package/dist/index-BQVrMGfe.d.mts +0 -22
- package/dist/index-BQVrMGfe.d.mts.map +0 -1
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts +0 -25
- package/dist/secret-CHOw4LBU-C8yXoC9N.d.mts.map +0 -1
- package/dist/secret-DoWGmN7m-DO5Brq1Y.mjs +0 -55
- package/dist/secret-DoWGmN7m-DO5Brq1Y.mjs.map +0 -1
- package/src/exports/arktype.ts +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./graph-
|
|
1
|
+
import { A as ProvisionNeed, H as ServiceNode, N as ResourceNode, S as NodeId, d as Graph, n as Config, t as BuildAdapter, y as ModuleNode } from "./graph-types-BcbVhojU-C3fhxjPK.mjs";
|
|
2
|
+
import "./graph-DUSgjmzA-DhtkTqoz.mjs";
|
|
3
3
|
import * as Alchemy from "alchemy";
|
|
4
4
|
import { Input, StackServices } from "alchemy";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Layer from "effect/Layer";
|
|
7
7
|
import { State } from "alchemy/State/State";
|
|
8
|
-
//#region ../../0-framework/1-core/core/dist/app-config-
|
|
8
|
+
//#region ../../0-framework/1-core/core/dist/app-config-Dw3r7sUa.d.mts
|
|
9
9
|
//#region src/container-transport.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* Carries resolved containers from the CLI process into the alchemy process
|
|
@@ -492,4 +492,4 @@ interface PrismaAppConfig {
|
|
|
492
492
|
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
493
493
|
//#endregion
|
|
494
494
|
export { ProvisionerDescriptor as A, joinDeployment as B, Lowering as C, PreflightInput as D, PackageInput as E, containerEnv as F, lowering as H, containerEnvVarName as I, defineConfig as L, StateDescriptor as M, TeardownInput as N, PrismaAppConfig as O, buildConfig as P, deserializeContainers as R, LoweredResult as S, Outputs as T, mergedProviders as U, lower as V, resolveStateLayer as W, LocalTargetProvidersInput as _, Bundle as a, LowerError as b, DEV_DIR as c, DeploymentResult as d, ExtensionDescriptor as f, LocalTargetEmulatorsInput as g, LocalTargetDescriptor as h, AssembleInput as i, ServiceLowering as j, ProvisionEdge as k, DeployedEntity as l, LocalTargetAttachment as m, ApplicationDescriptor as n, ContainerDescriptor as o, LocalTargetAttachInput as p, Artifact as r, ContainerInstance as s, AlchemyStateLayer as t, DeployedNode as u, LocateContainerInput as v, NodeDescriptor as w, LowerOptions as x, LowerContext as y, isBuildOnlyExtension as z };
|
|
495
|
-
//# sourceMappingURL=app-config-
|
|
495
|
+
//# sourceMappingURL=app-config-Dw3r7sUa-D3dr8rg2.d.mts.map
|
package/dist/{app-config-bsTo57A8-BfG21wAI.d.mts.map → app-config-Dw3r7sUa-D3dr8rg2.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config-
|
|
1
|
+
{"version":3,"file":"app-config-Dw3r7sUa-D3dr8rg2.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-Dw3r7sUa.d.mts"],"mappings":"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"}
|
package/dist/bin.mjs
CHANGED
|
@@ -58,7 +58,7 @@ function isBuildOnlyExtension(extension) {
|
|
|
58
58
|
return Object.values(extension.nodes).every((node) => node.kind === "build") && extension.providers === void 0 && extension.application === void 0 && extension.provisions === void 0 && extension.container === void 0;
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
|
-
//#region ../../0-framework/0-foundation/foundation/dist/casts
|
|
61
|
+
//#region ../../0-framework/0-foundation/foundation/dist/casts.mjs
|
|
62
62
|
/**
|
|
63
63
|
* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**
|
|
64
64
|
*
|
|
@@ -98,7 +98,7 @@ function blindCast(input) {
|
|
|
98
98
|
return input;
|
|
99
99
|
}
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region ../../0-framework/1-core/core/dist/graph-
|
|
101
|
+
//#region ../../0-framework/1-core/core/dist/graph-CP16cJyH.mjs
|
|
102
102
|
/** Thrown by Load when the graph is malformed. */
|
|
103
103
|
var LoadError = class extends Error {
|
|
104
104
|
constructor(message) {
|
|
@@ -215,7 +215,11 @@ function serviceInputs(service, serviceId) {
|
|
|
215
215
|
}
|
|
216
216
|
function loadService(root, rootId) {
|
|
217
217
|
for (const [input, value] of Object.entries(root.inputs)) if (isNode(value) && value.kind === "dependency") throw new LoadError(`Service "${rootId}" has an unwired dependency input "${input}" — this service is composed by a module; deploy the module instead of loading "${rootId}" directly.`);
|
|
218
|
-
|
|
218
|
+
const secretSlots = Object.keys(root.secretSlots);
|
|
219
|
+
if (secretSlots.length > 0) {
|
|
220
|
+
const names = secretSlots.map((k) => `"${k}"`).join(", ");
|
|
221
|
+
throw new LoadError(`Service "${rootId}" declares secret slot${secretSlots.length > 1 ? "s" : ""} ${names} but is being loaded directly — a lone service has no enclosing scope to bind them. Compose it inside a module that binds each with envSecret('NAME').`);
|
|
222
|
+
}
|
|
219
223
|
const rootGraphNode = {
|
|
220
224
|
id: rootId,
|
|
221
225
|
node: root
|
|
@@ -225,7 +229,7 @@ function loadService(root, rootId) {
|
|
|
225
229
|
root: rootGraphNode,
|
|
226
230
|
nodes: [...topoSort(nodes, edges), rootGraphNode],
|
|
227
231
|
edges,
|
|
228
|
-
|
|
232
|
+
secrets: [],
|
|
229
233
|
params: []
|
|
230
234
|
};
|
|
231
235
|
}
|
|
@@ -308,25 +312,6 @@ function validateWiring(pending, byId) {
|
|
|
308
312
|
if (value.kind === "dependency") throw new LoadError(`Dependency input "${input}" of provisioned ${targetKind} "${targetId}" is not wired to a producer (module "${enclosingModuleName}").`);
|
|
309
313
|
}
|
|
310
314
|
}
|
|
311
|
-
/**
|
|
312
|
-
* Flattens a value into itself plus every nested object/array member value —
|
|
313
|
-
* identity fodder for the ctx.secrets/ctx.params usage marking, which must
|
|
314
|
-
* see a forwarded source wherever it sits inside an input binding (ADR-0042).
|
|
315
|
-
* A secret/param source is an opaque leaf: it is pushed (a forwarded ref IS
|
|
316
|
-
* such a source, so identity-matching still needs it) but never descended
|
|
317
|
-
* into, so a ref buried in an unrelated source's payload is not falsely seen
|
|
318
|
-
* as used. `seen` guards object cycles so a self-referential binding cannot
|
|
319
|
-
* recurse forever.
|
|
320
|
-
*/
|
|
321
|
-
function deepValues(value, out, seen = /* @__PURE__ */ new WeakSet()) {
|
|
322
|
-
out.push(value);
|
|
323
|
-
if (typeof value !== "object" || value === null) return;
|
|
324
|
-
if (isSecretSource(value) || isParamSource(value)) return;
|
|
325
|
-
if (seen.has(value)) return;
|
|
326
|
-
seen.add(value);
|
|
327
|
-
const members = Array.isArray(value) ? value : Object.values(value);
|
|
328
|
-
for (const member of members) deepValues(member, out, seen);
|
|
329
|
-
}
|
|
330
315
|
/** The (unvalidated) edges a `wiring` object implies — one dependency edge per entry; `validateWiring` does the real checking. */
|
|
331
316
|
function wiringEdges(wiring, targetId) {
|
|
332
317
|
return Object.entries(wiring).map(([input, ref]) => ({
|
|
@@ -337,12 +322,11 @@ function wiringEdges(wiring, targetId) {
|
|
|
337
322
|
}));
|
|
338
323
|
}
|
|
339
324
|
/**
|
|
340
|
-
* Checks the secrets wired into one provisioned child
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* is needed).
|
|
325
|
+
* Checks the secrets wired into one provisioned child: every declared slot is
|
|
326
|
+
* bound to a real secret source (an `envSecret` or a forwarded ctx.secrets
|
|
327
|
+
* ref), and no wired key names a slot the child doesn't declare — the secret
|
|
328
|
+
* analog of `validateWiring`'s per-input checks, but resolved inline (a source
|
|
329
|
+
* carries its own name, so no whole-graph pass is needed).
|
|
346
330
|
*/
|
|
347
331
|
function validateSecretBinding(child, id, secretWiring, enclosingModuleName) {
|
|
348
332
|
const { kind } = child;
|
|
@@ -390,7 +374,7 @@ function validateParamNeedBinding(child, id, paramWiring, enclosingModuleName) {
|
|
|
390
374
|
* forward in a producer provisioned by an ancestor scope, and it is the
|
|
391
375
|
* shared `byId` (keyed by full address) that lets that resolve.
|
|
392
376
|
*/
|
|
393
|
-
function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes, edges, pending,
|
|
377
|
+
function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes, edges, pending, secretBindings, paramBindings, byId) {
|
|
394
378
|
const localIds = /* @__PURE__ */ new Set();
|
|
395
379
|
const used = /* @__PURE__ */ new Set();
|
|
396
380
|
const usedSecrets = /* @__PURE__ */ new Set();
|
|
@@ -404,7 +388,7 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
404
388
|
} : wired;
|
|
405
389
|
}
|
|
406
390
|
const markUsed = (values) => {
|
|
407
|
-
for (const value of values) for (const key of Object.keys(ctxInputs)) if (value === ctxInputs[key]) used.add(key);
|
|
391
|
+
for (const value of Object.values(values)) for (const key of Object.keys(ctxInputs)) if (value === ctxInputs[key]) used.add(key);
|
|
408
392
|
};
|
|
409
393
|
const ctxSecrets = {};
|
|
410
394
|
for (const key of Object.keys(moduleNode.secretSlots)) {
|
|
@@ -415,7 +399,7 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
415
399
|
} : bound;
|
|
416
400
|
}
|
|
417
401
|
const markSecretsUsed = (values) => {
|
|
418
|
-
for (const value of values) for (const key of Object.keys(ctxSecrets)) if (value === ctxSecrets[key]) usedSecrets.add(key);
|
|
402
|
+
for (const value of Object.values(values)) for (const key of Object.keys(ctxSecrets)) if (value === ctxSecrets[key]) usedSecrets.add(key);
|
|
419
403
|
};
|
|
420
404
|
const ctxParams = {};
|
|
421
405
|
for (const key of Object.keys(moduleNode.paramSlots)) {
|
|
@@ -426,13 +410,12 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
426
410
|
} : bound;
|
|
427
411
|
}
|
|
428
412
|
const markParamsUsed = (values) => {
|
|
429
|
-
for (const value of values) for (const key of Object.keys(ctxParams)) if (value === ctxParams[key]) usedParams.add(key);
|
|
413
|
+
for (const value of Object.values(values)) for (const key of Object.keys(ctxParams)) if (value === ctxParams[key]) usedParams.add(key);
|
|
430
414
|
};
|
|
431
415
|
const provision = (child, opts) => {
|
|
432
416
|
const id = opts?.id ?? child.name;
|
|
433
417
|
const provisionWiring = opts?.deps;
|
|
434
418
|
const provisionSecrets = opts?.secrets;
|
|
435
|
-
const provisionInput = opts?.input;
|
|
436
419
|
const provisionParams = opts?.params;
|
|
437
420
|
if (typeof id !== "string" || id.length === 0) throw new LoadError(`provision() requires a non-empty id (module "${moduleNode.name}").`);
|
|
438
421
|
if (!isConfigKeySegment(id)) throw new LoadError(`provision() id "${id}" (module "${moduleNode.name}") must contain only ASCII letters and digits ([A-Za-z0-9]) — the id becomes an address segment, and addresses derive deterministic config keys (segments uppercased and joined with "_"). "${id}" would put "${id.toUpperCase()}" inside the derived key. ("_" collides with the key separator and "." with the address separator.)`);
|
|
@@ -444,7 +427,6 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
444
427
|
if (child.kind === "resource") {
|
|
445
428
|
if (provisionWiring !== void 0) throw new LoadError(`provision("${id}") received deps for a resource — a resource has no dependency slots to satisfy.`);
|
|
446
429
|
if (provisionSecrets !== void 0) throw new LoadError(`provision("${id}") received secrets for a resource — a resource has no secret slots to satisfy.`);
|
|
447
|
-
if (provisionInput !== void 0) throw new LoadError(`provision("${id}") received an input binding for a resource — a resource declares no input schema.`);
|
|
448
430
|
if (provisionParams !== void 0) throw new LoadError(`provision("${id}") received params for a resource — a resource has no params to satisfy.`);
|
|
449
431
|
if (child.type.length === 0) throw new LoadError(`provision("${id}") received a resource with an empty node type.`);
|
|
450
432
|
byId.set(fullAddress, child);
|
|
@@ -455,23 +437,19 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
455
437
|
return refForResource(fullAddress, child);
|
|
456
438
|
}
|
|
457
439
|
const localWiring = { ...provisionWiring ?? {} };
|
|
458
|
-
markUsed(
|
|
440
|
+
markUsed(localWiring);
|
|
459
441
|
const localSecrets = { ...provisionSecrets ?? {} };
|
|
460
|
-
markSecretsUsed(
|
|
442
|
+
markSecretsUsed(localSecrets);
|
|
443
|
+
validateSecretBinding(child, id, localSecrets, moduleNode.name);
|
|
461
444
|
const localParams = { ...provisionParams ?? {} };
|
|
462
|
-
markParamsUsed(
|
|
445
|
+
markParamsUsed(localParams);
|
|
463
446
|
if (child.kind === "service") {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
if (provisionInput !== void 0) {
|
|
468
|
-
const leaves = [];
|
|
469
|
-
deepValues(provisionInput, leaves);
|
|
470
|
-
markSecretsUsed(leaves);
|
|
471
|
-
markParamsUsed(leaves);
|
|
472
|
-
inputBindings.push({
|
|
447
|
+
for (const slot of Object.keys(child.secretSlots)) {
|
|
448
|
+
const bound = localSecrets[slot];
|
|
449
|
+
if (isSecretSource(bound)) secretBindings.push({
|
|
473
450
|
serviceAddress: fullAddress,
|
|
474
|
-
|
|
451
|
+
slot,
|
|
452
|
+
source: bound
|
|
475
453
|
});
|
|
476
454
|
}
|
|
477
455
|
validateServiceParamBinding(child, id, localParams, moduleNode.name);
|
|
@@ -496,8 +474,6 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
496
474
|
byId.set(fullAddress, child);
|
|
497
475
|
return refFor(fullAddress, child);
|
|
498
476
|
}
|
|
499
|
-
if (provisionInput !== void 0) throw new LoadError(`provision("${id}") received an input binding for a module — a module has no input schema; bind the input on the service that declares it.`);
|
|
500
|
-
validateSecretBinding(child, id, localSecrets, moduleNode.name);
|
|
501
477
|
validateParamNeedBinding(child, id, localParams, moduleNode.name);
|
|
502
478
|
edges.push(...wiringEdges(localWiring, fullAddress));
|
|
503
479
|
pending.push({
|
|
@@ -507,7 +483,7 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
507
483
|
targetKind: "module",
|
|
508
484
|
enclosingModuleName: moduleNode.name
|
|
509
485
|
});
|
|
510
|
-
const childOutputs = flatten(child, fullAddress, localWiring, localSecrets, localParams, nodes, edges, pending,
|
|
486
|
+
const childOutputs = flatten(child, fullAddress, localWiring, localSecrets, localParams, nodes, edges, pending, secretBindings, paramBindings, byId);
|
|
511
487
|
nodes.push({
|
|
512
488
|
id: fullAddress,
|
|
513
489
|
node: child
|
|
@@ -525,7 +501,7 @@ function flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes,
|
|
|
525
501
|
provision: blindCast(provision)
|
|
526
502
|
});
|
|
527
503
|
const outputs = blindCast(moduleNode.body(ctx) ?? {});
|
|
528
|
-
markUsed(
|
|
504
|
+
markUsed(outputs);
|
|
529
505
|
for (const key of Object.keys(moduleNode.deps)) if (!used.has(key)) throw new LoadError(`Module "${moduleNode.name}" declares input "${key}" but never forwards it into a provision nor returns it as an output.`);
|
|
530
506
|
for (const key of Object.keys(moduleNode.secretSlots)) if (!usedSecrets.has(key)) throw new LoadError(`Module "${moduleNode.name}" declares secret "${key}" but never forwards it into a provision.`);
|
|
531
507
|
for (const key of Object.keys(moduleNode.paramSlots)) if (!usedParams.has(key)) throw new LoadError(`Module "${moduleNode.name}" declares param "${key}" but never forwards it into a provision.`);
|
|
@@ -556,10 +532,10 @@ function loadModule(root, opts) {
|
|
|
556
532
|
const nodes = [];
|
|
557
533
|
const edges = [];
|
|
558
534
|
const pending = [];
|
|
559
|
-
const
|
|
535
|
+
const secretBindings = [];
|
|
560
536
|
const paramBindings = [];
|
|
561
537
|
const byId = /* @__PURE__ */ new Map();
|
|
562
|
-
flatten(root, void 0, {}, {}, {}, nodes, edges, pending,
|
|
538
|
+
flatten(root, void 0, {}, {}, {}, nodes, edges, pending, secretBindings, paramBindings, byId);
|
|
563
539
|
for (const entry of pending) validateWiring(entry, byId);
|
|
564
540
|
assertDependencyDag(edges);
|
|
565
541
|
const rootGraphNode = {
|
|
@@ -570,7 +546,7 @@ function loadModule(root, opts) {
|
|
|
570
546
|
root: rootGraphNode,
|
|
571
547
|
nodes: [...topoSort(nodes, edges), rootGraphNode],
|
|
572
548
|
edges,
|
|
573
|
-
|
|
549
|
+
secrets: secretBindings,
|
|
574
550
|
params: paramBindings
|
|
575
551
|
};
|
|
576
552
|
}
|
|
@@ -618,7 +594,7 @@ function Load(root, opts) {
|
|
|
618
594
|
throw new LoadError("Load expects a service or module root (received another node kind).");
|
|
619
595
|
}
|
|
620
596
|
//#endregion
|
|
621
|
-
//#region ../../0-framework/1-core/core/dist/deploy-
|
|
597
|
+
//#region ../../0-framework/1-core/core/dist/deploy-H3PKi0ZR.mjs
|
|
622
598
|
var LowerError = class extends Error {
|
|
623
599
|
constructor(message) {
|
|
624
600
|
super(message);
|