@prisma/composer 0.1.0-dev.1
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/LICENSE +201 -0
- package/dist/app-config-CpWN1ZfP-CZ1c6Eqk.d.mts +325 -0
- package/dist/assertions.d.mts +31 -0
- package/dist/assertions.mjs +35 -0
- package/dist/assertions.mjs.map +1 -0
- package/dist/bin.mjs +1229 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/casts-Ci5rYYaR.mjs +82 -0
- package/dist/casts-Ci5rYYaR.mjs.map +1 -0
- package/dist/casts.d.mts +78 -0
- package/dist/casts.mjs +2 -0
- package/dist/config-D-h0FACe.d.mts +1 -0
- package/dist/config-ad92ubCB-D0-dZUgA.d.mts +568 -0
- package/dist/config.d.mts +3 -0
- package/dist/config.mjs +9 -0
- package/dist/config.mjs.map +1 -0
- package/dist/deploy-D-h0FACe.d.mts +1 -0
- package/dist/deploy.d.mts +3 -0
- package/dist/deploy.mjs +305 -0
- package/dist/deploy.mjs.map +1 -0
- package/dist/dist-B0axxnBf.mjs +193 -0
- package/dist/dist-B0axxnBf.mjs.map +1 -0
- package/dist/graph-BmrUEdo9-6Oq1hSmS.mjs +688 -0
- package/dist/graph-BmrUEdo9-6Oq1hSmS.mjs.map +1 -0
- package/dist/graph-DXuL5tN6-BeAHOb0u.d.mts +18 -0
- package/dist/index-C1f1Aot7.d.mts +16 -0
- package/dist/index-Cy4C23u1.d.mts +32 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +3 -0
- package/dist/nextjs-control.d.mts +14 -0
- package/dist/nextjs-control.mjs +105 -0
- package/dist/nextjs-control.mjs.map +1 -0
- package/dist/nextjs.d.mts +2 -0
- package/dist/nextjs.mjs +12 -0
- package/dist/nextjs.mjs.map +1 -0
- package/dist/node-control.d.mts +11 -0
- package/dist/node-control.mjs +142 -0
- package/dist/node-control.mjs.map +1 -0
- package/dist/node.d.mts +23 -0
- package/dist/node.mjs +12 -0
- package/dist/node.mjs.map +1 -0
- package/dist/report.d.mts +17 -0
- package/dist/report.mjs +79 -0
- package/dist/report.mjs.map +1 -0
- package/dist/rpc.d.mts +53 -0
- package/dist/rpc.mjs +184 -0
- package/dist/rpc.mjs.map +1 -0
- package/dist/testing.d.mts +23 -0
- package/dist/testing.mjs +45 -0
- package/dist/testing.mjs.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2026] [Prisma Data, Inc]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { M as ResourceNode, V as ServiceNode, d as Graph, k as ProvisionNeed, n as Config, t as BuildAdapter, x as NodeId, y as ModuleNode } from "./config-ad92ubCB-D0-dZUgA.mjs";
|
|
2
|
+
import "./graph-DXuL5tN6-BeAHOb0u.mjs";
|
|
3
|
+
import * as Alchemy from "alchemy";
|
|
4
|
+
import { Input, StackServices } from "alchemy";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import { State } from "alchemy/State/State";
|
|
8
|
+
//#region ../../0-framework/1-core/core/dist/app-config-CpWN1ZfP.d.mts
|
|
9
|
+
//#region src/deploy.d.ts
|
|
10
|
+
/** The Layer shape every Alchemy state store must satisfy — what `LowerOptions.state` and `PrismaAppConfig.state` both traffic in. */
|
|
11
|
+
type AlchemyStateLayer = Layer.Layer<State, never, StackServices>;
|
|
12
|
+
/**
|
|
13
|
+
* An extension's application-level descriptor: shared infrastructure that runs
|
|
14
|
+
* once per lowering, before any node. Its outputs reach the extension's own
|
|
15
|
+
* SPI calls via LowerContext.application.
|
|
16
|
+
*/
|
|
17
|
+
interface ApplicationDescriptor {
|
|
18
|
+
provision(ctx: LowerContext): Effect.Effect<unknown, unknown, unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One provisioned param need, resolved against the CONSUMER extension's
|
|
22
|
+
* `provisions` registry (ADR-0031). `edgeId` — `${consumerAddress}.${input}`
|
|
23
|
+
* — is the mint's stable resource key, so a provisioner's own resource ids
|
|
24
|
+
* derive from it and stay stable across redeploys.
|
|
25
|
+
*/
|
|
26
|
+
interface ProvisionEdge {
|
|
27
|
+
readonly edgeId: string;
|
|
28
|
+
readonly consumerAddress: string;
|
|
29
|
+
readonly providerAddress: string;
|
|
30
|
+
readonly input: string;
|
|
31
|
+
/** Opaque; forwarded from the param's declared need. Core never reads its payload. */
|
|
32
|
+
readonly need: ProvisionNeed;
|
|
33
|
+
}
|
|
34
|
+
/** One extension-registered provisioner, keyed by a need's brand (ADR-0031). */
|
|
35
|
+
interface ProvisionerDescriptor {
|
|
36
|
+
/** Mints one stable value for one provisioned edge; yields the platform resource, returns an opaque ref core forwards into config. */
|
|
37
|
+
provision(edge: ProvisionEdge): Effect.Effect<unknown, unknown, unknown>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The phased service SPI. `P` and `S` are the descriptor's OWN intra-node
|
|
41
|
+
* handoff types — provision's product consumed by serialize/deploy, and
|
|
42
|
+
* serialize's product consumed by deploy. Core threads them through without
|
|
43
|
+
* inspection; only the descriptor that writes them reads them.
|
|
44
|
+
*
|
|
45
|
+
* Method syntax (not property-arrow) is required: the heterogeneous
|
|
46
|
+
* descriptor registry (`NodeDescriptor`) assigns concrete descriptors to
|
|
47
|
+
* this interface's `unknown` defaults through TypeScript's method
|
|
48
|
+
* bivariance — a property-arrow form is checked contravariantly and breaks
|
|
49
|
+
* that assignment.
|
|
50
|
+
*/
|
|
51
|
+
interface ServiceLowering<P = unknown, S = unknown> {
|
|
52
|
+
/** Makes the platform-specific thing that will host the service — identity-bearing infrastructure only, no code runs. */
|
|
53
|
+
provision(ctx: LowerContext): Effect.Effect<P, unknown, unknown>;
|
|
54
|
+
/**
|
|
55
|
+
* Encodes the typed Config into the service's runtime environment. Boot-side
|
|
56
|
+
* deserialize reverses it through the same serializer. Returns the env-var
|
|
57
|
+
* records so `deploy` can reference them.
|
|
58
|
+
*/
|
|
59
|
+
serialize(ctx: LowerContext, provisioned: P, config: Config): Effect.Effect<S, unknown, unknown>;
|
|
60
|
+
/**
|
|
61
|
+
* Prints the bootstrap and assembles the deployable artifact from the
|
|
62
|
+
* app-built bundle. Must be byte-deterministic: an unchanged service noops
|
|
63
|
+
* on redeploy.
|
|
64
|
+
*/
|
|
65
|
+
package(ctx: LowerContext, input: PackageInput): Effect.Effect<Artifact, unknown, unknown>;
|
|
66
|
+
/** 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. */
|
|
67
|
+
deploy(ctx: LowerContext, provisioned: P, artifact: Artifact, serialized: S): Effect.Effect<LoweredResult, unknown, unknown>;
|
|
68
|
+
}
|
|
69
|
+
/** Input to an extension's package() step: the built bundle and the node's graph address. */
|
|
70
|
+
interface PackageInput {
|
|
71
|
+
/** The build descriptor's normalized output: the bundle dir + the app's runnable. */
|
|
72
|
+
readonly assembled: Bundle;
|
|
73
|
+
/** The node's graph address — baked into the printed bootstrap. */
|
|
74
|
+
readonly address: string;
|
|
75
|
+
}
|
|
76
|
+
/** One node's realization. Runs inside the Alchemy stack effect. */
|
|
77
|
+
type Lowering = (ctx: LowerContext) => Effect.Effect<LoweredResult, unknown, unknown>;
|
|
78
|
+
interface LowerContext {
|
|
79
|
+
readonly id: NodeId;
|
|
80
|
+
/**
|
|
81
|
+
* The node's deployment address: its full, dot-joined hierarchical
|
|
82
|
+
* position in the graph (e.g. "auth.api"). The config-key namespace and
|
|
83
|
+
* the bootstrap parameter.
|
|
84
|
+
*/
|
|
85
|
+
readonly address: string;
|
|
86
|
+
readonly node: ServiceNode | ResourceNode;
|
|
87
|
+
readonly graph: Graph;
|
|
88
|
+
readonly opts: LowerOptions;
|
|
89
|
+
/**
|
|
90
|
+
* The owning extension's application hook product; `undefined` when the
|
|
91
|
+
* extension declares no hook. Core never reads it; the extension narrows
|
|
92
|
+
* it with its own type guard.
|
|
93
|
+
*/
|
|
94
|
+
readonly application: unknown;
|
|
95
|
+
/** Already-lowered deps (topo order). */
|
|
96
|
+
readonly lowered: ReadonlyMap<NodeId, Outputs>;
|
|
97
|
+
/** Every provisioned param value minted this lowering, keyed by edge id (ADR-0031). */
|
|
98
|
+
readonly provisioned: ReadonlyMap<string, unknown>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The values a node provides to its dependents — what a consumer's declared
|
|
102
|
+
* connection params resolve against (buildConfig reads them by param name).
|
|
103
|
+
* Name-keyed and unknown-valued of necessity: core cannot know extension
|
|
104
|
+
* types, and which producer feeds which consumer is decided by the user's
|
|
105
|
+
* graph at runtime. The connection declaration is the contract.
|
|
106
|
+
*/
|
|
107
|
+
type Outputs = Readonly<Record<string, unknown>>;
|
|
108
|
+
/**
|
|
109
|
+
* One thing a node became on the deployment target, RESOLVED — what the report
|
|
110
|
+
* consumer sees. The descriptor names it; core never infers meaning from it.
|
|
111
|
+
* `url` is present ONLY when the descriptor declares the address publicly
|
|
112
|
+
* reachable — a connection string is never a `url`.
|
|
113
|
+
*
|
|
114
|
+
* A descriptor constructing one holds `svc.id` / `deployment.deployedUrl` —
|
|
115
|
+
* `Output<T>` references, not values, because the stack effect runs before
|
|
116
|
+
* Alchemy applies anything. So construction sites traffic in
|
|
117
|
+
* `Input<DeployedEntity>` (Alchemy's own idiom for "this shape, fields possibly
|
|
118
|
+
* unresolved"); apply resolves it before any reader sees it.
|
|
119
|
+
*/
|
|
120
|
+
interface DeployedEntity {
|
|
121
|
+
readonly kind: string;
|
|
122
|
+
readonly id: string;
|
|
123
|
+
readonly url?: string;
|
|
124
|
+
readonly details?: Readonly<Record<string, string>>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* What a node's final lowering phase produces: outputs for dependents,
|
|
128
|
+
* entities for reporting.
|
|
129
|
+
*
|
|
130
|
+
* `entities` is REQUIRED, not optional. "This node became nothing reportable
|
|
131
|
+
* on the deployment target" is a claim, and an optional field lets a
|
|
132
|
+
* descriptor make it by saying nothing at all — no error, no type complaint,
|
|
133
|
+
* no failing test. That is the shared bag's sin in miniature (ADR-0033): a
|
|
134
|
+
* claim made anonymously, with nothing recording that a claim was made. `[]`
|
|
135
|
+
* costs one token and puts the assertion on the record where a reviewer can
|
|
136
|
+
* see it.
|
|
137
|
+
*/
|
|
138
|
+
interface LoweredResult {
|
|
139
|
+
readonly outputs: Outputs;
|
|
140
|
+
readonly entities: readonly Input<DeployedEntity>[];
|
|
141
|
+
}
|
|
142
|
+
/** What one graph node became — in-process only (it holds the node itself, so it never crosses the stack boundary). */
|
|
143
|
+
interface DeployedNode {
|
|
144
|
+
readonly address: string;
|
|
145
|
+
readonly node: ServiceNode | ResourceNode;
|
|
146
|
+
readonly entities: readonly DeployedEntity[];
|
|
147
|
+
}
|
|
148
|
+
/** The result of the Deploy operation: the app and every node it deployed, in topo order. */
|
|
149
|
+
interface DeploymentResult {
|
|
150
|
+
readonly app: string;
|
|
151
|
+
readonly nodes: readonly DeployedNode[];
|
|
152
|
+
}
|
|
153
|
+
interface LowerOptions {
|
|
154
|
+
/** Stack + root node id. */
|
|
155
|
+
readonly name: string;
|
|
156
|
+
readonly bundles: Record<string, Bundle>;
|
|
157
|
+
readonly stage?: string;
|
|
158
|
+
/** Alchemy state store for the stack. Defaults to the config's own state layer. */
|
|
159
|
+
readonly state?: AlchemyStateLayer;
|
|
160
|
+
/**
|
|
161
|
+
* Invoked once per deploy, during apply, with the Deploy operation's result
|
|
162
|
+
* — the app and every node it deployed, resolved, in topo order.
|
|
163
|
+
* Presentation belongs to the caller (the CLI wires its renderer here);
|
|
164
|
+
* core never formats. Absent means no report is assembled and no Action is
|
|
165
|
+
* declared at all.
|
|
166
|
+
*/
|
|
167
|
+
readonly report?: (result: DeploymentResult) => void;
|
|
168
|
+
}
|
|
169
|
+
/** A build descriptor's normalized output: the produced bundle dir plus the app's runnable entry within it. */
|
|
170
|
+
interface Bundle {
|
|
171
|
+
readonly dir: string;
|
|
172
|
+
readonly entry: string;
|
|
173
|
+
}
|
|
174
|
+
/** Shared input shape for every extension's build descriptor. */
|
|
175
|
+
interface AssembleInput {
|
|
176
|
+
readonly build: BuildAdapter;
|
|
177
|
+
/** The service's graph address (e.g. "storefront.web"). Unique per service, so the assembler uses it to name this service's own working directory: `<cwd>/.prisma-composer/artifacts/<address>/`. */
|
|
178
|
+
readonly address: string;
|
|
179
|
+
/** The directory the deploy command was run from. The assembler puts its working directory under it (`<cwd>/.prisma-composer/`), the same place the CLI writes its other generated files. */
|
|
180
|
+
readonly cwd: string;
|
|
181
|
+
}
|
|
182
|
+
/** package()'s product. */
|
|
183
|
+
interface Artifact {
|
|
184
|
+
readonly path: string;
|
|
185
|
+
readonly sha256: string;
|
|
186
|
+
}
|
|
187
|
+
declare class LowerError extends Error {
|
|
188
|
+
constructor(message: string);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Assembles a service's typed Config. Connection params come from the
|
|
192
|
+
* dependency edge's lowered outputs — or, for a param carrying a `provision`
|
|
193
|
+
* need (ADR-0031), from `provisioned` (keyed by edge id): the framework mints
|
|
194
|
+
* it, the producer hands nothing over. The service's own params resolve via
|
|
195
|
+
* `resolveParam` (provision-time binding, then default, then loud
|
|
196
|
+
* unbound-required failure).
|
|
197
|
+
*
|
|
198
|
+
* This is also where the connection contract is enforced: a producer that fails to
|
|
199
|
+
* supply a required param its consumer's connection declares fails the deploy
|
|
200
|
+
* here, naming the edge, rather than reaching the consumer as `undefined`.
|
|
201
|
+
*/
|
|
202
|
+
declare function buildConfig(node: ServiceNode, id: NodeId, graph: Graph, lowered: ReadonlyMap<NodeId, Outputs>, provisioned: ReadonlyMap<string, unknown>): Config;
|
|
203
|
+
/**
|
|
204
|
+
* Joins resolved report entries back to their graph nodes — the last step of a
|
|
205
|
+
* deploy report, run inside the Action with apply's resolved values.
|
|
206
|
+
*
|
|
207
|
+
* The entries cross Alchemy's action-input boundary, so they carry addresses
|
|
208
|
+
* and plain entities only; the graph is held by closure on this side. That
|
|
209
|
+
* split is why this join exists at all, and it is what keeps functions and
|
|
210
|
+
* Standard Schemas (which a node carries, and which the plan's input hash
|
|
211
|
+
* would have to serialize) out of the input.
|
|
212
|
+
*
|
|
213
|
+
* Skips an address the graph no longer holds: entries are data, the graph is
|
|
214
|
+
* truth.
|
|
215
|
+
*/
|
|
216
|
+
declare function joinDeployment(graph: Graph, entries: readonly {
|
|
217
|
+
address: string;
|
|
218
|
+
entities: readonly DeployedEntity[];
|
|
219
|
+
}[]): readonly DeployedNode[];
|
|
220
|
+
/**
|
|
221
|
+
* The state-layer precedence a deploy resolves to: an explicit opts.state
|
|
222
|
+
* always wins; failing that, the config's own (required) state. A pure
|
|
223
|
+
* function so the precedence is testable without booting Alchemy.
|
|
224
|
+
*/
|
|
225
|
+
declare function resolveStateLayer(opts: LowerOptions, config: PrismaAppConfig): AlchemyStateLayer;
|
|
226
|
+
/**
|
|
227
|
+
* All configured extensions' providers merged, config array order — an
|
|
228
|
+
* extension without `providers` is skipped; no used-extensions-only
|
|
229
|
+
* filtering (ADR-0017's pinned providers rule).
|
|
230
|
+
*/
|
|
231
|
+
declare function mergedProviders(config: PrismaAppConfig): Layer.Layer<never>;
|
|
232
|
+
/**
|
|
233
|
+
* Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.
|
|
234
|
+
* Fails with LowerError or whatever an extension's lowering raises — the error type is open.
|
|
235
|
+
*/
|
|
236
|
+
declare function lowering(root: ModuleNode, config: PrismaAppConfig, opts: LowerOptions): Effect.Effect<undefined, LowerError, unknown>;
|
|
237
|
+
/**
|
|
238
|
+
* The whole-stack wrapper: Load → route each node through the config's
|
|
239
|
+
* extension registries → an Alchemy Stack (the default export the alchemy
|
|
240
|
+
* CLI consumes).
|
|
241
|
+
*/
|
|
242
|
+
declare function lower(root: ModuleNode, config: PrismaAppConfig, opts: LowerOptions): Effect.Effect<Alchemy.CompiledStack<undefined, any>, import("effect/Config").ConfigError, never>;
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/app-config.d.ts
|
|
245
|
+
/**
|
|
246
|
+
* One extension's control-plane registry: everything the deploy pipeline may
|
|
247
|
+
* look up for a node whose `extension` field names this package. `nodes` is
|
|
248
|
+
* keyed by the node's within-extension ID (`node.type` / `build.type`).
|
|
249
|
+
*/
|
|
250
|
+
interface ExtensionDescriptor {
|
|
251
|
+
/** The extension's package name, e.g. "@prisma/composer-prisma-cloud" — what a node's `extension` field is matched against. */
|
|
252
|
+
readonly id: string;
|
|
253
|
+
/** ONE registry per extension, keyed by node ID. */
|
|
254
|
+
readonly nodes: Record<string, NodeDescriptor>;
|
|
255
|
+
/** Param provisioners this extension supplies, keyed by need brand (ADR-0031). Core resolves a param's ProvisionNeed against the CONSUMER extension's map. */
|
|
256
|
+
readonly provisions?: ReadonlyMap<symbol, ProvisionerDescriptor>;
|
|
257
|
+
/** Once-per-lowering hook — the application's shared infrastructure (e.g. prisma-cloud's Project). */
|
|
258
|
+
readonly application?: ApplicationDescriptor;
|
|
259
|
+
/** The extension's Alchemy providers — merged across all configured extensions (config order). */
|
|
260
|
+
readonly providers?: () => Layer.Layer<never>;
|
|
261
|
+
/**
|
|
262
|
+
* Deploy-time prerequisite check — the CLI runs it once, after the app's
|
|
263
|
+
* Project/Branch are resolved and BEFORE any stack file is written or Alchemy
|
|
264
|
+
* runs. A target uses it to verify platform prerequisites (e.g. that every
|
|
265
|
+
* secret env var in the provision manifest exists for the resolved stage) and
|
|
266
|
+
* throws to abort the deploy. Async: it talks to the platform (ADR-0029).
|
|
267
|
+
*/
|
|
268
|
+
readonly preflight?: (input: PreflightInput) => Promise<void>;
|
|
269
|
+
/**
|
|
270
|
+
* Destroy-time cleanup — the CLI runs it once, after `alchemy destroy`
|
|
271
|
+
* succeeds and BEFORE the stage's Project/Branch are removed. A target uses
|
|
272
|
+
* it to remove infrastructure it owns outside the stack (e.g. the deploy
|
|
273
|
+
* state store, which the destroy above was still reading). Throwing aborts
|
|
274
|
+
* the destroy before the containers go; a target that would rather warn than
|
|
275
|
+
* fail the command handles that itself. Async: it talks to the platform.
|
|
276
|
+
*/
|
|
277
|
+
readonly teardown?: (input: TeardownInput) => Promise<void>;
|
|
278
|
+
}
|
|
279
|
+
/** The resolved deploy context handed to an extension's `preflight` hook. */
|
|
280
|
+
interface PreflightInput {
|
|
281
|
+
/** The loaded application graph — the manifest of prerequisites is read from it (`provisionManifest`). */
|
|
282
|
+
readonly graph: Graph;
|
|
283
|
+
/** The resolved Prisma Cloud Project id. */
|
|
284
|
+
readonly projectId: string;
|
|
285
|
+
/** The resolved Branch id for a named stage; `undefined` for the default (production) stage. */
|
|
286
|
+
readonly branchId: string | undefined;
|
|
287
|
+
/** The stage name (`--stage`), or `undefined` for the default stage — for diagnostics/scope. */
|
|
288
|
+
readonly stage: string | undefined;
|
|
289
|
+
}
|
|
290
|
+
/** The resolved destroy context handed to an extension's `teardown` hook. */
|
|
291
|
+
interface TeardownInput {
|
|
292
|
+
/** The resolved Prisma Cloud Project id. */
|
|
293
|
+
readonly projectId: string;
|
|
294
|
+
/** The resolved Branch id for a named stage; `undefined` for the default (production) stage. */
|
|
295
|
+
readonly branchId: string | undefined;
|
|
296
|
+
/** The stage name (`--stage`), or `undefined` for the default stage — for diagnostics/scope. */
|
|
297
|
+
readonly stage: string | undefined;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* What one registry entry can do. The `kind` discriminant is checked at every
|
|
301
|
+
* lookup site against what the site needs — a resource node looked up against
|
|
302
|
+
* a `service` descriptor is an error naming (extension, type, expected kind).
|
|
303
|
+
*/
|
|
304
|
+
type NodeDescriptor = ({
|
|
305
|
+
readonly kind: 'resource';
|
|
306
|
+
} & Lowering) | ({
|
|
307
|
+
readonly kind: 'service';
|
|
308
|
+
} & ServiceLowering) | {
|
|
309
|
+
readonly kind: 'build';
|
|
310
|
+
assemble(input: AssembleInput): Promise<Bundle>;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* The config file's default export. `extensions` lists every extension the
|
|
314
|
+
* app deploys through; `state` is the ONE state store per deploy — explicit,
|
|
315
|
+
* platform-agnostic, never defaulted by an extension.
|
|
316
|
+
*/
|
|
317
|
+
interface PrismaAppConfig {
|
|
318
|
+
readonly extensions: ExtensionDescriptor[];
|
|
319
|
+
readonly state: () => AlchemyStateLayer;
|
|
320
|
+
}
|
|
321
|
+
/** Typed identity — exists so `prisma-composer.config.ts` gets checked against PrismaAppConfig where it is written. */
|
|
322
|
+
declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
|
|
323
|
+
//#endregion
|
|
324
|
+
export { resolveStateLayer as A, TeardownInput as C, lower as D, joinDeployment as E, lowering as O, ServiceLowering as S, defineConfig as T, PackageInput as _, Bundle as a, ProvisionEdge as b, DeploymentResult as c, LowerError as d, LowerOptions as f, Outputs as g, NodeDescriptor as h, AssembleInput as i, mergedProviders as k, ExtensionDescriptor as l, Lowering as m, ApplicationDescriptor as n, DeployedEntity as o, LoweredResult as p, Artifact as r, DeployedNode as s, AlchemyStateLayer as t, LowerContext as u, PreflightInput as v, buildConfig as w, ProvisionerDescriptor as x, PrismaAppConfig as y };
|
|
325
|
+
//# sourceMappingURL=app-config-CpWN1ZfP-CZ1c6Eqk.d.mts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region ../../0-framework/0-foundation/foundation/dist/assertions.d.mts
|
|
2
|
+
//#region src/assertions.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Asserts that a value is defined (not null or undefined).
|
|
5
|
+
* Use for invariants where the value should always exist at runtime.
|
|
6
|
+
*
|
|
7
|
+
* @throws Error if value is null or undefined
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const port = config.ports[name];
|
|
12
|
+
* assertDefined(port, `Port "${name}" not found`);
|
|
13
|
+
* // port is now narrowed to non-nullable
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare function assertDefined<T>(value: T | null | undefined, message: string): asserts value is T;
|
|
17
|
+
/**
|
|
18
|
+
* Asserts that a condition is true.
|
|
19
|
+
* Use for invariants that should always hold at runtime.
|
|
20
|
+
*
|
|
21
|
+
* @throws Error if condition is false
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* invariant(edges.length > 0, 'A wired module must have at least one connection');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function invariant(condition: boolean, message: string): asserts condition;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { assertDefined, invariant };
|
|
31
|
+
//# sourceMappingURL=assertions.d.mts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region ../../0-framework/0-foundation/foundation/dist/assertions.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Asserts that a value is defined (not null or undefined).
|
|
4
|
+
* Use for invariants where the value should always exist at runtime.
|
|
5
|
+
*
|
|
6
|
+
* @throws Error if value is null or undefined
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const port = config.ports[name];
|
|
11
|
+
* assertDefined(port, `Port "${name}" not found`);
|
|
12
|
+
* // port is now narrowed to non-nullable
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
function assertDefined(value, message) {
|
|
16
|
+
if (value === null || value === void 0) throw new Error(message);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Asserts that a condition is true.
|
|
20
|
+
* Use for invariants that should always hold at runtime.
|
|
21
|
+
*
|
|
22
|
+
* @throws Error if condition is false
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* invariant(edges.length > 0, 'A wired module must have at least one connection');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
function invariant(condition, message) {
|
|
30
|
+
if (!condition) throw new Error(message);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { assertDefined, invariant };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=assertions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertions.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/assertions.mjs"],"sourcesContent":["//#region src/assertions.ts\n/**\n* Asserts that a value is defined (not null or undefined).\n* Use for invariants where the value should always exist at runtime.\n*\n* @throws Error if value is null or undefined\n*\n* @example\n* ```typescript\n* const port = config.ports[name];\n* assertDefined(port, `Port \"${name}\" not found`);\n* // port is now narrowed to non-nullable\n* ```\n*/\nfunction assertDefined(value, message) {\n\tif (value === null || value === void 0) throw new Error(message);\n}\n/**\n* Asserts that a condition is true.\n* Use for invariants that should always hold at runtime.\n*\n* @throws Error if condition is false\n*\n* @example\n* ```typescript\n* invariant(edges.length > 0, 'A wired module must have at least one connection');\n* ```\n*/\nfunction invariant(condition, message) {\n\tif (!condition) throw new Error(message);\n}\n//#endregion\nexport { assertDefined, invariant };\n\n//# sourceMappingURL=assertions.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,cAAc,OAAO,SAAS;CACtC,IAAI,UAAU,QAAQ,UAAU,KAAK,GAAG,MAAM,IAAI,MAAM,OAAO;AAChE;;;;;;;;;;;;AAYA,SAAS,UAAU,WAAW,SAAS;CACtC,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,OAAO;AACxC"}
|