@prisma-next/contract 0.3.0-pr.99.4 → 0.3.0-pr.99.6

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.
Files changed (39) hide show
  1. package/dist/framework-components-B-XOtXw3.d.mts +854 -0
  2. package/dist/framework-components-B-XOtXw3.d.mts.map +1 -0
  3. package/dist/framework-components.d.mts +2 -0
  4. package/dist/framework-components.mjs +70 -0
  5. package/dist/framework-components.mjs.map +1 -0
  6. package/dist/ir-B8zNqals.d.mts +79 -0
  7. package/dist/ir-B8zNqals.d.mts.map +1 -0
  8. package/dist/ir.d.mts +2 -0
  9. package/dist/ir.mjs +46 -0
  10. package/dist/ir.mjs.map +1 -0
  11. package/dist/pack-manifest-types.d.mts +2 -0
  12. package/dist/pack-manifest-types.mjs +1 -0
  13. package/dist/types.d.mts +2 -0
  14. package/dist/types.mjs +11 -0
  15. package/dist/types.mjs.map +1 -0
  16. package/package.json +15 -23
  17. package/src/ir.ts +3 -3
  18. package/dist/exports/framework-components.d.ts +0 -3
  19. package/dist/exports/framework-components.d.ts.map +0 -1
  20. package/dist/exports/framework-components.js +0 -57
  21. package/dist/exports/framework-components.js.map +0 -1
  22. package/dist/exports/ir.d.ts +0 -2
  23. package/dist/exports/ir.d.ts.map +0 -1
  24. package/dist/exports/ir.js +0 -35
  25. package/dist/exports/ir.js.map +0 -1
  26. package/dist/exports/pack-manifest-types.d.ts +0 -2
  27. package/dist/exports/pack-manifest-types.d.ts.map +0 -1
  28. package/dist/exports/pack-manifest-types.js +0 -1
  29. package/dist/exports/pack-manifest-types.js.map +0 -1
  30. package/dist/exports/types.d.ts +0 -3
  31. package/dist/exports/types.d.ts.map +0 -1
  32. package/dist/exports/types.js +0 -8
  33. package/dist/exports/types.js.map +0 -1
  34. package/dist/framework-components.d.ts +0 -526
  35. package/dist/framework-components.d.ts.map +0 -1
  36. package/dist/ir.d.ts +0 -76
  37. package/dist/ir.d.ts.map +0 -1
  38. package/dist/types.d.ts +0 -326
  39. package/dist/types.d.ts.map +0 -1
@@ -1,35 +0,0 @@
1
- // src/ir.ts
2
- function irHeader(opts) {
3
- return {
4
- schemaVersion: "1",
5
- target: opts.target,
6
- targetFamily: opts.targetFamily,
7
- coreHash: opts.coreHash,
8
- ...opts.profileHash !== void 0 && { profileHash: opts.profileHash }
9
- };
10
- }
11
- function irMeta(opts) {
12
- return {
13
- capabilities: opts?.capabilities ?? {},
14
- extensionPacks: opts?.extensionPacks ?? {},
15
- meta: opts?.meta ?? {},
16
- sources: opts?.sources ?? {}
17
- };
18
- }
19
- function contractIR(opts) {
20
- return {
21
- schemaVersion: opts.header.schemaVersion,
22
- target: opts.header.target,
23
- targetFamily: opts.header.targetFamily,
24
- ...opts.meta,
25
- storage: opts.storage,
26
- models: opts.models,
27
- relations: opts.relations
28
- };
29
- }
30
- export {
31
- contractIR,
32
- irHeader,
33
- irMeta
34
- };
35
- //# sourceMappingURL=ir.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ir.ts"],"sourcesContent":["/**\n * ContractIR types and factories for building contract intermediate representation.\n * ContractIR is family-agnostic and used by authoring, emitter, and no-emit runtime.\n */\n\n/**\n * ContractIR represents the intermediate representation of a contract.\n * It is family-agnostic and contains generic storage, models, and relations.\n * Note: coreHash and profileHash are computed by the emitter, not part of the IR.\n */\nexport interface ContractIR<\n TStorage extends Record<string, unknown> = Record<string, unknown>,\n TModels extends Record<string, unknown> = Record<string, unknown>,\n TRelations extends Record<string, unknown> = Record<string, unknown>,\n> {\n readonly schemaVersion: string;\n readonly targetFamily: string;\n readonly target: string;\n readonly models: TModels;\n readonly relations: TRelations;\n readonly storage: TStorage;\n readonly extensionPacks: Record<string, unknown>;\n readonly capabilities: Record<string, Record<string, boolean>>;\n readonly meta: Record<string, unknown>;\n readonly sources: Record<string, unknown>;\n}\n\n/**\n * Creates the header portion of a ContractIR.\n * Contains schema version, target, target family, core hash, and optional profile hash.\n */\nexport function irHeader(opts: {\n target: string;\n targetFamily: string;\n coreHash: string;\n profileHash?: string;\n}): {\n readonly schemaVersion: string;\n readonly target: string;\n readonly targetFamily: string;\n readonly coreHash: string;\n readonly profileHash?: string;\n} {\n return {\n schemaVersion: '1',\n target: opts.target,\n targetFamily: opts.targetFamily,\n coreHash: opts.coreHash,\n ...(opts.profileHash !== undefined && { profileHash: opts.profileHash }),\n };\n}\n\n/**\n * Creates the meta portion of a ContractIR.\n * Contains capabilities, extensionPacks, meta, and sources with empty object defaults.\n * If a field is explicitly `undefined`, it will be omitted (for testing validation).\n */\nexport function irMeta(opts?: {\n capabilities?: Record<string, Record<string, boolean>> | undefined;\n extensionPacks?: Record<string, unknown> | undefined;\n meta?: Record<string, unknown> | undefined;\n sources?: Record<string, unknown> | undefined;\n}): {\n readonly capabilities: Record<string, Record<string, boolean>>;\n readonly extensionPacks: Record<string, unknown>;\n readonly meta: Record<string, unknown>;\n readonly sources: Record<string, unknown>;\n} {\n return {\n capabilities: opts?.capabilities ?? {},\n extensionPacks: opts?.extensionPacks ?? {},\n meta: opts?.meta ?? {},\n sources: opts?.sources ?? {},\n };\n}\n\n/**\n * Creates a complete ContractIR by combining header, meta, and family-specific sections.\n * This is a family-agnostic factory that accepts generic storage, models, and relations.\n */\nexport function contractIR<\n TStorage extends Record<string, unknown>,\n TModels extends Record<string, unknown>,\n TRelations extends Record<string, unknown>,\n>(opts: {\n header: {\n readonly schemaVersion: string;\n readonly target: string;\n readonly targetFamily: string;\n readonly coreHash: string;\n readonly profileHash?: string;\n };\n meta: {\n readonly capabilities: Record<string, Record<string, boolean>>;\n readonly extensionPacks: Record<string, unknown>;\n readonly meta: Record<string, unknown>;\n readonly sources: Record<string, unknown>;\n };\n storage: TStorage;\n models: TModels;\n relations: TRelations;\n}): ContractIR<TStorage, TModels, TRelations> {\n // ContractIR doesn't include coreHash or profileHash (those are computed by emitter)\n return {\n schemaVersion: opts.header.schemaVersion,\n target: opts.header.target,\n targetFamily: opts.header.targetFamily,\n ...opts.meta,\n storage: opts.storage,\n models: opts.models,\n relations: opts.relations,\n };\n}\n"],"mappings":";AA+BO,SAAS,SAAS,MAWvB;AACA,SAAO;AAAA,IACL,eAAe;AAAA,IACf,QAAQ,KAAK;AAAA,IACb,cAAc,KAAK;AAAA,IACnB,UAAU,KAAK;AAAA,IACf,GAAI,KAAK,gBAAgB,UAAa,EAAE,aAAa,KAAK,YAAY;AAAA,EACxE;AACF;AAOO,SAAS,OAAO,MAUrB;AACA,SAAO;AAAA,IACL,cAAc,MAAM,gBAAgB,CAAC;AAAA,IACrC,gBAAgB,MAAM,kBAAkB,CAAC;AAAA,IACzC,MAAM,MAAM,QAAQ,CAAC;AAAA,IACrB,SAAS,MAAM,WAAW,CAAC;AAAA,EAC7B;AACF;AAMO,SAAS,WAId,MAiB4C;AAE5C,SAAO;AAAA,IACL,eAAe,KAAK,OAAO;AAAA,IAC3B,QAAQ,KAAK,OAAO;AAAA,IACpB,cAAc,KAAK,OAAO;AAAA,IAC1B,GAAG,KAAK;AAAA,IACR,SAAS,KAAK;AAAA,IACd,QAAQ,KAAK;AAAA,IACb,WAAW,KAAK;AAAA,EAClB;AACF;","names":[]}
@@ -1,2 +0,0 @@
1
- export type { ArgSpecManifest, LoweringSpecManifest, OperationManifest, ReturnSpecManifest, } from '../types';
2
- //# sourceMappingURL=pack-manifest-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pack-manifest-types.d.ts","sourceRoot":"","sources":["../../src/exports/pack-manifest-types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=pack-manifest-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,3 +0,0 @@
1
- export type { ContractBase, ContractMarkerRecord, DocCollection, DocIndex, DocumentContract, DocumentStorage, ExecutionPlan, Expr, FieldType, GenerateContractTypesOptions, OperationManifest, ParamDescriptor, ParameterizedCodecDescriptor, PlanMeta, PlanRefs, ResultType, Source, TargetFamilyHook, TypeRenderContext, TypeRenderEntry, TypeRenderer, TypesImportSpec, ValidationContext, } from '../types';
2
- export { isDocumentContract } from '../types';
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/exports/types.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,IAAI,EACJ,SAAS,EAET,4BAA4B,EAC5B,iBAAiB,EACjB,eAAe,EACf,4BAA4B,EAC5B,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
@@ -1,8 +0,0 @@
1
- // src/types.ts
2
- function isDocumentContract(contract) {
3
- return typeof contract === "object" && contract !== null && "targetFamily" in contract && contract.targetFamily === "document";
4
- }
5
- export {
6
- isDocumentContract
7
- };
8
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types.ts"],"sourcesContent":["import type { OperationRegistry } from '@prisma-next/operations';\nimport type { RenderTypeContext } from './framework-components';\nimport type { ContractIR } from './ir';\n\nexport interface ContractBase {\n readonly schemaVersion: string;\n readonly target: string;\n readonly targetFamily: string;\n readonly coreHash: string;\n readonly profileHash?: string;\n readonly capabilities: Record<string, Record<string, boolean>>;\n readonly extensionPacks: Record<string, unknown>;\n readonly meta: Record<string, unknown>;\n readonly sources: Record<string, Source>;\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 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' | 'cuid' | 'objectId';\n };\n readonly fields: Record<string, FieldType>;\n readonly indexes?: ReadonlyArray<DocIndex>;\n readonly readOnly?: boolean;\n}\n\nexport interface DocumentStorage {\n readonly document: {\n readonly collections: Record<string, DocCollection>;\n };\n}\n\nexport interface DocumentContract extends ContractBase {\n // Accept string to work with JSON imports; runtime validation ensures 'document'\n readonly targetFamily: string;\n readonly storage: DocumentStorage;\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';\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 coreHash: 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 * Type guard to check if a contract is a Document contract\n */\nexport function isDocumentContract(contract: unknown): contract is DocumentContract {\n return (\n typeof contract === 'object' &&\n contract !== null &&\n 'targetFamily' in contract &&\n contract.targetFamily === 'document'\n );\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 coreHash: 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\n// Emitter types - moved from @prisma-next/emitter to shared location\n/**\n * Specifies how to import TypeScript types from a package.\n * Used in extension pack manifests to declare codec and operation type imports.\n */\nexport interface TypesImportSpec {\n readonly package: string;\n readonly named: string;\n readonly alias: string;\n}\n\n/**\n * Validation context passed to TargetFamilyHook.validateTypes().\n * Contains pre-assembled operation registry, type imports, and extension IDs.\n */\nexport interface ValidationContext {\n readonly operationRegistry?: OperationRegistry;\n readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;\n readonly operationTypeImports?: ReadonlyArray<TypesImportSpec>;\n readonly extensionIds?: ReadonlyArray<string>;\n /**\n * Parameterized codec descriptors collected from adapters and extensions.\n * Map of codecId → descriptor for quick lookup during type generation.\n */\n readonly parameterizedCodecs?: Map<string, ParameterizedCodecDescriptor>;\n}\n\n/**\n * Context for rendering parameterized types during contract.d.ts generation.\n * Passed to type renderers so they can reference CodecTypes by name.\n */\nexport interface TypeRenderContext {\n readonly codecTypesName: string;\n}\n\n/**\n * A normalized type renderer for parameterized codecs.\n * This is the interface expected by TargetFamilyHook.generateContractTypes.\n */\nexport interface TypeRenderEntry {\n readonly codecId: string;\n readonly render: (params: Record<string, unknown>, ctx: TypeRenderContext) => string;\n}\n\n/**\n * Additional options for generateContractTypes.\n */\nexport interface GenerateContractTypesOptions {\n /**\n * Normalized parameterized type renderers, keyed by codecId.\n * When a column has typeParams and a renderer exists for its codecId,\n * the renderer is called to produce the TypeScript type expression.\n */\n readonly parameterizedRenderers?: Map<string, TypeRenderEntry>;\n /**\n * Type imports for parameterized codecs.\n * These are merged with codec and operation type imports in contract.d.ts.\n */\n readonly parameterizedTypeImports?: ReadonlyArray<TypesImportSpec>;\n}\n\n/**\n * SPI interface for target family hooks that extend emission behavior.\n * Implemented by family-specific emitter hooks (e.g., SQL family).\n */\nexport interface TargetFamilyHook {\n readonly id: string;\n\n /**\n * Validates that all type IDs in the contract come from referenced extension packs.\n * @param ir - Contract IR to validate\n * @param ctx - Validation context with operation registry and extension IDs\n */\n validateTypes(ir: ContractIR, ctx: ValidationContext): void;\n\n /**\n * Validates family-specific contract structure.\n * @param ir - Contract IR to validate\n */\n validateStructure(ir: ContractIR): void;\n\n /**\n * Generates contract.d.ts file content.\n * @param ir - Contract IR\n * @param codecTypeImports - Array of codec type import specs\n * @param operationTypeImports - Array of operation type import specs\n * @param options - Additional options including parameterized type renderers\n * @returns Generated TypeScript type definitions as string\n */\n generateContractTypes(\n ir: ContractIR,\n codecTypeImports: ReadonlyArray<TypesImportSpec>,\n operationTypeImports: ReadonlyArray<TypesImportSpec>,\n options?: GenerateContractTypesOptions,\n ): string;\n}\n\n// Extension pack manifest types - moved from @prisma-next/core-control-plane to shared location\nexport type ArgSpecManifest =\n | { readonly kind: 'typeId'; readonly type: string }\n | { readonly kind: 'param' }\n | { readonly kind: 'literal' };\n\nexport type ReturnSpecManifest =\n | { readonly kind: 'typeId'; readonly type: string }\n | { readonly kind: 'builtin'; readonly type: 'number' | 'boolean' | 'string' };\n\nexport interface LoweringSpecManifest {\n readonly targetFamily: 'sql';\n readonly strategy: 'infix' | 'function';\n readonly template: string;\n}\n\nexport interface OperationManifest {\n readonly for: string;\n readonly method: string;\n readonly args: ReadonlyArray<ArgSpecManifest>;\n readonly returns: ReturnSpecManifest;\n readonly lowering: LoweringSpecManifest;\n readonly capabilities?: ReadonlyArray<string>;\n}\n\n// ============================================================================\n// Parameterized Codec Descriptor Types\n// ============================================================================\n//\n// Types for codecs that support type parameters (e.g., Vector<1536>, Decimal<2>).\n// These enable precise TypeScript types for parameterized columns without\n// coupling the SQL family emitter to specific adapter codec IDs.\n//\n// ============================================================================\n\n// Re-export RenderTypeContext so it's available alongside TypeRenderer\nexport type { RenderTypeContext };\n\n/**\n * Declarative type renderer that produces a TypeScript type expression.\n *\n * Renderers can be:\n * - A template string with `{{paramName}}` placeholders (e.g., `Vector<{{length}}>`)\n * - A function that receives typeParams and context and returns a type expression\n *\n * **Prefer template strings** for most cases:\n * - Templates are JSON-serializable (safe for pack-ref metadata)\n * - Templates can be statically analyzed by tooling\n *\n * Function renderers are allowed but have tradeoffs:\n * - Require runtime execution during emission (the emitter runs code)\n * - Not JSON-serializable (can't be stored in contract.json)\n * - The emitted artifacts (contract.json, contract.d.ts) still contain no\n * executable code - this constraint applies to outputs, not the emission process\n */\nexport type TypeRenderer =\n | string\n | ((params: Record<string, unknown>, ctx: RenderTypeContext) => string);\n\n/**\n * Descriptor for a codec that supports type parameters.\n *\n * Parameterized codecs allow columns to carry additional metadata (typeParams)\n * that affects the generated TypeScript types. For example:\n * - A vector codec can use `{ length: 1536 }` to generate `Vector<1536>`\n * - A decimal codec can use `{ precision: 10, scale: 2 }` to generate `Decimal<10, 2>`\n *\n * The SQL family emitter uses these descriptors to generate precise types\n * without hard-coding knowledge of specific codec IDs.\n *\n * @example\n * ```typescript\n * const vectorCodecDescriptor: ParameterizedCodecDescriptor = {\n * codecId: 'pg/vector@1',\n * outputTypeRenderer: 'Vector<{{length}}>',\n * // Optional: paramsSchema for runtime validation\n * };\n * ```\n */\nexport interface ParameterizedCodecDescriptor {\n /** The codec ID this descriptor applies to (e.g., 'pg/vector@1') */\n readonly codecId: string;\n\n /**\n * Renderer for the output (read) type.\n * Can be a template string or function.\n *\n * This is the primary renderer used by SQL emission to generate\n * model field types in contract.d.ts.\n */\n readonly outputTypeRenderer: TypeRenderer;\n\n /**\n * Optional renderer for the input (write) type.\n * If not provided, outputTypeRenderer is used for both.\n *\n * **Reserved for future use**: Currently, SQL emission only uses\n * outputTypeRenderer. This field is defined for future support of\n * asymmetric codecs where input and output types differ (e.g., a\n * codec that accepts `string | number` but always returns `number`).\n */\n readonly inputTypeRenderer?: TypeRenderer;\n\n /**\n * Optional import spec for types used by this codec's renderers.\n * The emitter will add this import to contract.d.ts.\n */\n readonly typesImport?: TypesImportSpec;\n}\n"],"mappings":";AA4IO,SAAS,mBAAmB,UAAiD;AAClF,SACE,OAAO,aAAa,YACpB,aAAa,QACb,kBAAkB,YAClB,SAAS,iBAAiB;AAE9B;","names":[]}
@@ -1,526 +0,0 @@
1
- import type { OperationManifest, TypesImportSpec } from './types';
2
- /**
3
- * Context passed to type renderers during contract.d.ts generation.
4
- */
5
- export interface RenderTypeContext {
6
- /** The name of the CodecTypes type alias (typically 'CodecTypes') */
7
- readonly codecTypesName: string;
8
- }
9
- /**
10
- * A template-based type renderer (structured form).
11
- * Uses mustache-style placeholders (e.g., `Vector<{{length}}>`) that are
12
- * replaced with typeParams values during rendering.
13
- *
14
- * @example
15
- * ```ts
16
- * { kind: 'template', template: 'Vector<{{length}}>' }
17
- * // With typeParams { length: 1536 }, renders: 'Vector<1536>'
18
- * ```
19
- */
20
- export interface TypeRendererTemplate {
21
- readonly kind: 'template';
22
- /** Template string with `{{key}}` placeholders for typeParams values */
23
- readonly template: string;
24
- }
25
- /**
26
- * A function-based type renderer for full control over type expression generation.
27
- *
28
- * @example
29
- * ```ts
30
- * {
31
- * kind: 'function',
32
- * render: (params, ctx) => `Vector<${params.length}>`
33
- * }
34
- * ```
35
- */
36
- export interface TypeRendererFunction {
37
- readonly kind: 'function';
38
- /** Render function that produces a TypeScript type expression */
39
- readonly render: (params: Record<string, unknown>, ctx: RenderTypeContext) => string;
40
- }
41
- /**
42
- * A raw template string type renderer (convenience form).
43
- * Shorthand for TypeRendererTemplate - just the template string without wrapper.
44
- *
45
- * @example
46
- * ```ts
47
- * 'Vector<{{length}}>'
48
- * // Equivalent to: { kind: 'template', template: 'Vector<{{length}}>' }
49
- * ```
50
- */
51
- export type TypeRendererString = string;
52
- /**
53
- * A raw function type renderer (convenience form).
54
- * Shorthand for TypeRendererFunction - just the function without wrapper.
55
- *
56
- * @example
57
- * ```ts
58
- * (params, ctx) => `Vector<${params.length}>`
59
- * // Equivalent to: { kind: 'function', render: ... }
60
- * ```
61
- */
62
- export type TypeRendererRawFunction = (params: Record<string, unknown>, ctx: RenderTypeContext) => string;
63
- /**
64
- * Union of type renderer formats.
65
- *
66
- * Supports both structured forms (with `kind` discriminator) and convenience forms:
67
- * - `string` - Template string with `{{key}}` placeholders (manifest-safe, JSON-serializable)
68
- * - `function` - Render function for full control (requires runtime execution)
69
- * - `{ kind: 'template', template: string }` - Structured template form
70
- * - `{ kind: 'function', render: fn }` - Structured function form
71
- *
72
- * Templates are normalized to functions during pack assembly.
73
- * **Prefer template strings** for most cases - they are JSON-serializable.
74
- */
75
- export type TypeRenderer = TypeRendererString | TypeRendererRawFunction | TypeRendererTemplate | TypeRendererFunction;
76
- /**
77
- * Normalized type renderer - always a function after assembly.
78
- * This is the form received by the emitter.
79
- */
80
- export interface NormalizedTypeRenderer {
81
- readonly codecId: string;
82
- readonly render: (params: Record<string, unknown>, ctx: RenderTypeContext) => string;
83
- }
84
- /**
85
- * Interpolates a template string with params values.
86
- * Used internally by normalizeRenderer to compile templates to functions.
87
- *
88
- * @throws Error if a placeholder key is not found in params (except 'CodecTypes')
89
- */
90
- export declare function interpolateTypeTemplate(template: string, params: Record<string, unknown>, ctx: RenderTypeContext): string;
91
- /**
92
- * Normalizes a TypeRenderer to function form.
93
- * Called during pack assembly, not at emission time.
94
- *
95
- * Handles all TypeRenderer forms:
96
- * - Raw string template: `'Vector<{{length}}>'`
97
- * - Raw function: `(params, ctx) => ...`
98
- * - Structured template: `{ kind: 'template', template: '...' }`
99
- * - Structured function: `{ kind: 'function', render: fn }`
100
- */
101
- export declare function normalizeRenderer(codecId: string, renderer: TypeRenderer): NormalizedTypeRenderer;
102
- /**
103
- * Declarative fields that describe component metadata.
104
- * These fields are owned directly by descriptors (not nested under a manifest).
105
- */
106
- export interface ComponentMetadata {
107
- /** Component version (semver) */
108
- readonly version: string;
109
- /**
110
- * Capabilities this component provides.
111
- *
112
- * For adapters, capabilities must be declared on the adapter descriptor (so they are emitted into
113
- * the contract) and also exposed in runtime adapter code (e.g. `adapter.profile.capabilities`);
114
- * keep these declarations in sync. Targets are identifiers/descriptors and typically do not
115
- * declare capabilities.
116
- */
117
- readonly capabilities?: Record<string, unknown>;
118
- /** Type imports for contract.d.ts generation */
119
- readonly types?: {
120
- readonly codecTypes?: {
121
- /**
122
- * Base codec types import spec.
123
- * Optional: adapters typically provide this, extensions usually don't.
124
- */
125
- readonly import?: TypesImportSpec;
126
- /**
127
- * Optional renderers for parameterized codecs owned by this component.
128
- * Key is codecId (e.g., 'pg/vector@1'), value is the type renderer.
129
- *
130
- * Templates are normalized to functions during pack assembly.
131
- * Duplicate codecId across descriptors is a hard error.
132
- */
133
- readonly parameterized?: Record<string, TypeRenderer>;
134
- /**
135
- * Optional type imports for parameterized codecs.
136
- * These imports are added to contract.d.ts when parameterized renderers
137
- * reference types from external packages.
138
- */
139
- readonly parameterizedImports?: ReadonlyArray<TypesImportSpec>;
140
- };
141
- readonly operationTypes?: {
142
- readonly import: TypesImportSpec;
143
- };
144
- readonly storage?: ReadonlyArray<{
145
- readonly typeId: string;
146
- readonly familyId: string;
147
- readonly targetId: string;
148
- readonly nativeType?: string;
149
- }>;
150
- };
151
- /** Operation manifests for building operation registries */
152
- readonly operations?: ReadonlyArray<OperationManifest>;
153
- }
154
- /**
155
- * Base descriptor for any framework component.
156
- *
157
- * All component descriptors share these fundamental properties that identify
158
- * the component and provide its metadata. This interface is extended by
159
- * specific descriptor types (FamilyDescriptor, TargetDescriptor, etc.).
160
- *
161
- * @template Kind - Discriminator literal identifying the component type.
162
- * Built-in kinds are 'family', 'target', 'adapter', 'driver', 'extension',
163
- * but the type accepts any string to allow ecosystem extensions.
164
- *
165
- * @example
166
- * ```ts
167
- * // All descriptors have these properties
168
- * descriptor.kind // The Kind type parameter (e.g., 'family', 'target', or custom kinds)
169
- * descriptor.id // Unique string identifier (e.g., 'sql', 'postgres')
170
- * descriptor.version // Component version (semver)
171
- * ```
172
- */
173
- export interface ComponentDescriptor<Kind extends string> extends ComponentMetadata {
174
- /** Discriminator identifying the component type */
175
- readonly kind: Kind;
176
- /** Unique identifier for this component (e.g., 'sql', 'postgres', 'pgvector') */
177
- readonly id: string;
178
- }
179
- export interface ContractComponentRequirementsCheckInput {
180
- readonly contract: {
181
- readonly target: string;
182
- readonly targetFamily?: string | undefined;
183
- readonly extensionPacks?: Record<string, unknown> | undefined;
184
- };
185
- readonly expectedTargetFamily?: string | undefined;
186
- readonly expectedTargetId?: string | undefined;
187
- readonly providedComponentIds: Iterable<string>;
188
- }
189
- export interface ContractComponentRequirementsCheckResult {
190
- readonly familyMismatch?: {
191
- readonly expected: string;
192
- readonly actual: string;
193
- } | undefined;
194
- readonly targetMismatch?: {
195
- readonly expected: string;
196
- readonly actual: string;
197
- } | undefined;
198
- readonly missingExtensionPackIds: readonly string[];
199
- }
200
- export declare function checkContractComponentRequirements(input: ContractComponentRequirementsCheckInput): ContractComponentRequirementsCheckResult;
201
- /**
202
- * Descriptor for a family component.
203
- *
204
- * A "family" represents a category of data sources with shared semantics
205
- * (e.g., SQL databases, document stores). Families define:
206
- * - Query semantics and operations (SELECT, INSERT, find, aggregate, etc.)
207
- * - Contract structure (tables vs collections, columns vs fields)
208
- * - Type system and codecs
209
- *
210
- * Families are the top-level grouping. Each family contains multiple targets
211
- * (e.g., SQL family contains Postgres, MySQL, SQLite targets).
212
- *
213
- * Extended by plane-specific descriptors:
214
- * - `ControlFamilyDescriptor` - adds `hook` for CLI/tooling operations
215
- * - `RuntimeFamilyDescriptor` - adds runtime-specific factory methods
216
- *
217
- * @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document')
218
- *
219
- * @example
220
- * ```ts
221
- * import sql from '@prisma-next/family-sql/control';
222
- *
223
- * sql.kind // 'family'
224
- * sql.familyId // 'sql'
225
- * sql.id // 'sql'
226
- * ```
227
- */
228
- export interface FamilyDescriptor<TFamilyId extends string> extends ComponentDescriptor<'family'> {
229
- /** The family identifier (e.g., 'sql', 'document') */
230
- readonly familyId: TFamilyId;
231
- }
232
- /**
233
- * Descriptor for a target component.
234
- *
235
- * A "target" represents a specific database or data store within a family
236
- * (e.g., Postgres, MySQL, MongoDB). Targets define:
237
- * - Native type mappings (e.g., Postgres int4 → TypeScript number)
238
- * - Target-specific capabilities (e.g., RETURNING, LATERAL joins)
239
- *
240
- * Targets are bound to a family and provide the target-specific implementation
241
- * details that adapters and drivers use.
242
- *
243
- * Extended by plane-specific descriptors:
244
- * - `ControlTargetDescriptor` - adds optional `migrations` capability
245
- * - `RuntimeTargetDescriptor` - adds runtime factory method
246
- *
247
- * @template TFamilyId - Literal type for the family identifier
248
- * @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql')
249
- *
250
- * @example
251
- * ```ts
252
- * import postgres from '@prisma-next/target-postgres/control';
253
- *
254
- * postgres.kind // 'target'
255
- * postgres.familyId // 'sql'
256
- * postgres.targetId // 'postgres'
257
- * ```
258
- */
259
- export interface TargetDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'target'> {
260
- /** The family this target belongs to */
261
- readonly familyId: TFamilyId;
262
- /** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */
263
- readonly targetId: TTargetId;
264
- }
265
- /**
266
- * Base shape for any pack reference.
267
- * Pack refs are pure JSON-friendly objects safe to import in authoring flows.
268
- */
269
- export interface PackRefBase<Kind extends string, TFamilyId extends string> extends ComponentMetadata {
270
- readonly kind: Kind;
271
- readonly id: string;
272
- readonly familyId: TFamilyId;
273
- readonly targetId?: string;
274
- }
275
- export type TargetPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'target', TFamilyId> & {
276
- readonly targetId: TTargetId;
277
- };
278
- export type AdapterPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'adapter', TFamilyId> & {
279
- readonly targetId: TTargetId;
280
- };
281
- export type ExtensionPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'extension', TFamilyId> & {
282
- readonly targetId: TTargetId;
283
- };
284
- export type DriverPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'driver', TFamilyId> & {
285
- readonly targetId: TTargetId;
286
- };
287
- /**
288
- * Descriptor for an adapter component.
289
- *
290
- * An "adapter" provides the protocol and dialect implementation for a target.
291
- * Adapters handle:
292
- * - SQL/query generation (lowering AST to target-specific syntax)
293
- * - Codec registration (encoding/decoding between JS and wire types)
294
- * - Type mappings and coercions
295
- *
296
- * Adapters are bound to a specific family+target combination and work with
297
- * any compatible driver for that target.
298
- *
299
- * Extended by plane-specific descriptors:
300
- * - `ControlAdapterDescriptor` - control-plane factory
301
- * - `RuntimeAdapterDescriptor` - runtime factory
302
- *
303
- * @template TFamilyId - Literal type for the family identifier
304
- * @template TTargetId - Literal type for the target identifier
305
- *
306
- * @example
307
- * ```ts
308
- * import postgresAdapter from '@prisma-next/adapter-postgres/control';
309
- *
310
- * postgresAdapter.kind // 'adapter'
311
- * postgresAdapter.familyId // 'sql'
312
- * postgresAdapter.targetId // 'postgres'
313
- * ```
314
- */
315
- export interface AdapterDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'adapter'> {
316
- /** The family this adapter belongs to */
317
- readonly familyId: TFamilyId;
318
- /** The target this adapter is designed for */
319
- readonly targetId: TTargetId;
320
- }
321
- /**
322
- * Descriptor for a driver component.
323
- *
324
- * A "driver" provides the connection and execution layer for a target.
325
- * Drivers handle:
326
- * - Connection management (pooling, timeouts, retries)
327
- * - Query execution (sending SQL/commands, receiving results)
328
- * - Transaction management
329
- * - Wire protocol communication
330
- *
331
- * Drivers are bound to a specific family+target and work with any compatible
332
- * adapter. Multiple drivers can exist for the same target (e.g., node-postgres
333
- * vs postgres.js for Postgres).
334
- *
335
- * Extended by plane-specific descriptors:
336
- * - `ControlDriverDescriptor` - creates driver from connection URL
337
- * - `RuntimeDriverDescriptor` - creates driver with runtime options
338
- *
339
- * @template TFamilyId - Literal type for the family identifier
340
- * @template TTargetId - Literal type for the target identifier
341
- *
342
- * @example
343
- * ```ts
344
- * import postgresDriver from '@prisma-next/driver-postgres/control';
345
- *
346
- * postgresDriver.kind // 'driver'
347
- * postgresDriver.familyId // 'sql'
348
- * postgresDriver.targetId // 'postgres'
349
- * ```
350
- */
351
- export interface DriverDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'driver'> {
352
- /** The family this driver belongs to */
353
- readonly familyId: TFamilyId;
354
- /** The target this driver connects to */
355
- readonly targetId: TTargetId;
356
- }
357
- /**
358
- * Descriptor for an extension component.
359
- *
360
- * An "extension" adds optional capabilities to a target. Extensions can provide:
361
- * - Additional operations (e.g., vector similarity search with pgvector)
362
- * - Custom types and codecs (e.g., vector type)
363
- * - Extended query capabilities
364
- *
365
- * Extensions are bound to a specific family+target and are registered in the
366
- * config alongside the core components. Multiple extensions can be used together.
367
- *
368
- * Extended by plane-specific descriptors:
369
- * - `ControlExtensionDescriptor` - control-plane extension factory
370
- * - `RuntimeExtensionDescriptor` - runtime extension factory
371
- *
372
- * @template TFamilyId - Literal type for the family identifier
373
- * @template TTargetId - Literal type for the target identifier
374
- *
375
- * @example
376
- * ```ts
377
- * import pgvector from '@prisma-next/extension-pgvector/control';
378
- *
379
- * pgvector.kind // 'extension'
380
- * pgvector.familyId // 'sql'
381
- * pgvector.targetId // 'postgres'
382
- * ```
383
- */
384
- export interface ExtensionDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'extension'> {
385
- /** The family this extension belongs to */
386
- readonly familyId: TFamilyId;
387
- /** The target this extension is designed for */
388
- readonly targetId: TTargetId;
389
- }
390
- /**
391
- * Union type for target-bound component descriptors.
392
- *
393
- * Target-bound components are those that must be compatible with a specific
394
- * family+target combination. This includes targets, adapters, drivers, and
395
- * extensions. Families are not target-bound.
396
- *
397
- * This type is used in migration and verification interfaces to enforce
398
- * type-level compatibility between components.
399
- *
400
- * @template TFamilyId - Literal type for the family identifier
401
- * @template TTargetId - Literal type for the target identifier
402
- *
403
- * @example
404
- * ```ts
405
- * // All these components must have matching familyId and targetId
406
- * const components: TargetBoundComponentDescriptor<'sql', 'postgres'>[] = [
407
- * postgresTarget,
408
- * postgresAdapter,
409
- * postgresDriver,
410
- * pgvectorExtension,
411
- * ];
412
- * ```
413
- */
414
- export type TargetBoundComponentDescriptor<TFamilyId extends string, TTargetId extends string> = TargetDescriptor<TFamilyId, TTargetId> | AdapterDescriptor<TFamilyId, TTargetId> | DriverDescriptor<TFamilyId, TTargetId> | ExtensionDescriptor<TFamilyId, TTargetId>;
415
- /**
416
- * Base interface for family instances.
417
- *
418
- * A family instance is created by a family descriptor's `create()` method.
419
- * This base interface carries only the identity; plane-specific interfaces
420
- * add domain actions (e.g., `emitContract`, `verify` on ControlFamilyInstance).
421
- *
422
- * @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document')
423
- *
424
- * @example
425
- * ```ts
426
- * const instance = sql.create({ target, adapter, driver, extensions });
427
- * instance.familyId // 'sql'
428
- * ```
429
- */
430
- export interface FamilyInstance<TFamilyId extends string> {
431
- /** The family identifier (e.g., 'sql', 'document') */
432
- readonly familyId: TFamilyId;
433
- }
434
- /**
435
- * Base interface for target instances.
436
- *
437
- * A target instance is created by a target descriptor's `create()` method.
438
- * This base interface carries only the identity; plane-specific interfaces
439
- * add target-specific behavior.
440
- *
441
- * @template TFamilyId - Literal type for the family identifier
442
- * @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql')
443
- *
444
- * @example
445
- * ```ts
446
- * const instance = postgres.create();
447
- * instance.familyId // 'sql'
448
- * instance.targetId // 'postgres'
449
- * ```
450
- */
451
- export interface TargetInstance<TFamilyId extends string, TTargetId extends string> {
452
- /** The family this target belongs to */
453
- readonly familyId: TFamilyId;
454
- /** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */
455
- readonly targetId: TTargetId;
456
- }
457
- /**
458
- * Base interface for adapter instances.
459
- *
460
- * An adapter instance is created by an adapter descriptor's `create()` method.
461
- * This base interface carries only the identity; plane-specific interfaces
462
- * add adapter-specific behavior (e.g., codec registration, query lowering).
463
- *
464
- * @template TFamilyId - Literal type for the family identifier
465
- * @template TTargetId - Literal type for the target identifier
466
- *
467
- * @example
468
- * ```ts
469
- * const instance = postgresAdapter.create();
470
- * instance.familyId // 'sql'
471
- * instance.targetId // 'postgres'
472
- * ```
473
- */
474
- export interface AdapterInstance<TFamilyId extends string, TTargetId extends string> {
475
- /** The family this adapter belongs to */
476
- readonly familyId: TFamilyId;
477
- /** The target this adapter is designed for */
478
- readonly targetId: TTargetId;
479
- }
480
- /**
481
- * Base interface for driver instances.
482
- *
483
- * A driver instance is created by a driver descriptor's `create()` method.
484
- * This base interface carries only the identity; plane-specific interfaces
485
- * add driver-specific behavior (e.g., `query`, `close` on ControlDriverInstance).
486
- *
487
- * @template TFamilyId - Literal type for the family identifier
488
- * @template TTargetId - Literal type for the target identifier
489
- *
490
- * @example
491
- * ```ts
492
- * const instance = postgresDriver.create({ databaseUrl });
493
- * instance.familyId // 'sql'
494
- * instance.targetId // 'postgres'
495
- * ```
496
- */
497
- export interface DriverInstance<TFamilyId extends string, TTargetId extends string> {
498
- /** The family this driver belongs to */
499
- readonly familyId: TFamilyId;
500
- /** The target this driver connects to */
501
- readonly targetId: TTargetId;
502
- }
503
- /**
504
- * Base interface for extension instances.
505
- *
506
- * An extension instance is created by an extension descriptor's `create()` method.
507
- * This base interface carries only the identity; plane-specific interfaces
508
- * add extension-specific behavior.
509
- *
510
- * @template TFamilyId - Literal type for the family identifier
511
- * @template TTargetId - Literal type for the target identifier
512
- *
513
- * @example
514
- * ```ts
515
- * const instance = pgvector.create();
516
- * instance.familyId // 'sql'
517
- * instance.targetId // 'postgres'
518
- * ```
519
- */
520
- export interface ExtensionInstance<TFamilyId extends string, TTargetId extends string> {
521
- /** The family this extension belongs to */
522
- readonly familyId: TFamilyId;
523
- /** The target this extension is designed for */
524
- readonly targetId: TTargetId;
525
- }
526
- //# sourceMappingURL=framework-components.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components.d.ts","sourceRoot":"","sources":["../src/framework-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAiBlE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,QA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