@prisma/composer-cli 0.39.0-dev.1 → 0.39.0-dev.3
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-configuration-file-CeJvBAti-DA4EKwFq.mjs → app-configuration-file-Cw9autUL-CPnePaG6.mjs} +17 -20
- package/dist/app-configuration-file-Cw9autUL-CPnePaG6.mjs.map +1 -0
- package/dist/{dev-current-wD5YDLjA-CFI8XTAK.mjs → dev-current-D8GwJQex-D4xWpddG.mjs} +6 -6
- package/dist/{dev-current-wD5YDLjA-CFI8XTAK.mjs.map → dev-current-D8GwJQex-D4xWpddG.mjs.map} +1 -1
- package/dist/{dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs → dev-environment-name-6eEr5PW8-DuiDkcM6.mjs} +2 -2
- package/dist/dev-environment-name-6eEr5PW8-DuiDkcM6.mjs.map +1 -0
- package/dist/{dist-D0rWRHos.mjs → dist-qqNor5kl.mjs} +3 -3
- package/dist/{dist-D0rWRHos.mjs.map → dist-qqNor5kl.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs → execute-deploy-destroy-1SIH5uAu-SJMSVJ-C.mjs} +11 -10
- package/dist/{execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs.map → execute-deploy-destroy-1SIH5uAu-SJMSVJ-C.mjs.map} +1 -1
- package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs → execute-dev-current-DsAsDBB1-C_Pqg6lv.mjs} +6 -6
- package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs.map → execute-dev-current-DsAsDBB1-C_Pqg6lv.mjs.map} +1 -1
- package/dist/{execute-dev-BIyOI3Ys-DGpTd9rP.mjs → execute-dev-xPaS5SAl-Pf5LvC3G.mjs} +77 -15
- package/dist/{execute-dev-BIyOI3Ys-DGpTd9rP.mjs.map → execute-dev-xPaS5SAl-Pf5LvC3G.mjs.map} +1 -1
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +22 -6
- package/dist/family.mjs.map +1 -1
- package/dist/{generate-dev-stack-BV_n-X9n-DM5faH3-.mjs → generate-dev-stack-BEpqJ3AH-BwP97FIX.mjs} +5 -5
- package/dist/generate-dev-stack-BEpqJ3AH-BwP97FIX.mjs.map +1 -0
- package/dist/{list-deployed-BFJJxt_W.mjs → list-deployed-BAKSI43Y.mjs} +4 -4
- package/dist/{list-deployed-BFJJxt_W.mjs.map → list-deployed-BAKSI43Y.mjs.map} +1 -1
- package/dist/{preflight-transport-DmmtoFPH-CZ0o7QPf.mjs → preflight-transport-DJjTWvyH-C98XN-K2.mjs} +3 -4
- package/dist/{preflight-transport-DmmtoFPH-CZ0o7QPf.mjs.map → preflight-transport-DJjTWvyH-C98XN-K2.mjs.map} +1 -1
- package/dist/{redaction-DXung4ip-Co_fv4Zl.mjs → redaction-C-NnlVUh-xg-a8RGt.mjs} +4 -10
- package/dist/redaction-C-NnlVUh-xg-a8RGt.mjs.map +1 -0
- package/dist/{redaction-Bf8FvTFH-XGchRgrK.d.mts → redaction-CqdeMBKw-B6ldtfDI.d.mts} +99 -73
- package/dist/redaction-CqdeMBKw-B6ldtfDI.d.mts.map +1 -0
- package/dist/{result-sR7PBi61.mjs → result-DlBttLS8.mjs} +7 -2
- package/dist/{result-sR7PBi61.mjs.map → result-DlBttLS8.mjs.map} +1 -1
- package/dist/{run-alchemy-CRLAyOtt-CwFLe4Zg.mjs → run-alchemy-CyciV8i0-Djfa6x3a.mjs} +4 -4
- package/dist/{run-alchemy-CRLAyOtt-CwFLe4Zg.mjs.map → run-alchemy-CyciV8i0-Djfa6x3a.mjs.map} +1 -1
- package/dist/testing.d.mts +5 -10
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +5 -5
- package/dist/testing.mjs.map +1 -1
- package/dist/{validate-environment-D1BTCkTs-C5m4rL6t.mjs → validate-environment-DyW59rJ7-B1PoUO20.mjs} +135 -88
- package/dist/validate-environment-DyW59rJ7-B1PoUO20.mjs.map +1 -0
- package/package.json +7 -7
- package/dist/app-configuration-file-CeJvBAti-DA4EKwFq.mjs.map +0 -1
- package/dist/dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs.map +0 -1
- package/dist/generate-dev-stack-BV_n-X9n-DM5faH3-.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/validate-environment-D1BTCkTs-C5m4rL6t.mjs.map +0 -1
|
@@ -98,7 +98,7 @@ declare class SecretBox<T> {
|
|
|
98
98
|
/** The common case: a secret string. */
|
|
99
99
|
type SecretString = SecretBox<string>;
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region ../../0-framework/0-foundation/foundation/dist/pointer-
|
|
101
|
+
//#region ../../0-framework/0-foundation/foundation/dist/pointer-DclJZFQi.d.mts
|
|
102
102
|
//#region src/pointer.d.ts
|
|
103
103
|
declare const POINTER: unique symbol;
|
|
104
104
|
declare const POINTER_TYPE: unique symbol;
|
|
@@ -108,7 +108,7 @@ interface PointerWithKind<T, K extends PointerKind> {
|
|
|
108
108
|
readonly [POINTER]: K;
|
|
109
109
|
readonly [POINTER_TYPE]?: T;
|
|
110
110
|
}
|
|
111
|
-
/** The real value at deploy of a value known only at boot: it names the platform
|
|
111
|
+
/** 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
112
|
type Pointer<T> = PointerWithKind<T, unknown extends T ? PointerKind : T extends SecretString ? 'secret' : 'plain'>;
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region ../../../node_modules/@standard-schema/spec/dist/index.d.ts
|
|
@@ -188,7 +188,7 @@ declare namespace StandardSchemaV1 {
|
|
|
188
188
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
189
189
|
}
|
|
190
190
|
//#endregion
|
|
191
|
-
//#region ../../0-framework/1-core/core/dist/graph-types-
|
|
191
|
+
//#region ../../0-framework/1-core/core/dist/graph-types-Bzj1fahC.d.mts
|
|
192
192
|
//#region src/contract.d.ts
|
|
193
193
|
/**
|
|
194
194
|
* A Contract is the declared interface of a service-to-service dependency: a
|
|
@@ -259,6 +259,7 @@ interface Config {
|
|
|
259
259
|
//#region src/value.d.ts
|
|
260
260
|
declare const VALUE: unique symbol;
|
|
261
261
|
declare const VALUE_ORIGIN: unique symbol;
|
|
262
|
+
declare const VALUE_RESOURCE: unique symbol;
|
|
262
263
|
declare const VALUE_TYPE: unique symbol;
|
|
263
264
|
/** Where Load gets a value's real value. Internal to core; not re-exported from the public barrel. */
|
|
264
265
|
type ValueOrigin<T> = {
|
|
@@ -278,34 +279,33 @@ type ValueOrigin<T> = {
|
|
|
278
279
|
} | {
|
|
279
280
|
readonly kind: 'source';
|
|
280
281
|
readonly sourceKind: 'param';
|
|
281
|
-
/** How an error names the source
|
|
282
|
+
/** How an error names the source. */
|
|
282
283
|
readonly label: string;
|
|
283
|
-
|
|
284
|
-
readonly configurationKey: string | undefined;
|
|
284
|
+
readonly resource: NodeId | undefined;
|
|
285
285
|
/** The source itself. Not enumerable, so a copy's origin compares equal and the origin holds no cycle. */
|
|
286
286
|
readonly source: ParamSource;
|
|
287
287
|
} | {
|
|
288
288
|
readonly kind: 'source';
|
|
289
289
|
readonly sourceKind: 'secret';
|
|
290
|
-
/** How an error names the source
|
|
290
|
+
/** How an error names the source. */
|
|
291
291
|
readonly label: string;
|
|
292
|
-
/** The app secrets key that holds the secret's value
|
|
292
|
+
/** The app secrets key that holds the secret's value. `undefined` for a secret source built without one. */
|
|
293
293
|
readonly secretsKey: string | undefined;
|
|
294
|
+
readonly resource: NodeId | undefined;
|
|
294
295
|
/** The source itself. Not enumerable, so a copy's origin compares equal and the origin holds no cycle. */
|
|
295
296
|
readonly source: SecretSource;
|
|
296
297
|
};
|
|
297
298
|
/**
|
|
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.
|
|
299
|
+
* 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.
|
|
300
|
+
* A deploy-time value is known by the end of Load; a runtime value's real value at deploy is a pointer.
|
|
303
301
|
*/
|
|
304
302
|
interface Value<T> {
|
|
305
303
|
readonly [VALUE]: true;
|
|
306
304
|
readonly [VALUE_TYPE]?: T;
|
|
307
305
|
readonly [VALUE_ORIGIN]: ValueOrigin<T>;
|
|
308
306
|
}
|
|
307
|
+
/** 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. */
|
|
308
|
+
type RuntimeValue<T> = Value<Pointer<T>>;
|
|
309
309
|
/** Plain data: what a `resolve()` function may return. */
|
|
310
310
|
type PlainData = string | number | boolean | null | readonly PlainData[] | {
|
|
311
311
|
readonly [key: string]: PlainData;
|
|
@@ -351,7 +351,7 @@ type NotModuleInput = {
|
|
|
351
351
|
//#region src/node.d.ts
|
|
352
352
|
declare const NODE: unique symbol;
|
|
353
353
|
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
|
|
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 builds one with `secretSource()`. */
|
|
355
355
|
interface SecretSource<T = unknown> extends Value<unknown> {
|
|
356
356
|
readonly [SECRET_SOURCE]: true;
|
|
357
357
|
/** Target-defined. Core never reads this; the target that authored the source reads it back. */
|
|
@@ -367,14 +367,14 @@ interface ProvisionNeed<T = unknown> {
|
|
|
367
367
|
readonly payload: T;
|
|
368
368
|
}
|
|
369
369
|
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
|
|
370
|
+
/** 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
371
|
interface ParamSource<T = unknown> extends Value<unknown> {
|
|
372
372
|
readonly [PARAM_SOURCE]: true;
|
|
373
373
|
/** Target-defined. Core never reads this; the target that authored the source reads it back. */
|
|
374
374
|
readonly payload: T;
|
|
375
375
|
}
|
|
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']> |
|
|
376
|
+
/** 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`. */
|
|
377
|
+
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
378
|
/**
|
|
379
379
|
* What `provision(node, { input })` accepts, for a module or a service, where
|
|
380
380
|
* the node's input schema expects `T` (its Standard Schema input type): the
|
|
@@ -516,8 +516,8 @@ interface AppRootContext<I extends StandardSchemaV1 | undefined = StandardSchema
|
|
|
516
516
|
readonly input: I extends StandardSchemaV1 ? ModuleInput<I> : undefined;
|
|
517
517
|
/** The deploy-time facts of the environment, each a value (ADR-0062). */
|
|
518
518
|
readonly environment: EnvironmentFacts;
|
|
519
|
-
/** Registers an owned child (resource, service or
|
|
520
|
-
readonly provision:
|
|
519
|
+
/** Registers an owned child (resource, service, module or value resource) under a stable id. */
|
|
520
|
+
readonly provision: AppRootProvision;
|
|
521
521
|
}
|
|
522
522
|
/**
|
|
523
523
|
* A module's forwarded-input value: the same ref-port shape a producer's
|
|
@@ -590,21 +590,25 @@ type ModuleProvisionOptions<D extends Deps, I extends StandardSchemaV1 | undefin
|
|
|
590
590
|
} : unknown);
|
|
591
591
|
/** The options are optional exactly when nothing is required. */
|
|
592
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
|
-
|
|
594
|
-
|
|
593
|
+
type ProvisionArgs<N> = N extends ValueResourceNode ? [opts?: {
|
|
594
|
+
id?: string;
|
|
595
|
+
}] : 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
596
|
/** The contracts a service or module node `N` exposes. */
|
|
596
597
|
type ExposeOf<N> = N extends ServiceNode<Deps, Params, infer E, StandardSchemaV1 | undefined> ? E : N extends ModuleNode<Deps, infer E, StandardSchemaV1 | undefined> ? E : never;
|
|
597
|
-
|
|
598
|
+
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.";
|
|
599
|
+
interface SharedProvision {
|
|
598
600
|
/** Provisions an owned resource; its id defaults to the node's `name`. */
|
|
599
|
-
|
|
601
|
+
<C extends AnyContract | undefined>(resource: ResourceNode<C> & {
|
|
602
|
+
readonly [VALUE_RESOURCE]?: undefined;
|
|
603
|
+
}, opts?: {
|
|
600
604
|
id?: string;
|
|
601
605
|
}): {
|
|
602
606
|
readonly id: string;
|
|
603
607
|
} & (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
|
-
|
|
608
|
+
/** 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. */
|
|
609
|
+
<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
610
|
/** Registers an owned child module; its id defaults to the node's `name`; `deps` and `input` are required iff it declares them. */
|
|
607
|
-
|
|
611
|
+
<D extends Deps, E extends Expose, I extends StandardSchemaV1 | undefined>(child: ModuleNode<D, E, I>, ...args: ModuleProvisionArgs<D, I>): ProvisionedRef<E>;
|
|
608
612
|
/**
|
|
609
613
|
* The service call with `deps` written out. `ServiceProvisionArgs` above
|
|
610
614
|
* cannot resolve while `D` or `I` is still an unbound type parameter — a
|
|
@@ -612,40 +616,52 @@ interface ModuleBuilder {
|
|
|
612
616
|
* that call site resolves to this overload, or to the next one for a
|
|
613
617
|
* service without an input schema.
|
|
614
618
|
*/
|
|
615
|
-
|
|
619
|
+
<D extends Deps, P extends Params, E extends Expose, I extends StandardSchemaV1 | undefined>(service: ServiceNode<D, P, E, I>, opts: {
|
|
616
620
|
id?: string;
|
|
617
621
|
deps: DepBindings<D>;
|
|
618
622
|
input: InputBindingOf<I>;
|
|
619
623
|
params?: ParamBindings<P>;
|
|
620
624
|
}): ProvisionedRef<E>;
|
|
621
|
-
|
|
625
|
+
<D extends Deps, P extends Params, E extends Expose>(service: ServiceNode<D, P, E, undefined>, opts: {
|
|
622
626
|
id?: string;
|
|
623
627
|
deps: DepBindings<D>;
|
|
624
628
|
input?: never;
|
|
625
629
|
params?: ParamBindings<P>;
|
|
626
630
|
}): ProvisionedRef<E>;
|
|
627
631
|
/** The child-module call with `deps` written out — the same generic-wrapper escape as the two service overloads above. */
|
|
628
|
-
|
|
632
|
+
<D extends Deps, E extends Expose, I extends StandardSchemaV1 | undefined>(child: ModuleNode<D, E, I>, opts: {
|
|
629
633
|
id?: string;
|
|
630
634
|
deps: DepBindings<D>;
|
|
631
635
|
input: InputBindingOf<I>;
|
|
632
636
|
}): ProvisionedRef<E>;
|
|
633
|
-
|
|
637
|
+
<D extends Deps, E extends Expose>(child: ModuleNode<D, E, undefined>, opts: {
|
|
634
638
|
id?: string;
|
|
635
639
|
deps: DepBindings<D>;
|
|
636
640
|
input?: never;
|
|
637
641
|
}): 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
642
|
}
|
|
643
|
+
type ProvisionInModule = <N extends ServiceNode | ModuleNode | ValueResourceNode>(node: N extends ValueResourceNode ? OnlyInAppRoot : N, ...args: ProvisionArgs<N>) => ProvisionedRef<ExposeOf<N>>;
|
|
644
|
+
type ProvisionValue = <V extends SourceValue>(node: ValueResourceNode<V>, opts?: {
|
|
645
|
+
readonly id?: string;
|
|
646
|
+
}) => V & {
|
|
647
|
+
readonly id: string;
|
|
648
|
+
};
|
|
649
|
+
type ProvisionInAppRoot = <N extends ServiceNode | ModuleNode | ValueResourceNode>(node: N, ...args: ProvisionArgs<N>) => ProvisionedRef<ExposeOf<N>>;
|
|
650
|
+
interface ModuleBuilder {
|
|
651
|
+
/** Registers an owned child (resource, service or module) under a stable id. */
|
|
652
|
+
readonly provision: SharedProvision & ProvisionInModule;
|
|
653
|
+
}
|
|
654
|
+
type AppRootProvision = ProvisionValue & SharedProvision & ProvisionInAppRoot;
|
|
645
655
|
/** Dependency map: name → the slot the service declares. Only declarations are admitted, never a concrete ResourceNode. */
|
|
646
656
|
type Deps = Record<string, DependencyEnd<any, any>>;
|
|
647
657
|
/** Output-port map: name → the Contract a service exposes for others to depend on. */
|
|
648
658
|
type Expose = Readonly<Record<string, AnyContract>>;
|
|
659
|
+
/** What a value resource holds: a secret source or a param source, known only at boot. */
|
|
660
|
+
type SourceValue = (SecretSource | ParamSource) & RuntimeValue<unknown>;
|
|
661
|
+
/** 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. */
|
|
662
|
+
type ValueResourceNode<V extends SourceValue = SourceValue> = ResourceNode<undefined, Record<never, never>> & {
|
|
663
|
+
readonly [VALUE_RESOURCE]: V;
|
|
664
|
+
};
|
|
649
665
|
//#endregion
|
|
650
666
|
//#region src/graph-types.d.ts
|
|
651
667
|
/** Path-derived: root-scope children are bare ids ("auth", "db"); a nested module's own children dot-join under its address ("auth.db"). */
|
|
@@ -665,8 +681,6 @@ interface RootInputField {
|
|
|
665
681
|
interface AppConfigurationRead {
|
|
666
682
|
/** 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
683
|
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
684
|
}
|
|
671
685
|
interface GraphNode {
|
|
672
686
|
readonly id: NodeId;
|
|
@@ -732,31 +746,32 @@ interface InputBindingUse {
|
|
|
732
746
|
/** The binding object supplied at provision. */
|
|
733
747
|
readonly binding: unknown;
|
|
734
748
|
}
|
|
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
749
|
interface ParamBinding {
|
|
744
750
|
/** The graph address of the service that declares the param. */
|
|
745
751
|
readonly serviceAddress: NodeId;
|
|
746
752
|
/** The param name on that service. */
|
|
747
753
|
readonly slot: string;
|
|
748
|
-
/** A literal value
|
|
754
|
+
/** A literal value, schema-validated by `buildConfig`. */
|
|
749
755
|
readonly binding: unknown;
|
|
750
756
|
}
|
|
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. */
|
|
757
|
+
/** 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
758
|
interface SecretSourceUse {
|
|
753
759
|
/** The source, as its target built it. Core never reads its payload. */
|
|
754
760
|
readonly source: SecretSource;
|
|
755
|
-
/** A service whose final binding holds it, if one does. Otherwise the module whose input holds it. */
|
|
761
|
+
/** A service whose final binding holds it, if one does. Otherwise the secret value resource itself, or the module whose input holds it. */
|
|
756
762
|
readonly address: NodeId;
|
|
757
763
|
/** That node's kind. */
|
|
758
764
|
readonly nodeKind: 'service' | 'module' | 'resource';
|
|
759
765
|
}
|
|
766
|
+
/** One service reading one value resource's value. */
|
|
767
|
+
interface ValueRead {
|
|
768
|
+
/** The service whose resolved binding holds the value. */
|
|
769
|
+
readonly reader: NodeId;
|
|
770
|
+
/** The address of the value resource. */
|
|
771
|
+
readonly resource: NodeId;
|
|
772
|
+
/** The dotted key path in the service's input binding; `''` for the whole binding. */
|
|
773
|
+
readonly path: string;
|
|
774
|
+
}
|
|
760
775
|
interface Graph {
|
|
761
776
|
readonly root: GraphNode;
|
|
762
777
|
/** Root + one per input, topo-ordered (deps first). */
|
|
@@ -768,15 +783,17 @@ interface Graph {
|
|
|
768
783
|
readonly authoredEdges: readonly AuthoredEdge[];
|
|
769
784
|
/** Every service input binding a `provision()` call supplied (ADR-0042). */
|
|
770
785
|
readonly inputBindings: readonly InputBindingUse[];
|
|
771
|
-
/** Every service param bound at provision
|
|
786
|
+
/** Every service param bound at provision; unbound params are absent here and fall back to their `default` (see `buildConfig`). */
|
|
772
787
|
readonly params: readonly ParamBinding[];
|
|
773
|
-
/** Every secret source a binding names,
|
|
788
|
+
/** Every secret source a binding names, and every secret value resource, once each (ADR-0029). */
|
|
774
789
|
readonly secretSources: readonly SecretSourceUse[];
|
|
790
|
+
/** Each service that reads a value resource's value, and where in its binding it reads it. */
|
|
791
|
+
readonly valueReads: readonly ValueRead[];
|
|
775
792
|
/** What this Load read from the app configuration (ADR-0062). Empty when Load was given none. */
|
|
776
793
|
readonly appConfigurationRead: AppConfigurationRead;
|
|
777
794
|
}
|
|
778
795
|
//#endregion
|
|
779
|
-
//#region ../../0-framework/1-core/core/dist/app-config-
|
|
796
|
+
//#region ../../0-framework/1-core/core/dist/app-config-CxdIiCvU.d.mts
|
|
780
797
|
//#region src/container-transport.d.ts
|
|
781
798
|
/**
|
|
782
799
|
* Carries resolved containers from the CLI process into the alchemy process
|
|
@@ -850,19 +867,14 @@ interface ContainerDescriptor<I extends ContainerInstance = ContainerInstance, C
|
|
|
850
867
|
//#region src/preflight-transport.d.ts
|
|
851
868
|
/** A string only this extension reads back, or `undefined` when it has nothing to carry. */
|
|
852
869
|
type PreflightPayload = string | undefined;
|
|
853
|
-
/** Where a platform variable is named: a service's input field,
|
|
870
|
+
/** Where a platform variable is named: a service's input field, or a resource no service reads. */
|
|
854
871
|
type PlatformVariableReader = {
|
|
855
872
|
readonly kind: 'field';
|
|
856
873
|
readonly service: string;
|
|
857
874
|
readonly path: string;
|
|
858
|
-
} | {
|
|
859
|
-
readonly kind: 'param';
|
|
860
|
-
readonly service: string;
|
|
861
|
-
readonly param: string;
|
|
862
875
|
} | {
|
|
863
876
|
readonly kind: 'unread';
|
|
864
877
|
readonly node: string;
|
|
865
|
-
readonly nodeKind: 'module' | 'resource';
|
|
866
878
|
};
|
|
867
879
|
/** A platform variable with no value that nothing requires, with its readers and the commands that set it. */
|
|
868
880
|
interface UnsetPlatformVariable {
|
|
@@ -911,7 +923,7 @@ interface ProvisionerDescriptor {
|
|
|
911
923
|
/**
|
|
912
924
|
* The phased service SPI. `P` and `S` are the descriptor's OWN intra-node
|
|
913
925
|
* handoff types — provision's product consumed by serialize/deploy, and
|
|
914
|
-
* serialize's product consumed by deploy. Core threads them through without
|
|
926
|
+
* serialize's product consumed by package/deploy. Core threads them through without
|
|
915
927
|
* inspection; only the descriptor that writes them reads them.
|
|
916
928
|
*
|
|
917
929
|
* Method syntax (not property-arrow) is required: the heterogeneous
|
|
@@ -935,9 +947,10 @@ interface ServiceLowering<P = unknown, S = unknown> {
|
|
|
935
947
|
/**
|
|
936
948
|
* Prints the bootstrap and assembles the deployable artifact from the
|
|
937
949
|
* app-built bundle. Must be byte-deterministic: an unchanged service noops
|
|
938
|
-
* on redeploy.
|
|
950
|
+
* on redeploy. `serialized` is this service's `serialize` product. It must
|
|
951
|
+
* not write a secret, or a value the deploy has not resolved, into the artifact.
|
|
939
952
|
*/
|
|
940
|
-
package(ctx: LowerContext, input: PackageInput): Effect.Effect<Artifact, unknown, unknown>;
|
|
953
|
+
package(ctx: LowerContext, input: PackageInput, serialized: S): Effect.Effect<Artifact, unknown, unknown>;
|
|
941
954
|
/** 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
955
|
deploy(ctx: LowerContext, provisioned: P, artifact: Artifact, serialized: S): Effect.Effect<LoweredResult, unknown, unknown>;
|
|
943
956
|
/**
|
|
@@ -1047,7 +1060,7 @@ interface LowerOptions {
|
|
|
1047
1060
|
readonly name: string;
|
|
1048
1061
|
/** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; the generated stack files always pass it. */
|
|
1049
1062
|
readonly environment?: string;
|
|
1050
|
-
/** What the first process's Load read from the app configuration (ADR-0062), from the app configuration file. Load takes the root's input
|
|
1063
|
+
/** What the first process's Load read from the app configuration (ADR-0062), from the app configuration file. Load takes the root's input from it. The generated stack files pass it. */
|
|
1051
1064
|
readonly appConfigurationRead?: AppConfigurationRead;
|
|
1052
1065
|
/** 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. */
|
|
1053
1066
|
readonly firstProcessNodeAddresses?: readonly string[];
|
|
@@ -1330,8 +1343,8 @@ interface LocalTargetDescriptor {
|
|
|
1330
1343
|
providers(input: LocalTargetProvidersInput): Layer.Layer<never>;
|
|
1331
1344
|
/** A stable local identity — resolved without any platform call. */
|
|
1332
1345
|
readonly container: ContainerDescriptor;
|
|
1333
|
-
/**
|
|
1334
|
-
preflight?(input: PreflightInput): Promise<
|
|
1346
|
+
/** 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. */
|
|
1347
|
+
preflight?(input: PreflightInput): Promise<DevPreflightResult>;
|
|
1335
1348
|
/** 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
1349
|
emulators?(input: LocalTargetEmulatorsInput): Promise<void>;
|
|
1337
1350
|
/** The dev session's view of the running app. Core renders it and never learns an emulator's API. */
|
|
@@ -1346,6 +1359,12 @@ interface LocalTargetDescriptor {
|
|
|
1346
1359
|
*/
|
|
1347
1360
|
current?(input: LocalTargetCurrentInput): Promise<LocalTargetCurrentApp | undefined>;
|
|
1348
1361
|
}
|
|
1362
|
+
/** What a local target's preflight found. */
|
|
1363
|
+
interface DevPreflightResult {
|
|
1364
|
+
readonly payload: PreflightPayload;
|
|
1365
|
+
/** The text of each plain platform variable a service reads, by name. Never a secret. */
|
|
1366
|
+
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
1367
|
+
}
|
|
1349
1368
|
interface LocalTargetCurrentInput {
|
|
1350
1369
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1351
1370
|
readonly devDir: string;
|
|
@@ -1398,9 +1417,9 @@ interface LocalTargetProvidersInput {
|
|
|
1398
1417
|
readonly container: ContainerInstance | undefined;
|
|
1399
1418
|
/** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
|
|
1400
1419
|
readonly devDir: string;
|
|
1401
|
-
/** The text of each
|
|
1402
|
-
readonly
|
|
1403
|
-
/** The app secrets the graph's
|
|
1420
|
+
/** The text of each plain platform variable a service reads, by name. Never a secret. */
|
|
1421
|
+
readonly plainVariableText: Readonly<Record<string, string>>;
|
|
1422
|
+
/** The app secrets the graph's platform secrets name, which the first process handed the second. A local deployment takes the text its secret `$platform` markers name from it. */
|
|
1404
1423
|
readonly namedSecrets: NamedSecrets;
|
|
1405
1424
|
}
|
|
1406
1425
|
interface LocalTargetEmulatorsInput {
|
|
@@ -1486,7 +1505,7 @@ interface ConfigAdapterInput {
|
|
|
1486
1505
|
type ConfigValues = Readonly<Record<string, unknown>>;
|
|
1487
1506
|
/** 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
1507
|
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
|
|
1508
|
+
/** 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
1509
|
type AppConfiguration = Readonly<Record<string, unknown>>;
|
|
1491
1510
|
/** 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 its second process the values under the secrets keys of the graph's secret sources, and Composer redacts those values wherever it prints. */
|
|
1492
1511
|
type AppSecrets = Readonly<Record<string, string>>;
|
|
@@ -1551,7 +1570,7 @@ interface NotOk<F> {
|
|
|
1551
1570
|
*/
|
|
1552
1571
|
type Result$1<T, F> = Ok<T> | NotOk<F>;
|
|
1553
1572
|
//#endregion
|
|
1554
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-
|
|
1573
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-DDe8SH4o.d.mts
|
|
1555
1574
|
//#region src/composer-config.d.ts
|
|
1556
1575
|
/** Composer's configuration and the `prisma.config.ts` that declares it. */
|
|
1557
1576
|
interface ComposerConfigSource {
|
|
@@ -1709,6 +1728,13 @@ type DevEvent =
|
|
|
1709
1728
|
{
|
|
1710
1729
|
readonly kind: 'values-changed';
|
|
1711
1730
|
} |
|
|
1731
|
+
/** 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. */
|
|
1732
|
+
{
|
|
1733
|
+
readonly kind: 'value-reads-changed';
|
|
1734
|
+
readonly added: readonly string[];
|
|
1735
|
+
readonly removed: readonly string[];
|
|
1736
|
+
readonly changed: readonly string[];
|
|
1737
|
+
} |
|
|
1712
1738
|
/** The app keeps running, still watching. */
|
|
1713
1739
|
{
|
|
1714
1740
|
readonly kind: 'converge-failed';
|
|
@@ -1795,7 +1821,7 @@ interface DeploymentSummary {
|
|
|
1795
1821
|
readonly nodes: readonly DeployedNodeSummary[];
|
|
1796
1822
|
}
|
|
1797
1823
|
//#endregion
|
|
1798
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
1824
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-BuX95QnN.d.mts
|
|
1799
1825
|
//#region src/operations/deploy.d.ts
|
|
1800
1826
|
/** A deploy step. `assemble-service` steps run inside `assemble`, one per service. */
|
|
1801
1827
|
type DeployStep = {
|
|
@@ -1913,7 +1939,7 @@ declare function devUrl(input: DevUrlInput): Promise<Result$1<DevUrl, CliStructu
|
|
|
1913
1939
|
/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */
|
|
1914
1940
|
declare function devStop(input: DevStopInput): Promise<Result$1<DevStopped, CliStructuredError>>;
|
|
1915
1941
|
//#endregion
|
|
1916
|
-
//#region ../../0-framework/3-tooling/cli/dist/family-
|
|
1942
|
+
//#region ../../0-framework/3-tooling/cli/dist/family-CUPY2qjp.d.mts
|
|
1917
1943
|
//#region src/family/family.d.ts
|
|
1918
1944
|
/**
|
|
1919
1945
|
* The control-plane operations the family's handlers call. These are the
|
|
@@ -1939,7 +1965,7 @@ interface CreateComposerFamilyOptions {
|
|
|
1939
1965
|
readonly redirects?: readonly RedirectSpec[] | undefined;
|
|
1940
1966
|
}
|
|
1941
1967
|
//#endregion
|
|
1942
|
-
//#region ../../0-framework/3-tooling/cli/dist/redaction-
|
|
1968
|
+
//#region ../../0-framework/3-tooling/cli/dist/redaction-CqdeMBKw.d.mts
|
|
1943
1969
|
//#region src/redaction.d.ts
|
|
1944
1970
|
/** A value under a secrets key, with that key. */
|
|
1945
1971
|
interface KnownSecret {
|
|
@@ -1965,4 +1991,4 @@ declare class KnownSecrets {
|
|
|
1965
1991
|
}
|
|
1966
1992
|
//#endregion
|
|
1967
1993
|
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-
|
|
1994
|
+
//# sourceMappingURL=redaction-CqdeMBKw-B6ldtfDI.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redaction-CqdeMBKw-B6ldtfDI.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/errors.d.mts","../../../0-framework/0-foundation/foundation/dist/secret-CHOw4LBU.d.mts","../../../0-framework/0-foundation/foundation/dist/pointer-DclJZFQi.d.mts","../../../../node_modules/@standard-schema/spec/dist/index.d.ts","../../../0-framework/1-core/core/dist/graph-types-Bzj1fahC.d.mts","../../../0-framework/1-core/core/dist/app-config-CxdIiCvU.d.mts","../../../0-framework/3-tooling/assemble/dist/index.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-DDe8SH4o.d.mts","../../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-BuX95QnN.d.mts","../../../0-framework/3-tooling/cli/dist/family-CUPY2qjp.d.mts","../../../0-framework/3-tooling/cli/dist/redaction-CqdeMBKw.d.mts"],"x_google_ignoreList":[3],"mappings":";;;;;;;UACU,wBAAwB;WACvB;WACA;WACA;WACA;aACE;aACA;;WAEF;WACA,OAAO;WACP;;;;;;;;UAwBD;WACC;WACA;WACA;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;;;;;;;;;;;;cAoBG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA;aACA;eACE;eACA;;aAEF,OAAO;aACP;aACA;;;;;EAKX,cAAc;;;;;SAKP,GAAG,iBAAiB,SAAS;;;;;cCjGxB;cACA,UAAU;;YAEZ;EACV,YAAY,OAAO;;EAEnB,UAAU;EACV;EACA;EACA;GACC,OAAO;;;KAGL,eAAe;;;;cCZN;cACA;;KAET;UACK,gBAAgB,GAAG,UAAU;YAC3B,UAAU;YACV,gBAAgB;;;KAGvB,QAAQ,KAAK,gBAAgB,mBAAmB,IAAI,cAAc,UAAU;;;;UCVvE,gBAAgB,iBAAiB,SAAS;;WAEvC,aAAa,gBAAgB,MAAM,OAAO;;kBAErC;;YAEJ,MAAM,iBAAiB,SAAS;;aAE7B;;aAEA;;aAEA,QAAQ,MAAM,OAAO;;;YAGxB,MAAM,iBAAiB,SAAS;;aAE7B,OAAO;;aAEP,QAAQ;;;OAGhB,WAAW,eAAe,mBAAmB,YAAY;;OAEzD,YAAY,eAAe,mBAAmB,YAAY;;;UAGzD,iBAAiB,iBAAiB,SAAS;;WAExC,aAAa,iBAAi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 var CliStructuredError = class extends Error {
|
|
|
136
136
|
return candidate.name === "CliStructuredError" && typeof candidate.code === "string" && typeof candidate.toEnvelope === "function";
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
|
+
function quotedList(names) {
|
|
140
|
+
const quoted = names.map((name) => `"${name}"`);
|
|
141
|
+
const last = quoted.pop() ?? "";
|
|
142
|
+
return quoted.length === 0 ? last : `${quoted.join(", ")} and ${last}`;
|
|
143
|
+
}
|
|
139
144
|
//#endregion
|
|
140
145
|
//#region ../../0-framework/0-foundation/foundation/dist/result.mjs
|
|
141
146
|
/**
|
|
@@ -224,6 +229,6 @@ function okVoid() {
|
|
|
224
229
|
return OK_VOID;
|
|
225
230
|
}
|
|
226
231
|
//#endregion
|
|
227
|
-
export {
|
|
232
|
+
export { quotedList as a, CliStructuredError as i, ok as n, InternalError as o, okVoid as r, blindCast as s, notOk as t };
|
|
228
233
|
|
|
229
|
-
//# sourceMappingURL=result-
|
|
234
|
+
//# sourceMappingURL=result-DlBttLS8.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-sR7PBi61.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/casts-DpaahrlC.mjs","../../../0-framework/0-foundation/foundation/dist/internal-error-Dfur7Zqt.mjs","../../../0-framework/0-foundation/foundation/dist/errors.mjs","../../../0-framework/0-foundation/foundation/dist/result.mjs"],"sourcesContent":["//#region src/casts.ts\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n/**\n* Type-checked, runtime pass-through alternative to a bare `as Type` cast.\n*\n* Use `castAs` when the value already satisfies the target type but you want to make\n* the type assertion explicit at the call site — for example, when an inferred type is\n* wider than the type you want to publish, or when a literal object should be tagged\n* with its nominal interface. Unlike {@link blindCast}, the compiler still checks that\n* the value is assignable to the target type, so this helper cannot smuggle in an\n* unsafe assertion.\n*\n* `castAs` exists alongside `blindCast` so authors pick the right name at the call\n* site: a `castAs` is type-checked and benign; a `blindCast` is the unsafe escape\n* hatch. The split makes review faster — readers know which casts to scrutinize and\n* which are pure annotations.\n*\n* @example\n* ```typescript\n* interface FancyObject {\n* key: string;\n* keyTwo: {\n* subKey: string;\n* subKeyTwo: number;\n* };\n* }\n*\n* const typedObject = castAs<FancyObject>({\n* key: 'Chookede',\n* keyTwo: {\n* subKey: 'Choookeeeee',\n* subKeyTwo: 2,\n* },\n* });\n* ```\n*\n* @typeParam Type - The type to constrain and tag the value with. The value must be assignable to `Type`.\n*/\nfunction castAs(value) {\n\treturn value;\n}\n//#endregion\nexport { castAs as n, blindCast as t };\n\n//# sourceMappingURL=casts-DpaahrlC.mjs.map","//#region src/internal-error.ts\n/**\n* A bug in Prisma ORM, not a user error. Never catch this except at the\n* outermost boundary for crash reporting — an InternalError means an invariant\n* broke and the process cannot reliably continue. User-facing failures use\n* `structuredError` with a dotted code instead.\n*/\nvar InternalError = class extends Error {\n\tisPrismaInternalError = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"InternalError\";\n\t}\n};\nfunction isInternalError(e) {\n\treturn typeof e === \"object\" && e !== null && \"isPrismaInternalError\" in e && e.isPrismaInternalError === true;\n}\nfunction assertNever(value, message) {\n\tthrow new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);\n}\n//#endregion\nexport { assertNever as n, isInternalError as r, InternalError as t };\n\n//# sourceMappingURL=internal-error-Dfur7Zqt.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as describeKind } from \"./describe-kind-Cpm_euxo.mjs\";\nimport { n as assertNever, r as isInternalError, t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/defined.ts\n/**\n* Returns an object with the key/value if value is defined, otherwise an empty object.\n*\n* Use with spread to conditionally include optional properties while satisfying\n* exactOptionalPropertyTypes. This is explicit about which properties are optional\n* and won't inadvertently strip other undefined values.\n*\n* @example\n* ```typescript\n* // Instead of:\n* const obj = {\n* required: 'value',\n* ...(optional ? { optional } : {}),\n* };\n*\n* // Use:\n* const obj = {\n* required: 'value',\n* ...ifDefined('optional', optional),\n* };\n* ```\n*/\nfunction ifDefined(key, value) {\n\treturn value !== void 0 ? blindCast({ [key]: value }) : {};\n}\n//#endregion\n//#region src/cli-structured-error.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `./structured-error.ts`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See ADR 239 in\n* prisma/prisma and composer's ADR-0044 for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = blindCast(error);\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n//#endregion\n//#region src/structured-error.ts\nconst STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\\.[A-Z][A-Z0-9_]*$/;\nfunction isStructuredError(e) {\n\treturn typeof e === \"object\" && e !== null && \"code\" in e && typeof e.code === \"string\" && STRUCTURED_CODE_RE.test(e.code) && \"message\" in e && typeof e.message === \"string\";\n}\nfunction structuredError(code, message, options) {\n\tconst error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"StructuredError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"where\", options?.where),\n\t\t...ifDefined(\"severity\", options?.severity),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t});\n}\nconst DOCS_BASE = `https://docs.prisma.io/docs/orm/next/reference/error-reference`;\nfunction docsUrlFor(code) {\n\treturn `${DOCS_BASE}#${code}`;\n}\n//#endregion\nexport { CliStructuredError, DOCS_BASE, InternalError, assertNever, describeKind, docsUrlFor, isInternalError, isStructuredError, structuredError };\n\n//# sourceMappingURL=errors.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,UAAU,OAAO;CACzB,OAAO;AACR;;;;;;;;;AC/BA,IAAI,gBAAgB,cAAc,MAAM;CACvC,wBAAwB;CACxB,YAAY,SAAS,SAAS;EAC7B,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;CACb;AACD;;;;;;;;;;;;;;;;;;;;;;;;;ACaA,SAAS,UAAU,KAAK,OAAO;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I,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS,UAAU,cAAc;OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,oCAAoC;EACzE,OAAO,KAAK;CACb;;;;CAIA,OAAO,GAAG,OAAO;EAChB,OAAO,UAAU,IAAI,WAAW,MAAM,KAAK,CAAC;CAC7C;;;;CAIA,OAAO,MAAM,SAAS;EACrB,OAAO,UAAU,IAAI,WAAW,OAAO,OAAO,CAAC;CAChD;;;;;CAKA,WAAW;EACV,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACxE,OAAO,KAAK;CACb;;;;;CAKA,cAAc;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACvE,OAAO,KAAK;CACb;AACD;;;;AAIA,SAAS,GAAG,OAAO;CAClB,OAAO,WAAW,GAAG,KAAK;AAC3B;;;;AAIA,SAAS,MAAM,SAAS;CACvB,OAAO,WAAW,MAAM,OAAO;AAChC;;;;;AAKA,MAAM,UAAU,WAAW,GAAG,KAAK,CAAC;;;;;AAKpC,SAAS,SAAS;CACjB,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"result-DlBttLS8.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/casts-DpaahrlC.mjs","../../../0-framework/0-foundation/foundation/dist/internal-error-Dfur7Zqt.mjs","../../../0-framework/0-foundation/foundation/dist/errors.mjs","../../../0-framework/0-foundation/foundation/dist/result.mjs"],"sourcesContent":["//#region src/casts.ts\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n/**\n* Type-checked, runtime pass-through alternative to a bare `as Type` cast.\n*\n* Use `castAs` when the value already satisfies the target type but you want to make\n* the type assertion explicit at the call site — for example, when an inferred type is\n* wider than the type you want to publish, or when a literal object should be tagged\n* with its nominal interface. Unlike {@link blindCast}, the compiler still checks that\n* the value is assignable to the target type, so this helper cannot smuggle in an\n* unsafe assertion.\n*\n* `castAs` exists alongside `blindCast` so authors pick the right name at the call\n* site: a `castAs` is type-checked and benign; a `blindCast` is the unsafe escape\n* hatch. The split makes review faster — readers know which casts to scrutinize and\n* which are pure annotations.\n*\n* @example\n* ```typescript\n* interface FancyObject {\n* key: string;\n* keyTwo: {\n* subKey: string;\n* subKeyTwo: number;\n* };\n* }\n*\n* const typedObject = castAs<FancyObject>({\n* key: 'Chookede',\n* keyTwo: {\n* subKey: 'Choookeeeee',\n* subKeyTwo: 2,\n* },\n* });\n* ```\n*\n* @typeParam Type - The type to constrain and tag the value with. The value must be assignable to `Type`.\n*/\nfunction castAs(value) {\n\treturn value;\n}\n//#endregion\nexport { castAs as n, blindCast as t };\n\n//# sourceMappingURL=casts-DpaahrlC.mjs.map","//#region src/internal-error.ts\n/**\n* A bug in Prisma ORM, not a user error. Never catch this except at the\n* outermost boundary for crash reporting — an InternalError means an invariant\n* broke and the process cannot reliably continue. User-facing failures use\n* `structuredError` with a dotted code instead.\n*/\nvar InternalError = class extends Error {\n\tisPrismaInternalError = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"InternalError\";\n\t}\n};\nfunction isInternalError(e) {\n\treturn typeof e === \"object\" && e !== null && \"isPrismaInternalError\" in e && e.isPrismaInternalError === true;\n}\nfunction assertNever(value, message) {\n\tthrow new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);\n}\n//#endregion\nexport { assertNever as n, isInternalError as r, InternalError as t };\n\n//# sourceMappingURL=internal-error-Dfur7Zqt.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as describeKind } from \"./describe-kind-Cpm_euxo.mjs\";\nimport { n as assertNever, r as isInternalError, t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/defined.ts\n/**\n* Returns an object with the key/value if value is defined, otherwise an empty object.\n*\n* Use with spread to conditionally include optional properties while satisfying\n* exactOptionalPropertyTypes. This is explicit about which properties are optional\n* and won't inadvertently strip other undefined values.\n*\n* @example\n* ```typescript\n* // Instead of:\n* const obj = {\n* required: 'value',\n* ...(optional ? { optional } : {}),\n* };\n*\n* // Use:\n* const obj = {\n* required: 'value',\n* ...ifDefined('optional', optional),\n* };\n* ```\n*/\nfunction ifDefined(key, value) {\n\treturn value !== void 0 ? blindCast({ [key]: value }) : {};\n}\n//#endregion\n//#region src/cli-structured-error.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `./structured-error.ts`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See ADR 239 in\n* prisma/prisma and composer's ADR-0044 for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = blindCast(error);\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n//#endregion\n//#region src/quoted-list.ts\nfunction quotedList(names) {\n\tconst quoted = names.map((name) => `\"${name}\"`);\n\tconst last = quoted.pop() ?? \"\";\n\treturn quoted.length === 0 ? last : `${quoted.join(\", \")} and ${last}`;\n}\n//#endregion\n//#region src/structured-error.ts\nconst STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\\.[A-Z][A-Z0-9_]*$/;\nfunction isStructuredError(e) {\n\treturn typeof e === \"object\" && e !== null && \"code\" in e && typeof e.code === \"string\" && STRUCTURED_CODE_RE.test(e.code) && \"message\" in e && typeof e.message === \"string\";\n}\nfunction structuredError(code, message, options) {\n\tconst error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"StructuredError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"where\", options?.where),\n\t\t...ifDefined(\"severity\", options?.severity),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t});\n}\nconst DOCS_BASE = `https://docs.prisma.io/docs/orm/next/reference/error-reference`;\nfunction docsUrlFor(code) {\n\treturn `${DOCS_BASE}#${code}`;\n}\n//#endregion\nexport { CliStructuredError, DOCS_BASE, InternalError, assertNever, describeKind, docsUrlFor, isInternalError, isStructuredError, quotedList, structuredError };\n\n//# sourceMappingURL=errors.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a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,cAAc,kCAAkC;EACxE,OAAO,KAAK;CACb;;;;;CAKA,cAAc;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACvE,OAAO,KAAK;CACb;AACD;;;;AAIA,SAAS,GAAG,OAAO;CAClB,OAAO,WAAW,GAAG,KAAK;AAC3B;;;;AAIA,SAAS,MAAM,SAAS;CACvB,OAAO,WAAW,MAAM,OAAO;AAChC;;;;;AAKA,MAAM,UAAU,WAAW,GAAG,KAAK,CAAC;;;;;AAKpC,SAAS,SAAS;CACjB,OAAO;AACR"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as StreamRedactor } from "./redaction-
|
|
2
|
-
import { i as CliStructuredError } from "./result-
|
|
1
|
+
import { r as StreamRedactor } from "./redaction-C-NnlVUh-xg-a8RGt.mjs";
|
|
2
|
+
import { i as CliStructuredError } from "./result-DlBttLS8.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
6
|
import spawn from "cross-spawn";
|
|
7
|
-
//#region ../../0-framework/3-tooling/cli/dist/run-alchemy-
|
|
7
|
+
//#region ../../0-framework/3-tooling/cli/dist/run-alchemy-CyciV8i0.mjs
|
|
8
8
|
/**
|
|
9
9
|
* Which Alchemy CLI runs a generated stack file: the `alchemy` that
|
|
10
10
|
* `@prisma/composer` depends on, found from the app the way the stack file's
|
|
@@ -233,4 +233,4 @@ function spawnCommandLine(line, redactedValues, outputs = process) {
|
|
|
233
233
|
//#endregion
|
|
234
234
|
export { spawnAlchemy as i, alchemyInvocation as n, reproduceCommand as r, alchemyCommandLine as t };
|
|
235
235
|
|
|
236
|
-
//# sourceMappingURL=run-alchemy-
|
|
236
|
+
//# sourceMappingURL=run-alchemy-CyciV8i0-Djfa6x3a.mjs.map
|