@prisma/composer-cli 0.36.0 → 0.37.0-dev.2
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-CErnR6NK-6QjHJ7q5.mjs → app-config-CErnR6NK-DnKH4Kqc.mjs} +2 -2
- package/dist/{app-config-CErnR6NK-6QjHJ7q5.mjs.map → app-config-CErnR6NK-DnKH4Kqc.mjs.map} +1 -1
- package/dist/app-configuration-file-CeJvBAti-Dk65W3Az.mjs +140 -0
- package/dist/app-configuration-file-CeJvBAti-Dk65W3Az.mjs.map +1 -0
- package/dist/{dev-current-Brb4qugP-BOI9FJdz.mjs → dev-current-D-Qb6Yem-CvaY4xsk.mjs} +6 -6
- package/dist/{dev-current-Brb4qugP-BOI9FJdz.mjs.map → dev-current-D-Qb6Yem-CvaY4xsk.mjs.map} +1 -1
- package/dist/{dev-environment-name-6eEr5PW8-lIZmJjfr.mjs → dev-environment-name-6eEr5PW8-DpdGjmTb.mjs} +3 -3
- package/dist/dev-environment-name-6eEr5PW8-DpdGjmTb.mjs.map +1 -0
- package/dist/{dist-B9-nLeho.mjs → dist-BH6HQ6zZ.mjs} +3 -6
- package/dist/{dist-B9-nLeho.mjs.map → dist-BH6HQ6zZ.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-CNt-xpE7-CMQCNQpY.mjs → execute-deploy-destroy-C6EsdmLz-DqdToZ_i.mjs} +62 -31
- package/dist/execute-deploy-destroy-C6EsdmLz-DqdToZ_i.mjs.map +1 -0
- package/dist/{execute-dev-current-BdEqeKAB-xCBBITAB.mjs → execute-dev-current-tBKmDAjV-DOOMGrl5.mjs} +7 -7
- package/dist/{execute-dev-current-BdEqeKAB-xCBBITAB.mjs.map → execute-dev-current-tBKmDAjV-DOOMGrl5.mjs.map} +1 -1
- package/dist/{execute-dev-BUk-XWBJ-DaB9ma8z.mjs → execute-dev-gjIKYybU-hRndPEgC.mjs} +93 -45
- package/dist/{execute-dev-BUk-XWBJ-DaB9ma8z.mjs.map → execute-dev-gjIKYybU-hRndPEgC.mjs.map} +1 -1
- package/dist/family.d.mts +2 -2
- package/dist/family.mjs +26 -9
- package/dist/family.mjs.map +1 -1
- package/dist/{generate-dev-stack-BkkU2HLE-Dek3CkAQ.mjs → generate-dev-stack-BV_n-X9n-BDBjgphH.mjs} +11 -5
- package/dist/generate-dev-stack-BV_n-X9n-BDBjgphH.mjs.map +1 -0
- package/dist/{list-deployed-B-N3imFH.mjs → list-deployed-D3tlbgmG.mjs} +5 -5
- package/dist/list-deployed-D3tlbgmG.mjs.map +1 -0
- package/dist/{family-B2JZ8O7U-P_rOUr4w.d.mts → redaction-Bf8FvTFH-D0dXGsO8.d.mts} +394 -185
- package/dist/redaction-Bf8FvTFH-D0dXGsO8.d.mts.map +1 -0
- package/dist/redaction-HnbkSFrK-CCKJNRwi.mjs +534 -0
- package/dist/redaction-HnbkSFrK-CCKJNRwi.mjs.map +1 -0
- package/dist/result-sR7PBi61.mjs +229 -0
- package/dist/result-sR7PBi61.mjs.map +1 -0
- package/dist/run-alchemy-OS_ix5g0-DSlHsv2p.mjs +236 -0
- package/dist/run-alchemy-OS_ix5g0-DSlHsv2p.mjs.map +1 -0
- package/dist/testing.d.mts +31 -2
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +8 -4
- package/dist/testing.mjs.map +1 -1
- package/dist/validate-environment-CpQLC3CA-Ct-PXoKN.mjs +2517 -0
- package/dist/validate-environment-CpQLC3CA-Ct-PXoKN.mjs.map +1 -0
- package/package.json +9 -9
- package/src/exports/testing.ts +3 -2
- package/src/family/deploy-list.ts +2 -2
- package/dist/dev-environment-name-6eEr5PW8-lIZmJjfr.mjs.map +0 -1
- package/dist/execute-deploy-destroy-CNt-xpE7-CMQCNQpY.mjs.map +0 -1
- package/dist/family-B2JZ8O7U-P_rOUr4w.d.mts.map +0 -1
- package/dist/generate-dev-stack-BkkU2HLE-Dek3CkAQ.mjs.map +0 -1
- package/dist/list-deployed-B-N3imFH.mjs.map +0 -1
- package/dist/run-alchemy-Dl_MWw4g-DaWV9tkH.mjs +0 -667
- package/dist/run-alchemy-Dl_MWw4g-DaWV9tkH.mjs.map +0 -1
- package/dist/validate-environment-CEhUSEg2-ExABehBM.mjs +0 -1343
- package/dist/validate-environment-CEhUSEg2-ExABehBM.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandFamily, RedirectSpec } from "@prisma/cli-engine";
|
|
2
|
-
import * as Layer from "effect/Layer";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
2
|
import { Input, StackServices } from "alchemy";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
5
|
import { State } from "alchemy/State/State";
|
|
6
6
|
//#region ../../0-framework/0-foundation/foundation/dist/errors.d.mts
|
|
7
7
|
//#region src/structured-error.d.ts
|
|
@@ -81,6 +81,36 @@ declare class CliStructuredError extends Error implements StructuredError {
|
|
|
81
81
|
static is(error: unknown): error is CliStructuredError;
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
|
+
//#region ../../0-framework/0-foundation/foundation/dist/secret-CHOw4LBU.d.mts
|
|
85
|
+
//#region src/secret.d.ts
|
|
86
|
+
declare const SECRET_BOX: unique symbol;
|
|
87
|
+
declare class SecretBox<T> {
|
|
88
|
+
#private;
|
|
89
|
+
readonly [SECRET_BOX] = true;
|
|
90
|
+
constructor(value: T);
|
|
91
|
+
/** The sole explicit door to the wrapped value. */
|
|
92
|
+
expose(): T;
|
|
93
|
+
toString(): string;
|
|
94
|
+
toJSON(): string;
|
|
95
|
+
valueOf(): string;
|
|
96
|
+
[Symbol.toPrimitive](): string;
|
|
97
|
+
}
|
|
98
|
+
/** The common case: a secret string. */
|
|
99
|
+
type SecretString = SecretBox<string>;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region ../../0-framework/0-foundation/foundation/dist/pointer-CyQZZugO.d.mts
|
|
102
|
+
//#region src/pointer.d.ts
|
|
103
|
+
declare const POINTER: unique symbol;
|
|
104
|
+
declare const POINTER_TYPE: unique symbol;
|
|
105
|
+
/** Whether the variable a pointer names holds a secret. */
|
|
106
|
+
type PointerKind = 'secret' | 'plain';
|
|
107
|
+
interface PointerWithKind<T, K extends PointerKind> {
|
|
108
|
+
readonly [POINTER]: K;
|
|
109
|
+
readonly [POINTER_TYPE]?: T;
|
|
110
|
+
}
|
|
111
|
+
/** The real value at deploy of a value known only at boot: it names the platform variable that holds the text of a `T`. Its kind is `'secret'` when `T` is a `SecretString` and `'plain'` otherwise. */
|
|
112
|
+
type Pointer<T> = PointerWithKind<T, unknown extends T ? PointerKind : T extends SecretString ? 'secret' : 'plain'>;
|
|
113
|
+
//#endregion
|
|
84
114
|
//#region ../../../node_modules/@standard-schema/spec/dist/index.d.ts
|
|
85
115
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
86
116
|
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
@@ -158,7 +188,7 @@ declare namespace StandardSchemaV1 {
|
|
|
158
188
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
159
189
|
}
|
|
160
190
|
//#endregion
|
|
161
|
-
//#region ../../0-framework/1-core/core/dist/graph-types-
|
|
191
|
+
//#region ../../0-framework/1-core/core/dist/graph-types-BiFZrE06.d.mts
|
|
162
192
|
//#region src/contract.d.ts
|
|
163
193
|
/**
|
|
164
194
|
* A Contract is the declared interface of a service-to-service dependency: a
|
|
@@ -239,18 +269,44 @@ type ValueOrigin<T> = {
|
|
|
239
269
|
readonly kind: 'computed';
|
|
240
270
|
readonly dependencies: readonly Value<unknown>[];
|
|
241
271
|
readonly compute: (values: readonly unknown[]) => T;
|
|
272
|
+
} | {
|
|
273
|
+
readonly kind: 'input';
|
|
274
|
+
/** The address of the module whose input this field is. */
|
|
275
|
+
readonly module: string;
|
|
276
|
+
/** The key path inside that module's input; `[]` is the whole input, which Load refuses wherever it is passed on. */
|
|
277
|
+
readonly path: readonly string[];
|
|
278
|
+
} | {
|
|
279
|
+
readonly kind: 'source';
|
|
280
|
+
readonly sourceKind: 'param';
|
|
281
|
+
/** How an error names the source, e.g. `envParam('REGION')`. */
|
|
282
|
+
readonly label: string;
|
|
283
|
+
/** The app configuration key whose text at deploy is the real value, as for `envParam()`. `undefined` for a value known only at boot, whose real value is `source`, a pointer. */
|
|
284
|
+
readonly configurationKey: string | undefined;
|
|
285
|
+
/** The source itself. Not enumerable, so a copy's origin compares equal and the origin holds no cycle. */
|
|
286
|
+
readonly source: ParamSource;
|
|
287
|
+
} | {
|
|
288
|
+
readonly kind: 'source';
|
|
289
|
+
readonly sourceKind: 'secret';
|
|
290
|
+
/** How an error names the source, e.g. `envSecret('STRIPE_KEY')`. */
|
|
291
|
+
readonly label: string;
|
|
292
|
+
/** The app secrets key that holds the secret's value, as for `envSecret()`. `undefined` for a secret source built without one. */
|
|
293
|
+
readonly secretsKey: string | undefined;
|
|
294
|
+
/** The source itself. Not enumerable, so a copy's origin compares equal and the origin holds no cycle. */
|
|
295
|
+
readonly source: SecretSource;
|
|
242
296
|
};
|
|
243
297
|
/**
|
|
244
|
-
* An opaque stand-in a module body can pass wherever a `T` is accepted
|
|
245
|
-
*
|
|
246
|
-
* `resolve()` returns one computed from others
|
|
298
|
+
* An opaque stand-in a module body can pass wherever a `T` is accepted
|
|
299
|
+
* (ADR-0062). `environment.name` is one; each field of a module's `input` is
|
|
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.
|
|
247
303
|
*/
|
|
248
304
|
interface Value<T> {
|
|
249
305
|
readonly [VALUE]: true;
|
|
250
306
|
readonly [VALUE_TYPE]?: T;
|
|
251
307
|
readonly [VALUE_ORIGIN]: ValueOrigin<T>;
|
|
252
308
|
}
|
|
253
|
-
/** Plain data: what a `resolve()` function may return
|
|
309
|
+
/** Plain data: what a `resolve()` function may return. */
|
|
254
310
|
type PlainData = string | number | boolean | null | readonly PlainData[] | {
|
|
255
311
|
readonly [key: string]: PlainData;
|
|
256
312
|
};
|
|
@@ -260,25 +316,47 @@ interface EnvironmentFacts {
|
|
|
260
316
|
readonly name: Value<string>;
|
|
261
317
|
}
|
|
262
318
|
//#endregion
|
|
319
|
+
//#region src/module-input.d.ts
|
|
320
|
+
declare const MODULE_INPUT: unique symbol;
|
|
321
|
+
type PlainObject = {
|
|
322
|
+
readonly [key: string]: unknown;
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* What a module body holds for an input field whose real value has type `T`:
|
|
326
|
+
* a value, plus one `ModuleInputField` per key when `T` is a plain object.
|
|
327
|
+
*/
|
|
328
|
+
type ModuleInputField<T> = Value<T> & FieldsOf<T>;
|
|
329
|
+
type FieldsOf<T> = [NonNullable<T>] extends [never] ? unknown : [NonNullable<T>] extends [readonly unknown[]] ? unknown : [NonNullable<T>] extends [PlainObject] ? Fields<NonNullable<T>, undefined extends T ? undefined : never> : unknown;
|
|
330
|
+
type Fields<O, Absent> = { readonly [K in keyof O & string]-?: ModuleInputField<FieldType<O, K> | Absent>; };
|
|
331
|
+
type FieldType<O, K extends keyof O> = Record<never, never> extends Pick<O, K> ? O[K] | undefined : O[K];
|
|
332
|
+
/**
|
|
333
|
+
* The `input` a module body receives for its input schema `S`: a dictionary
|
|
334
|
+
* with one value per field, typed from the schema's output (ADR-0061). It is
|
|
335
|
+
* not itself a value, and no binding accepts it: pass its fields on by name.
|
|
336
|
+
*/
|
|
337
|
+
type ModuleInput<S extends StandardSchemaV1> = {
|
|
338
|
+
readonly [MODULE_INPUT]: true;
|
|
339
|
+
} & FieldsOf<StandardSchemaV1.InferOutput<S>>;
|
|
340
|
+
/** The type error an author sees for a module body's whole input passed where a value is accepted. */
|
|
341
|
+
type ModuleInputIsNotAValue = 'the whole input of a module is not a value; pass its fields on by name';
|
|
342
|
+
/**
|
|
343
|
+
* Required of every object a binding accepts, so a module body's whole `input`
|
|
344
|
+
* fits none. Unlike `NotDeployTime`, a message string, it is an object
|
|
345
|
+
* constraint: its property's type is the message.
|
|
346
|
+
*/
|
|
347
|
+
type NotModuleInput = {
|
|
348
|
+
readonly [MODULE_INPUT]?: ModuleInputIsNotAValue;
|
|
349
|
+
};
|
|
350
|
+
//#endregion
|
|
263
351
|
//#region src/node.d.ts
|
|
264
352
|
declare const NODE: unique symbol;
|
|
265
|
-
declare const SECRET_NEED: unique symbol;
|
|
266
353
|
declare const SECRET_SOURCE: unique symbol;
|
|
267
|
-
/** A
|
|
268
|
-
interface
|
|
269
|
-
readonly [SECRET_NEED]: true;
|
|
270
|
-
readonly kind: 'secret';
|
|
271
|
-
}
|
|
272
|
-
/** A module's secret-forwarding slots: name → the need it declares. */
|
|
273
|
-
type Secrets = Record<string, SecretNeed>;
|
|
274
|
-
/** The wiring value bound to a secret slot: a target-defined payload core forwards but never inspects. A target (e.g. @prisma/composer-prisma-cloud's `envSecret`) builds one via `secretSource()`. */
|
|
275
|
-
interface SecretSource<T = unknown> {
|
|
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 (e.g. @prisma/composer-prisma-cloud's `envSecret`) builds one with `secretSource()`. */
|
|
355
|
+
interface SecretSource<T = unknown> extends Value<unknown> {
|
|
276
356
|
readonly [SECRET_SOURCE]: true;
|
|
277
357
|
/** Target-defined. Core never reads this; the target that authored the source reads it back. */
|
|
278
358
|
readonly payload: T;
|
|
279
359
|
}
|
|
280
|
-
/** What `provision(moduleChild, { secrets })` supplies: one source per declared secret slot. */
|
|
281
|
-
type SecretBindings<S extends Secrets> = { [K in keyof S]: SecretSource; };
|
|
282
360
|
declare const PROVISION_NEED: unique symbol;
|
|
283
361
|
/** A param value the framework mints. Opaque to core: it forwards the payload to the resolved provisioner and never reads it (ADR-0031). */
|
|
284
362
|
interface ProvisionNeed<T = unknown> {
|
|
@@ -289,35 +367,26 @@ interface ProvisionNeed<T = unknown> {
|
|
|
289
367
|
readonly payload: T;
|
|
290
368
|
}
|
|
291
369
|
declare const PARAM_SOURCE: unique symbol;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
interface ParamSource<T = unknown> {
|
|
370
|
+
/** A param's source: a target-defined payload core forwards but never inspects. It is a value too: known at deploy when it names an app configuration key (`envParam`), otherwise 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
|
+
interface ParamSource<T = unknown> extends Value<unknown> {
|
|
295
372
|
readonly [PARAM_SOURCE]: true;
|
|
296
373
|
/** Target-defined. Core never reads this; the target that authored the source reads it back. */
|
|
297
374
|
readonly payload: T;
|
|
298
375
|
}
|
|
299
|
-
/** A module's declared param-forwarding slot — nameless, schema-less; the root (or an ancestor module) binds a `ParamSource` and the topology forwards it into a child's real, schema-bearing param. */
|
|
300
|
-
interface ParamNeed {
|
|
301
|
-
readonly [PARAM_NEED]: true;
|
|
302
|
-
readonly kind: 'param';
|
|
303
|
-
}
|
|
304
|
-
/** A module's param-forwarding slots: name → the need it declares. */
|
|
305
|
-
type ParamNeeds = Record<string, ParamNeed>;
|
|
306
376
|
/** What `provision(service, { params })` accepts per declared param: a literal (schema-validated when config is built) or an opaque `ParamSource`, taking precedence over `param.default`. Every entry is optional — an unbound param falls back to its `default`. */
|
|
307
377
|
type ParamBindings<P extends Params> = { readonly [K in keyof P]?: StandardSchemaV1.InferOutput<P[K]['schema']> | ParamSource | (StandardSchemaV1.InferOutput<P[K]['schema']> extends PlainData ? Value<StandardSchemaV1.InferOutput<P[K]['schema']>> : never); };
|
|
308
|
-
/** What `provision(moduleChild, { params })` accepts per declared `ParamNeed`: a `ParamSource` only — a need carries no schema to validate a literal against. */
|
|
309
|
-
type ParamNeedBindings<PN extends ParamNeeds> = { readonly [K in keyof PN]?: ParamSource; };
|
|
310
378
|
/**
|
|
311
|
-
* What `provision(
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
* validation of the resolved binding is the real check.
|
|
379
|
+
* What `provision(node, { input })` accepts, for a module or a service, where
|
|
380
|
+
* the node's input schema expects `T` (its Standard Schema input type): the
|
|
381
|
+
* data, a value standing for it, or, for a `SecretString` field, a secret
|
|
382
|
+
* source. A `SecretString` or a `Pointer` is never written as a literal. An
|
|
383
|
+
* optional key also takes a value that may stand for `undefined`.
|
|
317
384
|
*/
|
|
318
|
-
type InputBinding =
|
|
319
|
-
readonly [key: string]:
|
|
320
|
-
};
|
|
385
|
+
type InputBinding<T> = Value<T> | (T extends Pointer<unknown> ? never : T extends SecretString ? SecretSource : T extends readonly (infer E)[] ? readonly InputBinding<E>[] : T extends {
|
|
386
|
+
readonly [key: string]: unknown;
|
|
387
|
+
} ? { readonly [K in keyof T]: InputBinding<T[K]> | (Record<never, never> extends Pick<T, K> ? Value<T[K] | undefined> : never); } & NotModuleInput : T);
|
|
388
|
+
/** What `provision()` accepts as the `input` of a node whose input schema is `I`. */
|
|
389
|
+
type InputBindingOf<I extends StandardSchemaV1 | undefined> = InputBinding<StandardSchemaV1.InferInput<NonNullable<I>>>;
|
|
321
390
|
/** Opaque `Contract<any, any>` bound shared by every node/port type that doesn't care which contract. */
|
|
322
391
|
type AnyContract = Contract<any, any>;
|
|
323
392
|
/** How a service's app becomes a runnable artifact — the build descriptor's routing key (`extension`/`type`) plus paths resolved relative to the authoring module. */
|
|
@@ -357,10 +426,10 @@ interface ResourceNode<C extends AnyContract | undefined = AnyContract, D extend
|
|
|
357
426
|
/** A resource's configuration: plain data and values, nested in objects and arrays. */
|
|
358
427
|
type ResourceProps = {
|
|
359
428
|
readonly [key: string]: ResourcePropsMember;
|
|
360
|
-
};
|
|
361
|
-
type ResourcePropsMember = string | number | boolean | null | Value<PlainData> | readonly ResourcePropsMember[] | {
|
|
429
|
+
} & NotModuleInput;
|
|
430
|
+
type ResourcePropsMember = string | number | boolean | null | Value<PlainData> | readonly ResourcePropsMember[] | ({
|
|
362
431
|
readonly [key: string]: ResourcePropsMember;
|
|
363
|
-
};
|
|
432
|
+
} & NotModuleInput);
|
|
364
433
|
/**
|
|
365
434
|
* A Service: inputs + its own declared params + how it is built. Inspectable,
|
|
366
435
|
* inert until run, and carries NO runtime behavior — an extension's factory
|
|
@@ -400,35 +469,56 @@ interface DependencyEnd<C = unknown, Req = unknown> {
|
|
|
400
469
|
readonly required: Req | undefined;
|
|
401
470
|
}
|
|
402
471
|
/** A Module: the same Deps/Expose boundary a service has, around transparent wiring instead of a black-box body — its `body` runs at Load, not at authoring. */
|
|
403
|
-
interface ModuleNode<D extends Deps = Deps, E extends Expose = Expose,
|
|
472
|
+
interface ModuleNode<D extends Deps = Deps, E extends Expose = Expose, I extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
404
473
|
readonly [NODE]: true;
|
|
405
474
|
readonly kind: 'module';
|
|
406
475
|
/** Human-readable, given at authoring — logs/diagnostics only. */
|
|
407
476
|
readonly name: string;
|
|
408
477
|
readonly deps: D;
|
|
409
|
-
/**
|
|
410
|
-
readonly
|
|
411
|
-
/** Declared param-forwarding slots (authored as `params`) — forwarded to internals via `ctx.params`, the same rail secrets ride on. */
|
|
412
|
-
readonly paramSlots: PN;
|
|
478
|
+
/** The module's whole incoming configuration as one Standard Schema (authored as `input`, ADR-0061), or `undefined` when it takes none. Load only calls its `~standard.validate`. */
|
|
479
|
+
readonly inputSchema: I;
|
|
413
480
|
readonly expose: E;
|
|
414
|
-
body(ctx: ModuleContext<D,
|
|
481
|
+
body(ctx: ModuleContext<D, I>): ModuleOutputs<E> | void;
|
|
482
|
+
/** `false`: a `module()` node can be provisioned. The app root, built with `appRoot()`, is the deploy's entry and cannot be. It answers `false` even when a `module()` node is the deploy's entry. */
|
|
483
|
+
isRoot(): false;
|
|
484
|
+
}
|
|
485
|
+
/** The app's root, built with `appRoot()`: a module node that nothing provisions, with no `deps` and no `expose`. */
|
|
486
|
+
interface AppRootNode<I extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
487
|
+
readonly [NODE]: true;
|
|
488
|
+
readonly kind: 'module';
|
|
489
|
+
/** The app's name. */
|
|
490
|
+
readonly name: string;
|
|
491
|
+
readonly deps: Record<never, never>;
|
|
492
|
+
/** The app configuration's schema, or `undefined` when the root takes none. */
|
|
493
|
+
readonly inputSchema: I;
|
|
494
|
+
readonly expose: Record<never, never>;
|
|
495
|
+
body(ctx: AppRootContext<I>): void;
|
|
496
|
+
/** `true`: the app root is the deploy's entry and cannot be provisioned. */
|
|
497
|
+
isRoot(): true;
|
|
415
498
|
}
|
|
416
499
|
/**
|
|
417
500
|
* What a module's body receives: its declared dependencies as forwardable wiring
|
|
418
501
|
* values, plus `provision` to register the owned services/modules it wires them into.
|
|
419
502
|
*/
|
|
420
|
-
interface ModuleContext<D extends Deps,
|
|
503
|
+
interface ModuleContext<D extends Deps, I extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
421
504
|
/** The module's declared dependencies as wiring values — pass them into provision(). */
|
|
422
505
|
readonly deps: { [K in keyof D]: InputRef<D[K]>; };
|
|
423
|
-
/** The module's
|
|
424
|
-
readonly
|
|
425
|
-
/** The module's declared param-forwarding slots as forwardable sources — pass them into a child's `params`. */
|
|
426
|
-
readonly params: { readonly [K in keyof PN]: ParamSource; };
|
|
506
|
+
/** The module's input: a dictionary with one value per field, typed from its input schema's output (ADR-0061); `undefined` when it declares none. It is not itself a value: pass its fields on by name, into a provision() binding or, for a plain field, as a resolve() dependency. A root's input is the app configuration, validated by its schema. */
|
|
507
|
+
readonly input: I extends StandardSchemaV1 ? ModuleInput<I> : undefined;
|
|
427
508
|
/** The deploy-time facts of the environment, each a value (ADR-0062). List `environment.name` as a `resolve()` dependency. Never environment variables: user code never reads those. */
|
|
428
509
|
readonly environment: EnvironmentFacts;
|
|
429
510
|
/** Registers an owned child (service or module) under a stable id. */
|
|
430
511
|
readonly provision: ModuleBuilder['provision'];
|
|
431
512
|
}
|
|
513
|
+
/** What an app root's body receives: its input, the environment's facts, and `provision`. */
|
|
514
|
+
interface AppRootContext<I extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
515
|
+
/** The app configuration, one value per field, typed from the root's input schema; `undefined` when it declares none. */
|
|
516
|
+
readonly input: I extends StandardSchemaV1 ? ModuleInput<I> : undefined;
|
|
517
|
+
/** The deploy-time facts of the environment, each a value (ADR-0062). */
|
|
518
|
+
readonly environment: EnvironmentFacts;
|
|
519
|
+
/** Registers an owned child (resource, service or module) under a stable id. */
|
|
520
|
+
readonly provision: ModuleBuilder['provision'];
|
|
521
|
+
}
|
|
432
522
|
/**
|
|
433
523
|
* A module's forwarded-input value: the same ref-port shape a producer's
|
|
434
524
|
* output carries, so it flows down a nested `provision()` call indistinguishably
|
|
@@ -475,7 +565,7 @@ type ServiceProvisionArgs<D extends Deps, I extends StandardSchemaV1 | undefined
|
|
|
475
565
|
params?: PB;
|
|
476
566
|
}] : [opts: {
|
|
477
567
|
id?: string;
|
|
478
|
-
input:
|
|
568
|
+
input: InputBindingOf<I>;
|
|
479
569
|
params?: PB;
|
|
480
570
|
}] : I extends undefined ? [opts: {
|
|
481
571
|
id?: string;
|
|
@@ -484,31 +574,26 @@ type ServiceProvisionArgs<D extends Deps, I extends StandardSchemaV1 | undefined
|
|
|
484
574
|
}] : [opts: {
|
|
485
575
|
id?: string;
|
|
486
576
|
deps: DepBindings<D>;
|
|
487
|
-
input:
|
|
577
|
+
input: InputBindingOf<I>;
|
|
488
578
|
params?: PB;
|
|
489
579
|
}];
|
|
490
580
|
/**
|
|
491
|
-
* A child-MODULE provision's trailing options: `deps
|
|
492
|
-
* exactly when the module declares
|
|
493
|
-
* slot may be bound to a `ParamSource`.
|
|
581
|
+
* A child-MODULE provision's trailing options: `deps` and `input` each
|
|
582
|
+
* required exactly when the module declares them.
|
|
494
583
|
*/
|
|
495
|
-
type
|
|
496
|
-
id?: string;
|
|
497
|
-
params?: PB;
|
|
498
|
-
}] : [opts: {
|
|
499
|
-
id?: string;
|
|
500
|
-
secrets: SecretBindings<S>;
|
|
501
|
-
params?: PB;
|
|
502
|
-
}] : [keyof S] extends [never] ? [opts: {
|
|
584
|
+
type ModuleProvisionOptions<D extends Deps, I extends StandardSchemaV1 | undefined> = {
|
|
503
585
|
id?: string;
|
|
586
|
+
} & ([keyof D] extends [never] ? unknown : {
|
|
504
587
|
deps: DepBindings<D>;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
588
|
+
}) & (I extends StandardSchemaV1 ? {
|
|
589
|
+
input: InputBindingOf<I>;
|
|
590
|
+
} : unknown);
|
|
591
|
+
/** The options are optional exactly when nothing is required. */
|
|
592
|
+
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
|
+
/** The options `provision()` takes after a service or module node `N`. */
|
|
594
|
+
type ProvisionArgs<N> = 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
|
+
/** The contracts a service or module node `N` exposes. */
|
|
596
|
+
type ExposeOf<N> = N extends ServiceNode<Deps, Params, infer E, StandardSchemaV1 | undefined> ? E : N extends ModuleNode<Deps, infer E, StandardSchemaV1 | undefined> ? E : never;
|
|
512
597
|
interface ModuleBuilder {
|
|
513
598
|
/** Provisions an owned resource; its id defaults to the node's `name`. */
|
|
514
599
|
provision<C extends AnyContract | undefined>(resource: ResourceNode<C>, opts?: {
|
|
@@ -518,27 +603,44 @@ interface ModuleBuilder {
|
|
|
518
603
|
} & (C extends AnyContract ? RefPort<C> : Record<never, never>);
|
|
519
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 `ParamSource`), overriding its default. */
|
|
520
605
|
provision<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
|
+
/** Registers an owned child module; its id defaults to the node's `name`; `deps` and `input` are required iff it declares them. */
|
|
607
|
+
provision<D extends Deps, E extends Expose, I extends StandardSchemaV1 | undefined>(child: ModuleNode<D, E, I>, ...args: ModuleProvisionArgs<D, I>): ProvisionedRef<E>;
|
|
521
608
|
/**
|
|
522
|
-
* The service call with `deps
|
|
523
|
-
*
|
|
609
|
+
* The service call with `deps` written out. `ServiceProvisionArgs` above
|
|
610
|
+
* cannot resolve while `D` or `I` is still an unbound type parameter — a
|
|
524
611
|
* generic wrapper like `cron()` provisioning a caller-supplied service — so
|
|
525
|
-
* that call site resolves to this
|
|
612
|
+
* that call site resolves to this overload, or to the next one for a
|
|
613
|
+
* service without an input schema.
|
|
526
614
|
*/
|
|
527
615
|
provision<D extends Deps, P extends Params, E extends Expose, I extends StandardSchemaV1 | undefined>(service: ServiceNode<D, P, E, I>, opts: {
|
|
528
616
|
id?: string;
|
|
529
617
|
deps: DepBindings<D>;
|
|
530
|
-
input
|
|
618
|
+
input: InputBindingOf<I>;
|
|
619
|
+
params?: ParamBindings<P>;
|
|
620
|
+
}): ProvisionedRef<E>;
|
|
621
|
+
provision<D extends Deps, P extends Params, E extends Expose>(service: ServiceNode<D, P, E, undefined>, opts: {
|
|
622
|
+
id?: string;
|
|
623
|
+
deps: DepBindings<D>;
|
|
624
|
+
input?: never;
|
|
531
625
|
params?: ParamBindings<P>;
|
|
532
626
|
}): ProvisionedRef<E>;
|
|
533
|
-
/**
|
|
534
|
-
provision<D extends Deps, E extends Expose,
|
|
535
|
-
|
|
536
|
-
|
|
627
|
+
/** The child-module call with `deps` written out — the same generic-wrapper escape as the two service overloads above. */
|
|
628
|
+
provision<D extends Deps, E extends Expose, I extends StandardSchemaV1 | undefined>(child: ModuleNode<D, E, I>, opts: {
|
|
629
|
+
id?: string;
|
|
630
|
+
deps: DepBindings<D>;
|
|
631
|
+
input: InputBindingOf<I>;
|
|
632
|
+
}): ProvisionedRef<E>;
|
|
633
|
+
provision<D extends Deps, E extends Expose>(child: ModuleNode<D, E, undefined>, opts: {
|
|
537
634
|
id?: string;
|
|
538
635
|
deps: DepBindings<D>;
|
|
539
|
-
|
|
540
|
-
params?: ParamNeedBindings<PN>;
|
|
636
|
+
input?: never;
|
|
541
637
|
}): 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>>;
|
|
542
644
|
}
|
|
543
645
|
/** Dependency map: name → the slot the service declares. Only declarations are admitted, never a concrete ResourceNode. */
|
|
544
646
|
type Deps = Record<string, DependencyEnd<any, any>>;
|
|
@@ -548,6 +650,24 @@ type Expose = Readonly<Record<string, AnyContract>>;
|
|
|
548
650
|
//#region src/graph-types.d.ts
|
|
549
651
|
/** Path-derived: root-scope children are bare ids ("auth", "db"); a nested module's own children dot-join under its address ("auth.db"). */
|
|
550
652
|
type NodeId = string;
|
|
653
|
+
/** One field of the root's input that its body names, with the real value the root's schema produced there. */
|
|
654
|
+
interface RootInputField {
|
|
655
|
+
/** The key path inside the root's input, such as `['smtp', 'host']`. */
|
|
656
|
+
readonly path: readonly string[];
|
|
657
|
+
/** The real value; absent when it is `undefined`. */
|
|
658
|
+
readonly value?: unknown;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* What a Load read from the app configuration (ADR-0062). The deploy's and `prisma dev`'s
|
|
662
|
+
* first process writes it to the app configuration file, and their second process Loads with
|
|
663
|
+
* it in place of the app configuration.
|
|
664
|
+
*/
|
|
665
|
+
interface AppConfigurationRead {
|
|
666
|
+
/** 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
|
+
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
|
+
}
|
|
551
671
|
interface GraphNode {
|
|
552
672
|
readonly id: NodeId;
|
|
553
673
|
/**
|
|
@@ -557,7 +677,7 @@ interface GraphNode {
|
|
|
557
677
|
* (the platform's application topology included) treats the id as opaque.
|
|
558
678
|
*/
|
|
559
679
|
readonly parent: NodeId | undefined;
|
|
560
|
-
readonly node: ServiceNode | ResourceNode | DependencyEnd | ModuleNode;
|
|
680
|
+
readonly node: ServiceNode | ResourceNode | DependencyEnd | ModuleNode | AppRootNode;
|
|
561
681
|
}
|
|
562
682
|
/** One end of an authored edge: a boundary port named by its owning node, direction, and name. */
|
|
563
683
|
interface PortEndpoint {
|
|
@@ -603,16 +723,14 @@ interface Edge {
|
|
|
603
723
|
readonly kind: 'input' | 'dependency';
|
|
604
724
|
}
|
|
605
725
|
/**
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
* address. Core never walks it beyond usage tracking; the deploy target's
|
|
609
|
-
* recursive descent classifies its leaves (literals, `envParam`, `envSecret`).
|
|
726
|
+
* The binding a `provision()` call supplied as a service's input (ADR-0042),
|
|
727
|
+
* recorded at the service's address. The deploy target resolves its leaves.
|
|
610
728
|
*/
|
|
611
|
-
interface
|
|
729
|
+
interface InputBindingUse {
|
|
612
730
|
/** The graph address of the service that declares the input schema. */
|
|
613
731
|
readonly serviceAddress: NodeId;
|
|
614
732
|
/** The binding object supplied at provision. */
|
|
615
|
-
readonly binding:
|
|
733
|
+
readonly binding: unknown;
|
|
616
734
|
}
|
|
617
735
|
/**
|
|
618
736
|
* A resolved param binding: a `provision()` call bound a service's param
|
|
@@ -630,6 +748,15 @@ interface ParamBinding {
|
|
|
630
748
|
/** A literal value (schema-validated by `buildConfig`) or an opaque `ParamSource` (the deploy target reads its own payload back) — check with `isParamSource`. Core never inspects a `ParamSource`'s payload. */
|
|
631
749
|
readonly binding: unknown;
|
|
632
750
|
}
|
|
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. */
|
|
752
|
+
interface SecretSourceUse {
|
|
753
|
+
/** The source, as its target built it. Core never reads its payload. */
|
|
754
|
+
readonly source: SecretSource;
|
|
755
|
+
/** A service whose final binding holds it, if one does. Otherwise the module whose input holds it. */
|
|
756
|
+
readonly address: NodeId;
|
|
757
|
+
/** That node's kind. */
|
|
758
|
+
readonly nodeKind: 'service' | 'module' | 'resource';
|
|
759
|
+
}
|
|
633
760
|
interface Graph {
|
|
634
761
|
readonly root: GraphNode;
|
|
635
762
|
/** Root + one per input, topo-ordered (deps first). */
|
|
@@ -640,12 +767,16 @@ interface Graph {
|
|
|
640
767
|
/** The authored (pre-dereference) edges between boundary ports, in declaration order. */
|
|
641
768
|
readonly authoredEdges: readonly AuthoredEdge[];
|
|
642
769
|
/** Every service input binding a `provision()` call supplied (ADR-0042). */
|
|
643
|
-
readonly inputBindings: readonly
|
|
770
|
+
readonly inputBindings: readonly InputBindingUse[];
|
|
644
771
|
/** Every service param bound at provision — literal or source; unbound params are absent here and fall back to their `default` (see `buildConfig`). */
|
|
645
772
|
readonly params: readonly ParamBinding[];
|
|
773
|
+
/** Every secret source a binding names, once each, in the order Load met them (ADR-0029). */
|
|
774
|
+
readonly secretSources: readonly SecretSourceUse[];
|
|
775
|
+
/** What this Load read from the app configuration (ADR-0062). Empty when Load was given none. */
|
|
776
|
+
readonly appConfigurationRead: AppConfigurationRead;
|
|
646
777
|
}
|
|
647
778
|
//#endregion
|
|
648
|
-
//#region ../../0-framework/1-core/core/dist/app-config-
|
|
779
|
+
//#region ../../0-framework/1-core/core/dist/app-config-lMqqcFA1.d.mts
|
|
649
780
|
//#region src/container-transport.d.ts
|
|
650
781
|
/**
|
|
651
782
|
* Carries resolved containers from the CLI process into the alchemy process
|
|
@@ -889,6 +1020,10 @@ interface LowerOptions {
|
|
|
889
1020
|
readonly name: string;
|
|
890
1021
|
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; the generated stack files always pass it. */
|
|
891
1022
|
readonly environment?: string;
|
|
1023
|
+
/** What the first process's Load read from the app configuration (ADR-0062), from the app configuration file. Load takes the root's input and every configuration key's text from it, and the Prisma Cloud serializer reads a service's `envParam()` leaves from its `configurationKeyText`. The generated stack files pass it. */
|
|
1024
|
+
readonly appConfigurationRead?: AppConfigurationRead;
|
|
1025
|
+
/** The node addresses of the graph the first process built. When given, lowering refuses a graph whose addresses differ. The generated stack files pass them. */
|
|
1026
|
+
readonly firstProcessNodeAddresses?: readonly string[];
|
|
892
1027
|
readonly bundles: Record<string, Bundle>;
|
|
893
1028
|
/** Alchemy state store for the stack. Defaults to the config's own state layer. */
|
|
894
1029
|
readonly state?: AlchemyStateLayer;
|
|
@@ -1048,10 +1183,16 @@ interface PreflightInput<C = unknown> {
|
|
|
1048
1183
|
readonly container: ContainerInstance | undefined;
|
|
1049
1184
|
/** The environment name. */
|
|
1050
1185
|
readonly environment: string;
|
|
1186
|
+
/** The app configuration the command read for this environment. Preflight fills a missing `envParam()` param's platform variable from it. */
|
|
1187
|
+
readonly configuration: AppConfiguration;
|
|
1188
|
+
/** The app secrets the command read for this environment. Preflight fills a missing `envSecret()` platform variable from it. */
|
|
1189
|
+
readonly secrets: AppSecrets;
|
|
1051
1190
|
/** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
|
|
1052
1191
|
readonly credentials?: ContainerCredentials<C> | undefined;
|
|
1053
1192
|
/** Hands the deploy's progress output what the check covered, as counts (e.g. `{ checked: 53, filled: 0, missing: 0 }`). Counts only: never a name or a value. */
|
|
1054
1193
|
readonly report?: ((counts: Readonly<Record<string, number>>) => void) | undefined;
|
|
1194
|
+
/** Shows the user a warning that does not stop the run. Only `prisma dev` passes it and shows the warnings; deploy passes none. */
|
|
1195
|
+
readonly warn?: ((message: string) => void) | undefined;
|
|
1055
1196
|
}
|
|
1056
1197
|
/** The resolved destroy context handed to an extension's `teardown` hook. */
|
|
1057
1198
|
interface TeardownInput {
|
|
@@ -1223,6 +1364,10 @@ interface LocalTargetProvidersInput {
|
|
|
1223
1364
|
readonly container: ContainerInstance | undefined;
|
|
1224
1365
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1225
1366
|
readonly devDir: string;
|
|
1367
|
+
/** The text of each configuration key the graph reads, from the app configuration file. A local deployment takes the text its param rows point at from it. */
|
|
1368
|
+
readonly configurationKeyText: Readonly<Record<string, string>>;
|
|
1369
|
+
/** The app secrets the graph's `envSecret()`s name, which the first process handed the second. A local deployment takes the text its `$secret` pointers name from it. */
|
|
1370
|
+
readonly namedSecrets: NamedSecrets;
|
|
1226
1371
|
}
|
|
1227
1372
|
interface LocalTargetEmulatorsInput {
|
|
1228
1373
|
/** The loaded application graph — inspected for which node kinds need an emulator. */
|
|
@@ -1262,6 +1407,10 @@ interface LocalTargetAttachment {
|
|
|
1262
1407
|
readonly address: string;
|
|
1263
1408
|
readonly node: ServiceNode;
|
|
1264
1409
|
readonly server: DevServer;
|
|
1410
|
+
/** The app configuration the command read for this environment. */
|
|
1411
|
+
readonly configuration: AppConfiguration;
|
|
1412
|
+
/** The app secrets the command read for this environment. */
|
|
1413
|
+
readonly secrets: AppSecrets;
|
|
1265
1414
|
}): Promise<{
|
|
1266
1415
|
readonly restarted: boolean;
|
|
1267
1416
|
}>;
|
|
@@ -1286,39 +1435,38 @@ type NodeDescriptor = ({
|
|
|
1286
1435
|
*/
|
|
1287
1436
|
serve?(input: ServeInput): Promise<DevServer | undefined>;
|
|
1288
1437
|
};
|
|
1438
|
+
/** What a config adapter receives (ADR-0062). */
|
|
1439
|
+
interface ConfigAdapterInput {
|
|
1440
|
+
/** The environment's name, as `--environment` gave it. */
|
|
1441
|
+
readonly environment: string;
|
|
1442
|
+
/** The absolute directory of the prisma.config.ts that declares the `composer` section. A file adapter reads its files relative to it (ADR-0004). */
|
|
1443
|
+
readonly configDirectory: string;
|
|
1444
|
+
}
|
|
1445
|
+
/** The values one adapter returns, by name. */
|
|
1446
|
+
type ConfigValues = Readonly<Record<string, unknown>>;
|
|
1447
|
+
/** 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. */
|
|
1448
|
+
type ConfigAdapter = (input: ConfigAdapterInput) => ConfigValues | Promise<ConfigValues>;
|
|
1449
|
+
/** 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 what `envParam()` reads. */
|
|
1450
|
+
type AppConfiguration = Readonly<Record<string, unknown>>;
|
|
1451
|
+
/** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text. Preflight fills a missing `envSecret()` platform variable from it, and `prisma dev` hands its second process the values the graph's `envSecret()`s name. Composer redacts the values the graph's `envSecret()`s name wherever it prints. */
|
|
1452
|
+
type AppSecrets = Readonly<Record<string, string>>;
|
|
1453
|
+
/** The app secrets an `envSecret()` in the graph names, each with text. `prisma dev`'s first process hands them to its second process in `PRISMA_COMPOSER_NAMED_SECRETS`. */
|
|
1454
|
+
type NamedSecrets = Readonly<Record<string, string>>;
|
|
1289
1455
|
/**
|
|
1290
1456
|
* The config file's default export. `extensions` lists every extension the
|
|
1291
1457
|
* app deploys through; `state` is the ONE state store per deploy — explicit,
|
|
1292
|
-
* platform-agnostic, never defaulted by an extension.
|
|
1458
|
+
* platform-agnostic, never defaulted by an extension. `config` and `secrets`
|
|
1459
|
+
* list the adapters the app configuration and the app secrets come from.
|
|
1293
1460
|
*/
|
|
1294
1461
|
interface PrismaAppConfig {
|
|
1295
1462
|
/** The module whose default export is the app root, relative to `prisma.config.ts`. `--entry` overrides it. */
|
|
1296
1463
|
readonly entry?: string;
|
|
1297
1464
|
readonly extensions: ExtensionDescriptor[];
|
|
1298
1465
|
readonly state: StateDescriptor;
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
/** Composer's configuration and the `prisma.config.ts` that declares it. */
|
|
1304
|
-
interface ComposerConfigSource {
|
|
1305
|
-
/** The `composer` section: the `composer` property of that file's default export. */
|
|
1306
|
-
readonly value: PrismaAppConfig;
|
|
1307
|
-
/** The declaring `prisma.config.ts`. The deploy's generated stack file imports it. A relative path resolves against the operation's `cwd`. */
|
|
1308
|
-
readonly file: string;
|
|
1309
|
-
}
|
|
1310
|
-
//#endregion
|
|
1311
|
-
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts
|
|
1312
|
-
//#region src/deployment-summary.d.ts
|
|
1313
|
-
/** The serializable projection of DeploymentResult — what CAN cross the process
|
|
1314
|
-
* boundary. Writer (report hook) and reader (deploy operation) share this shape. */
|
|
1315
|
-
interface DeployedNodeSummary {
|
|
1316
|
-
readonly address: string;
|
|
1317
|
-
readonly entities: readonly DeployedEntity[];
|
|
1318
|
-
}
|
|
1319
|
-
interface DeploymentSummary {
|
|
1320
|
-
readonly app: string;
|
|
1321
|
-
readonly nodes: readonly DeployedNodeSummary[];
|
|
1466
|
+
/** Where the app configuration comes from. Defaults to `[environmentVariables()]`; a list given here replaces the default. */
|
|
1467
|
+
readonly config?: readonly ConfigAdapter[];
|
|
1468
|
+
/** Where the app secrets come from. Defaults to `[environmentVariables()]`; a list given here replaces the default. */
|
|
1469
|
+
readonly secrets?: readonly ConfigAdapter[];
|
|
1322
1470
|
}
|
|
1323
1471
|
//#endregion
|
|
1324
1472
|
//#region ../../0-framework/3-tooling/assemble/dist/index.d.mts
|
|
@@ -1363,7 +1511,16 @@ interface NotOk<F> {
|
|
|
1363
1511
|
*/
|
|
1364
1512
|
type Result$1<T, F> = Ok<T> | NotOk<F>;
|
|
1365
1513
|
//#endregion
|
|
1366
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-
|
|
1514
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-Df-kx6UV.d.mts
|
|
1515
|
+
//#region src/composer-config.d.ts
|
|
1516
|
+
/** Composer's configuration and the `prisma.config.ts` that declares it. */
|
|
1517
|
+
interface ComposerConfigSource {
|
|
1518
|
+
/** The `composer` section: the `composer` property of that file's default export. */
|
|
1519
|
+
readonly value: PrismaAppConfig;
|
|
1520
|
+
/** The declaring `prisma.config.ts`. The deploy's generated stack file imports it. A relative path resolves against the operation's `cwd`. */
|
|
1521
|
+
readonly file: string;
|
|
1522
|
+
}
|
|
1523
|
+
//#endregion
|
|
1367
1524
|
//#region src/dev/watch.d.ts
|
|
1368
1525
|
interface WatchTarget {
|
|
1369
1526
|
readonly address: string;
|
|
@@ -1409,6 +1566,8 @@ interface AlchemyInvocation {
|
|
|
1409
1566
|
readonly cwd: string;
|
|
1410
1567
|
readonly stage: string;
|
|
1411
1568
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
1569
|
+
/** The known secrets and the credential-looking values, for `spawnAlchemy`'s stream redactor; the CLI's runner ignores them. Never in `env` or on the command line, which the engine may log. */
|
|
1570
|
+
readonly redactedValues: readonly string[];
|
|
1412
1571
|
}
|
|
1413
1572
|
/** The command line an invocation becomes, once a binary has been resolved. */
|
|
1414
1573
|
interface AlchemyCommandLine {
|
|
@@ -1431,7 +1590,9 @@ interface AlchemyOutcome {
|
|
|
1431
1590
|
readonly commandLine?: AlchemyCommandLine;
|
|
1432
1591
|
}
|
|
1433
1592
|
/** Starts the converge and resolves when it ends. The CLI supplies one backed
|
|
1434
|
-
* by `ctx.spawn
|
|
1593
|
+
* by `ctx.spawn`, which gives the child the terminal and does not redact its
|
|
1594
|
+
* output; hosts get `spawnAlchemy`, which pipes the output through the stream
|
|
1595
|
+
* redactor (ADR-0062). */
|
|
1435
1596
|
type RunAlchemy = (invocation: AlchemyInvocation) => Promise<AlchemyOutcome>;
|
|
1436
1597
|
//#endregion
|
|
1437
1598
|
//#region src/operations/shared.d.ts
|
|
@@ -1476,69 +1637,6 @@ interface OperationDeps {
|
|
|
1476
1637
|
readonly credentials?: ContainerCredentials | undefined;
|
|
1477
1638
|
}
|
|
1478
1639
|
//#endregion
|
|
1479
|
-
//#region src/operations/deploy.d.ts
|
|
1480
|
-
/** A deploy step. `assemble-service` steps run inside `assemble`, one per service. */
|
|
1481
|
-
type DeployStep = {
|
|
1482
|
-
readonly name: 'prepare' | 'assemble' | 'connect' | 'preflight' | 'apply' | 'record';
|
|
1483
|
-
} | {
|
|
1484
|
-
readonly name: 'assemble-service';
|
|
1485
|
-
readonly address: string;
|
|
1486
|
-
};
|
|
1487
|
-
type DeployEvent = {
|
|
1488
|
-
readonly kind: 'step-started';
|
|
1489
|
-
readonly step: DeployStep;
|
|
1490
|
-
} | {
|
|
1491
|
-
readonly kind: 'step-finished';
|
|
1492
|
-
readonly step: DeployStep;
|
|
1493
|
-
readonly outcome: 'ok' | 'failed';
|
|
1494
|
-
readonly durationMs: number;
|
|
1495
|
-
/** What the step measured, as its build adapter or deploy target reported it. The fields vary by adapter and target. */
|
|
1496
|
-
readonly data?: Readonly<Record<string, string | number>> | undefined;
|
|
1497
|
-
};
|
|
1498
|
-
/** The environment `deploy` targets when none is named. */
|
|
1499
|
-
declare const DEFAULT_DEPLOY_ENVIRONMENT = "production";
|
|
1500
|
-
interface DeployInput {
|
|
1501
|
-
/**
|
|
1502
|
-
* Composer's configuration: the `composer` section of `prisma.config.ts` and that file. The operation does not look for a config file; it refuses a section the CLI would refuse, before any work starts.
|
|
1503
|
-
*/
|
|
1504
|
-
readonly config: ComposerConfigSource;
|
|
1505
|
-
/** The entry module, resolved against `cwd`. Overrides the `entry` in `config`; without either the operation fails with `CONFIG.ENTRY_MISSING`. */
|
|
1506
|
-
readonly entry?: string | undefined;
|
|
1507
|
-
/** Override the root node's name (the `--name` flag's slot). */
|
|
1508
|
-
readonly name?: string | undefined;
|
|
1509
|
-
/** The environment to deploy to. Defaults to `production`. */
|
|
1510
|
-
readonly environment?: string | undefined;
|
|
1511
|
-
/** Defaults to process.cwd(); the directory `.prisma-composer/` and `.alchemy` state live under. */
|
|
1512
|
-
readonly cwd?: string | undefined;
|
|
1513
|
-
/**
|
|
1514
|
-
* Where to write the run report — the deploy's outcome as JSON, for a tool
|
|
1515
|
-
* that consumes a deploy rather than watches one. Relative paths resolve
|
|
1516
|
-
* against `cwd`. Absent falls back to `PRISMA_COMPOSER_REPORT_FILE`, and
|
|
1517
|
-
* absent from both writes no report.
|
|
1518
|
-
*/
|
|
1519
|
-
readonly reportPath?: string | undefined;
|
|
1520
|
-
/**
|
|
1521
|
-
* An existing report record this deploy belongs to — the `--build-id` flag's
|
|
1522
|
-
* slot. A CI job that opens the record before invoking Composer passes the
|
|
1523
|
-
* id here, and the target's reporter joins that record instead of creating
|
|
1524
|
-
* one. Absent falls back to whatever the target reads from environment variables.
|
|
1525
|
-
*/
|
|
1526
|
-
readonly reportId?: string | undefined;
|
|
1527
|
-
/** Each step as it starts and finishes, in real time. Rendering is the host's. */
|
|
1528
|
-
readonly onEvent?: ((event: DeployEvent) => void) | undefined;
|
|
1529
|
-
}
|
|
1530
|
-
interface DeploySuccess {
|
|
1531
|
-
/** Parsed from the alchemy child's result file. Undefined when the child
|
|
1532
|
-
* did not write one (injected fake alchemy, or a report-less apply). */
|
|
1533
|
-
readonly summary: DeploymentSummary | undefined;
|
|
1534
|
-
/** How long the whole deploy took, from the call to its result. */
|
|
1535
|
-
readonly durationMs: number;
|
|
1536
|
-
}
|
|
1537
|
-
/** In-package variant threading the injection seam, which the family's
|
|
1538
|
-
* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors
|
|
1539
|
-
* internal types and is not part of the published surface. */
|
|
1540
|
-
declare function deployWithDeps(input: DeployInput, deps: OperationDeps): Promise<Result$1<DeploySuccess, CliStructuredError>>;
|
|
1541
|
-
//#endregion
|
|
1542
1640
|
//#region src/operations/dev.d.ts
|
|
1543
1641
|
type DevEvent =
|
|
1544
1642
|
/** Initial front door + after each successful re-converge. */
|
|
@@ -1548,6 +1646,11 @@ type DevEvent =
|
|
|
1548
1646
|
} | {
|
|
1549
1647
|
readonly kind: 'unwatchable';
|
|
1550
1648
|
readonly address: string;
|
|
1649
|
+
} |
|
|
1650
|
+
/** A target's preflight warned about the graph; the session still starts. */
|
|
1651
|
+
{
|
|
1652
|
+
readonly kind: 'target-warning';
|
|
1653
|
+
readonly message: string;
|
|
1551
1654
|
} | {
|
|
1552
1655
|
readonly kind: 'rebuild-failed';
|
|
1553
1656
|
readonly message: string;
|
|
@@ -1562,6 +1665,10 @@ type DevEvent =
|
|
|
1562
1665
|
readonly kind: 'config-changed';
|
|
1563
1666
|
readonly file: string;
|
|
1564
1667
|
} |
|
|
1668
|
+
/** What the `config` or `secrets` adapters return changed since the session started. The session keeps the values it started with and stops rebuilding until it is restarted. */
|
|
1669
|
+
{
|
|
1670
|
+
readonly kind: 'values-changed';
|
|
1671
|
+
} |
|
|
1565
1672
|
/** The app keeps running, still watching. */
|
|
1566
1673
|
{
|
|
1567
1674
|
readonly kind: 'converge-failed';
|
|
@@ -1635,6 +1742,83 @@ interface DevSession {
|
|
|
1635
1742
|
* internal types and is not part of the published surface. */
|
|
1636
1743
|
declare function devWithDeps(input: DevInput, deps: OperationDeps): Promise<Result$1<DevSession, CliStructuredError>>;
|
|
1637
1744
|
//#endregion
|
|
1745
|
+
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts
|
|
1746
|
+
//#region src/deployment-summary.d.ts
|
|
1747
|
+
/** The serializable projection of DeploymentResult — what CAN cross the process
|
|
1748
|
+
* boundary. Writer (report hook) and reader (deploy operation) share this shape. */
|
|
1749
|
+
interface DeployedNodeSummary {
|
|
1750
|
+
readonly address: string;
|
|
1751
|
+
readonly entities: readonly DeployedEntity[];
|
|
1752
|
+
}
|
|
1753
|
+
interface DeploymentSummary {
|
|
1754
|
+
readonly app: string;
|
|
1755
|
+
readonly nodes: readonly DeployedNodeSummary[];
|
|
1756
|
+
}
|
|
1757
|
+
//#endregion
|
|
1758
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-BPnQtqnQ.d.mts
|
|
1759
|
+
//#region src/operations/deploy.d.ts
|
|
1760
|
+
/** A deploy step. `assemble-service` steps run inside `assemble`, one per service. */
|
|
1761
|
+
type DeployStep = {
|
|
1762
|
+
readonly name: 'prepare' | 'assemble' | 'connect' | 'preflight' | 'apply' | 'record';
|
|
1763
|
+
} | {
|
|
1764
|
+
readonly name: 'assemble-service';
|
|
1765
|
+
readonly address: string;
|
|
1766
|
+
};
|
|
1767
|
+
type DeployEvent = {
|
|
1768
|
+
readonly kind: 'step-started';
|
|
1769
|
+
readonly step: DeployStep;
|
|
1770
|
+
} | {
|
|
1771
|
+
readonly kind: 'step-finished';
|
|
1772
|
+
readonly step: DeployStep;
|
|
1773
|
+
readonly outcome: 'ok' | 'failed';
|
|
1774
|
+
readonly durationMs: number;
|
|
1775
|
+
/** What the step measured, as its build adapter or deploy target reported it. The fields vary by adapter and target. */
|
|
1776
|
+
readonly data?: Readonly<Record<string, string | number>> | undefined;
|
|
1777
|
+
};
|
|
1778
|
+
/** The environment `deploy` targets when none is named. */
|
|
1779
|
+
declare const DEFAULT_DEPLOY_ENVIRONMENT = "production";
|
|
1780
|
+
interface DeployInput {
|
|
1781
|
+
/**
|
|
1782
|
+
* Composer's configuration: the `composer` section of `prisma.config.ts` and that file. The operation does not look for a config file; it refuses a section the CLI would refuse, before any work starts.
|
|
1783
|
+
*/
|
|
1784
|
+
readonly config: ComposerConfigSource;
|
|
1785
|
+
/** The entry module, resolved against `cwd`. Overrides the `entry` in `config`; without either the operation fails with `CONFIG.ENTRY_MISSING`. */
|
|
1786
|
+
readonly entry?: string | undefined;
|
|
1787
|
+
/** Override the root node's name (the `--name` flag's slot). */
|
|
1788
|
+
readonly name?: string | undefined;
|
|
1789
|
+
/** The environment to deploy to. Defaults to `production`. */
|
|
1790
|
+
readonly environment?: string | undefined;
|
|
1791
|
+
/** Defaults to process.cwd(); the directory `.prisma-composer/` and `.alchemy` state live under. */
|
|
1792
|
+
readonly cwd?: string | undefined;
|
|
1793
|
+
/**
|
|
1794
|
+
* Where to write the run report — the deploy's outcome as JSON, for a tool
|
|
1795
|
+
* that consumes a deploy rather than watches one. Relative paths resolve
|
|
1796
|
+
* against `cwd`. Absent falls back to `PRISMA_COMPOSER_REPORT_FILE`, and
|
|
1797
|
+
* absent from both writes no report.
|
|
1798
|
+
*/
|
|
1799
|
+
readonly reportPath?: string | undefined;
|
|
1800
|
+
/**
|
|
1801
|
+
* An existing report record this deploy belongs to — the `--build-id` flag's
|
|
1802
|
+
* slot. A CI job that opens the record before invoking Composer passes the
|
|
1803
|
+
* id here, and the target's reporter joins that record instead of creating
|
|
1804
|
+
* one. Absent falls back to whatever the target reads from environment variables.
|
|
1805
|
+
*/
|
|
1806
|
+
readonly reportId?: string | undefined;
|
|
1807
|
+
/** Each step as it starts and finishes, in real time. Rendering is the host's. */
|
|
1808
|
+
readonly onEvent?: ((event: DeployEvent) => void) | undefined;
|
|
1809
|
+
}
|
|
1810
|
+
interface DeploySuccess {
|
|
1811
|
+
/** Parsed from the alchemy child's result file. Undefined when the child
|
|
1812
|
+
* did not write one (injected fake alchemy, or a report-less apply). */
|
|
1813
|
+
readonly summary: DeploymentSummary | undefined;
|
|
1814
|
+
/** How long the whole deploy took, from the call to its result. */
|
|
1815
|
+
readonly durationMs: number;
|
|
1816
|
+
}
|
|
1817
|
+
/** In-package variant threading the injection seam, which the family's
|
|
1818
|
+
* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors
|
|
1819
|
+
* internal types and is not part of the published surface. */
|
|
1820
|
+
declare function deployWithDeps(input: DeployInput, deps: OperationDeps): Promise<Result$1<DeploySuccess, CliStructuredError>>;
|
|
1821
|
+
//#endregion
|
|
1638
1822
|
//#region src/operations/dev-current.d.ts
|
|
1639
1823
|
interface DevUrlInput {
|
|
1640
1824
|
/** Composer's configuration: the `composer` section of `prisma.config.ts` and that file. It names the extensions whose local targets recorded the app. */
|
|
@@ -1684,7 +1868,7 @@ declare function devUrl(input: DevUrlInput): Promise<Result$1<DevUrl, CliStructu
|
|
|
1684
1868
|
/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */
|
|
1685
1869
|
declare function devStop(input: DevStopInput): Promise<Result$1<DevStopped, CliStructuredError>>;
|
|
1686
1870
|
//#endregion
|
|
1687
|
-
//#region ../../0-framework/3-tooling/cli/dist/family-
|
|
1871
|
+
//#region ../../0-framework/3-tooling/cli/dist/family-qagovuqK.d.mts
|
|
1688
1872
|
//#region src/family/family.d.ts
|
|
1689
1873
|
/**
|
|
1690
1874
|
* The control-plane operations the family's handlers call. These are the
|
|
@@ -1710,5 +1894,30 @@ interface CreateComposerFamilyOptions {
|
|
|
1710
1894
|
readonly redirects?: readonly RedirectSpec[] | undefined;
|
|
1711
1895
|
}
|
|
1712
1896
|
//#endregion
|
|
1713
|
-
|
|
1714
|
-
//#
|
|
1897
|
+
//#region ../../0-framework/3-tooling/cli/dist/redaction-Bf8FvTFH.d.mts
|
|
1898
|
+
//#region src/redaction.d.ts
|
|
1899
|
+
/** A value under a secrets key, with that key. */
|
|
1900
|
+
interface KnownSecret {
|
|
1901
|
+
readonly name: string;
|
|
1902
|
+
readonly value: string;
|
|
1903
|
+
}
|
|
1904
|
+
/**
|
|
1905
|
+
* The known secrets of one command: the values under the secrets keys the graph names, in the app
|
|
1906
|
+
* secrets and the app configuration (ADR-0062). The app configuration file must not hold any of them.
|
|
1907
|
+
*/
|
|
1908
|
+
declare class KnownSecrets {
|
|
1909
|
+
#private;
|
|
1910
|
+
constructor(secrets?: Iterable<KnownSecret>);
|
|
1911
|
+
/** Adds each secret whose value is not empty. A value already known keeps its first name. */
|
|
1912
|
+
add(secrets: Iterable<KnownSecret>): void;
|
|
1913
|
+
values(): ReadonlySet<string>;
|
|
1914
|
+
/**
|
|
1915
|
+
* The name of a known secret `text` holds, or undefined. A secret of
|
|
1916
|
+
* `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter
|
|
1917
|
+
* one only when it is all of `text`.
|
|
1918
|
+
*/
|
|
1919
|
+
nameIn(text: string): string | undefined;
|
|
1920
|
+
}
|
|
1921
|
+
//#endregion
|
|
1922
|
+
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 };
|
|
1923
|
+
//# sourceMappingURL=redaction-Bf8FvTFH-D0dXGsO8.d.mts.map
|