@prisma-next/contract 0.5.0-dev.8 → 0.5.0-dev.9

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/README.md CHANGED
@@ -11,7 +11,7 @@ Core contract data types and JSON schemas for Prisma Next.
11
11
  This package provides the foundational type definitions for Prisma Next data contracts:
12
12
 
13
13
  - **Contract data types**: The canonical description of an application's data model and storage layout (`ContractBase`, `DocumentContract`, `Source`, `FieldType`)
14
- - **Plan types**: Target-family-agnostic execution plan types (`ExecutionPlan`, `PlanMeta`, `ParamDescriptor`)
14
+ - **Plan metadata**: Target-family-agnostic plan metadata types (`PlanMeta`, `ParamDescriptor`, `PlanRefs`). The plan markers themselves (`QueryPlan`, `ExecutionPlan`) live in `@prisma-next/framework-components/runtime`; family-specific plans (`SqlExecutionPlan`, `MongoExecutionPlan`) live in their respective domains.
15
15
  - **Hash types**: Branded hash types for storage, execution, and profile hashing (`StorageHashBase`, `ExecutionHashBase`, `ProfileHashBase`)
16
16
  - **JSON Schemas**: Validation schemas for contract files
17
17
  - **Type guards**: Runtime type guards for narrowing contract types (`isDocumentContract`)
@@ -25,7 +25,6 @@ import type {
25
25
  Contract,
26
26
  ContractMarkerRecord,
27
27
  DocumentContract,
28
- ExecutionPlan,
29
28
  PlanMeta,
30
29
  } from '@prisma-next/contract/types';
31
30
  import { isDocumentContract, coreHash, profileHash } from '@prisma-next/contract/types';
@@ -220,37 +220,6 @@ interface PlanMeta {
220
220
  */
221
221
  readonly projectionTypes?: Record<string, string>;
222
222
  }
223
- /**
224
- * Canonical execution plan shape used by runtimes.
225
- *
226
- * - Row is the inferred result row type (TypeScript-only).
227
- * - Ast is the optional, family-specific AST type (e.g. SQL QueryAst).
228
- *
229
- * The payload executed by the runtime is represented by the sql + params pair
230
- * for now; future families can specialize this via Ast or additional metadata.
231
- */
232
- interface ExecutionPlan<Row = unknown, Ast = unknown> {
233
- readonly sql: string;
234
- readonly params: readonly unknown[];
235
- readonly ast?: Ast;
236
- readonly meta: PlanMeta;
237
- /**
238
- * Phantom property to carry the Row generic for type-level utilities.
239
- * Not set at runtime; used only for ResultType extraction.
240
- */
241
- readonly _row?: Row;
242
- }
243
- /**
244
- * Utility type to extract the Row type from an ExecutionPlan.
245
- * Example: `type Row = ResultType<typeof plan>`
246
- *
247
- * Works with both ExecutionPlan and SqlQueryPlan (SQL query plans before lowering).
248
- * SqlQueryPlan includes a phantom `_Row` property to preserve the generic parameter
249
- * for type extraction.
250
- */
251
- type ResultType<P> = P extends ExecutionPlan<infer R, unknown> ? R : P extends {
252
- readonly _Row?: infer R;
253
- } ? R : never;
254
223
  /**
255
224
  * Contract marker record stored in the database.
256
225
  * Represents the current contract identity for a database.
@@ -310,5 +279,5 @@ interface Contract<TStorage extends StorageBase = StorageBase, TModels extends R
310
279
  readonly meta: Record<string, unknown>;
311
280
  }
312
281
  //#endregion
313
- export { executionHash as A, ContractRelationOn as B, PlanRefs as C, StorageBase as D, Source as E, ContractFieldType as F, ReferenceRelationKeys as G, ContractVariantEntry as H, ContractModel as I, ValueObjectFieldType as J, ScalarFieldType as K, ContractModelBase as L, ContractDiscriminator as M, ContractEmbedRelation as N, StorageHashBase as O, ContractField as P, ContractReferenceRelation as R, PlanMeta as S, ResultType as T, EmbedRelationKeys as U, ContractValueObject as V, ModelStorageBase as W, FieldType as _, ColumnDefault as a, JsonValue as b, ContractMarkerRecord as c, ExecutionHashBase as d, ExecutionMutationDefault as f, Expr as g, ExecutionSection as h, Brand as i, profileHash as j, coreHash as k, DocCollection as l, ExecutionPlan as m, ContractExecutionSection as n, ColumnDefaultLiteralInputValue as o, ExecutionMutationDefaultValue as p, UnionFieldType as q, $ as r, ColumnDefaultLiteralValue as s, Contract as t, DocIndex as u, GeneratedValueSpec as v, ProfileHashBase as w, ParamDescriptor as x, JsonPrimitive as y, ContractRelation as z };
314
- //# sourceMappingURL=contract-types-MYdoYIIh.d.mts.map
282
+ export { ContractDiscriminator as A, ContractVariantEntry as B, ProfileHashBase as C, coreHash as D, StorageHashBase as E, ContractModelBase as F, UnionFieldType as G, ModelStorageBase as H, ContractReferenceRelation as I, ValueObjectFieldType as K, ContractRelation as L, ContractField as M, ContractFieldType as N, executionHash as O, ContractModel as P, ContractRelationOn as R, PlanRefs as S, StorageBase as T, ReferenceRelationKeys as U, EmbedRelationKeys as V, ScalarFieldType as W, GeneratedValueSpec as _, ColumnDefault as a, ParamDescriptor as b, ContractMarkerRecord as c, ExecutionHashBase as d, ExecutionMutationDefault as f, FieldType as g, Expr as h, Brand as i, ContractEmbedRelation as j, profileHash as k, DocCollection as l, ExecutionSection as m, ContractExecutionSection as n, ColumnDefaultLiteralInputValue as o, ExecutionMutationDefaultValue as p, $ as r, ColumnDefaultLiteralValue as s, Contract as t, DocIndex as u, JsonPrimitive as v, Source as w, PlanMeta as x, JsonValue as y, ContractValueObject as z };
283
+ //# sourceMappingURL=contract-types-CmLTUrpi.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract-types-MYdoYIIh.d.mts","names":[],"sources":["../src/domain-types.ts","../src/types.ts","../src/contract-types.ts"],"sourcesContent":[],"mappings":";KAAY,eAAA;EAAA,SAAA,IAAA,EAAA,QAAe;EAMf,SAAA,OAAA,EAAA,MAAoB;EAKpB,SAAA,UAAc,CAAA,EARF,MAQE,CAAA,MAAA,EAAA,OAAA,CAAA;CAEQ;AAAkB,KAPxC,oBAAA,GAOwC;EAAhC,SAAA,IAAA,EAAA,aAAA;EAAa,SAAA,IAAA,EAAA,MAAA;AAGjC,CAAA;AAAgC,KALpB,cAAA,GAKoB;EAAkB,SAAA,IAAA,EAAA,OAAA;EAAuB,SAAA,OAAA,EAHrD,aAGqD,CAHvC,eAGuC,GAHrB,oBAGqB,CAAA;CAAc;AAE3E,KAFA,iBAAA,GAAoB,eAIf,GAJiC,oBAIhB,GAJuC,cAIvC;AAKtB,KAPA,aAAA,GAOkB;EAKlB,SAAA,QAAA,EAAA,OAAA;EAMA,SAAA,IAAA,EAh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AA;AAMZ,CAAA;AAKA;AAEA;AAIA;AAIA;AAIA;AAEA;;;;;;;;;;AAKsB,UEvBL,QFuBK,CAAA,iBEtBH,WFsBG,GEtBW,WFsBX,EAAA,gBErBJ,MFqBI,CAAA,MAAA,EErBW,iBFqBX,CAAA,GErBgC,MFqBhC,CAAA,MAAA,EErB+C,iBFqB/C,CAAA,CAAA,CAAA;EAAM,SAAA,MAAA,EAAA,MAAA;EAKX,SAAA,YAAa,EAAA,MAAA;EAAuB,SAAA,KAAA,EEtBnC,MFsBmC,CAAA,MAAA,EAAA,MAAA,CAAA;EAAmB,SAAA,MAAA,EErBrD,OFqBqD;EAC5C,SAAA,YAAA,CAAA,EErBF,MFqBE,CAAA,MAAA,EErBa,mBFqBb,CAAA;EACM,SAAA,OAAA,EErBd,QFqBc;EAAf,SAAA,YAAA,EEpBM,MFoBN,CAAA,MAAA,EEpBqB,MFoBrB,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;EADT,SAAA,cAAA,EElBiB,MFkBjB,CAAA,MAAA,EAAA,OAAA,CAAA;EAAiB,SAAA,SAAA,CAAA,EEjBJ,wBFiBI;EAMtB,SAAA,WAAA,EEtBmB,eFsBG,CAAA,MAAA,CAAA;EAC4C,SAAA,IAAA,EEtBtD,MFsBsD,CAAA,MAAA,EAAA,OAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { O as StorageHashBase, d as ExecutionHashBase, t as Contract, w as ProfileHashBase } from "./contract-types-MYdoYIIh.mjs";
1
+ import { C as ProfileHashBase, E as StorageHashBase, d as ExecutionHashBase, t as Contract } from "./contract-types-CmLTUrpi.mjs";
2
2
 
3
3
  //#region src/canonicalization.d.ts
4
4
  declare function canonicalizeContractToObject(contract: Contract, options?: {
@@ -1,4 +1,4 @@
1
- import { D as StorageBase, I as ContractModel, L as ContractModelBase, O as StorageHashBase, V as ContractValueObject, W as ModelStorageBase, h as ExecutionSection, t as Contract, w as ProfileHashBase } from "./contract-types-MYdoYIIh.mjs";
1
+ import { C as ProfileHashBase, E as StorageHashBase, F as ContractModelBase, H as ModelStorageBase, P as ContractModel, T as StorageBase, m as ExecutionSection, t as Contract, z as ContractValueObject } from "./contract-types-CmLTUrpi.mjs";
2
2
 
3
3
  //#region src/testing-factories.d.ts
4
4
  type ContractOverrides<TStorage extends StorageBase = StorageBase, TModels extends Record<string, ContractModelBase> = Record<string, ContractModel>> = {
@@ -1 +1 @@
1
- {"version":3,"file":"types-aMyNgejf.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Unique symbol used as the key for branding types.\n */\nexport const $: unique symbol = Symbol('__prisma_next_brand__');\n\n/**\n * A helper type to brand a given type with a unique identifier.\n *\n * @template TKey Text used as the brand key.\n * @template TValue Optional value associated with the brand key. Defaults to `true`.\n */\nexport type Brand<TKey extends string | number | symbol, TValue = true> = {\n [$]: {\n [K in TKey]: TValue;\n };\n};\n\n/**\n * Base type for storage contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type StorageHash = StorageHashBase<'sha256:abc123...'>`\n */\nexport type StorageHashBase<THash extends string> = THash & Brand<'StorageHash'>;\n\n/**\n * Base type for execution contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type ExecutionHash = ExecutionHashBase<'sha256:def456...'>`\n */\nexport type ExecutionHashBase<THash extends string> = THash & Brand<'ExecutionHash'>;\n\nexport function executionHash<const T extends string>(value: T): ExecutionHashBase<T> {\n return value as ExecutionHashBase<T>;\n}\n\nexport function coreHash<const T extends string>(value: T): StorageHashBase<T> {\n return value as StorageHashBase<T>;\n}\n\n/**\n * Base type for profile contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type ProfileHash = ProfileHashBase<'sha256:def456...'>`\n */\nexport type ProfileHashBase<THash extends string> = THash & Brand<'ProfileHash'>;\n\nexport function profileHash<const T extends string>(value: T): ProfileHashBase<T> {\n return value as ProfileHashBase<T>;\n}\n\n/**\n * Base type for family-specific storage blocks.\n * Family storage types (SqlStorage, MongoStorage, etc.) extend this to carry the\n * storage hash alongside family-specific data (tables, collections, etc.).\n */\nexport interface StorageBase<THash extends string = string> {\n readonly storageHash: StorageHashBase<THash>;\n}\n\nexport interface FieldType {\n readonly type: string;\n readonly nullable: boolean;\n readonly items?: FieldType;\n readonly properties?: Record<string, FieldType>;\n}\n\nexport type GeneratedValueSpec = {\n readonly id: string;\n readonly params?: Record<string, unknown>;\n};\n\nexport type JsonPrimitive = string | number | boolean | null;\n\nexport type JsonValue =\n | JsonPrimitive\n | { readonly [key: string]: JsonValue }\n | readonly JsonValue[];\n\nexport type ColumnDefaultLiteralValue = JsonValue;\n\nexport type ColumnDefaultLiteralInputValue = ColumnDefaultLiteralValue | Date;\n\nexport type ColumnDefault =\n | {\n readonly kind: 'literal';\n readonly value: ColumnDefaultLiteralInputValue;\n }\n | { readonly kind: 'function'; readonly expression: string };\n\nexport type ExecutionMutationDefaultValue = {\n readonly kind: 'generator';\n readonly id: GeneratedValueSpec['id'];\n readonly params?: Record<string, unknown>;\n};\n\nexport type ExecutionMutationDefault = {\n readonly ref: { readonly table: string; readonly column: string };\n readonly onCreate?: ExecutionMutationDefaultValue;\n readonly onUpdate?: ExecutionMutationDefaultValue;\n};\n\nexport type ExecutionSection<THash extends string = string> = {\n readonly executionHash: ExecutionHashBase<THash>;\n readonly mutations: {\n readonly defaults: ReadonlyArray<ExecutionMutationDefault>;\n };\n};\n\nexport interface Source {\n readonly readOnly: boolean;\n readonly projection: Record<string, FieldType>;\n readonly origin?: Record<string, unknown>;\n readonly capabilities?: Record<string, boolean>;\n}\n\n// Document family types\nexport interface DocIndex {\n readonly name: string;\n readonly keys: Record<string, 'asc' | 'desc'>;\n readonly unique?: boolean;\n readonly where?: Expr;\n}\n\nexport type Expr =\n | { readonly kind: 'eq'; readonly path: ReadonlyArray<string>; readonly value: unknown }\n | { readonly kind: 'exists'; readonly path: ReadonlyArray<string> };\n\nexport interface DocCollection {\n readonly name: string;\n readonly id?: {\n readonly strategy: 'auto' | 'client' | 'uuid' | 'objectId';\n };\n readonly fields: Record<string, FieldType>;\n readonly indexes?: ReadonlyArray<DocIndex>;\n readonly readOnly?: boolean;\n}\n\n// Plan types - target-family agnostic execution types\nexport interface ParamDescriptor {\n readonly index?: number;\n readonly name?: string;\n readonly codecId?: string;\n readonly nativeType?: string;\n readonly nullable?: boolean;\n readonly source: 'dsl' | 'raw' | 'lane';\n readonly refs?: { table: string; column: string };\n}\n\nexport interface PlanRefs {\n readonly tables?: readonly string[];\n readonly columns?: ReadonlyArray<{ table: string; column: string }>;\n readonly indexes?: ReadonlyArray<{\n readonly table: string;\n readonly columns: ReadonlyArray<string>;\n readonly name?: string;\n }>;\n}\n\nexport interface PlanMeta {\n readonly target: string;\n readonly targetFamily?: string;\n readonly storageHash: string;\n readonly profileHash?: string;\n readonly lane: string;\n readonly annotations?: {\n codecs?: Record<string, string>; // alias/param → codec id ('ns/name@v')\n [key: string]: unknown;\n };\n readonly paramDescriptors: ReadonlyArray<ParamDescriptor>;\n readonly refs?: PlanRefs;\n readonly projection?: Record<string, string> | ReadonlyArray<string>;\n /**\n * Optional mapping of projection alias → column type ID (fully qualified ns/name@version).\n * Used for codec resolution when AST+refs don't provide enough type info.\n */\n readonly projectionTypes?: Record<string, string>;\n}\n\n/**\n * Canonical execution plan shape used by runtimes.\n *\n * - Row is the inferred result row type (TypeScript-only).\n * - Ast is the optional, family-specific AST type (e.g. SQL QueryAst).\n *\n * The payload executed by the runtime is represented by the sql + params pair\n * for now; future families can specialize this via Ast or additional metadata.\n */\nexport interface ExecutionPlan<Row = unknown, Ast = unknown> {\n readonly sql: string;\n readonly params: readonly unknown[];\n readonly ast?: Ast;\n readonly meta: PlanMeta;\n /**\n * Phantom property to carry the Row generic for type-level utilities.\n * Not set at runtime; used only for ResultType extraction.\n */\n readonly _row?: Row;\n}\n\n/**\n * Utility type to extract the Row type from an ExecutionPlan.\n * Example: `type Row = ResultType<typeof plan>`\n *\n * Works with both ExecutionPlan and SqlQueryPlan (SQL query plans before lowering).\n * SqlQueryPlan includes a phantom `_Row` property to preserve the generic parameter\n * for type extraction.\n */\nexport type ResultType<P> =\n P extends ExecutionPlan<infer R, unknown> ? R : P extends { readonly _Row?: infer R } ? R : never;\n\n/**\n * Contract marker record stored in the database.\n * Represents the current contract identity for a database.\n */\nexport interface ContractMarkerRecord {\n readonly storageHash: string;\n readonly profileHash: string;\n readonly contractJson: unknown | null;\n readonly canonicalVersion: number | null;\n readonly updatedAt: Date;\n readonly appTag: string | null;\n readonly meta: Record<string, unknown>;\n}\n"],"mappings":";AA+BA,SAAgB,cAAsC,OAAgC;AACpF,QAAO;;AAGT,SAAgB,SAAiC,OAA8B;AAC7E,QAAO;;AAUT,SAAgB,YAAoC,OAA8B;AAChF,QAAO"}
1
+ {"version":3,"file":"types-aMyNgejf.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * Unique symbol used as the key for branding types.\n */\nexport const $: unique symbol = Symbol('__prisma_next_brand__');\n\n/**\n * A helper type to brand a given type with a unique identifier.\n *\n * @template TKey Text used as the brand key.\n * @template TValue Optional value associated with the brand key. Defaults to `true`.\n */\nexport type Brand<TKey extends string | number | symbol, TValue = true> = {\n [$]: {\n [K in TKey]: TValue;\n };\n};\n\n/**\n * Base type for storage contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type StorageHash = StorageHashBase<'sha256:abc123...'>`\n */\nexport type StorageHashBase<THash extends string> = THash & Brand<'StorageHash'>;\n\n/**\n * Base type for execution contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type ExecutionHash = ExecutionHashBase<'sha256:def456...'>`\n */\nexport type ExecutionHashBase<THash extends string> = THash & Brand<'ExecutionHash'>;\n\nexport function executionHash<const T extends string>(value: T): ExecutionHashBase<T> {\n return value as ExecutionHashBase<T>;\n}\n\nexport function coreHash<const T extends string>(value: T): StorageHashBase<T> {\n return value as StorageHashBase<T>;\n}\n\n/**\n * Base type for profile contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type ProfileHash = ProfileHashBase<'sha256:def456...'>`\n */\nexport type ProfileHashBase<THash extends string> = THash & Brand<'ProfileHash'>;\n\nexport function profileHash<const T extends string>(value: T): ProfileHashBase<T> {\n return value as ProfileHashBase<T>;\n}\n\n/**\n * Base type for family-specific storage blocks.\n * Family storage types (SqlStorage, MongoStorage, etc.) extend this to carry the\n * storage hash alongside family-specific data (tables, collections, etc.).\n */\nexport interface StorageBase<THash extends string = string> {\n readonly storageHash: StorageHashBase<THash>;\n}\n\nexport interface FieldType {\n readonly type: string;\n readonly nullable: boolean;\n readonly items?: FieldType;\n readonly properties?: Record<string, FieldType>;\n}\n\nexport type GeneratedValueSpec = {\n readonly id: string;\n readonly params?: Record<string, unknown>;\n};\n\nexport type JsonPrimitive = string | number | boolean | null;\n\nexport type JsonValue =\n | JsonPrimitive\n | { readonly [key: string]: JsonValue }\n | readonly JsonValue[];\n\nexport type ColumnDefaultLiteralValue = JsonValue;\n\nexport type ColumnDefaultLiteralInputValue = ColumnDefaultLiteralValue | Date;\n\nexport type ColumnDefault =\n | {\n readonly kind: 'literal';\n readonly value: ColumnDefaultLiteralInputValue;\n }\n | { readonly kind: 'function'; readonly expression: string };\n\nexport type ExecutionMutationDefaultValue = {\n readonly kind: 'generator';\n readonly id: GeneratedValueSpec['id'];\n readonly params?: Record<string, unknown>;\n};\n\nexport type ExecutionMutationDefault = {\n readonly ref: { readonly table: string; readonly column: string };\n readonly onCreate?: ExecutionMutationDefaultValue;\n readonly onUpdate?: ExecutionMutationDefaultValue;\n};\n\nexport type ExecutionSection<THash extends string = string> = {\n readonly executionHash: ExecutionHashBase<THash>;\n readonly mutations: {\n readonly defaults: ReadonlyArray<ExecutionMutationDefault>;\n };\n};\n\nexport interface Source {\n readonly readOnly: boolean;\n readonly projection: Record<string, FieldType>;\n readonly origin?: Record<string, unknown>;\n readonly capabilities?: Record<string, boolean>;\n}\n\n// Document family types\nexport interface DocIndex {\n readonly name: string;\n readonly keys: Record<string, 'asc' | 'desc'>;\n readonly unique?: boolean;\n readonly where?: Expr;\n}\n\nexport type Expr =\n | { readonly kind: 'eq'; readonly path: ReadonlyArray<string>; readonly value: unknown }\n | { readonly kind: 'exists'; readonly path: ReadonlyArray<string> };\n\nexport interface DocCollection {\n readonly name: string;\n readonly id?: {\n readonly strategy: 'auto' | 'client' | 'uuid' | 'objectId';\n };\n readonly fields: Record<string, FieldType>;\n readonly indexes?: ReadonlyArray<DocIndex>;\n readonly readOnly?: boolean;\n}\n\n// Plan types - target-family agnostic execution types\nexport interface ParamDescriptor {\n readonly index?: number;\n readonly name?: string;\n readonly codecId?: string;\n readonly nativeType?: string;\n readonly nullable?: boolean;\n readonly source: 'dsl' | 'raw' | 'lane';\n readonly refs?: { table: string; column: string };\n}\n\nexport interface PlanRefs {\n readonly tables?: readonly string[];\n readonly columns?: ReadonlyArray<{ table: string; column: string }>;\n readonly indexes?: ReadonlyArray<{\n readonly table: string;\n readonly columns: ReadonlyArray<string>;\n readonly name?: string;\n }>;\n}\n\nexport interface PlanMeta {\n readonly target: string;\n readonly targetFamily?: string;\n readonly storageHash: string;\n readonly profileHash?: string;\n readonly lane: string;\n readonly annotations?: {\n codecs?: Record<string, string>; // alias/param → codec id ('ns/name@v')\n [key: string]: unknown;\n };\n readonly paramDescriptors: ReadonlyArray<ParamDescriptor>;\n readonly refs?: PlanRefs;\n readonly projection?: Record<string, string> | ReadonlyArray<string>;\n /**\n * Optional mapping of projection alias → column type ID (fully qualified ns/name@version).\n * Used for codec resolution when AST+refs don't provide enough type info.\n */\n readonly projectionTypes?: Record<string, string>;\n}\n\n/**\n * Contract marker record stored in the database.\n * Represents the current contract identity for a database.\n */\nexport interface ContractMarkerRecord {\n readonly storageHash: string;\n readonly profileHash: string;\n readonly contractJson: unknown | null;\n readonly canonicalVersion: number | null;\n readonly updatedAt: Date;\n readonly appTag: string | null;\n readonly meta: Record<string, unknown>;\n}\n"],"mappings":";AA+BA,SAAgB,cAAsC,OAAgC;AACpF,QAAO;;AAGT,SAAgB,SAAiC,OAA8B;AAC7E,QAAO;;AAUT,SAAgB,YAAoC,OAA8B;AAChF,QAAO"}
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as executionHash, B as ContractRelationOn, C as PlanRefs, D as StorageBase, E as Source, F as ContractFieldType, G as ReferenceRelationKeys, H as ContractVariantEntry, I as ContractModel, J as ValueObjectFieldType, K as ScalarFieldType, L as ContractModelBase, M as ContractDiscriminator, N as ContractEmbedRelation, O as StorageHashBase, P as ContractField, R as ContractReferenceRelation, S as PlanMeta, T as ResultType, U as EmbedRelationKeys, V as ContractValueObject, W as ModelStorageBase, _ as FieldType, a as ColumnDefault, b as JsonValue, c as ContractMarkerRecord, d as ExecutionHashBase, f as ExecutionMutationDefault, g as Expr, h as ExecutionSection, i as Brand, j as profileHash, k as coreHash, l as DocCollection, m as ExecutionPlan, n as ContractExecutionSection, o as ColumnDefaultLiteralInputValue, p as ExecutionMutationDefaultValue, q as UnionFieldType, r as $, s as ColumnDefaultLiteralValue, t as Contract, u as DocIndex, v as GeneratedValueSpec, w as ProfileHashBase, x as ParamDescriptor, y as JsonPrimitive, z as ContractRelation } from "./contract-types-MYdoYIIh.mjs";
2
- export { type $, type Brand, type ColumnDefault, type ColumnDefaultLiteralInputValue, type ColumnDefaultLiteralValue, type Contract, type ContractDiscriminator, type ContractEmbedRelation, type ContractExecutionSection, type ContractField, type ContractFieldType, type ContractMarkerRecord, type ContractModel, type ContractModelBase, type ContractReferenceRelation, type ContractRelation, type ContractRelationOn, type ContractValueObject, type ContractVariantEntry, type DocCollection, type DocIndex, type EmbedRelationKeys, type ExecutionHashBase, type ExecutionMutationDefault, type ExecutionMutationDefaultValue, type ExecutionPlan, type ExecutionSection, type Expr, type FieldType, type GeneratedValueSpec, type JsonPrimitive, type JsonValue, type ModelStorageBase, type ParamDescriptor, type PlanMeta, type PlanRefs, type ProfileHashBase, type ReferenceRelationKeys, type ResultType, type ScalarFieldType, type Source, type StorageBase, type StorageHashBase, type UnionFieldType, type ValueObjectFieldType, coreHash, executionHash, profileHash };
1
+ import { A as ContractDiscriminator, B as ContractVariantEntry, C as ProfileHashBase, D as coreHash, E as StorageHashBase, F as ContractModelBase, G as UnionFieldType, H as ModelStorageBase, I as ContractReferenceRelation, K as ValueObjectFieldType, L as ContractRelation, M as ContractField, N as ContractFieldType, O as executionHash, P as ContractModel, R as ContractRelationOn, S as PlanRefs, T as StorageBase, U as ReferenceRelationKeys, V as EmbedRelationKeys, W as ScalarFieldType, _ as GeneratedValueSpec, a as ColumnDefault, b as ParamDescriptor, c as ContractMarkerRecord, d as ExecutionHashBase, f as ExecutionMutationDefault, g as FieldType, h as Expr, i as Brand, j as ContractEmbedRelation, k as profileHash, l as DocCollection, m as ExecutionSection, n as ContractExecutionSection, o as ColumnDefaultLiteralInputValue, p as ExecutionMutationDefaultValue, r as $, s as ColumnDefaultLiteralValue, t as Contract, u as DocIndex, v as JsonPrimitive, w as Source, x as PlanMeta, y as JsonValue, z as ContractValueObject } from "./contract-types-CmLTUrpi.mjs";
2
+ export { type $, type Brand, type ColumnDefault, type ColumnDefaultLiteralInputValue, type ColumnDefaultLiteralValue, type Contract, type ContractDiscriminator, type ContractEmbedRelation, type ContractExecutionSection, type ContractField, type ContractFieldType, type ContractMarkerRecord, type ContractModel, type ContractModelBase, type ContractReferenceRelation, type ContractRelation, type ContractRelationOn, type ContractValueObject, type ContractVariantEntry, type DocCollection, type DocIndex, type EmbedRelationKeys, type ExecutionHashBase, type ExecutionMutationDefault, type ExecutionMutationDefaultValue, type ExecutionSection, type Expr, type FieldType, type GeneratedValueSpec, type JsonPrimitive, type JsonValue, type ModelStorageBase, type ParamDescriptor, type PlanMeta, type PlanRefs, type ProfileHashBase, type ReferenceRelationKeys, type ScalarFieldType, type Source, type StorageBase, type StorageHashBase, type UnionFieldType, type ValueObjectFieldType, coreHash, executionHash, profileHash };
@@ -1,4 +1,4 @@
1
- import { t as Contract } from "./contract-types-MYdoYIIh.mjs";
1
+ import { t as Contract } from "./contract-types-CmLTUrpi.mjs";
2
2
 
3
3
  //#region src/validate-contract.d.ts
4
4
  type ContractValidationPhase = 'structural' | 'domain' | 'storage';
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@prisma-next/contract",
3
- "version": "0.5.0-dev.8",
3
+ "version": "0.5.0-dev.9",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Data contract type definitions and JSON schema for Prisma Next",
7
7
  "dependencies": {
8
8
  "arktype": "^2.1.29",
9
- "@prisma-next/utils": "0.5.0-dev.8"
9
+ "@prisma-next/utils": "0.5.0-dev.9"
10
10
  },
11
11
  "devDependencies": {
12
12
  "tsdown": "0.18.4",
@@ -30,7 +30,6 @@ export type {
30
30
  ExecutionHashBase,
31
31
  ExecutionMutationDefault,
32
32
  ExecutionMutationDefaultValue,
33
- ExecutionPlan,
34
33
  ExecutionSection,
35
34
  Expr,
36
35
  FieldType,
@@ -41,7 +40,6 @@ export type {
41
40
  PlanMeta,
42
41
  PlanRefs,
43
42
  ProfileHashBase,
44
- ResultType,
45
43
  Source,
46
44
  StorageBase,
47
45
  StorageHashBase,
package/src/types.ts CHANGED
@@ -176,38 +176,6 @@ export interface PlanMeta {
176
176
  readonly projectionTypes?: Record<string, string>;
177
177
  }
178
178
 
179
- /**
180
- * Canonical execution plan shape used by runtimes.
181
- *
182
- * - Row is the inferred result row type (TypeScript-only).
183
- * - Ast is the optional, family-specific AST type (e.g. SQL QueryAst).
184
- *
185
- * The payload executed by the runtime is represented by the sql + params pair
186
- * for now; future families can specialize this via Ast or additional metadata.
187
- */
188
- export interface ExecutionPlan<Row = unknown, Ast = unknown> {
189
- readonly sql: string;
190
- readonly params: readonly unknown[];
191
- readonly ast?: Ast;
192
- readonly meta: PlanMeta;
193
- /**
194
- * Phantom property to carry the Row generic for type-level utilities.
195
- * Not set at runtime; used only for ResultType extraction.
196
- */
197
- readonly _row?: Row;
198
- }
199
-
200
- /**
201
- * Utility type to extract the Row type from an ExecutionPlan.
202
- * Example: `type Row = ResultType<typeof plan>`
203
- *
204
- * Works with both ExecutionPlan and SqlQueryPlan (SQL query plans before lowering).
205
- * SqlQueryPlan includes a phantom `_Row` property to preserve the generic parameter
206
- * for type extraction.
207
- */
208
- export type ResultType<P> =
209
- P extends ExecutionPlan<infer R, unknown> ? R : P extends { readonly _Row?: infer R } ? R : never;
210
-
211
179
  /**
212
180
  * Contract marker record stored in the database.
213
181
  * Represents the current contract identity for a database.