@prisma/orm-toolchain 8.0.0-rc.24-dev.43 → 8.0.0-rc.24-dev.44
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/{aggregate-D7dLfF9a.mjs → aggregate-B2D5REGs.mjs} +9 -9
- package/dist/{aggregate-D7dLfF9a.mjs.map → aggregate-B2D5REGs.mjs.map} +1 -1
- package/dist/{aggregate-BMh4SLep.d.mts → aggregate-CvDNKQbR.d.mts} +5 -5
- package/dist/{aggregate-BMh4SLep.d.mts.map → aggregate-CvDNKQbR.d.mts.map} +1 -1
- package/dist/{caught-errors-D8Hn_D5h-C4BJDZ5y.mjs → caught-errors-DZXnK8Ls-zVmM4nr3.mjs} +577 -49
- package/dist/caught-errors-DZXnK8Ls-zVmM4nr3.mjs.map +1 -0
- package/dist/cli-telemetry.mjs +1 -1
- package/dist/cli.d.mts +1 -1
- package/dist/cli.mjs +189 -70
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__control-api.d.mts +12 -59
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +2 -2
- package/dist/cli__control-api__testing.d.mts +1 -1
- package/dist/cli__migration-cli.mjs +4 -4
- package/dist/cli__migration-cli.mjs.map +1 -1
- package/dist/config-loader.mjs +1 -1
- package/dist/contract-snapshot-store-D-s2aKZY.d.mts +2 -0
- package/dist/{contract-snapshot-store-DRAG5XXy-DOvf98Np.d.mts → contract-snapshot-store-DRAG5XXy-ChW4hBLb.d.mts} +2 -2
- package/dist/{contract-snapshot-store-DRAG5XXy-DOvf98Np.d.mts.map → contract-snapshot-store-DRAG5XXy-ChW4hBLb.d.mts.map} +1 -1
- package/dist/{contract-snapshot-store-Ds7lE7vL-Dn444yIq.mjs → contract-snapshot-store-Dl6v-Uxr-CwhnMsgc.mjs} +4 -4
- package/dist/{contract-snapshot-store-Ds7lE7vL-Dn444yIq.mjs.map → contract-snapshot-store-Dl6v-Uxr-CwhnMsgc.mjs.map} +1 -1
- package/dist/{db-sign-DLIR5swa-CMgFrBoH.d.mts → db-sign-BQMw6RX9-Stp7Gjj7.d.mts} +187 -18
- package/dist/db-sign-BQMw6RX9-Stp7Gjj7.d.mts.map +1 -0
- package/dist/{domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs → domain-type-generation-BGcbGgHJ-SB6n89eE.mjs} +3 -3
- package/dist/{domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs.map → domain-type-generation-BGcbGgHJ-SB6n89eE.mjs.map} +1 -1
- package/dist/emitter.mjs +2 -2
- package/dist/emitter__domain-type-generation.mjs +1 -1
- package/dist/{errors-BMq40nYH-Cg8PBect.mjs → errors-BlaB9AFz-CZDOC0mV.mjs} +8 -10
- package/dist/{errors-BMq40nYH-Cg8PBect.mjs.map → errors-BlaB9AFz-CZDOC0mV.mjs.map} +1 -1
- package/dist/{exports-BiXPktAF.mjs → exports-B0yFVod3.mjs} +3 -3
- package/dist/{exports-BiXPktAF.mjs.map → exports-B0yFVod3.mjs.map} +1 -1
- package/dist/{exports-CCuYD8dO-yw1GizAT.mjs → exports-CCuYD8dO-fFXwpizm.mjs} +3 -3
- package/dist/{exports-CCuYD8dO-yw1GizAT.mjs.map → exports-CCuYD8dO-fFXwpizm.mjs.map} +1 -1
- package/dist/{exports-CZ6dPu-O.mjs → exports-DNFYCa6U.mjs} +3 -3
- package/dist/{exports-CZ6dPu-O.mjs.map → exports-DNFYCa6U.mjs.map} +1 -1
- package/dist/{graph-membership-D7m41lWA-B68g1CRS.mjs → graph-membership-ClCmhVjf-8XCns4rf.mjs} +3 -3
- package/dist/{graph-membership-D7m41lWA-B68g1CRS.mjs.map → graph-membership-ClCmhVjf-8XCns4rf.mjs.map} +1 -1
- package/dist/hash-DcBt3lpO.d.mts +1 -0
- package/dist/{hash-DclMqd7S-WBvXJ_4C.d.mts → hash-DclMqd7S-Dddl_NeA.d.mts} +2 -2
- package/dist/{hash-DclMqd7S-WBvXJ_4C.d.mts.map → hash-DclMqd7S-Dddl_NeA.d.mts.map} +1 -1
- package/dist/{invariants-DxCj82g2-DhGkStla.mjs → invariants-c9W7-6DY-CzSdi8Vp.mjs} +3 -3
- package/dist/{invariants-DxCj82g2-DhGkStla.mjs.map → invariants-c9W7-6DY-CzSdi8Vp.mjs.map} +1 -1
- package/dist/io-BalYebmm.d.mts +1 -0
- package/dist/{io-D51jgF31-RTnIqw4C.mjs → io-DUsSXBRO-BqRNb69U.mjs} +5 -5
- package/dist/{io-D51jgF31-RTnIqw4C.mjs.map → io-DUsSXBRO-BqRNb69U.mjs.map} +1 -1
- package/dist/{io-DpAplMzQ-oLyfXvz-.d.mts → io-DpAplMzQ-ZTJi-tTr.d.mts} +2 -2
- package/dist/{io-DpAplMzQ-oLyfXvz-.d.mts.map → io-DpAplMzQ-ZTJi-tTr.d.mts.map} +1 -1
- package/dist/{migration-DTmtOJ0n.mjs → migration-C1l4_CWi.mjs} +3 -3
- package/dist/{migration-DTmtOJ0n.mjs.map → migration-C1l4_CWi.mjs.map} +1 -1
- package/dist/{migration-graph-BoiiZAaU-DLht12k7.mjs → migration-graph-DBJAol1y-DX61Ss3X.mjs} +19 -3
- package/dist/{migration-graph-BoiiZAaU-DLht12k7.mjs.map → migration-graph-DBJAol1y-DX61Ss3X.mjs.map} +1 -1
- package/dist/{migration-graph-D8IuOkZb-pSI7-k4_.d.mts → migration-graph-DCIdjMtC-CAs3pm1A.d.mts} +10 -3
- package/dist/{migration-graph-D8IuOkZb-pSI7-k4_.d.mts.map → migration-graph-DCIdjMtC-CAs3pm1A.d.mts.map} +1 -1
- package/dist/{migration-graph-Dra4CcyN.d.mts → migration-graph-GiSYbAc8.d.mts} +2 -2
- package/dist/{migration-graph-Dra4CcyN.d.mts.map → migration-graph-GiSYbAc8.d.mts.map} +1 -1
- package/dist/migration-tools.d.mts +14 -14
- package/dist/migration-tools.mjs +13 -13
- package/dist/migration-tools__aggregate.d.mts +1 -1
- package/dist/migration-tools__aggregate.mjs +1 -1
- package/dist/migration-tools__contract-snapshot-store.d.mts +3 -3
- package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
- package/dist/migration-tools__errors.mjs +1 -1
- package/dist/migration-tools__hash.d.mts +2 -2
- package/dist/migration-tools__invariants.mjs +1 -1
- package/dist/migration-tools__io.d.mts +2 -2
- package/dist/migration-tools__io.mjs +1 -1
- package/dist/migration-tools__migration-graph.d.mts +3 -3
- package/dist/migration-tools__migration-graph.mjs +3 -3
- package/dist/migration-tools__migration.mjs +1 -1
- package/dist/migration-tools__ref-resolution.mjs +1 -1
- package/dist/migration-tools__refs.mjs +1 -1
- package/dist/migration-tools__spaces.mjs +2 -2
- package/dist/{ref-BrtKINun-CRtoeAmD.mjs → ref-C7TozKnq-C4UYYbRT.mjs} +362 -160
- package/dist/ref-C7TozKnq-C4UYYbRT.mjs.map +1 -0
- package/dist/{ref-resolution-C0xsiRig.mjs → ref-resolution-533MGMov.mjs} +2 -2
- package/dist/{ref-resolution-C0xsiRig.mjs.map → ref-resolution-533MGMov.mjs.map} +1 -1
- package/dist/{refs-t_JbIjGo-BVCqKpXd.mjs → refs-BE6yEgSV-CbpqGnbl.mjs} +3 -3
- package/dist/{refs-t_JbIjGo-BVCqKpXd.mjs.map → refs-BE6yEgSV-CbpqGnbl.mjs.map} +1 -1
- package/dist/{spaces-qTjiPqw0.mjs → spaces-Cj_GYpmM.mjs} +7 -7
- package/dist/{spaces-qTjiPqw0.mjs.map → spaces-Cj_GYpmM.mjs.map} +1 -1
- package/dist/{verify-contract-spaces-BZV67Pqk-DhswS52A.mjs → verify-contract-spaces-DvU9lE0Y-Y1WwEsPA.mjs} +4 -4
- package/dist/{verify-contract-spaces-BZV67Pqk-DhswS52A.mjs.map → verify-contract-spaces-DvU9lE0Y-Y1WwEsPA.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +3 -3
- package/package.json +11 -11
- package/dist/caught-errors-D8Hn_D5h-C4BJDZ5y.mjs.map +0 -1
- package/dist/contract-snapshot-store-CtlOZtzJ.d.mts +0 -2
- package/dist/db-sign-DLIR5swa-CMgFrBoH.d.mts.map +0 -1
- package/dist/hash-CwWGlFWV.d.mts +0 -1
- package/dist/io-CpR7fgmB.d.mts +0 -1
- package/dist/ref-BrtKINun-CRtoeAmD.mjs.map +0 -1
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
import { n as SnapshotContentVerifier } from "./contract-snapshot-store-DRAG5XXy-
|
|
2
|
-
import "./contract-snapshot-store-CtlOZtzJ.mjs";
|
|
1
|
+
import { n as SnapshotContentVerifier } from "./contract-snapshot-store-DRAG5XXy-ChW4hBLb.mjs";
|
|
3
2
|
import { n as NamedRef } from "./refs-CkGjbosE-CLkrSkQ4.mjs";
|
|
3
|
+
import { n as MigrationGraph } from "./graph-bDjJ4GL9-BhFevsJS.mjs";
|
|
4
|
+
import { t as AggregateContractSpace } from "./aggregate-CvDNKQbR.mjs";
|
|
5
|
+
import "./contract-snapshot-store-D-s2aKZY.mjs";
|
|
4
6
|
import "./refs-B5N_vHH7.mjs";
|
|
5
7
|
import "./ref-resolution-UwnXbc9M.mjs";
|
|
6
8
|
import { CliStructuredError as CliStructuredError$2 } from "@prisma/orm-framework/errors/control";
|
|
7
9
|
import { ControlAdapterDescriptor, ControlDriverConnectOptions, ControlDriverDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyDescriptor, ControlFamilyInstance, ControlTargetDescriptor, CoreSchemaView, DatabasePolicies, DatabasePolicyDifference, MarkerHashes, MigrationAccessChange, MigrationDataLoss, MigrationOperationSubject, MigrationPlanNamespaces, MigrationPlanOperation, MigrationPlanSubjects, MigrationPlannerConflict, MigrationStatementJson, MigrationSubjectJson, OperationPreview, ResolvedMigrationStatement, SpaceDatabasePoliciesConflict, SpaceSignature, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
8
10
|
import { Result } from "@prisma/orm-framework/utils/result";
|
|
11
|
+
import { Contract, ContractMarkerRecord, EntityCoordinate, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
9
12
|
import "@prisma/orm-framework/errors/execution";
|
|
10
13
|
import "@prisma/orm-framework/errors/migration";
|
|
11
|
-
import { Contract, ContractMarkerRecord, EntityCoordinate, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
12
14
|
import { PslDocumentAst } from "@prisma/orm-framework/components/psl-ast";
|
|
13
15
|
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
14
16
|
import "@prisma/cli-engine/protocol";
|
|
15
17
|
import { ContractSourceDiagnostic, ContractSourceDiagnostics, ContractSourceProvider, PrismaConfig } from "@prisma/orm-framework/config/config-types";
|
|
16
18
|
import { AuthoringPslBlockDescriptorNamespace } from "@prisma/orm-framework/components/authoring";
|
|
17
|
-
//#region ../../../1-framework/3-tooling/cli/dist/db-sign-
|
|
18
|
-
//#region src/control-api/
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
//#region ../../../1-framework/3-tooling/cli/dist/db-sign-BQMw6RX9.d.mts
|
|
20
|
+
//#region src/control-api/operations/graph-queries.d.ts
|
|
21
|
+
/** True when the on-disk graph contains a path fromHash → toHash. */
|
|
22
|
+
declare function hasMigrationPath(graph: MigrationGraph, fromHash: string, toHash: string): boolean;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
* `
|
|
24
|
-
* `
|
|
24
|
+
* How a database at `marker` reaches `target` through migrations:
|
|
25
|
+
* - `none-needed`: it is at the target and records every invariant the target requires;
|
|
26
|
+
* - `on-disk`: a path on disk leads there and provides every such invariant it does not record, so
|
|
27
|
+
* `db migrate` alone moves it;
|
|
28
|
+
* - `at-target-missing-invariants`: it is at the target's contract, but no migration on disk
|
|
29
|
+
* provides `missingInvariants`, and `migration plan` cannot write one, because a plan from a
|
|
30
|
+
* contract to itself is empty, so the migration is written by hand. `newMigration` is there when a
|
|
31
|
+
* migration ends at the target, so `migration new --from` it resolves: that writes a migration
|
|
32
|
+
* from the target to itself once the emitted contract is the target, which it already is unless
|
|
33
|
+
* `emitFirst`;
|
|
34
|
+
* - `plan-needed`: the database is not at the target's contract, so a migration has to be planned,
|
|
35
|
+
* and it has to provide `missingInvariants`.
|
|
36
|
+
*
|
|
37
|
+
* @internal
|
|
25
38
|
*/
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
type MigrationsToTarget = {
|
|
40
|
+
readonly kind: 'none-needed';
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: 'on-disk';
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'at-target-missing-invariants';
|
|
45
|
+
readonly missingInvariants: readonly string[];
|
|
46
|
+
readonly newMigration?: {
|
|
47
|
+
readonly from: string;
|
|
48
|
+
readonly emitFirst: boolean;
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: 'plan-needed';
|
|
52
|
+
readonly missingInvariants: readonly string[];
|
|
53
|
+
};
|
|
30
54
|
//#endregion
|
|
31
55
|
//#region src/utils/printed-command.d.ts
|
|
32
56
|
/**
|
|
@@ -41,6 +65,135 @@ interface CliInvocation {
|
|
|
41
65
|
readonly rerunArgs?: readonly string[];
|
|
42
66
|
/** The run's statements, as flags, which another command that plans the same change repeats. */
|
|
43
67
|
readonly statementArgs?: readonly string[];
|
|
68
|
+
/** The ref the run's `--to` named, when it named one. */
|
|
69
|
+
readonly targetRef?: string;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/control-api/operations/plan-resolution.d.ts
|
|
73
|
+
/**
|
|
74
|
+
* Set when the origin was derived from the `db` ref by default (no `--from`)
|
|
75
|
+
* and that node already has outgoing edges. Planning from it forks the
|
|
76
|
+
* graph, so the caller must surface it to the user.
|
|
77
|
+
*/
|
|
78
|
+
interface DefaultOriginForks {
|
|
79
|
+
readonly refName: string;
|
|
80
|
+
readonly refHash: string;
|
|
81
|
+
readonly outgoingTo: readonly string[];
|
|
82
|
+
}
|
|
83
|
+
type FromResolution = {
|
|
84
|
+
kind: 'greenfield';
|
|
85
|
+
fromHash: null;
|
|
86
|
+
fromContract: null;
|
|
87
|
+
defaulted: boolean;
|
|
88
|
+
} | {
|
|
89
|
+
kind: 'graph-node';
|
|
90
|
+
fromHash: string;
|
|
91
|
+
fromContract: Contract;
|
|
92
|
+
defaultOriginForks?: DefaultOriginForks;
|
|
93
|
+
} | {
|
|
94
|
+
kind: 'ref';
|
|
95
|
+
fromHash: string;
|
|
96
|
+
fromContract: Contract;
|
|
97
|
+
defaultOriginForks?: DefaultOriginForks;
|
|
98
|
+
} | {
|
|
99
|
+
kind: 'auto-baseline';
|
|
100
|
+
fromHash: string;
|
|
101
|
+
fromContract: Contract;
|
|
102
|
+
};
|
|
103
|
+
interface ResolveFromForPlanInput {
|
|
104
|
+
readonly optionsFrom?: string | undefined;
|
|
105
|
+
readonly space: AggregateContractSpace;
|
|
106
|
+
/** Where `migration plan` ran and the `--config` it was given, which the commands its errors print repeat. */
|
|
107
|
+
readonly invocation?: CliInvocation;
|
|
108
|
+
}
|
|
109
|
+
declare function resolveFromForPlan(input: ResolveFromForPlanInput): Promise<Result<FromResolution, CliStructuredError$2>>;
|
|
110
|
+
interface ResolveToForPlanInput {
|
|
111
|
+
readonly space: AggregateContractSpace;
|
|
112
|
+
}
|
|
113
|
+
interface ResolvedContractRef {
|
|
114
|
+
readonly hash: string;
|
|
115
|
+
readonly contract: Contract;
|
|
116
|
+
/** The ref `--to` named, with the policies it declares; `undefined` when `--to` named no ref. */
|
|
117
|
+
readonly ref: NamedRef | undefined;
|
|
118
|
+
}
|
|
119
|
+
declare function resolveToForPlan(optionsTo: string, input: ResolveToForPlanInput): Promise<Result<ResolvedContractRef, CliStructuredError$2>>;
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/control-api/operations/plan-arguments.d.ts
|
|
122
|
+
/**
|
|
123
|
+
* What `migration plan` takes for `--from` or `--to`:
|
|
124
|
+
* - `reference`: a contract reference it resolves (a hash, a ref name, or `@empty`);
|
|
125
|
+
* - `default`: leave the flag out;
|
|
126
|
+
* - `ambiguous`: the user has to choose, for `reason`, from `candidates` when they are known;
|
|
127
|
+
* - `none`: no value makes `migration plan` start or end there, for `reason`.
|
|
128
|
+
*/
|
|
129
|
+
type MigrationPlanArgument = {
|
|
130
|
+
readonly kind: 'reference';
|
|
131
|
+
readonly reference: string;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: 'default';
|
|
134
|
+
} | {
|
|
135
|
+
readonly kind: 'ambiguous';
|
|
136
|
+
readonly reason: string;
|
|
137
|
+
readonly candidates: readonly string[];
|
|
138
|
+
} | {
|
|
139
|
+
readonly kind: 'none';
|
|
140
|
+
readonly reason: string;
|
|
141
|
+
};
|
|
142
|
+
/** What `--to` can be: the target is never left for the user to choose. */
|
|
143
|
+
type MigrationPlanTargetArgument = Exclude<MigrationPlanArgument, {
|
|
144
|
+
readonly kind: 'ambiguous';
|
|
145
|
+
}>;
|
|
146
|
+
/** What a `migration plan` takes for `--from` and `--to`. */
|
|
147
|
+
interface MigrationPlanArguments {
|
|
148
|
+
readonly from: MigrationPlanArgument;
|
|
149
|
+
readonly to: MigrationPlanTargetArgument;
|
|
150
|
+
/**
|
|
151
|
+
* Where the database is, when its marker was read.
|
|
152
|
+
*
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
readonly position?: DatabasePosition;
|
|
156
|
+
/**
|
|
157
|
+
* Present when `from` lies past migrations on disk the database has not applied, by its marker:
|
|
158
|
+
* the plan extends the history that continues from where the database is.
|
|
159
|
+
*
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
162
|
+
readonly startsAfterUnapplied?: true;
|
|
163
|
+
/**
|
|
164
|
+
* How the database reaches `to` through migrations, when its marker was read, which decides what
|
|
165
|
+
* the CLI's advice prints. It is in the published types, but it exists for that advice only, and
|
|
166
|
+
* its shape may change in any release without notice.
|
|
167
|
+
*
|
|
168
|
+
* @internal
|
|
169
|
+
*/
|
|
170
|
+
readonly migrationsToTarget?: MigrationsToTarget;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Where a database is, which decides where a plan for it starts: unmarked (no marker, so empty or
|
|
174
|
+
* not yet adopted), at a contract by its hash, or unknown, for `reason`, when it cannot be read.
|
|
175
|
+
*/
|
|
176
|
+
type DatabasePosition = {
|
|
177
|
+
readonly kind: 'unmarked';
|
|
178
|
+
} | {
|
|
179
|
+
readonly kind: 'contract';
|
|
180
|
+
readonly hash: string;
|
|
181
|
+
} | {
|
|
182
|
+
readonly kind: 'unknown';
|
|
183
|
+
readonly reason: string;
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/control-api/statements/statement-text.d.ts
|
|
187
|
+
/** The verbs a statement can have. */
|
|
188
|
+
type StatementVerb = 'rename' | 'delete' | 'allow' | 'convert' | 'backfill';
|
|
189
|
+
/**
|
|
190
|
+
* A statement as the user wrote it, before it is parsed: its verb and its text, for example
|
|
191
|
+
* `{ verb: 'rename', text: 'Profile:User' }` for `--rename Profile:User` or
|
|
192
|
+
* `{ verb: 'delete', text: 'Legacy' }` for `--delete Legacy`.
|
|
193
|
+
*/
|
|
194
|
+
interface StatementText {
|
|
195
|
+
readonly verb: StatementVerb;
|
|
196
|
+
readonly text: string;
|
|
44
197
|
}
|
|
45
198
|
//#endregion
|
|
46
199
|
//#region src/utils/data-protection-settings.d.ts
|
|
@@ -407,6 +560,12 @@ interface DbUpdateOptions extends PlannerWarningsListener {
|
|
|
407
560
|
readonly ref?: NamedRef;
|
|
408
561
|
/** Consents to writing the ref's declared policies into the database when they differ from those in force. */
|
|
409
562
|
readonly permitPolicyChange?: boolean;
|
|
563
|
+
/**
|
|
564
|
+
* The storage hash of the emitted contract, the one at the config's contract path that
|
|
565
|
+
* `migration new` writes to. It differs from `contract` when `ref` names another contract. When
|
|
566
|
+
* absent, failure advice takes `contract` as the emitted one without `ref`, and as unknown with it.
|
|
567
|
+
*/
|
|
568
|
+
readonly emittedContractHash?: string;
|
|
410
569
|
/**
|
|
411
570
|
* On-disk migrations directory. Always required — every `db update`
|
|
412
571
|
* routes through the per-space flow, which reads on-disk
|
|
@@ -641,10 +800,20 @@ interface DbUpdateSuccess extends MigrationPlanSubjects<AskedDataLoss, AskedAcce
|
|
|
641
800
|
/** The statements the application space's plan applied, in order; empty when none were given. */
|
|
642
801
|
readonly appliedStatements: readonly AppliedStatementReport[];
|
|
643
802
|
/**
|
|
644
|
-
* The storage hash of the contract the database was at before the run, when a migration
|
|
645
|
-
*
|
|
803
|
+
* The storage hash of the contract the database was at before the run, when a migration records
|
|
804
|
+
* it.
|
|
805
|
+
*
|
|
806
|
+
* @deprecated Use `migrationPlan.from`, which says what `migration plan --from` takes in every
|
|
807
|
+
* case this field leaves out.
|
|
646
808
|
*/
|
|
647
809
|
readonly databaseStorageHash?: string;
|
|
810
|
+
/**
|
|
811
|
+
* The `--from` and `--to` of a `migration plan` that takes this database, as it was before the
|
|
812
|
+
* run, where the run went. Each is a contract reference, the default, or why no `migration plan`
|
|
813
|
+
* can start or end there; `--from` can also be a choice for the user. Its `migrationsToTarget`
|
|
814
|
+
* exists for the CLI's own advice only, and its shape may change in any release without notice.
|
|
815
|
+
*/
|
|
816
|
+
readonly migrationPlan?: MigrationPlanArguments;
|
|
648
817
|
/** The storage entities that changed, when the run signed the database with a changed contract and ran no operation. */
|
|
649
818
|
readonly changedStorageEntities?: readonly ChangedStorageEntity[];
|
|
650
819
|
readonly summary: string;
|
|
@@ -1106,5 +1275,5 @@ type ExecuteDbSignResult = Result<ExecuteDbSignSuccess, CliStructuredError$2>;
|
|
|
1106
1275
|
*/
|
|
1107
1276
|
declare function executeDbSign<TFamilyId extends string, TTargetId extends string>(options: ExecuteDbSignOptions<TFamilyId, TTargetId>): Promise<ExecuteDbSignResult>;
|
|
1108
1277
|
//#endregion
|
|
1109
|
-
export { ExecuteDbSignOptions as A,
|
|
1110
|
-
//# sourceMappingURL=db-sign-
|
|
1278
|
+
export { StatementVerb as $, ExecuteDbSignOptions as A, OnControlProgress as B, DbUpdateSuccess as C, EmitOptions as D, EmitFailureCode as E, IntrospectOptions as F, RenderContractDtsFailure as G, PlanQuestion as H, MigrateResult as I, RenderContractDtsResult as J, RenderContractDtsFailureCode as K, MigrationPlanArgument as L, ExecuteDbVerifyOptions as M, ExecuteDbVerifyResult as N, EmitResult as O, FromResolution as P, StatementText as Q, MigrationPlanArguments as R, DbUpdateResult as S, EmitFailure as T, PlanQuestionVerb as U, PlanAnswer as V, PlannerWarningsListener as W, ResolvedContractRef as X, RenderContractDtsSuccess as Y, SchemaVerifyOptions as Z, DbInitSuccess as _, ChangedStorageEntity as a, resolveFromForPlan as at, DbSignSpaceOutcome as b, ContractEmitOptions as c, ControlClient as d, TemporaryValueReport as et, ControlClientOptions as f, DbInitResult as g, DbInitOptions as h, AskedSubject as i, hasMigrationPath as it, ExecuteDbSignResult as j, EmitSuccess as k, ContractEmitResult as l, CreateControlClient as m, AppliedStatementReport as n, executeDbSign as nt, CliInvocation as o, resolveToForPlan as ot, ControlProgressEvent as p, RenderContractDtsOptions as q, AskedDataLoss as r, executeDbVerify as rt, CliStructuredError$2 as s, AnswerPlanQuestions as t, VerifyOptions as tt, ControlActionName as u, DbSignOptions as v, EmitContractConfig as w, DbUpdateOptions as x, DbSignSpaceFailure as y, MigrationPlanTargetArgument as z };
|
|
1279
|
+
//# sourceMappingURL=db-sign-BQMw6RX9-Stp7Gjj7.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-sign-BQMw6RX9-Stp7Gjj7.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/db-sign-BQMw6RX9.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAmBiB,iBAAiB,OAAO,gBAAgB,kBAAkB;;;;;;;;;;;;;;;;;KAiBtE;WACM;;WAEA;;WAEA;WACA;WACA;aACE;aACA;;;WAGF;WACA;;;;;;;;UAQD;WACC;WACA;WACA;;WAE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BAA2B,WAAW;WAChE,qBAAqB,cAAc,+BAA+B,WAAW;WAC7E,wBAAwB;;WAExB,YAAY;WACZ,aAAa;;;UAGd;WACC;WACA;WACA,UAAU;WACV,QAAQ;;;UAGT;WACC;WACA;WACA,UAAU;WACV;WACA,SAAS;;;;;KAKf,qBAAqB,QAAQ,gBAAgB,iCAAiC,qBAAqB;UAC9F;;WAEC,iBAAiB;;KAEvB,sBAAsB,OAAO,sBAAsB;;;;iBAIvC,cAAc,0BAA0B,0BAA0B,SAAS,qBAAqB,WAAW,aAAa,QAAQ"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as isSafeTypeExpression } from "./type-expression-safety-CgHTWypx.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
|
-
import { compareCodeUnits } from "@prisma/orm-framework/contract/hashing-utils";
|
|
5
|
-
import { valueObjectsWithCoordinates } from "@prisma/orm-framework/contract/types";
|
|
6
4
|
import { entityAt } from "@prisma/orm-framework/components/ir";
|
|
5
|
+
import { valueObjectsWithCoordinates } from "@prisma/orm-framework/contract/types";
|
|
6
|
+
import { compareCodeUnits } from "@prisma/orm-framework/contract/hashing-utils";
|
|
7
7
|
import { tsStringLiteral } from "@prisma/orm-framework/ts-render";
|
|
8
8
|
//#region ../../../1-framework/3-tooling/emitter/dist/domain-type-generation-BGcbGgHJ.mjs
|
|
9
9
|
function emitterError(code, message, options) {
|
|
@@ -332,4 +332,4 @@ function generateFieldTypeOverridesMap(contract, codecLookup, resolveStorageValu
|
|
|
332
332
|
//#endregion
|
|
333
333
|
export { resolveFieldTypeOverride as C, serializeObjectKey as D, serializeNamespaceId as E, serializeValue as O, renderValueSetType as S, serializeExecutionType as T, renderCodecTypeOverride as _, generateCodecTypeIntersection as a, renderValueLiteralType as b, generateHashTypeAliases as c, generateModelRelationsType as d, generateModelsType as f, parameterizedOutputTypeFunctionsAlias as g, generateValueObjectsDescriptorType as h, fieldTypesMapExpression as i, typesImportRequirements as k, generateModelFieldEntry as l, generateValueObjectTypeAliases as m, deduplicateImports as n, generateContractFieldDescriptor as o, generateRootsType as p, emitterError as r, generateFieldTypeOverridesMap as s, PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS as t, generateModelFieldsType as u, renderTypeOverride as v, serializeCrossReference as w, renderValueSetOverride as x, renderTypeOverridesMap as y };
|
|
334
334
|
|
|
335
|
-
//# sourceMappingURL=domain-type-generation-BGcbGgHJ-
|
|
335
|
+
//# sourceMappingURL=domain-type-generation-BGcbGgHJ-SB6n89eE.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/domain-type-generation-BGcbGgHJ.mjs"],"sourcesContent":["import { isSafeTypeExpression } from \"./type-expression-safety.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { compareCodeUnits } from \"@internal/contract/hashing-utils\";\nimport { valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { entityAt } from \"@internal/framework-components/ir\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/emitter-errors.ts\nfunction emitterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/domain-type-generation.ts\nfunction serializeValue(value) {\n\tif (value === null) return \"null\";\n\tif (value === void 0) return \"undefined\";\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (typeof value === \"bigint\") return `${value}n`;\n\tif (Array.isArray(value)) return `readonly [${value.map((v) => serializeValue(v)).join(\", \")}]`;\n\tif (typeof value === \"object\") return `{ ${Object.entries(value).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([k, v]) => `readonly ${serializeObjectKey(k)}: ${serializeValue(v)}`).join(\"; \")} }`;\n\treturn \"unknown\";\n}\nfunction serializeObjectKey(key) {\n\tif (/^[$A-Z_a-z][$\\w]*$/.test(key)) return key;\n\treturn serializeValue(key);\n}\nfunction serializeNamespaceId(value) {\n\treturn `${serializeValue(value)} & NamespaceId`;\n}\nfunction serializeCrossReference(ref) {\n\treturn `{ readonly namespace: ${serializeNamespaceId(String(ref.namespace))}; readonly model: ${serializeValue(ref.model)}${ref.space !== void 0 ? `; readonly space: ${serializeValue(ref.space)}` : \"\"} }`;\n}\nfunction generateRootsType(roots) {\n\tif (!roots || Object.keys(roots).length === 0) return \"Record<string, never>\";\n\treturn `{ ${Object.entries(roots).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${serializeCrossReference(value)}`).join(\"; \")} }`;\n}\nfunction valueObjectFieldTypeText(type) {\n\treturn `{ readonly kind: \"valueObject\"; readonly plane: \"storage\"; readonly namespaceId: ${serializeValue(type.namespaceId)}; readonly entityKind: \"valueObject\"; readonly entityName: ${serializeValue(type.entityName)} }`;\n}\nfunction contractFieldModifierSuffix(field) {\n\treturn (field.many ? `; readonly many: { readonly elementNullable: ${field.many.elementNullable} }` : \"\") + (field.dict === true ? \"; readonly dict: true\" : \"\");\n}\nfunction generateModelFieldEntry(fieldName, field) {\n\tconst mods = contractFieldModifierSuffix(field);\n\tconst { nullable, type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${mods} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${valueObjectFieldTypeText(type)}${mods} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${serializeValue(type)}${mods} }`;\n}\nfunction objectTypeOpenWhenEmpty(entries) {\n\treturn entries.length > 0 ? `{ ${entries.join(\"; \")} }` : \"{}\";\n}\nfunction generateModelFieldsType(fields) {\n\tconst fieldEntries = [];\n\tfor (const [fieldName, field] of Object.entries(fields)) fieldEntries.push(generateModelFieldEntry(fieldName, field));\n\treturn objectTypeOpenWhenEmpty(fieldEntries);\n}\nfunction generateModelRelationsType(relations) {\n\tconst relationEntries = [];\n\tfor (const [relName, rel] of Object.entries(relations)) {\n\t\tif (typeof rel !== \"object\" || rel === null) continue;\n\t\tconst relObj = blindCast(rel);\n\t\tconst toRef = relObj[\"to\"];\n\t\tif (toRef !== null && typeof toRef === \"object\" && \"space\" in toRef && toRef.space !== void 0) {\n\t\t\trelationEntries.push(`readonly ${serializeObjectKey(relName)}: never`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst parts = [];\n\t\tif (toRef) parts.push(`readonly to: ${serializeCrossReference(blindCast(toRef))}`);\n\t\tif (relObj[\"cardinality\"]) parts.push(`readonly cardinality: ${serializeValue(relObj[\"cardinality\"])}`);\n\t\tif (typeof relObj[\"nullable\"] === \"boolean\") parts.push(`readonly nullable: ${relObj[\"nullable\"]}`);\n\t\tconst on = blindCast(relObj[\"on\"]);\n\t\tif (on && (!on.localFields || !on.targetFields)) throw emitterError(\"CONTRACT.RELATION_INVALID\", `Relation \"${relName}\" has an \"on\" block but is missing localFields or targetFields`, { meta: { relation: relName } });\n\t\tif (on?.localFields && on.targetFields) {\n\t\t\tconst localFields = on.localFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tconst targetFields = on.targetFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tparts.push(`readonly on: { readonly localFields: readonly [${localFields}]; readonly targetFields: readonly [${targetFields}] }`);\n\t\t}\n\t\tif (relObj[\"cardinality\"] === \"N:M\") {\n\t\t\tconst { through } = blindCast(relObj);\n\t\t\tconst table = serializeValue(through.table);\n\t\t\tconst namespaceId = serializeValue(through.namespaceId);\n\t\t\tconst parentColumns = through.parentColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst childColumns = through.childColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst targetColumns = through.targetColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tparts.push(`readonly through: { readonly table: ${table}; readonly namespaceId: ${namespaceId}; readonly parentColumns: readonly [${parentColumns}]; readonly childColumns: readonly [${childColumns}]; readonly targetColumns: readonly [${targetColumns}] }`);\n\t\t}\n\t\tif (parts.length > 0) relationEntries.push(`readonly ${serializeObjectKey(relName)}: { ${parts.join(\"; \")} }`);\n\t}\n\tif (relationEntries.length === 0) return \"Record<string, never>\";\n\treturn `{ ${relationEntries.join(\"; \")} }`;\n}\nfunction generateModelsType(models, generateModelStorage) {\n\tif (!models || Object.keys(models).length === 0) return \"Record<string, never>\";\n\tconst modelTypes = [];\n\tfor (const [modelName, model] of Object.entries(models).sort(([a], [b]) => compareCodeUnits(a, b))) {\n\t\tconst fieldsType = generateModelFieldsType(model.fields);\n\t\tconst relationsType = generateModelRelationsType(model.relations);\n\t\tconst storageType = generateModelStorage(modelName, model);\n\t\tconst modelParts = [\n\t\t\t`readonly fields: ${fieldsType}`,\n\t\t\t`readonly relations: ${relationsType}`,\n\t\t\t`readonly storage: ${storageType}`\n\t\t];\n\t\tif (model.owner) modelParts.push(`readonly owner: ${serializeValue(model.owner)}`);\n\t\tif (model.discriminator) modelParts.push(`readonly discriminator: ${serializeValue(model.discriminator)}`);\n\t\tif (model.variants) {\n\t\t\tconst variantEntries = Object.entries(model.variants).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([value, ref]) => `readonly ${serializeObjectKey(value)}: ${serializeCrossReference(ref)}`);\n\t\t\tmodelParts.push(`readonly variants: { ${variantEntries.join(\"; \")} }`);\n\t\t}\n\t\tif (model.base) modelParts.push(`readonly base: ${serializeCrossReference(model.base)}`);\n\t\tmodelTypes.push(`readonly ${serializeObjectKey(modelName)}: { ${modelParts.join(\"; \")} }`);\n\t}\n\treturn `{ ${modelTypes.join(\"; \")} }`;\n}\nfunction deduplicateImports(imports) {\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tfor (const imp of imports) {\n\t\tconst key = `${imp.package}::${imp.named}`;\n\t\tif (!seenKeys.has(key)) {\n\t\t\tseenKeys.add(key);\n\t\t\tresult.push(imp);\n\t\t}\n\t}\n\treturn result;\n}\nfunction typesImportRequirements(imports) {\n\treturn imports.map((imp) => ({\n\t\tmoduleSpecifier: imp.package,\n\t\tsymbol: imp.named,\n\t\talias: imp.alias,\n\t\ttypeOnly: true\n\t}));\n}\nfunction generateCodecTypeIntersection(imports, named) {\n\treturn imports.filter((imp) => imp.named === named).map((imp) => imp.alias).join(\" & \") || \"Record<string, never>\";\n}\nfunction serializeExecutionType(execution) {\n\tconst parts = [\"readonly executionHash: ExecutionHash\"];\n\tfor (const [key, value] of Object.entries(execution)) {\n\t\tif (key === \"executionHash\") continue;\n\t\tparts.push(`readonly ${serializeObjectKey(key)}: ${serializeValue(value)}`);\n\t}\n\treturn `{ ${parts.join(\"; \")} }`;\n}\nfunction generateHashTypeAliases(hashes) {\n\tconst executionHashType = hashes.executionHash ? `ExecutionHashBase<${serializeValue(hashes.executionHash)}>` : \"ExecutionHashBase<string>\";\n\treturn [\n\t\t`export type StorageHash = StorageHashBase<${serializeValue(hashes.storageHash)}>;`,\n\t\t`export type ExecutionHash = ${executionHashType};`,\n\t\t`export type ProfileHash = ProfileHashBase<${serializeValue(hashes.profileHash)}>;`\n\t].join(\"\\n\");\n}\n/**\n* Renders a value set (a field/column's permitted values, codec-encoded) into a TS literal union by\n* routing **each** value through the codec's `renderValueLiteral` — the seam owned by the codec, not\n* a generic serializer. `side`: `output` = read type, `input` = create/update type.\n*\n* Returns `undefined` — signalling the caller to fall back to the codec's full output type — when\n* the lookup is absent, has no `renderValueLiteralFor`, the value set is empty, or **any** value\n* isn't literal-expressible, which every value of a codec that declares `keepsWrittenForm` is. A\n* caller that needs column and field types to agree shares this so both compute the union\n* identically.\n*/\nfunction renderValueSetType(values, codecId, side, codecLookup) {\n\tif (values.length === 0) return void 0;\n\tconst literals = [];\n\tfor (const value of values) {\n\t\tconst lit = renderValueLiteralType(value, codecId, side, codecLookup);\n\t\tif (lit === void 0) return void 0;\n\t\tliterals.push(lit);\n\t}\n\treturn literals.join(\" | \");\n}\n/** The TS literal type the codec renders for one stored value, or `undefined` when it renders none or what it renders is not a safe type expression. */\nfunction renderValueLiteralType(value, codecId, side, codecLookup) {\n\tconst lit = codecLookup?.renderValueLiteralFor?.(codecId, value, side);\n\treturn lit === void 0 || !isSafeTypeExpression(lit) ? void 0 : lit;\n}\n/** The local alias for the union of the stack's parameterized output type functions. */\nconst PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS = \"ParameterizedOutputTypeFunctions\";\n/** The declaration of {@link PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS} for the type functions the stack's components declare. */\nfunction parameterizedOutputTypeFunctionsAlias(typeFunctions) {\n\tconst aliases = [...new Set(typeFunctions.map((typeFunction) => typeFunction.alias))];\n\treturn `type ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS} = ${aliases.length > 0 ? aliases.join(\" | \") : \"never\"};`;\n}\n/** `FieldOutputTypes` (`side` `'output'`) or `FieldInputTypes` (`'input'`): the shared generic applied to the emitted contract's domain, with `FieldTypeOverrides`, and to its storage namespaces. */\nfunction fieldTypesMapExpression(side) {\n\treturn `FieldTypesFromDomain<ContractBase['domain']['namespaces'], CodecTypes, ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS}, FieldTypeOverrides, ${serializeValue(side)}, ContractBase['storage']['namespaces']>`;\n}\nfunction generateContractFieldDescriptor(fieldName, field) {\n\tconst modStr = contractFieldModifierSuffix(field);\n\tconst { type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${modStr} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${valueObjectFieldTypeText(type)}${modStr} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${serializeValue(type)}${modStr} }`;\n}\nfunction generateValueObjectsDescriptorType(valueObjects) {\n\tif (!valueObjects || Object.keys(valueObjects).length === 0) return \"Record<string, never>\";\n\tconst voEntries = [];\n\tfor (const [voName, vo] of Object.entries(valueObjects)) {\n\t\tconst fieldEntries = [];\n\t\tfor (const [fieldName, field] of Object.entries(vo.fields)) fieldEntries.push(generateContractFieldDescriptor(fieldName, field));\n\t\tconst fieldsType = fieldEntries.length > 0 ? `{ ${fieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tvoEntries.push(`readonly ${serializeObjectKey(voName)}: { readonly fields: ${fieldsType} }`);\n\t}\n\treturn `{ ${voEntries.join(\"; \")} }`;\n}\n/**\n* `<Name>Output` and `<Name>Input` for each value object, read from the shared generic's value object types at the storage namespace that holds it.\n*/\nfunction generateValueObjectTypeAliases(valueObjectNamespaces) {\n\tif (valueObjectNamespaces.length === 0) return \"\";\n\tconst generic = (side) => `ValueObjectTypesFromStorage<ContractBase['storage']['namespaces'], CodecTypes, ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS}, FieldTypeOverrides, ${serializeValue(side)}>`;\n\tconst aliases = [`type ValueObjectOutputTypes = ${generic(\"output\")};`, `type ValueObjectInputTypes = ${generic(\"input\")};`];\n\tfor (const [name, namespaceId] of valueObjectNamespaces) {\n\t\tconst path = `[${serializeValue(namespaceId)}][${serializeValue(name)}]`;\n\t\taliases.push(`export type ${name}Output = ValueObjectOutputTypes${path};`);\n\t\taliases.push(`export type ${name}Input = ValueObjectInputTypes${path};`);\n\t}\n\treturn aliases.join(\"\\n\");\n}\n/**\n* The type of a scalar field that its codec does not give, which the shared field type generic takes as an override: the literal union of the value set it holds, or the text its codec renders for its type parameters. `undefined` when the codec gives both sides, and for a value object or union field, which the generic types itself.\n*/\nfunction resolveFieldTypeOverride(field, codecLookup, resolvedValueSet) {\n\tconst { type } = field;\n\tif (type.kind !== \"scalar\") return void 0;\n\tif (resolvedValueSet) {\n\t\tconst override = renderValueSetOverride(resolvedValueSet.encodedValues, resolvedValueSet.codecId, codecLookup);\n\t\tif (override !== void 0) return override;\n\t}\n\tconst typeParams = type.typeParams && Object.keys(type.typeParams).length > 0 ? type.typeParams : void 0;\n\treturn renderCodecTypeOverride(type.codecId, typeParams, codecLookup);\n}\n/** The literal union of a value set on each side whose values all have literal types, or `undefined` when neither side has. */\nfunction renderValueSetOverride(values, codecId, codecLookup) {\n\tconst output = renderValueSetType(values, codecId, \"output\", codecLookup);\n\tconst input = renderValueSetType(values, codecId, \"input\", codecLookup);\n\tconst override = {\n\t\t...output !== void 0 ? { output } : {},\n\t\t...input !== void 0 ? { input } : {}\n\t};\n\treturn Object.keys(override).length > 0 ? override : void 0;\n}\n/** The type text a codec renders for these type parameters, on the sides it renders one. */\nfunction renderCodecTypeOverride(codecId, typeParams, codecLookup) {\n\tif (codecLookup === void 0 || typeParams === void 0) return void 0;\n\tconst output = codecLookup.renderOutputTypeFor(codecId, typeParams);\n\tconst input = codecLookup.renderInputTypeFor?.(codecId, typeParams);\n\tconst override = {\n\t\t...output && isSafeTypeExpression(output) ? { output } : {},\n\t\t...input && isSafeTypeExpression(input) ? { input } : {}\n\t};\n\treturn Object.keys(override).length > 0 ? override : void 0;\n}\nfunction renderTypeOverride(override) {\n\treturn `{ ${[\"output\", \"input\"].flatMap((side) => {\n\t\tconst type = override[side];\n\t\treturn type === void 0 ? [] : [`readonly ${side}: ${type}`];\n\t}).join(\"; \")} }`;\n}\n/** A nested map of type overrides, one level per path segment, ordered by name at every level, leaving out every branch with no entry. */\nfunction renderTypeOverridesMap(entries) {\n\tconst root = /* @__PURE__ */ new Map();\n\tfor (const [path, type] of entries) {\n\t\tif (type === void 0) continue;\n\t\tlet node = root;\n\t\tfor (const segment of path.slice(0, -1)) {\n\t\t\tconst child = node.get(segment);\n\t\t\tconst next = child instanceof Map ? child : /* @__PURE__ */ new Map();\n\t\t\tnode.set(segment, next);\n\t\t\tnode = next;\n\t\t}\n\t\tconst leaf = path.at(-1);\n\t\tif (leaf !== void 0) node.set(leaf, type);\n\t}\n\treturn renderOverrideTree(root);\n}\nfunction renderOverrideTree(tree) {\n\treturn `{ ${[...tree].sort(([a], [b]) => compareCodeUnits(a, b)).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${value instanceof Map ? renderOverrideTree(value) : renderTypeOverride(value)}`).join(\"; \")} }`;\n}\n/**\n* The values a model field's value set holds, with the field's codec. A reference to a domain enum is read from the contract's domain. Any other model field goes to the family's `resolveStorageValueSet`, which reads its storage.\n*/\nfunction resolveFieldValueSet(field, contract, resolveStorageValueSet) {\n\tif (field.valueSet?.plane === \"domain\") return resolveDomainValueSet(field, contract);\n\treturn resolveStorageValueSet();\n}\nfunction resolveDomainValueSet(field, contract) {\n\tconst ref = field.valueSet;\n\tif (ref === void 0 || field.type.kind !== \"scalar\" || ref.entityKind !== \"enum\") return;\n\tconst domainEnum = contract.domain.namespaces[ref.namespaceId]?.enum?.[ref.entityName];\n\tif (domainEnum === void 0) return void 0;\n\treturn {\n\t\tencodedValues: domainEnum.members.map((member) => member.value),\n\t\tcodecId: field.type.codecId\n\t};\n}\n/** The values of the storage value set a value object field names, with the field's codec. */\nfunction resolveValueObjectFieldValueSet(field, storage) {\n\tif (field.valueSet === void 0 || field.type.kind !== \"scalar\") return void 0;\n\tconst valueSet = entityAt(storage, field.valueSet);\n\tif (valueSet === void 0) return void 0;\n\treturn {\n\t\tencodedValues: valueSet.values,\n\t\tcodecId: field.type.codecId\n\t};\n}\n/** `FieldTypeOverrides`: per namespace, `models` (domain namespace) or `valueObjects` (storage namespace), owner and field, the type of each field its codec does not give. */\nfunction generateFieldTypeOverridesMap(contract, codecLookup, resolveStorageValueSet) {\n\tconst modelFields = Object.entries(contract.domain.namespaces).flatMap(([nsId, ns]) => Object.entries(ns.models).flatMap(([modelName, model]) => Object.entries(model.fields).map(([fieldName, field]) => [[\n\t\tnsId,\n\t\t\"models\",\n\t\tmodelName,\n\t\tfieldName\n\t], resolveFieldTypeOverride(field, codecLookup, resolveFieldValueSet(field, contract, () => resolveStorageValueSet?.(modelName, fieldName, model)))])));\n\tconst valueObjectFields = valueObjectsWithCoordinates(contract.storage).flatMap(({ coordinate: { namespaceId: nsId, entityName: valueObjectName }, valueObject }) => Object.entries(valueObject.fields).map(([fieldName, field]) => [[\n\t\tnsId,\n\t\t\"valueObjects\",\n\t\tvalueObjectName,\n\t\tfieldName\n\t], resolveFieldTypeOverride(field, codecLookup, resolveValueObjectFieldValueSet(field, contract.storage))]));\n\treturn renderTypeOverridesMap([...modelFields, ...valueObjectFields]);\n}\n//#endregion\nexport { serializeCrossReference as C, serializeValue as D, serializeObjectKey as E, typesImportRequirements as O, resolveFieldTypeOverride as S, serializeNamespaceId as T, renderTypeOverride as _, generateContractFieldDescriptor as a, renderValueSetOverride as b, generateModelFieldEntry as c, generateModelsType as d, generateRootsType as f, renderCodecTypeOverride as g, parameterizedOutputTypeFunctionsAlias as h, generateCodecTypeIntersection as i, emitterError as k, generateModelFieldsType as l, generateValueObjectsDescriptorType as m, deduplicateImports as n, generateFieldTypeOverridesMap as o, generateValueObjectTypeAliases as p, fieldTypesMapExpression as r, generateHashTypeAliases as s, PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS as t, generateModelRelationsType as u, renderTypeOverridesMap as v, serializeExecutionType as w, renderValueSetType as x, renderValueLiteralType as y };\n\n//# sourceMappingURL=domain-type-generation-BGcbGgHJ.mjs.map"],"mappings":";;;;;;;;AA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O,uBAAuB,CAAC,GAAG,aAAa,GAAG,iBAAiB,CAAC;AACrE"}
|
|
1
|
+
{"version":3,"file":"domain-type-generation-BGcbGgHJ-SB6n89eE.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/domain-type-generation-BGcbGgHJ.mjs"],"sourcesContent":["import { isSafeTypeExpression } from \"./type-expression-safety.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { compareCodeUnits } from \"@internal/contract/hashing-utils\";\nimport { valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { entityAt } from \"@internal/framework-components/ir\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/emitter-errors.ts\nfunction emitterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/domain-type-generation.ts\nfunction serializeValue(value) {\n\tif (value === null) return \"null\";\n\tif (value === void 0) return \"undefined\";\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (typeof value === \"bigint\") return `${value}n`;\n\tif (Array.isArray(value)) return `readonly [${value.map((v) => serializeValue(v)).join(\", \")}]`;\n\tif (typeof value === \"object\") return `{ ${Object.entries(value).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([k, v]) => `readonly ${serializeObjectKey(k)}: ${serializeValue(v)}`).join(\"; \")} }`;\n\treturn \"unknown\";\n}\nfunction serializeObjectKey(key) {\n\tif (/^[$A-Z_a-z][$\\w]*$/.test(key)) return key;\n\treturn serializeValue(key);\n}\nfunction serializeNamespaceId(value) {\n\treturn `${serializeValue(value)} & NamespaceId`;\n}\nfunction serializeCrossReference(ref) {\n\treturn `{ readonly namespace: ${serializeNamespaceId(String(ref.namespace))}; readonly model: ${serializeValue(ref.model)}${ref.space !== void 0 ? `; readonly space: ${serializeValue(ref.space)}` : \"\"} }`;\n}\nfunction generateRootsType(roots) {\n\tif (!roots || Object.keys(roots).length === 0) return \"Record<string, never>\";\n\treturn `{ ${Object.entries(roots).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${serializeCrossReference(value)}`).join(\"; \")} }`;\n}\nfunction valueObjectFieldTypeText(type) {\n\treturn `{ readonly kind: \"valueObject\"; readonly plane: \"storage\"; readonly namespaceId: ${serializeValue(type.namespaceId)}; readonly entityKind: \"valueObject\"; readonly entityName: ${serializeValue(type.entityName)} }`;\n}\nfunction contractFieldModifierSuffix(field) {\n\treturn (field.many ? `; readonly many: { readonly elementNullable: ${field.many.elementNullable} }` : \"\") + (field.dict === true ? \"; readonly dict: true\" : \"\");\n}\nfunction generateModelFieldEntry(fieldName, field) {\n\tconst mods = contractFieldModifierSuffix(field);\n\tconst { nullable, type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${mods} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${valueObjectFieldTypeText(type)}${mods} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${serializeValue(type)}${mods} }`;\n}\nfunction objectTypeOpenWhenEmpty(entries) {\n\treturn entries.length > 0 ? `{ ${entries.join(\"; \")} }` : \"{}\";\n}\nfunction generateModelFieldsType(fields) {\n\tconst fieldEntries = [];\n\tfor (const [fieldName, field] of Object.entries(fields)) fieldEntries.push(generateModelFieldEntry(fieldName, field));\n\treturn objectTypeOpenWhenEmpty(fieldEntries);\n}\nfunction generateModelRelationsType(relations) {\n\tconst relationEntries = [];\n\tfor (const [relName, rel] of Object.entries(relations)) {\n\t\tif (typeof rel !== \"object\" || rel === null) continue;\n\t\tconst relObj = blindCast(rel);\n\t\tconst toRef = relObj[\"to\"];\n\t\tif (toRef !== null && typeof toRef === \"object\" && \"space\" in toRef && toRef.space !== void 0) {\n\t\t\trelationEntries.push(`readonly ${serializeObjectKey(relName)}: never`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst parts = [];\n\t\tif (toRef) parts.push(`readonly to: ${serializeCrossReference(blindCast(toRef))}`);\n\t\tif (relObj[\"cardinality\"]) parts.push(`readonly cardinality: ${serializeValue(relObj[\"cardinality\"])}`);\n\t\tif (typeof relObj[\"nullable\"] === \"boolean\") parts.push(`readonly nullable: ${relObj[\"nullable\"]}`);\n\t\tconst on = blindCast(relObj[\"on\"]);\n\t\tif (on && (!on.localFields || !on.targetFields)) throw emitterError(\"CONTRACT.RELATION_INVALID\", `Relation \"${relName}\" has an \"on\" block but is missing localFields or targetFields`, { meta: { relation: relName } });\n\t\tif (on?.localFields && on.targetFields) {\n\t\t\tconst localFields = on.localFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tconst targetFields = on.targetFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tparts.push(`readonly on: { readonly localFields: readonly [${localFields}]; readonly targetFields: readonly [${targetFields}] }`);\n\t\t}\n\t\tif (relObj[\"cardinality\"] === \"N:M\") {\n\t\t\tconst { through } = blindCast(relObj);\n\t\t\tconst table = serializeValue(through.table);\n\t\t\tconst namespaceId = serializeValue(through.namespaceId);\n\t\t\tconst parentColumns = through.parentColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst childColumns = through.childColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst targetColumns = through.targetColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tparts.push(`readonly through: { readonly table: ${table}; readonly namespaceId: ${namespaceId}; readonly parentColumns: readonly [${parentColumns}]; readonly childColumns: readonly [${childColumns}]; readonly targetColumns: readonly [${targetColumns}] }`);\n\t\t}\n\t\tif (parts.length > 0) relationEntries.push(`readonly ${serializeObjectKey(relName)}: { ${parts.join(\"; \")} }`);\n\t}\n\tif (relationEntries.length === 0) return \"Record<string, never>\";\n\treturn `{ ${relationEntries.join(\"; \")} }`;\n}\nfunction generateModelsType(models, generateModelStorage) {\n\tif (!models || Object.keys(models).length === 0) return \"Record<string, never>\";\n\tconst modelTypes = [];\n\tfor (const [modelName, model] of Object.entries(models).sort(([a], [b]) => compareCodeUnits(a, b))) {\n\t\tconst fieldsType = generateModelFieldsType(model.fields);\n\t\tconst relationsType = generateModelRelationsType(model.relations);\n\t\tconst storageType = generateModelStorage(modelName, model);\n\t\tconst modelParts = [\n\t\t\t`readonly fields: ${fieldsType}`,\n\t\t\t`readonly relations: ${relationsType}`,\n\t\t\t`readonly storage: ${storageType}`\n\t\t];\n\t\tif (model.owner) modelParts.push(`readonly owner: ${serializeValue(model.owner)}`);\n\t\tif (model.discriminator) modelParts.push(`readonly discriminator: ${serializeValue(model.discriminator)}`);\n\t\tif (model.variants) {\n\t\t\tconst variantEntries = Object.entries(model.variants).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([value, ref]) => `readonly ${serializeObjectKey(value)}: ${serializeCrossReference(ref)}`);\n\t\t\tmodelParts.push(`readonly variants: { ${variantEntries.join(\"; \")} }`);\n\t\t}\n\t\tif (model.base) modelParts.push(`readonly base: ${serializeCrossReference(model.base)}`);\n\t\tmodelTypes.push(`readonly ${serializeObjectKey(modelName)}: { ${modelParts.join(\"; \")} }`);\n\t}\n\treturn `{ ${modelTypes.join(\"; \")} }`;\n}\nfunction deduplicateImports(imports) {\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tfor (const imp of imports) {\n\t\tconst key = `${imp.package}::${imp.named}`;\n\t\tif (!seenKeys.has(key)) {\n\t\t\tseenKeys.add(key);\n\t\t\tresult.push(imp);\n\t\t}\n\t}\n\treturn result;\n}\nfunction typesImportRequirements(imports) {\n\treturn imports.map((imp) => ({\n\t\tmoduleSpecifier: imp.package,\n\t\tsymbol: imp.named,\n\t\talias: imp.alias,\n\t\ttypeOnly: true\n\t}));\n}\nfunction generateCodecTypeIntersection(imports, named) {\n\treturn imports.filter((imp) => imp.named === named).map((imp) => imp.alias).join(\" & \") || \"Record<string, never>\";\n}\nfunction serializeExecutionType(execution) {\n\tconst parts = [\"readonly executionHash: ExecutionHash\"];\n\tfor (const [key, value] of Object.entries(execution)) {\n\t\tif (key === \"executionHash\") continue;\n\t\tparts.push(`readonly ${serializeObjectKey(key)}: ${serializeValue(value)}`);\n\t}\n\treturn `{ ${parts.join(\"; \")} }`;\n}\nfunction generateHashTypeAliases(hashes) {\n\tconst executionHashType = hashes.executionHash ? `ExecutionHashBase<${serializeValue(hashes.executionHash)}>` : \"ExecutionHashBase<string>\";\n\treturn [\n\t\t`export type StorageHash = StorageHashBase<${serializeValue(hashes.storageHash)}>;`,\n\t\t`export type ExecutionHash = ${executionHashType};`,\n\t\t`export type ProfileHash = ProfileHashBase<${serializeValue(hashes.profileHash)}>;`\n\t].join(\"\\n\");\n}\n/**\n* Renders a value set (a field/column's permitted values, codec-encoded) into a TS literal union by\n* routing **each** value through the codec's `renderValueLiteral` — the seam owned by the codec, not\n* a generic serializer. `side`: `output` = read type, `input` = create/update type.\n*\n* Returns `undefined` — signalling the caller to fall back to the codec's full output type — when\n* the lookup is absent, has no `renderValueLiteralFor`, the value set is empty, or **any** value\n* isn't literal-expressible, which every value of a codec that declares `keepsWrittenForm` is. A\n* caller that needs column and field types to agree shares this so both compute the union\n* identically.\n*/\nfunction renderValueSetType(values, codecId, side, codecLookup) {\n\tif (values.length === 0) return void 0;\n\tconst literals = [];\n\tfor (const value of values) {\n\t\tconst lit = renderValueLiteralType(value, codecId, side, codecLookup);\n\t\tif (lit === void 0) return void 0;\n\t\tliterals.push(lit);\n\t}\n\treturn literals.join(\" | \");\n}\n/** The TS literal type the codec renders for one stored value, or `undefined` when it renders none or what it renders is not a safe type expression. */\nfunction renderValueLiteralType(value, codecId, side, codecLookup) {\n\tconst lit = codecLookup?.renderValueLiteralFor?.(codecId, value, side);\n\treturn lit === void 0 || !isSafeTypeExpression(lit) ? void 0 : lit;\n}\n/** The local alias for the union of the stack's parameterized output type functions. */\nconst PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS = \"ParameterizedOutputTypeFunctions\";\n/** The declaration of {@link PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS} for the type functions the stack's components declare. */\nfunction parameterizedOutputTypeFunctionsAlias(typeFunctions) {\n\tconst aliases = [...new Set(typeFunctions.map((typeFunction) => typeFunction.alias))];\n\treturn `type ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS} = ${aliases.length > 0 ? aliases.join(\" | \") : \"never\"};`;\n}\n/** `FieldOutputTypes` (`side` `'output'`) or `FieldInputTypes` (`'input'`): the shared generic applied to the emitted contract's domain, with `FieldTypeOverrides`, and to its storage namespaces. */\nfunction fieldTypesMapExpression(side) {\n\treturn `FieldTypesFromDomain<ContractBase['domain']['namespaces'], CodecTypes, ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS}, FieldTypeOverrides, ${serializeValue(side)}, ContractBase['storage']['namespaces']>`;\n}\nfunction generateContractFieldDescriptor(fieldName, field) {\n\tconst modStr = contractFieldModifierSuffix(field);\n\tconst { type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${modStr} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${valueObjectFieldTypeText(type)}${modStr} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${serializeValue(type)}${modStr} }`;\n}\nfunction generateValueObjectsDescriptorType(valueObjects) {\n\tif (!valueObjects || Object.keys(valueObjects).length === 0) return \"Record<string, never>\";\n\tconst voEntries = [];\n\tfor (const [voName, vo] of Object.entries(valueObjects)) {\n\t\tconst fieldEntries = [];\n\t\tfor (const [fieldName, field] of Object.entries(vo.fields)) fieldEntries.push(generateContractFieldDescriptor(fieldName, field));\n\t\tconst fieldsType = fieldEntries.length > 0 ? `{ ${fieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tvoEntries.push(`readonly ${serializeObjectKey(voName)}: { readonly fields: ${fieldsType} }`);\n\t}\n\treturn `{ ${voEntries.join(\"; \")} }`;\n}\n/**\n* `<Name>Output` and `<Name>Input` for each value object, read from the shared generic's value object types at the storage namespace that holds it.\n*/\nfunction generateValueObjectTypeAliases(valueObjectNamespaces) {\n\tif (valueObjectNamespaces.length === 0) return \"\";\n\tconst generic = (side) => `ValueObjectTypesFromStorage<ContractBase['storage']['namespaces'], CodecTypes, ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS}, FieldTypeOverrides, ${serializeValue(side)}>`;\n\tconst aliases = [`type ValueObjectOutputTypes = ${generic(\"output\")};`, `type ValueObjectInputTypes = ${generic(\"input\")};`];\n\tfor (const [name, namespaceId] of valueObjectNamespaces) {\n\t\tconst path = `[${serializeValue(namespaceId)}][${serializeValue(name)}]`;\n\t\taliases.push(`export type ${name}Output = ValueObjectOutputTypes${path};`);\n\t\taliases.push(`export type ${name}Input = ValueObjectInputTypes${path};`);\n\t}\n\treturn aliases.join(\"\\n\");\n}\n/**\n* The type of a scalar field that its codec does not give, which the shared field type generic takes as an override: the literal union of the value set it holds, or the text its codec renders for its type parameters. `undefined` when the codec gives both sides, and for a value object or union field, which the generic types itself.\n*/\nfunction resolveFieldTypeOverride(field, codecLookup, resolvedValueSet) {\n\tconst { type } = field;\n\tif (type.kind !== \"scalar\") return void 0;\n\tif (resolvedValueSet) {\n\t\tconst override = renderValueSetOverride(resolvedValueSet.encodedValues, resolvedValueSet.codecId, codecLookup);\n\t\tif (override !== void 0) return override;\n\t}\n\tconst typeParams = type.typeParams && Object.keys(type.typeParams).length > 0 ? type.typeParams : void 0;\n\treturn renderCodecTypeOverride(type.codecId, typeParams, codecLookup);\n}\n/** The literal union of a value set on each side whose values all have literal types, or `undefined` when neither side has. */\nfunction renderValueSetOverride(values, codecId, codecLookup) {\n\tconst output = renderValueSetType(values, codecId, \"output\", codecLookup);\n\tconst input = renderValueSetType(values, codecId, \"input\", codecLookup);\n\tconst override = {\n\t\t...output !== void 0 ? { output } : {},\n\t\t...input !== void 0 ? { input } : {}\n\t};\n\treturn Object.keys(override).length > 0 ? override : void 0;\n}\n/** The type text a codec renders for these type parameters, on the sides it renders one. */\nfunction renderCodecTypeOverride(codecId, typeParams, codecLookup) {\n\tif (codecLookup === void 0 || typeParams === void 0) return void 0;\n\tconst output = codecLookup.renderOutputTypeFor(codecId, typeParams);\n\tconst input = codecLookup.renderInputTypeFor?.(codecId, typeParams);\n\tconst override = {\n\t\t...output && isSafeTypeExpression(output) ? { output } : {},\n\t\t...input && isSafeTypeExpression(input) ? { input } : {}\n\t};\n\treturn Object.keys(override).length > 0 ? override : void 0;\n}\nfunction renderTypeOverride(override) {\n\treturn `{ ${[\"output\", \"input\"].flatMap((side) => {\n\t\tconst type = override[side];\n\t\treturn type === void 0 ? [] : [`readonly ${side}: ${type}`];\n\t}).join(\"; \")} }`;\n}\n/** A nested map of type overrides, one level per path segment, ordered by name at every level, leaving out every branch with no entry. */\nfunction renderTypeOverridesMap(entries) {\n\tconst root = /* @__PURE__ */ new Map();\n\tfor (const [path, type] of entries) {\n\t\tif (type === void 0) continue;\n\t\tlet node = root;\n\t\tfor (const segment of path.slice(0, -1)) {\n\t\t\tconst child = node.get(segment);\n\t\t\tconst next = child instanceof Map ? child : /* @__PURE__ */ new Map();\n\t\t\tnode.set(segment, next);\n\t\t\tnode = next;\n\t\t}\n\t\tconst leaf = path.at(-1);\n\t\tif (leaf !== void 0) node.set(leaf, type);\n\t}\n\treturn renderOverrideTree(root);\n}\nfunction renderOverrideTree(tree) {\n\treturn `{ ${[...tree].sort(([a], [b]) => compareCodeUnits(a, b)).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${value instanceof Map ? renderOverrideTree(value) : renderTypeOverride(value)}`).join(\"; \")} }`;\n}\n/**\n* The values a model field's value set holds, with the field's codec. A reference to a domain enum is read from the contract's domain. Any other model field goes to the family's `resolveStorageValueSet`, which reads its storage.\n*/\nfunction resolveFieldValueSet(field, contract, resolveStorageValueSet) {\n\tif (field.valueSet?.plane === \"domain\") return resolveDomainValueSet(field, contract);\n\treturn resolveStorageValueSet();\n}\nfunction resolveDomainValueSet(field, contract) {\n\tconst ref = field.valueSet;\n\tif (ref === void 0 || field.type.kind !== \"scalar\" || ref.entityKind !== \"enum\") return;\n\tconst domainEnum = contract.domain.namespaces[ref.namespaceId]?.enum?.[ref.entityName];\n\tif (domainEnum === void 0) return void 0;\n\treturn {\n\t\tencodedValues: domainEnum.members.map((member) => member.value),\n\t\tcodecId: field.type.codecId\n\t};\n}\n/** The values of the storage value set a value object field names, with the field's codec. */\nfunction resolveValueObjectFieldValueSet(field, storage) {\n\tif (field.valueSet === void 0 || field.type.kind !== \"scalar\") return void 0;\n\tconst valueSet = entityAt(storage, field.valueSet);\n\tif (valueSet === void 0) return void 0;\n\treturn {\n\t\tencodedValues: valueSet.values,\n\t\tcodecId: field.type.codecId\n\t};\n}\n/** `FieldTypeOverrides`: per namespace, `models` (domain namespace) or `valueObjects` (storage namespace), owner and field, the type of each field its codec does not give. */\nfunction generateFieldTypeOverridesMap(contract, codecLookup, resolveStorageValueSet) {\n\tconst modelFields = Object.entries(contract.domain.namespaces).flatMap(([nsId, ns]) => Object.entries(ns.models).flatMap(([modelName, model]) => Object.entries(model.fields).map(([fieldName, field]) => [[\n\t\tnsId,\n\t\t\"models\",\n\t\tmodelName,\n\t\tfieldName\n\t], resolveFieldTypeOverride(field, codecLookup, resolveFieldValueSet(field, contract, () => resolveStorageValueSet?.(modelName, fieldName, model)))])));\n\tconst valueObjectFields = valueObjectsWithCoordinates(contract.storage).flatMap(({ coordinate: { namespaceId: nsId, entityName: valueObjectName }, valueObject }) => Object.entries(valueObject.fields).map(([fieldName, field]) => [[\n\t\tnsId,\n\t\t\"valueObjects\",\n\t\tvalueObjectName,\n\t\tfieldName\n\t], resolveFieldTypeOverride(field, codecLookup, resolveValueObjectFieldValueSet(field, contract.storage))]));\n\treturn renderTypeOverridesMap([...modelFields, ...valueObjectFields]);\n}\n//#endregion\nexport { serializeCrossReference as C, serializeValue as D, serializeObjectKey as E, typesImportRequirements as O, resolveFieldTypeOverride as S, serializeNamespaceId as T, renderTypeOverride as _, generateContractFieldDescriptor as a, renderValueSetOverride as b, generateModelFieldEntry as c, generateModelsType as d, generateRootsType as f, renderCodecTypeOverride as g, parameterizedOutputTypeFunctionsAlias as h, generateCodecTypeIntersection as i, emitterError as k, generateModelFieldsType as l, generateValueObjectsDescriptorType as m, deduplicateImports as n, generateFieldTypeOverridesMap as o, generateValueObjectTypeAliases as p, fieldTypesMapExpression as r, generateHashTypeAliases as s, PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS as t, generateModelRelationsType as u, renderTypeOverridesMap as v, serializeExecutionType as w, renderValueSetType as x, renderValueLiteralType as y };\n\n//# sourceMappingURL=domain-type-generation-BGcbGgHJ.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AAGA,SAAS,eAAe,OAAO;CAC9B,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,UAAU,KAAK,GAAG,OAAO;CAC7B,IAAI,OAAO,UAAU,UAAU,OAAO,gBAAgB,KAAK;CAC3D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;CAChF,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,MAAM;CAC/C,IAAI,MAAM,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M,KAAK,SAAS,UAAU,OAAO,KAAK;CAC3E,MAAM,WAAW,SAAS,SAAS,MAAM,QAAQ;CACjD,IAAI,aAAa,KAAK,GAAG,OAAO,KAAK;CACrC,OAAO;EACN,eAAe,SAAS;EACxB,SAAS,MAAM,KAAK;CACrB;AACD;;AAEA,SAAS,8BAA8B,UAAU,aAAa,wBAAwB;CACrF,MAAM,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,QAAQ,OAAO,QAAQ,GAAG,MAAM,CAAC,CAAC,SAAS,CAAC,WAAW,WAAW,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,WAAW,WAAW,CAAC;EAC1M;EACA;EACA;EACA;CACD,GAAG,yBAAyB,OAAO,aAAa,qBAAqB,OAAO,gBAAgB,yBAAyB,WAAW,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtJ,MAAM,oBAAoB,4BAA4B,SAAS,OAAO,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,MAAM,YAAY,mBAAmB,kBAAkB,OAAO,QAAQ,YAAY,MAAM,CAAC,CAAC,KAAK,CAAC,WAAW,WAAW,CAAC;EACpO;EACA;EACA;EACA;CACD,GAAG,yBAAyB,OAAO,aAAa,gCAAgC,OAAO,SAAS,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3G,OAAO,uBAAuB,CAAC,GAAG,aAAa,GAAG,iBAAiB,CAAC;AACrE"}
|
package/dist/emitter.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { D as serializeObjectKey, O as serializeValue, a as generateCodecTypeIntersection, c as generateHashTypeAliases, d as generateModelRelationsType, k as typesImportRequirements, n as deduplicateImports, p as generateRootsType } from "./domain-type-generation-BGcbGgHJ-
|
|
2
|
-
import { n as generateContractDts, r as getEmittedArtifactPaths, t as emit } from "./exports-CCuYD8dO-
|
|
1
|
+
import { D as serializeObjectKey, O as serializeValue, a as generateCodecTypeIntersection, c as generateHashTypeAliases, d as generateModelRelationsType, k as typesImportRequirements, n as deduplicateImports, p as generateRootsType } from "./domain-type-generation-BGcbGgHJ-SB6n89eE.mjs";
|
|
2
|
+
import { n as generateContractDts, r as getEmittedArtifactPaths, t as emit } from "./exports-CCuYD8dO-fFXwpizm.mjs";
|
|
3
3
|
export { deduplicateImports, emit, generateCodecTypeIntersection, generateContractDts, generateHashTypeAliases, generateModelRelationsType, generateRootsType, getEmittedArtifactPaths, serializeObjectKey, serializeValue, typesImportRequirements };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as resolveFieldTypeOverride, D as serializeObjectKey, E as serializeNamespaceId, O as serializeValue, S as renderValueSetType, T as serializeExecutionType, _ as renderCodecTypeOverride, a as generateCodecTypeIntersection, b as renderValueLiteralType, c as generateHashTypeAliases, d as generateModelRelationsType, f as generateModelsType, g as parameterizedOutputTypeFunctionsAlias, h as generateValueObjectsDescriptorType, i as fieldTypesMapExpression, k as typesImportRequirements, l as generateModelFieldEntry, m as generateValueObjectTypeAliases, n as deduplicateImports, o as generateContractFieldDescriptor, p as generateRootsType, s as generateFieldTypeOverridesMap, t as PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS, u as generateModelFieldsType, v as renderTypeOverride, w as serializeCrossReference, x as renderValueSetOverride, y as renderTypeOverridesMap } from "./domain-type-generation-BGcbGgHJ-
|
|
1
|
+
import { C as resolveFieldTypeOverride, D as serializeObjectKey, E as serializeNamespaceId, O as serializeValue, S as renderValueSetType, T as serializeExecutionType, _ as renderCodecTypeOverride, a as generateCodecTypeIntersection, b as renderValueLiteralType, c as generateHashTypeAliases, d as generateModelRelationsType, f as generateModelsType, g as parameterizedOutputTypeFunctionsAlias, h as generateValueObjectsDescriptorType, i as fieldTypesMapExpression, k as typesImportRequirements, l as generateModelFieldEntry, m as generateValueObjectTypeAliases, n as deduplicateImports, o as generateContractFieldDescriptor, p as generateRootsType, s as generateFieldTypeOverridesMap, t as PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS, u as generateModelFieldsType, v as renderTypeOverride, w as serializeCrossReference, x as renderValueSetOverride, y as renderTypeOverridesMap } from "./domain-type-generation-BGcbGgHJ-SB6n89eE.mjs";
|
|
2
2
|
export { PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS, deduplicateImports, fieldTypesMapExpression, generateCodecTypeIntersection, generateContractFieldDescriptor, generateFieldTypeOverridesMap, generateHashTypeAliases, generateModelFieldEntry, generateModelFieldsType, generateModelRelationsType, generateModelsType, generateRootsType, generateValueObjectTypeAliases, generateValueObjectsDescriptorType, parameterizedOutputTypeFunctionsAlias, renderCodecTypeOverride, renderTypeOverride, renderTypeOverridesMap, renderValueLiteralType, renderValueSetOverride, renderValueSetType, resolveFieldTypeOverride, serializeCrossReference, serializeExecutionType, serializeNamespaceId, serializeObjectKey, serializeValue, typesImportRequirements };
|
|
@@ -3,7 +3,7 @@ import { CliStructuredError } from "@prisma/orm-framework/errors/control";
|
|
|
3
3
|
import { ACCESS_WIDENING_LEVELS, CHANGE_STRATEGIES, DATABASE_POLICIES_KEYS, DATA_LOSS_LEVELS, DATA_PROTECTION_KEYS } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
5
|
import { dirname, relative } from "pathe";
|
|
6
|
-
//#region ../../../1-framework/3-tooling/migration/dist/errors-
|
|
6
|
+
//#region ../../../1-framework/3-tooling/migration/dist/errors-BlaB9AFz.mjs
|
|
7
7
|
/**
|
|
8
8
|
* Build the canonical "re-emit this package" remediation hint.
|
|
9
9
|
*
|
|
@@ -362,15 +362,14 @@ function errorHashNotInGraph(hash, graph) {
|
|
|
362
362
|
const reachableList = reachableHashes.length > 0 ? reachableHashes.join(", ") : "(none)";
|
|
363
363
|
return new MigrationToolsError("MIGRATION.HASH_NOT_IN_GRAPH", `Hash "${hash}" is not a node in the migration graph`, {
|
|
364
364
|
why: `The migration graph contains nodes ${reachableList}; "${hash}" isn't one of them.`,
|
|
365
|
-
fix: `Pass a hash that's the from-or-to of an on-disk migration bundle, use --from with a graph-node hash, or
|
|
365
|
+
fix: `Pass a hash that's the from-or-to of an on-disk migration bundle, use --from with a graph-node hash, or plan a migration that ends at it to introduce it.`,
|
|
366
366
|
nextActions: [{
|
|
367
367
|
kind: "user-choice",
|
|
368
368
|
label: "Pass a hash that is the from-or-to of an on-disk migration bundle, or use --from with a graph-node hash",
|
|
369
369
|
reason: `Graph nodes: ${reachableList}.`
|
|
370
370
|
}, {
|
|
371
|
-
kind: "
|
|
372
|
-
label: `
|
|
373
|
-
command: "{bin} migration plan"
|
|
371
|
+
kind: "user-choice",
|
|
372
|
+
label: `Or introduce "${hash}" by planning a migration that ends at it`
|
|
374
373
|
}],
|
|
375
374
|
meta: {
|
|
376
375
|
hash,
|
|
@@ -381,12 +380,11 @@ function errorHashNotInGraph(hash, graph) {
|
|
|
381
380
|
function errorContractSnapshotMissing(storageHash, expectedPath) {
|
|
382
381
|
return new MigrationToolsError("MIGRATION.CONTRACT_SNAPSHOT_MISSING", "Contract snapshot is missing", {
|
|
383
382
|
why: `Expected a contract snapshot for ${storageHash} at "${expectedPath}" but the file does not exist.`,
|
|
384
|
-
fix:
|
|
383
|
+
fix: `Re-emit the contract snapshot, or restore migrations/snapshots/ from version control. For an app-space migration planned to the emitted contract, emit that contract again and re-run the \`migration plan\` that wrote the migration ending at ${storageHash}, with its \`--from\` and no \`--to\`, then delete the new migration directory it writes, which repeats the existing migration; the snapshot stays. A plan with \`--to\` reads the snapshot, so it cannot re-emit it. For an extension space, re-run the extension's contract-space build.`,
|
|
385
384
|
nextActions: [
|
|
386
385
|
{
|
|
387
|
-
kind: "
|
|
388
|
-
label: "
|
|
389
|
-
command: "{bin} migration plan"
|
|
386
|
+
kind: "user-choice",
|
|
387
|
+
label: "For an app-space migration planned to the emitted contract, emit that contract again and re-run the migration plan that wrote the migration ending at that contract, with its --from and no --to, to re-emit the snapshot. Then delete the new migration directory it writes, which repeats the existing migration; the snapshot stays. A plan with --to reads the snapshot, so it cannot re-emit it"
|
|
390
388
|
},
|
|
391
389
|
{
|
|
392
390
|
kind: "user-choice",
|
|
@@ -440,4 +438,4 @@ function errorMigrationContractViewMissing(className, accessor, jsonField) {
|
|
|
440
438
|
//#endregion
|
|
441
439
|
export { errorRefNotResolvable as A, errorInvalidSpaceId as C, errorNoInvariantPath as D, errorMissingFile as E, errorUnknownInvariant as M, errorOperationsNotArray as O, errorInvalidSlug as S, errorMigrationHashMismatch as T, errorInvalidManifest as _, errorContractSnapshotHashMismatch as a, errorInvalidRefName as b, errorDescribeMissingEndContract as c, errorDuplicateInvariantInEdge as d, errorDuplicateSpaceId as f, errorInvalidJson as g, errorInvalidInvariantId as h, errorContractSnapshotContentMismatch as i, errorSpaceHeadRefMissing as j, errorProvidedInvariantsMismatch as k, errorDescriptorHeadHashMismatch as l, errorInvalidDestName as m, errorBundleNotFoundForGraphNode as n, errorContractSnapshotMissing as o, errorHashNotInGraph as p, errorContractDeserializationFailed as r, errorDescribeInvalidMetadata as s, MigrationToolsError as t, errorDirectoryExists as u, errorInvalidOperationEntry as v, errorMigrationContractViewMissing as w, errorInvalidRefValue as x, errorInvalidRefFile as y };
|
|
442
440
|
|
|
443
|
-
//# sourceMappingURL=errors-
|
|
441
|
+
//# sourceMappingURL=errors-BlaB9AFz-CZDOC0mV.mjs.map
|