@prisma/orm-framework 8.0.0-rc.3-dev.7 → 8.0.0-rc.3-dev.8
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/components.d.mts +1 -1
- package/dist/components__control.d.mts +1 -1
- package/dist/{config-types-CW4PDwMC.d.mts → config-types-CBV5U5IX.d.mts} +6 -19
- package/dist/{config-types-CW4PDwMC.d.mts.map → config-types-CBV5U5IX.d.mts.map} +1 -1
- package/dist/config-types-D_UCRNbm.mjs +38 -0
- package/dist/config-types-D_UCRNbm.mjs.map +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/config__config-types.d.mts +2 -2
- package/dist/config__config-types.mjs +2 -2
- package/dist/{control-BF8qzdnM.d.mts → control-BE92GNIR.d.mts} +2 -2
- package/dist/{control-BF8qzdnM.d.mts.map → control-BE92GNIR.d.mts.map} +1 -1
- package/dist/{control-BD96JZi8-NUhO5Kkw.mjs → control-dcFIOWpk-BLVmTGhh.mjs} +5 -5
- package/dist/control-dcFIOWpk-BLVmTGhh.mjs.map +1 -0
- package/dist/errors.d.mts +1 -1
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/errors__execution.mjs +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-Cyl2dXxX.d.mts → execution-BVw3c1X3.d.mts} +2 -2
- package/dist/{execution-Cyl2dXxX.d.mts.map → execution-BVw3c1X3.d.mts.map} +1 -1
- package/dist/{execution-Crk6IfTs.mjs → execution-Dd7goUCC.mjs} +8 -8
- package/dist/execution-Dd7goUCC.mjs.map +1 -0
- package/dist/{migration-C57VKLUY.mjs → migration-DjAbwcyQ.mjs} +3 -3
- package/dist/migration-DjAbwcyQ.mjs.map +1 -0
- package/dist/psl-parser__interpret.d.mts +1 -1
- package/dist/psl-printer.mjs +1 -1
- package/dist/psl-printer.mjs.map +1 -1
- package/package.json +15 -15
- package/dist/config-types-BqhNxw0z.mjs +0 -67
- package/dist/config-types-BqhNxw0z.mjs.map +0 -1
- package/dist/control-BD96JZi8-NUhO5Kkw.mjs.map +0 -1
- package/dist/execution-Crk6IfTs.mjs.map +0 -1
- package/dist/migration-C57VKLUY.mjs.map +0 -1
package/dist/components.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import { a as SettledAggregateOverloads, i as SettledAggregateOperation, n as Ag
|
|
|
9
9
|
import { a as keepInternalSpecifiers, i as ValidationContext, n as GenerateContractTypesOptions, o as resolveRequirementSpecifiers, r as ImportSpecifierResolver, t as EmissionSpi } from "./emission-types-DLXP34Ki-CFms3VrX.mjs";
|
|
10
10
|
import { A as makePslNamespace, C as PslReferentialAction, D as UNSPECIFIED_PSL_NAMESPACE_ID, E as PslUniqueConstraint, M as namespacePslExtensionBlocks, O as flatPslCompositeTypes, S as PslNamespaceEntry, T as PslTypesBlock, _ as PslIndexConstraint, a as PslAttributeArgument, b as PslNamedTypeDeclaration, c as PslAttributeTarget, d as PslDefaultLiteralValue, f as PslDefaultValue, g as PslFieldAttribute, h as PslField, i as PslAttribute, j as makePslNamespaceEntries, k as flatPslModels, l as PslCompositeType, m as PslDocumentAst, n as ParsePslDocumentInput, o as PslAttributeNamedArgument, p as PslDiagnostic, r as ParsePslDocumentResult, s as PslAttributePositionalArgument, t as BUILTIN_PSL_KIND_KEYS, u as PslDefaultFunctionValue, v as PslModel, w as PslTypeConstructorCall, x as PslNamespace, y as PslModelAttribute } from "./psl-ast-CWJQF8LA-Vr5JNPdn.mjs";
|
|
11
11
|
import { t as ImportRequirement } from "./index-CDk9yEbw.mjs";
|
|
12
|
-
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-
|
|
12
|
+
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-BE92GNIR.mjs";
|
|
13
13
|
import "./emission-CmUO03gQ.mjs";
|
|
14
14
|
import { a as RuntimeDriverDescriptor, c as RuntimeExtensionInstance, d as RuntimeTargetDescriptor, f as RuntimeTargetInstance, h as instantiateExecutionStack, i as RuntimeAdapterInstance, l as RuntimeFamilyDescriptor, m as createExecutionStack, n as ExecutionStackInstance, o as RuntimeDriverInstance, p as assertRuntimeContractRequirementsSatisfied, r as RuntimeAdapterDescriptor, s as RuntimeExtensionDescriptor, t as ExecutionStack, u as RuntimeFamilyInstance } from "./execution-CSnQT8EX.mjs";
|
|
15
15
|
import { t as isPlainRecord } from "./is-plain-record-C9BWiqcw.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { C as MutationDefaultGeneratorDescriptor, E as SourceSpan, S as LoweredDefaultValue, T as SourceDiagnostic, c as ControlMutationDefaultEntry, d as DefaultFunctionLoweringContext, j as TypedDefaultFunctionCall, l as ControlMutationDefaultRegistry, u as ControlMutationDefaults, x as LoweredDefaultResult } from "./framework-components-hZ2tO-KH-CdRXBOYd.mjs";
|
|
2
2
|
import { t as ImportRequirement } from "./index-CDk9yEbw.mjs";
|
|
3
|
-
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-
|
|
3
|
+
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-BE92GNIR.mjs";
|
|
4
4
|
export { APP_SPACE_ID, type AssembledAuthoringContributions, CONTRACT_SNAPSHOTS_DIRNAME, type ContractSerializer, type ContractSpace, type ContractSpaceHeadRef, type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlMutationDefaultEntry, type ControlMutationDefaultRegistry, type ControlMutationDefaults, type ControlStack, type ControlTargetDescriptor, type ControlTargetInstance, type CoreSchemaView, type CreateControlStackInput, type DefaultFunctionLoweringContext, type DiffSubjectGranularity, type DiffableNode, type EmitContractResult, type ExpectationFailureReason, type ImportRequirement, type IntrospectSchemaResult, type LoweredDefaultResult, type LoweredDefaultValue, type MigratableTargetDescriptor, type MigrationMetadata, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPackage, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanWithAuthoringSurface, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerFailureResult, type MigrationPlannerResult, type MigrationPlannerSuccessResult, type MigrationRunner, type MigrationRunnerExecutionChecks, type MigrationRunnerFailure, type MigrationRunnerPerSpaceOptions, type MigrationRunnerPerSpaceSuccessValue, type MigrationRunnerResult, type MigrationRunnerSuccessValue, type MigrationScaffoldContext, type MutationDefaultGeneratorDescriptor, type OpFactoryCall, type OperationContext, type OperationPreview, type OperationPreviewCapable, type OperationPreviewStatement, type PslContractInferCapable, SchemaDiff, type SchemaDiffIssue, type SchemaEntityCoordinate, type SchemaNodeRef, type SchemaOwnership, type SchemaSubjectClassifierCapable, SchemaTreeNode, type SchemaTreeNodeOptions, type SchemaTreeVisitor, type SchemaVerifier, type SchemaVerifyOptions, type SchemaVerifyResult, type SchemaViewCapable, type SchemaViewNodeKind, type SignDatabaseResult, type SourceDiagnostic, type SourceSpan, type TargetMigrationsCapability, type TypedDefaultFunctionCall, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, type VerificationStatus, type VerifierIssueCategory, type VerifierOutcome, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, assembleAuthoringContributions, assembleControlMutationDefaults, assertUniqueCodecOwner, buildExtensionLoadOrder, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, createControlStack, diffSchemas, dispositionForCategory, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, issueOutcome, orderIssuesByDependencies, storageHashHex };
|
|
@@ -5,7 +5,7 @@ import { t as CapabilityMatrix } from "./capabilities-Cupq4-1--C71ORI3N.mjs";
|
|
|
5
5
|
import { u as ControlMutationDefaults } from "./framework-components-hZ2tO-KH-CdRXBOYd.mjs";
|
|
6
6
|
import "./components-CGA_WwEG.mjs";
|
|
7
7
|
import { r as Result } from "./result-Bpupv5vO.mjs";
|
|
8
|
-
import { d as ControlExtensionDescriptor, g as ControlTargetDescriptor, l as ControlDriverDescriptor, n as AssembledAuthoringContributions, p as ControlFamilyDescriptor, s as ControlAdapterDescriptor, u as ControlDriverInstance } from "./control-
|
|
8
|
+
import { d as ControlExtensionDescriptor, g as ControlTargetDescriptor, l as ControlDriverDescriptor, n as AssembledAuthoringContributions, p as ControlFamilyDescriptor, s as ControlAdapterDescriptor, u as ControlDriverInstance } from "./control-BE92GNIR.mjs";
|
|
9
9
|
//#region ../../../1-framework/1-core/config/dist/config-types.d.mts
|
|
10
10
|
//#region src/contract-source-types.d.ts
|
|
11
11
|
interface ContractSourceDiagnosticPosition {
|
|
@@ -145,22 +145,9 @@ interface PrismaNextConfig<TFamilyId extends string = string, TTargetId extends
|
|
|
145
145
|
readonly formatter?: FormatterConfig;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
*
|
|
149
|
-
* the
|
|
150
|
-
|
|
151
|
-
declare const CONFIG_FORMAT_VERSION = 1;
|
|
152
|
-
/**
|
|
153
|
-
* Reads the config-format version stamped by `defineConfig`, or `undefined`
|
|
154
|
-
* when the value was not produced by `defineConfig`. The marker is
|
|
155
|
-
* non-enumerable and does not survive spreads: configs must export the
|
|
156
|
-
* `defineConfig` result directly.
|
|
157
|
-
*/
|
|
158
|
-
declare function readConfigFormatVersion(value: unknown): number | undefined;
|
|
159
|
-
declare function hasCurrentConfigFormatVersion(value: unknown): boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Helper function to define a Prisma Next config.
|
|
162
|
-
* Normalizes the config and stamps it with the config-format version marker.
|
|
163
|
-
* Structural validation happens in the config loader, which reports
|
|
148
|
+
* Builds the ORM section of `prisma.config.ts`. The result nests under the
|
|
149
|
+
* `orm` key of the engine's `defineConfig` — the marker lives on the envelope,
|
|
150
|
+
* not here. Structural validation happens in the config loader, which reports
|
|
164
151
|
* per-section diagnostics instead of failing the whole load.
|
|
165
152
|
*
|
|
166
153
|
* Normalization:
|
|
@@ -172,5 +159,5 @@ declare function hasCurrentConfigFormatVersion(value: unknown): boolean;
|
|
|
172
159
|
*/
|
|
173
160
|
declare function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(config: PrismaNextConfig<TFamilyId, TTargetId>): PrismaNextConfig<TFamilyId, TTargetId>;
|
|
174
161
|
//#endregion
|
|
175
|
-
export {
|
|
176
|
-
//# sourceMappingURL=config-types-
|
|
162
|
+
export { normalizeContractConfig as _, ContractSourceDiagnosticSpan as a, ContractSourceProvider as c, FormatterConfig as d, OpaqueContractSourceProvider as f, defineConfig as g, TypeScriptContractSourceProvider as h, ContractSourceDiagnosticPosition as i, ContractSourceProviderBase as l, PslContractSourceProvider as m, ContractSourceContext as n, ContractSourceDiagnostics as o, PrismaNextConfig as p, ContractSourceDiagnostic as r, ContractSourceFormat as s, ContractConfig as t, DEFAULT_CONTRACT_SOURCE_DIR as u };
|
|
163
|
+
//# sourceMappingURL=config-types-CBV5U5IX.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-
|
|
1
|
+
{"version":3,"file":"config-types-CBV5U5IX.d.mts","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-types.d.mts"],"mappings":";;;;;;;;;;UAMU;WACC;WACA;WACA;;UAED;WACC,OAAO;WACP,KAAK;;UAEN;WACC;WACA;WACA;WACA,OAAO;;;;;;WAMP,OAAO,SAAS;;UAEjB;WACC;WACA,sBAAsB;WACtB,OAAO;;UAER;WACC;;WAEA,4BAA4B,oBAAoB;WAChD,wBAAwB;WACxB,aAAa;WACb,yBAAyB;WACzB;WACA,cAAc;;;KAGpB;UACK;WACC;WACA,OAAO,SAAS,0BAA0B,QAAQ,OAAO,UAAU;;UAEpE,kCAAkC;WACjC;;UAED,yCAAyC;WACxC;;;;;;;;UAQD,qCAAqC;WACpC;;KAEN,yBAAyB,4BAA4B,mCAAmC;;;;;;UAMnF;;;;;WAKC,QAAQ;;;;;;;WAOR;;UAED;WACC;WACA;;;;;;;cAOG;iBACG,wBAAwB,UAAU,iBAAiB;WACzD;;;;;;;;;;UAUD,iBAAiB,mCAAmC,mCAAmC;WACtF,QAAQ,wBAAwB;WAChC,QAAQ,wBAAwB,WAAW;WAC3C,SAAS,yBAAyB,WAAW;WAC7C,sBAAsB,2BAA2B,WAAW;;;;;;;WAO5D,SAAS,wBAAwB,WAAW,WAAW,sBAAsB,WAAW,YAAY;;;;;WAKpG;;;;;;aAME,aAAa;;;;;;WAMf,WAAW;;;;WAIX;;aAEE;;WAEF,YAAY;;;;;;;;;;;;;;;iBAeN,aAAa,mCAAmC,mCAAmC,QAAQ,iBAAiB,WAAW,aAAa,iBAAiB,WAAW"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region ../../../1-framework/1-core/config/dist/config-types.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Default *source* directory for the contract file the user authors at `init`
|
|
4
|
+
* time. Output artefacts colocate with source per the same rule path-bearing
|
|
5
|
+
* providers apply.
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_CONTRACT_SOURCE_DIR = "src/prisma";
|
|
8
|
+
function normalizeContractConfig(contract) {
|
|
9
|
+
const inMemoryFallbackOutput = `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.json`;
|
|
10
|
+
return {
|
|
11
|
+
source: contract.source,
|
|
12
|
+
output: contract.output ?? inMemoryFallbackOutput
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Builds the ORM section of `prisma.config.ts`. The result nests under the
|
|
17
|
+
* `orm` key of the engine's `defineConfig` — the marker lives on the envelope,
|
|
18
|
+
* not here. Structural validation happens in the config loader, which reports
|
|
19
|
+
* per-section diagnostics instead of failing the whole load.
|
|
20
|
+
*
|
|
21
|
+
* Normalization:
|
|
22
|
+
* - contract.output defaults to a path colocated with DEFAULT_CONTRACT_SOURCE_DIR
|
|
23
|
+
* when missing (in-memory-only providers)
|
|
24
|
+
*
|
|
25
|
+
* @param config - Raw config input from user
|
|
26
|
+
* @returns Normalized config IR with defaults applied
|
|
27
|
+
*/
|
|
28
|
+
function defineConfig(config) {
|
|
29
|
+
if (config.contract) return {
|
|
30
|
+
...config,
|
|
31
|
+
contract: normalizeContractConfig(config.contract)
|
|
32
|
+
};
|
|
33
|
+
return config;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { defineConfig as n, normalizeContractConfig as r, DEFAULT_CONTRACT_SOURCE_DIR as t };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=config-types-D_UCRNbm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-types-D_UCRNbm.mjs","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-types.mjs"],"sourcesContent":["//#region src/config-types.ts\n/**\n* Default *source* directory for the contract file the user authors at `init`\n* time. Output artefacts colocate with source per the same rule path-bearing\n* providers apply.\n*/\nconst DEFAULT_CONTRACT_SOURCE_DIR = \"src/prisma\";\nfunction normalizeContractConfig(contract) {\n\tconst inMemoryFallbackOutput = `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.json`;\n\treturn {\n\t\tsource: contract.source,\n\t\toutput: contract.output ?? inMemoryFallbackOutput\n\t};\n}\n/**\n* Builds the ORM section of `prisma.config.ts`. The result nests under the\n* `orm` key of the engine's `defineConfig` — the marker lives on the envelope,\n* not here. Structural validation happens in the config loader, which reports\n* per-section diagnostics instead of failing the whole load.\n*\n* Normalization:\n* - contract.output defaults to a path colocated with DEFAULT_CONTRACT_SOURCE_DIR\n* when missing (in-memory-only providers)\n*\n* @param config - Raw config input from user\n* @returns Normalized config IR with defaults applied\n*/\nfunction defineConfig(config) {\n\tif (config.contract) return {\n\t\t...config,\n\t\tcontract: normalizeContractConfig(config.contract)\n\t};\n\treturn config;\n}\n//#endregion\nexport { DEFAULT_CONTRACT_SOURCE_DIR, defineConfig, normalizeContractConfig };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;AAMA,MAAM,8BAA8B;AACpC,SAAS,wBAAwB,UAAU;CAC1C,MAAM,yBAAyB,GAAG,4BAA4B;CAC9D,OAAO;EACN,QAAQ,SAAS;EACjB,QAAQ,SAAS,UAAU;CAC5B;AACD;;;;;;;;;;;;;;AAcA,SAAS,aAAa,QAAQ;CAC7B,IAAI,OAAO,UAAU,OAAO;EAC3B,GAAG;EACH,UAAU,wBAAwB,OAAO,QAAQ;CAClD;CACA,OAAO;AACR"}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as normalizeContractConfig, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as OpaqueContractSourceProvider, g as defineConfig, h as TypeScriptContractSourceProvider, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PrismaNextConfig, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-CBV5U5IX.mjs";
|
|
2
2
|
import { n as ConfigValidationIssue, r as collectConfigIssues, t as ConfigSection } from "./config-validation-Wiqew2J9.mjs";
|
|
3
|
-
export {
|
|
3
|
+
export { type ConfigSection, type ConfigValidationIssue, type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type OpaqueContractSourceProvider, type PrismaNextConfig, type PslContractSourceProvider, type TypeScriptContractSourceProvider, collectConfigIssues, defineConfig, normalizeContractConfig };
|
package/dist/config.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as defineConfig, r as normalizeContractConfig, t as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-D_UCRNbm.mjs";
|
|
2
2
|
import { t as collectConfigIssues } from "./config-validation-DPt5hwQx.mjs";
|
|
3
|
-
export {
|
|
3
|
+
export { DEFAULT_CONTRACT_SOURCE_DIR, collectConfigIssues, defineConfig, normalizeContractConfig };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export {
|
|
1
|
+
import { _ as normalizeContractConfig, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as OpaqueContractSourceProvider, g as defineConfig, h as TypeScriptContractSourceProvider, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PrismaNextConfig, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-CBV5U5IX.mjs";
|
|
2
|
+
export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type OpaqueContractSourceProvider, type PrismaNextConfig, type PslContractSourceProvider, type TypeScriptContractSourceProvider, defineConfig, normalizeContractConfig };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { n as defineConfig, r as normalizeContractConfig, t as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-D_UCRNbm.mjs";
|
|
2
|
+
export { DEFAULT_CONTRACT_SOURCE_DIR, defineConfig, normalizeContractConfig };
|
|
@@ -1241,7 +1241,7 @@ interface SchemaViewCapable<TSchemaIR = unknown> {
|
|
|
1241
1241
|
declare function hasSchemaView<TFamilyId extends string, TSchemaIR>(instance: ControlFamilyInstance<TFamilyId, TSchemaIR>): instance is ControlFamilyInstance<TFamilyId, TSchemaIR> & SchemaViewCapable<TSchemaIR>;
|
|
1242
1242
|
/**
|
|
1243
1243
|
* Capability declaring that a family can infer a PSL contract AST from its
|
|
1244
|
-
* opaque introspected schema IR. Consumed by `prisma
|
|
1244
|
+
* opaque introspected schema IR. Consumed by `prisma contract infer`.
|
|
1245
1245
|
*/
|
|
1246
1246
|
interface PslContractInferCapable<TSchemaIR = unknown> {
|
|
1247
1247
|
inferPslContract(schemaIR: TSchemaIR): PslDocumentAst;
|
|
@@ -1390,4 +1390,4 @@ type VerifierIssueCategory = 'declaredMissing' | 'declaredIncompatible' | 'value
|
|
|
1390
1390
|
declare function dispositionForCategory(controlPolicy: ControlPolicy, category: VerifierIssueCategory): VerifierOutcome;
|
|
1391
1391
|
//#endregion
|
|
1392
1392
|
export { SchemaDiffIssue as $, MigrationPlan as A, diffSchemas as At, MigrationRunnerFailure as B, hasSchemaView as Bt, ExpectationFailureReason as C, assembleAuthoringContributions as Ct, MigrationOperationClass as D, contractSnapshotJsonSpecifier as Dt, MigrationMetadata as E, buildExtensionLoadOrder as Et, MigrationPlannerFailureResult as F, extractQueryOperationTypeImports as Ft, MigrationScaffoldContext as G, MigrationRunnerPerSpaceSuccessValue as H, orderIssuesByDependencies as Ht, MigrationPlannerResult as I, hasMigrations as It, OperationPreview as J, OpFactoryCall as K, MigrationPlannerSuccessResult as L, hasOperationPreview as Lt, MigrationPlanWithAuthoringSurface as M, extractCodecLookup as Mt, MigrationPlanner as N, extractCodecTypeImports as Nt, MigrationOperationPolicy as O, contractSnapshotTypesSpecifier as Ot, MigrationPlannerConflict as P, extractComponentIds as Pt, SchemaDiff as Q, MigrationRunner as R, hasPslContractInfer as Rt, EmitContractResult as S, VerifyDatabaseSchemaResult as St, MigratableTargetDescriptor as T, assertUniqueCodecOwner as Tt, MigrationRunnerResult as U, storageHashHex as Ut, MigrationRunnerPerSpaceOptions as V, issueOutcome as Vt, MigrationRunnerSuccessValue as W, OperationPreviewStatement as X, OperationPreviewCapable as Y, PslContractInferCapable as Z, ControlTargetInstance as _, VERIFY_CODE_TARGET_MISMATCH as _t, ContractSpace as a, SchemaTreeNodeOptions as at, DiffSubjectGranularity as b, VerifierOutcome as bt, ControlAdapterInstance as c, SchemaVerifyOptions as ct, ControlExtensionDescriptor as d, SchemaViewNodeKind as dt, SchemaEntityCoordinate as et, ControlExtensionInstance as f, SignDatabaseResult as ft, ControlTargetDescriptor as g, VERIFY_CODE_SCHEMA_FAILURE as gt, ControlStack as h, VERIFY_CODE_MARKER_MISSING as ht, ContractSerializer as i, SchemaTreeNode as it, MigrationPlanOperation as j, dispositionForCategory as jt, MigrationPackage as k, createControlStack as kt, ControlDriverDescriptor as l, SchemaVerifyResult as lt, ControlFamilyInstance as m, VERIFY_CODE_HASH_MISMATCH as mt, AssembledAuthoringContributions as n, SchemaOwnership as nt, ContractSpaceHeadRef as o, SchemaTreeVisitor as ot, ControlFamilyDescriptor as p, TargetMigrationsCapability as pt, OperationContext as q, CONTRACT_SNAPSHOTS_DIRNAME as r, SchemaSubjectClassifierCapable as rt, ControlAdapterDescriptor as s, SchemaVerifier as st, APP_SPACE_ID as t, SchemaNodeRef as tt, ControlDriverInstance as u, SchemaViewCapable as ut, CoreSchemaView as v, VerificationStatus as vt, IntrospectSchemaResult as w, assembleControlMutationDefaults as wt, DiffableNode as x, VerifyDatabaseResult as xt, CreateControlStackInput as y, VerifierIssueCategory as yt, MigrationRunnerExecutionChecks as z, hasSchemaSubjectClassifier as zt };
|
|
1393
|
-
//# sourceMappingURL=control-
|
|
1393
|
+
//# sourceMappingURL=control-BE92GNIR.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-BE92GNIR.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BU,mBAAmB;;;;;;;;;;;;EAY3B,oBAAoB,UAAU,YAAY,WAAW,gBAAgB;;;;;;;;;;EAUrE,kBAAkB,UAAU,YAAY;;;;;;;;WAQ/B,sBAAsB;;;;;;;;WAQtB,cAAc;;;;cAIX;;iBAEG,eAAe;;iBAEf,8BAA8B,6BAA6B;;iBAE3D,+BAA+B,6BAA6B;;;;;;;;;;KAUxE;WACM;WACA;;UAED,gBAAgB,cAAc,eAAe;;WAE5C;;WAEA,WAAW;;WAEX,SAAS;;;;;;;;WAQT;;;;;;;;;;;;;;;;KAgBN;;;;;;;iBAOY,aAAa,OAAO,kBAAkB;;;;;;;;;;;;;;;UAe7C;WACC;WACA;;;;;;;WAOA,qBAAqB;EAC9B,UAAU,OAAO;EACjB,qBAAqB;;;;;;;;;;;iBAWN,YAAY,UAAU,cAAc,QAAQ,wBAAwB;;;;;;;;;;;;cAYvE,WAAW,cAAc,eAAe;WAC3C,iBAAiB,gBAAgB;EAC1C,YAAY,iBAAiB,gBAAgB;;EAE7C,OAAO,OAAO,OAAO,gBAAgB,qBAAqB,WAAW;;;;cAIzD;cACA;cACA;cACA;UACJ;WACC;WACA;WACA,OAAO,SAAS;;UAEjB;WACC;WACA;WACA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA;WACA;aACE;aACA;;WAEF;aACE;;;;;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e,cAAc,iBAAiB,gBAAgB,oBAAoB,gBAAgB;;;;;;;;;;;;;;;;;;UAkBjJ,eAAe,WAAW;EAClC,aAAa,SAAS,oBAAoB,WAAW,WAAW;;;;;;;;UAQxD,oBAAoB,WAAW;WAC9B,UAAU;WACV,QAAQ;;;;;;;;UAQT;WACC;WACA,iBAAiB;;;;KAIvB;KACA,kBAAkB;;;;;;;;;;;;;;;;;KAiBlB;;;;;;;;;;iBAUY,uBAAuB,eAAe,eAAe,UAAU,wBAAwB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
2
2
|
import { r as docsUrlFor } from "./structured-error-CgiSMpdU.mjs";
|
|
3
|
-
//#region ../../../1-framework/1-core/errors/dist/control-
|
|
3
|
+
//#region ../../../1-framework/1-core/errors/dist/control-dcFIOWpk.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Structured CLI error that contains all information needed for error envelopes.
|
|
6
6
|
* Call sites throw these errors with full context.
|
|
@@ -70,7 +70,7 @@ var CliStructuredError = class extends Error {
|
|
|
70
70
|
function errorConfigFileNotFound(configPath, options) {
|
|
71
71
|
return new CliStructuredError("CONFIG.FILE_NOT_FOUND", "Config file not found", {
|
|
72
72
|
...options?.why ? { why: options.why } : { why: "Config file not found" },
|
|
73
|
-
fix: "Run 'prisma
|
|
73
|
+
fix: "Run 'prisma orm init' to create a config file",
|
|
74
74
|
nextActions: [{
|
|
75
75
|
kind: "run-command",
|
|
76
76
|
label: "Create a config file",
|
|
@@ -121,7 +121,7 @@ function errorContractConfigMissing(options) {
|
|
|
121
121
|
function errorContractValidationFailed(reason, options) {
|
|
122
122
|
return new CliStructuredError("CONTRACT.VALIDATION_FAILED", "Contract validation failed", {
|
|
123
123
|
why: reason,
|
|
124
|
-
fix: "Re-run `prisma
|
|
124
|
+
fix: "Re-run `prisma contract emit`, or fix the contract file and try again",
|
|
125
125
|
nextActions: [{
|
|
126
126
|
kind: "run-command",
|
|
127
127
|
label: "Re-emit the contract",
|
|
@@ -152,7 +152,7 @@ function errorFileNotFound(filePath, options) {
|
|
|
152
152
|
* Database connection is required but not provided.
|
|
153
153
|
*/
|
|
154
154
|
function errorDatabaseConnectionRequired(options) {
|
|
155
|
-
const runHint = options?.retryCommand ? `Run \`${options.retryCommand}\`` : options?.commandName ? `Run \`prisma
|
|
155
|
+
const runHint = options?.retryCommand ? `Run \`${options.retryCommand}\`` : options?.commandName ? `Run \`prisma ${options.commandName} --db <url>\`` : "Provide `--db <url>`";
|
|
156
156
|
return new CliStructuredError("CONFIG.DB_CONNECTION_REQUIRED", "Database connection is required", {
|
|
157
157
|
why: options?.why ?? "Database connection is required for this command",
|
|
158
158
|
fix: `${runHint}, or set \`db: { connection: "postgres://…" }\` in prisma.config.ts`,
|
|
@@ -332,4 +332,4 @@ function errorUnexpected(message, options) {
|
|
|
332
332
|
//#endregion
|
|
333
333
|
export { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };
|
|
334
334
|
|
|
335
|
-
//# sourceMappingURL=control-
|
|
335
|
+
//# sourceMappingURL=control-dcFIOWpk-BLVmTGhh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-dcFIOWpk-BLVmTGhh.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-dcFIOWpk.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { docsUrlFor } from \"@internal/utils/structured-error\";\n//#region src/control.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `@internal/utils/structured-error`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See\n* [ADR 239](../../../../../docs/architecture%20docs/adrs/ADR%20239%20-%20Errors%20are%20structural%20envelopes%20with%20dotted%20namespace%20codes.md)\n* for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*\n\t* This is the boundary that emits the envelope, so it is where a missing\n\t* `nextActions` becomes `[]`.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\tnextActions: this.nextActions ?? [],\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = error;\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n/**\n* Config file not found or missing.\n*/\nfunction errorConfigFileNotFound(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.FILE_NOT_FOUND\", \"Config file not found\", {\n\t\t...options?.why ? { why: options.why } : { why: \"Config file not found\" },\n\t\tfix: \"Run 'prisma orm init' to create a config file\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Create a config file\",\n\t\t\tcommand: \"{bin} init\"\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FILE_NOT_FOUND\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Config module failed to evaluate (syntax error, module threw during import).\n*/\nfunction errorConfigEvaluationFailed(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", \"Config file could not be evaluated\", {\n\t\twhy: options.why,\n\t\tfix: \"Fix the error in your prisma.config.ts so the module evaluates, then rerun the command\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.EVALUATION_FAILED\"),\n\t\t...configPath ? { where: { path: configPath } } : {},\n\t\t...options.cause !== void 0 ? { cause: options.cause } : {}\n\t});\n}\n/**\n* Config module evaluated, but its export does not carry the defineConfig\n* version marker (plain object export, or a config produced by a different\n* defineConfig such as classic Prisma's).\n*/\nfunction errorConfigVersionMarkerMissing(configPath) {\n\treturn new CliStructuredError(\"CONFIG.VERSION_MARKER_MISSING\", \"Config is not a defineConfig result\", {\n\t\twhy: \"The config module evaluated, but its default export was not created by a current defineConfig\",\n\t\tfix: \"Create the config with defineConfig from '@prisma/cli-engine', nest your settings under its `orm` section, and export its return value directly\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VERSION_MARKER_MISSING\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Contract configuration missing from config.\n*/\nfunction errorContractConfigMissing(options) {\n\treturn new CliStructuredError(\"CONFIG.CONTRACT_MISSING\", \"Contract configuration missing\", {\n\t\twhy: options?.why ?? \"The contract configuration is required for emit\",\n\t\tfix: \"Add contract configuration to your prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.CONTRACT_MISSING\")\n\t});\n}\n/**\n* Contract validation failed.\n*/\nfunction errorContractValidationFailed(reason, options) {\n\treturn new CliStructuredError(\"CONTRACT.VALIDATION_FAILED\", \"Contract validation failed\", {\n\t\twhy: reason,\n\t\tfix: \"Re-run `prisma contract emit`, or fix the contract file and try again\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Re-emit the contract\",\n\t\t\tcommand: \"{bin} contract emit\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Fix the contract file, then re-run the command\",\n\t\t\treason\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONTRACT.VALIDATION_FAILED\"),\n\t\t...options?.where ? { where: options.where } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* File not found.\n*/\nfunction errorFileNotFound(filePath, options) {\n\treturn new CliStructuredError(\"CLI.FILE_NOT_FOUND\", \"File not found\", {\n\t\twhy: options?.why ?? `File not found: ${filePath}`,\n\t\tfix: options?.fix ?? \"Check that the file path is correct\",\n\t\twhere: { path: filePath },\n\t\t...options?.docsUrl ? { docsUrl: options.docsUrl } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* Database connection is required but not provided.\n*/\nfunction errorDatabaseConnectionRequired(options) {\n\tconst runHint = options?.retryCommand ? `Run \\`${options.retryCommand}\\`` : options?.commandName ? `Run \\`prisma ${options.commandName} --db <url>\\`` : \"Provide `--db <url>`\";\n\treturn new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"Database connection is required\", {\n\t\twhy: options?.why ?? \"Database connection is required for this command\",\n\t\tfix: `${runHint}, or set \\`db: { connection: \"postgres://…\" }\\` in prisma.config.ts`,\n\t\t...options?.missingFlags !== void 0 ? { meta: { missingFlags: [...options.missingFlags] } } : {}\n\t});\n}\n/**\n* Query runner factory is required but not provided in config.\n*/\nfunction errorQueryRunnerFactoryRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\", \"Query runner factory is required\", {\n\t\twhy: options?.why ?? \"Config.db.queryRunnerFactory is required for db verify\",\n\t\tfix: \"Add db.queryRunnerFactory to prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\")\n\t});\n}\n/**\n* Family verify.readMarker is required but not provided.\n*/\nfunction errorFamilyReadMarkerSqlRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\", \"Family readMarker() is required\", {\n\t\twhy: options?.why ?? \"Family verify.readMarker is required for db verify\",\n\t\tfix: \"Ensure family.verify.readMarker() is exported by your family package\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\")\n\t});\n}\n/**\n* JSON output format not supported.\n*/\nfunction errorJsonFormatNotSupported(options) {\n\treturn new CliStructuredError(\"CLI.JSON_FORMAT_UNSUPPORTED\", \"Unsupported JSON format\", {\n\t\twhy: `The ${options.command} command does not support --json ${options.format}`,\n\t\tfix: `Use --json ${options.supportedFormats.join(\" or \")}, or omit --json for human output`,\n\t\tmeta: {\n\t\t\tcommand: options.command,\n\t\t\tformat: options.format,\n\t\t\tsupportedFormats: options.supportedFormats\n\t\t}\n\t});\n}\n/**\n* Driver is required for DB-connected commands but not provided.\n*/\nfunction errorDriverRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is required for DB-connected commands\", {\n\t\twhy: options?.why ?? \"Config.driver is required for DB-connected commands\",\n\t\tfix: \"Add a control-plane driver to prisma.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.DRIVER_REQUIRED\")\n\t});\n}\n/**\n* Contract requires extension packs that are not provided by config descriptors.\n*/\nfunction errorContractMissingExtensions(options) {\n\tconst missing = [...options.missingExtensions].sort();\n\treturn new CliStructuredError(\"CONFIG.MISSING_EXTENSION_PACKS\", \"Missing extension packs in config\", {\n\t\twhy: missing.length === 1 ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.` : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(\", \")}, but CLI config does not provide matching descriptors.`,\n\t\tfix: \"Add the missing extension descriptors to `extensions` in prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.MISSING_EXTENSION_PACKS\"),\n\t\tmeta: {\n\t\t\tmissingExtensions: missing,\n\t\t\tprovidedComponentIds: [...options.providedComponentIds].sort()\n\t\t}\n\t});\n}\n/**\n* Migration planning failed due to conflicts.\n*/\nfunction errorMigrationPlanningFailed(options) {\n\tconst conflictSummaries = options.conflicts.map((c) => c.summary);\n\tconst computedWhy = options.why ?? conflictSummaries.join(\"\\n\");\n\tconst conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === \"string\");\n\treturn new CliStructuredError(\"MIGRATION.PLANNING_FAILED\", \"Migration planning failed\", {\n\t\twhy: computedWhy,\n\t\tfix: conflictFixes.length > 0 ? conflictFixes.join(\"\\n\") : \"Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty\",\n\t\tmeta: { conflicts: options.conflicts },\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.PLANNING_FAILED\")\n\t});\n}\n/**\n* Target does not support migrations (missing createPlanner/createRunner).\n*/\nfunction errorTargetMigrationNotSupported(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", \"Target does not support migrations\", {\n\t\twhy: options?.why ?? \"The configured target does not provide migration planner/runner\",\n\t\tfix: \"Select a target that provides migrations (it must export `target.migrations` for db init)\",\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.TARGET_UNSUPPORTED\")\n\t});\n}\n/**\n* The migration-file CLI received `--config` without a path argument (either\n* a bare trailing `--config`, or `--config` followed by another flag like\n* `--config --dry-run`). Surfacing this as a structured error fails fast\n* rather than silently consuming the next flag as the config path or\n* falling back to default discovery against the wrong project.\n*/\nfunction errorMigrationCliInvalidConfigArg(options) {\n\treturn new CliStructuredError(\"CLI.CONFIG_ARG_MISSING_PATH\", \"--config flag requires a path argument\", {\n\t\twhy: options?.nextToken !== void 0 ? `\\`--config\\` was followed by another flag (\\`${options.nextToken}\\`) instead of a path argument.` : \"`--config` was passed without a following path argument.\",\n\t\tfix: \"Pass a config path: `--config <path>` or `--config=<path>`.\",\n\t\tmeta: options?.nextToken !== void 0 ? { nextToken: options.nextToken } : {}\n\t});\n}\n/**\n* The migration-file CLI received a flag it does not recognise. Surfaced as a\n* structured error so consumers can render their own \"did you mean\"\n* suggestions from `meta.knownFlags` rather than parsing the message.\n*\n* Designed to wrap clipanion's `UnknownSyntaxError` at the parser boundary:\n* pass the offending token as `flag` and the option declarations as\n* `knownFlags`.\n*/\nfunction errorMigrationCliUnknownFlag(options) {\n\tconst knownList = options.knownFlags.join(\", \");\n\treturn new CliStructuredError(\"CLI.UNKNOWN_FLAG\", \"Unknown migration CLI flag\", {\n\t\twhy: `Unknown flag \\`${options.flag}\\`.`,\n\t\tfix: `Known flags: ${knownList}. Run with \\`--help\\` to see the full list.`,\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tknownFlags: options.knownFlags\n\t\t}\n\t});\n}\n/**\n* The main CLI received an unsupported `--format` value.\n*/\nfunction errorInvalidOutputFormat(value) {\n\treturn new CliStructuredError(\"CLI.INVALID_OUTPUT_FORMAT\", `Invalid --format value \"${value}\". Allowed values: pretty, json.`, { meta: {\n\t\tvalue,\n\t\tallowed: [\"pretty\", \"json\"]\n\t} });\n}\n/**\n* The main CLI received mutually exclusive output format flags\n* (`--format pretty` together with `--json`).\n*/\nfunction errorOutputFormatMutex() {\n\treturn new CliStructuredError(\"CLI.OUTPUT_FORMAT_CONFLICT\", \"Cannot use --format pretty together with --json. Use --format json or --json alone for JSON output.\");\n}\n/**\n* Config validation error (missing required fields).\n*/\nfunction errorConfigValidation(field, options) {\n\treturn new CliStructuredError(\"CONFIG.VALIDATION_FAILED\", \"Config validation error\", {\n\t\twhy: options?.why ?? `Config must have a \"${field}\" field`,\n\t\tfix: \"Check your prisma.config.ts and ensure all required fields are provided\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VALIDATION_FAILED\"),\n\t\tmeta: {\n\t\t\tfield,\n\t\t\t...options?.section !== void 0 ? { section: options.section } : {}\n\t\t}\n\t});\n}\n/**\n* An enum declares a codecId that no component in the contract's pack stack provides,\n* so its member values cannot be encoded. Thrown by both authoring paths (TS `defineContract`\n* and PSL interpretation) when the codec lookup built from the contract's packs has no\n* descriptor for the codecId.\n*/\nfunction errorEnumCodecNotInPackStack(options) {\n\treturn new CliStructuredError(\"CONTRACT.ENUM_CODEC_NOT_IN_PACK_STACK\", `Enum codec \"${options.codecId}\" is not part of the contract's pack stack`, {\n\t\twhy: `An enum uses codec \"${options.codecId}\", but no family, target, or extension pack in the contract provides it.`,\n\t\tfix: \"Use a codec provided by the contract's target/extension packs, or add the pack that supplies this codec.\",\n\t\tmeta: { codecId: options.codecId }\n\t});\n}\n/**\n* Generic unexpected error.\n*/\nfunction errorUnexpected(message, options) {\n\treturn new CliStructuredError(\"CLI.UNEXPECTED\", \"Unexpected error\", {\n\t\twhy: options?.why ?? message,\n\t\tfix: options?.fix ?? \"Check the error message and try again\",\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };\n\n//# sourceMappingURL=control-dcFIOWpk.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,IAAI,qBAAqB,cAAc,MAAM;CAC5C;CACA;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,WAAW,SAAS,YAAY;EACrC,MAAM,MAAM,SAAS,QAAQ,SAAS,MAAM,KAAK,IAAI,SAAS;EAC9D,MAAM,QAAQ,SAAS,QAAQ;GAC9B,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;GACvC,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;EACxC,IAAI,KAAK;EACT,OAAO,OAAO,MAAM;GACnB,GAAG,UAAU,OAAO,SAAS,GAAG;GAChC,GAAG,UAAU,OAAO,GAAG;GACvB,GAAG,UAAU,eAAe,SAAS,WAAW;GAChD,GAAG,UAAU,SAAS,KAAK;GAC3B,GAAG,UAAU,QAAQ,SAAS,IAAI;GAClC,GAAG,UAAU,WAAW,SAAS,OAAO;EACzC,CAAC;CACF;;;;;;;CAOA,aAAa;EACZ,OAAO;GACN,IAAI;GACJ,MAAM,KAAK;GACX,UAAU,KAAK;GACf,SAAS,KAAK;G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,KAAK,SAAS,OAAO,uBAAuB,MAAM;EAClD,KAAK;EACL,SAAS,WAAW,0BAA0B;EAC9C,MAAM;GACL;GACA,GAAG,SAAS,YAAY,KAAK,IAAI,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EAClE;CACD,CAAC;AACF;;;;;;;AAOA,SAAS,6BAA6B,SAAS;CAC9C,OAAO,IAAI,mBAAmB,yCAAyC,eAAe,QAAQ,QAAQ,6CAA6C;EAClJ,KAAK,uBAAuB,QAAQ,QAAQ;EAC5C,KAAK;EACL,MAAM,EAAE,SAAS,QAAQ,QAAQ;CAClC,CAAC;AACF;;;;AAIA,SAAS,gBAAgB,SAAS,SAAS;CAC1C,OAAO,IAAI,mBAAmB,kBAAkB,oBAAoB;EACnE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF"}
|
package/dist/errors.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { C as errorTargetMigrationNotSupported, S as errorQueryRunnerFactoryRequired, _ as errorJsonFormatNotSupported, a as errorConfigFileNotFound, b as errorMigrationPlanningFailed, c as errorContractConfigMissing, d as errorDatabaseConnectionRequired, f as errorDriverRequired, g as errorInvalidOutputFormat, h as errorFileNotFound, i as errorConfigEvaluationFailed, l as errorContractMissingExtensions, m as errorFamilyReadMarkerSqlRequired, n as CliErrorEnvelope, o as errorConfigValidation, p as errorEnumCodecNotInPackStack, r as CliStructuredError, s as errorConfigVersionMarkerMissing, t as CliErrorConflict, u as errorContractValidationFailed, v as errorMigrationCliInvalidConfigArg, w as errorUnexpected, x as errorOutputFormatMutex, y as errorMigrationCliUnknownFlag } from "./control-ql9N9u4f-r3Vv41kZ.mjs";
|
|
2
|
-
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-
|
|
2
|
+
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-BVw3c1X3.mjs";
|
|
3
3
|
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-BvrgDZXw.mjs";
|
|
4
4
|
export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing, errorConsentPlanMismatch, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDataTransformContractMismatch, errorDatabaseConnectionRequired, errorDestructiveChanges, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationPlanningFailed, errorMigrationTargetMismatch, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected, errorUnfilledPlaceholder, parseMarkerRowSafely, placeholder, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
package/dist/errors.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-
|
|
2
|
-
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-
|
|
3
|
-
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-
|
|
1
|
+
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-dcFIOWpk-BLVmTGhh.mjs";
|
|
2
|
+
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-Dd7goUCC.mjs";
|
|
3
|
+
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-DjAbwcyQ.mjs";
|
|
4
4
|
export { CliStructuredError, ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing, errorConsentPlanMismatch, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDataTransformContractMismatch, errorDatabaseConnectionRequired, errorDestructiveChanges, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationPlanningFailed, errorMigrationTargetMismatch, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected, errorUnfilledPlaceholder, parseMarkerRowSafely, placeholder, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
package/dist/errors__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-
|
|
1
|
+
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-dcFIOWpk-BLVmTGhh.mjs";
|
|
2
2
|
export { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationPlanningFailed, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorTargetMigrationNotSupported, errorUnexpected };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-
|
|
1
|
+
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-BVw3c1X3.mjs";
|
|
2
2
|
export { ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-
|
|
1
|
+
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-Dd7goUCC.mjs";
|
|
2
2
|
export { ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-
|
|
1
|
+
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-DjAbwcyQ.mjs";
|
|
2
2
|
export { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as SchemaDiffIssue, St as VerifyDatabaseSchemaResult } from "./control-
|
|
1
|
+
import { $ as SchemaDiffIssue, St as VerifyDatabaseSchemaResult } from "./control-BE92GNIR.mjs";
|
|
2
2
|
import { r as NextAction } from "./structured-error-BsNT4Hun.mjs";
|
|
3
3
|
import { r as CliStructuredError } from "./control-ql9N9u4f-r3Vv41kZ.mjs";
|
|
4
4
|
//#region ../../../1-framework/1-core/errors/dist/execution.d.mts
|
|
@@ -112,4 +112,4 @@ declare function errorRuntime(code: `${string}.${string}`, summary: string, opti
|
|
|
112
112
|
}): CliStructuredError;
|
|
113
113
|
//#endregion
|
|
114
114
|
export { errorHashMismatch as a, errorMarkerRequired as c, errorRuntime as d, errorSchemaVerificationFailed as f, withMarkerReadErrorHandling as g, rethrowMarkerReadError as h, errorDestructiveChanges as i, errorMarkerRowCorrupt as l, parseMarkerRowSafely as m, ERROR_CODE_DESTRUCTIVE_CHANGES as n, errorMarkerMissing as o, errorTargetMismatch as p, errorConsentPlanMismatch as r, errorMarkerReadFailed as s, ERROR_CODE_CONSENT_PLAN_MISMATCH as t, errorRunnerFailed as u };
|
|
115
|
-
//# sourceMappingURL=execution-
|
|
115
|
+
//# sourceMappingURL=execution-BVw3c1X3.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-
|
|
1
|
+
{"version":3,"file":"execution-BVw3c1X3.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.d.mts"],"mappings":";;;;;;;;iBAOiB,mBAAmB;WACzB;IACP;;;;iBAIa,kBAAkB;WACxB;WACA;WACA;IACP;;;;iBAIa,oBAAoB,kBAAkB,gBAAgB;WAC5D;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;WACA;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;WACA;IACP;iBACa,uBAAuB,cAAc;WAC3C;WACA;;iBAEM,4BAA4B,GAAG,iBAAiB,QAAQ,IAAI;WAClE;WACA;IACP,QAAQ;iBACK,qBAAqB,GAAG,cAAc,QAAQ,mBAAmB,GAAG;WAC1E;WACA;IACP;;;;;iBAKa,oBAAoB;WAC1B;WACA;WACA,uBAAuB;IAC9B;;;;;iBAKa,8BAA8B;WACpC;WACA,oBAAoB;WACpB,kBAAkB;IACzB;;;;iBAIa,kBAAkB,iBAAiB;WACzC;WACA;WACA,uBAAuB;WACvB,OAAO;WACP;IACP;;cAEU;;;;iBAIG,wBAAwB,iBAAiB;WAC/C;WACA;WACA,OAAO;IACd;cACU;;;;;iBAKG,yBAAyB;WAC/B;WACA;WACA;IACP;;;;iBAIa,aAAa,6BAA6B,iBAAiB;WACjE;WACA;WACA,OAAO;WACP;IACP"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
2
|
-
import { t as CliStructuredError } from "./control-
|
|
2
|
+
import { t as CliStructuredError } from "./control-dcFIOWpk-BLVmTGhh.mjs";
|
|
3
3
|
//#region ../../../1-framework/1-core/errors/dist/execution.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Contract marker not found in database.
|
|
@@ -7,7 +7,7 @@ import { t as CliStructuredError } from "./control-BD96JZi8-NUhO5Kkw.mjs";
|
|
|
7
7
|
function errorMarkerMissing(options) {
|
|
8
8
|
return new CliStructuredError("CONTRACT.MARKER_MISSING", "Database not signed", {
|
|
9
9
|
why: options?.why ?? "No database signature (marker) found",
|
|
10
|
-
fix: "Run `prisma
|
|
10
|
+
fix: "Run `prisma db sign --db <url>` to sign the database",
|
|
11
11
|
nextActions: [{
|
|
12
12
|
kind: "run-command",
|
|
13
13
|
label: "Sign the database",
|
|
@@ -47,7 +47,7 @@ function errorTargetMismatch(expected, actual, options) {
|
|
|
47
47
|
function errorMarkerRowCorrupt(options) {
|
|
48
48
|
return new CliStructuredError("CONTRACT.MARKER_ROW_CORRUPT", "Marker row is corrupt or incompatible", {
|
|
49
49
|
why: options.why,
|
|
50
|
-
fix: `The ${options.markerLocation} row for space "${options.space}" contains invalid data. Delete the row, then run \`prisma
|
|
50
|
+
fix: `The ${options.markerLocation} row for space "${options.space}" contains invalid data. Delete the row, then run \`prisma db sign --db <url>\` to write a fresh marker.`,
|
|
51
51
|
nextActions: [{
|
|
52
52
|
kind: "run-command",
|
|
53
53
|
label: "Write a fresh marker",
|
|
@@ -77,9 +77,9 @@ function isLegacyMarkerShapeReadError(message) {
|
|
|
77
77
|
return normalized.includes("column \"space\" does not exist") || normalized.includes("no such column: space");
|
|
78
78
|
}
|
|
79
79
|
function errorLegacyMarkerShape(options) {
|
|
80
|
-
return errorRunnerFailed(`Legacy marker-table shape detected on ${options.markerLocation} (no \`space\` column). Prisma Next is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \`${options.markerLocation}\` and re-run \`prisma
|
|
80
|
+
return errorRunnerFailed(`Legacy marker-table shape detected on ${options.markerLocation} (no \`space\` column). Prisma Next is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \`${options.markerLocation}\` and re-run \`prisma db init\` to reinitialise from a clean baseline.`, {
|
|
81
81
|
why: options.why,
|
|
82
|
-
fix: "Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma
|
|
82
|
+
fix: "Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma db init` to recreate it with the current per-space schema.",
|
|
83
83
|
nextActions: [{
|
|
84
84
|
kind: "run-command",
|
|
85
85
|
label: "Reinitialise the marker table from a clean baseline",
|
|
@@ -132,7 +132,7 @@ function parseMarkerRowSafely(row, parse, context) {
|
|
|
132
132
|
function errorMarkerRequired(options) {
|
|
133
133
|
return new CliStructuredError("CONTRACT.MARKER_REQUIRED", "Database must be signed first", {
|
|
134
134
|
why: options?.why ?? "No database signature (marker) found",
|
|
135
|
-
fix: options?.fix ?? "Run `prisma
|
|
135
|
+
fix: options?.fix ?? "Run `prisma db init` first to sign the database",
|
|
136
136
|
nextActions: options?.nextActions ?? [{
|
|
137
137
|
kind: "run-command",
|
|
138
138
|
label: "Sign the database",
|
|
@@ -147,7 +147,7 @@ function errorMarkerRequired(options) {
|
|
|
147
147
|
function errorSchemaVerificationFailed(options) {
|
|
148
148
|
return new CliStructuredError("CONTRACT.SCHEMA_VERIFICATION_FAILED", options.summary, {
|
|
149
149
|
why: "Database schema does not satisfy the contract",
|
|
150
|
-
fix: "Run `prisma
|
|
150
|
+
fix: "Run `prisma db update` to reconcile, or adjust your contract to match the database",
|
|
151
151
|
nextActions: [{
|
|
152
152
|
kind: "run-command",
|
|
153
153
|
label: "Reconcile the database",
|
|
@@ -215,4 +215,4 @@ function errorRuntime(code, summary, options) {
|
|
|
215
215
|
//#endregion
|
|
216
216
|
export { errorHashMismatch as a, errorMarkerRequired as c, errorRuntime as d, errorSchemaVerificationFailed as f, withMarkerReadErrorHandling as g, rethrowMarkerReadError as h, errorDestructiveChanges as i, errorMarkerRowCorrupt as l, parseMarkerRowSafely as m, ERROR_CODE_DESTRUCTIVE_CHANGES as n, errorMarkerMissing as o, errorTargetMismatch as p, errorConsentPlanMismatch as r, errorMarkerReadFailed as s, ERROR_CODE_CONSENT_PLAN_MISMATCH as t, errorRunnerFailed as u };
|
|
217
217
|
|
|
218
|
-
//# sourceMappingURL=execution-
|
|
218
|
+
//# sourceMappingURL=execution-Dd7goUCC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-Dd7goUCC.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-dcFIOWpk.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/execution.ts\n/**\n* Contract marker not found in database.\n*/\nfunction errorMarkerMissing(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISSING\", \"Database not signed\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: \"Run `prisma db sign --db <url>` to sign the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db sign --db <url>\"\n\t\t}]\n\t});\n}\n/**\n* Contract hash does not match database marker.\n*/\nfunction errorHashMismatch(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISMATCH\", \"Hash mismatch\", {\n\t\twhy: options?.why ?? \"Contract hash does not match database marker\",\n\t\tfix: \"Migrate database or re-sign if intentional\",\n\t\t...options?.expected !== void 0 || options?.actual !== void 0 ? { meta: {\n\t\t\t...ifDefined(\"expected\", options?.expected),\n\t\t\t...ifDefined(\"actual\", options?.actual)\n\t\t} } : {}\n\t});\n}\n/**\n* Contract target does not match config target.\n*/\nfunction errorTargetMismatch(expected, actual, options) {\n\treturn new CliStructuredError(\"CONTRACT.TARGET_MISMATCH\", \"Target mismatch\", {\n\t\twhy: options?.why ?? `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,\n\t\tfix: \"Align contract target and config target\",\n\t\tmeta: {\n\t\t\texpected,\n\t\t\tactual\n\t\t}\n\t});\n}\n/**\n* Marker row exists but column values fail schema validation.\n*/\nfunction errorMarkerRowCorrupt(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_ROW_CORRUPT\", \"Marker row is corrupt or incompatible\", {\n\t\twhy: options.why,\n\t\tfix: `The ${options.markerLocation} row for space \"${options.space}\" contains invalid data. Delete the row, then run \\`prisma db sign --db <url>\\` to write a fresh marker.`,\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Write a fresh marker\",\n\t\t\tcommand: \"{bin} db sign --db <url>\",\n\t\t\treason: `Delete the invalid ${options.markerLocation} row for space \"${options.space}\" first — this command then writes a valid one.`\n\t\t}],\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/**\n* Driver-level failure while reading the contract marker table.\n*/\nfunction errorMarkerReadFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_READ_FAILED\", \"Database error while reading contract marker\", {\n\t\twhy: options.why,\n\t\tfix: `Could not read marker at ${options.markerLocation} for space \"${options.space}\". Verify read permissions, connectivity, and locks, then retry.`,\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction isMarkerRowParseError(err) {\n\treturn err instanceof Error && (err.message.startsWith(\"Invalid contract marker row:\") || err.message.startsWith(\"Invalid marker doc on\"));\n}\nfunction isLegacyMarkerShapeReadError(message) {\n\tconst normalized = message.toLowerCase();\n\treturn normalized.includes(\"column \\\"space\\\" does not exist\") || normalized.includes(\"no such column: space\");\n}\nfunction errorLegacyMarkerShape(options) {\n\treturn errorRunnerFailed(`Legacy marker-table shape detected on ${options.markerLocation} (no \\`space\\` column). Prisma Next is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \\`${options.markerLocation}\\` and re-run \\`prisma db init\\` to reinitialise from a clean baseline.`, {\n\t\twhy: options.why,\n\t\tfix: \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma db init` to recreate it with the current per-space schema.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reinitialise the marker table from a clean baseline\",\n\t\t\tcommand: \"{bin} db init\",\n\t\t\treason: `Drop \\`${options.markerLocation}\\` first — it has the legacy shape (no \\`space\\` column) and this command recreates it with the current per-space schema.`\n\t\t}],\n\t\tmeta: { runnerErrorCode: \"MIGRATION.LEGACY_MARKER_SHAPE\" },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction rethrowMarkerReadError(err, context) {\n\tif (CliStructuredError.is(err)) throw err;\n\tif (isMarkerRowParseError(err)) throw errorMarkerRowCorrupt({\n\t\twhy: err.message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tconst message = err instanceof Error ? err.message : String(err);\n\tif (isLegacyMarkerShapeReadError(message)) throw errorLegacyMarkerShape({\n\t\twhy: message,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tthrow errorMarkerReadFailed({\n\t\twhy: message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n}\nasync function withMarkerReadErrorHandling(operation, context) {\n\ttry {\n\t\treturn await operation();\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\nfunction parseMarkerRowSafely(row, parse, context) {\n\ttry {\n\t\treturn parse(row);\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\n/**\n* Database marker is required but not found.\n* Used by commands that require a pre-existing marker as a precondition.\n*/\nfunction errorMarkerRequired(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_REQUIRED\", \"Database must be signed first\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: options?.fix ?? \"Run `prisma db init` first to sign the database\",\n\t\tnextActions: options?.nextActions ?? [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db init\"\n\t\t}]\n\t});\n}\n/**\n* Schema verification found mismatches between the database and the contract.\n* The full verification result is preserved in `meta.verificationResult`.\n*/\nfunction errorSchemaVerificationFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.SCHEMA_VERIFICATION_FAILED\", options.summary, {\n\t\twhy: \"Database schema does not satisfy the contract\",\n\t\tfix: \"Run `prisma db update` to reconcile, or adjust your contract to match the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reconcile the database\",\n\t\t\tcommand: \"{bin} db update\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Adjust your contract to match the database\"\n\t\t}],\n\t\tmeta: {\n\t\t\tverificationResult: options.verificationResult,\n\t\t\t...ifDefined(\"issues\", options.issues)\n\t\t}\n\t});\n}\n/**\n* Migration runner failed during execution.\n*/\nfunction errorRunnerFailed(summary, options) {\n\treturn new CliStructuredError(\"MIGRATION.RUNNER_FAILED\", summary, {\n\t\twhy: options?.why ?? \"Migration runner failed\",\n\t\tfix: options?.fix ?? \"Inspect the reported conflict and reconcile schema drift\",\n\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t...options?.meta ? { meta: options.meta } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/** Error code for destructive changes that require explicit confirmation. */\nconst ERROR_CODE_DESTRUCTIVE_CHANGES = \"MIGRATION.DESTRUCTIVE_CHANGES\";\n/**\n* Destructive operations require explicit confirmation via -y/--yes.\n*/\nfunction errorDestructiveChanges(summary, options) {\n\treturn new CliStructuredError(ERROR_CODE_DESTRUCTIVE_CHANGES, summary, {\n\t\twhy: options?.why ?? \"Planned operations include destructive changes that require confirmation\",\n\t\tfix: options?.fix ?? \"Re-run with `-y` to apply, or use `--dry-run` to preview first\",\n\t\t...options?.meta ? { meta: options.meta } : {}\n\t});\n}\nconst ERROR_CODE_CONSENT_PLAN_MISMATCH = \"MIGRATION.CONSENT_PLAN_MISMATCH\";\n/**\n* An apply carrying consent was refused because the plan recomputed for it is\n* not the plan that was consented to.\n*/\nfunction errorConsentPlanMismatch(options) {\n\treturn new CliStructuredError(ERROR_CODE_CONSENT_PLAN_MISMATCH, \"The plan changed between consent and apply\", {\n\t\twhy: options.why ?? \"The plan recomputed for the consented apply is not the plan that was consented to, so applying it could destroy something nobody agreed to.\",\n\t\tfix: \"Re-run the command and review the freshly planned operations before consenting again\",\n\t\tmeta: {\n\t\t\tconsentedPlanHash: options.consentedPlanHash,\n\t\t\tplanHash: options.planHash\n\t\t}\n\t});\n}\n/**\n* Generic runtime error carrying a caller-provided dotted code.\n*/\nfunction errorRuntime(code, summary, options) {\n\treturn new CliStructuredError(code, summary, {\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };\n\n//# sourceMappingURL=execution.mjs.map"],"mappings":";;;;;;AAMA,SAAS,mBAAmB,SAAS;CACpC,OAAO,IAAI,mBAAmB,2BAA2B,uBAAuB;EAC/E,KAAK,SAAS,OAAO;EACrB,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,SAAS;EACV,CAAC;CACF,CAAC;AACF;;;;AAIA,SAAS,kBAAkB,SAAS;CACnC,OAAO,IAAI,mBAAmB,4BAA4B,iBAAiB;EAC1E,KAAK,SAAS,OAAO;EACrB,KAAK;EACL,GAAG,SAAS,aAAa,KAAK,KAAK,SAAS,WAAW,KAAK,IAAI,EAAE,MAAM;GACvE,GAAG,UAAU,YAAY,SAAS,QAAQ;GAC1C,GAAG,UAAU,UAAU,SAAS,MAAM;EACvC,EAAE,IAAI,CAAC;CACR,CAAC;AACF;;;;AAIA,SAAS,oBAAoB,UAAU,QAAQ,SAAS;CACvD,OAAO,IAAI,mBAAmB,4BAA4B,mBAAmB;E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AIA,SAAS,kBAAkB,SAAS,SAAS;CAC5C,OAAO,IAAI,mBAAmB,2BAA2B,SAAS;EACjE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,UAAU,eAAe,SAAS,WAAW;EAChD,GAAG,SAAS,OAAO,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC;EAC7C,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF;;AAEA,MAAM,iCAAiC;;;;AAIvC,SAAS,wBAAwB,SAAS,SAAS;CAClD,OAAO,IAAI,mBAAmB,gCAAgC,SAAS;EACtE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,SAAS,OAAO,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC;CAC9C,CAAC;AACF;AACA,MAAM,mCAAmC;;;;;AAKzC,SAAS,yBAAyB,SAAS;CAC1C,OAAO,IAAI,mBAAmB,kCAAkC,8CAA8C;EAC7G,KAAK,QAAQ,OAAO;EACpB,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,UAAU,QAAQ;EACnB;CACD,CAAC;AACF;;;;AAIA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,IAAI,mBAAmB,MAAM,SAAS;EAC5C,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,QAAQ,SAAS,IAAI;EAClC,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CliStructuredError } from "./control-
|
|
1
|
+
import { t as CliStructuredError } from "./control-dcFIOWpk-BLVmTGhh.mjs";
|
|
2
2
|
//#region ../../../1-framework/1-core/errors/dist/migration.mjs
|
|
3
3
|
/**
|
|
4
4
|
* A scaffolded migration contains a placeholder slot that was never filled in.
|
|
@@ -57,7 +57,7 @@ function errorDataTransformContractMismatch(options) {
|
|
|
57
57
|
function errorMigrationFileMissing(dir) {
|
|
58
58
|
return new CliStructuredError("MIGRATION.FILE_MISSING", "migration.ts not found", {
|
|
59
59
|
why: `No migration.ts file was found at "${dir}"`,
|
|
60
|
-
fix: "Scaffold one with `prisma
|
|
60
|
+
fix: "Scaffold one with `prisma migration new` or `prisma migration plan`.",
|
|
61
61
|
nextActions: [{
|
|
62
62
|
kind: "run-command",
|
|
63
63
|
label: "Scaffold an empty migration",
|
|
@@ -124,4 +124,4 @@ function errorMigrationPlanNotArray(dir, actualValueDescription) {
|
|
|
124
124
|
//#endregion
|
|
125
125
|
export { errorMigrationTargetMismatch as a, errorMigrationPlanNotArray as i, errorMigrationFileMissing as n, errorUnfilledPlaceholder as o, errorMigrationInvalidDefaultExport as r, placeholder as s, errorDataTransformContractMismatch as t };
|
|
126
126
|
|
|
127
|
-
//# sourceMappingURL=migration-
|
|
127
|
+
//# sourceMappingURL=migration-DjAbwcyQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-DjAbwcyQ.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-dcFIOWpk.mjs\";\n//#region src/migration.ts\n/**\n* A scaffolded migration contains a placeholder slot that was never filled in.\n*\n* Thrown at emit time (when `check.source()` or `run()` is invoked) via the\n* `placeholder(...)` utility. The `slot` identifies the exact location the\n* author still needs to edit, e.g. `\"backfill-product-status:check.source\"`.\n*/\nfunction errorUnfilledPlaceholder(slot) {\n\treturn new CliStructuredError(\"MIGRATION.UNFILLED_PLACEHOLDER\", \"Unfilled migration placeholder\", {\n\t\twhy: `The migration contains a placeholder that has not been filled in: ${slot}`,\n\t\tfix: \"Open migration.ts and replace the `placeholder(...)` call with your actual query.\",\n\t\tmeta: { slot }\n\t});\n}\n/**\n* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't\n* emit a real query and the author is expected to fill one in. Always throws\n* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).\n*\n* The return type `never` makes it assignable to any expected return type, so\n* a scaffolded `() => placeholder('...')` satisfies signatures like\n* `() => MongoQueryPlan` without polluting them with a sentinel union arm.\n*/\nfunction placeholder(slot) {\n\tthrow errorUnfilledPlaceholder(slot);\n}\n/**\n* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose\n* `meta.storageHash` does not match the `endContract.storage.storageHash` it\n* was configured with. This almost always means the user's query-builder\n* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)\n* was instantiated from a different contract reference than the one passed\n* to `dataTransform(endContract, …)`.\n*\n* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which\n* rejects a plan at runtime execution; this is an authoring-time rejection\n* so it lives in the `MIGRATION` namespace.\n*/\nfunction errorDataTransformContractMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH\", \"dataTransform query plan built against wrong contract\", {\n\t\twhy: `Data transform \"${options.dataTransformName}\" produced a query plan whose storage hash (${options.actual}) does not match the migration's contract (${options.expected}). The query builder was configured with a different contract than the one passed to dataTransform(endContract, ...).`,\n\t\tfix: \"Ensure the `endContract` imported at module scope (used for both `dataTransform(endContract, …)` and `sql({ context: createExecutionContext({ contract: endContract, … }) })`) is the same reference.\",\n\t\tmeta: {\n\t\t\tdataTransformName: options.dataTransformName,\n\t\t\texpected: options.expected,\n\t\t\tactual: options.actual\n\t\t}\n\t});\n}\n/**\n* `migration.ts` was expected at the given package directory but could not be\n* located. Thrown when consumers attempt to read a migration package that is\n* missing its source file.\n*/\nfunction errorMigrationFileMissing(dir) {\n\treturn new CliStructuredError(\"MIGRATION.FILE_MISSING\", \"migration.ts not found\", {\n\t\twhy: `No migration.ts file was found at \"${dir}\"`,\n\t\tfix: \"Scaffold one with `prisma migration new` or `prisma migration plan`.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold an empty migration\",\n\t\t\tcommand: \"{bin} migration new\"\n\t\t}, {\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold a migration from a contract diff\",\n\t\t\tcommand: \"{bin} migration plan\"\n\t\t}],\n\t\tmeta: { dir }\n\t});\n}\n/**\n* The `migration.ts` at the given package directory does not default-export a\n* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a\n* factory function returning a `MigrationPlan`-shaped object (with at least\n* an `operations` array, plus `targetId` and `destination`). Thrown when the\n* default export is missing, is not a constructor/function, does not extend\n* `Migration`, or (for factory functions) returns a value that is not\n* `MigrationPlan`-shaped.\n*/\nfunction errorMigrationInvalidDefaultExport(dir, actualExportDescription) {\n\treturn new CliStructuredError(\"MIGRATION.INVALID_DEFAULT_EXPORT\", \"migration.ts default export is not a valid migration\", {\n\t\twhy: actualExportDescription !== void 0 ? `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object; got ${actualExportDescription}` : `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object.`,\n\t\tfix: \"Use `export default class extends Migration { ... }` or `export default () => ({ targetId, destination, operations })`.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {}\n\t\t}\n\t});\n}\n/**\n* The migration class declares one `targetId` but the loaded\n* `prisma.config.ts` declares another. Thrown by `MigrationCLI.run`\n* when a migration script is invoked against a config whose target\n* descriptor disagrees with the migration's own `targetId`. Distinct from generic\n* config-validation errors because the mismatch is between two valid\n* artifacts (the script and the config), not a malformed input.\n*/\nfunction errorMigrationTargetMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_MISMATCH\", \"Migration target does not match config target\", {\n\t\twhy: `This migration is for target \"${options.migrationTargetId}\" but the loaded prisma.config.ts declares target \"${options.configTargetId}\". The migration script can only be run against a config that targets the same database.`,\n\t\tfix: \"Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.\",\n\t\tmeta: {\n\t\t\tmigrationTargetId: options.migrationTargetId,\n\t\t\tconfigTargetId: options.configTargetId\n\t\t}\n\t});\n}\n/**\n* A `Migration.operations` getter returned a value that is not an array. Used\n* by emit capabilities after instantiating the authored migration.\n*/\nfunction errorMigrationPlanNotArray(dir, actualValueDescription) {\n\treturn new CliStructuredError(\"MIGRATION.PLAN_NOT_ARRAY\", \"Migration.operations must be an array of operations\", {\n\t\twhy: actualValueDescription !== void 0 ? `Migration.operations for migration.ts at \"${dir}\" was ${actualValueDescription}; an array of operations is required.` : `Migration.operations for migration.ts at \"${dir}\" is not an array of operations.`,\n\t\tfix: \"Ensure your `operations` getter returns an array of operations; see the data-migrations authoring guide.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {}\n\t\t}\n\t});\n}\n//#endregion\nexport { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,OAAO,IAAI,mBAAmB,kCAAkC,kCAAkC;EACjG,KAAK,qEAAqE;EAC1E,KAAK;EACL,MAAM,EAAE,KAAK;CACd,CAAC;AACF;;;;;;;;;;AAUA,SAAS,YAAY,MAAM;CAC1B,MAAM,yBAAyB,IAAI;AACpC;;;;;;;;;;;;;AAaA,SAAS,mCAAmC,SAAS;CACpD,OAAO,IAAI,mBAAmB,8CAA8C,yDAAyD;EACpI,KAAK,mBAAmB,QAAQ,kBAAkB,8CAA8C,QAAQ,OAAO,6CAA6C,QAAQ,SAAS;EAC7K,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,UAAU,QAAQ;GAClB,QAAQ,QAAQ;EACjB;CACD,CAAC;AACF;;;;;;AAMA,SAAS,0BAA0B,KAAK;CACvC,OAAO,IAAI,mBAAmB,0BAA0B,0BAA0B;EACjF,KAAK,sCAAsC,IAAI;EAC/C,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,SAAS;EACV,GAAG;GACF,MAAM;GACN,OAAO;GACP,SAAS;EACV,CAAC;EACD,MAAM,EAAE,IAAI;CACb,CAAC;AACF;;;;;;;;;;AAUA,SAAS,mCAAmC,KAAK,yBAAyB;CACzE,OAAO,IAAI,mBAAmB,oCAAoC,wDAAwD;EACzH,KAAK,4BAA4B,KAAK,IAAI,oBAAoB,IAAI,gHAAgH,4BAA4B,oBAAoB,IAAI;EACtO,KAAK;EACL,MAAM;GACL;GACA,GAAG,4BAA4B,KAAK,IAAI,EAAE,cAAc,wBAAwB,IAAI,CAAC;EACtF;CACD,CAAC;AACF;;;;;;;;;AASA,SAAS,6BAA6B,SAAS;CAC9C,OAAO,IAAI,mBAAmB,6BAA6B,iDAAiD;EAC3G,KAAK,iCAAiC,QAAQ,kBAAkB,qDAAqD,QAAQ,eAAe;EAC5I,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,gBAAgB,QAAQ;EACzB;CACD,CAAC;AACF;;;;;AAKA,SAAS,2BAA2B,KAAK,wBAAwB;CAChE,OAAO,IAAI,mBAAmB,4BAA4B,uDAAuD;EAChH,KAAK,2BAA2B,KAAK,IAAI,6CAA6C,IAAI,QAAQ,uBAAuB,yCAAyC,6CAA6C,IAAI;EACnN,KAAK;EACL,MAAM;GACL;GACA,GAAG,2BAA2B,KAAK,IAAI,EAAE,aAAa,uBAAuB,IAAI,CAAC;EACnF;CACD,CAAC;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Contract } from "./contract-types-CkdMH7F7-9EHXSwbH.mjs";
|
|
2
2
|
import { r as Result } from "./result-Bpupv5vO.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { c as ContractSourceProvider, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, r as ContractSourceDiagnostic } from "./config-types-CBV5U5IX.mjs";
|
|
4
4
|
import { I as SourceFile, d as DocumentAst } from "./parse-0ZJjj_2N-DhQpSVmQ.mjs";
|
|
5
5
|
import { f as SymbolTable } from "./symbol-table-CZ7EVCTL-CR-ncCpD.mjs";
|
|
6
6
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/interpret.d.mts
|
package/dist/psl-printer.mjs
CHANGED
|
@@ -193,7 +193,7 @@ function formatFieldType(field) {
|
|
|
193
193
|
else if (field.optional) type += "?";
|
|
194
194
|
return type;
|
|
195
195
|
}
|
|
196
|
-
const DEFAULT_AST_PRINT_HEADER = "// use prisma-next\n// Contract inferred from the live database schema. Edit as needed, then run `prisma
|
|
196
|
+
const DEFAULT_AST_PRINT_HEADER = "// use prisma-next\n// Contract inferred from the live database schema. Edit as needed, then run `prisma contract emit`.";
|
|
197
197
|
function astDocumentToPrintDocument(ast) {
|
|
198
198
|
const allModels = flatPslModels(ast);
|
|
199
199
|
const sortedModels = topologicalSortModels(allModels, buildModelFkDeps(allModels, new Set(allModels.map((m) => m.name))));
|
package/dist/psl-printer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-printer.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-printer/dist/index.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID, flatPslModels, namespacePslExtensionBlocks } from \"@internal/framework-components/psl-ast\";\nimport { isAuthoringPslBlockDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/serialize-print-document.ts\n/**\n* Indent unit used for PSL block bodies and namespace nesting.\n*/\nconst PSL_INDENT_UNIT = \" \";\nfunction buildPslBlockDispatchMap(namespace) {\n\tconst byKeyword = /* @__PURE__ */ new Map();\n\tif (namespace) collectBlockDescriptors(namespace, byKeyword);\n\treturn { byKeyword };\n}\nfunction collectBlockDescriptors(namespace, byKeyword) {\n\tfor (const value of Object.values(namespace)) {\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tbyKeyword.set(value.keyword, value);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) collectBlockDescriptors(value, byKeyword);\n\t}\n}\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nfunction serializePrintDocument(doc, options = {}) {\n\tconst sections = [];\n\tsections.push(doc.headerComment);\n\tconst namedTypeEntries = [...doc.namedTypes].sort((a, b) => a.name.localeCompare(b.name));\n\tif (namedTypeEntries.length > 0) sections.push(serializeTypesBlock(namedTypeEntries));\n\tconst blockDispatchMap = buildPslBlockDispatchMap(options.pslBlockDescriptors);\n\tfor (const namespace of doc.namespaces) {\n\t\tconst namespaceSections = serializeNamespaceContents(namespace, blockDispatchMap, options.codecLookup);\n\t\tif (namespaceSections.length === 0) continue;\n\t\tif (namespace.name === UNSPECIFIED_PSL_NAMESPACE_ID) sections.push(...namespaceSections);\n\t\telse sections.push(wrapNamespaceBlock(namespace.name, namespaceSections));\n\t}\n\treturn `${sections.join(\"\\n\\n\")}\\n`;\n}\nfunction serializeNamespaceContents(namespace, blockDispatchMap, codecLookup) {\n\tconst sections = [];\n\tfor (const model of namespace.models) sections.push(serializeModel(model));\n\tfor (const extensionBlock of namespace.extensionBlocks) sections.push(serializeExtensionBlock(extensionBlock, blockDispatchMap, codecLookup));\n\treturn sections;\n}\nfunction serializeExtensionBlock(extensionBlock, blockDispatchMap, codecLookup) {\n\tconst descriptor = blockDispatchMap.byKeyword.get(extensionBlock.keyword);\n\tif (!descriptor) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `No pslBlockDescriptors contribution registered for extension-contributed block keyword \"${extensionBlock.keyword}\". Provide a matching pslBlockDescriptors contribution to serializePrintDocument, or remove the block from the input AST.`, { meta: {\n\t\treason: \"block-descriptor-missing\",\n\t\tkeyword: extensionBlock.keyword\n\t} });\n\tif (descriptor.discriminator !== extensionBlock.kind) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `The pslBlockDescriptors contribution for keyword \"${extensionBlock.keyword}\" owns discriminator \"${descriptor.discriminator}\", but the block carries kind \"${extensionBlock.kind}\". Provide a matching pslBlockDescriptors contribution to serializePrintDocument, or remove the block from the input AST.`, { meta: {\n\t\treason: \"block-descriptor-kind-mismatch\",\n\t\tkeyword: extensionBlock.keyword,\n\t\tdescriptorDiscriminator: descriptor.discriminator,\n\t\tblockKind: extensionBlock.kind\n\t} });\n\tconst lines = [`${extensionBlock.keyword} ${extensionBlock.name} {`];\n\tfor (const [paramName, paramDescriptor] of Object.entries(descriptor.parameters)) {\n\t\tconst paramValue = extensionBlock.parameters[paramName];\n\t\tif (paramValue === void 0) continue;\n\t\tconst rendered = renderParamValue(paramValue, paramDescriptor, codecLookup, paramName);\n\t\tlines.push(`${PSL_INDENT_UNIT}${paramName} = ${rendered}`);\n\t}\n\tif (descriptor.variadicParameters) for (const [paramName, paramValue] of Object.entries(extensionBlock.parameters)) {\n\t\tif (Object.hasOwn(descriptor.parameters, paramName)) continue;\n\t\tlines.push(`${PSL_INDENT_UNIT}${renderVariadicParam(paramName, paramValue)}`);\n\t}\n\tfor (const attr of extensionBlock.blockAttributes ?? []) {\n\t\tconst args = attr.args.map((arg) => arg.value).join(\", \");\n\t\tlines.push(`${PSL_INDENT_UNIT}@@${attr.name}${args.length > 0 ? `(${args})` : \"\"}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders one undeclared parameter of a `variadicParameters` block (e.g. a\n* `native_enum` member line). Variadic entries have no per-parameter\n* descriptor, so there is no codec to round-trip a `value` through — the raw\n* PSL literal is emitted verbatim. A `bare` entry is just its key.\n*/\nfunction renderVariadicParam(paramName, paramValue) {\n\tif (paramValue.kind === \"bare\") return paramName;\n\treturn `${paramName} = ${renderVariadicValue(paramValue)}`;\n}\nfunction renderVariadicValue(paramValue) {\n\tswitch (paramValue.kind) {\n\t\tcase \"bare\": return \"\";\n\t\tcase \"value\": return paramValue.raw;\n\t\tcase \"ref\": return paramValue.identifier;\n\t\tcase \"option\": return paramValue.token;\n\t\tcase \"list\": return `[${paramValue.items.map(renderVariadicValue).join(\", \")}]`;\n\t}\n}\nfunction renderParamValue(paramValue, descriptor, codecLookup, paramName) {\n\tswitch (descriptor.kind) {\n\t\tcase \"ref\":\n\t\t\tif (paramValue.kind !== \"ref\") throw paramKindMismatchError(paramName, \"ref\", paramValue.kind);\n\t\t\treturn paramValue.identifier;\n\t\tcase \"value\":\n\t\t\tif (paramValue.kind !== \"value\") throw paramKindMismatchError(paramName, \"value\", paramValue.kind);\n\t\t\treturn renderValueParam(paramValue.raw, descriptor.codecId, codecLookup, paramName);\n\t\tcase \"option\":\n\t\t\tif (paramValue.kind !== \"option\") throw paramKindMismatchError(paramName, \"option\", paramValue.kind);\n\t\t\treturn paramValue.token;\n\t\tcase \"list\":\n\t\t\tif (paramValue.kind !== \"list\") throw paramKindMismatchError(paramName, \"list\", paramValue.kind);\n\t\t\treturn `[${paramValue.items.map((item) => renderParamValue(item, descriptor.of, codecLookup, paramName)).join(\", \")}]`;\n\t}\n}\nfunction paramKindMismatchError(paramName, descriptorKind, valueKind) {\n\treturn contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": descriptor is \"${descriptorKind}\" but AST node has kind \"${valueKind}\"`, { meta: {\n\t\treason: \"param-kind-mismatch\",\n\t\tparamName,\n\t\tdescriptorKind,\n\t\tvalueKind\n\t} });\n}\nfunction renderValueParam(raw, codecId, codecLookup, paramName) {\n\tif (!codecLookup) return raw;\n\tconst codec = codecLookup.get(codecId);\n\tif (!codec) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": no codec registered for id \"${codecId}\"`, { meta: {\n\t\treason: \"codec-unregistered\",\n\t\tparamName,\n\t\tcodecId\n\t} });\n\tlet parsedJson;\n\ttry {\n\t\tparsedJson = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": codec \"${codecId}\" — raw literal is not valid JSON: ${String(e)}`, {\n\t\t\tmeta: {\n\t\t\t\treason: \"raw-literal-invalid-json\",\n\t\t\t\tparamName,\n\t\t\t\tcodecId\n\t\t\t},\n\t\t\tcause: e\n\t\t});\n\t}\n\treturn JSON.stringify(codec.encodeJson(codec.decodeJson(blindCast(parsedJson))));\n}\nfunction wrapNamespaceBlock(name, innerSections) {\n\treturn `namespace ${name} {\\n${innerSections.map((section) => section.split(\"\\n\").map((line) => line.length > 0 ? ` ${line}` : line).join(\"\\n\")).join(\"\\n\\n\")}\\n}`;\n}\nfunction serializeTypesBlock(namedTypes) {\n\tconst lines = [\"types {\"];\n\tfor (const nt of namedTypes) {\n\t\tconst attrStr = nt.attributes.length > 0 ? ` ${nt.attributes.join(\" \")}` : \"\";\n\t\tlines.push(` ${nt.name} = ${nt.baseType}${attrStr}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\nfunction serializeModel(model) {\n\tconst lines = [];\n\tif (model.comment) lines.push(model.comment);\n\tlines.push(`model ${model.name} {`);\n\tconst idFields = model.fields.filter((f) => f.isId);\n\tconst scalarFields = model.fields.filter((f) => !f.isId && !f.isRelation);\n\tconst relationFields = model.fields.filter((f) => f.isRelation);\n\tconst allOrderedFields = [\n\t\t...idFields,\n\t\t...scalarFields,\n\t\t...relationFields\n\t];\n\tif (allOrderedFields.length > 0) {\n\t\tconst maxNameLen = Math.max(...allOrderedFields.map((f) => f.name.length));\n\t\tconst maxTypeLen = Math.max(...allOrderedFields.map((f) => formatFieldType(f).length));\n\t\tfor (const field of allOrderedFields) {\n\t\t\tconst typePart = formatFieldType(field);\n\t\t\tconst paddedName = field.name.padEnd(maxNameLen);\n\t\t\tconst paddedType = typePart.padEnd(maxTypeLen);\n\t\t\tif (field.comment) lines.push(` ${field.comment}`);\n\t\t\tconst attrStr = field.attributes.length > 0 ? ` ${field.attributes.join(\" \")}` : \"\";\n\t\t\tlines.push(` ${paddedName} ${paddedType}${attrStr}`.trimEnd());\n\t\t}\n\t}\n\tif (model.modelAttributes.length > 0) {\n\t\tif (allOrderedFields.length > 0) lines.push(\"\");\n\t\tfor (const attr of model.modelAttributes) lines.push(` ${attr}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\nfunction formatFieldType(field) {\n\tlet type = field.typeName;\n\tif (field.list) type += \"[]\";\n\telse if (field.optional) type += \"?\";\n\treturn type;\n}\n//#endregion\n//#region src/ast-to-print-document.ts\nconst DEFAULT_AST_PRINT_HEADER = \"// use prisma-next\\n// Contract inferred from the live database schema. Edit as needed, then run `prisma-next contract emit`.\";\nfunction astDocumentToPrintDocument(ast) {\n\tconst allModels = flatPslModels(ast);\n\tconst sortedModels = topologicalSortModels(allModels, buildModelFkDeps(allModels, new Set(allModels.map((m) => m.name))));\n\tconst namedTypes = ast.types ? ast.types.declarations.map(namedTypeDeclarationToPrinterNamedType) : [];\n\tconst modelOrder = new Map(sortedModels.map((model, index) => [model.name, index]));\n\tconst sectionsByName = /* @__PURE__ */ new Map();\n\tfor (const namespace of ast.namespaces) {\n\t\tconst section = sectionsByName.get(namespace.name) ?? {\n\t\t\tmodels: /* @__PURE__ */ new Map(),\n\t\t\tblocks: /* @__PURE__ */ new Map()\n\t\t};\n\t\tfor (const model of namespace.models) section.models.set(model.name, model);\n\t\tfor (const block of namespacePslExtensionBlocks(namespace)) section.blocks.set(`${block.kind} ${block.name}`, block);\n\t\tsectionsByName.set(namespace.name, section);\n\t}\n\tconst unranked = sortedModels.length;\n\tconst namespaceSections = [...sectionsByName].map(([name, section]) => ({\n\t\tname,\n\t\tmodels: [...section.models.values()].sort((a, b) => (modelOrder.get(a.name) ?? unranked) - (modelOrder.get(b.name) ?? unranked)).map((m) => modelToPrinterModel(m)),\n\t\textensionBlocks: [...section.blocks.values()]\n\t}));\n\tnamespaceSections.sort((a, b) => {\n\t\tif (a.name === b.name) return 0;\n\t\tif (a.name === UNSPECIFIED_PSL_NAMESPACE_ID) return -1;\n\t\tif (b.name === UNSPECIFIED_PSL_NAMESPACE_ID) return 1;\n\t\treturn a.name < b.name ? -1 : 1;\n\t});\n\treturn {\n\t\theaderComment: DEFAULT_AST_PRINT_HEADER,\n\t\tnamedTypes,\n\t\tnamespaces: namespaceSections\n\t};\n}\nfunction renderPslAttribute(attr) {\n\tconst prefix = attr.target === \"model\" || attr.target === \"enum\" ? \"@@\" : \"@\";\n\tif (attr.args.length === 0) return `${prefix}${attr.name}`;\n\tconst inner = attr.args.map(renderAttributeArgument).join(\", \");\n\treturn `${prefix}${attr.name}(${inner})`;\n}\nfunction renderAttributeArgument(arg) {\n\tif (arg.kind === \"positional\") return arg.value;\n\treturn `${arg.name}: ${arg.value}`;\n}\nfunction namedTypeDeclarationToPrinterNamedType(decl) {\n\tconst base = decl.baseType ?? (decl.typeConstructor !== void 0 ? formatTypeConstructor(decl.typeConstructor) : \"\");\n\tconst attributes = decl.attributes.map(renderPslAttribute);\n\treturn {\n\t\tname: decl.name,\n\t\tbaseType: base,\n\t\tattributes\n\t};\n}\nfunction formatTypeConstructor(tc) {\n\tconst path = tc.path.join(\".\");\n\tif (tc.args.length === 0) return path;\n\treturn `${path}(${tc.args.map(renderAttributeArgument).join(\", \")})`;\n}\nfunction getPositionalStringArg(attr, index) {\n\tconst raw = attr.args.filter((a) => a.kind === \"positional\")[index]?.value.trim();\n\tif (!raw) return void 0;\n\tconst m = raw.match(/^(['\"])(.*)\\1$/);\n\tif (!m) return void 0;\n\treturn unescapePslString(m[2]);\n}\n/**\n* Inverse of `escapePslString`. The parser stores quoted-literal arguments with\n* their PSL escape sequences (`\\\\`, `\\\"`, `\\n`, `\\r`) intact; when we round-trip\n* a value through `getPositionalStringArg` and re-render via `escapePslString`,\n* we must decode it once on extraction to avoid double-escaping the same\n* sequences on output.\n*/\nfunction unescapePslString(value) {\n\tlet result = \"\";\n\tfor (let i = 0; i < value.length; i++) {\n\t\tif (value.charCodeAt(i) !== 92 || i + 1 >= value.length) {\n\t\t\tresult += value[i];\n\t\t\tcontinue;\n\t\t}\n\t\tconst next = value[i + 1];\n\t\tif (next === \"\\\\\" || next === \"\\\"\" || next === \"'\") result += next;\n\t\telse if (next === \"n\") result += \"\\n\";\n\t\telse if (next === \"r\") result += \"\\r\";\n\t\telse {\n\t\t\tresult += \"\\\\\";\n\t\t\tresult += next;\n\t\t}\n\t\ti++;\n\t}\n\treturn result;\n}\nfunction modelToPrinterModel(model) {\n\tlet mapName;\n\tconst modelAttrStrings = [];\n\tfor (const a of model.attributes) {\n\t\tif (a.name === \"map\" && a.target === \"model\") {\n\t\t\tmapName = getPositionalStringArg(a, 0) ?? mapName;\n\t\t\tcontinue;\n\t\t}\n\t\tmodelAttrStrings.push(renderPslAttribute(a));\n\t}\n\tif (mapName !== void 0) modelAttrStrings.push(`@@map(\"${escapePslString(mapName)}\")`);\n\tconst printerFields = model.fields.map((f) => fieldToPrinterField(f));\n\treturn {\n\t\tname: model.name,\n\t\tmapName,\n\t\tfields: printerFields,\n\t\tmodelAttributes: modelAttrStrings,\n\t\tcomment: model.comment\n\t};\n}\n/**\n* Assembles the qualified type name string for a field type reference.\n*\n* Handles all four forms:\n* - `space:ns.Name` — typeContractSpaceId + typeNamespaceId + typeName\n* - `space:Name` — typeContractSpaceId + typeName (no namespace)\n* - `ns.Name` — typeNamespaceId + typeName (no space); fixes TML-2459 printer gap\n* - `Name` — typeName only (no qualifier)\n*/\nfunction assembleQualifiedTypeName(field) {\n\tconst { typeName, typeNamespaceId, typeContractSpaceId } = field;\n\tconst dotted = typeNamespaceId !== void 0 ? `${typeNamespaceId}.${typeName}` : typeName;\n\treturn typeContractSpaceId !== void 0 ? `${typeContractSpaceId}:${dotted}` : dotted;\n}\nfunction fieldToPrinterField(field) {\n\tconst typeName = field.typeConstructor !== void 0 ? formatTypeConstructor(field.typeConstructor) : assembleQualifiedTypeName(field);\n\tlet mapName;\n\tconst attrStrings = [];\n\tfor (const a of field.attributes) {\n\t\tif (a.name === \"map\" && a.target === \"field\") {\n\t\t\tmapName = getPositionalStringArg(a, 0) ?? mapName;\n\t\t\tcontinue;\n\t\t}\n\t\tattrStrings.push(renderPslAttribute(a));\n\t}\n\tif (mapName !== void 0) attrStrings.push(`@map(\"${escapePslString(mapName)}\")`);\n\tconst isRelation = field.attributes.some((a) => a.name === \"relation\" && a.target === \"field\");\n\tconst isUnsupported = typeName.startsWith(\"Unsupported(\");\n\tconst isId = field.attributes.some((a) => a.name === \"id\" && a.target === \"field\");\n\treturn {\n\t\tname: field.name,\n\t\ttypeName,\n\t\toptional: field.optional,\n\t\tlist: field.list,\n\t\tattributes: attrStrings,\n\t\tmapName,\n\t\tisId,\n\t\tisRelation,\n\t\tisUnsupported,\n\t\tcomment: void 0\n\t};\n}\nfunction buildModelFkDeps(models, modelNames) {\n\tconst deps = /* @__PURE__ */ new Map();\n\tfor (const m of models) deps.set(m.name, /* @__PURE__ */ new Set());\n\tfor (const m of models) for (const field of m.fields) {\n\t\tconst refModel = relationReferencedModel(field, modelNames);\n\t\tif (!refModel || refModel === m.name) continue;\n\t\tif (!hasFullRelation(field)) continue;\n\t\tdeps.get(m.name).add(refModel);\n\t}\n\treturn deps;\n}\nfunction hasFullRelation(field) {\n\tconst rel = field.attributes.find((a) => a.name === \"relation\" && a.target === \"field\");\n\tif (!rel) return false;\n\tconst named = Object.fromEntries(rel.args.filter((a) => a.kind === \"named\").map((a) => [a.name, a.value.trim()]));\n\treturn named[\"fields\"] !== void 0 && named[\"references\"] !== void 0;\n}\nfunction relationReferencedModel(field, modelNames) {\n\tconst raw = field.typeConstructor?.path[0] ?? field.typeName.replace(/\\?$/, \"\").replace(/\\[\\]$/, \"\");\n\tif (raw.length === 0) return;\n\treturn modelNames.has(raw) ? raw : void 0;\n}\nfunction topologicalSortModels(models, deps) {\n\tconst byName = new Map(models.map((m) => [m.name, m]));\n\tconst result = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst sortedNames = [...deps.keys()].sort();\n\tfunction visit(name) {\n\t\tif (visited.has(name)) return;\n\t\tif (visiting.has(name)) return;\n\t\tvisiting.add(name);\n\t\tconst sortedDeps = [...deps.get(name) ?? /* @__PURE__ */ new Set()].sort();\n\t\tfor (const dep of sortedDeps) visit(dep);\n\t\tvisiting.delete(name);\n\t\tvisited.add(name);\n\t\tconst model = byName.get(name);\n\t\tif (model) result.push(model);\n\t}\n\tfor (const name of sortedNames) visit(name);\n\treturn result;\n}\n//#endregion\n//#region src/print-psl.ts\nfunction printPslFromAst(ast, options = {}) {\n\treturn serializePrintDocument(astDocumentToPrintDocument(ast), {\n\t\t...ifDefined(\"pslBlockDescriptors\", options.pslBlockDescriptors),\n\t\t...ifDefined(\"codecLookup\", options.codecLookup)\n\t});\n}\n//#endregion\nexport { printPslFromAst as printPsl };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;AAMA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,MAAM,kBAAkB;AACxB,SAAS,yBAAyB,WAAW;CAC5C,MAAM,4BAA4B,IAAI,IAAI;CAC1C,IAAI,WAAW,wBAAwB,WAAW,SAAS;CAC3D,OAAO,EAAE,UAAU;AACpB;AACA,SAAS,wBAAwB,WAAW,WAAW;CACtD,KAAK,MAAM,SAAS,OAAO,OAAO,SAAS,GAAG;EAC7C,IAAI,8BAA8B,KAAK,GAAG;GACzC,UAAU,IAAI,MAAM,SAAS,KAAK;GA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,SAAS,EAAE;CACnG,IAAI,IAAI,WAAW,GAAG;CACtB,OAAO,WAAW,IAAI,GAAG,IAAI,MAAM,KAAK;AACzC;AACA,SAAS,sBAAsB,QAAQ,MAAM;CAC5C,MAAM,SAAS,IAAI,IAAI,OAAO,KAAK,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD,MAAM,SAAS,CAAC;CAChB,MAAM,0BAA0B,IAAI,IAAI;CACxC,MAAM,2BAA2B,IAAI,IAAI;CACzC,MAAM,cAAc,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK;CAC1C,SAAS,MAAM,MAAM;EACpB,IAAI,QAAQ,IAAI,IAAI,GAAG;EACvB,IAAI,SAAS,IAAI,IAAI,GAAG;EACxB,SAAS,IAAI,IAAI;EACjB,MAAM,aAAa,CAAC,GAAG,KAAK,IAAI,IAAI,qBAAqB,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK;EACzE,KAAK,MAAM,OAAO,YAAY,MAAM,GAAG;EACvC,SAAS,OAAO,IAAI;EACpB,QAAQ,IAAI,IAAI;EAChB,MAAM,QAAQ,OAAO,IAAI,IAAI;EAC7B,IAAI,OAAO,OAAO,KAAK,KAAK;CAC7B;CACA,KAAK,MAAM,QAAQ,aAAa,MAAM,IAAI;CAC1C,OAAO;AACR;AAGA,SAAS,gBAAgB,KAAK,UAAU,CAAC,GAAG;CAC3C,OAAO,uBAAuB,2BAA2B,GAAG,GAAG;EAC9D,GAAG,UAAU,uBAAuB,QAAQ,mBAAmB;EAC/D,GAAG,UAAU,eAAe,QAAQ,WAAW;CAChD,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"psl-printer.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-printer/dist/index.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID, flatPslModels, namespacePslExtensionBlocks } from \"@internal/framework-components/psl-ast\";\nimport { isAuthoringPslBlockDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/serialize-print-document.ts\n/**\n* Indent unit used for PSL block bodies and namespace nesting.\n*/\nconst PSL_INDENT_UNIT = \" \";\nfunction buildPslBlockDispatchMap(namespace) {\n\tconst byKeyword = /* @__PURE__ */ new Map();\n\tif (namespace) collectBlockDescriptors(namespace, byKeyword);\n\treturn { byKeyword };\n}\nfunction collectBlockDescriptors(namespace, byKeyword) {\n\tfor (const value of Object.values(namespace)) {\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tbyKeyword.set(value.keyword, value);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) collectBlockDescriptors(value, byKeyword);\n\t}\n}\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nfunction serializePrintDocument(doc, options = {}) {\n\tconst sections = [];\n\tsections.push(doc.headerComment);\n\tconst namedTypeEntries = [...doc.namedTypes].sort((a, b) => a.name.localeCompare(b.name));\n\tif (namedTypeEntries.length > 0) sections.push(serializeTypesBlock(namedTypeEntries));\n\tconst blockDispatchMap = buildPslBlockDispatchMap(options.pslBlockDescriptors);\n\tfor (const namespace of doc.namespaces) {\n\t\tconst namespaceSections = serializeNamespaceContents(namespace, blockDispatchMap, options.codecLookup);\n\t\tif (namespaceSections.length === 0) continue;\n\t\tif (namespace.name === UNSPECIFIED_PSL_NAMESPACE_ID) sections.push(...namespaceSections);\n\t\telse sections.push(wrapNamespaceBlock(namespace.name, namespaceSections));\n\t}\n\treturn `${sections.join(\"\\n\\n\")}\\n`;\n}\nfunction serializeNamespaceContents(namespace, blockDispatchMap, codecLookup) {\n\tconst sections = [];\n\tfor (const model of namespace.models) sections.push(serializeModel(model));\n\tfor (const extensionBlock of namespace.extensionBlocks) sections.push(serializeExtensionBlock(extensionBlock, blockDispatchMap, codecLookup));\n\treturn sections;\n}\nfunction serializeExtensionBlock(extensionBlock, blockDispatchMap, codecLookup) {\n\tconst descriptor = blockDispatchMap.byKeyword.get(extensionBlock.keyword);\n\tif (!descriptor) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `No pslBlockDescriptors contribution registered for extension-contributed block keyword \"${extensionBlock.keyword}\". Provide a matching pslBlockDescriptors contribution to serializePrintDocument, or remove the block from the input AST.`, { meta: {\n\t\treason: \"block-descriptor-missing\",\n\t\tkeyword: extensionBlock.keyword\n\t} });\n\tif (descriptor.discriminator !== extensionBlock.kind) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `The pslBlockDescriptors contribution for keyword \"${extensionBlock.keyword}\" owns discriminator \"${descriptor.discriminator}\", but the block carries kind \"${extensionBlock.kind}\". Provide a matching pslBlockDescriptors contribution to serializePrintDocument, or remove the block from the input AST.`, { meta: {\n\t\treason: \"block-descriptor-kind-mismatch\",\n\t\tkeyword: extensionBlock.keyword,\n\t\tdescriptorDiscriminator: descriptor.discriminator,\n\t\tblockKind: extensionBlock.kind\n\t} });\n\tconst lines = [`${extensionBlock.keyword} ${extensionBlock.name} {`];\n\tfor (const [paramName, paramDescriptor] of Object.entries(descriptor.parameters)) {\n\t\tconst paramValue = extensionBlock.parameters[paramName];\n\t\tif (paramValue === void 0) continue;\n\t\tconst rendered = renderParamValue(paramValue, paramDescriptor, codecLookup, paramName);\n\t\tlines.push(`${PSL_INDENT_UNIT}${paramName} = ${rendered}`);\n\t}\n\tif (descriptor.variadicParameters) for (const [paramName, paramValue] of Object.entries(extensionBlock.parameters)) {\n\t\tif (Object.hasOwn(descriptor.parameters, paramName)) continue;\n\t\tlines.push(`${PSL_INDENT_UNIT}${renderVariadicParam(paramName, paramValue)}`);\n\t}\n\tfor (const attr of extensionBlock.blockAttributes ?? []) {\n\t\tconst args = attr.args.map((arg) => arg.value).join(\", \");\n\t\tlines.push(`${PSL_INDENT_UNIT}@@${attr.name}${args.length > 0 ? `(${args})` : \"\"}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Renders one undeclared parameter of a `variadicParameters` block (e.g. a\n* `native_enum` member line). Variadic entries have no per-parameter\n* descriptor, so there is no codec to round-trip a `value` through — the raw\n* PSL literal is emitted verbatim. A `bare` entry is just its key.\n*/\nfunction renderVariadicParam(paramName, paramValue) {\n\tif (paramValue.kind === \"bare\") return paramName;\n\treturn `${paramName} = ${renderVariadicValue(paramValue)}`;\n}\nfunction renderVariadicValue(paramValue) {\n\tswitch (paramValue.kind) {\n\t\tcase \"bare\": return \"\";\n\t\tcase \"value\": return paramValue.raw;\n\t\tcase \"ref\": return paramValue.identifier;\n\t\tcase \"option\": return paramValue.token;\n\t\tcase \"list\": return `[${paramValue.items.map(renderVariadicValue).join(\", \")}]`;\n\t}\n}\nfunction renderParamValue(paramValue, descriptor, codecLookup, paramName) {\n\tswitch (descriptor.kind) {\n\t\tcase \"ref\":\n\t\t\tif (paramValue.kind !== \"ref\") throw paramKindMismatchError(paramName, \"ref\", paramValue.kind);\n\t\t\treturn paramValue.identifier;\n\t\tcase \"value\":\n\t\t\tif (paramValue.kind !== \"value\") throw paramKindMismatchError(paramName, \"value\", paramValue.kind);\n\t\t\treturn renderValueParam(paramValue.raw, descriptor.codecId, codecLookup, paramName);\n\t\tcase \"option\":\n\t\t\tif (paramValue.kind !== \"option\") throw paramKindMismatchError(paramName, \"option\", paramValue.kind);\n\t\t\treturn paramValue.token;\n\t\tcase \"list\":\n\t\t\tif (paramValue.kind !== \"list\") throw paramKindMismatchError(paramName, \"list\", paramValue.kind);\n\t\t\treturn `[${paramValue.items.map((item) => renderParamValue(item, descriptor.of, codecLookup, paramName)).join(\", \")}]`;\n\t}\n}\nfunction paramKindMismatchError(paramName, descriptorKind, valueKind) {\n\treturn contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": descriptor is \"${descriptorKind}\" but AST node has kind \"${valueKind}\"`, { meta: {\n\t\treason: \"param-kind-mismatch\",\n\t\tparamName,\n\t\tdescriptorKind,\n\t\tvalueKind\n\t} });\n}\nfunction renderValueParam(raw, codecId, codecLookup, paramName) {\n\tif (!codecLookup) return raw;\n\tconst codec = codecLookup.get(codecId);\n\tif (!codec) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": no codec registered for id \"${codecId}\"`, { meta: {\n\t\treason: \"codec-unregistered\",\n\t\tparamName,\n\t\tcodecId\n\t} });\n\tlet parsedJson;\n\ttry {\n\t\tparsedJson = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension block parameter \"${paramName}\": codec \"${codecId}\" — raw literal is not valid JSON: ${String(e)}`, {\n\t\t\tmeta: {\n\t\t\t\treason: \"raw-literal-invalid-json\",\n\t\t\t\tparamName,\n\t\t\t\tcodecId\n\t\t\t},\n\t\t\tcause: e\n\t\t});\n\t}\n\treturn JSON.stringify(codec.encodeJson(codec.decodeJson(blindCast(parsedJson))));\n}\nfunction wrapNamespaceBlock(name, innerSections) {\n\treturn `namespace ${name} {\\n${innerSections.map((section) => section.split(\"\\n\").map((line) => line.length > 0 ? ` ${line}` : line).join(\"\\n\")).join(\"\\n\\n\")}\\n}`;\n}\nfunction serializeTypesBlock(namedTypes) {\n\tconst lines = [\"types {\"];\n\tfor (const nt of namedTypes) {\n\t\tconst attrStr = nt.attributes.length > 0 ? ` ${nt.attributes.join(\" \")}` : \"\";\n\t\tlines.push(` ${nt.name} = ${nt.baseType}${attrStr}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\nfunction serializeModel(model) {\n\tconst lines = [];\n\tif (model.comment) lines.push(model.comment);\n\tlines.push(`model ${model.name} {`);\n\tconst idFields = model.fields.filter((f) => f.isId);\n\tconst scalarFields = model.fields.filter((f) => !f.isId && !f.isRelation);\n\tconst relationFields = model.fields.filter((f) => f.isRelation);\n\tconst allOrderedFields = [\n\t\t...idFields,\n\t\t...scalarFields,\n\t\t...relationFields\n\t];\n\tif (allOrderedFields.length > 0) {\n\t\tconst maxNameLen = Math.max(...allOrderedFields.map((f) => f.name.length));\n\t\tconst maxTypeLen = Math.max(...allOrderedFields.map((f) => formatFieldType(f).length));\n\t\tfor (const field of allOrderedFields) {\n\t\t\tconst typePart = formatFieldType(field);\n\t\t\tconst paddedName = field.name.padEnd(maxNameLen);\n\t\t\tconst paddedType = typePart.padEnd(maxTypeLen);\n\t\t\tif (field.comment) lines.push(` ${field.comment}`);\n\t\t\tconst attrStr = field.attributes.length > 0 ? ` ${field.attributes.join(\" \")}` : \"\";\n\t\t\tlines.push(` ${paddedName} ${paddedType}${attrStr}`.trimEnd());\n\t\t}\n\t}\n\tif (model.modelAttributes.length > 0) {\n\t\tif (allOrderedFields.length > 0) lines.push(\"\");\n\t\tfor (const attr of model.modelAttributes) lines.push(` ${attr}`);\n\t}\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\nfunction formatFieldType(field) {\n\tlet type = field.typeName;\n\tif (field.list) type += \"[]\";\n\telse if (field.optional) type += \"?\";\n\treturn type;\n}\n//#endregion\n//#region src/ast-to-print-document.ts\nconst DEFAULT_AST_PRINT_HEADER = \"// use prisma-next\\n// Contract inferred from the live database schema. Edit as needed, then run `prisma contract emit`.\";\nfunction astDocumentToPrintDocument(ast) {\n\tconst allModels = flatPslModels(ast);\n\tconst sortedModels = topologicalSortModels(allModels, buildModelFkDeps(allModels, new Set(allModels.map((m) => m.name))));\n\tconst namedTypes = ast.types ? ast.types.declarations.map(namedTypeDeclarationToPrinterNamedType) : [];\n\tconst modelOrder = new Map(sortedModels.map((model, index) => [model.name, index]));\n\tconst sectionsByName = /* @__PURE__ */ new Map();\n\tfor (const namespace of ast.namespaces) {\n\t\tconst section = sectionsByName.get(namespace.name) ?? {\n\t\t\tmodels: /* @__PURE__ */ new Map(),\n\t\t\tblocks: /* @__PURE__ */ new Map()\n\t\t};\n\t\tfor (const model of namespace.models) section.models.set(model.name, model);\n\t\tfor (const block of namespacePslExtensionBlocks(namespace)) section.blocks.set(`${block.kind} ${block.name}`, block);\n\t\tsectionsByName.set(namespace.name, section);\n\t}\n\tconst unranked = sortedModels.length;\n\tconst namespaceSections = [...sectionsByName].map(([name, section]) => ({\n\t\tname,\n\t\tmodels: [...section.models.values()].sort((a, b) => (modelOrder.get(a.name) ?? unranked) - (modelOrder.get(b.name) ?? unranked)).map((m) => modelToPrinterModel(m)),\n\t\textensionBlocks: [...section.blocks.values()]\n\t}));\n\tnamespaceSections.sort((a, b) => {\n\t\tif (a.name === b.name) return 0;\n\t\tif (a.name === UNSPECIFIED_PSL_NAMESPACE_ID) return -1;\n\t\tif (b.name === UNSPECIFIED_PSL_NAMESPACE_ID) return 1;\n\t\treturn a.name < b.name ? -1 : 1;\n\t});\n\treturn {\n\t\theaderComment: DEFAULT_AST_PRINT_HEADER,\n\t\tnamedTypes,\n\t\tnamespaces: namespaceSections\n\t};\n}\nfunction renderPslAttribute(attr) {\n\tconst prefix = attr.target === \"model\" || attr.target === \"enum\" ? \"@@\" : \"@\";\n\tif (attr.args.length === 0) return `${prefix}${attr.name}`;\n\tconst inner = attr.args.map(renderAttributeArgument).join(\", \");\n\treturn `${prefix}${attr.name}(${inner})`;\n}\nfunction renderAttributeArgument(arg) {\n\tif (arg.kind === \"positional\") return arg.value;\n\treturn `${arg.name}: ${arg.value}`;\n}\nfunction namedTypeDeclarationToPrinterNamedType(decl) {\n\tconst base = decl.baseType ?? (decl.typeConstructor !== void 0 ? formatTypeConstructor(decl.typeConstructor) : \"\");\n\tconst attributes = decl.attributes.map(renderPslAttribute);\n\treturn {\n\t\tname: decl.name,\n\t\tbaseType: base,\n\t\tattributes\n\t};\n}\nfunction formatTypeConstructor(tc) {\n\tconst path = tc.path.join(\".\");\n\tif (tc.args.length === 0) return path;\n\treturn `${path}(${tc.args.map(renderAttributeArgument).join(\", \")})`;\n}\nfunction getPositionalStringArg(attr, index) {\n\tconst raw = attr.args.filter((a) => a.kind === \"positional\")[index]?.value.trim();\n\tif (!raw) return void 0;\n\tconst m = raw.match(/^(['\"])(.*)\\1$/);\n\tif (!m) return void 0;\n\treturn unescapePslString(m[2]);\n}\n/**\n* Inverse of `escapePslString`. The parser stores quoted-literal arguments with\n* their PSL escape sequences (`\\\\`, `\\\"`, `\\n`, `\\r`) intact; when we round-trip\n* a value through `getPositionalStringArg` and re-render via `escapePslString`,\n* we must decode it once on extraction to avoid double-escaping the same\n* sequences on output.\n*/\nfunction unescapePslString(value) {\n\tlet result = \"\";\n\tfor (let i = 0; i < value.length; i++) {\n\t\tif (value.charCodeAt(i) !== 92 || i + 1 >= value.length) {\n\t\t\tresult += value[i];\n\t\t\tcontinue;\n\t\t}\n\t\tconst next = value[i + 1];\n\t\tif (next === \"\\\\\" || next === \"\\\"\" || next === \"'\") result += next;\n\t\telse if (next === \"n\") result += \"\\n\";\n\t\telse if (next === \"r\") result += \"\\r\";\n\t\telse {\n\t\t\tresult += \"\\\\\";\n\t\t\tresult += next;\n\t\t}\n\t\ti++;\n\t}\n\treturn result;\n}\nfunction modelToPrinterModel(model) {\n\tlet mapName;\n\tconst modelAttrStrings = [];\n\tfor (const a of model.attributes) {\n\t\tif (a.name === \"map\" && a.target === \"model\") {\n\t\t\tmapName = getPositionalStringArg(a, 0) ?? mapName;\n\t\t\tcontinue;\n\t\t}\n\t\tmodelAttrStrings.push(renderPslAttribute(a));\n\t}\n\tif (mapName !== void 0) modelAttrStrings.push(`@@map(\"${escapePslString(mapName)}\")`);\n\tconst printerFields = model.fields.map((f) => fieldToPrinterField(f));\n\treturn {\n\t\tname: model.name,\n\t\tmapName,\n\t\tfields: printerFields,\n\t\tmodelAttributes: modelAttrStrings,\n\t\tcomment: model.comment\n\t};\n}\n/**\n* Assembles the qualified type name string for a field type reference.\n*\n* Handles all four forms:\n* - `space:ns.Name` — typeContractSpaceId + typeNamespaceId + typeName\n* - `space:Name` — typeContractSpaceId + typeName (no namespace)\n* - `ns.Name` — typeNamespaceId + typeName (no space); fixes TML-2459 printer gap\n* - `Name` — typeName only (no qualifier)\n*/\nfunction assembleQualifiedTypeName(field) {\n\tconst { typeName, typeNamespaceId, typeContractSpaceId } = field;\n\tconst dotted = typeNamespaceId !== void 0 ? `${typeNamespaceId}.${typeName}` : typeName;\n\treturn typeContractSpaceId !== void 0 ? `${typeContractSpaceId}:${dotted}` : dotted;\n}\nfunction fieldToPrinterField(field) {\n\tconst typeName = field.typeConstructor !== void 0 ? formatTypeConstructor(field.typeConstructor) : assembleQualifiedTypeName(field);\n\tlet mapName;\n\tconst attrStrings = [];\n\tfor (const a of field.attributes) {\n\t\tif (a.name === \"map\" && a.target === \"field\") {\n\t\t\tmapName = getPositionalStringArg(a, 0) ?? mapName;\n\t\t\tcontinue;\n\t\t}\n\t\tattrStrings.push(renderPslAttribute(a));\n\t}\n\tif (mapName !== void 0) attrStrings.push(`@map(\"${escapePslString(mapName)}\")`);\n\tconst isRelation = field.attributes.some((a) => a.name === \"relation\" && a.target === \"field\");\n\tconst isUnsupported = typeName.startsWith(\"Unsupported(\");\n\tconst isId = field.attributes.some((a) => a.name === \"id\" && a.target === \"field\");\n\treturn {\n\t\tname: field.name,\n\t\ttypeName,\n\t\toptional: field.optional,\n\t\tlist: field.list,\n\t\tattributes: attrStrings,\n\t\tmapName,\n\t\tisId,\n\t\tisRelation,\n\t\tisUnsupported,\n\t\tcomment: void 0\n\t};\n}\nfunction buildModelFkDeps(models, modelNames) {\n\tconst deps = /* @__PURE__ */ new Map();\n\tfor (const m of models) deps.set(m.name, /* @__PURE__ */ new Set());\n\tfor (const m of models) for (const field of m.fields) {\n\t\tconst refModel = relationReferencedModel(field, modelNames);\n\t\tif (!refModel || refModel === m.name) continue;\n\t\tif (!hasFullRelation(field)) continue;\n\t\tdeps.get(m.name).add(refModel);\n\t}\n\treturn deps;\n}\nfunction hasFullRelation(field) {\n\tconst rel = field.attributes.find((a) => a.name === \"relation\" && a.target === \"field\");\n\tif (!rel) return false;\n\tconst named = Object.fromEntries(rel.args.filter((a) => a.kind === \"named\").map((a) => [a.name, a.value.trim()]));\n\treturn named[\"fields\"] !== void 0 && named[\"references\"] !== void 0;\n}\nfunction relationReferencedModel(field, modelNames) {\n\tconst raw = field.typeConstructor?.path[0] ?? field.typeName.replace(/\\?$/, \"\").replace(/\\[\\]$/, \"\");\n\tif (raw.length === 0) return;\n\treturn modelNames.has(raw) ? raw : void 0;\n}\nfunction topologicalSortModels(models, deps) {\n\tconst byName = new Map(models.map((m) => [m.name, m]));\n\tconst result = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst sortedNames = [...deps.keys()].sort();\n\tfunction visit(name) {\n\t\tif (visited.has(name)) return;\n\t\tif (visiting.has(name)) return;\n\t\tvisiting.add(name);\n\t\tconst sortedDeps = [...deps.get(name) ?? /* @__PURE__ */ new Set()].sort();\n\t\tfor (const dep of sortedDeps) visit(dep);\n\t\tvisiting.delete(name);\n\t\tvisited.add(name);\n\t\tconst model = byName.get(name);\n\t\tif (model) result.push(model);\n\t}\n\tfor (const name of sortedNames) visit(name);\n\treturn result;\n}\n//#endregion\n//#region src/print-psl.ts\nfunction printPslFromAst(ast, options = {}) {\n\treturn serializePrintDocument(astDocumentToPrintDocument(ast), {\n\t\t...ifDefined(\"pslBlockDescriptors\", options.pslBlockDescriptors),\n\t\t...ifDefined(\"codecLookup\", options.codecLookup)\n\t});\n}\n//#endregion\nexport { printPslFromAst as printPsl };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;AAMA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,MAAM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,mBAAmB;EAC/D,GAAG,UAAU,eAAe,QAAQ,WAAW;CAChD,CAAC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "8.0.0-rc.3-dev.
|
|
3
|
+
"version": "8.0.0-rc.3-dev.8",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
"uniku": "^0.5.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@internal/config": "8.0.0-rc.3-dev.
|
|
19
|
-
"@internal/contract": "8.0.0-rc.3-dev.
|
|
20
|
-
"@internal/contract-authoring": "8.0.0-rc.3-dev.
|
|
21
|
-
"@internal/errors": "8.0.0-rc.3-dev.
|
|
22
|
-
"@internal/framework-components": "8.0.0-rc.3-dev.
|
|
23
|
-
"@internal/ids": "8.0.0-rc.3-dev.
|
|
24
|
-
"@internal/operations": "8.0.0-rc.3-dev.
|
|
25
|
-
"@internal/psl-parser": "8.0.0-rc.3-dev.
|
|
26
|
-
"@internal/psl-printer": "8.0.0-rc.3-dev.
|
|
27
|
-
"@internal/ts-render": "8.0.0-rc.3-dev.
|
|
28
|
-
"@repo/tsconfig": "8.0.0-rc.3-dev.
|
|
29
|
-
"@internal/publish-surface": "8.0.0-rc.3-dev.
|
|
30
|
-
"@repo/tsdown": "8.0.0-rc.3-dev.
|
|
31
|
-
"@internal/utils": "8.0.0-rc.3-dev.
|
|
18
|
+
"@internal/config": "8.0.0-rc.3-dev.8",
|
|
19
|
+
"@internal/contract": "8.0.0-rc.3-dev.8",
|
|
20
|
+
"@internal/contract-authoring": "8.0.0-rc.3-dev.8",
|
|
21
|
+
"@internal/errors": "8.0.0-rc.3-dev.8",
|
|
22
|
+
"@internal/framework-components": "8.0.0-rc.3-dev.8",
|
|
23
|
+
"@internal/ids": "8.0.0-rc.3-dev.8",
|
|
24
|
+
"@internal/operations": "8.0.0-rc.3-dev.8",
|
|
25
|
+
"@internal/psl-parser": "8.0.0-rc.3-dev.8",
|
|
26
|
+
"@internal/psl-printer": "8.0.0-rc.3-dev.8",
|
|
27
|
+
"@internal/ts-render": "8.0.0-rc.3-dev.8",
|
|
28
|
+
"@repo/tsconfig": "8.0.0-rc.3-dev.8",
|
|
29
|
+
"@internal/publish-surface": "8.0.0-rc.3-dev.8",
|
|
30
|
+
"@repo/tsdown": "8.0.0-rc.3-dev.8",
|
|
31
|
+
"@internal/utils": "8.0.0-rc.3-dev.8",
|
|
32
32
|
"tsdown": "0.22.14",
|
|
33
33
|
"typescript": "5.9.3",
|
|
34
34
|
"vitest": "4.1.10"
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
//#region ../../../1-framework/1-core/config/dist/config-types.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Default *source* directory for the contract file the user authors at `init`
|
|
4
|
-
* time. Output artefacts colocate with source per the same rule path-bearing
|
|
5
|
-
* providers apply.
|
|
6
|
-
*/
|
|
7
|
-
const DEFAULT_CONTRACT_SOURCE_DIR = "src/prisma";
|
|
8
|
-
function normalizeContractConfig(contract) {
|
|
9
|
-
const inMemoryFallbackOutput = `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.json`;
|
|
10
|
-
return {
|
|
11
|
-
source: contract.source,
|
|
12
|
-
output: contract.output ?? inMemoryFallbackOutput
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Version of the config format produced by this `defineConfig`. Bumped when
|
|
17
|
-
* the config shape changes incompatibly.
|
|
18
|
-
*/
|
|
19
|
-
const CONFIG_FORMAT_VERSION = 1;
|
|
20
|
-
const CONFIG_FORMAT_VERSION_KEY = Symbol.for("prisma-next.config-format-version");
|
|
21
|
-
function stampConfigFormatVersion(config) {
|
|
22
|
-
Object.defineProperty(config, CONFIG_FORMAT_VERSION_KEY, {
|
|
23
|
-
value: 1,
|
|
24
|
-
enumerable: false,
|
|
25
|
-
configurable: false,
|
|
26
|
-
writable: false
|
|
27
|
-
});
|
|
28
|
-
return config;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Reads the config-format version stamped by `defineConfig`, or `undefined`
|
|
32
|
-
* when the value was not produced by `defineConfig`. The marker is
|
|
33
|
-
* non-enumerable and does not survive spreads: configs must export the
|
|
34
|
-
* `defineConfig` result directly.
|
|
35
|
-
*/
|
|
36
|
-
function readConfigFormatVersion(value) {
|
|
37
|
-
if (typeof value !== "object" || value === null) return;
|
|
38
|
-
const version = Reflect.get(value, CONFIG_FORMAT_VERSION_KEY);
|
|
39
|
-
return typeof version === "number" ? version : void 0;
|
|
40
|
-
}
|
|
41
|
-
function hasCurrentConfigFormatVersion(value) {
|
|
42
|
-
return readConfigFormatVersion(value) === 1;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Helper function to define a Prisma Next config.
|
|
46
|
-
* Normalizes the config and stamps it with the config-format version marker.
|
|
47
|
-
* Structural validation happens in the config loader, which reports
|
|
48
|
-
* per-section diagnostics instead of failing the whole load.
|
|
49
|
-
*
|
|
50
|
-
* Normalization:
|
|
51
|
-
* - contract.output defaults to a path colocated with DEFAULT_CONTRACT_SOURCE_DIR
|
|
52
|
-
* when missing (in-memory-only providers)
|
|
53
|
-
*
|
|
54
|
-
* @param config - Raw config input from user
|
|
55
|
-
* @returns Normalized config IR with defaults applied
|
|
56
|
-
*/
|
|
57
|
-
function defineConfig(config) {
|
|
58
|
-
if (config.contract) return stampConfigFormatVersion({
|
|
59
|
-
...config,
|
|
60
|
-
contract: normalizeContractConfig(config.contract)
|
|
61
|
-
});
|
|
62
|
-
return stampConfigFormatVersion(config);
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
|
-
export { normalizeContractConfig as a, hasCurrentConfigFormatVersion as i, DEFAULT_CONTRACT_SOURCE_DIR as n, readConfigFormatVersion as o, defineConfig as r, CONFIG_FORMAT_VERSION as t };
|
|
66
|
-
|
|
67
|
-
//# sourceMappingURL=config-types-BqhNxw0z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-BqhNxw0z.mjs","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-types.mjs"],"sourcesContent":["//#region src/config-types.ts\n/**\n* Default *source* directory for the contract file the user authors at `init`\n* time. Output artefacts colocate with source per the same rule path-bearing\n* providers apply.\n*/\nconst DEFAULT_CONTRACT_SOURCE_DIR = \"src/prisma\";\nfunction normalizeContractConfig(contract) {\n\tconst inMemoryFallbackOutput = `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.json`;\n\treturn {\n\t\tsource: contract.source,\n\t\toutput: contract.output ?? inMemoryFallbackOutput\n\t};\n}\n/**\n* Version of the config format produced by this `defineConfig`. Bumped when\n* the config shape changes incompatibly.\n*/\nconst CONFIG_FORMAT_VERSION = 1;\nconst CONFIG_FORMAT_VERSION_KEY = Symbol.for(\"prisma-next.config-format-version\");\nfunction stampConfigFormatVersion(config) {\n\tObject.defineProperty(config, CONFIG_FORMAT_VERSION_KEY, {\n\t\tvalue: 1,\n\t\tenumerable: false,\n\t\tconfigurable: false,\n\t\twritable: false\n\t});\n\treturn config;\n}\n/**\n* Reads the config-format version stamped by `defineConfig`, or `undefined`\n* when the value was not produced by `defineConfig`. The marker is\n* non-enumerable and does not survive spreads: configs must export the\n* `defineConfig` result directly.\n*/\nfunction readConfigFormatVersion(value) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tconst version = Reflect.get(value, CONFIG_FORMAT_VERSION_KEY);\n\treturn typeof version === \"number\" ? version : void 0;\n}\nfunction hasCurrentConfigFormatVersion(value) {\n\treturn readConfigFormatVersion(value) === 1;\n}\n/**\n* Helper function to define a Prisma Next config.\n* Normalizes the config and stamps it with the config-format version marker.\n* Structural validation happens in the config loader, which reports\n* per-section diagnostics instead of failing the whole load.\n*\n* Normalization:\n* - contract.output defaults to a path colocated with DEFAULT_CONTRACT_SOURCE_DIR\n* when missing (in-memory-only providers)\n*\n* @param config - Raw config input from user\n* @returns Normalized config IR with defaults applied\n*/\nfunction defineConfig(config) {\n\tif (config.contract) return stampConfigFormatVersion({\n\t\t...config,\n\t\tcontract: normalizeContractConfig(config.contract)\n\t});\n\treturn stampConfigFormatVersion(config);\n}\n//#endregion\nexport { CONFIG_FORMAT_VERSION, DEFAULT_CONTRACT_SOURCE_DIR, defineConfig, hasCurrentConfigFormatVersion, normalizeContractConfig, readConfigFormatVersion };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;AAMA,MAAM,8BAA8B;AACpC,SAAS,wBAAwB,UAAU;CAC1C,MAAM,yBAAyB,GAAG,4BAA4B;CAC9D,OAAO;EACN,QAAQ,SAAS;EACjB,QAAQ,SAAS,UAAU;CAC5B;AACD;;;;;AAKA,MAAM,wBAAwB;AAC9B,MAAM,4BAA4B,OAAO,IAAI,mCAAmC;AAChF,SAAS,yBAAyB,QAAQ;CACzC,OAAO,eAAe,QAAQ,2BAA2B;EACxD,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;CACX,CAAC;CACD,OAAO;AACR;;;;;;;AAOA,SAAS,wBAAwB,OAAO;CACvC,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM;CACjD,MAAM,UAAU,QAAQ,IAAI,OAAO,yBAAyB;CAC5D,OAAO,OAAO,YAAY,WAAW,UAAU,KAAK;AACrD;AACA,SAAS,8BAA8B,OAAO;CAC7C,OAAO,wBAAwB,KAAK,MAAM;AAC3C;;;;;;;;;;;;;;AAcA,SAAS,aAAa,QAAQ;CAC7B,IAAI,OAAO,UAAU,OAAO,yBAAyB;EACpD,GAAG;EACH,UAAU,wBAAwB,OAAO,QAAQ;CAClD,CAAC;CACD,OAAO,yBAAyB,MAAM;AACvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-BD96JZi8-NUhO5Kkw.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-BD96JZi8.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { docsUrlFor } from \"@internal/utils/structured-error\";\n//#region src/control.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `@internal/utils/structured-error`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See\n* [ADR 239](../../../../../docs/architecture%20docs/adrs/ADR%20239%20-%20Errors%20are%20structural%20envelopes%20with%20dotted%20namespace%20codes.md)\n* for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*\n\t* This is the boundary that emits the envelope, so it is where a missing\n\t* `nextActions` becomes `[]`.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\tnextActions: this.nextActions ?? [],\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = error;\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n/**\n* Config file not found or missing.\n*/\nfunction errorConfigFileNotFound(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.FILE_NOT_FOUND\", \"Config file not found\", {\n\t\t...options?.why ? { why: options.why } : { why: \"Config file not found\" },\n\t\tfix: \"Run 'prisma-next init' to create a config file\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Create a config file\",\n\t\t\tcommand: \"{bin} init\"\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FILE_NOT_FOUND\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Config module failed to evaluate (syntax error, module threw during import).\n*/\nfunction errorConfigEvaluationFailed(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", \"Config file could not be evaluated\", {\n\t\twhy: options.why,\n\t\tfix: \"Fix the error in your prisma.config.ts so the module evaluates, then rerun the command\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.EVALUATION_FAILED\"),\n\t\t...configPath ? { where: { path: configPath } } : {},\n\t\t...options.cause !== void 0 ? { cause: options.cause } : {}\n\t});\n}\n/**\n* Config module evaluated, but its export does not carry the defineConfig\n* version marker (plain object export, or a config produced by a different\n* defineConfig such as classic Prisma's).\n*/\nfunction errorConfigVersionMarkerMissing(configPath) {\n\treturn new CliStructuredError(\"CONFIG.VERSION_MARKER_MISSING\", \"Config is not a defineConfig result\", {\n\t\twhy: \"The config module evaluated, but its default export was not created by a current defineConfig\",\n\t\tfix: \"Create the config with defineConfig from '@prisma/cli-engine', nest your settings under its `orm` section, and export its return value directly\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VERSION_MARKER_MISSING\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Contract configuration missing from config.\n*/\nfunction errorContractConfigMissing(options) {\n\treturn new CliStructuredError(\"CONFIG.CONTRACT_MISSING\", \"Contract configuration missing\", {\n\t\twhy: options?.why ?? \"The contract configuration is required for emit\",\n\t\tfix: \"Add contract configuration to your prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.CONTRACT_MISSING\")\n\t});\n}\n/**\n* Contract validation failed.\n*/\nfunction errorContractValidationFailed(reason, options) {\n\treturn new CliStructuredError(\"CONTRACT.VALIDATION_FAILED\", \"Contract validation failed\", {\n\t\twhy: reason,\n\t\tfix: \"Re-run `prisma-next contract emit`, or fix the contract file and try again\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Re-emit the contract\",\n\t\t\tcommand: \"{bin} contract emit\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Fix the contract file, then re-run the command\",\n\t\t\treason\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONTRACT.VALIDATION_FAILED\"),\n\t\t...options?.where ? { where: options.where } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* File not found.\n*/\nfunction errorFileNotFound(filePath, options) {\n\treturn new CliStructuredError(\"CLI.FILE_NOT_FOUND\", \"File not found\", {\n\t\twhy: options?.why ?? `File not found: ${filePath}`,\n\t\tfix: options?.fix ?? \"Check that the file path is correct\",\n\t\twhere: { path: filePath },\n\t\t...options?.docsUrl ? { docsUrl: options.docsUrl } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* Database connection is required but not provided.\n*/\nfunction errorDatabaseConnectionRequired(options) {\n\tconst runHint = options?.retryCommand ? `Run \\`${options.retryCommand}\\`` : options?.commandName ? `Run \\`prisma-next ${options.commandName} --db <url>\\`` : \"Provide `--db <url>`\";\n\treturn new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"Database connection is required\", {\n\t\twhy: options?.why ?? \"Database connection is required for this command\",\n\t\tfix: `${runHint}, or set \\`db: { connection: \"postgres://…\" }\\` in prisma.config.ts`,\n\t\t...options?.missingFlags !== void 0 ? { meta: { missingFlags: [...options.missingFlags] } } : {}\n\t});\n}\n/**\n* Query runner factory is required but not provided in config.\n*/\nfunction errorQueryRunnerFactoryRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\", \"Query runner factory is required\", {\n\t\twhy: options?.why ?? \"Config.db.queryRunnerFactory is required for db verify\",\n\t\tfix: \"Add db.queryRunnerFactory to prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\")\n\t});\n}\n/**\n* Family verify.readMarker is required but not provided.\n*/\nfunction errorFamilyReadMarkerSqlRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\", \"Family readMarker() is required\", {\n\t\twhy: options?.why ?? \"Family verify.readMarker is required for db verify\",\n\t\tfix: \"Ensure family.verify.readMarker() is exported by your family package\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\")\n\t});\n}\n/**\n* JSON output format not supported.\n*/\nfunction errorJsonFormatNotSupported(options) {\n\treturn new CliStructuredError(\"CLI.JSON_FORMAT_UNSUPPORTED\", \"Unsupported JSON format\", {\n\t\twhy: `The ${options.command} command does not support --json ${options.format}`,\n\t\tfix: `Use --json ${options.supportedFormats.join(\" or \")}, or omit --json for human output`,\n\t\tmeta: {\n\t\t\tcommand: options.command,\n\t\t\tformat: options.format,\n\t\t\tsupportedFormats: options.supportedFormats\n\t\t}\n\t});\n}\n/**\n* Driver is required for DB-connected commands but not provided.\n*/\nfunction errorDriverRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is required for DB-connected commands\", {\n\t\twhy: options?.why ?? \"Config.driver is required for DB-connected commands\",\n\t\tfix: \"Add a control-plane driver to prisma.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.DRIVER_REQUIRED\")\n\t});\n}\n/**\n* Contract requires extension packs that are not provided by config descriptors.\n*/\nfunction errorContractMissingExtensions(options) {\n\tconst missing = [...options.missingExtensions].sort();\n\treturn new CliStructuredError(\"CONFIG.MISSING_EXTENSION_PACKS\", \"Missing extension packs in config\", {\n\t\twhy: missing.length === 1 ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.` : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(\", \")}, but CLI config does not provide matching descriptors.`,\n\t\tfix: \"Add the missing extension descriptors to `extensions` in prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.MISSING_EXTENSION_PACKS\"),\n\t\tmeta: {\n\t\t\tmissingExtensions: missing,\n\t\t\tprovidedComponentIds: [...options.providedComponentIds].sort()\n\t\t}\n\t});\n}\n/**\n* Migration planning failed due to conflicts.\n*/\nfunction errorMigrationPlanningFailed(options) {\n\tconst conflictSummaries = options.conflicts.map((c) => c.summary);\n\tconst computedWhy = options.why ?? conflictSummaries.join(\"\\n\");\n\tconst conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === \"string\");\n\treturn new CliStructuredError(\"MIGRATION.PLANNING_FAILED\", \"Migration planning failed\", {\n\t\twhy: computedWhy,\n\t\tfix: conflictFixes.length > 0 ? conflictFixes.join(\"\\n\") : \"Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty\",\n\t\tmeta: { conflicts: options.conflicts },\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.PLANNING_FAILED\")\n\t});\n}\n/**\n* Target does not support migrations (missing createPlanner/createRunner).\n*/\nfunction errorTargetMigrationNotSupported(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", \"Target does not support migrations\", {\n\t\twhy: options?.why ?? \"The configured target does not provide migration planner/runner\",\n\t\tfix: \"Select a target that provides migrations (it must export `target.migrations` for db init)\",\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.TARGET_UNSUPPORTED\")\n\t});\n}\n/**\n* The migration-file CLI received `--config` without a path argument (either\n* a bare trailing `--config`, or `--config` followed by another flag like\n* `--config --dry-run`). Surfacing this as a structured error fails fast\n* rather than silently consuming the next flag as the config path or\n* falling back to default discovery against the wrong project.\n*/\nfunction errorMigrationCliInvalidConfigArg(options) {\n\treturn new CliStructuredError(\"CLI.CONFIG_ARG_MISSING_PATH\", \"--config flag requires a path argument\", {\n\t\twhy: options?.nextToken !== void 0 ? `\\`--config\\` was followed by another flag (\\`${options.nextToken}\\`) instead of a path argument.` : \"`--config` was passed without a following path argument.\",\n\t\tfix: \"Pass a config path: `--config <path>` or `--config=<path>`.\",\n\t\tmeta: options?.nextToken !== void 0 ? { nextToken: options.nextToken } : {}\n\t});\n}\n/**\n* The migration-file CLI received a flag it does not recognise. Surfaced as a\n* structured error so consumers can render their own \"did you mean\"\n* suggestions from `meta.knownFlags` rather than parsing the message.\n*\n* Designed to wrap clipanion's `UnknownSyntaxError` at the parser boundary:\n* pass the offending token as `flag` and the option declarations as\n* `knownFlags`.\n*/\nfunction errorMigrationCliUnknownFlag(options) {\n\tconst knownList = options.knownFlags.join(\", \");\n\treturn new CliStructuredError(\"CLI.UNKNOWN_FLAG\", \"Unknown migration CLI flag\", {\n\t\twhy: `Unknown flag \\`${options.flag}\\`.`,\n\t\tfix: `Known flags: ${knownList}. Run with \\`--help\\` to see the full list.`,\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tknownFlags: options.knownFlags\n\t\t}\n\t});\n}\n/**\n* The main CLI received an unsupported `--format` value.\n*/\nfunction errorInvalidOutputFormat(value) {\n\treturn new CliStructuredError(\"CLI.INVALID_OUTPUT_FORMAT\", `Invalid --format value \"${value}\". Allowed values: pretty, json.`, { meta: {\n\t\tvalue,\n\t\tallowed: [\"pretty\", \"json\"]\n\t} });\n}\n/**\n* The main CLI received mutually exclusive output format flags\n* (`--format pretty` together with `--json`).\n*/\nfunction errorOutputFormatMutex() {\n\treturn new CliStructuredError(\"CLI.OUTPUT_FORMAT_CONFLICT\", \"Cannot use --format pretty together with --json. Use --format json or --json alone for JSON output.\");\n}\n/**\n* Config validation error (missing required fields).\n*/\nfunction errorConfigValidation(field, options) {\n\treturn new CliStructuredError(\"CONFIG.VALIDATION_FAILED\", \"Config validation error\", {\n\t\twhy: options?.why ?? `Config must have a \"${field}\" field`,\n\t\tfix: \"Check your prisma.config.ts and ensure all required fields are provided\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VALIDATION_FAILED\"),\n\t\tmeta: {\n\t\t\tfield,\n\t\t\t...options?.section !== void 0 ? { section: options.section } : {}\n\t\t}\n\t});\n}\n/**\n* An enum declares a codecId that no component in the contract's pack stack provides,\n* so its member values cannot be encoded. Thrown by both authoring paths (TS `defineContract`\n* and PSL interpretation) when the codec lookup built from the contract's packs has no\n* descriptor for the codecId.\n*/\nfunction errorEnumCodecNotInPackStack(options) {\n\treturn new CliStructuredError(\"CONTRACT.ENUM_CODEC_NOT_IN_PACK_STACK\", `Enum codec \"${options.codecId}\" is not part of the contract's pack stack`, {\n\t\twhy: `An enum uses codec \"${options.codecId}\", but no family, target, or extension pack in the contract provides it.`,\n\t\tfix: \"Use a codec provided by the contract's target/extension packs, or add the pack that supplies this codec.\",\n\t\tmeta: { codecId: options.codecId }\n\t});\n}\n/**\n* Generic unexpected error.\n*/\nfunction errorUnexpected(message, options) {\n\treturn new CliStructuredError(\"CLI.UNEXPECTED\", \"Unexpected error\", {\n\t\twhy: options?.why ?? message,\n\t\tfix: options?.fix ?? \"Check the error message and try again\",\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };\n\n//# sourceMappingURL=control-BD96JZi8.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,IAAI,qBAAqB,cAAc,MAAM;CAC5C;CACA;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,WAAW,SAAS,YAAY;EACrC,MAAM,MAAM,SAAS,QAAQ,SAAS,MAAM,KAAK,IAAI,SAAS;EAC9D,MAAM,QAAQ,SAAS,QAAQ;GAC9B,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;GACvC,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;EACxC,IAAI,KAAK;EACT,OAAO,OAAO,MAAM;GACnB,GAAG,UAAU,OAAO,SAAS,GAAG;GAChC,GAAG,UAAU,OAAO,GAAG;GACvB,GAAG,UAAU,eAAe,SAAS,WAAW;GAChD,GAAG,UAAU,SAAS,KAAK;GAC3B,GAAG,UAAU,QAAQ,SAAS,IAAI;GAClC,GAAG,UAAU,WAAW,SAAS,OAAO;EACzC,CAAC;CACF;;;;;;;CAOA,aAAa;EACZ,OAAO;GACN,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AO,SAAS;CAC9C,OAAO,IAAI,mBAAmB,4BAA4B,2BAA2B;EACpF,KAAK,SAAS,OAAO,uBAAuB,MAAM;EAClD,KAAK;EACL,SAAS,WAAW,0BAA0B;EAC9C,MAAM;GACL;GACA,GAAG,SAAS,YAAY,KAAK,IAAI,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EAClE;CACD,CAAC;AACF;;;;;;;AAOA,SAAS,6BAA6B,SAAS;CAC9C,OAAO,IAAI,mBAAmB,yCAAyC,eAAe,QAAQ,QAAQ,6CAA6C;EAClJ,KAAK,uBAAuB,QAAQ,QAAQ;EAC5C,KAAK;EACL,MAAM,EAAE,SAAS,QAAQ,QAAQ;CAClC,CAAC;AACF;;;;AAIA,SAAS,gBAAgB,SAAS,SAAS;CAC1C,OAAO,IAAI,mBAAmB,kBAAkB,oBAAoB;EACnE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution-Crk6IfTs.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-BD96JZi8.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/execution.ts\n/**\n* Contract marker not found in database.\n*/\nfunction errorMarkerMissing(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISSING\", \"Database not signed\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: \"Run `prisma-next db sign --db <url>` to sign the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db sign --db <url>\"\n\t\t}]\n\t});\n}\n/**\n* Contract hash does not match database marker.\n*/\nfunction errorHashMismatch(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISMATCH\", \"Hash mismatch\", {\n\t\twhy: options?.why ?? \"Contract hash does not match database marker\",\n\t\tfix: \"Migrate database or re-sign if intentional\",\n\t\t...options?.expected !== void 0 || options?.actual !== void 0 ? { meta: {\n\t\t\t...ifDefined(\"expected\", options?.expected),\n\t\t\t...ifDefined(\"actual\", options?.actual)\n\t\t} } : {}\n\t});\n}\n/**\n* Contract target does not match config target.\n*/\nfunction errorTargetMismatch(expected, actual, options) {\n\treturn new CliStructuredError(\"CONTRACT.TARGET_MISMATCH\", \"Target mismatch\", {\n\t\twhy: options?.why ?? `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,\n\t\tfix: \"Align contract target and config target\",\n\t\tmeta: {\n\t\t\texpected,\n\t\t\tactual\n\t\t}\n\t});\n}\n/**\n* Marker row exists but column values fail schema validation.\n*/\nfunction errorMarkerRowCorrupt(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_ROW_CORRUPT\", \"Marker row is corrupt or incompatible\", {\n\t\twhy: options.why,\n\t\tfix: `The ${options.markerLocation} row for space \"${options.space}\" contains invalid data. Delete the row, then run \\`prisma-next db sign --db <url>\\` to write a fresh marker.`,\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Write a fresh marker\",\n\t\t\tcommand: \"{bin} db sign --db <url>\",\n\t\t\treason: `Delete the invalid ${options.markerLocation} row for space \"${options.space}\" first — this command then writes a valid one.`\n\t\t}],\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/**\n* Driver-level failure while reading the contract marker table.\n*/\nfunction errorMarkerReadFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_READ_FAILED\", \"Database error while reading contract marker\", {\n\t\twhy: options.why,\n\t\tfix: `Could not read marker at ${options.markerLocation} for space \"${options.space}\". Verify read permissions, connectivity, and locks, then retry.`,\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction isMarkerRowParseError(err) {\n\treturn err instanceof Error && (err.message.startsWith(\"Invalid contract marker row:\") || err.message.startsWith(\"Invalid marker doc on\"));\n}\nfunction isLegacyMarkerShapeReadError(message) {\n\tconst normalized = message.toLowerCase();\n\treturn normalized.includes(\"column \\\"space\\\" does not exist\") || normalized.includes(\"no such column: space\");\n}\nfunction errorLegacyMarkerShape(options) {\n\treturn errorRunnerFailed(`Legacy marker-table shape detected on ${options.markerLocation} (no \\`space\\` column). Prisma Next is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \\`${options.markerLocation}\\` and re-run \\`prisma-next db init\\` to reinitialise from a clean baseline.`, {\n\t\twhy: options.why,\n\t\tfix: \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-next db init` to recreate it with the current per-space schema.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reinitialise the marker table from a clean baseline\",\n\t\t\tcommand: \"{bin} db init\",\n\t\t\treason: `Drop \\`${options.markerLocation}\\` first — it has the legacy shape (no \\`space\\` column) and this command recreates it with the current per-space schema.`\n\t\t}],\n\t\tmeta: { runnerErrorCode: \"MIGRATION.LEGACY_MARKER_SHAPE\" },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction rethrowMarkerReadError(err, context) {\n\tif (CliStructuredError.is(err)) throw err;\n\tif (isMarkerRowParseError(err)) throw errorMarkerRowCorrupt({\n\t\twhy: err.message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tconst message = err instanceof Error ? err.message : String(err);\n\tif (isLegacyMarkerShapeReadError(message)) throw errorLegacyMarkerShape({\n\t\twhy: message,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tthrow errorMarkerReadFailed({\n\t\twhy: message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n}\nasync function withMarkerReadErrorHandling(operation, context) {\n\ttry {\n\t\treturn await operation();\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\nfunction parseMarkerRowSafely(row, parse, context) {\n\ttry {\n\t\treturn parse(row);\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\n/**\n* Database marker is required but not found.\n* Used by commands that require a pre-existing marker as a precondition.\n*/\nfunction errorMarkerRequired(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_REQUIRED\", \"Database must be signed first\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: options?.fix ?? \"Run `prisma-next db init` first to sign the database\",\n\t\tnextActions: options?.nextActions ?? [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db init\"\n\t\t}]\n\t});\n}\n/**\n* Schema verification found mismatches between the database and the contract.\n* The full verification result is preserved in `meta.verificationResult`.\n*/\nfunction errorSchemaVerificationFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.SCHEMA_VERIFICATION_FAILED\", options.summary, {\n\t\twhy: \"Database schema does not satisfy the contract\",\n\t\tfix: \"Run `prisma-next db update` to reconcile, or adjust your contract to match the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reconcile the database\",\n\t\t\tcommand: \"{bin} db update\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Adjust your contract to match the database\"\n\t\t}],\n\t\tmeta: {\n\t\t\tverificationResult: options.verificationResult,\n\t\t\t...ifDefined(\"issues\", options.issues)\n\t\t}\n\t});\n}\n/**\n* Migration runner failed during execution.\n*/\nfunction errorRunnerFailed(summary, options) {\n\treturn new CliStructuredError(\"MIGRATION.RUNNER_FAILED\", summary, {\n\t\twhy: options?.why ?? \"Migration runner failed\",\n\t\tfix: options?.fix ?? \"Inspect the reported conflict and reconcile schema drift\",\n\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t...options?.meta ? { meta: options.meta } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/** Error code for destructive changes that require explicit confirmation. */\nconst ERROR_CODE_DESTRUCTIVE_CHANGES = \"MIGRATION.DESTRUCTIVE_CHANGES\";\n/**\n* Destructive operations require explicit confirmation via -y/--yes.\n*/\nfunction errorDestructiveChanges(summary, options) {\n\treturn new CliStructuredError(ERROR_CODE_DESTRUCTIVE_CHANGES, summary, {\n\t\twhy: options?.why ?? \"Planned operations include destructive changes that require confirmation\",\n\t\tfix: options?.fix ?? \"Re-run with `-y` to apply, or use `--dry-run` to preview first\",\n\t\t...options?.meta ? { meta: options.meta } : {}\n\t});\n}\nconst ERROR_CODE_CONSENT_PLAN_MISMATCH = \"MIGRATION.CONSENT_PLAN_MISMATCH\";\n/**\n* An apply carrying consent was refused because the plan recomputed for it is\n* not the plan that was consented to.\n*/\nfunction errorConsentPlanMismatch(options) {\n\treturn new CliStructuredError(ERROR_CODE_CONSENT_PLAN_MISMATCH, \"The plan changed between consent and apply\", {\n\t\twhy: options.why ?? \"The plan recomputed for the consented apply is not the plan that was consented to, so applying it could destroy something nobody agreed to.\",\n\t\tfix: \"Re-run the command and review the freshly planned operations before consenting again\",\n\t\tmeta: {\n\t\t\tconsentedPlanHash: options.consentedPlanHash,\n\t\t\tplanHash: options.planHash\n\t\t}\n\t});\n}\n/**\n* Generic runtime error carrying a caller-provided dotted code.\n*/\nfunction errorRuntime(code, summary, options) {\n\treturn new CliStructuredError(code, summary, {\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };\n\n//# sourceMappingURL=execution.mjs.map"],"mappings":";;;;;;AAMA,SAAS,mBAAmB,SAAS;CACpC,OAAO,IAAI,mBAAmB,2BAA2B,uBAAuB;EAC/E,KAAK,SAAS,OAAO;EACrB,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,SAAS;EACV,CAAC;CACF,CAAC;AACF;;;;AAIA,SAAS,kBAAkB,SAAS;CACnC,OAAO,IAAI,mBAAmB,4BAA4B,iBAAiB;EAC1E,KAAK,SAAS,OAAO;EACrB,KAAK;EACL,GAAG,SAAS,aAAa,KAAK,KAAK,SAAS,WAAW,KAAK,IAAI,EAAE,MAAM;GACvE,GAAG,UAAU,YAAY,SAAS,QAAQ;GAC1C,GAAG,UAAU,UAAU,SAAS,MAAM;EACvC,EAAE,IAAI,CAAC;CACR,CAAC;AACF;;;;AAIA,SAAS,oBAAoB,UAAU,QAAQ,SAAS;CACvD,OAAO,IAAI,mBAAmB,4BAA4B,mBAAmB;EAC5E,KAAK,SAAS,OAAO,2DAA2D,SAAS,YAAY,OAAO;EAC5G,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;;;;AAIA,SAAS,sBAAsB,SAAS;CACvC,OAAO,IAAI,mBAAmB,+BAA+B,yCAAyC;EACrG,KAAK,QAAQ;EACb,KAAK,OAAO,QAAQ,eAAe,kBAAkB,QAAQ,MAAM;EACnE,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,SAAS;GACT,QAAQ,sBAAsB,QAAQ,eAAe,kBAAkB,QAAQ,MAAM;EACtF,CAAC;EACD,MAAM,EAAE,OAAO,QAAQ,MAAM;EAC7B,GAAG,UAAU,SAAS,QAAQ,KAAK;CACpC,CAAC;AACF;;;;AAIA,SAAS,sBAAsB,SAAS;CACvC,OAAO,IAAI,mBAAmB,+BAA+B,gDAAgD;EAC5G,KAA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B,SAAS;CAC1C,OAAO,IAAI,mBAAmB,kCAAkC,8CAA8C;EAC7G,KAAK,QAAQ,OAAO;EACpB,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,UAAU,QAAQ;EACnB;CACD,CAAC;AACF;;;;AAIA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,IAAI,mBAAmB,MAAM,SAAS;EAC5C,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,QAAQ,SAAS,IAAI;EAClC,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-C57VKLUY.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-BD96JZi8.mjs\";\n//#region src/migration.ts\n/**\n* A scaffolded migration contains a placeholder slot that was never filled in.\n*\n* Thrown at emit time (when `check.source()` or `run()` is invoked) via the\n* `placeholder(...)` utility. The `slot` identifies the exact location the\n* author still needs to edit, e.g. `\"backfill-product-status:check.source\"`.\n*/\nfunction errorUnfilledPlaceholder(slot) {\n\treturn new CliStructuredError(\"MIGRATION.UNFILLED_PLACEHOLDER\", \"Unfilled migration placeholder\", {\n\t\twhy: `The migration contains a placeholder that has not been filled in: ${slot}`,\n\t\tfix: \"Open migration.ts and replace the `placeholder(...)` call with your actual query.\",\n\t\tmeta: { slot }\n\t});\n}\n/**\n* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't\n* emit a real query and the author is expected to fill one in. Always throws\n* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).\n*\n* The return type `never` makes it assignable to any expected return type, so\n* a scaffolded `() => placeholder('...')` satisfies signatures like\n* `() => MongoQueryPlan` without polluting them with a sentinel union arm.\n*/\nfunction placeholder(slot) {\n\tthrow errorUnfilledPlaceholder(slot);\n}\n/**\n* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose\n* `meta.storageHash` does not match the `endContract.storage.storageHash` it\n* was configured with. This almost always means the user's query-builder\n* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)\n* was instantiated from a different contract reference than the one passed\n* to `dataTransform(endContract, …)`.\n*\n* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which\n* rejects a plan at runtime execution; this is an authoring-time rejection\n* so it lives in the `MIGRATION` namespace.\n*/\nfunction errorDataTransformContractMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH\", \"dataTransform query plan built against wrong contract\", {\n\t\twhy: `Data transform \"${options.dataTransformName}\" produced a query plan whose storage hash (${options.actual}) does not match the migration's contract (${options.expected}). The query builder was configured with a different contract than the one passed to dataTransform(endContract, ...).`,\n\t\tfix: \"Ensure the `endContract` imported at module scope (used for both `dataTransform(endContract, …)` and `sql({ context: createExecutionContext({ contract: endContract, … }) })`) is the same reference.\",\n\t\tmeta: {\n\t\t\tdataTransformName: options.dataTransformName,\n\t\t\texpected: options.expected,\n\t\t\tactual: options.actual\n\t\t}\n\t});\n}\n/**\n* `migration.ts` was expected at the given package directory but could not be\n* located. Thrown when consumers attempt to read a migration package that is\n* missing its source file.\n*/\nfunction errorMigrationFileMissing(dir) {\n\treturn new CliStructuredError(\"MIGRATION.FILE_MISSING\", \"migration.ts not found\", {\n\t\twhy: `No migration.ts file was found at \"${dir}\"`,\n\t\tfix: \"Scaffold one with `prisma-next migration new` or `prisma-next migration plan`.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold an empty migration\",\n\t\t\tcommand: \"{bin} migration new\"\n\t\t}, {\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold a migration from a contract diff\",\n\t\t\tcommand: \"{bin} migration plan\"\n\t\t}],\n\t\tmeta: { dir }\n\t});\n}\n/**\n* The `migration.ts` at the given package directory does not default-export a\n* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a\n* factory function returning a `MigrationPlan`-shaped object (with at least\n* an `operations` array, plus `targetId` and `destination`). Thrown when the\n* default export is missing, is not a constructor/function, does not extend\n* `Migration`, or (for factory functions) returns a value that is not\n* `MigrationPlan`-shaped.\n*/\nfunction errorMigrationInvalidDefaultExport(dir, actualExportDescription) {\n\treturn new CliStructuredError(\"MIGRATION.INVALID_DEFAULT_EXPORT\", \"migration.ts default export is not a valid migration\", {\n\t\twhy: actualExportDescription !== void 0 ? `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object; got ${actualExportDescription}` : `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object.`,\n\t\tfix: \"Use `export default class extends Migration { ... }` or `export default () => ({ targetId, destination, operations })`.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {}\n\t\t}\n\t});\n}\n/**\n* The migration class declares one `targetId` but the loaded\n* `prisma.config.ts` declares another. Thrown by `MigrationCLI.run`\n* when a migration script is invoked against a config whose target\n* descriptor disagrees with the migration's own `targetId`. Distinct from generic\n* config-validation errors because the mismatch is between two valid\n* artifacts (the script and the config), not a malformed input.\n*/\nfunction errorMigrationTargetMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_MISMATCH\", \"Migration target does not match config target\", {\n\t\twhy: `This migration is for target \"${options.migrationTargetId}\" but the loaded prisma.config.ts declares target \"${options.configTargetId}\". The migration script can only be run against a config that targets the same database.`,\n\t\tfix: \"Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.\",\n\t\tmeta: {\n\t\t\tmigrationTargetId: options.migrationTargetId,\n\t\t\tconfigTargetId: options.configTargetId\n\t\t}\n\t});\n}\n/**\n* A `Migration.operations` getter returned a value that is not an array. Used\n* by emit capabilities after instantiating the authored migration.\n*/\nfunction errorMigrationPlanNotArray(dir, actualValueDescription) {\n\treturn new CliStructuredError(\"MIGRATION.PLAN_NOT_ARRAY\", \"Migration.operations must be an array of operations\", {\n\t\twhy: actualValueDescription !== void 0 ? `Migration.operations for migration.ts at \"${dir}\" was ${actualValueDescription}; an array of operations is required.` : `Migration.operations for migration.ts at \"${dir}\" is not an array of operations.`,\n\t\tfix: \"Ensure your `operations` getter returns an array of operations; see the data-migrations authoring guide.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {}\n\t\t}\n\t});\n}\n//#endregion\nexport { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,OAAO,IAAI,mBAAmB,kCAAkC,kCAAkC;EACjG,KAAK,qEAAqE;EAC1E,KAAK;EACL,MAAM,EAAE,KAAK;CACd,CAAC;AACF;;;;;;;;;;AAUA,SAAS,YAAY,MAAM;CAC1B,MAAM,yBAAyB,IAAI;AACpC;;;;;;;;;;;;;AAaA,SAAS,mCAAmC,SAAS;CACpD,OAAO,IAAI,mBAAmB,8CAA8C,yDAAyD;EACpI,KAAK,mBAAmB,QAAQ,kBAAkB,8CAA8C,QAAQ,OAAO,6CAA6C,QAAQ,SAAS;EAC7K,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,UAAU,QAAQ;GAClB,QAAQ,QAAQ;EACjB;CACD,CAAC;AACF;;;;;;AAMA,SAAS,0BAA0B,KAAK;CACvC,OAAO,IAAI,mBAAmB,0BAA0B,0BAA0B;EACjF,KAAK,sCAAsC,IAAI;EAC/C,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,SAAS;EACV,GAAG;GACF,MAAM;GACN,OAAO;GACP,SAAS;EACV,CAAC;EACD,MAAM,EAA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