@prisma/composer-cli 0.39.0-dev.1 → 0.39.0-dev.10
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-converge-C_YkTIBF-RmqGOR45.mjs +88 -0
- package/dist/app-converge-C_YkTIBF-RmqGOR45.mjs.map +1 -0
- package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs +254 -0
- package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs.map +1 -0
- package/dist/{validate-environment-D1BTCkTs-C5m4rL6t.mjs → deploy-Br1yvLe3.mjs} +335 -1091
- package/dist/deploy-Br1yvLe3.mjs.map +1 -0
- package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs +256 -0
- package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs.map +1 -0
- package/dist/dev-converge-worker.d.mts +1 -0
- package/dist/dev-converge-worker.mjs +143 -0
- package/dist/dev-converge-worker.mjs.map +1 -0
- package/dist/{dev-current-wD5YDLjA-CFI8XTAK.mjs → dev-current-DANgmcle-RwunETUJ.mjs} +12 -18
- package/dist/dev-current-DANgmcle-RwunETUJ.mjs.map +1 -0
- package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs +43 -0
- package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs.map +1 -0
- package/dist/{dist-D0rWRHos.mjs → dist-C0OGaDnj.mjs} +4 -3
- package/dist/{dist-D0rWRHos.mjs.map → dist-C0OGaDnj.mjs.map} +1 -1
- package/dist/errors-CVYwN2km.mjs +93 -0
- package/dist/errors-CVYwN2km.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs → execute-deploy-destroy-DIR9uvA_-Bk0HBMTz.mjs} +374 -141
- package/dist/execute-deploy-destroy-DIR9uvA_-Bk0HBMTz.mjs.map +1 -0
- package/dist/{execute-dev-BIyOI3Ys-DGpTd9rP.mjs → execute-dev-Cu9_LsQi-CsyIqphZ.mjs} +444 -128
- package/dist/execute-dev-Cu9_LsQi-CsyIqphZ.mjs.map +1 -0
- package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs → execute-dev-current-Bs0lE_5--BU3A2hsC.mjs} +9 -6
- package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs.map → execute-dev-current-Bs0lE_5--BU3A2hsC.mjs.map} +1 -1
- package/dist/{redaction-Bf8FvTFH-XGchRgrK.d.mts → family-DfwviKFj-CS1L-EvS.d.mts} +439 -204
- package/dist/family-DfwviKFj-CS1L-EvS.d.mts.map +1 -0
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +259 -269
- package/dist/family.mjs.map +1 -1
- package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs +58 -0
- package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs.map +1 -0
- package/dist/{list-deployed-BFJJxt_W.mjs → list-deployed-slo4P7dl.mjs} +6 -5
- package/dist/list-deployed-slo4P7dl.mjs.map +1 -0
- package/dist/local-target-CZzICh5R.mjs +34 -0
- package/dist/local-target-CZzICh5R.mjs.map +1 -0
- package/dist/{preflight-transport-DmmtoFPH-CZ0o7QPf.mjs → preflight-transport-2d6iIchu-ArIJUY1L.mjs} +7 -28
- package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs.map +1 -0
- package/dist/{redaction-DXung4ip-Co_fv4Zl.mjs → redaction-DY6eDC12-BrK1aSN5.mjs} +33 -267
- package/dist/redaction-DY6eDC12-BrK1aSN5.mjs.map +1 -0
- package/dist/result-CttmabB6.mjs +91 -0
- package/dist/result-CttmabB6.mjs.map +1 -0
- package/dist/rolldown-runtime-C7HZzL1F.mjs +26 -0
- package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs +287 -0
- package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs.map +1 -0
- package/dist/testing.d.mts +4 -49
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +2 -75
- package/dist/testing.mjs.map +1 -1
- package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs +983 -0
- package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs.map +1 -0
- package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs +15 -0
- package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs.map +1 -0
- package/package.json +9 -9
- package/src/exports/dev-converge-worker.ts +2 -0
- package/src/exports/testing.ts +1 -4
- package/dist/app-configuration-file-CeJvBAti-DA4EKwFq.mjs +0 -140
- package/dist/app-configuration-file-CeJvBAti-DA4EKwFq.mjs.map +0 -1
- package/dist/dev-current-wD5YDLjA-CFI8XTAK.mjs.map +0 -1
- package/dist/dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs +0 -71
- package/dist/dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs.map +0 -1
- package/dist/execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs.map +0 -1
- package/dist/execute-dev-BIyOI3Ys-DGpTd9rP.mjs.map +0 -1
- package/dist/generate-dev-stack-BV_n-X9n-DM5faH3-.mjs +0 -100
- package/dist/generate-dev-stack-BV_n-X9n-DM5faH3-.mjs.map +0 -1
- package/dist/list-deployed-BFJJxt_W.mjs.map +0 -1
- package/dist/preflight-transport-DmmtoFPH-CZ0o7QPf.mjs.map +0 -1
- package/dist/redaction-Bf8FvTFH-XGchRgrK.d.mts.map +0 -1
- package/dist/redaction-DXung4ip-Co_fv4Zl.mjs.map +0 -1
- package/dist/result-sR7PBi61.mjs +0 -229
- package/dist/result-sR7PBi61.mjs.map +0 -1
- package/dist/run-alchemy-CRLAyOtt-CwFLe4Zg.mjs +0 -236
- package/dist/run-alchemy-CRLAyOtt-CwFLe4Zg.mjs.map +0 -1
- package/dist/validate-environment-D1BTCkTs-C5m4rL6t.mjs.map +0 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { CommandFamily, RedirectSpec } from "@prisma/cli-engine";
|
|
2
|
+
import * as Alchemy from "alchemy";
|
|
2
3
|
import { Input, StackServices } from "alchemy";
|
|
3
4
|
import * as Effect from "effect/Effect";
|
|
4
5
|
import * as Layer from "effect/Layer";
|
|
6
|
+
import "alchemy/Alchemist";
|
|
7
|
+
import "effect/Cause";
|
|
5
8
|
import { State } from "alchemy/State/State";
|
|
9
|
+
import "alchemy/Provider";
|
|
6
10
|
//#region ../../0-framework/0-foundation/foundation/dist/errors.d.mts
|
|
7
11
|
//#region src/structured-error.d.ts
|
|
8
12
|
interface StructuredError extends Error {
|
|
@@ -98,7 +102,7 @@ declare class SecretBox<T> {
|
|
|
98
102
|
/** The common case: a secret string. */
|
|
99
103
|
type SecretString = SecretBox<string>;
|
|
100
104
|
//#endregion
|
|
101
|
-
//#region ../../0-framework/0-foundation/foundation/dist/pointer-
|
|
105
|
+
//#region ../../0-framework/0-foundation/foundation/dist/pointer-BX2KJ720.d.mts
|
|
102
106
|
//#region src/pointer.d.ts
|
|
103
107
|
declare const POINTER: unique symbol;
|
|
104
108
|
declare const POINTER_TYPE: unique symbol;
|
|
@@ -108,7 +112,7 @@ interface PointerWithKind<T, K extends PointerKind> {
|
|
|
108
112
|
readonly [POINTER]: K;
|
|
109
113
|
readonly [POINTER_TYPE]?: T;
|
|
110
114
|
}
|
|
111
|
-
/** The real value at deploy of a value known only at boot: it names the platform
|
|
115
|
+
/** The real value at deploy of a value known only at boot: it names the variable on the platform that holds the text of a `T`. Its kind is `'secret'` when `T` is a `SecretString` and `'plain'` otherwise. */
|
|
112
116
|
type Pointer<T> = PointerWithKind<T, unknown extends T ? PointerKind : T extends SecretString ? 'secret' : 'plain'>;
|
|
113
117
|
//#endregion
|
|
114
118
|
//#region ../../../node_modules/@standard-schema/spec/dist/index.d.ts
|
|
@@ -188,7 +192,7 @@ declare namespace StandardSchemaV1 {
|
|
|
188
192
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
189
193
|
}
|
|
190
194
|
//#endregion
|
|
191
|
-
//#region ../../0-framework/1-core/core/dist/graph-types-
|
|
195
|
+
//#region ../../0-framework/1-core/core/dist/graph-types-D4PrtP-l.d.mts
|
|
192
196
|
//#region src/contract.d.ts
|
|
193
197
|
/**
|
|
194
198
|
* A Contract is the declared interface of a service-to-service dependency: a
|
|
@@ -259,6 +263,7 @@ interface Config {
|
|
|
259
263
|
//#region src/value.d.ts
|
|
260
264
|
declare const VALUE: unique symbol;
|
|
261
265
|
declare const VALUE_ORIGIN: unique symbol;
|
|
266
|
+
declare const VALUE_RESOURCE: unique symbol;
|
|
262
267
|
declare const VALUE_TYPE: unique symbol;
|
|
263
268
|
/** Where Load gets a value's real value. Internal to core; not re-exported from the public barrel. */
|
|
264
269
|
type ValueOrigin<T> = {
|
|
@@ -278,34 +283,33 @@ type ValueOrigin<T> = {
|
|
|
278
283
|
} | {
|
|
279
284
|
readonly kind: 'source';
|
|
280
285
|
readonly sourceKind: 'param';
|
|
281
|
-
/** How an error names the source
|
|
286
|
+
/** How an error names the source. */
|
|
282
287
|
readonly label: string;
|
|
283
|
-
|
|
284
|
-
readonly configurationKey: string | undefined;
|
|
288
|
+
readonly resource: NodeId | undefined;
|
|
285
289
|
/** The source itself. Not enumerable, so a copy's origin compares equal and the origin holds no cycle. */
|
|
286
290
|
readonly source: ParamSource;
|
|
287
291
|
} | {
|
|
288
292
|
readonly kind: 'source';
|
|
289
293
|
readonly sourceKind: 'secret';
|
|
290
|
-
/** How an error names the source
|
|
294
|
+
/** How an error names the source. */
|
|
291
295
|
readonly label: string;
|
|
292
|
-
/** The app secrets key that holds the secret's value
|
|
296
|
+
/** The app secrets key that holds the secret's value. `undefined` for a secret source built without one. */
|
|
293
297
|
readonly secretsKey: string | undefined;
|
|
298
|
+
readonly resource: NodeId | undefined;
|
|
294
299
|
/** The source itself. Not enumerable, so a copy's origin compares equal and the origin holds no cycle. */
|
|
295
300
|
readonly source: SecretSource;
|
|
296
301
|
};
|
|
297
302
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
* one; `resolve()` returns one computed from others; a deploy target's source,
|
|
301
|
-
* such as `envParam()` or `envSecret()`, is one too. A deploy-time value's real
|
|
302
|
-
* value is known by the end of Load; a runtime value's real value at deploy is a pointer.
|
|
303
|
+
* A stand-in a module body passes wherever a `T` is accepted (ADR-0062): `environment.name`, an input field, a `resolve()` result or a target's source.
|
|
304
|
+
* A deploy-time value is known by the end of Load; a runtime value's real value at deploy is a pointer.
|
|
303
305
|
*/
|
|
304
306
|
interface Value<T> {
|
|
305
307
|
readonly [VALUE]: true;
|
|
306
308
|
readonly [VALUE_TYPE]?: T;
|
|
307
309
|
readonly [VALUE_ORIGIN]: ValueOrigin<T>;
|
|
308
310
|
}
|
|
311
|
+
/** A value known only at boot (ADR-0062): its real value at deploy is a `Pointer<T>`, which names the variable on the platform that the service reads at boot. */
|
|
312
|
+
type RuntimeValue<T> = Value<Pointer<T>>;
|
|
309
313
|
/** Plain data: what a `resolve()` function may return. */
|
|
310
314
|
type PlainData = string | number | boolean | null | readonly PlainData[] | {
|
|
311
315
|
readonly [key: string]: PlainData;
|
|
@@ -351,7 +355,7 @@ type NotModuleInput = {
|
|
|
351
355
|
//#region src/node.d.ts
|
|
352
356
|
declare const NODE: unique symbol;
|
|
353
357
|
declare const SECRET_SOURCE: unique symbol;
|
|
354
|
-
/** A secret's source: a target-defined payload core forwards but never inspects. It is a value too, known only at boot; its real value at deploy is the source itself, a secret pointer. A target
|
|
358
|
+
/** A secret's source: a target-defined payload core forwards but never inspects. It is a value too, known only at boot; its real value at deploy is the source itself, a secret pointer. A target builds one with `secretSource()`. */
|
|
355
359
|
interface SecretSource<T = unknown> extends Value<unknown> {
|
|
356
360
|
readonly [SECRET_SOURCE]: true;
|
|
357
361
|
/** Target-defined. Core never reads this; the target that authored the source reads it back. */
|
|
@@ -367,14 +371,14 @@ interface ProvisionNeed<T = unknown> {
|
|
|
367
371
|
readonly payload: T;
|
|
368
372
|
}
|
|
369
373
|
declare const PARAM_SOURCE: unique symbol;
|
|
370
|
-
/** A param's source: a target-defined payload core forwards but never inspects. It is a value too
|
|
374
|
+
/** A param's source: a target-defined payload core forwards but never inspects. It is a value too, known only at boot, with the source itself as its real value: a secret pointer when it is redacted, a plain pointer otherwise. A target builds one with `paramSource()`. */
|
|
371
375
|
interface ParamSource<T = unknown> extends Value<unknown> {
|
|
372
376
|
readonly [PARAM_SOURCE]: true;
|
|
373
377
|
/** Target-defined. Core never reads this; the target that authored the source reads it back. */
|
|
374
378
|
readonly payload: T;
|
|
375
379
|
}
|
|
376
|
-
/** What `provision(service, { params })` accepts per declared param: a literal (schema-validated when config is built) or
|
|
377
|
-
type ParamBindings<P extends Params> = { readonly [K in keyof P]?: StandardSchemaV1.InferOutput<P[K]['schema']> |
|
|
380
|
+
/** What `provision(service, { params })` accepts per declared param: a literal (schema-validated when config is built) or a deploy-time value, taking precedence over `param.default`. Every entry is optional — an unbound param falls back to its `default`. */
|
|
381
|
+
type ParamBindings<P extends Params> = { readonly [K in keyof P]?: StandardSchemaV1.InferOutput<P[K]['schema']> | (StandardSchemaV1.InferOutput<P[K]['schema']> extends PlainData ? Value<StandardSchemaV1.InferOutput<P[K]['schema']>> : never); };
|
|
378
382
|
/**
|
|
379
383
|
* What `provision(node, { input })` accepts, for a module or a service, where
|
|
380
384
|
* the node's input schema expects `T` (its Standard Schema input type): the
|
|
@@ -516,8 +520,8 @@ interface AppRootContext<I extends StandardSchemaV1 | undefined = StandardSchema
|
|
|
516
520
|
readonly input: I extends StandardSchemaV1 ? ModuleInput<I> : undefined;
|
|
517
521
|
/** The deploy-time facts of the environment, each a value (ADR-0062). */
|
|
518
522
|
readonly environment: EnvironmentFacts;
|
|
519
|
-
/** Registers an owned child (resource, service or
|
|
520
|
-
readonly provision:
|
|
523
|
+
/** Registers an owned child (resource, service, module or value resource) under a stable id. */
|
|
524
|
+
readonly provision: AppRootProvision;
|
|
521
525
|
}
|
|
522
526
|
/**
|
|
523
527
|
* A module's forwarded-input value: the same ref-port shape a producer's
|
|
@@ -590,21 +594,25 @@ type ModuleProvisionOptions<D extends Deps, I extends StandardSchemaV1 | undefin
|
|
|
590
594
|
} : unknown);
|
|
591
595
|
/** The options are optional exactly when nothing is required. */
|
|
592
596
|
type ModuleProvisionArgs<D extends Deps, I extends StandardSchemaV1 | undefined> = I extends StandardSchemaV1 ? [opts: ModuleProvisionOptions<D, I>] : [keyof D] extends [never] ? [opts?: ModuleProvisionOptions<D, I>] : [opts: ModuleProvisionOptions<D, I>];
|
|
593
|
-
|
|
594
|
-
|
|
597
|
+
type ProvisionArgs<N> = N extends ValueResourceNode ? [opts?: {
|
|
598
|
+
id?: string;
|
|
599
|
+
}] : N extends ServiceNode<infer D, infer P, Expose, infer I> ? ServiceProvisionArgs<D, I, ParamBindings<P>> : N extends ModuleNode<infer D, Expose, infer I> ? ModuleProvisionArgs<D, I> : never;
|
|
595
600
|
/** The contracts a service or module node `N` exposes. */
|
|
596
601
|
type ExposeOf<N> = N extends ServiceNode<Deps, Params, infer E, StandardSchemaV1 | undefined> ? E : N extends ModuleNode<Deps, infer E, StandardSchemaV1 | undefined> ? E : never;
|
|
597
|
-
|
|
602
|
+
type OnlyInAppRoot = "Only appRoot() can provision a resource that is a value. Provision it in the app root and pass its value down through this module's input.";
|
|
603
|
+
interface SharedProvision {
|
|
598
604
|
/** Provisions an owned resource; its id defaults to the node's `name`. */
|
|
599
|
-
|
|
605
|
+
<C extends AnyContract | undefined>(resource: ResourceNode<C> & {
|
|
606
|
+
readonly [VALUE_RESOURCE]?: undefined;
|
|
607
|
+
}, opts?: {
|
|
600
608
|
id?: string;
|
|
601
609
|
}): {
|
|
602
610
|
readonly id: string;
|
|
603
611
|
} & (C extends AnyContract ? RefPort<C> : Record<never, never>);
|
|
604
|
-
/** Registers an owned service; its id defaults to the node's `name`; `deps`/`input` are required iff it declares them; a reserved param may be bound (literal or
|
|
605
|
-
|
|
612
|
+
/** Registers an owned service; its id defaults to the node's `name`; `deps`/`input` are required iff it declares them; a reserved param may be bound (literal or deploy-time value), overriding its default. */
|
|
613
|
+
<D extends Deps, P extends Params, E extends Expose, I extends StandardSchemaV1 | undefined>(service: ServiceNode<D, P, E, I>, ...args: ServiceProvisionArgs<D, I, ParamBindings<P>>): ProvisionedRef<E>;
|
|
606
614
|
/** Registers an owned child module; its id defaults to the node's `name`; `deps` and `input` are required iff it declares them. */
|
|
607
|
-
|
|
615
|
+
<D extends Deps, E extends Expose, I extends StandardSchemaV1 | undefined>(child: ModuleNode<D, E, I>, ...args: ModuleProvisionArgs<D, I>): ProvisionedRef<E>;
|
|
608
616
|
/**
|
|
609
617
|
* The service call with `deps` written out. `ServiceProvisionArgs` above
|
|
610
618
|
* cannot resolve while `D` or `I` is still an unbound type parameter — a
|
|
@@ -612,40 +620,52 @@ interface ModuleBuilder {
|
|
|
612
620
|
* that call site resolves to this overload, or to the next one for a
|
|
613
621
|
* service without an input schema.
|
|
614
622
|
*/
|
|
615
|
-
|
|
623
|
+
<D extends Deps, P extends Params, E extends Expose, I extends StandardSchemaV1 | undefined>(service: ServiceNode<D, P, E, I>, opts: {
|
|
616
624
|
id?: string;
|
|
617
625
|
deps: DepBindings<D>;
|
|
618
626
|
input: InputBindingOf<I>;
|
|
619
627
|
params?: ParamBindings<P>;
|
|
620
628
|
}): ProvisionedRef<E>;
|
|
621
|
-
|
|
629
|
+
<D extends Deps, P extends Params, E extends Expose>(service: ServiceNode<D, P, E, undefined>, opts: {
|
|
622
630
|
id?: string;
|
|
623
631
|
deps: DepBindings<D>;
|
|
624
632
|
input?: never;
|
|
625
633
|
params?: ParamBindings<P>;
|
|
626
634
|
}): ProvisionedRef<E>;
|
|
627
635
|
/** The child-module call with `deps` written out — the same generic-wrapper escape as the two service overloads above. */
|
|
628
|
-
|
|
636
|
+
<D extends Deps, E extends Expose, I extends StandardSchemaV1 | undefined>(child: ModuleNode<D, E, I>, opts: {
|
|
629
637
|
id?: string;
|
|
630
638
|
deps: DepBindings<D>;
|
|
631
639
|
input: InputBindingOf<I>;
|
|
632
640
|
}): ProvisionedRef<E>;
|
|
633
|
-
|
|
641
|
+
<D extends Deps, E extends Expose>(child: ModuleNode<D, E, undefined>, opts: {
|
|
634
642
|
id?: string;
|
|
635
643
|
deps: DepBindings<D>;
|
|
636
644
|
input?: never;
|
|
637
645
|
}): ProvisionedRef<E>;
|
|
638
|
-
/**
|
|
639
|
-
* Any service or child module. Declared last, so a call no overload accepts
|
|
640
|
-
* reports this overload's error, which names the binding key that does not
|
|
641
|
-
* fit, or says a module's whole input is not a value.
|
|
642
|
-
*/
|
|
643
|
-
provision<N extends ServiceNode | ModuleNode>(node: N, ...args: ProvisionArgs<N>): ProvisionedRef<ExposeOf<N>>;
|
|
644
646
|
}
|
|
647
|
+
type ProvisionInModule = <N extends ServiceNode | ModuleNode | ValueResourceNode>(node: N extends ValueResourceNode ? OnlyInAppRoot : N, ...args: ProvisionArgs<N>) => ProvisionedRef<ExposeOf<N>>;
|
|
648
|
+
type ProvisionValue = <V extends SourceValue>(node: ValueResourceNode<V>, opts?: {
|
|
649
|
+
readonly id?: string;
|
|
650
|
+
}) => V & {
|
|
651
|
+
readonly id: string;
|
|
652
|
+
};
|
|
653
|
+
type ProvisionInAppRoot = <N extends ServiceNode | ModuleNode | ValueResourceNode>(node: N, ...args: ProvisionArgs<N>) => ProvisionedRef<ExposeOf<N>>;
|
|
654
|
+
interface ModuleBuilder {
|
|
655
|
+
/** Registers an owned child (resource, service or module) under a stable id. */
|
|
656
|
+
readonly provision: SharedProvision & ProvisionInModule;
|
|
657
|
+
}
|
|
658
|
+
type AppRootProvision = ProvisionValue & SharedProvision & ProvisionInAppRoot;
|
|
645
659
|
/** Dependency map: name → the slot the service declares. Only declarations are admitted, never a concrete ResourceNode. */
|
|
646
660
|
type Deps = Record<string, DependencyEnd<any, any>>;
|
|
647
661
|
/** Output-port map: name → the Contract a service exposes for others to depend on. */
|
|
648
662
|
type Expose = Readonly<Record<string, AnyContract>>;
|
|
663
|
+
/** What a value resource holds: a secret source or a param source, known only at boot. */
|
|
664
|
+
type SourceValue = (SecretSource | ParamSource) & RuntimeValue<unknown>;
|
|
665
|
+
/** A resource node that is also a value. Only `provision()` in an app root's body takes its value out. It provides no contract and has no dependencies. */
|
|
666
|
+
type ValueResourceNode<V extends SourceValue = SourceValue> = ResourceNode<undefined, Record<never, never>> & {
|
|
667
|
+
readonly [VALUE_RESOURCE]: V;
|
|
668
|
+
};
|
|
649
669
|
//#endregion
|
|
650
670
|
//#region src/graph-types.d.ts
|
|
651
671
|
/** Path-derived: root-scope children are bare ids ("auth", "db"); a nested module's own children dot-join under its address ("auth.db"). */
|
|
@@ -658,15 +678,14 @@ interface RootInputField {
|
|
|
658
678
|
readonly value?: unknown;
|
|
659
679
|
}
|
|
660
680
|
/**
|
|
661
|
-
* What a Load read from the app configuration (ADR-0062).
|
|
662
|
-
*
|
|
663
|
-
*
|
|
681
|
+
* What a Load read from the app configuration (ADR-0062). A later Load takes it in place of the
|
|
682
|
+
* app configuration: `lower()` under `deploy` (on the main thread) and `prisma dev` (in its
|
|
683
|
+
* converge worker thread), and `destroy`'s second process, which reads it from the app
|
|
684
|
+
* configuration file.
|
|
664
685
|
*/
|
|
665
686
|
interface AppConfigurationRead {
|
|
666
687
|
/** Each field of the root's input that its body names, as the root's schema produced it. Empty when the root declares no input. */
|
|
667
688
|
readonly rootInput: readonly RootInputField[];
|
|
668
|
-
/** The text the app configuration holds for each configuration key a source reads, such as `envParam('NAME')`'s `NAME`. A key the app configuration does not hold, or holds as `''`, is absent. */
|
|
669
|
-
readonly configurationKeyText: Readonly<Record<string, string>>;
|
|
670
689
|
}
|
|
671
690
|
interface GraphNode {
|
|
672
691
|
readonly id: NodeId;
|
|
@@ -732,31 +751,32 @@ interface InputBindingUse {
|
|
|
732
751
|
/** The binding object supplied at provision. */
|
|
733
752
|
readonly binding: unknown;
|
|
734
753
|
}
|
|
735
|
-
/**
|
|
736
|
-
* A resolved param binding: a `provision()` call bound a service's param
|
|
737
|
-
* slot to either a literal value or an opaque `ParamSource` — the non-secret
|
|
738
|
-
* sibling of `SecretBinding`. Unlike a secret, a param binding is not
|
|
739
|
-
* required for every declared param (a param may fall back to its own
|
|
740
|
-
* `default`), so this list only carries the ones a `provision()` call
|
|
741
|
-
* actually bound.
|
|
742
|
-
*/
|
|
743
754
|
interface ParamBinding {
|
|
744
755
|
/** The graph address of the service that declares the param. */
|
|
745
756
|
readonly serviceAddress: NodeId;
|
|
746
757
|
/** The param name on that service. */
|
|
747
758
|
readonly slot: string;
|
|
748
|
-
/** A literal value
|
|
759
|
+
/** A literal value, schema-validated by `buildConfig`. */
|
|
749
760
|
readonly binding: unknown;
|
|
750
761
|
}
|
|
751
|
-
/** A secret source a binding in the graph names, wherever it sits (ADR-0029). Deploy preflight checks every one, including one in a module's input that no service receives. */
|
|
762
|
+
/** A secret source a binding in the graph names, or a secret value resource, wherever it sits (ADR-0029). Deploy preflight checks every one, including one in a module's input that no service receives. */
|
|
752
763
|
interface SecretSourceUse {
|
|
753
764
|
/** The source, as its target built it. Core never reads its payload. */
|
|
754
765
|
readonly source: SecretSource;
|
|
755
|
-
/** A service whose final binding holds it, if one does. Otherwise the module whose input holds it. */
|
|
766
|
+
/** A service whose final binding holds it, if one does. Otherwise the secret value resource itself, or the module whose input holds it. */
|
|
756
767
|
readonly address: NodeId;
|
|
757
768
|
/** That node's kind. */
|
|
758
769
|
readonly nodeKind: 'service' | 'module' | 'resource';
|
|
759
770
|
}
|
|
771
|
+
/** One service reading one value resource's value. */
|
|
772
|
+
interface ValueRead {
|
|
773
|
+
/** The service whose resolved binding holds the value. */
|
|
774
|
+
readonly reader: NodeId;
|
|
775
|
+
/** The address of the value resource. */
|
|
776
|
+
readonly resource: NodeId;
|
|
777
|
+
/** The dotted key path in the service's input binding; `''` for the whole binding. */
|
|
778
|
+
readonly path: string;
|
|
779
|
+
}
|
|
760
780
|
interface Graph {
|
|
761
781
|
readonly root: GraphNode;
|
|
762
782
|
/** Root + one per input, topo-ordered (deps first). */
|
|
@@ -768,26 +788,31 @@ interface Graph {
|
|
|
768
788
|
readonly authoredEdges: readonly AuthoredEdge[];
|
|
769
789
|
/** Every service input binding a `provision()` call supplied (ADR-0042). */
|
|
770
790
|
readonly inputBindings: readonly InputBindingUse[];
|
|
771
|
-
/** Every service param bound at provision
|
|
791
|
+
/** Every service param bound at provision; unbound params are absent here and fall back to their `default` (see `buildConfig`). */
|
|
772
792
|
readonly params: readonly ParamBinding[];
|
|
773
|
-
/** Every secret source a binding names,
|
|
793
|
+
/** Every secret source a binding names, and every secret value resource, once each (ADR-0029). */
|
|
774
794
|
readonly secretSources: readonly SecretSourceUse[];
|
|
795
|
+
/** Each service that reads a value resource's value, and where in its binding it reads it. */
|
|
796
|
+
readonly valueReads: readonly ValueRead[];
|
|
775
797
|
/** What this Load read from the app configuration (ADR-0062). Empty when Load was given none. */
|
|
776
798
|
readonly appConfigurationRead: AppConfigurationRead;
|
|
777
799
|
}
|
|
778
800
|
//#endregion
|
|
779
|
-
//#region ../../0-framework/1-core/core/dist/app-config-
|
|
780
|
-
//#region src/
|
|
801
|
+
//#region ../../0-framework/1-core/core/dist/app-config-DriAu5RU.d.mts
|
|
802
|
+
//#region src/caller-credentials.d.ts
|
|
781
803
|
/**
|
|
782
|
-
*
|
|
783
|
-
*
|
|
784
|
-
*
|
|
785
|
-
* from scratch and needs those containers back — and env vars are the only
|
|
786
|
-
* channel between the two. So the CLI writes each instance's `serialize()`
|
|
787
|
-
* output into one env var per extension, and in the alchemy process
|
|
788
|
-
* `deserializeContainers` reads each var back through the same extension's
|
|
789
|
-
* descriptor. The framework owns the vars; it never reads their contents.
|
|
804
|
+
* What the caller has already authenticated, handed unchanged to every
|
|
805
|
+
* extension hook that talks to the platform. `C` is the extension's own client
|
|
806
|
+
* type: this module cannot import a platform SDK.
|
|
790
807
|
*/
|
|
808
|
+
interface CallerCredentials<C = unknown> {
|
|
809
|
+
/** The workspace the caller acts in. `undefined` when the caller has no workspace to name — the extension decides whether it can proceed. */
|
|
810
|
+
readonly workspaceId: string | undefined;
|
|
811
|
+
/** An already-authenticated platform API client. Present means the extension must not build its own from the environment. */
|
|
812
|
+
readonly client?: C | undefined;
|
|
813
|
+
}
|
|
814
|
+
//#endregion
|
|
815
|
+
//#region src/container-transport.d.ts
|
|
791
816
|
/** The key an extension resolves a container from: which app, which environment. */
|
|
792
817
|
interface LocateContainerInput {
|
|
793
818
|
/** The application name (root node's name, or `--name`). */
|
|
@@ -807,25 +832,6 @@ interface ContainerInstance {
|
|
|
807
832
|
/** Serialize to a non-empty string for the process transport above. The format is the extension's own; only its `deserialize` reads it. */
|
|
808
833
|
serialize(): string;
|
|
809
834
|
}
|
|
810
|
-
/**
|
|
811
|
-
* What the caller has already authenticated, handed to one container
|
|
812
|
-
* lifecycle call. A caller that holds neither omits the argument, and the
|
|
813
|
-
* extension falls back to whatever credential protocol it defines for
|
|
814
|
-
* itself (for Prisma Cloud, its env vars — which is how the alchemy child
|
|
815
|
-
* process still resolves containers).
|
|
816
|
-
*
|
|
817
|
-
* `C` is the extension's own platform-client type, left as a type parameter
|
|
818
|
-
* because this shared-plane module must not import a platform SDK; the
|
|
819
|
-
* framework only carries the value, never calls it. The framework stores the
|
|
820
|
-
* erased `C = unknown` form and the extension recovers its concrete client
|
|
821
|
-
* through the same method bivariance that erases `I` below.
|
|
822
|
-
*/
|
|
823
|
-
interface ContainerCredentials<C = unknown> {
|
|
824
|
-
/** The workspace the container lives in. `undefined` when the caller has no workspace to name — the extension decides whether it can proceed. */
|
|
825
|
-
readonly workspaceId: string | undefined;
|
|
826
|
-
/** An already-authenticated platform API client. Present means the extension must not build its own from the environment. */
|
|
827
|
-
readonly client?: C | undefined;
|
|
828
|
-
}
|
|
829
835
|
/**
|
|
830
836
|
* The platform containers an app deploys into, as one lifecycle. `I` is
|
|
831
837
|
* the extension's own instance type — the same descriptor produces and
|
|
@@ -838,11 +844,11 @@ interface ContainerCredentials<C = unknown> {
|
|
|
838
844
|
*/
|
|
839
845
|
interface ContainerDescriptor<I extends ContainerInstance = ContainerInstance, C = unknown> {
|
|
840
846
|
/** Resolve the container for (appName, environment), creating anything absent. Called by `deploy`. */
|
|
841
|
-
ensure(input: LocateContainerInput, credentials?:
|
|
847
|
+
ensure(input: LocateContainerInput, credentials?: CallerCredentials<C>): Promise<I>;
|
|
842
848
|
/** Find the container for (appName, environment); `undefined` when nothing exists. Called by `destroy` — never creates. */
|
|
843
|
-
locate(input: LocateContainerInput, credentials?:
|
|
849
|
+
locate(input: LocateContainerInput, credentials?: CallerCredentials<C>): Promise<I | undefined>;
|
|
844
850
|
/** Remove the container after a successful destroy, after every extension's `teardown` has run. Failure policy is the extension's. */
|
|
845
|
-
remove(instance: I, credentials?:
|
|
851
|
+
remove(instance: I, credentials?: CallerCredentials<C>): Promise<void>;
|
|
846
852
|
/** Reconstruct an instance from its own `serialize()` output — the far end of the framework's parent→child transport. */
|
|
847
853
|
deserialize(serialized: string): I;
|
|
848
854
|
}
|
|
@@ -850,19 +856,14 @@ interface ContainerDescriptor<I extends ContainerInstance = ContainerInstance, C
|
|
|
850
856
|
//#region src/preflight-transport.d.ts
|
|
851
857
|
/** A string only this extension reads back, or `undefined` when it has nothing to carry. */
|
|
852
858
|
type PreflightPayload = string | undefined;
|
|
853
|
-
/** Where a platform variable is named: a service's input field,
|
|
859
|
+
/** Where a platform variable is named: a service's input field, or a resource no service reads. */
|
|
854
860
|
type PlatformVariableReader = {
|
|
855
861
|
readonly kind: 'field';
|
|
856
862
|
readonly service: string;
|
|
857
863
|
readonly path: string;
|
|
858
|
-
} | {
|
|
859
|
-
readonly kind: 'param';
|
|
860
|
-
readonly service: string;
|
|
861
|
-
readonly param: string;
|
|
862
864
|
} | {
|
|
863
865
|
readonly kind: 'unread';
|
|
864
866
|
readonly node: string;
|
|
865
|
-
readonly nodeKind: 'module' | 'resource';
|
|
866
867
|
};
|
|
867
868
|
/** A platform variable with no value that nothing requires, with its readers and the commands that set it. */
|
|
868
869
|
interface UnsetPlatformVariable {
|
|
@@ -911,7 +912,7 @@ interface ProvisionerDescriptor {
|
|
|
911
912
|
/**
|
|
912
913
|
* The phased service SPI. `P` and `S` are the descriptor's OWN intra-node
|
|
913
914
|
* handoff types — provision's product consumed by serialize/deploy, and
|
|
914
|
-
* serialize's product consumed by deploy. Core threads them through without
|
|
915
|
+
* serialize's product consumed by package/deploy. Core threads them through without
|
|
915
916
|
* inspection; only the descriptor that writes them reads them.
|
|
916
917
|
*
|
|
917
918
|
* Method syntax (not property-arrow) is required: the heterogeneous
|
|
@@ -935,9 +936,10 @@ interface ServiceLowering<P = unknown, S = unknown> {
|
|
|
935
936
|
/**
|
|
936
937
|
* Prints the bootstrap and assembles the deployable artifact from the
|
|
937
938
|
* app-built bundle. Must be byte-deterministic: an unchanged service noops
|
|
938
|
-
* on redeploy.
|
|
939
|
+
* on redeploy. `serialized` is this service's `serialize` product. It must
|
|
940
|
+
* not write a secret, or a value the deploy has not resolved, into the artifact.
|
|
939
941
|
*/
|
|
940
|
-
package(ctx: LowerContext, input: PackageInput): Effect.Effect<Artifact, unknown, unknown>;
|
|
942
|
+
package(ctx: LowerContext, input: PackageInput, serialized: S): Effect.Effect<Artifact, unknown, unknown>;
|
|
941
943
|
/** Ships the packaged artifact into the provisioned thing and runs it. Returns the node's outputs for dependents, plus the entities it became on the deployment target. */
|
|
942
944
|
deploy(ctx: LowerContext, provisioned: P, artifact: Artifact, serialized: S): Effect.Effect<LoweredResult, unknown, unknown>;
|
|
943
945
|
/**
|
|
@@ -974,12 +976,13 @@ interface LowerContext {
|
|
|
974
976
|
*/
|
|
975
977
|
readonly application: unknown;
|
|
976
978
|
/**
|
|
977
|
-
* The owning extension's resolved container
|
|
978
|
-
*
|
|
979
|
-
*
|
|
980
|
-
* container descriptor.
|
|
979
|
+
* The owning extension's resolved container; core never reads it — the
|
|
980
|
+
* extension narrows it with its own type guard. `undefined` when the
|
|
981
|
+
* extension declares no container descriptor.
|
|
981
982
|
*/
|
|
982
983
|
readonly container: ContainerInstance | undefined;
|
|
984
|
+
/** What the owning extension's preflight handed back this run; `undefined` when it returned nothing or ran no preflight. Core never reads it. */
|
|
985
|
+
readonly preflight: PreflightPayload;
|
|
983
986
|
/** Already-lowered deps (topo order). */
|
|
984
987
|
readonly lowered: ReadonlyMap<NodeId, Outputs>;
|
|
985
988
|
/** Every provisioned param value minted this lowering, keyed by edge id (ADR-0031). */
|
|
@@ -1045,16 +1048,16 @@ interface DeploymentResult {
|
|
|
1045
1048
|
interface LowerOptions {
|
|
1046
1049
|
/** Stack + root node id. */
|
|
1047
1050
|
readonly name: string;
|
|
1048
|
-
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`;
|
|
1051
|
+
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; every caller passes it. */
|
|
1049
1052
|
readonly environment?: string;
|
|
1050
|
-
/** What the
|
|
1053
|
+
/** What the caller's Load read from the app configuration (ADR-0062). Load takes the root's input from it. */
|
|
1051
1054
|
readonly appConfigurationRead?: AppConfigurationRead;
|
|
1052
|
-
/** The node addresses of the graph the
|
|
1055
|
+
/** The node addresses of the graph the caller built. When given, lowering refuses a graph whose addresses differ. */
|
|
1053
1056
|
readonly firstProcessNodeAddresses?: readonly string[];
|
|
1054
1057
|
readonly bundles: Record<string, Bundle>;
|
|
1055
1058
|
/** Alchemy state store for the stack. Defaults to the config's own state layer. */
|
|
1056
1059
|
readonly state?: AlchemyStateLayer;
|
|
1057
|
-
/** Explicit provider set for the stack. Defaults to the config's own merged `providers()` (`mergedProviders`) — the same override precedence as `state`.
|
|
1060
|
+
/** Explicit provider set for the stack. Defaults to the config's own merged `providers()` (`mergedProviders`) — the same override precedence as `state`. `prisma dev` passes `localTargetProviders(...)` here (ADR-0041); `lower()` itself learns nothing about the local target. */
|
|
1058
1061
|
readonly providers?: Layer.Layer<never>;
|
|
1059
1062
|
/**
|
|
1060
1063
|
* Invoked once per deploy, during apply, with the Deploy operation's result
|
|
@@ -1064,8 +1067,16 @@ interface LowerOptions {
|
|
|
1064
1067
|
* declared at all.
|
|
1065
1068
|
*/
|
|
1066
1069
|
readonly report?: (result: DeploymentResult) => void;
|
|
1067
|
-
/** Addresses lowered without an artifact: `package` and `deploy` are skipped and `reserve` runs instead (ADR-0056). Only
|
|
1070
|
+
/** Addresses lowered without an artifact: `package` and `deploy` are skipped and `reserve` runs instead (ADR-0056). Only `prisma dev` sets it. */
|
|
1068
1071
|
readonly unassembled?: readonly string[];
|
|
1072
|
+
/** Each extension's resolved container, by extension id. Pass both `containers` and `preflightPayloads`, or neither. When both are absent, `lower()` reads both from the environment transports through `transportedLowerInputs(config)`. When exactly one is passed, `lower()` throws. */
|
|
1073
|
+
readonly containers?: ReadonlyMap<string, ContainerInstance> | undefined;
|
|
1074
|
+
/** What each extension's preflight returned, by extension id. Each lowering context gets its own extension's entry as `LowerContext.preflight`. */
|
|
1075
|
+
readonly preflightPayloads?: ReadonlyMap<string, string> | undefined;
|
|
1076
|
+
/** The platform variables with no value that the deploy preflight found. The deploy report carries them. Absent means none. */
|
|
1077
|
+
readonly findings?: PreflightFindings;
|
|
1078
|
+
/** What the caller already authenticated, handed to every extension's `providers()` and to the state descriptor's `create()`. Absent means each extension falls back to its own credential protocol. */
|
|
1079
|
+
readonly credentials?: CallerCredentials | undefined;
|
|
1069
1080
|
}
|
|
1070
1081
|
/** A build descriptor's normalized output: the produced bundle dir plus the app's runnable entry within it. */
|
|
1071
1082
|
interface Bundle {
|
|
@@ -1117,6 +1128,12 @@ interface Artifact {
|
|
|
1117
1128
|
readonly path: string;
|
|
1118
1129
|
readonly sha256: string;
|
|
1119
1130
|
}
|
|
1131
|
+
/**
|
|
1132
|
+
* The whole-stack wrapper: Load → route each node through the config's
|
|
1133
|
+
* extension registries → an Alchemy Stack, which `deploy` hands to
|
|
1134
|
+
* `Alchemist.plan` and a generated stack file exports for the alchemy CLI.
|
|
1135
|
+
*/
|
|
1136
|
+
declare function lower(root: ModuleNode | AppRootNode, config: PrismaAppConfig, opts: LowerOptions): Alchemy.ConfiguredStack<undefined, never>;
|
|
1120
1137
|
//#endregion
|
|
1121
1138
|
//#region src/control/app-config.d.ts
|
|
1122
1139
|
/**
|
|
@@ -1133,8 +1150,11 @@ interface ExtensionDescriptor {
|
|
|
1133
1150
|
readonly provisions?: ReadonlyMap<symbol, ProvisionerDescriptor>;
|
|
1134
1151
|
/** Once-per-lowering hook — the application's shared infrastructure (e.g. prisma-cloud's Project). */
|
|
1135
1152
|
readonly application?: ApplicationDescriptor;
|
|
1136
|
-
/**
|
|
1137
|
-
|
|
1153
|
+
/**
|
|
1154
|
+
* The extension's Alchemy providers — merged across all configured extensions (config order).
|
|
1155
|
+
* METHOD SYNTAX REQUIRED, like `preflight`: an extension types `input` against its own client, which assigns here only through method bivariance.
|
|
1156
|
+
*/
|
|
1157
|
+
providers?(input: ProvidersInput): Layer.Layer<never>;
|
|
1138
1158
|
/** Refuses a loaded graph this extension cannot deploy by throwing `GraphCheckError`. The CLI calls it right after Load in every command that runs Load. Any other throw is a bug. */
|
|
1139
1159
|
readonly checkGraph?: (graph: Graph) => void;
|
|
1140
1160
|
/**
|
|
@@ -1144,10 +1164,10 @@ interface ExtensionDescriptor {
|
|
|
1144
1164
|
* platform variable a service needs has a value) and throws to abort the
|
|
1145
1165
|
* deploy. Async: it talks to the platform (ADR-0064).
|
|
1146
1166
|
*
|
|
1147
|
-
* What it returns
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1167
|
+
* What it returns reaches this same extension's lowering as
|
|
1168
|
+
* `LowerContext.preflight`: as a value under `deploy` and `prisma dev`, and
|
|
1169
|
+
* through the environment (preflight-transport.ts) for `destroy`'s alchemy
|
|
1170
|
+
* child, which re-imports the config from scratch. The payload
|
|
1151
1171
|
* is the extension's own opaque string; the framework never reads it, and a
|
|
1152
1172
|
* secret value must never go in it. What it hands `input.report` reaches the
|
|
1153
1173
|
* deploy report through the framework's own transport, not this payload.
|
|
@@ -1202,10 +1222,15 @@ interface ExtensionDescriptor {
|
|
|
1202
1222
|
interface StateDescriptor {
|
|
1203
1223
|
/** The owning extension's id — matched against `ExtensionDescriptor.id`. */
|
|
1204
1224
|
readonly extension: string;
|
|
1205
|
-
/** Build the state layer. `container` is the owning extension's resolved instance; `undefined` when it declared no container descriptor. */
|
|
1206
|
-
create(container: ContainerInstance | undefined): AlchemyStateLayer;
|
|
1225
|
+
/** Build the state layer. `container` is the owning extension's resolved instance; `undefined` when it declared no container descriptor. `credentials` is as `ExtensionDescriptor.providers` receives it. */
|
|
1226
|
+
create(container: ContainerInstance | undefined, credentials?: CallerCredentials): AlchemyStateLayer;
|
|
1207
1227
|
}
|
|
1208
|
-
/**
|
|
1228
|
+
/** What `ExtensionDescriptor.providers` receives. `C` erases to `unknown` at the framework boundary, exactly as on `PreflightInput`. */
|
|
1229
|
+
interface ProvidersInput<C = unknown> {
|
|
1230
|
+
/** What the caller already authenticated (`LowerOptions.credentials`). Absent means the extension falls back to its own credential protocol. */
|
|
1231
|
+
readonly credentials?: CallerCredentials<C> | undefined;
|
|
1232
|
+
}
|
|
1233
|
+
/** The resolved deploy context handed to an extension's `preflight` hook. `C` erases to `unknown` at the framework boundary — see CallerCredentials. */
|
|
1209
1234
|
interface PreflightInput<C = unknown> {
|
|
1210
1235
|
/** The loaded application graph — the manifest of prerequisites is read from it (`provisionManifest`). */
|
|
1211
1236
|
readonly graph: Graph;
|
|
@@ -1218,7 +1243,7 @@ interface PreflightInput<C = unknown> {
|
|
|
1218
1243
|
/** The app secrets the command read for this environment. */
|
|
1219
1244
|
readonly secrets: AppSecrets;
|
|
1220
1245
|
/** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
|
|
1221
|
-
readonly credentials?:
|
|
1246
|
+
readonly credentials?: CallerCredentials<C> | undefined;
|
|
1222
1247
|
/** Hands the deploy how many platform variables the check read and which have no value. */
|
|
1223
1248
|
readonly report?: ((check: PlatformVariableCheck) => void) | undefined;
|
|
1224
1249
|
/** Shows the user a warning that does not stop the run. Only `prisma dev` passes it and shows the warnings; deploy passes none. */
|
|
@@ -1263,7 +1288,7 @@ interface ReportBeginInput<C = unknown> {
|
|
|
1263
1288
|
*/
|
|
1264
1289
|
readonly reportId: string | undefined;
|
|
1265
1290
|
/** What the caller has already authenticated, exactly as `preflight` and the container lifecycle receive it. Present means the reporter must not build a client from the environment. */
|
|
1266
|
-
readonly credentials?:
|
|
1291
|
+
readonly credentials?: CallerCredentials<C> | undefined;
|
|
1267
1292
|
}
|
|
1268
1293
|
/** The deploy context handed to `RunReporter.attach`, once containers exist. */
|
|
1269
1294
|
interface ReportAttachInput {
|
|
@@ -1330,8 +1355,8 @@ interface LocalTargetDescriptor {
|
|
|
1330
1355
|
providers(input: LocalTargetProvidersInput): Layer.Layer<never>;
|
|
1331
1356
|
/** A stable local identity — resolved without any platform call. */
|
|
1332
1357
|
readonly container: ContainerDescriptor;
|
|
1333
|
-
/**
|
|
1334
|
-
preflight?(input: PreflightInput): Promise<
|
|
1358
|
+
/** Works out the platform variables' values, where deploy's preflight runs. Its payload reaches the alchemy process the same way deploy's preflight payload does. */
|
|
1359
|
+
preflight?(input: PreflightInput): Promise<DevPreflightResult>;
|
|
1335
1360
|
/** Ensure the emulator daemons this topology's node kinds need are running, plus any per-node emulator state that must exist before converge (idempotent; daemons persist across sessions). */
|
|
1336
1361
|
emulators?(input: LocalTargetEmulatorsInput): Promise<void>;
|
|
1337
1362
|
/** The dev session's view of the running app. Core renders it and never learns an emulator's API. */
|
|
@@ -1346,6 +1371,12 @@ interface LocalTargetDescriptor {
|
|
|
1346
1371
|
*/
|
|
1347
1372
|
current?(input: LocalTargetCurrentInput): Promise<LocalTargetCurrentApp | undefined>;
|
|
1348
1373
|
}
|
|
1374
|
+
/** What a local target's preflight found. */
|
|
1375
|
+
interface DevPreflightResult {
|
|
1376
|
+
readonly payload: PreflightPayload;
|
|
1377
|
+
/** The text of each plain platform variable a service reads, by name. Never a secret. */
|
|
1378
|
+
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
1379
|
+
}
|
|
1349
1380
|
interface LocalTargetCurrentInput {
|
|
1350
1381
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1351
1382
|
readonly devDir: string;
|
|
@@ -1398,9 +1429,9 @@ interface LocalTargetProvidersInput {
|
|
|
1398
1429
|
readonly container: ContainerInstance | undefined;
|
|
1399
1430
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1400
1431
|
readonly devDir: string;
|
|
1401
|
-
/** The text of each
|
|
1402
|
-
readonly
|
|
1403
|
-
/** The app secrets the graph's
|
|
1432
|
+
/** The text of each plain platform variable a service reads, by name. Never a secret. */
|
|
1433
|
+
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
1434
|
+
/** The app secrets the graph's platform secrets name, which `prisma dev` hands its converge worker thread in memory. A local deployment takes the text its secret `$platform` markers name from it. */
|
|
1404
1435
|
readonly namedSecrets: NamedSecrets;
|
|
1405
1436
|
}
|
|
1406
1437
|
interface LocalTargetEmulatorsInput {
|
|
@@ -1486,11 +1517,11 @@ interface ConfigAdapterInput {
|
|
|
1486
1517
|
type ConfigValues = Readonly<Record<string, unknown>>;
|
|
1487
1518
|
/** A function in the `config` or `secrets` list of the `composer` section (ADR-0062): it receives the environment and returns that environment's values. Only the command's first process calls it; the second process reads what the first read from the app configuration file. */
|
|
1488
1519
|
type ConfigAdapter = (input: ConfigAdapterInput) => ConfigValues | Promise<ConfigValues>;
|
|
1489
|
-
/** The app configuration (ADR-0062): what the `config` adapters return, merged by top-level key, a later adapter winning. It is the root's input, and
|
|
1520
|
+
/** The app configuration (ADR-0062): what the `config` adapters return, merged by top-level key, a later adapter winning. It is the root's input, and under `prisma dev` it also holds the text of each plain platform variable. */
|
|
1490
1521
|
type AppConfiguration = Readonly<Record<string, unknown>>;
|
|
1491
|
-
/** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text. Nothing fills a platform variable from them. `prisma dev` hands
|
|
1522
|
+
/** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text. Nothing fills a platform variable from them. `prisma dev` hands the local target's providers the values under the secrets keys of the graph's secret sources, and Composer redacts those values wherever it prints. */
|
|
1492
1523
|
type AppSecrets = Readonly<Record<string, string>>;
|
|
1493
|
-
/** The app secrets under the secrets keys of the graph's secret sources, each with text. `prisma dev`
|
|
1524
|
+
/** The app secrets under the secrets keys of the graph's secret sources, each with text. `prisma dev` hands them to the local target's providers, in memory. */
|
|
1494
1525
|
type NamedSecrets = Readonly<Record<string, string>>;
|
|
1495
1526
|
/**
|
|
1496
1527
|
* The config file's default export. `extensions` lists every extension the
|
|
@@ -1509,15 +1540,75 @@ interface PrismaAppConfig {
|
|
|
1509
1540
|
readonly secrets?: readonly ConfigAdapter[];
|
|
1510
1541
|
}
|
|
1511
1542
|
//#endregion
|
|
1512
|
-
//#region ../../0-framework/3-tooling/
|
|
1543
|
+
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-6LgQDUuu.d.mts
|
|
1544
|
+
//#region src/deployment-summary.d.ts
|
|
1545
|
+
/** The serializable projection of DeploymentResult — what CAN cross the process
|
|
1546
|
+
* boundary. Writer (report hook) and reader (deploy operation) share this shape. */
|
|
1547
|
+
interface DeployedNodeSummary {
|
|
1548
|
+
readonly address: string;
|
|
1549
|
+
readonly entities: readonly DeployedEntity[];
|
|
1550
|
+
}
|
|
1551
|
+
interface DeploymentSummary {
|
|
1552
|
+
readonly app: string;
|
|
1553
|
+
readonly nodes: readonly DeployedNodeSummary[];
|
|
1554
|
+
/** The platform variables with no value that the deploy preflight found. */
|
|
1555
|
+
readonly findings: PreflightFindings;
|
|
1556
|
+
}
|
|
1513
1557
|
//#endregion
|
|
1514
|
-
//#region
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1558
|
+
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-CTomEXaD.d.mts
|
|
1559
|
+
//#region src/converge-in-process.d.ts
|
|
1560
|
+
/** What `lower()` returns: the stack value `Alchemist.plan` takes. */
|
|
1561
|
+
type LoweredStack = ReturnType<typeof lower>;
|
|
1562
|
+
/** Where a resource is in its apply. `pending` is planned but not yet touched. */
|
|
1563
|
+
type ResourcePhase = 'pending' | 'running' | 'done' | 'failed';
|
|
1564
|
+
type ConvergeEvent = {
|
|
1565
|
+
readonly kind: 'resource';
|
|
1566
|
+
readonly fqn: string;
|
|
1567
|
+
readonly resourceType: string;
|
|
1568
|
+
/** Alchemy's own status word, such as `creating` or `updated`. */
|
|
1569
|
+
readonly status: string;
|
|
1570
|
+
readonly phase: ResourcePhase;
|
|
1571
|
+
readonly message?: string | undefined;
|
|
1572
|
+
} | {
|
|
1573
|
+
readonly kind: 'log';
|
|
1574
|
+
readonly severity: 'info' | 'warn' | 'verbose';
|
|
1575
|
+
readonly text: string;
|
|
1576
|
+
};
|
|
1577
|
+
interface ConvergeRequest {
|
|
1578
|
+
readonly operation: 'deploy';
|
|
1579
|
+
readonly stack: LoweredStack;
|
|
1580
|
+
readonly stage: string;
|
|
1581
|
+
/** The directory Alchemy runs in: where it reads `.env` and keeps `.alchemy`. */
|
|
1582
|
+
readonly cwd: string;
|
|
1583
|
+
/** Set in `process.env` while Alchemy plans and applies, and restored after; `undefined` removes the variable for that time. Alchemy reads its configuration only from there. */
|
|
1584
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
1585
|
+
readonly signal?: AbortSignal | undefined;
|
|
1586
|
+
readonly onEvent?: ((event: ConvergeEvent) => void) | undefined;
|
|
1587
|
+
/** Receives what Alchemy writes to the terminal itself. A throw from it is ignored. Absent means stderr. */
|
|
1588
|
+
readonly output?: ((text: string) => void) | undefined;
|
|
1589
|
+
}
|
|
1590
|
+
/** One error a failed converge ended with: the error's tag or class name, and its message. */
|
|
1591
|
+
interface ConvergeFailureReason {
|
|
1592
|
+
readonly tag: string;
|
|
1593
|
+
readonly message: string;
|
|
1520
1594
|
}
|
|
1595
|
+
type ConvergeOutcome = {
|
|
1596
|
+
readonly kind: 'applied';
|
|
1597
|
+
} | {
|
|
1598
|
+
readonly kind: 'interrupted';
|
|
1599
|
+
} | {
|
|
1600
|
+
readonly kind: 'failed';
|
|
1601
|
+
readonly reasons: readonly ConvergeFailureReason[];
|
|
1602
|
+
} |
|
|
1603
|
+
/** Nothing ran: another converge holds this process's environment and working directory, or this is a worker thread that cannot change directory. */
|
|
1604
|
+
{
|
|
1605
|
+
readonly kind: 'refused';
|
|
1606
|
+
readonly reason: 'already-running' | 'worker-thread';
|
|
1607
|
+
};
|
|
1608
|
+
/** Plans and applies a lowered stack. The deploy executor's default is {@link convergeInProcess}. */
|
|
1609
|
+
type Converge = (request: ConvergeRequest) => Promise<ConvergeOutcome>;
|
|
1610
|
+
//#endregion
|
|
1611
|
+
//#region ../../0-framework/3-tooling/assemble/dist/index.d.mts
|
|
1521
1612
|
/** What a build adapter measured during one assemble, for progress output. Never read here. */
|
|
1522
1613
|
type AssembleReport = (data: Readonly<Record<string, string | number>>) => void;
|
|
1523
1614
|
/** Assembles one service node — the seam tests substitute to avoid a real build. */
|
|
@@ -1551,7 +1642,19 @@ interface NotOk<F> {
|
|
|
1551
1642
|
*/
|
|
1552
1643
|
type Result$1<T, F> = Ok<T> | NotOk<F>;
|
|
1553
1644
|
//#endregion
|
|
1554
|
-
//#region ../../0-framework/
|
|
1645
|
+
//#region ../../0-framework/1-core/core/dist/local-target.d.mts
|
|
1646
|
+
/**
|
|
1647
|
+
* All configured extensions' local-target providers merged, config array
|
|
1648
|
+
* order (ADR-0041), from the ALREADY-RESOLVED descriptor map
|
|
1649
|
+
* (`resolveLocalTargets`'s product — this function itself never touches a
|
|
1650
|
+
* `localTarget` thunk). `prisma dev`'s converge worker thread is this
|
|
1651
|
+
* aggregator's one caller, passing the result as `LowerOptions.providers`.
|
|
1652
|
+
*/
|
|
1653
|
+
declare function localTargetProviders(resolved: ReadonlyMap<string, LocalTargetDescriptor>, containers: ReadonlyMap<string, ContainerInstance>, devDir: string, plainVariableText: Readonly<Record<string, string>>, namedSecrets: NamedSecrets): Layer.Layer<never>;
|
|
1654
|
+
/** The state store `prisma dev` converges against: Alchemy's file store in the app's working directory. */
|
|
1655
|
+
declare function devState(): AlchemyStateLayer;
|
|
1656
|
+
//#endregion
|
|
1657
|
+
//#region ../../0-framework/3-tooling/cli/dist/redaction-Dn7BRdaP.d.mts
|
|
1555
1658
|
//#region src/composer-config.d.ts
|
|
1556
1659
|
/** Composer's configuration and the `prisma.config.ts` that declares it. */
|
|
1557
1660
|
interface ComposerConfigSource {
|
|
@@ -1561,6 +1664,15 @@ interface ComposerConfigSource {
|
|
|
1561
1664
|
readonly file: string;
|
|
1562
1665
|
}
|
|
1563
1666
|
//#endregion
|
|
1667
|
+
//#region src/app-converge.d.ts
|
|
1668
|
+
/** The app install's `lower`, its converge (`convergeInProcess`), and the local target's providers and state store for `prisma dev`. */
|
|
1669
|
+
interface AppConvergeEntry {
|
|
1670
|
+
readonly lower: typeof lower;
|
|
1671
|
+
readonly converge: Converge;
|
|
1672
|
+
readonly localTargetProviders: typeof localTargetProviders;
|
|
1673
|
+
readonly devState: typeof devState;
|
|
1674
|
+
}
|
|
1675
|
+
//#endregion
|
|
1564
1676
|
//#region src/dev/watch.d.ts
|
|
1565
1677
|
interface WatchTarget {
|
|
1566
1678
|
readonly address: string;
|
|
@@ -1583,7 +1695,9 @@ interface WatchHandle {
|
|
|
1583
1695
|
* watched file; proven by the delete-recreate test failing on Linux CI
|
|
1584
1696
|
* only). Directory targets are watched recursively as themselves; a
|
|
1585
1697
|
* nonexistent path is treated as a file target, so it starts reporting the
|
|
1586
|
-
* moment something creates it.
|
|
1698
|
+
* moment something creates it. A file whose directory does not exist yet is
|
|
1699
|
+
* watched through its nearest existing ancestor, following only the
|
|
1700
|
+
* directories on the way to it.
|
|
1587
1701
|
*/
|
|
1588
1702
|
declare function startWatch(targets: readonly WatchTarget[], onChange: () => void, onError?: (error: unknown) => void): WatchHandle;
|
|
1589
1703
|
//#endregion
|
|
@@ -1606,7 +1720,7 @@ interface AlchemyInvocation {
|
|
|
1606
1720
|
readonly cwd: string;
|
|
1607
1721
|
readonly stage: string;
|
|
1608
1722
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
1609
|
-
/** The known secrets and the credential-looking values, for `spawnAlchemy`'s stream redactor
|
|
1723
|
+
/** The known secrets and the credential-looking values, for `spawnAlchemy`'s stream redactor. Never in `env` or on the command line, which the engine may log. */
|
|
1610
1724
|
readonly redactedValues: readonly string[];
|
|
1611
1725
|
}
|
|
1612
1726
|
/** The command line an invocation becomes, once a binary has been resolved. */
|
|
@@ -1629,12 +1743,82 @@ interface AlchemyOutcome {
|
|
|
1629
1743
|
/** The command line the adapter started, when it can say; failures print it as the reproduce command. */
|
|
1630
1744
|
readonly commandLine?: AlchemyCommandLine;
|
|
1631
1745
|
}
|
|
1632
|
-
/** Starts the converge and resolves when it ends
|
|
1633
|
-
* by `ctx.spawn`, which gives the child the terminal and does not redact its
|
|
1634
|
-
* output; hosts get `spawnAlchemy`, which pipes the output through the stream
|
|
1635
|
-
* redactor (ADR-0062). */
|
|
1746
|
+
/** Starts the converge and resolves when it ends; `spawnAlchemy` by default. */
|
|
1636
1747
|
type RunAlchemy = (invocation: AlchemyInvocation) => Promise<AlchemyOutcome>;
|
|
1637
1748
|
//#endregion
|
|
1749
|
+
//#region src/dev/value-reads-change.d.ts
|
|
1750
|
+
/** A graph's value reads and the props of each value resource they read, as data a worker thread can receive. */
|
|
1751
|
+
interface ValueReadsSnapshot {
|
|
1752
|
+
readonly reads: readonly ValueRead[];
|
|
1753
|
+
readonly props: Readonly<Record<string, unknown>>;
|
|
1754
|
+
}
|
|
1755
|
+
interface ValueReadsChange {
|
|
1756
|
+
readonly added: readonly string[];
|
|
1757
|
+
readonly removed: readonly string[];
|
|
1758
|
+
readonly changed: readonly string[];
|
|
1759
|
+
}
|
|
1760
|
+
//#endregion
|
|
1761
|
+
//#region src/operations/dev-converge.d.ts
|
|
1762
|
+
/** Everything a dev converge needs from the session, as data a worker thread can receive. */
|
|
1763
|
+
interface DevConvergeJob {
|
|
1764
|
+
/** The `prisma.config.ts` that declares the `composer` section. Absolute. */
|
|
1765
|
+
readonly configFile: string;
|
|
1766
|
+
/** The entry module. Absolute. */
|
|
1767
|
+
readonly entry: string;
|
|
1768
|
+
/** Where the app's own `@prisma/composer` resolves from. */
|
|
1769
|
+
readonly appDir: string;
|
|
1770
|
+
readonly cwd: string;
|
|
1771
|
+
readonly name: string;
|
|
1772
|
+
readonly environment: string;
|
|
1773
|
+
readonly appConfigurationRead: AppConfigurationRead;
|
|
1774
|
+
/** Each service's assembled bundle: only the fields lowering reads. */
|
|
1775
|
+
readonly bundles: Readonly<Record<string, {
|
|
1776
|
+
readonly dir: string;
|
|
1777
|
+
readonly entry: string;
|
|
1778
|
+
}>>;
|
|
1779
|
+
readonly unassembled: readonly string[];
|
|
1780
|
+
/** Each extension's local container, as its `serialize()` text, by extension id. */
|
|
1781
|
+
readonly containers: Readonly<Record<string, string>>;
|
|
1782
|
+
readonly preflightPayloads: Readonly<Record<string, string>>;
|
|
1783
|
+
readonly devDir: string;
|
|
1784
|
+
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
1785
|
+
readonly namedSecrets: Readonly<Record<string, string>>;
|
|
1786
|
+
/** The node addresses of the graph the session started with. */
|
|
1787
|
+
readonly nodeAddresses: readonly string[];
|
|
1788
|
+
/** The value reads of the graph the session started with. */
|
|
1789
|
+
readonly valueReads: ValueReadsSnapshot;
|
|
1790
|
+
}
|
|
1791
|
+
/** Where a dev converge reports what happens while it runs. */
|
|
1792
|
+
interface DevConvergeReport {
|
|
1793
|
+
readonly onEvent: (event: ConvergeEvent) => void;
|
|
1794
|
+
/** Text written to the terminal while it runs: Alchemy's own, and anything the app's code prints. */
|
|
1795
|
+
readonly output: (text: string) => void;
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* What one dev converge came to; each variant lists the app files the converge's import loaded.
|
|
1799
|
+
* `outcome`: the converge ran, or the runner refused or ended it, to this outcome.
|
|
1800
|
+
* `error`: a structured error stopped it before it began, as its envelope.
|
|
1801
|
+
* `value-reads-changed`: the app now reads other platform variables than the session prepared
|
|
1802
|
+
* for, so nothing was converged.
|
|
1803
|
+
*/
|
|
1804
|
+
type DevConvergeResult = {
|
|
1805
|
+
readonly kind: 'outcome';
|
|
1806
|
+
readonly outcome: ConvergeOutcome;
|
|
1807
|
+
readonly appFiles: readonly string[];
|
|
1808
|
+
} | {
|
|
1809
|
+
readonly kind: 'error';
|
|
1810
|
+
readonly error: CliErrorEnvelope;
|
|
1811
|
+
/** Set when the runtime keeps the failed lookup of a directory import that would now succeed, so only a new process loads it. */
|
|
1812
|
+
readonly lookupKept?: true;
|
|
1813
|
+
readonly appFiles: readonly string[];
|
|
1814
|
+
} | {
|
|
1815
|
+
readonly kind: 'value-reads-changed';
|
|
1816
|
+
readonly change: ValueReadsChange;
|
|
1817
|
+
readonly appFiles: readonly string[];
|
|
1818
|
+
};
|
|
1819
|
+
/** Runs one dev converge and reports its events. Never rejects: every failure is a result. */
|
|
1820
|
+
type RunDevConverge = (job: DevConvergeJob, report: DevConvergeReport, signal?: AbortSignal) => Promise<DevConvergeResult>;
|
|
1821
|
+
//#endregion
|
|
1638
1822
|
//#region src/operations/shared.d.ts
|
|
1639
1823
|
/** A running service's dotted address plus its local URL — what `dev` reports
|
|
1640
1824
|
* as the front door and `log` reports as the tailable services. */
|
|
@@ -1646,18 +1830,20 @@ interface ServiceEndpoint {
|
|
|
1646
1830
|
}
|
|
1647
1831
|
/**
|
|
1648
1832
|
* The operations' in-package injection seam — lets the CLI's own tests drive
|
|
1649
|
-
* them without a real wrapper build or alchemy process.
|
|
1833
|
+
* them without a real wrapper build, Alchemy converge or alchemy process.
|
|
1650
1834
|
* Threaded through the *WithDeps variants, never part of the published
|
|
1651
1835
|
* surface: the fields mirror internal types.
|
|
1652
1836
|
*/
|
|
1653
1837
|
interface OperationDeps {
|
|
1654
1838
|
readonly runAssembler?: RunAssembler | undefined;
|
|
1655
|
-
/**
|
|
1656
|
-
* Starts the converge child. The CLI passes one backed by the engine's
|
|
1657
|
-
* `ctx.spawn`, so the terminal reaches the child natively and the engine
|
|
1658
|
-
* owns signal policy; hosts get the default `spawnAlchemy`.
|
|
1659
|
-
*/
|
|
1839
|
+
/** Starts the converge child for `destroy`; defaults to `spawnAlchemy`. Tests substitute it. */
|
|
1660
1840
|
readonly alchemy?: RunAlchemy | undefined;
|
|
1841
|
+
/** The `lower` and converge functions `deploy` runs; defaults to the app's own install (`loadAppConvergeEntry`). Tests substitute it. */
|
|
1842
|
+
readonly appConvergeEntry?: AppConvergeEntry | undefined;
|
|
1843
|
+
/** Runs one `dev` converge and reports its events; defaults to a new worker thread per converge (`runDevConvergeInWorker`). Tests substitute it. */
|
|
1844
|
+
readonly runDevConverge?: RunDevConverge | undefined;
|
|
1845
|
+
/** What `deploy` and `dev` redact from everything they report. Defaults to one built from `process.env`; the CLI passes its own so its console redirect redacts the same values. */
|
|
1846
|
+
readonly redaction?: SecretRedaction | undefined;
|
|
1661
1847
|
/** Starts a file watch for `dev`; defaults to chokidar-backed `startWatch`. Tests substitute it to drive changes directly. */
|
|
1662
1848
|
readonly watch?: typeof startWatch | undefined;
|
|
1663
1849
|
/**
|
|
@@ -1674,11 +1860,46 @@ interface OperationDeps {
|
|
|
1674
1860
|
* call", and both commands are credential-free by contract: there is no
|
|
1675
1861
|
* authenticated call on those paths for this to reach.
|
|
1676
1862
|
*/
|
|
1677
|
-
readonly credentials?:
|
|
1863
|
+
readonly credentials?: CallerCredentials | undefined;
|
|
1678
1864
|
}
|
|
1679
1865
|
//#endregion
|
|
1866
|
+
//#region src/operations/steps.d.ts
|
|
1867
|
+
/** A step event, over the operation's own step type. */
|
|
1868
|
+
type StepEvent<Step> = {
|
|
1869
|
+
readonly kind: 'step-started';
|
|
1870
|
+
readonly step: Step;
|
|
1871
|
+
} | {
|
|
1872
|
+
readonly kind: 'message';
|
|
1873
|
+
readonly severity: 'info' | 'warn' | 'verbose';
|
|
1874
|
+
/** A line Alchemy logged while it planned or applied. */
|
|
1875
|
+
readonly text: string;
|
|
1876
|
+
} | {
|
|
1877
|
+
readonly kind: 'step-finished';
|
|
1878
|
+
readonly step: Step;
|
|
1879
|
+
readonly outcome: 'ok' | 'failed';
|
|
1880
|
+
readonly durationMs: number;
|
|
1881
|
+
/** What the step measured, as its build adapter or deploy target reported it. The fields vary by adapter and target. */
|
|
1882
|
+
readonly data?: Readonly<Record<string, string | number>> | undefined;
|
|
1883
|
+
};
|
|
1884
|
+
//#endregion
|
|
1680
1885
|
//#region src/operations/dev.d.ts
|
|
1886
|
+
/** A step of a converge. Each converge is one `converge` step, `dev.converge` for the first and `dev.rebuild.<n>` for the n-th rebuild, and each resource Alchemy touches is an `apply-resource` step inside it. */
|
|
1887
|
+
type DevStep = {
|
|
1888
|
+
readonly name: 'converge';
|
|
1889
|
+
readonly id: string;
|
|
1890
|
+
} | {
|
|
1891
|
+
readonly name: 'apply-resource';
|
|
1892
|
+
/** The id of the converge step it belongs to. */
|
|
1893
|
+
readonly converge: string;
|
|
1894
|
+
/** The resource's ID (ADR-0057): its node's address, or the address and the resource's role in that node. */
|
|
1895
|
+
readonly resourceId: string;
|
|
1896
|
+
readonly resourceType: string;
|
|
1897
|
+
/** Alchemy's status word for what is happening to it, such as `creating` or `created`. */
|
|
1898
|
+
readonly status: string;
|
|
1899
|
+
};
|
|
1681
1900
|
type DevEvent =
|
|
1901
|
+
/** A converge's steps and Alchemy's log lines. Every step a converge opens is finished when it ends, as `failed` when it failed or was interrupted. */
|
|
1902
|
+
StepEvent<DevStep> |
|
|
1682
1903
|
/** Initial front door + after each successful re-converge. */
|
|
1683
1904
|
{
|
|
1684
1905
|
readonly kind: 'ready';
|
|
@@ -1709,12 +1930,22 @@ type DevEvent =
|
|
|
1709
1930
|
{
|
|
1710
1931
|
readonly kind: 'values-changed';
|
|
1711
1932
|
} |
|
|
1712
|
-
/** The app
|
|
1933
|
+
/** The value resources the app reads changed since the session started. `added` holds the nodes whose reads were only added, `removed` those whose reads were only removed, and `changed` every other changed node, each by address. The session stops rebuilding until it is restarted. */
|
|
1934
|
+
{
|
|
1935
|
+
readonly kind: 'value-reads-changed';
|
|
1936
|
+
readonly added: readonly string[];
|
|
1937
|
+
readonly removed: readonly string[];
|
|
1938
|
+
readonly changed: readonly string[];
|
|
1939
|
+
} |
|
|
1940
|
+
/** A rebuild's converge failed, or was refused: `DEV.CONVERGE_RUNNING` when another converge on this thread holds the process state, `DEV.WORKER_THREAD` when dev was called from a thread that cannot change the process's working directory. The app keeps running, still watching. */
|
|
1713
1941
|
{
|
|
1714
1942
|
readonly kind: 'converge-failed';
|
|
1715
|
-
readonly
|
|
1716
|
-
readonly
|
|
1717
|
-
readonly
|
|
1943
|
+
readonly code: 'DEV.CONVERGE_FAILED' | 'DEV.CONVERGE_RUNNING' | 'DEV.WORKER_THREAD';
|
|
1944
|
+
readonly message: string;
|
|
1945
|
+
readonly reasons: readonly {
|
|
1946
|
+
readonly tag: string;
|
|
1947
|
+
readonly message: string;
|
|
1948
|
+
}[];
|
|
1718
1949
|
} |
|
|
1719
1950
|
/** Once per service that runs its build adapter's dev server, before the first converge (ADR-0056). `cwd` is absolute. */
|
|
1720
1951
|
{
|
|
@@ -1762,16 +1993,18 @@ interface DevInput {
|
|
|
1762
1993
|
* `devStop` stops the app later.
|
|
1763
1994
|
*/
|
|
1764
1995
|
readonly detach?: boolean | undefined;
|
|
1996
|
+
/** The app's directory, where `.prisma-composer/` and Alchemy's `.alchemy` live. Defaults to `process.cwd()`. For the length of each converge, the process's working directory is `cwd`; it is restored after. */
|
|
1765
1997
|
readonly cwd?: string | undefined;
|
|
1766
1998
|
readonly onEvent?: ((event: DevEvent) => void) | undefined;
|
|
1999
|
+
/** Interrupts a running converge and stops dev. During the first converge, dev then fails with `DEV.INTERRUPTED`; once the session has started, it stops as `stop()` stops it. Only one converge runs at a time on the thread that called dev, which holds the converge flag while dev's converge worker runs: a `deploy` on that thread while dev converges is refused, and so is a dev converge while a deploy runs there. A converge on another thread of the process is not refused. */
|
|
2000
|
+
readonly signal?: AbortSignal | undefined;
|
|
1767
2001
|
}
|
|
1768
|
-
/** A running dev session. The operation NEVER touches process signal handlers
|
|
1769
|
-
* the host owns signals (and must evict alchemy's import-time SIGINT/SIGTERM
|
|
1770
|
-
* listeners before installing its own; see run-dev.ts). */
|
|
2002
|
+
/** A running dev session. The operation NEVER touches process signal handlers: the host owns signals. */
|
|
1771
2003
|
interface DevSession {
|
|
1772
2004
|
/** The initial front door, already merged across attachments. */
|
|
1773
2005
|
readonly endpoints: readonly ServiceEndpoint[];
|
|
1774
2006
|
/** Stop the watch loop and the app's services (emulators and data stay up).
|
|
2007
|
+
* A converge still running is interrupted, and its worker thread ends before the services stop.
|
|
1775
2008
|
* Idempotent; emits 'stopping'/'stopped'; resolves `closed`. A no-op for a detached session. */
|
|
1776
2009
|
stop(): Promise<void>;
|
|
1777
2010
|
/** Settles when the session has fully stopped (via stop()); already settled for a detached session. */
|
|
@@ -1782,39 +2015,65 @@ interface DevSession {
|
|
|
1782
2015
|
* internal types and is not part of the published surface. */
|
|
1783
2016
|
declare function devWithDeps(input: DevInput, deps: OperationDeps): Promise<Result$1<DevSession, CliStructuredError>>;
|
|
1784
2017
|
//#endregion
|
|
1785
|
-
//#region
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
readonly address: string;
|
|
1791
|
-
readonly entities: readonly DeployedEntity[];
|
|
2018
|
+
//#region src/redaction.d.ts
|
|
2019
|
+
/** A value under a secrets key, with that key. */
|
|
2020
|
+
interface KnownSecret {
|
|
2021
|
+
readonly name: string;
|
|
2022
|
+
readonly value: string;
|
|
1792
2023
|
}
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
2024
|
+
/**
|
|
2025
|
+
* The known secrets of one command: the values under the secrets keys the graph names, in the app
|
|
2026
|
+
* secrets and the app configuration (ADR-0062). The app configuration file must not hold any of them.
|
|
2027
|
+
*/
|
|
2028
|
+
declare class KnownSecrets {
|
|
2029
|
+
#private;
|
|
2030
|
+
constructor(secrets?: Iterable<KnownSecret>);
|
|
2031
|
+
/** Adds each secret whose value is not empty. A value already known keeps its first name. */
|
|
2032
|
+
add(secrets: Iterable<KnownSecret>): void;
|
|
2033
|
+
values(): ReadonlySet<string>;
|
|
2034
|
+
/**
|
|
2035
|
+
* The name of a known secret `text` holds, or undefined. A secret of
|
|
2036
|
+
* `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter
|
|
2037
|
+
* one only when it is all of `text`.
|
|
2038
|
+
*/
|
|
2039
|
+
nameIn(text: string): string | undefined;
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* What one command hides from everything it prints, returns or reports (ADR-0062): its known
|
|
2043
|
+
* secrets, and the credential-looking values, which only look like secrets by the name of the
|
|
2044
|
+
* variable they are under. It starts with the credential-looking values of the process
|
|
2045
|
+
* environment.
|
|
2046
|
+
*/
|
|
2047
|
+
declare class SecretRedaction {
|
|
2048
|
+
readonly knownSecrets: KnownSecrets;
|
|
2049
|
+
private readonly credentialLooking;
|
|
2050
|
+
private matcher;
|
|
2051
|
+
constructor(env: Readonly<Record<string, string | undefined>>);
|
|
2052
|
+
addKnownSecrets(secrets: Iterable<KnownSecret>): void;
|
|
2053
|
+
addCredentialLookingValues(values: Iterable<string>): void;
|
|
2054
|
+
/** The known secrets and the credential-looking values, longest first. */
|
|
2055
|
+
allValues(): readonly string[];
|
|
2056
|
+
/** `text` with every known secret and credential-looking value replaced by `[redacted]` at any length, then bearer tokens, JWTs, URL passwords and `token=…` pairs. */
|
|
2057
|
+
redact(text: string): string;
|
|
1796
2058
|
}
|
|
1797
2059
|
//#endregion
|
|
1798
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
2060
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-BiJzvHNz.d.mts
|
|
1799
2061
|
//#region src/operations/deploy.d.ts
|
|
1800
|
-
/** A deploy step. `assemble-service` steps run inside `assemble`, one per service. */
|
|
2062
|
+
/** A deploy step. `assemble-service` steps run inside `assemble`, one per service, and `apply-resource` steps inside `apply`, one per resource Alchemy touches. */
|
|
1801
2063
|
type DeployStep = {
|
|
1802
2064
|
readonly name: 'prepare' | 'assemble' | 'connect' | 'preflight' | 'apply' | 'record';
|
|
1803
2065
|
} | {
|
|
1804
2066
|
readonly name: 'assemble-service';
|
|
1805
2067
|
readonly address: string;
|
|
1806
|
-
};
|
|
1807
|
-
type DeployEvent = {
|
|
1808
|
-
readonly kind: 'step-started';
|
|
1809
|
-
readonly step: DeployStep;
|
|
1810
2068
|
} | {
|
|
1811
|
-
readonly
|
|
1812
|
-
|
|
1813
|
-
readonly
|
|
1814
|
-
readonly
|
|
1815
|
-
/**
|
|
1816
|
-
readonly
|
|
1817
|
-
}
|
|
2069
|
+
readonly name: 'apply-resource';
|
|
2070
|
+
/** The resource's ID (ADR-0057): its node's address, or the address and the resource's role in that node. */
|
|
2071
|
+
readonly resourceId: string;
|
|
2072
|
+
readonly resourceType: string;
|
|
2073
|
+
/** Alchemy's word for what is happening to the resource, such as `creating` or `created`, for people to read. It changes between a step's start and finish, and its values are Alchemy's, so do not branch on it. */
|
|
2074
|
+
readonly status: string;
|
|
2075
|
+
};
|
|
2076
|
+
type DeployEvent = StepEvent<DeployStep> |
|
|
1818
2077
|
/** Right after the preflight step, when it found platform variables with no value that no service needs. */
|
|
1819
2078
|
{
|
|
1820
2079
|
readonly kind: 'preflight-findings';
|
|
@@ -1851,10 +2110,11 @@ interface DeployInput {
|
|
|
1851
2110
|
readonly reportId?: string | undefined;
|
|
1852
2111
|
/** Each step as it starts and finishes, in real time. Rendering is the host's. */
|
|
1853
2112
|
readonly onEvent?: ((event: DeployEvent) => void) | undefined;
|
|
2113
|
+
/** Interrupts the plan or apply when it aborts. The deploy then fails with `DEPLOY.INTERRUPTED`, after releasing the environment's state lease. */
|
|
2114
|
+
readonly signal?: AbortSignal | undefined;
|
|
1854
2115
|
}
|
|
1855
2116
|
interface DeploySuccess {
|
|
1856
|
-
/**
|
|
1857
|
-
* did not write one (injected fake alchemy, or a report-less apply). */
|
|
2117
|
+
/** What the apply deployed. Undefined when the apply produced no report. */
|
|
1858
2118
|
readonly summary: DeploymentSummary | undefined;
|
|
1859
2119
|
/** How long the whole deploy took, from the call to its result. */
|
|
1860
2120
|
readonly durationMs: number;
|
|
@@ -1913,7 +2173,7 @@ declare function devUrl(input: DevUrlInput): Promise<Result$1<DevUrl, CliStructu
|
|
|
1913
2173
|
/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */
|
|
1914
2174
|
declare function devStop(input: DevStopInput): Promise<Result$1<DevStopped, CliStructuredError>>;
|
|
1915
2175
|
//#endregion
|
|
1916
|
-
//#region ../../0-framework/3-tooling/cli/dist/family-
|
|
2176
|
+
//#region ../../0-framework/3-tooling/cli/dist/family-DfwviKFj.d.mts
|
|
1917
2177
|
//#region src/family/family.d.ts
|
|
1918
2178
|
/**
|
|
1919
2179
|
* The control-plane operations the family's handlers call. These are the
|
|
@@ -1939,30 +2199,5 @@ interface CreateComposerFamilyOptions {
|
|
|
1939
2199
|
readonly redirects?: readonly RedirectSpec[] | undefined;
|
|
1940
2200
|
}
|
|
1941
2201
|
//#endregion
|
|
1942
|
-
|
|
1943
|
-
//#
|
|
1944
|
-
/** A value under a secrets key, with that key. */
|
|
1945
|
-
interface KnownSecret {
|
|
1946
|
-
readonly name: string;
|
|
1947
|
-
readonly value: string;
|
|
1948
|
-
}
|
|
1949
|
-
/**
|
|
1950
|
-
* The known secrets of one command: the values under the secrets keys the graph names, in the app
|
|
1951
|
-
* secrets and the app configuration (ADR-0062). The app configuration file must not hold any of them.
|
|
1952
|
-
*/
|
|
1953
|
-
declare class KnownSecrets {
|
|
1954
|
-
#private;
|
|
1955
|
-
constructor(secrets?: Iterable<KnownSecret>);
|
|
1956
|
-
/** Adds each secret whose value is not empty. A value already known keeps its first name. */
|
|
1957
|
-
add(secrets: Iterable<KnownSecret>): void;
|
|
1958
|
-
values(): ReadonlySet<string>;
|
|
1959
|
-
/**
|
|
1960
|
-
* The name of a known secret `text` holds, or undefined. A secret of
|
|
1961
|
-
* `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter
|
|
1962
|
-
* one only when it is all of `text`.
|
|
1963
|
-
*/
|
|
1964
|
-
nameIn(text: string): string | undefined;
|
|
1965
|
-
}
|
|
1966
|
-
//#endregion
|
|
1967
|
-
export { CliStructuredError as C, AppConfigurationRead as S, OperationDeps as _, DEFAULT_DEPLOY_ENVIRONMENT as a, AssembledServices as b, DeploySuccess as c, DevUrl as d, DevUrlInput as f, DevSession as g, DevInput as h, realOperations as i, DevStopInput as l, DevEvent as m, ComposerOperations as n, DeployEvent as o, ComposerConfigSource as p, CreateComposerFamilyOptions as r, DeployInput as s, KnownSecrets as t, DevStopped as u, ServiceEndpoint as v, AppSecrets as x, Result$1 as y };
|
|
1968
|
-
//# sourceMappingURL=redaction-Bf8FvTFH-XGchRgrK.d.mts.map
|
|
2202
|
+
export { ServiceEndpoint as _, DeployEvent as a, DevStopInput as c, DevUrlInput as d, ComposerConfigSource as f, OperationDeps as g, DevSession as h, DEFAULT_DEPLOY_ENVIRONMENT as i, DevStopped as l, DevInput as m, CreateComposerFamilyOptions as n, DeployInput as o, DevEvent as p, realOperations as r, DeploySuccess as s, ComposerOperations as t, DevUrl as u, Result$1 as v, CliStructuredError as y };
|
|
2203
|
+
//# sourceMappingURL=family-DfwviKFj-CS1L-EvS.d.mts.map
|