@prisma-next/contract 0.3.0-dev.137 → 0.3.0-dev.138
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/contract-types-C0y-Bn8M.d.mts +512 -0
- package/dist/contract-types-C0y-Bn8M.d.mts.map +1 -0
- package/dist/{ir-DkfZ4S60.d.mts → ir-BPkihpFL.d.mts} +1 -1
- package/dist/{ir-DkfZ4S60.d.mts.map → ir-BPkihpFL.d.mts.map} +1 -1
- package/dist/ir.d.mts +1 -1
- package/dist/types.d.mts +2 -443
- package/dist/types.mjs.map +1 -1
- package/dist/validate-contract.d.mts +35 -0
- package/dist/validate-contract.d.mts.map +1 -0
- package/dist/validate-contract.mjs +61 -0
- package/dist/validate-contract.mjs.map +1 -0
- package/dist/validate-domain-WfuBWGsF.mjs +84 -0
- package/dist/validate-domain-WfuBWGsF.mjs.map +1 -0
- package/dist/validate-domain.mjs +2 -83
- package/package.json +5 -3
- package/src/contract-types.ts +54 -0
- package/src/domain-types.ts +41 -18
- package/src/exports/types.ts +11 -0
- package/src/exports/validate-contract.ts +5 -0
- package/src/types.ts +9 -0
- package/src/validate-contract.ts +93 -0
- package/dist/types.d.mts.map +0 -1
- package/dist/validate-domain.mjs.map +0 -1
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
import { t as ContractIR } from "./ir-BPkihpFL.mjs";
|
|
2
|
+
import { OperationRegistry } from "@prisma-next/operations";
|
|
3
|
+
|
|
4
|
+
//#region src/domain-types.d.ts
|
|
5
|
+
type ContractField = {
|
|
6
|
+
readonly nullable: boolean;
|
|
7
|
+
readonly codecId: string;
|
|
8
|
+
};
|
|
9
|
+
type ContractRelationOn = {
|
|
10
|
+
readonly localFields: readonly string[];
|
|
11
|
+
readonly targetFields: readonly string[];
|
|
12
|
+
};
|
|
13
|
+
type ContractReferenceRelation = {
|
|
14
|
+
readonly to: string;
|
|
15
|
+
readonly cardinality: '1:1' | '1:N' | 'N:1';
|
|
16
|
+
readonly on: ContractRelationOn;
|
|
17
|
+
};
|
|
18
|
+
type ContractEmbedRelation = {
|
|
19
|
+
readonly to: string;
|
|
20
|
+
readonly cardinality: '1:1' | '1:N';
|
|
21
|
+
};
|
|
22
|
+
type ContractRelation = ContractReferenceRelation | ContractEmbedRelation;
|
|
23
|
+
type ContractDiscriminator = {
|
|
24
|
+
readonly field: string;
|
|
25
|
+
};
|
|
26
|
+
type ContractVariantEntry = {
|
|
27
|
+
readonly value: string;
|
|
28
|
+
};
|
|
29
|
+
type ModelStorageBase = Readonly<Record<string, unknown>>;
|
|
30
|
+
interface ContractModel<TModelStorage extends ModelStorageBase = ModelStorageBase> {
|
|
31
|
+
readonly fields: Record<string, ContractField>;
|
|
32
|
+
readonly relations: Record<string, ContractRelation>;
|
|
33
|
+
readonly storage: TModelStorage;
|
|
34
|
+
readonly discriminator?: ContractDiscriminator;
|
|
35
|
+
readonly variants?: Record<string, ContractVariantEntry>;
|
|
36
|
+
readonly base?: string;
|
|
37
|
+
readonly owner?: string;
|
|
38
|
+
}
|
|
39
|
+
/** @deprecated Use {@link ContractField} */
|
|
40
|
+
type DomainField = ContractField;
|
|
41
|
+
/** @deprecated Use {@link ContractRelationOn} */
|
|
42
|
+
type DomainRelationOn = ContractRelationOn;
|
|
43
|
+
/** @deprecated Use {@link ContractReferenceRelation} */
|
|
44
|
+
type DomainReferenceRelation = ContractReferenceRelation;
|
|
45
|
+
/** @deprecated Use {@link ContractEmbedRelation} */
|
|
46
|
+
type DomainEmbedRelation = ContractEmbedRelation;
|
|
47
|
+
/** @deprecated Use {@link ContractRelation} */
|
|
48
|
+
type DomainRelation = ContractRelation;
|
|
49
|
+
/** @deprecated Use {@link ContractDiscriminator} */
|
|
50
|
+
type DomainDiscriminator = ContractDiscriminator;
|
|
51
|
+
/** @deprecated Use {@link ContractVariantEntry} */
|
|
52
|
+
type DomainVariantEntry = ContractVariantEntry;
|
|
53
|
+
/** @deprecated Use {@link ContractModel} */
|
|
54
|
+
type DomainModel = ContractModel;
|
|
55
|
+
type HasModelsWithRelations = {
|
|
56
|
+
readonly models: Record<string, {
|
|
57
|
+
readonly relations: Record<string, ContractRelation>;
|
|
58
|
+
}>;
|
|
59
|
+
};
|
|
60
|
+
type ReferenceRelationKeys<TContract extends HasModelsWithRelations, ModelName extends string & keyof TContract['models']> = { [K in keyof TContract['models'][ModelName]['relations']]: TContract['models'][ModelName]['relations'][K] extends ContractReferenceRelation ? K : never }[keyof TContract['models'][ModelName]['relations']];
|
|
61
|
+
type EmbedRelationKeys<TContract extends HasModelsWithRelations, ModelName extends string & keyof TContract['models']> = { [K in keyof TContract['models'][ModelName]['relations']]: TContract['models'][ModelName]['relations'][K] extends ContractReferenceRelation ? never : K }[keyof TContract['models'][ModelName]['relations']];
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/types.d.ts
|
|
64
|
+
/**
|
|
65
|
+
* Unique symbol used as the key for branding types.
|
|
66
|
+
*/
|
|
67
|
+
declare const $: unique symbol;
|
|
68
|
+
/**
|
|
69
|
+
* A helper type to brand a given type with a unique identifier.
|
|
70
|
+
*
|
|
71
|
+
* @template TKey Text used as the brand key.
|
|
72
|
+
* @template TValue Optional value associated with the brand key. Defaults to `true`.
|
|
73
|
+
*/
|
|
74
|
+
type Brand<TKey extends string | number | symbol, TValue = true> = {
|
|
75
|
+
[$]: { [K in TKey]: TValue };
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Context passed to type renderers during contract.d.ts generation.
|
|
79
|
+
*/
|
|
80
|
+
interface RenderTypeContext {
|
|
81
|
+
/** The name of the CodecTypes type alias (typically 'CodecTypes') */
|
|
82
|
+
readonly codecTypesName: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Base type for storage contract hashes.
|
|
86
|
+
* Emitted contract.d.ts files use this with the hash value as a type parameter:
|
|
87
|
+
* `type StorageHash = StorageHashBase<'sha256:abc123...'>`
|
|
88
|
+
*/
|
|
89
|
+
type StorageHashBase<THash extends string> = THash & Brand<'StorageHash'>;
|
|
90
|
+
/**
|
|
91
|
+
* Base type for execution contract hashes.
|
|
92
|
+
* Emitted contract.d.ts files use this with the hash value as a type parameter:
|
|
93
|
+
* `type ExecutionHash = ExecutionHashBase<'sha256:def456...'>`
|
|
94
|
+
*/
|
|
95
|
+
type ExecutionHashBase<THash extends string> = THash & Brand<'ExecutionHash'>;
|
|
96
|
+
declare function coreHash<const T extends string>(value: T): StorageHashBase<T>;
|
|
97
|
+
/**
|
|
98
|
+
* Base type for profile contract hashes.
|
|
99
|
+
* Emitted contract.d.ts files use this with the hash value as a type parameter:
|
|
100
|
+
* `type ProfileHash = ProfileHashBase<'sha256:def456...'>`
|
|
101
|
+
*/
|
|
102
|
+
type ProfileHashBase<THash extends string> = THash & Brand<'ProfileHash'>;
|
|
103
|
+
declare function profileHash<const T extends string>(value: T): ProfileHashBase<T>;
|
|
104
|
+
/**
|
|
105
|
+
* Base type for family-specific storage blocks.
|
|
106
|
+
* Family storage types (SqlStorage, MongoStorage, etc.) extend this to carry the
|
|
107
|
+
* storage hash alongside family-specific data (tables, collections, etc.).
|
|
108
|
+
*/
|
|
109
|
+
interface StorageBase<THash extends string = string> {
|
|
110
|
+
readonly storageHash: StorageHashBase<THash>;
|
|
111
|
+
}
|
|
112
|
+
interface ContractBase<TStorageHash extends StorageHashBase<string> = StorageHashBase<string>, TExecutionHash extends ExecutionHashBase<string> = ExecutionHashBase<string>, TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>> {
|
|
113
|
+
readonly schemaVersion: string;
|
|
114
|
+
readonly target: string;
|
|
115
|
+
readonly targetFamily: string;
|
|
116
|
+
readonly storageHash: TStorageHash;
|
|
117
|
+
readonly executionHash?: TExecutionHash | undefined;
|
|
118
|
+
readonly profileHash?: TProfileHash | undefined;
|
|
119
|
+
readonly capabilities: Record<string, Record<string, boolean>>;
|
|
120
|
+
readonly extensionPacks: Record<string, unknown>;
|
|
121
|
+
readonly meta: Record<string, unknown>;
|
|
122
|
+
readonly sources: Record<string, Source>;
|
|
123
|
+
readonly execution?: ExecutionSection;
|
|
124
|
+
readonly roots: Record<string, string>;
|
|
125
|
+
readonly models: Record<string, DomainModel>;
|
|
126
|
+
}
|
|
127
|
+
interface FieldType {
|
|
128
|
+
readonly type: string;
|
|
129
|
+
readonly nullable: boolean;
|
|
130
|
+
readonly items?: FieldType;
|
|
131
|
+
readonly properties?: Record<string, FieldType>;
|
|
132
|
+
}
|
|
133
|
+
type GeneratedValueSpec = {
|
|
134
|
+
readonly id: string;
|
|
135
|
+
readonly params?: Record<string, unknown>;
|
|
136
|
+
};
|
|
137
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
138
|
+
type JsonValue = JsonPrimitive | {
|
|
139
|
+
readonly [key: string]: JsonValue;
|
|
140
|
+
} | readonly JsonValue[];
|
|
141
|
+
type TaggedBigInt = {
|
|
142
|
+
readonly $type: 'bigint';
|
|
143
|
+
readonly value: string;
|
|
144
|
+
};
|
|
145
|
+
declare function isTaggedBigInt(value: unknown): value is TaggedBigInt;
|
|
146
|
+
declare function bigintJsonReplacer(_key: string, value: unknown): unknown;
|
|
147
|
+
type TaggedRaw = {
|
|
148
|
+
readonly $type: 'raw';
|
|
149
|
+
readonly value: JsonValue;
|
|
150
|
+
};
|
|
151
|
+
declare function isTaggedRaw(value: unknown): value is TaggedRaw;
|
|
152
|
+
type TaggedLiteralValue = TaggedBigInt | TaggedRaw;
|
|
153
|
+
type ColumnDefaultLiteralValue = JsonValue | TaggedLiteralValue;
|
|
154
|
+
type ColumnDefaultLiteralInputValue = ColumnDefaultLiteralValue | bigint | Date;
|
|
155
|
+
type ColumnDefault = {
|
|
156
|
+
readonly kind: 'literal';
|
|
157
|
+
readonly value: ColumnDefaultLiteralInputValue;
|
|
158
|
+
} | {
|
|
159
|
+
readonly kind: 'function';
|
|
160
|
+
readonly expression: string;
|
|
161
|
+
};
|
|
162
|
+
type ExecutionMutationDefaultValue = {
|
|
163
|
+
readonly kind: 'generator';
|
|
164
|
+
readonly id: GeneratedValueSpec['id'];
|
|
165
|
+
readonly params?: Record<string, unknown>;
|
|
166
|
+
};
|
|
167
|
+
type ExecutionMutationDefault = {
|
|
168
|
+
readonly ref: {
|
|
169
|
+
readonly table: string;
|
|
170
|
+
readonly column: string;
|
|
171
|
+
};
|
|
172
|
+
readonly onCreate?: ExecutionMutationDefaultValue;
|
|
173
|
+
readonly onUpdate?: ExecutionMutationDefaultValue;
|
|
174
|
+
};
|
|
175
|
+
type ExecutionSection = {
|
|
176
|
+
readonly mutations: {
|
|
177
|
+
readonly defaults: ReadonlyArray<ExecutionMutationDefault>;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
interface Source {
|
|
181
|
+
readonly readOnly: boolean;
|
|
182
|
+
readonly projection: Record<string, FieldType>;
|
|
183
|
+
readonly origin?: Record<string, unknown>;
|
|
184
|
+
readonly capabilities?: Record<string, boolean>;
|
|
185
|
+
}
|
|
186
|
+
interface DocIndex {
|
|
187
|
+
readonly name: string;
|
|
188
|
+
readonly keys: Record<string, 'asc' | 'desc'>;
|
|
189
|
+
readonly unique?: boolean;
|
|
190
|
+
readonly where?: Expr;
|
|
191
|
+
}
|
|
192
|
+
type Expr = {
|
|
193
|
+
readonly kind: 'eq';
|
|
194
|
+
readonly path: ReadonlyArray<string>;
|
|
195
|
+
readonly value: unknown;
|
|
196
|
+
} | {
|
|
197
|
+
readonly kind: 'exists';
|
|
198
|
+
readonly path: ReadonlyArray<string>;
|
|
199
|
+
};
|
|
200
|
+
interface DocCollection {
|
|
201
|
+
readonly name: string;
|
|
202
|
+
readonly id?: {
|
|
203
|
+
readonly strategy: 'auto' | 'client' | 'uuid' | 'objectId';
|
|
204
|
+
};
|
|
205
|
+
readonly fields: Record<string, FieldType>;
|
|
206
|
+
readonly indexes?: ReadonlyArray<DocIndex>;
|
|
207
|
+
readonly readOnly?: boolean;
|
|
208
|
+
}
|
|
209
|
+
interface DocumentStorage {
|
|
210
|
+
readonly document: {
|
|
211
|
+
readonly collections: Record<string, DocCollection>;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
interface DocumentContract<TStorageHash extends StorageHashBase<string> = StorageHashBase<string>, TExecutionHash extends ExecutionHashBase<string> = ExecutionHashBase<string>, TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>> extends ContractBase<TStorageHash, TExecutionHash, TProfileHash> {
|
|
215
|
+
readonly targetFamily: string;
|
|
216
|
+
readonly storage: DocumentStorage;
|
|
217
|
+
}
|
|
218
|
+
interface ParamDescriptor {
|
|
219
|
+
readonly index?: number;
|
|
220
|
+
readonly name?: string;
|
|
221
|
+
readonly codecId?: string;
|
|
222
|
+
readonly nativeType?: string;
|
|
223
|
+
readonly nullable?: boolean;
|
|
224
|
+
readonly source: 'dsl' | 'raw' | 'lane';
|
|
225
|
+
readonly refs?: {
|
|
226
|
+
table: string;
|
|
227
|
+
column: string;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
interface PlanRefs {
|
|
231
|
+
readonly tables?: readonly string[];
|
|
232
|
+
readonly columns?: ReadonlyArray<{
|
|
233
|
+
table: string;
|
|
234
|
+
column: string;
|
|
235
|
+
}>;
|
|
236
|
+
readonly indexes?: ReadonlyArray<{
|
|
237
|
+
readonly table: string;
|
|
238
|
+
readonly columns: ReadonlyArray<string>;
|
|
239
|
+
readonly name?: string;
|
|
240
|
+
}>;
|
|
241
|
+
}
|
|
242
|
+
interface PlanMeta {
|
|
243
|
+
readonly target: string;
|
|
244
|
+
readonly targetFamily?: string;
|
|
245
|
+
readonly storageHash: string;
|
|
246
|
+
readonly profileHash?: string;
|
|
247
|
+
readonly lane: string;
|
|
248
|
+
readonly annotations?: {
|
|
249
|
+
codecs?: Record<string, string>;
|
|
250
|
+
[key: string]: unknown;
|
|
251
|
+
};
|
|
252
|
+
readonly paramDescriptors: ReadonlyArray<ParamDescriptor>;
|
|
253
|
+
readonly refs?: PlanRefs;
|
|
254
|
+
readonly projection?: Record<string, string> | ReadonlyArray<string>;
|
|
255
|
+
/**
|
|
256
|
+
* Optional mapping of projection alias → column type ID (fully qualified ns/name@version).
|
|
257
|
+
* Used for codec resolution when AST+refs don't provide enough type info.
|
|
258
|
+
*/
|
|
259
|
+
readonly projectionTypes?: Record<string, string>;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Canonical execution plan shape used by runtimes.
|
|
263
|
+
*
|
|
264
|
+
* - Row is the inferred result row type (TypeScript-only).
|
|
265
|
+
* - Ast is the optional, family-specific AST type (e.g. SQL QueryAst).
|
|
266
|
+
*
|
|
267
|
+
* The payload executed by the runtime is represented by the sql + params pair
|
|
268
|
+
* for now; future families can specialize this via Ast or additional metadata.
|
|
269
|
+
*/
|
|
270
|
+
interface ExecutionPlan<Row = unknown, Ast = unknown> {
|
|
271
|
+
readonly sql: string;
|
|
272
|
+
readonly params: readonly unknown[];
|
|
273
|
+
readonly ast?: Ast;
|
|
274
|
+
readonly meta: PlanMeta;
|
|
275
|
+
/**
|
|
276
|
+
* Phantom property to carry the Row generic for type-level utilities.
|
|
277
|
+
* Not set at runtime; used only for ResultType extraction.
|
|
278
|
+
*/
|
|
279
|
+
readonly _row?: Row;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Utility type to extract the Row type from an ExecutionPlan.
|
|
283
|
+
* Example: `type Row = ResultType<typeof plan>`
|
|
284
|
+
*
|
|
285
|
+
* Works with both ExecutionPlan and SqlQueryPlan (SQL query plans before lowering).
|
|
286
|
+
* SqlQueryPlan includes a phantom `_Row` property to preserve the generic parameter
|
|
287
|
+
* for type extraction.
|
|
288
|
+
*/
|
|
289
|
+
type ResultType<P> = P extends ExecutionPlan<infer R, unknown> ? R : P extends {
|
|
290
|
+
readonly _Row?: infer R;
|
|
291
|
+
} ? R : never;
|
|
292
|
+
/**
|
|
293
|
+
* Type guard to check if a contract is a Document contract
|
|
294
|
+
*/
|
|
295
|
+
declare function isDocumentContract(contract: unknown): contract is DocumentContract;
|
|
296
|
+
/**
|
|
297
|
+
* Contract marker record stored in the database.
|
|
298
|
+
* Represents the current contract identity for a database.
|
|
299
|
+
*/
|
|
300
|
+
interface ContractMarkerRecord {
|
|
301
|
+
readonly storageHash: string;
|
|
302
|
+
readonly profileHash: string;
|
|
303
|
+
readonly contractJson: unknown | null;
|
|
304
|
+
readonly canonicalVersion: number | null;
|
|
305
|
+
readonly updatedAt: Date;
|
|
306
|
+
readonly appTag: string | null;
|
|
307
|
+
readonly meta: Record<string, unknown>;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Specifies how to import TypeScript types from a package.
|
|
311
|
+
* Used in extension pack manifests to declare codec and operation type imports.
|
|
312
|
+
*/
|
|
313
|
+
interface TypesImportSpec {
|
|
314
|
+
readonly package: string;
|
|
315
|
+
readonly named: string;
|
|
316
|
+
readonly alias: string;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Validation context passed to TargetFamilyHook.validateTypes().
|
|
320
|
+
* Contains pre-assembled operation registry, type imports, and extension IDs.
|
|
321
|
+
*/
|
|
322
|
+
interface ValidationContext {
|
|
323
|
+
readonly operationRegistry?: OperationRegistry;
|
|
324
|
+
readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
325
|
+
readonly operationTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
326
|
+
readonly extensionIds?: ReadonlyArray<string>;
|
|
327
|
+
/**
|
|
328
|
+
* Parameterized codec descriptors collected from adapters and extensions.
|
|
329
|
+
* Map of codecId → descriptor for quick lookup during type generation.
|
|
330
|
+
*/
|
|
331
|
+
readonly parameterizedCodecs?: Map<string, ParameterizedCodecDescriptor>;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Context for rendering parameterized types during contract.d.ts generation.
|
|
335
|
+
* Passed to type renderers so they can reference CodecTypes by name.
|
|
336
|
+
*/
|
|
337
|
+
interface TypeRenderContext {
|
|
338
|
+
readonly codecTypesName: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* A normalized type renderer for parameterized codecs.
|
|
342
|
+
* This is the interface expected by TargetFamilyHook.generateContractTypes.
|
|
343
|
+
*/
|
|
344
|
+
interface TypeRenderEntry {
|
|
345
|
+
readonly codecId: string;
|
|
346
|
+
readonly render: (params: Record<string, unknown>, ctx: TypeRenderContext) => string;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Additional options for generateContractTypes.
|
|
350
|
+
*/
|
|
351
|
+
interface GenerateContractTypesOptions {
|
|
352
|
+
/**
|
|
353
|
+
* Normalized parameterized type renderers, keyed by codecId.
|
|
354
|
+
* When a column has typeParams and a renderer exists for its codecId,
|
|
355
|
+
* the renderer is called to produce the TypeScript type expression.
|
|
356
|
+
*/
|
|
357
|
+
readonly parameterizedRenderers?: Map<string, TypeRenderEntry>;
|
|
358
|
+
/**
|
|
359
|
+
* Type imports for parameterized codecs.
|
|
360
|
+
* These are merged with codec and operation type imports in contract.d.ts.
|
|
361
|
+
*/
|
|
362
|
+
readonly parameterizedTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
363
|
+
/**
|
|
364
|
+
* Query operation type imports for the query builder.
|
|
365
|
+
* Flat operation signatures keyed by operation name, emitted as standalone QueryOperationTypes.
|
|
366
|
+
*/
|
|
367
|
+
readonly queryOperationTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* SPI interface for target family hooks that extend emission behavior.
|
|
371
|
+
* Implemented by family-specific emitter hooks (e.g., SQL family).
|
|
372
|
+
*/
|
|
373
|
+
interface TargetFamilyHook {
|
|
374
|
+
readonly id: string;
|
|
375
|
+
/**
|
|
376
|
+
* Validates that all type IDs in the contract come from referenced extension packs.
|
|
377
|
+
* @param ir - Contract IR to validate
|
|
378
|
+
* @param ctx - Validation context with operation registry and extension IDs
|
|
379
|
+
*/
|
|
380
|
+
validateTypes(ir: ContractIR, ctx: ValidationContext): void;
|
|
381
|
+
/**
|
|
382
|
+
* Validates family-specific contract structure.
|
|
383
|
+
* @param ir - Contract IR to validate
|
|
384
|
+
*/
|
|
385
|
+
validateStructure(ir: ContractIR): void;
|
|
386
|
+
/**
|
|
387
|
+
* Generates contract.d.ts file content.
|
|
388
|
+
* @param ir - Contract IR
|
|
389
|
+
* @param codecTypeImports - Array of codec type import specs
|
|
390
|
+
* @param operationTypeImports - Array of operation type import specs
|
|
391
|
+
* @param hashes - Contract hash values (storageHash, executionHash, profileHash)
|
|
392
|
+
* @param options - Additional options including parameterized type renderers
|
|
393
|
+
* @returns Generated TypeScript type definitions as string
|
|
394
|
+
*/
|
|
395
|
+
generateContractTypes(ir: ContractIR, codecTypeImports: ReadonlyArray<TypesImportSpec>, operationTypeImports: ReadonlyArray<TypesImportSpec>, hashes: {
|
|
396
|
+
readonly storageHash: string;
|
|
397
|
+
readonly executionHash?: string;
|
|
398
|
+
readonly profileHash: string;
|
|
399
|
+
}, options?: GenerateContractTypesOptions): string;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Declarative type renderer that produces a TypeScript type expression.
|
|
403
|
+
*
|
|
404
|
+
* Renderers can be:
|
|
405
|
+
* - A template string with `{{paramName}}` placeholders (e.g., `Vector<{{length}}>`)
|
|
406
|
+
* - A function that receives typeParams and context and returns a type expression
|
|
407
|
+
*
|
|
408
|
+
* **Prefer template strings** for most cases:
|
|
409
|
+
* - Templates are JSON-serializable (safe for pack-ref metadata)
|
|
410
|
+
* - Templates can be statically analyzed by tooling
|
|
411
|
+
*
|
|
412
|
+
* Function renderers are allowed but have tradeoffs:
|
|
413
|
+
* - Require runtime execution during emission (the emitter runs code)
|
|
414
|
+
* - Not JSON-serializable (can't be stored in contract.json)
|
|
415
|
+
* - The emitted artifacts (contract.json, contract.d.ts) still contain no
|
|
416
|
+
* executable code - this constraint applies to outputs, not the emission process
|
|
417
|
+
*/
|
|
418
|
+
type TypeRenderer = string | ((params: Record<string, unknown>, ctx: RenderTypeContext) => string);
|
|
419
|
+
/**
|
|
420
|
+
* Descriptor for a codec that supports type parameters.
|
|
421
|
+
*
|
|
422
|
+
* Parameterized codecs allow columns to carry additional metadata (typeParams)
|
|
423
|
+
* that affects the generated TypeScript types. For example:
|
|
424
|
+
* - A vector codec can use `{ length: 1536 }` to generate `Vector<1536>`
|
|
425
|
+
* - A decimal codec can use `{ precision: 10, scale: 2 }` to generate `Decimal<10, 2>`
|
|
426
|
+
*
|
|
427
|
+
* The SQL family emitter uses these descriptors to generate precise types
|
|
428
|
+
* without hard-coding knowledge of specific codec IDs.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* const vectorCodecDescriptor: ParameterizedCodecDescriptor = {
|
|
433
|
+
* codecId: 'pg/vector@1',
|
|
434
|
+
* outputTypeRenderer: 'Vector<{{length}}>',
|
|
435
|
+
* // Optional: paramsSchema for runtime validation
|
|
436
|
+
* };
|
|
437
|
+
* ```
|
|
438
|
+
*/
|
|
439
|
+
interface ParameterizedCodecDescriptor {
|
|
440
|
+
/** The codec ID this descriptor applies to (e.g., 'pg/vector@1') */
|
|
441
|
+
readonly codecId: string;
|
|
442
|
+
/**
|
|
443
|
+
* Renderer for the output (read) type.
|
|
444
|
+
* Can be a template string or function.
|
|
445
|
+
*
|
|
446
|
+
* This is the primary renderer used by SQL emission to generate
|
|
447
|
+
* model field types in contract.d.ts.
|
|
448
|
+
*/
|
|
449
|
+
readonly outputTypeRenderer: TypeRenderer;
|
|
450
|
+
/**
|
|
451
|
+
* Optional renderer for the input (write) type.
|
|
452
|
+
* If not provided, outputTypeRenderer is used for both.
|
|
453
|
+
*
|
|
454
|
+
* **Reserved for future use**: Currently, SQL emission only uses
|
|
455
|
+
* outputTypeRenderer. This field is defined for future support of
|
|
456
|
+
* asymmetric codecs where input and output types differ (e.g., a
|
|
457
|
+
* codec that accepts `string | number` but always returns `number`).
|
|
458
|
+
*/
|
|
459
|
+
readonly inputTypeRenderer?: TypeRenderer;
|
|
460
|
+
/**
|
|
461
|
+
* Optional import spec for types used by this codec's renderers.
|
|
462
|
+
* The emitter will add this import to contract.d.ts.
|
|
463
|
+
*/
|
|
464
|
+
readonly typesImport?: TypesImportSpec;
|
|
465
|
+
}
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region src/contract-types.d.ts
|
|
468
|
+
/**
|
|
469
|
+
* Execution section for the unified contract (ADR 182).
|
|
470
|
+
*
|
|
471
|
+
* Unlike the legacy {@link import('./types').ExecutionSection}, this type
|
|
472
|
+
* requires `executionHash` — when an execution section is present, its
|
|
473
|
+
* hash must be too (consistent with `StorageBase.storageHash`).
|
|
474
|
+
*
|
|
475
|
+
* @template THash Literal hash string type for type-safe hash tracking.
|
|
476
|
+
*/
|
|
477
|
+
type ContractExecutionSection<THash extends string = string> = {
|
|
478
|
+
readonly executionHash: ExecutionHashBase<THash>;
|
|
479
|
+
readonly mutations: {
|
|
480
|
+
readonly defaults: ReadonlyArray<ExecutionMutationDefault>;
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
/**
|
|
484
|
+
* Unified contract representation (ADR 182).
|
|
485
|
+
*
|
|
486
|
+
* A `Contract` is the canonical in-memory representation of a data contract.
|
|
487
|
+
* It is model-first (domain models carry their own storage bridge) and
|
|
488
|
+
* family-parameterized (SQL, Mongo, etc. specialize via `TStorage` and model
|
|
489
|
+
* storage generics on `ContractModel`).
|
|
490
|
+
*
|
|
491
|
+
* JSON persistence fields (`schemaVersion`, `sources`) are not represented
|
|
492
|
+
* here — they are handled at the serialization boundary.
|
|
493
|
+
*
|
|
494
|
+
* @template TStorage Family-specific storage block (extends {@link StorageBase}).
|
|
495
|
+
* @template TModels Record of model name → {@link ContractModel} with
|
|
496
|
+
* family-specific model storage.
|
|
497
|
+
*/
|
|
498
|
+
interface Contract<TStorage extends StorageBase = StorageBase, TModels extends Record<string, ContractModel> = Record<string, ContractModel>> {
|
|
499
|
+
readonly target: string;
|
|
500
|
+
readonly targetFamily: string;
|
|
501
|
+
readonly roots: Record<string, string>;
|
|
502
|
+
readonly models: TModels;
|
|
503
|
+
readonly storage: TStorage;
|
|
504
|
+
readonly capabilities: Record<string, Record<string, boolean>>;
|
|
505
|
+
readonly extensionPacks: Record<string, unknown>;
|
|
506
|
+
readonly execution?: ContractExecutionSection;
|
|
507
|
+
readonly profileHash?: ProfileHashBase<string>;
|
|
508
|
+
readonly meta: Record<string, unknown>;
|
|
509
|
+
}
|
|
510
|
+
//#endregion
|
|
511
|
+
export { ContractModel as $, RenderTypeContext as A, TypeRenderEntry as B, JsonPrimitive as C, PlanMeta as D, ParameterizedCodecDescriptor as E, TaggedBigInt as F, coreHash as G, TypesImportSpec as H, TaggedLiteralValue as I, isTaggedRaw as J, isDocumentContract as K, TaggedRaw as L, Source as M, StorageBase as N, PlanRefs as O, StorageHashBase as P, ContractField as Q, TargetFamilyHook as R, GeneratedValueSpec as S, ParamDescriptor as T, ValidationContext as U, TypeRenderer as V, bigintJsonReplacer as W, ContractDiscriminator as X, profileHash as Y, ContractEmbedRelation as Z, ExecutionPlan as _, ColumnDefault as a, DomainEmbedRelation as at, FieldType as b, ContractBase as c, DomainReferenceRelation as ct, DocIndex as d, DomainVariantEntry as dt, ContractReferenceRelation as et, DocumentContract as f, EmbedRelationKeys as ft, ExecutionMutationDefaultValue as g, ExecutionMutationDefault as h, Brand as i, DomainDiscriminator as it, ResultType as j, ProfileHashBase as k, ContractMarkerRecord as l, DomainRelation as lt, ExecutionHashBase as m, ReferenceRelationKeys as mt, ContractExecutionSection as n, ContractRelationOn as nt, ColumnDefaultLiteralInputValue as o, DomainField as ot, DocumentStorage as p, ModelStorageBase as pt, isTaggedBigInt as q, $ as r, ContractVariantEntry as rt, ColumnDefaultLiteralValue as s, DomainModel as st, Contract as t, ContractRelation as tt, DocCollection as u, DomainRelationOn as ut, ExecutionSection as v, JsonValue as w, GenerateContractTypesOptions as x, Expr as y, TypeRenderContext as z };
|
|
512
|
+
//# sourceMappingURL=contract-types-C0y-Bn8M.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-types-C0y-Bn8M.d.mts","names":[],"sources":["../src/domain-types.ts","../src/types.ts","../src/contract-types.ts"],"sourcesContent":[],"mappings":";;;;KAAY,aAAA;;;;AAAA,KAKA,kBAAA,GALa;EAKb,SAAA,WAAA,EAAkB,SAAA,MAAA,EAAA;EAKlB,SAAA,YAAA,EAAA,SAAyB,MAAA,EAGtB;AAGf,CAAA;AAKY,KAXA,yBAAA,GAWmB;EAEnB,SAAA,EAAA,EAAA,MAAA;EAIA,SAAA,WAAA,EAAA,KAAoB,GAAA,KAAA,GAAA,KAAA;EAIpB,SAAA,EAAA,EAlBG,kBAkByB;AAExC,CAAA;AAAqD,KAjBzC,qBAAA,GAiByC;EAAmB,SAAA,EAAA,EAAA,MAAA;EACtC,SAAA,WAAA,EAAA,KAAA,GAAA,KAAA;CAAf;AACkB,KAdzB,gBAAA,GAAmB,yBAcM,GAdsB,qBActB;AAAf,KAZV,qBAAA,GAYU;EACF,SAAA,KAAA,EAAA,MAAA;CACO;AACU,KAXzB,oBAAA,GAWyB;EAAf,SAAA,KAAA,EAAA,MAAA;CAAM;AAQhB,KAfA,gBAAA,GAAmB,QAeL,CAfc,MAeD,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;AAE3B,UAfK,aAeW,CAAA,sBAfyB,gBAeJ,GAfuB,gBAevB,CAAA,CAAA;EAErC,SAAA,MAAA,EAhBO,MAgBP,CAAA,MAAuB,EAhBD,aAgBI,CAAA;EAE1B,SAAA,SAAA,EAjBU,MAiBS,CAAA,MAAA,EAjBM,gBAiBH,CAAA;EAEtB,SAAA,OAAA,EAlBQ,aAkBS;EAEjB,SAAA,aAAmB,CAAA,EAnBJ,qBAmBO;EAEtB,SAAA,QAAA,CAAA,EApBU,MAoBQ,CAAA,MAAG,EApBI,oBAoBgB,CAAA;EAEzC,SAAA,IAAA,CAAW,EAAA,MAAA;EAIlB,SAAA,KAAA,CAAA,EAAA,MAAA;;;AACc,KAnBP,WA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MFoBC,CAAA,MAAA,EAAA,MAAA,CAAA;EAAM,SAAA,MAAA,EEnBN,OFmBM;EAGb,SAAA,OAAA,EErBQ,QFqBa;EACb,SAAA,YAAA,EErBK,MFqBL,CAAA,MAAA,EErBoB,MFqBpB,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;EACe,SAAA,cAAA,EErBR,MFqBQ,CAAA,MAAA,EAAA,OAAA,CAAA;EAErB,SAAA,SAAA,CAAA,EEtBS,wBFsBT;EAAoB,SAAA,WAAA,CAAA,EErBT,eFqBS,CAAA,MAAA,CAAA;EAA0B,SAAA,IAAA,EEpB3C,MFoB2C,CAAA,MAAA,EAAA,OAAA,CAAA"}
|
|
@@ -83,4 +83,4 @@ declare function contractIR<TStorage extends Record<string, unknown>, TModels ex
|
|
|
83
83
|
}): ContractIR<TStorage, TModels, TRelations, TExecution>;
|
|
84
84
|
//#endregion
|
|
85
85
|
export { irMeta as i, contractIR as n, irHeader as r, ContractIR as t };
|
|
86
|
-
//# sourceMappingURL=ir-
|
|
86
|
+
//# sourceMappingURL=ir-BPkihpFL.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir-
|
|
1
|
+
{"version":3,"file":"ir-BPkihpFL.d.mts","names":[],"sources":["../src/ir.ts"],"sourcesContent":[],"mappings":";;AAiBA;;;;;;;;AAI+C,UAJ9B,UAI8B,CAAA,iBAH5B,MAG4B,CAAA,MAAA,EAAA,OAAA,CAAA,GAHF,MAGE,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,gBAF7B,MAE6B,CAAA,MAAA,EAAA,OAAA,CAAA,GAFH,MAEG,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,mBAD1B,MAC0B,CAAA,MAAA,EAAA,OAAA,CAAA,GADA,MACA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,mBAA1B,MAA0B,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,MAAA,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA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AA,GAAA,SAAA;EACC,IAAA,CAAA,EA7CN,MA6CM,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,SAAA;EAAU,OAAA,CAAA,EA5Cb,MA4Ca,CAAA,MAAA,EAAA,OAAA,CAAA,GAAA,SAAA;CAAS,CAAA,EAAA;EAAY,SAAA,YAAA,EA1CrB,MA0CqB,CAAA,MAAA,EA1CN,MA0CM,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;EAA1C,SAAA,cAAA,EAzCuB,MAyCvB,CAAA,MAAA,EAAA,OAAA,CAAA;EAAU,SAAA,IAAA,EAxCG,MAwCH,CAAA,MAAA,EAAA,OAAA,CAAA;oBAvCM;;;;;;iBAcJ,4BACG,yCACD,4CACG,4CACA;;;;;;;;;;2BAWM,eAAe;6BACb;mBACV;sBACG;;UAEZ;WACC;UACD;cACI;cACA;IACV,WAAW,UAAU,SAAS,YAAY"}
|
package/dist/ir.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as irMeta, n as contractIR, r as irHeader, t as ContractIR } from "./ir-
|
|
1
|
+
import { i as irMeta, n as contractIR, r as irHeader, t as ContractIR } from "./ir-BPkihpFL.mjs";
|
|
2
2
|
export { ContractIR, contractIR, irHeader, irMeta };
|