@prisma/orm-toolchain 8.0.0-rc.11-dev.6 → 8.0.0-rc.11-dev.7
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/cli.mjs +128 -80
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__control-api.d.mts +26 -23
- 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 +2 -1
- package/dist/cli__control-api__testing.d.mts.map +1 -1
- package/dist/cli__control-api__testing.mjs +5 -1
- package/dist/cli__control-api__testing.mjs.map +1 -1
- package/dist/{db-verify-Yih5kWtB-B1kv76ec.d.mts → db-verify-BdKY7U7l-6VLIVuKF.d.mts} +41 -3
- package/dist/db-verify-BdKY7U7l-6VLIVuKF.d.mts.map +1 -0
- package/dist/{ref-DcqFmceq-QaUjgZeM.mjs → ref-uqvZQnnQ-DpAQaLiM.mjs} +108 -81
- package/dist/ref-uqvZQnnQ-DpAQaLiM.mjs.map +1 -0
- package/dist/vite-plugin-contract-emit.mjs +1 -1
- package/package.json +12 -12
- package/dist/db-verify-Yih5kWtB-B1kv76ec.d.mts.map +0 -1
- package/dist/ref-DcqFmceq-QaUjgZeM.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as Refs, n as RefEntry } from "./refs-BNCUu58Y-BIso5Jfg.mjs";
|
|
2
2
|
import { n as MigrationGraph } from "./graph-bDjJ4GL9-BhFevsJS.mjs";
|
|
3
3
|
import { r as MigrationRef, t as ContractRef } from "./ref-resolution-CaHQJXE0.mjs";
|
|
4
|
-
import { A as
|
|
4
|
+
import { A as RenderContractDtsFailure, C as EmitResult, D as IntrospectOptions, E as ExecuteDbVerifyResult, F as SchemaVerifyOptions, I as SignOptions, L as VerifyOptions, M as RenderContractDtsOptions, N as RenderContractDtsResult, P as RenderContractDtsSuccess, R as executeDbVerify, S as EmitOptions, T as ExecuteDbVerifyOptions, _ as DbUpdateResult, a as ControlClient, b as EmitFailure, c as CreateControlClient, d as DbInitOptions, f as DbInitResult, g as DbUpdateOptions, h as DbUpdateFailureCode, i as ControlActionName, j as RenderContractDtsFailureCode, k as OnControlProgress, l as DbInitFailure, m as DbUpdateFailure, n as ContractEmitOptions, o as ControlClientOptions, p as DbInitSuccess, r as ContractEmitResult, s as ControlProgressEvent, t as CliStructuredError$2, u as DbInitFailureCode, v as DbUpdateSuccess, w as EmitSuccess, x as EmitFailureCode, y as EmitContractConfig } from "./db-verify-BdKY7U7l-6VLIVuKF.mjs";
|
|
5
5
|
import { a as emit } from "./index-D217lbiW.mjs";
|
|
6
6
|
import { n as OnDiskMigrationPackage, t as MigrationOps } from "./package-CfWiDNrr-ZR4HM_Iz.mjs";
|
|
7
7
|
import { c as ContractSpaceAggregate, d as IntegrityQueryOptions, p as IntegrityViolation, t as AggregateContractSpace } from "./aggregate-D_eX4zoo.mjs";
|
|
@@ -856,6 +856,7 @@ declare function executeRefDeleteCommand(name: string, options: RefOperationOpti
|
|
|
856
856
|
declare function executeRefListCommand(options: RefOperationOptions): Promise<Result<RefListResult, CliStructuredError$2>>;
|
|
857
857
|
//#endregion
|
|
858
858
|
//#region src/control-api/operations/ref-advancement.d.ts
|
|
859
|
+
/** A contract snapshot's two halves: the JSON and the declarations rendered from it. */
|
|
859
860
|
interface ContractIR {
|
|
860
861
|
readonly contract: unknown;
|
|
861
862
|
readonly contractDts: string;
|
|
@@ -870,41 +871,43 @@ interface RefAdvancementFields {
|
|
|
870
871
|
readonly hash: string;
|
|
871
872
|
} | null;
|
|
872
873
|
}
|
|
874
|
+
declare const NO_REF_ADVANCEMENT: RefAdvancementFields;
|
|
873
875
|
declare function computeRefAdvancementName(options: {
|
|
874
876
|
readonly advanceRef?: string;
|
|
875
877
|
readonly db?: string;
|
|
876
878
|
}): string | null;
|
|
877
|
-
|
|
879
|
+
/**
|
|
880
|
+
* Everything `executeRefAdvancement` needs, produced before a command does the
|
|
881
|
+
* work that precedes the ref write: the ref name is validated and the
|
|
882
|
+
* declarations of the contract to snapshot are rendered from its JSON, with
|
|
883
|
+
* the import names the project owning `configPath` can resolve. Nothing is
|
|
884
|
+
* read or rendered after the database is touched, so a contract that cannot
|
|
885
|
+
* be snapshotted refuses the command before it changes anything.
|
|
886
|
+
*/
|
|
887
|
+
declare function preflightRefAdvancement(args: {
|
|
888
|
+
readonly name: string;
|
|
889
|
+
readonly contractJson: Record<string, unknown>;
|
|
890
|
+
readonly contractJsonPath: string;
|
|
891
|
+
readonly configPath: string;
|
|
892
|
+
readonly client: Pick<ControlClient, 'renderContractDts'>;
|
|
893
|
+
}): Promise<Result<ContractIR, CliStructuredError$2>>;
|
|
878
894
|
declare function executeRefAdvancement(refsDir: string, migrationsDir: string, name: string, hash: string, contractIR: ContractIR): Promise<{
|
|
879
895
|
name: string;
|
|
880
896
|
hash: string;
|
|
881
897
|
}>;
|
|
898
|
+
/**
|
|
899
|
+
* The ref-advancement tail of db init / db update, run after the database
|
|
900
|
+
* work with the `ContractIR` that `preflightRefAdvancement` produced before
|
|
901
|
+
* it. Plan mode reports the ref that an apply would advance without writing.
|
|
902
|
+
*/
|
|
882
903
|
declare function buildRefAdvancementFields(options: {
|
|
883
|
-
readonly
|
|
884
|
-
readonly db?: string;
|
|
904
|
+
readonly name: string;
|
|
885
905
|
readonly refsDir: string;
|
|
886
906
|
readonly migrationsDir: string;
|
|
887
907
|
readonly contractIR: ContractIR;
|
|
888
908
|
readonly mode: 'plan' | 'apply';
|
|
889
909
|
readonly hash: string;
|
|
890
|
-
}): Promise<RefAdvancementFields
|
|
891
|
-
interface ResolveRefAdvancementFieldsOptions {
|
|
892
|
-
readonly advanceRef?: string;
|
|
893
|
-
readonly db?: string;
|
|
894
|
-
readonly refsDir: string;
|
|
895
|
-
readonly migrationsDir: string;
|
|
896
|
-
readonly contractJson: Record<string, unknown>;
|
|
897
|
-
/** Path whose sibling .d.ts readContractIR derives (contract.json path). */
|
|
898
|
-
readonly contractJsonPath: string;
|
|
899
|
-
readonly mode: 'plan' | 'apply';
|
|
900
|
-
readonly hash: string;
|
|
901
|
-
}
|
|
902
|
-
/**
|
|
903
|
-
* Full ref-advancement phase for db init/update: ok({advancedRef:null, plannedAdvanceRef:null})
|
|
904
|
-
* when computeRefAdvancementName is null; else readContractIR + buildRefAdvancementFields with
|
|
905
|
-
* MigrationToolsError mapped, other errors rethrown.
|
|
906
|
-
*/
|
|
907
|
-
declare function resolveRefAdvancementFields(options: ResolveRefAdvancementFieldsOptions): Promise<Result<RefAdvancementFields, CliStructuredError$2>>;
|
|
910
|
+
}): Promise<Result<RefAdvancementFields, CliStructuredError$2>>;
|
|
908
911
|
/**
|
|
909
912
|
* The --advance-ref tail of migrate and db sign: executeRefAdvancement with
|
|
910
913
|
* MigrationToolsError failures passed through as notOk, others rethrown.
|
|
@@ -939,5 +942,5 @@ declare function readMigrationRefs(refsDir: string): Promise<Result<Refs, CliStr
|
|
|
939
942
|
//#region src/utils/emit-queue.d.ts
|
|
940
943
|
declare function disposeEmitQueue(outputJsonPath: string): void;
|
|
941
944
|
//#endregion
|
|
942
|
-
export { type BuildAggregateInputs, type CheckSpace, type ContractEmitOptions, type ContractEmitResult, type ContractIR, type ContractSpaceSeedPhaseInputs, type ContractSpaceSeedPhaseRecord, type ContractSpaceSeedPhaseResult, type ControlActionName, type ControlClient, type ControlClientOptions, type ControlProgressEvent, type ControlStack, type DbInitFailure, type DbInitFailureCode, type DbInitOptions, type DbInitResult, type DbInitSuccess, type DbUpdateFailure, type DbUpdateFailureCode, type DbUpdateOptions, type DbUpdateResult, type DbUpdateSuccess, type EmitContractConfig, type EmitFailure, type EmitFailureCode, type EmitOptions, type EmitResult, type EmitSuccess, type ExecuteDbInitOptions, type ExecuteDbUpdateOptions, type ExecuteDbVerifyOptions, type ExecuteDbVerifyResult, type ExecuteMigrateShowPlanOptions, type FromResolution, type IntrospectOptions, type MigrateShowMigration, type MigrateShowPlanSuccess, type MigrationCheckOutcome, type MigrationPlanResult, type OnControlProgress, type RefAdvancementFields, type ResolveContractRefToSnapshotOptions, type ResolveContractRefToSnapshotSuccess, type ResolvedContractRef, type RunMigrationCheckInputs, type RunMigrationListInputs, type SchemaVerifyOptions, type SignDatabaseResult, type SignOptions, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, type VerifyOptions, advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSpaceAggregateForCli, mapCaughtMigrationError, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, originHashForStatus,
|
|
945
|
+
export { type BuildAggregateInputs, type CheckSpace, type ContractEmitOptions, type ContractEmitResult, type ContractIR, type ContractSpaceSeedPhaseInputs, type ContractSpaceSeedPhaseRecord, type ContractSpaceSeedPhaseResult, type ControlActionName, type ControlClient, type ControlClientOptions, type ControlProgressEvent, type ControlStack, type DbInitFailure, type DbInitFailureCode, type DbInitOptions, type DbInitResult, type DbInitSuccess, type DbUpdateFailure, type DbUpdateFailureCode, type DbUpdateOptions, type DbUpdateResult, type DbUpdateSuccess, type EmitContractConfig, type EmitFailure, type EmitFailureCode, type EmitOptions, type EmitResult, type EmitSuccess, type ExecuteDbInitOptions, type ExecuteDbUpdateOptions, type ExecuteDbVerifyOptions, type ExecuteDbVerifyResult, type ExecuteMigrateShowPlanOptions, type FromResolution, type IntrospectOptions, type MigrateShowMigration, type MigrateShowPlanSuccess, type MigrationCheckOutcome, type MigrationPlanResult, NO_REF_ADVANCEMENT, type OnControlProgress, type RefAdvancementFields, type RenderContractDtsFailure, type RenderContractDtsFailureCode, type RenderContractDtsOptions, type RenderContractDtsResult, type RenderContractDtsSuccess, type ResolveContractRefToSnapshotOptions, type ResolveContractRefToSnapshotSuccess, type ResolvedContractRef, type RunMigrationCheckInputs, type RunMigrationListInputs, type SchemaVerifyOptions, type SignDatabaseResult, type SignOptions, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, type VerifyOptions, advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSpaceAggregateForCli, mapCaughtMigrationError, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, originHashForStatus, preflightRefAdvancement, readMigrationRefs, refuseContractSpaceIntegrity, refuseDeclaredExtensionTargetMismatch, refuseMarkerOutsideGraph, refuseMissingInvariantPath, refusePackageCorruptionOnAggregate, refuseUnknownInvariants, resolveContractRef, resolveContractRefToSnapshot, resolveFromForPlan, resolveMigrationRef, resolveToForPlan, runContractSpaceSeedPhase, runMigrationCheck, runMigrationList, statusForMigrationHash };
|
|
943
946
|
//# sourceMappingURL=cli__control-api.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli__control-api.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBiB,oBAAoB,SAAS,uBAAuB;;;;;;iB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,wBAAwB,cAAc,SAAS,sBAAsB,QAAQ,OAAO,iBAAiB;iBACrG,sBAAsB,SAAS,sBAAsB,QAAQ,OAAO,eAAe;;;;UAI1F;WACC;WACA;;UAED;WACC;aACE;aACA;;WAEF;aACE;aACA;;;cAGC,oBAAoB;iBACjB,0BAA0B;WAChC;WACA;;;;;;;;;;iBAUM,wBAAwB;WAC9B;WACA,cAAc;WACd;WACA;WACA,QAAQ,KAAK;IACpB,QAAQ,OAAO,YAAY;iBACd,sBAAsB,iBAAiB,uBAAuB,cAAc,cAAc,YAAY,aAAa;EAClI;EACA;;;;;;;iBAOe,0BAA0B;WAChC;WACA;WACA;WACA,YAAY;WACZ;WACA;IACP,QAAQ,OAAO,sBAAsB;;;;;iBAKxB,iBAAiB;WACvB;WACA;WACA;WACA;WACA,YAAY;IACnB,QAAQ;WACD;WACA;GACR;;;UAGO;WACC,OAAO;WACP,MAAM;WACN;;iBAEM,mBAAmB,eAAe,SAAS,uBAAuB,OAAO,aAAa;iBACtF,oBAAoB,eAAe;WACzC,OAAO;WACP,MAAM;IACb,OAAO,cAAc;;;;iBAIR,kBAAkB,kBAAkB,QAAQ,OAAO,MAAM;;;iBAGzD,iBAAiB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSpaceAggregateForCli, mapCaughtMigrationError, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, originHashForStatus,
|
|
1
|
+
import { $ as listRefsByContractHash, B as executeContractEmit, Ct as resolveFromForPlan, Dt as runContractSpaceSeedPhase, G as executeMigrationNewCommand, H as executeDbUpdate, J as executeRefDeleteCommand, K as executeMigrationPlanCommand, Ot as runMigrationCheck, Q as hasMigrationPath, St as resolveContractRefToSnapshot, Tt as resolveToForPlan, U as executeDbVerify, V as executeDbInit, W as executeMigrateShowPlan, X as executeRefSetCommand, Y as executeRefListCommand, _ as enrichContract, _t as refusePackageCorruptionOnAggregate, a as appliedHashesFromLedger, at as mapContractAtError, c as buildReadAggregate, ct as migrationSpaceListEntriesFromAggregate, et as loadAggregateIntegrityViolations, ft as readMigrationRefs, g as disposeEmitQueue, gt as refuseMissingInvariantPath, h as deriveStatusEdgeAnnotations, ht as refuseMarkerOutsideGraph, i as appContractStandInFromIdentity, it as mapCaughtMigrationError, jt as statusForMigrationHash, kt as runMigrationList, l as buildRefAdvancementFields, lt as originHashForStatus, m as createControlClient, mt as refuseDeclaredExtensionTargetMismatch, n as NO_REF_ADVANCEMENT, nt as loadContractSpaceAggregateForCli, o as buildContractSpaceAggregate, ot as mapIntegrityViolations, p as computeRefAdvancementName, pt as refuseContractSpaceIntegrity, q as executeRefAdvancement, r as advanceRefSafely, s as buildMigrationSpaceGraphEntries, tt as loadContractRawSafely, u as checkSingleTarget, ut as preflightRefAdvancement, v as enumerateCheckSpaces, vt as refuseUnknownInvariants, wt as resolveMigrationRef, xt as resolveContractRef$1 } from "./ref-uqvZQnnQ-DpAQaLiM.mjs";
|
|
2
|
+
export { NO_REF_ADVANCEMENT, advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSpaceAggregateForCli, mapCaughtMigrationError, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, originHashForStatus, preflightRefAdvancement, readMigrationRefs, refuseContractSpaceIntegrity, refuseDeclaredExtensionTargetMismatch, refuseMarkerOutsideGraph, refuseMissingInvariantPath, refusePackageCorruptionOnAggregate, refuseUnknownInvariants, resolveContractRef$1 as resolveContractRef, resolveContractRefToSnapshot, resolveFromForPlan, resolveMigrationRef, resolveToForPlan, runContractSpaceSeedPhase, runMigrationCheck, runMigrationList, statusForMigrationHash };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as EmitResult, E as ExecuteDbVerifyResult, O as MigrateResult, _ as DbUpdateResult, a as ControlClient, f as DbInitResult } from "./db-verify-
|
|
1
|
+
import { C as EmitResult, E as ExecuteDbVerifyResult, N as RenderContractDtsResult, O as MigrateResult, _ as DbUpdateResult, a as ControlClient, f as DbInitResult } from "./db-verify-BdKY7U7l-6VLIVuKF.mjs";
|
|
2
2
|
import { CoreSchemaView, OperationPreview, SignDatabaseResult, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
3
3
|
import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
4
4
|
import { AuthoringPslBlockDescriptorNamespace } from "@prisma/orm-framework/components/authoring";
|
|
@@ -33,6 +33,7 @@ interface ControlClientFixtures {
|
|
|
33
33
|
readonly getPslBlockDescriptors: AuthoringPslBlockDescriptorNamespace;
|
|
34
34
|
readonly toOperationPreview: OperationPreview | undefined;
|
|
35
35
|
readonly emit: EmitResult;
|
|
36
|
+
readonly renderContractDts: RenderContractDtsResult;
|
|
36
37
|
}
|
|
37
38
|
interface FixtureControlClientCall {
|
|
38
39
|
readonly operation: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli__control-api__testing.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api-testing.d.mts"],"mappings":";;;;;;;cAMc;cACA;cACA;;cAEA;;cAEA;;;;;UAKJ;WACC,QAAQ;WACR,cAAc;WACd,MAAM;WACN,QAAQ;WACR,UAAU;WACV,UAAU;WACV,YAAY;WACZ,gBAAgB,oBAAoB;WACpC,qBAAqB;WACrB,SAAS;WACT;WACA,cAAc;WACd,kBAAkB;WAClB,wBAAwB;WACxB,oBAAoB;WACpB,MAAM;;
|
|
1
|
+
{"version":3,"file":"cli__control-api__testing.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api-testing.d.mts"],"mappings":";;;;;;;cAMc;cACA;cACA;;cAEA;;cAEA;;;;;UAKJ;WACC,QAAQ;WACR,cAAc;WACd,MAAM;WACN,QAAQ;WACR,UAAU;WACV,UAAU;WACV,YAAY;WACZ,gBAAgB,oBAAoB;WACpC,qBAAqB;WACrB,SAAS;WACT;WACA,cAAc;WACd,kBAAkB;WAClB,wBAAwB;WACxB,oBAAoB;WACpB,MAAM;WACN,mBAAmB;;UAEpB;WACC;WACA;;;;;;;;UAQD,6BAA6B;;WAE5B,gBAAgB;;WAEhB;;;;;;iBAMM,gCAAgC;;;;;;iBAMhC,2BAA2B,YAAY,QAAQ,yBAAyB"}
|
|
@@ -135,7 +135,8 @@ function defaultControlClientFixtures() {
|
|
|
135
135
|
profileHash: FIXTURE_PROFILE_HASH,
|
|
136
136
|
contractJson: `{"targetFamily":"${FIXTURE_FAMILY_ID}"}`,
|
|
137
137
|
contractDts: `export type Contract = { targetFamily: "${FIXTURE_FAMILY_ID}" };`
|
|
138
|
-
})
|
|
138
|
+
}),
|
|
139
|
+
renderContractDts: ok({ contractDts: `export type Contract = { targetFamily: "${FIXTURE_FAMILY_ID}" };` })
|
|
139
140
|
};
|
|
140
141
|
}
|
|
141
142
|
var FixtureControlClientImpl = class {
|
|
@@ -241,6 +242,9 @@ var FixtureControlClientImpl = class {
|
|
|
241
242
|
async emit(options) {
|
|
242
243
|
return this.record("emit", options, this.fixtures.emit);
|
|
243
244
|
}
|
|
245
|
+
async renderContractDts(options) {
|
|
246
|
+
return this.record("renderContractDts", options, this.fixtures.renderContractDts);
|
|
247
|
+
}
|
|
244
248
|
};
|
|
245
249
|
/**
|
|
246
250
|
* Creates a fixture-backed {@link ControlClient} double for host and product
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli__control-api__testing.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api-testing.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/errors/control\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/control-api/testing/fixture-client.ts\nconst FIXTURE_STORAGE_HASH = \"7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26\";\nconst FIXTURE_PROFILE_HASH = \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\";\nconst FIXTURE_MIGRATION_HASH = \"fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9\";\nconst FIXTURE_TIMESTAMP = \"2026-01-01T00:00:00.000Z\";\n/** Target id the default fixtures report; overridable per test. */\nconst FIXTURE_TARGET_ID = \"fixture-target\";\n/** Family id the default fixtures report in emitted contract payloads. */\nconst FIXTURE_FAMILY_ID = \"fixture-family\";\nconst fixtureOperation = {\n\tid: \"op-1\",\n\tlabel: \"create User\",\n\toperationClass: \"additive\"\n};\nfunction fixtureMarker() {\n\treturn {\n\t\tstorageHash: FIXTURE_STORAGE_HASH,\n\t\tprofileHash: FIXTURE_PROFILE_HASH,\n\t\tcontractJson: null,\n\t\tcanonicalVersion: 1,\n\t\tupdatedAt: /* @__PURE__ */ new Date(FIXTURE_TIMESTAMP),\n\t\tappTag: null,\n\t\tmeta: {},\n\t\tinvariants: []\n\t};\n}\n/**\n* Target-neutral defaults for every operation: a healthy database whose\n* marker, ledger, and schema all match the fixture contract.\n*/\nfunction defaultControlClientFixtures() {\n\tconst contract = {\n\t\tstorageHash: FIXTURE_STORAGE_HASH,\n\t\tprofileHash: FIXTURE_PROFILE_HASH\n\t};\n\tconst target = {\n\t\texpected: FIXTURE_TARGET_ID,\n\t\tactual: FIXTURE_TARGET_ID\n\t};\n\tconst schemaVerify = {\n\t\tok: true,\n\t\tsummary: \"Schema satisfies contract\",\n\t\tcontract,\n\t\ttarget,\n\t\tschema: { issues: [] },\n\t\ttimings: { total: 5 }\n\t};\n\tconst applySuccess = {\n\t\tmode: \"apply\",\n\t\tplan: { operations: [fixtureOperation] },\n\t\tdestination: contract,\n\t\texecution: {\n\t\t\toperationsPlanned: 1,\n\t\t\toperationsExecuted: 1\n\t\t},\n\t\tmarker: contract,\n\t\tperSpace: [{\n\t\t\tspaceId: APP_SPACE_ID,\n\t\t\tkind: \"app\",\n\t\t\toperations: [fixtureOperation],\n\t\t\tmarker: { storageHash: FIXTURE_STORAGE_HASH }\n\t\t}],\n\t\tsummary: \"Applied 1 operation\"\n\t};\n\treturn {\n\t\tverify: {\n\t\t\tok: true,\n\t\t\tsummary: \"Database matches contract\",\n\t\t\tcontract,\n\t\t\tmarker: contract,\n\t\t\ttarget,\n\t\t\ttimings: { total: 5 }\n\t\t},\n\t\tschemaVerify,\n\t\tsign: {\n\t\t\tok: true,\n\t\t\tsummary: \"Signature written\",\n\t\t\tcontract,\n\t\t\ttarget,\n\t\t\tmarker: {\n\t\t\t\tcreated: true,\n\t\t\t\tupdated: false\n\t\t\t},\n\t\t\ttimings: { total: 5 }\n\t\t},\n\t\tdbInit: ok(applySuccess),\n\t\tdbUpdate: ok(applySuccess),\n\t\tdbVerify: ok({\n\t\t\tschemaResults: /* @__PURE__ */ new Map([[APP_SPACE_ID, schemaVerify]]),\n\t\t\tunclaimed: [],\n\t\t\tspaceOrder: [APP_SPACE_ID],\n\t\t\tappSpaceId: APP_SPACE_ID,\n\t\t\tmarkerDrift: null\n\t\t}),\n\t\treadMarker: fixtureMarker(),\n\t\treadAllMarkers: /* @__PURE__ */ new Map([[APP_SPACE_ID, fixtureMarker()]]),\n\t\treadLedger: [{\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmigrationName: \"20260101000000_init\",\n\t\t\tmigrationHash: FIXTURE_MIGRATION_HASH,\n\t\t\tfrom: null,\n\t\t\tto: FIXTURE_STORAGE_HASH,\n\t\t\tappliedAt: /* @__PURE__ */ new Date(FIXTURE_TIMESTAMP),\n\t\t\toperationCount: 1\n\t\t}],\n\t\tmigrate: ok({\n\t\t\tmigrationsApplied: 1,\n\t\t\tmarkerHash: FIXTURE_STORAGE_HASH,\n\t\t\tapplied: [{\n\t\t\t\tspaceId: APP_SPACE_ID,\n\t\t\t\tdirName: \"20260101000000_init\",\n\t\t\t\tmigrationHash: FIXTURE_MIGRATION_HASH,\n\t\t\t\tfrom: FIXTURE_PROFILE_HASH,\n\t\t\t\tto: FIXTURE_STORAGE_HASH,\n\t\t\t\toperationsExecuted: 1\n\t\t\t}],\n\t\t\tsummary: \"Applied 1 migration\",\n\t\t\tperSpace: [{\n\t\t\t\tspaceId: APP_SPACE_ID,\n\t\t\t\tkind: \"app\",\n\t\t\t\toperations: [fixtureOperation],\n\t\t\t\tmarker: { storageHash: FIXTURE_STORAGE_HASH }\n\t\t\t}]\n\t\t}),\n\t\tintrospect: {},\n\t\ttoSchemaView: void 0,\n\t\tinferPslContract: void 0,\n\t\tgetPslBlockDescriptors: {},\n\t\ttoOperationPreview: void 0,\n\t\temit: ok({\n\t\t\tstorageHash: FIXTURE_STORAGE_HASH,\n\t\t\tprofileHash: FIXTURE_PROFILE_HASH,\n\t\t\tcontractJson: `{\"targetFamily\":\"${FIXTURE_FAMILY_ID}\"}`,\n\t\t\tcontractDts: `export type Contract = { targetFamily: \"${FIXTURE_FAMILY_ID}\" };`\n\t\t})\n\t};\n}\nvar FixtureControlClientImpl = class {\n\tcalls = [];\n\tconnected = false;\n\tinitialized = false;\n\tfixtures;\n\tconstructor(overrides) {\n\t\tthis.fixtures = {\n\t\t\t...defaultControlClientFixtures(),\n\t\t\t...overrides\n\t\t};\n\t}\n\trecord(operation, options, value) {\n\t\tthis.init();\n\t\tthis.calls.push({\n\t\t\toperation,\n\t\t\toptions\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Records an operation the real client runs against a driver, so a caller\n\t* that skipped `connect()` fails here exactly as it would in production.\n\t*/\n\trecordConnected(operation, options, value) {\n\t\tconst supplied = typeof options === \"object\" && options !== null ? Reflect.get(options, \"connection\") : void 0;\n\t\tif (supplied !== void 0) this.markConnected(supplied);\n\t\tif (!this.connected) throw new CliStructuredError(\"DRIVER.NOT_CONNECTED\", \"Not connected. Call connect(connection) first.\");\n\t\treturn this.record(operation, options, value);\n\t}\n\tinit() {\n\t\tif (this.initialized) return;\n\t\tthis.initialized = true;\n\t\tthis.calls.push({\n\t\t\toperation: \"init\",\n\t\t\toptions: void 0\n\t\t});\n\t}\n\tmarkConnected(connection) {\n\t\tthis.init();\n\t\tthis.calls.push({\n\t\t\toperation: \"connect\",\n\t\t\toptions: connection\n\t\t});\n\t\tthis.connected = true;\n\t}\n\tasync connect(connection) {\n\t\tthis.markConnected(connection);\n\t}\n\tasync close() {\n\t\tthis.calls.push({\n\t\t\toperation: \"close\",\n\t\t\toptions: void 0\n\t\t});\n\t\tthis.connected = false;\n\t}\n\tasync verify(options) {\n\t\treturn this.recordConnected(\"verify\", options, this.fixtures.verify);\n\t}\n\tasync schemaVerify(options) {\n\t\treturn this.recordConnected(\"schemaVerify\", options, this.fixtures.schemaVerify);\n\t}\n\tasync sign(options) {\n\t\treturn this.recordConnected(\"sign\", options, this.fixtures.sign);\n\t}\n\tasync dbInit(options) {\n\t\treturn this.recordConnected(\"dbInit\", options, this.fixtures.dbInit);\n\t}\n\tasync dbUpdate(options) {\n\t\treturn this.recordConnected(\"dbUpdate\", options, this.fixtures.dbUpdate);\n\t}\n\tasync dbVerify(options) {\n\t\treturn this.recordConnected(\"dbVerify\", options, this.fixtures.dbVerify);\n\t}\n\tasync readMarker() {\n\t\treturn this.recordConnected(\"readMarker\", void 0, this.fixtures.readMarker);\n\t}\n\tasync readAllMarkers() {\n\t\treturn this.recordConnected(\"readAllMarkers\", void 0, this.fixtures.readAllMarkers);\n\t}\n\tasync readLedger(space) {\n\t\treturn this.recordConnected(\"readLedger\", space, this.fixtures.readLedger);\n\t}\n\tasync migrate(options) {\n\t\treturn this.recordConnected(\"migrate\", options, this.fixtures.migrate);\n\t}\n\tasync introspect(options) {\n\t\treturn this.recordConnected(\"introspect\", options, this.fixtures.introspect);\n\t}\n\ttoSchemaView(schemaIR) {\n\t\treturn this.record(\"toSchemaView\", schemaIR, this.fixtures.toSchemaView);\n\t}\n\tinferPslContract(schemaIR) {\n\t\treturn this.record(\"inferPslContract\", schemaIR, this.fixtures.inferPslContract);\n\t}\n\tgetPslBlockDescriptors() {\n\t\treturn this.record(\"getPslBlockDescriptors\", void 0, this.fixtures.getPslBlockDescriptors);\n\t}\n\ttoOperationPreview(operations) {\n\t\treturn this.record(\"toOperationPreview\", operations, this.fixtures.toOperationPreview);\n\t}\n\tasync emit(options) {\n\t\treturn this.record(\"emit\", options, this.fixtures.emit);\n\t}\n};\n/**\n* Creates a fixture-backed {@link ControlClient} double for host and product\n* tests: every operation resolves a realistic fixture payload without a\n* database or driver, and each fixture is overridable per test.\n*/\nfunction createFixtureControlClient(overrides) {\n\treturn new FixtureControlClientImpl(overrides);\n}\n//#endregion\nexport { FIXTURE_FAMILY_ID, FIXTURE_MIGRATION_HASH, FIXTURE_PROFILE_HASH, FIXTURE_STORAGE_HASH, FIXTURE_TARGET_ID, createFixtureControlClient, defaultControlClientFixtures };\n\n//# sourceMappingURL=control-api-testing.mjs.map"],"mappings":";;;;AAIA,MAAM,uBAAuB;AAC7B,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;CAC1E;CACA,MAAM,QAAQ,SAAS;EACtB,OAAO,KAAK,gBAAgB,WAAW,SAAS,KAAK,SAAS,OAAO;CACtE;CACA,MAAM,WAAW,SAAS;EACzB,OAAO,KAAK,gBAAgB,cAAc,SAAS,KAAK,SAAS,UAAU;CAC5E;CACA,aAAa,UAAU;EACtB,OAAO,KAAK,OAAO,gBAAgB,UAAU,KAAK,SAAS,YAAY;CACxE;CACA,iBAAiB,UAAU;EAC1B,OAAO,KAAK,OAAO,oBAAoB,UAAU,KAAK,SAAS,gBAAgB;CAChF;CACA,yBAAyB;EACxB,OAAO,KAAK,OAAO,0BAA0B,KAAK,GAAG,KAAK,SAAS,sBAAsB;CAC1F;CACA,mBAAmB,YAAY;EAC9B,OAAO,KAAK,OAAO,sBAAsB,YAAY,KAAK,SAAS,kBAAkB;CACtF;CACA,MAAM,KAAK,SAAS;EACnB,OAAO,KAAK,OAAO,QAAQ,SAAS,KAAK,SAAS,IAAI;CACvD;AACD;;;;;;AAMA,SAAS,2BAA2B,WAAW;CAC9C,OAAO,IAAI,yBAAyB,SAAS;AAC9C"}
|
|
1
|
+
{"version":3,"file":"cli__control-api__testing.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/control-api-testing.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/errors/control\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/control-api/testing/fixture-client.ts\nconst FIXTURE_STORAGE_HASH = \"7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26\";\nconst FIXTURE_PROFILE_HASH = \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\";\nconst FIXTURE_MIGRATION_HASH = \"fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9\";\nconst FIXTURE_TIMESTAMP = \"2026-01-01T00:00:00.000Z\";\n/** Target id the default fixtures report; overridable per test. */\nconst FIXTURE_TARGET_ID = \"fixture-target\";\n/** Family id the default fixtures report in emitted contract payloads. */\nconst FIXTURE_FAMILY_ID = \"fixture-family\";\nconst fixtureOperation = {\n\tid: \"op-1\",\n\tlabel: \"create User\",\n\toperationClass: \"additive\"\n};\nfunction fixtureMarker() {\n\treturn {\n\t\tstorageHash: FIXTURE_STORAGE_HASH,\n\t\tprofileHash: FIXTURE_PROFILE_HASH,\n\t\tcontractJson: null,\n\t\tcanonicalVersion: 1,\n\t\tupdatedAt: /* @__PURE__ */ new Date(FIXTURE_TIMESTAMP),\n\t\tappTag: null,\n\t\tmeta: {},\n\t\tinvariants: []\n\t};\n}\n/**\n* Target-neutral defaults for every operation: a healthy database whose\n* marker, ledger, and schema all match the fixture contract.\n*/\nfunction defaultControlClientFixtures() {\n\tconst contract = {\n\t\tstorageHash: FIXTURE_STORAGE_HASH,\n\t\tprofileHash: FIXTURE_PROFILE_HASH\n\t};\n\tconst target = {\n\t\texpected: FIXTURE_TARGET_ID,\n\t\tactual: FIXTURE_TARGET_ID\n\t};\n\tconst schemaVerify = {\n\t\tok: true,\n\t\tsummary: \"Schema satisfies contract\",\n\t\tcontract,\n\t\ttarget,\n\t\tschema: { issues: [] },\n\t\ttimings: { total: 5 }\n\t};\n\tconst applySuccess = {\n\t\tmode: \"apply\",\n\t\tplan: { operations: [fixtureOperation] },\n\t\tdestination: contract,\n\t\texecution: {\n\t\t\toperationsPlanned: 1,\n\t\t\toperationsExecuted: 1\n\t\t},\n\t\tmarker: contract,\n\t\tperSpace: [{\n\t\t\tspaceId: APP_SPACE_ID,\n\t\t\tkind: \"app\",\n\t\t\toperations: [fixtureOperation],\n\t\t\tmarker: { storageHash: FIXTURE_STORAGE_HASH }\n\t\t}],\n\t\tsummary: \"Applied 1 operation\"\n\t};\n\treturn {\n\t\tverify: {\n\t\t\tok: true,\n\t\t\tsummary: \"Database matches contract\",\n\t\t\tcontract,\n\t\t\tmarker: contract,\n\t\t\ttarget,\n\t\t\ttimings: { total: 5 }\n\t\t},\n\t\tschemaVerify,\n\t\tsign: {\n\t\t\tok: true,\n\t\t\tsummary: \"Signature written\",\n\t\t\tcontract,\n\t\t\ttarget,\n\t\t\tmarker: {\n\t\t\t\tcreated: true,\n\t\t\t\tupdated: false\n\t\t\t},\n\t\t\ttimings: { total: 5 }\n\t\t},\n\t\tdbInit: ok(applySuccess),\n\t\tdbUpdate: ok(applySuccess),\n\t\tdbVerify: ok({\n\t\t\tschemaResults: /* @__PURE__ */ new Map([[APP_SPACE_ID, schemaVerify]]),\n\t\t\tunclaimed: [],\n\t\t\tspaceOrder: [APP_SPACE_ID],\n\t\t\tappSpaceId: APP_SPACE_ID,\n\t\t\tmarkerDrift: null\n\t\t}),\n\t\treadMarker: fixtureMarker(),\n\t\treadAllMarkers: /* @__PURE__ */ new Map([[APP_SPACE_ID, fixtureMarker()]]),\n\t\treadLedger: [{\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmigrationName: \"20260101000000_init\",\n\t\t\tmigrationHash: FIXTURE_MIGRATION_HASH,\n\t\t\tfrom: null,\n\t\t\tto: FIXTURE_STORAGE_HASH,\n\t\t\tappliedAt: /* @__PURE__ */ new Date(FIXTURE_TIMESTAMP),\n\t\t\toperationCount: 1\n\t\t}],\n\t\tmigrate: ok({\n\t\t\tmigrationsApplied: 1,\n\t\t\tmarkerHash: FIXTURE_STORAGE_HASH,\n\t\t\tapplied: [{\n\t\t\t\tspaceId: APP_SPACE_ID,\n\t\t\t\tdirName: \"20260101000000_init\",\n\t\t\t\tmigrationHash: FIXTURE_MIGRATION_HASH,\n\t\t\t\tfrom: FIXTURE_PROFILE_HASH,\n\t\t\t\tto: FIXTURE_STORAGE_HASH,\n\t\t\t\toperationsExecuted: 1\n\t\t\t}],\n\t\t\tsummary: \"Applied 1 migration\",\n\t\t\tperSpace: [{\n\t\t\t\tspaceId: APP_SPACE_ID,\n\t\t\t\tkind: \"app\",\n\t\t\t\toperations: [fixtureOperation],\n\t\t\t\tmarker: { storageHash: FIXTURE_STORAGE_HASH }\n\t\t\t}]\n\t\t}),\n\t\tintrospect: {},\n\t\ttoSchemaView: void 0,\n\t\tinferPslContract: void 0,\n\t\tgetPslBlockDescriptors: {},\n\t\ttoOperationPreview: void 0,\n\t\temit: ok({\n\t\t\tstorageHash: FIXTURE_STORAGE_HASH,\n\t\t\tprofileHash: FIXTURE_PROFILE_HASH,\n\t\t\tcontractJson: `{\"targetFamily\":\"${FIXTURE_FAMILY_ID}\"}`,\n\t\t\tcontractDts: `export type Contract = { targetFamily: \"${FIXTURE_FAMILY_ID}\" };`\n\t\t}),\n\t\trenderContractDts: ok({ contractDts: `export type Contract = { targetFamily: \"${FIXTURE_FAMILY_ID}\" };` })\n\t};\n}\nvar FixtureControlClientImpl = class {\n\tcalls = [];\n\tconnected = false;\n\tinitialized = false;\n\tfixtures;\n\tconstructor(overrides) {\n\t\tthis.fixtures = {\n\t\t\t...defaultControlClientFixtures(),\n\t\t\t...overrides\n\t\t};\n\t}\n\trecord(operation, options, value) {\n\t\tthis.init();\n\t\tthis.calls.push({\n\t\t\toperation,\n\t\t\toptions\n\t\t});\n\t\treturn value;\n\t}\n\t/**\n\t* Records an operation the real client runs against a driver, so a caller\n\t* that skipped `connect()` fails here exactly as it would in production.\n\t*/\n\trecordConnected(operation, options, value) {\n\t\tconst supplied = typeof options === \"object\" && options !== null ? Reflect.get(options, \"connection\") : void 0;\n\t\tif (supplied !== void 0) this.markConnected(supplied);\n\t\tif (!this.connected) throw new CliStructuredError(\"DRIVER.NOT_CONNECTED\", \"Not connected. Call connect(connection) first.\");\n\t\treturn this.record(operation, options, value);\n\t}\n\tinit() {\n\t\tif (this.initialized) return;\n\t\tthis.initialized = true;\n\t\tthis.calls.push({\n\t\t\toperation: \"init\",\n\t\t\toptions: void 0\n\t\t});\n\t}\n\tmarkConnected(connection) {\n\t\tthis.init();\n\t\tthis.calls.push({\n\t\t\toperation: \"connect\",\n\t\t\toptions: connection\n\t\t});\n\t\tthis.connected = true;\n\t}\n\tasync connect(connection) {\n\t\tthis.markConnected(connection);\n\t}\n\tasync close() {\n\t\tthis.calls.push({\n\t\t\toperation: \"close\",\n\t\t\toptions: void 0\n\t\t});\n\t\tthis.connected = false;\n\t}\n\tasync verify(options) {\n\t\treturn this.recordConnected(\"verify\", options, this.fixtures.verify);\n\t}\n\tasync schemaVerify(options) {\n\t\treturn this.recordConnected(\"schemaVerify\", options, this.fixtures.schemaVerify);\n\t}\n\tasync sign(options) {\n\t\treturn this.recordConnected(\"sign\", options, this.fixtures.sign);\n\t}\n\tasync dbInit(options) {\n\t\treturn this.recordConnected(\"dbInit\", options, this.fixtures.dbInit);\n\t}\n\tasync dbUpdate(options) {\n\t\treturn this.recordConnected(\"dbUpdate\", options, this.fixtures.dbUpdate);\n\t}\n\tasync dbVerify(options) {\n\t\treturn this.recordConnected(\"dbVerify\", options, this.fixtures.dbVerify);\n\t}\n\tasync readMarker() {\n\t\treturn this.recordConnected(\"readMarker\", void 0, this.fixtures.readMarker);\n\t}\n\tasync readAllMarkers() {\n\t\treturn this.recordConnected(\"readAllMarkers\", void 0, this.fixtures.readAllMarkers);\n\t}\n\tasync readLedger(space) {\n\t\treturn this.recordConnected(\"readLedger\", space, this.fixtures.readLedger);\n\t}\n\tasync migrate(options) {\n\t\treturn this.recordConnected(\"migrate\", options, this.fixtures.migrate);\n\t}\n\tasync introspect(options) {\n\t\treturn this.recordConnected(\"introspect\", options, this.fixtures.introspect);\n\t}\n\ttoSchemaView(schemaIR) {\n\t\treturn this.record(\"toSchemaView\", schemaIR, this.fixtures.toSchemaView);\n\t}\n\tinferPslContract(schemaIR) {\n\t\treturn this.record(\"inferPslContract\", schemaIR, this.fixtures.inferPslContract);\n\t}\n\tgetPslBlockDescriptors() {\n\t\treturn this.record(\"getPslBlockDescriptors\", void 0, this.fixtures.getPslBlockDescriptors);\n\t}\n\ttoOperationPreview(operations) {\n\t\treturn this.record(\"toOperationPreview\", operations, this.fixtures.toOperationPreview);\n\t}\n\tasync emit(options) {\n\t\treturn this.record(\"emit\", options, this.fixtures.emit);\n\t}\n\tasync renderContractDts(options) {\n\t\treturn this.record(\"renderContractDts\", options, this.fixtures.renderContractDts);\n\t}\n};\n/**\n* Creates a fixture-backed {@link ControlClient} double for host and product\n* tests: every operation resolves a realistic fixture payload without a\n* database or driver, and each fixture is overridable per test.\n*/\nfunction createFixtureControlClient(overrides) {\n\treturn new FixtureControlClientImpl(overrides);\n}\n//#endregion\nexport { FIXTURE_FAMILY_ID, FIXTURE_MIGRATION_HASH, FIXTURE_PROFILE_HASH, FIXTURE_STORAGE_HASH, FIXTURE_TARGET_ID, createFixtureControlClient, defaultControlClientFixtures };\n\n//# sourceMappingURL=control-api-testing.mjs.map"],"mappings":";;;;AAIA,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAC7B,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB;;AAE1B,MAAM,oBAAoB;;AAE1B,MAAM,oBAAoB;AAC1B,MAAM,mBAAmB;CACxB,IAAI;CACJ,OAAO;CACP,gBAAgB;AACjB;AACA,SAAS,gBAAgB;CACxB,OAAO;EACN,aAAa;EACb,aAAa;EACb,cAAc;EACd,kBAAkB;EAClB,2BAA2B,IAAI,KAAK,iBAAiB;EACrD,QAAQ;EACR,MAAM,CAAC;EACP,YAAY,CAAC;CACd;AACD;;;;;AAKA,SAAS,+BAA+B;CACvC,MAAM,WAAW;EAChB,aAAa;EACb,aAAa;CACd;CACA,MAAM,SAAS;EACd,UAAU;EACV,QAAQ;CACT;CACA,MAAM,eAAe;EACpB,IAAI;EACJ,SAAS;EACT;EACA;EACA,QAAQ,EAAE,QAAQ,CAAC,EAAE;EACrB,SAAS,EAAE,OAAO,EAAE;CACrB;CACA,MAAM,eAAe;EACpB,MAAM;EACN,MAAM,EAAE,YAAY,CAAC,gBAAgB,EAAE;EACvC,aAAa;EACb,WAAW;GACV,mBAAmB;GACnB,oBAAoB;EACrB;EACA,QAAQ;EACR,UAAU,CAAC;GACV,SAAS;GACT,M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jF;AACD;;;;;;AAMA,SAAS,2BAA2B,WAAW;CAC9C,OAAO,IAAI,yBAAyB,SAAS;AAC9C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "./ref-resolution-CaHQJXE0.mjs";
|
|
2
|
+
import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
|
|
2
3
|
import { CliStructuredError as CliStructuredError$2 } from "@prisma/orm-framework/errors/control";
|
|
3
4
|
import { ControlAdapterDescriptor, ControlDriverDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyDescriptor, ControlFamilyInstance, ControlTargetDescriptor, CoreSchemaView, MigrationPlanOperation, MigrationPlannerConflict, OperationPreview, SignDatabaseResult, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
4
5
|
import { Result } from "@prisma/orm-framework/utils/result";
|
|
@@ -10,7 +11,36 @@ import "@prisma/cli-engine/protocol";
|
|
|
10
11
|
import { ContractSourceDiagnostics, ContractSourceProvider, PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
|
|
11
12
|
import { AuthoringPslBlockDescriptorNamespace } from "@prisma/orm-framework/components/authoring";
|
|
12
13
|
import { PslDocumentAst } from "@prisma/orm-framework/components/psl-ast";
|
|
13
|
-
//#region ../../../1-framework/3-tooling/cli/dist/db-verify-
|
|
14
|
+
//#region ../../../1-framework/3-tooling/cli/dist/db-verify-BdKY7U7l.d.mts
|
|
15
|
+
//#region src/control-api/render-contract-dts.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* Options for rendering the `contract.d.ts` text of an already-emitted
|
|
18
|
+
* contract, as read from `contract.json`.
|
|
19
|
+
*/
|
|
20
|
+
interface RenderContractDtsOptions {
|
|
21
|
+
/** The parsed `contract.json` to render types for. */
|
|
22
|
+
readonly contract: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Rewrites the package names the declarations import from, for the import
|
|
25
|
+
* root of the project that keeps them. Defaults to leaving every specifier
|
|
26
|
+
* as authored.
|
|
27
|
+
*/
|
|
28
|
+
readonly resolveImportSpecifier?: ImportSpecifierResolver;
|
|
29
|
+
}
|
|
30
|
+
interface RenderContractDtsSuccess {
|
|
31
|
+
/** The declarations, rendered through the same emitter as `emit`, with the import specifiers the caller asked for. */
|
|
32
|
+
readonly contractDts: string;
|
|
33
|
+
}
|
|
34
|
+
type RenderContractDtsFailureCode = 'CONTRACT_VALIDATION_FAILED' | 'RENDER_FAILED';
|
|
35
|
+
interface RenderContractDtsFailure {
|
|
36
|
+
readonly code: RenderContractDtsFailureCode;
|
|
37
|
+
readonly summary: string;
|
|
38
|
+
readonly why: string | undefined;
|
|
39
|
+
/** Underlying error for diagnostics; never serialized into envelopes. */
|
|
40
|
+
readonly cause?: unknown;
|
|
41
|
+
}
|
|
42
|
+
type RenderContractDtsResult = Result<RenderContractDtsSuccess, RenderContractDtsFailure>;
|
|
43
|
+
//#endregion
|
|
14
44
|
//#region src/control-api/types.d.ts
|
|
15
45
|
/**
|
|
16
46
|
* Options for creating a control client.
|
|
@@ -884,6 +914,14 @@ interface ControlClient {
|
|
|
884
914
|
* @returns Result pattern: Ok with emit details, NotOk with failure details
|
|
885
915
|
*/
|
|
886
916
|
emit(options: EmitOptions): Promise<EmitResult>;
|
|
917
|
+
/**
|
|
918
|
+
* Renders the `contract.d.ts` text for a `contract.json` that was already
|
|
919
|
+
* emitted. A snapshot of a contract is that JSON plus these declarations, so
|
|
920
|
+
* whoever writes a snapshot renders them from the JSON it is storing rather
|
|
921
|
+
* than reading a sibling file that may have drifted or gone missing.
|
|
922
|
+
* Offline: uses `init()` but never `connect()`.
|
|
923
|
+
*/
|
|
924
|
+
renderContractDts(options: RenderContractDtsOptions): Promise<RenderContractDtsResult>;
|
|
887
925
|
}
|
|
888
926
|
//#endregion
|
|
889
927
|
//#region src/control-api/operations/db-verify.d.ts
|
|
@@ -959,5 +997,5 @@ type ExecuteDbVerifyResult = Result<ExecuteDbVerifySuccess, CliStructuredError$2
|
|
|
959
997
|
*/
|
|
960
998
|
declare function executeDbVerify<TFamilyId extends string, TTargetId extends string>(options: ExecuteDbVerifyOptions<TFamilyId, TTargetId>): Promise<ExecuteDbVerifyResult>;
|
|
961
999
|
//#endregion
|
|
962
|
-
export {
|
|
963
|
-
//# sourceMappingURL=db-verify-
|
|
1000
|
+
export { RenderContractDtsFailure as A, EmitResult as C, IntrospectOptions as D, ExecuteDbVerifyResult as E, SchemaVerifyOptions as F, SignOptions as I, VerifyOptions as L, RenderContractDtsOptions as M, RenderContractDtsResult as N, MigrateResult as O, RenderContractDtsSuccess as P, executeDbVerify as R, EmitOptions as S, ExecuteDbVerifyOptions as T, DbUpdateResult as _, ControlClient as a, EmitFailure as b, CreateControlClient as c, DbInitOptions as d, DbInitResult as f, DbUpdateOptions as g, DbUpdateFailureCode as h, ControlActionName as i, RenderContractDtsFailureCode as j, OnControlProgress as k, DbInitFailure as l, DbUpdateFailure as m, ContractEmitOptions as n, ControlClientOptions as o, DbInitSuccess as p, ContractEmitResult as r, ControlProgressEvent as s, CliStructuredError$2 as t, DbInitFailureCode as u, DbUpdateSuccess as v, EmitSuccess as w, EmitFailureCode as x, EmitContractConfig as y };
|
|
1001
|
+
//# sourceMappingURL=db-verify-BdKY7U7l-6VLIVuKF.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-verify-BdKY7U7l-6VLIVuKF.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/db-verify-BdKY7U7l.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;UAmBU;;WAEC;;;;;;WAMA,yBAAyB;;UAE1B;;WAEC;;KAEN;UACK;WACC,MAAM;WACN;WACA;;WAEA;;KAEN,0BAA0B,OAAO,0BAA0B;;;;;;;;;;;;;;UActD;WACC,QAAQ;WACR,QAAQ;WACR,SAAS;;WAET,SAAS;WACT,aAAa,cAAc;;;;;;WAM3B;;;;;;KAMN,uBAAuB,SAAS,yBAAyB;;;;KAIzD;;;;;;;;;;;;;;K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QAAQ;;;;;;;;;;;;;;EAc5C,SAAS,SAAS,kBAAkB,QAAQ;;;;;;;EAO5C,cAAc,QAAQ;;;;;;EAMtB,kBAAkB,QAAQ,oBAAoB;;;;;;EAM9C,WAAW,iBAAiB,iBAAiB;;;;;;;;;;;;;;EAc7C,QAAQ,SAAS,iBAAiB,QAAQ;;;;;;;EAO1C,WAAW,UAAU,oBAAoB;;;;;;;;EAQzC,aAAa,oBAAoB;;;;;;;;EAQjC,iBAAiB,oBAAoB;;;;;;;;EAQrC,0BAA0B;;;;;;;;;EAS1B,mBAAmB,qBAAqB,2BAA2B;;;;;;;;EAQnE,KAAK,SAAS,cAAc,QAAQ;;;;;;;;EAQpC,kBAAkB,SAAS,2BAA2B,QAAQ;;;;;;;;;;;;;UAatD,uBAAuB,0BAA0B;WAChD,QAAQ,sBAAsB,WAAW;WACzC,gBAAgB,sBAAsB;WACtC,UAAU;WACV;WACA,UAAU;WACV,YAAY,cAAc,2BAA2B,WAAW;WAChE,qBAAqB,cAAc,+BAA+B,WAAW;WAC7E;WACA;WACA;WACA,aAAa;;;;;;;;;;;;;;UAcd;WACC,eAAe,oBAAoB;;;;;;WAMnC;WACA;WACA;;;;;;;;WAQA,aAAa;;KAEnB,wBAAwB,OAAO,wBAAwB;;;;;;;;;;;;;;;;;iBAiB3C,gBAAgB,0BAA0B,0BAA0B,SAAS,uBAAuB,WAAW,aAAa,QAAQ"}
|
|
@@ -11,13 +11,14 @@ import { d as writeRef, i as readRefs, l as validateRefName, n as deleteRef, o a
|
|
|
11
11
|
import { a as isValidSpaceId, c as spaceMigrationDirectory, l as spaceRefsDirectory, o as listContractSpaceDirectories, s as readContractSpaceHeadRef, t as APP_SPACE_ID$1 } from "./verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs";
|
|
12
12
|
import { d as resolveRecordedPath, f as verifyMigration, l as planMigration, n as buildFabricatedMigrationEdge, r as collectAggregateNamespaces, s as loadContractSpaceAggregate, t as allStorageElementsExternal, u as requireHeadRef } from "./aggregate-B4HKshLQ.mjs";
|
|
13
13
|
import { i as emitContractSpaceArtifacts, o as planAllSpaces } from "./spaces-BCZiAZQn.mjs";
|
|
14
|
-
import { c as internalImportRoot, o as importRootForDependencies, r as createImportSpecifierResolver } from "./import-roots-BHOrDJbI.mjs";
|
|
14
|
+
import { c as internalImportRoot, o as importRootForDependencies, r as createImportSpecifierResolver, t as ImportRootError } from "./import-roots-BHOrDJbI.mjs";
|
|
15
15
|
import { n as parseContractRef, r as parseMigrationRef } from "./ref-resolution-BWpwb8_b.mjs";
|
|
16
16
|
import { i as writeMigrationTs } from "./migration-ts-DdVm0rws.mjs";
|
|
17
17
|
import { createRequire } from "node:module";
|
|
18
18
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
19
19
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
20
20
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
21
|
+
import { keepInternalSpecifiers } from "@prisma/orm-framework/components/emission";
|
|
21
22
|
import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
|
|
22
23
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
23
24
|
import { CliStructuredError, CliStructuredError as CliStructuredError$1, errorConfigValidation as errorConfigValidation$1, errorContractConfigMissing, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFileNotFound, errorMigrationPlanningFailed, errorTargetMigrationNotSupported, errorUnexpected } from "@prisma/orm-framework/errors/control";
|
|
@@ -32,7 +33,7 @@ import { createHash } from "node:crypto";
|
|
|
32
33
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
33
34
|
import { abortable } from "@prisma/orm-framework/utils/abortable";
|
|
34
35
|
import { resolve as resolve$1 } from "node:path";
|
|
35
|
-
//#region ../../../1-framework/3-tooling/cli/dist/ref-
|
|
36
|
+
//#region ../../../1-framework/3-tooling/cli/dist/ref-uqvZQnnQ.mjs
|
|
36
37
|
/**
|
|
37
38
|
* The typed remediation the CLI attaches to its own errors and findings.
|
|
38
39
|
* Constructors live here rather than in any library the CLI calls: naming a
|
|
@@ -2542,10 +2543,7 @@ var ControlClientImpl = class {
|
|
|
2542
2543
|
meta: void 0
|
|
2543
2544
|
});
|
|
2544
2545
|
}
|
|
2545
|
-
const result = await
|
|
2546
|
-
serializeContract: (contract) => this.options.target.contractSerializer.serializeContract(contract),
|
|
2547
|
-
...ifDefined("supportsNamespaces", this.options.target.supportsNamespaces)
|
|
2548
|
-
});
|
|
2546
|
+
const result = await this.emitArtifacts(deserializedContract, keepInternalSpecifiers);
|
|
2549
2547
|
onProgress?.({
|
|
2550
2548
|
action: "emit",
|
|
2551
2549
|
kind: "spanEnd",
|
|
@@ -2574,6 +2572,39 @@ var ControlClientImpl = class {
|
|
|
2574
2572
|
});
|
|
2575
2573
|
}
|
|
2576
2574
|
}
|
|
2575
|
+
async renderContractDts(options) {
|
|
2576
|
+
this.init();
|
|
2577
|
+
if (!this.familyInstance) throw new InternalError("Family instance was not initialized. This is a bug.");
|
|
2578
|
+
let contract;
|
|
2579
|
+
try {
|
|
2580
|
+
contract = this.familyInstance.deserializeContract(options.contract);
|
|
2581
|
+
} catch (error) {
|
|
2582
|
+
return notOk({
|
|
2583
|
+
code: "CONTRACT_VALIDATION_FAILED",
|
|
2584
|
+
summary: "Contract validation failed",
|
|
2585
|
+
why: error instanceof Error ? error.message : String(error),
|
|
2586
|
+
cause: error
|
|
2587
|
+
});
|
|
2588
|
+
}
|
|
2589
|
+
try {
|
|
2590
|
+
const { contractDts } = await this.emitArtifacts(contract, options.resolveImportSpecifier ?? keepInternalSpecifiers);
|
|
2591
|
+
return ok({ contractDts });
|
|
2592
|
+
} catch (error) {
|
|
2593
|
+
return notOk({
|
|
2594
|
+
code: "RENDER_FAILED",
|
|
2595
|
+
summary: "Failed to render contract types",
|
|
2596
|
+
why: error instanceof Error ? error.message : String(error),
|
|
2597
|
+
cause: error
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
emitArtifacts(contract, resolveImportSpecifier) {
|
|
2602
|
+
return emit(contract, this.stack, this.options.family.emission, {
|
|
2603
|
+
serializeContract: (c) => this.options.target.contractSerializer.serializeContract(c),
|
|
2604
|
+
resolveImportSpecifier,
|
|
2605
|
+
...ifDefined("supportsNamespaces", this.options.target.supportsNamespaces)
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2577
2608
|
};
|
|
2578
2609
|
/**
|
|
2579
2610
|
* Per-output FIFO queue for `executeContractEmit`.
|
|
@@ -2662,7 +2693,10 @@ function nearestManifest(from) {
|
|
|
2662
2693
|
fix: `Make \`${path}\` a JSON object with the usual manifest fields, then re-run the command. Emission reads it to decide which package names generated files should import.`,
|
|
2663
2694
|
meta: { path }
|
|
2664
2695
|
});
|
|
2665
|
-
return
|
|
2696
|
+
return {
|
|
2697
|
+
manifest: parsed,
|
|
2698
|
+
path
|
|
2699
|
+
};
|
|
2666
2700
|
}
|
|
2667
2701
|
}
|
|
2668
2702
|
function declaredDependencies(manifest) {
|
|
@@ -2680,9 +2714,19 @@ function declaredDependencies(manifest) {
|
|
|
2680
2714
|
* project that has not moved to published names is unaffected.
|
|
2681
2715
|
*/
|
|
2682
2716
|
function projectImportRoot(configPath) {
|
|
2683
|
-
const
|
|
2684
|
-
if (
|
|
2685
|
-
|
|
2717
|
+
const nearest = nearestManifest(configPath === void 0 ? resolve(".") : dirname(resolve(configPath)));
|
|
2718
|
+
if (nearest === void 0) return internalImportRoot;
|
|
2719
|
+
try {
|
|
2720
|
+
return importRootForDependencies(declaredDependencies(nearest.manifest));
|
|
2721
|
+
} catch (cause) {
|
|
2722
|
+
if (!(cause instanceof ImportRootError)) throw cause;
|
|
2723
|
+
throw errorRuntime("CLI.PROJECT_MANIFEST_INVALID", `Failed to read ${nearest.path}`, {
|
|
2724
|
+
why: `\`${nearest.path}\` states dependencies emission cannot import from: ${cause.message}.`,
|
|
2725
|
+
fix: `Keep one database facade in \`${nearest.path}\`, then re-run the command. Emission reads it to decide which package names generated files should import.`,
|
|
2726
|
+
meta: { path: nearest.path },
|
|
2727
|
+
cause
|
|
2728
|
+
});
|
|
2729
|
+
}
|
|
2686
2730
|
}
|
|
2687
2731
|
/** The specifier resolver emission should use for the project owning `configPath`. */
|
|
2688
2732
|
function createProjectSpecifierResolver(configPath) {
|
|
@@ -2983,47 +3027,54 @@ async function executeContractEmit(options, dependencies = defaultContractEmitDe
|
|
|
2983
3027
|
};
|
|
2984
3028
|
});
|
|
2985
3029
|
}
|
|
3030
|
+
const NO_REF_ADVANCEMENT = {
|
|
3031
|
+
advancedRef: null,
|
|
3032
|
+
plannedAdvanceRef: null
|
|
3033
|
+
};
|
|
2986
3034
|
function computeRefAdvancementName(options) {
|
|
2987
3035
|
if (options.advanceRef !== void 0) return options.advanceRef;
|
|
2988
3036
|
if (options.db === void 0) return "db";
|
|
2989
3037
|
return null;
|
|
2990
3038
|
}
|
|
2991
|
-
function
|
|
2992
|
-
|
|
2993
|
-
}
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
}
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
return typeof code === "string" ? code : void 0;
|
|
3003
|
-
}
|
|
3004
|
-
function errorUnreadableContractDts(contractJsonPath, cause) {
|
|
3005
|
-
const contractDtsPath = contractDtsPathOf(contractJsonPath);
|
|
3006
|
-
const code = fsErrorCodeOf(cause);
|
|
3007
|
-
return errorFileNotFound(contractDtsPath, {
|
|
3008
|
-
why: code === "ENOENT" ? `The contract types next to ${contractJsonPath} are missing: ${contractDtsPath}` : `The contract types next to ${contractJsonPath} could not be read${code === void 0 ? "" : ` (${code})`}: ${contractDtsPath}`,
|
|
3009
|
-
fix: "Run {bin} contract emit to regenerate the contract artifacts, then advance the ref again.",
|
|
3010
|
-
cause
|
|
3039
|
+
function errorContractDtsRenderFailed(contractJsonPath, failure) {
|
|
3040
|
+
const why = failure.why ?? failure.summary;
|
|
3041
|
+
if (failure.code === "CONTRACT_VALIDATION_FAILED") return errorContractValidationFailed(`Contract at ${contractJsonPath} failed to deserialize: ${why}`, {
|
|
3042
|
+
where: { path: contractJsonPath },
|
|
3043
|
+
...ifDefined("cause", failure.cause)
|
|
3044
|
+
});
|
|
3045
|
+
return new CliStructuredError$1("CONTRACT.TYPES_RENDER_FAILED", "Failed to render contract types", {
|
|
3046
|
+
why: `The types for the contract at ${contractJsonPath} could not be rendered: ${why}`,
|
|
3047
|
+
fix: "Run {bin} contract emit to see why the contract does not emit, fix it, then advance the ref again.",
|
|
3048
|
+
where: { path: contractJsonPath },
|
|
3049
|
+
...ifDefined("cause", failure.cause)
|
|
3011
3050
|
});
|
|
3012
3051
|
}
|
|
3013
3052
|
/**
|
|
3014
|
-
* Everything `
|
|
3015
|
-
*
|
|
3016
|
-
*
|
|
3017
|
-
*
|
|
3018
|
-
*
|
|
3053
|
+
* Everything `executeRefAdvancement` needs, produced before a command does the
|
|
3054
|
+
* work that precedes the ref write: the ref name is validated and the
|
|
3055
|
+
* declarations of the contract to snapshot are rendered from its JSON, with
|
|
3056
|
+
* the import names the project owning `configPath` can resolve. Nothing is
|
|
3057
|
+
* read or rendered after the database is touched, so a contract that cannot
|
|
3058
|
+
* be snapshotted refuses the command before it changes anything.
|
|
3019
3059
|
*/
|
|
3020
3060
|
async function preflightRefAdvancement(args) {
|
|
3021
3061
|
if (!validateRefName(args.name)) return notOk(errorInvalidRefName(args.name));
|
|
3062
|
+
let resolveImportSpecifier;
|
|
3022
3063
|
try {
|
|
3023
|
-
|
|
3064
|
+
resolveImportSpecifier = createProjectSpecifierResolver(args.configPath);
|
|
3024
3065
|
} catch (error) {
|
|
3025
|
-
return notOk(
|
|
3066
|
+
if (CliStructuredError$1.is(error)) return notOk(error);
|
|
3067
|
+
throw error;
|
|
3026
3068
|
}
|
|
3069
|
+
const rendered = await args.client.renderContractDts({
|
|
3070
|
+
contract: args.contractJson,
|
|
3071
|
+
resolveImportSpecifier
|
|
3072
|
+
});
|
|
3073
|
+
if (!rendered.ok) return notOk(errorContractDtsRenderFailed(args.contractJsonPath, rendered.failure));
|
|
3074
|
+
return ok({
|
|
3075
|
+
contract: args.contractJson,
|
|
3076
|
+
contractDts: rendered.value.contractDts
|
|
3077
|
+
});
|
|
3027
3078
|
}
|
|
3028
3079
|
async function executeRefAdvancement(refsDir, migrationsDir, name, hash, contractIR) {
|
|
3029
3080
|
if (!validateRefName(name)) throw errorInvalidRefName(name);
|
|
@@ -3040,55 +3091,31 @@ async function executeRefAdvancement(refsDir, migrationsDir, name, hash, contrac
|
|
|
3040
3091
|
hash
|
|
3041
3092
|
};
|
|
3042
3093
|
}
|
|
3094
|
+
/**
|
|
3095
|
+
* The ref-advancement tail of db init / db update, run after the database
|
|
3096
|
+
* work with the `ContractIR` that `preflightRefAdvancement` produced before
|
|
3097
|
+
* it. Plan mode reports the ref that an apply would advance without writing.
|
|
3098
|
+
*/
|
|
3043
3099
|
async function buildRefAdvancementFields(options) {
|
|
3044
|
-
|
|
3045
|
-
...ifDefined("advanceRef", options.advanceRef),
|
|
3046
|
-
...ifDefined("db", options.db)
|
|
3047
|
-
});
|
|
3048
|
-
if (name === null) return {
|
|
3049
|
-
advancedRef: null,
|
|
3050
|
-
plannedAdvanceRef: null
|
|
3051
|
-
};
|
|
3052
|
-
if (options.mode === "plan") return {
|
|
3100
|
+
if (options.mode === "plan") return ok({
|
|
3053
3101
|
advancedRef: null,
|
|
3054
3102
|
plannedAdvanceRef: {
|
|
3055
|
-
name,
|
|
3103
|
+
name: options.name,
|
|
3056
3104
|
hash: options.hash
|
|
3057
3105
|
}
|
|
3058
|
-
};
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
async function resolveRefAdvancementFields(options) {
|
|
3070
|
-
if (computeRefAdvancementName({
|
|
3071
|
-
...ifDefined("advanceRef", options.advanceRef),
|
|
3072
|
-
...ifDefined("db", options.db)
|
|
3073
|
-
}) === null) return ok({
|
|
3074
|
-
advancedRef: null,
|
|
3106
|
+
});
|
|
3107
|
+
const advanced = await advanceRefSafely({
|
|
3108
|
+
refsDir: options.refsDir,
|
|
3109
|
+
migrationsDir: options.migrationsDir,
|
|
3110
|
+
name: options.name,
|
|
3111
|
+
hash: options.hash,
|
|
3112
|
+
contractIR: options.contractIR
|
|
3113
|
+
});
|
|
3114
|
+
if (!advanced.ok) return advanced;
|
|
3115
|
+
return ok({
|
|
3116
|
+
advancedRef: advanced.value,
|
|
3075
3117
|
plannedAdvanceRef: null
|
|
3076
3118
|
});
|
|
3077
|
-
try {
|
|
3078
|
-
const contractIR = await readContractIR(options.contractJson, options.contractJsonPath);
|
|
3079
|
-
return ok(await buildRefAdvancementFields({
|
|
3080
|
-
...ifDefined("advanceRef", options.advanceRef),
|
|
3081
|
-
...ifDefined("db", options.db),
|
|
3082
|
-
refsDir: options.refsDir,
|
|
3083
|
-
migrationsDir: options.migrationsDir,
|
|
3084
|
-
contractIR,
|
|
3085
|
-
mode: options.mode,
|
|
3086
|
-
hash: options.hash
|
|
3087
|
-
}));
|
|
3088
|
-
} catch (error) {
|
|
3089
|
-
if (MigrationToolsError.is(error)) return notOk(error);
|
|
3090
|
-
throw error;
|
|
3091
|
-
}
|
|
3092
3119
|
}
|
|
3093
3120
|
/**
|
|
3094
3121
|
* The --advance-ref tail of migrate and db sign: executeRefAdvancement with
|
|
@@ -4784,6 +4811,6 @@ async function executeRefListCommand(options) {
|
|
|
4784
4811
|
}
|
|
4785
4812
|
}
|
|
4786
4813
|
//#endregion
|
|
4787
|
-
export {
|
|
4814
|
+
export { listRefsByContractHash as $, errorMarkerMissing as A, sanitizeErrorMessage as At, executeContractEmit as B, errorContractValidationFailed as C, resolveFromForPlan as Ct, errorFileNotFound as D, runContractSpaceSeedPhase as Dt, errorDriverRequired as E, runCommandAction as Et, errorRunnerFailed as F, executeMigrationNewCommand as G, executeDbUpdate as H, errorRuntime as I, executeRefDeleteCommand as J, executeMigrationPlanCommand as K, errorTargetMigrationNotSupported as L, errorMigrationPlanningFailed as M, targetSupportsMigrations as Mt, errorNoMigrations as N, toDeclaredExtensionsFromRaw as Nt, errorHashMismatch as O, runMigrationCheck as Ot, errorPathUnreachable as P, hasMigrationPath as Q, errorTargetMismatch as R, errorContractArgConflict as S, resolveContractRefToSnapshot as St, errorDestructiveChanges as T, resolveToForPlan as Tt, executeDbVerify as U, executeDbInit as V, executeMigrateShowPlan as W, executeRefSetCommand as X, executeRefListCommand as Y, findPackageByDirPath as Z, enrichContract as _, refusePackageCorruptionOnAggregate as _t, appliedHashesFromLedger as a, mapContractAtError as at, errorConfigValidation$1 as b, resolveAppTargetPath as bt, buildReadAggregate as c, migrationSpaceListEntriesFromAggregate as ct, chooseAction as d, readContractEnvelope as dt, loadAggregateIntegrityViolations as et, closeQuietly as f, readMigrationRefs as ft, disposeEmitQueue as g, refuseMissingInvariantPath as gt, deriveStatusEdgeAnnotations as h, refuseMarkerOutsideGraph as ht, appContractStandInFromIdentity as i, mapCaughtMigrationError as it, errorMigrationPackageNotFound as j, statusForMigrationHash as jt, errorLegendHumanOnly as k, runMigrationList as kt, buildRefAdvancementFields as l, originHashForStatus as lt, createControlClient as m, refuseDeclaredExtensionTargetMismatch as mt, NO_REF_ADVANCEMENT as n, loadContractSpaceAggregateForCli as nt, buildContractSpaceAggregate as o, mapIntegrityViolations as ot, computeRefAdvancementName as p, refuseContractSpaceIntegrity as pt, executeRefAdvancement as q, advanceRefSafely as r, looksLikePath as rt, buildMigrationSpaceGraphEntries as s, maskConnectionUrl as st, CliStructuredError$1 as t, loadContractRawSafely as tt, checkSingleTarget as u, preflightRefAdvancement as ut, enumerateCheckSpaces as v, refuseUnknownInvariants as vt, errorDatabaseConnectionRequired as w, resolveMigrationRef as wt, errorConsentPlanMismatch as x, resolveContractRef$1 as xt, errorAdvanceRefArgConflict as y, requireLiveDatabase as yt, errorUnexpected as z };
|
|
4788
4815
|
|
|
4789
|
-
//# sourceMappingURL=ref-
|
|
4816
|
+
//# sourceMappingURL=ref-uqvZQnnQ-DpAQaLiM.mjs.map
|