@prisma-next/framework-components
Advanced tools
| import { f as AnyCodecDescriptor } from "./codec-types-4tPB4m_G.mjs"; | ||
| import { i as AuthoringContributions } from "./framework-authoring-DT8QRvDv.mjs"; | ||
| import { t as TypesImportSpec } from "./types-import-spec-DRKzrJ20.mjs"; | ||
| import { ColumnDefault, ExecutionMutationDefaultPhases, ExecutionMutationDefaultValue } from "@prisma-next/contract/types"; | ||
| //#region src/shared/mutation-default-types.d.ts | ||
| interface SourcePosition { | ||
| readonly offset: number; | ||
| readonly line: number; | ||
| readonly column: number; | ||
| } | ||
| interface SourceSpan { | ||
| readonly start: SourcePosition; | ||
| readonly end: SourcePosition; | ||
| } | ||
| interface SourceDiagnostic { | ||
| readonly code: string; | ||
| readonly message: string; | ||
| readonly sourceId?: string; | ||
| readonly span?: SourceSpan; | ||
| readonly data?: Readonly<Record<string, unknown>>; | ||
| } | ||
| interface DefaultFunctionLoweringContext { | ||
| readonly sourceId: string; | ||
| readonly modelName: string; | ||
| readonly fieldName: string; | ||
| readonly columnCodecId?: string; | ||
| } | ||
| type LoweredDefaultValue = { | ||
| readonly kind: 'storage'; | ||
| readonly defaultValue: ColumnDefault; | ||
| } | { | ||
| readonly kind: 'execution'; | ||
| readonly generated: ExecutionMutationDefaultValue; | ||
| }; | ||
| type LoweredDefaultResult = { | ||
| readonly ok: true; | ||
| readonly value: LoweredDefaultValue; | ||
| } | { | ||
| readonly ok: false; | ||
| readonly diagnostic: SourceDiagnostic; | ||
| }; | ||
| interface MutationDefaultGeneratorDescriptor { | ||
| readonly id: string; | ||
| /** | ||
| * Codec ids the generator is compatible with when the codec choice | ||
| * and the generator choice are made independently by the contract | ||
| * author. Set when the registry-coherence check is meaningful | ||
| * (the codec and the generator can be paired arbitrarily by the | ||
| * caller); omitted when the generator is only reachable through a | ||
| * descriptor that co-registers a fixed codec, so coherence is | ||
| * structural and the list would be tautological. | ||
| */ | ||
| readonly applicableCodecIds?: readonly string[]; | ||
| /** | ||
| * Construct the `onCreate`/`onUpdate` phases value owned by this | ||
| * generator. Authoring layers (PSL `temporal.updatedAt()`, TS field presets) call | ||
| * this instead of building the literal inline so PSL/TS-authored | ||
| * contracts stay byte-equivalent for any future params-bearing generator. | ||
| */ | ||
| readonly buildPhases?: (args?: Record<string, unknown>) => ExecutionMutationDefaultPhases; | ||
| } | ||
| interface TypedDefaultFunctionCall { | ||
| readonly fn: string; | ||
| readonly span: SourceSpan; | ||
| readonly args: Readonly<Record<string, unknown>>; | ||
| } | ||
| interface ControlMutationDefaultEntry { | ||
| readonly signature?: unknown; | ||
| readonly lower: (input: { | ||
| readonly call: TypedDefaultFunctionCall; | ||
| readonly context: DefaultFunctionLoweringContext; | ||
| }) => LoweredDefaultResult; | ||
| readonly usageSignatures?: readonly string[]; | ||
| } | ||
| type ControlMutationDefaultRegistry = ReadonlyMap<string, ControlMutationDefaultEntry>; | ||
| interface ControlMutationDefaults { | ||
| readonly defaultFunctionRegistry: ControlMutationDefaultRegistry; | ||
| readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[]; | ||
| } | ||
| //#endregion | ||
| //#region src/shared/framework-components.d.ts | ||
| /** | ||
| * Declarative fields that describe component metadata. | ||
| */ | ||
| interface ComponentMetadata { | ||
| /** Component version (semver) */ | ||
| readonly version: string; | ||
| /** | ||
| * Capabilities this component provides. | ||
| * | ||
| * For adapters, capabilities must be declared on the adapter descriptor (so they are emitted into the contract) and also exposed in runtime adapter code (e.g. `adapter.profile.capabilities`); keep these declarations in sync. Targets are identifiers/descriptors and typically do not declare capabilities. | ||
| */ | ||
| readonly capabilities?: Record<string, unknown>; | ||
| /** Type imports for contract.d.ts generation */ | ||
| readonly types?: { | ||
| readonly codecTypes?: { | ||
| /** | ||
| * Base codec types import spec. Optional: adapters typically provide this, extensions usually don't. | ||
| */ | ||
| readonly import?: TypesImportSpec; | ||
| /** | ||
| * Additional type-only imports for parameterized codec branded types. | ||
| * | ||
| * These imports are included in generated `contract.d.ts` but are NOT treated as codec type maps (i.e., they should not be intersected into `export type CodecTypes = ...`). | ||
| * | ||
| * Example: `Vector<N>` for pgvector codecs that emit `Vector<1536>` | ||
| */ | ||
| readonly typeImports?: ReadonlyArray<TypesImportSpec>; | ||
| /** | ||
| * Optional control-plane hooks keyed by codecId. Used by family-specific planners/verifiers to handle storage types. | ||
| */ | ||
| readonly controlPlaneHooks?: Record<string, unknown>; | ||
| /** | ||
| * Codec descriptors contributed by this component. Source of truth for codec-id-keyed metadata (`traits`, `targetTypes`, `meta`, `renderOutputType`) consumed by `extractCodecLookup`, and used to materialize representative `Codec` instances for codec-dispatched type rendering during emission. | ||
| */ | ||
| readonly codecDescriptors?: ReadonlyArray<AnyCodecDescriptor>; | ||
| }; | ||
| readonly queryOperationTypes?: { | ||
| readonly import: TypesImportSpec; | ||
| }; | ||
| readonly storage?: ReadonlyArray<{ | ||
| readonly typeId: string; | ||
| readonly familyId: string; | ||
| readonly targetId: string; | ||
| readonly nativeType?: string; | ||
| }>; | ||
| }; | ||
| /** | ||
| * Optional pure-data authoring contributions exposed by this component. | ||
| * | ||
| * These contributions are safe to include on pack refs and descriptors because they contain only declarative metadata. Higher-level authoring packages may project them into concrete helper functions for TS-first workflows. | ||
| */ | ||
| readonly authoring?: AuthoringContributions; | ||
| /** | ||
| * Mutation default function handlers and generator descriptors contributed by this component. Assembled by `createControlStack` with duplicate detection. | ||
| */ | ||
| readonly controlMutationDefaults?: ControlMutationDefaults; | ||
| } | ||
| /** | ||
| * Base descriptor for any framework component. | ||
| * | ||
| * All component descriptors share these fundamental properties that identify the component and provide its metadata. This interface is extended by specific descriptor types (FamilyDescriptor, TargetDescriptor, etc.). | ||
| * | ||
| * @template Kind - Discriminator literal identifying the component type. Built-in kinds are 'family', 'target', 'adapter', 'driver', 'extension', but the type accepts any string to allow ecosystem extensions. | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * // All descriptors have these properties | ||
| * descriptor.kind // The Kind type parameter (e.g., 'family', 'target', or custom kinds) | ||
| * descriptor.id // Unique string identifier (e.g., 'sql', 'postgres') | ||
| * descriptor.version // Component version (semver) | ||
| * ``` | ||
| */ | ||
| interface ComponentDescriptor<Kind extends string> extends ComponentMetadata { | ||
| /** Discriminator identifying the component type */ | ||
| readonly kind: Kind; | ||
| /** Unique identifier for this component (e.g., 'sql', 'postgres', 'pgvector') */ | ||
| readonly id: string; | ||
| } | ||
| interface ContractComponentRequirementsCheckInput { | ||
| readonly contract: { | ||
| readonly target: string; | ||
| readonly targetFamily?: string | undefined; | ||
| readonly extensions?: Record<string, unknown> | undefined; | ||
| }; | ||
| readonly expectedTargetFamily?: string | undefined; | ||
| readonly expectedTargetId?: string | undefined; | ||
| readonly providedComponentIds: Iterable<string>; | ||
| } | ||
| interface ContractComponentRequirementsCheckResult { | ||
| readonly familyMismatch?: { | ||
| readonly expected: string; | ||
| readonly actual: string; | ||
| } | undefined; | ||
| readonly targetMismatch?: { | ||
| readonly expected: string; | ||
| readonly actual: string; | ||
| } | undefined; | ||
| readonly missingExtensionPackIds: readonly string[]; | ||
| } | ||
| declare function checkContractComponentRequirements(input: ContractComponentRequirementsCheckInput): ContractComponentRequirementsCheckResult; | ||
| /** | ||
| * Descriptor for a family component. | ||
| * | ||
| * A "family" represents a category of data sources with shared semantics (e.g., SQL databases, document stores). Families define: | ||
| * - Query semantics and operations (SELECT, INSERT, find, aggregate, etc.) | ||
| * - Contract structure (tables vs collections, columns vs fields) | ||
| * - Type system and codecs | ||
| * | ||
| * Families are the top-level grouping. Each family contains multiple targets (e.g., SQL family contains Postgres, MySQL, SQLite targets). | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlFamilyDescriptor` - adds `emission` for CLI/tooling operations | ||
| * - `RuntimeFamilyDescriptor` - adds runtime-specific factory methods | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document') | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import sql from '@prisma-next/family-sql/control'; | ||
| * | ||
| * sql.kind // 'family' | ||
| * sql.familyId // 'sql' | ||
| * sql.id // 'sql' | ||
| * ``` | ||
| */ | ||
| interface FamilyDescriptor<TFamilyId extends string> extends ComponentDescriptor<'family'> { | ||
| /** The family identifier (e.g., 'sql', 'document') */ | ||
| readonly familyId: TFamilyId; | ||
| } | ||
| /** | ||
| * Descriptor for a target component. | ||
| * | ||
| * A "target" represents a specific database or data store within a family (e.g., Postgres, MySQL, MongoDB). Targets define: | ||
| * - Native type mappings (e.g., Postgres int4 → TypeScript number) | ||
| * - Target-specific capabilities (e.g., RETURNING, LATERAL joins) | ||
| * | ||
| * Targets are bound to a family and provide the target-specific implementation details that adapters and drivers use. | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlTargetDescriptor` - adds optional `migrations` capability | ||
| * - `RuntimeTargetDescriptor` - adds runtime factory method | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql') | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import postgres from '@prisma-next/target-postgres/control'; | ||
| * | ||
| * postgres.kind // 'target' | ||
| * postgres.familyId // 'sql' | ||
| * postgres.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface TargetDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'target'> { | ||
| /** The family this target belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** | ||
| * Base shape for any pack reference. Pack refs are pure JSON-friendly objects safe to import in authoring flows. | ||
| */ | ||
| interface PackRefBase<Kind extends string, TFamilyId extends string> extends ComponentMetadata { | ||
| readonly kind: Kind; | ||
| readonly id: string; | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId?: string; | ||
| readonly authoring?: AuthoringContributions; | ||
| } | ||
| type FamilyPackRef<TFamilyId extends string = string> = PackRefBase<'family', TFamilyId>; | ||
| type TargetPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'target', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| /** The namespace a bare (un-namespaced) entity name resolves to for this target (e.g. Postgres `'public'`). */ | ||
| readonly defaultNamespaceId: string; | ||
| }; | ||
| type AdapterPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'adapter', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| }; | ||
| type ExtensionPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'extension', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| }; | ||
| type DriverPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'driver', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| }; | ||
| /** | ||
| * Descriptor for an adapter component. | ||
| * | ||
| * An "adapter" provides the protocol and dialect implementation for a target. Adapters handle: | ||
| * - SQL/query generation (lowering AST to target-specific syntax) | ||
| * - Codec registration (encoding/decoding between JS and wire types) | ||
| * - Type mappings and coercions | ||
| * | ||
| * Adapters are bound to a specific family+target combination and work with any compatible driver for that target. | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlAdapterDescriptor` - control-plane factory | ||
| * - `RuntimeAdapterDescriptor` - runtime factory | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import postgresAdapter from '@prisma-next/adapter-postgres/control'; | ||
| * | ||
| * postgresAdapter.kind // 'adapter' | ||
| * postgresAdapter.familyId // 'sql' | ||
| * postgresAdapter.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface AdapterDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'adapter'> { | ||
| /** The family this adapter belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target this adapter is designed for */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** | ||
| * Descriptor for a driver component. | ||
| * | ||
| * A "driver" provides the connection and execution layer for a target. Drivers handle: | ||
| * - Connection management (pooling, timeouts, retries) | ||
| * - Query execution (sending SQL/commands, receiving results) | ||
| * - Transaction management | ||
| * - Wire protocol communication | ||
| * | ||
| * Drivers are bound to a specific family+target and work with any compatible adapter. Multiple drivers can exist for the same target (e.g., node-postgres vs postgres.js for Postgres). | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlDriverDescriptor` - creates driver from connection URL | ||
| * - `RuntimeDriverDescriptor` - creates driver with runtime options | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import postgresDriver from '@prisma-next/driver-postgres/control'; | ||
| * | ||
| * postgresDriver.kind // 'driver' | ||
| * postgresDriver.familyId // 'sql' | ||
| * postgresDriver.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface DriverDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'driver'> { | ||
| /** The family this driver belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target this driver connects to */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** | ||
| * Descriptor for an extension component. | ||
| * | ||
| * An "extension" adds optional capabilities to a target. Extensions can provide: | ||
| * - Additional operations (e.g., vector similarity search with pgvector) | ||
| * - Custom types and codecs (e.g., vector type) | ||
| * - Extended query capabilities | ||
| * | ||
| * Extensions are bound to a specific family+target and are registered in the config alongside the core components. Multiple extensions can be used together. | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlExtensionDescriptor` - control-plane extension factory | ||
| * - `RuntimeExtensionDescriptor` - runtime extension factory | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import pgvector from '@prisma-next/extension-pgvector/control'; | ||
| * | ||
| * pgvector.kind // 'extension' | ||
| * pgvector.familyId // 'sql' | ||
| * pgvector.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface ExtensionDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'extension'> { | ||
| /** The family this extension belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target this extension is designed for */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** Components bound to a specific family+target combination. */ | ||
| type TargetBoundComponentDescriptor<TFamilyId extends string, TTargetId extends string> = TargetDescriptor<TFamilyId, TTargetId> | AdapterDescriptor<TFamilyId, TTargetId> | DriverDescriptor<TFamilyId, TTargetId> | ExtensionDescriptor<TFamilyId, TTargetId>; | ||
| interface FamilyInstance<TFamilyId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| } | ||
| interface TargetInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| interface AdapterInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| interface DriverInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| interface ExtensionInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| //#endregion | ||
| export { SourceDiagnostic as A, ControlMutationDefaultEntry as C, LoweredDefaultResult as D, DefaultFunctionLoweringContext as E, TypedDefaultFunctionCall as M, LoweredDefaultValue as O, checkContractComponentRequirements as S, ControlMutationDefaults as T, PackRefBase as _, ComponentMetadata as a, TargetInstance as b, DriverDescriptor as c, ExtensionDescriptor as d, ExtensionInstance as f, FamilyPackRef as g, FamilyInstance as h, ComponentDescriptor as i, SourceSpan as j, MutationDefaultGeneratorDescriptor as k, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, AdapterPackRef as r, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, DriverPackRef as u, TargetBoundComponentDescriptor as v, ControlMutationDefaultRegistry as w, TargetPackRef as x, TargetDescriptor as y }; | ||
| //# sourceMappingURL=framework-components-Crm97b5Y.d.mts.map |
| {"version":3,"file":"framework-components-Crm97b5Y.d.mts","names":[],"sources":["../src/shared/mutation-default-types.ts","../src/shared/framework-components.ts"],"mappings":";;;;;UAMU;WACC;WACA;WACA;;UAGM;WACN,OAAO;WACP,KAAK;;UAGC;WACN;WACA;WACA;WACA,OAAO;WACP,OAAO,SAAS;;UAGV;WACN;WACA;WACA;WACA;;KAGC;WACG;WAA0B,cAAc;;WACxC;WAA4B,WAAW;;KAE1C;WACG;WAAmB,OAAO;;WAC1B;WAAoB,YAAY;;UAE9B;WACN;;;;;;;;;;WAUA;;;;;;;WAOA,eAAe,OAAO,4BAA4B;;UAK5C;WACN;WACA,MAAM;WACN,MAAM,SAAS;;UAGT;WAIN;WACA,QAAQ;aACN,MAAM;aACN,SAAS;QACd;WACG;;KAGC,iCAAiC,oBAAoB;UAEhD;WACN,yBAAyB;WACzB,+BAA+B;;;;;;;UC7EzB;;WAEN;;;;;;WAOA,eAAe;;WAGf;aACE;;;;eAIE,SAAS;;;;;;;;eAQT,cAAc,cAAc;;;;eAI5B,oBAAoB;;;;eAIpB,mBAAmB,cAAc;;aAEnC;eAAiC,QAAQ;;aACzC,UAAU;eACR;eACA;eACA;eACA;;;;;;;;WASJ,YAAY;;;;WAKZ,0BAA0B;;;;;;;;;;;;;;;;;UAkBpB,oBAAoB,6BAA6B;;WAEvD,MAAM;;WAGN;;UAGM;WACN;aACE;aACA;aACA,aAAa;;WAEf;WACA;WACA,sBAAsB;;UAGhB;WACN;aAA4B;aAA2B;;WACvD;aAA4B;aAA2B;;WACvD;;iBAGK,mCACd,OAAO,0CACN;;;;;;;;;;;;;;;;;;;;;;;;;;UA2Dc,iBAAiB,kCAAkC;;WAEzD,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BJ,iBAAiB,0BAA0B,kCAClD;;WAEC,UAAU;;WAGV,UAAU;;;;;UAMJ,YAAY,qBAAqB,kCACxC;WACC,MAAM;WACN;WACA,UAAU;WACV;WACA,YAAY;;KAGX,cAAc,qCAAqC,sBAAsB;KAEzE,cACV,mCACA,qCACE,sBAAsB;WACf,UAAU;;WAEV;;KAGC,eACV,mCACA,qCACE,uBAAuB;WAChB,UAAU;;KAGT,iBACV,mCACA,qCACE,yBAAyB;WAClB,UAAU;;KAGT,cACV,mCACA,qCACE,sBAAsB;WACf,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BJ,kBAAkB,0BAA0B,kCACnD;;WAEC,UAAU;;WAGV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BJ,iBAAiB,0BAA0B,kCAClD;;WAEC,UAAU;;WAGV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BJ,oBAAoB,0BAA0B,kCACrD;;WAEC,UAAU;;WAGV,UAAU;;;KAIT,+BAA+B,0BAA0B,4BACjE,iBAAiB,WAAW,aAC5B,kBAAkB,WAAW,aAC7B,iBAAiB,WAAW,aAC5B,oBAAoB,WAAW;UAElB,eAAe;WACrB,UAAU;;UAGJ,eAAe,0BAA0B;WAC/C,UAAU;WACV,UAAU;;UAGJ,gBAAgB,0BAA0B;WAChD,UAAU;WACV,UAAU;;UAGJ,eAAe,0BAA0B;WAC/C,UAAU;WACV,UAAU;;UAGJ,kBAAkB,0BAA0B;WAClD,UAAU;WACV,UAAU"} |
| //#region src/shared/framework-components.ts | ||
| function checkContractComponentRequirements(input) { | ||
| const providedIds = /* @__PURE__ */ new Set(); | ||
| for (const id of input.providedComponentIds) providedIds.add(id); | ||
| const missingExtensionPackIds = (input.contract.extensions ? Object.keys(input.contract.extensions) : []).filter((id) => !providedIds.has(id)); | ||
| const expectedTargetFamily = input.expectedTargetFamily; | ||
| const contractTargetFamily = input.contract.targetFamily; | ||
| const familyMismatch = expectedTargetFamily !== void 0 && contractTargetFamily !== void 0 && contractTargetFamily !== expectedTargetFamily ? { | ||
| expected: expectedTargetFamily, | ||
| actual: contractTargetFamily | ||
| } : void 0; | ||
| const expectedTargetId = input.expectedTargetId; | ||
| const contractTargetId = input.contract.target; | ||
| const targetMismatch = expectedTargetId !== void 0 && contractTargetId !== expectedTargetId ? { | ||
| expected: expectedTargetId, | ||
| actual: contractTargetId | ||
| } : void 0; | ||
| return { | ||
| ...familyMismatch ? { familyMismatch } : {}, | ||
| ...targetMismatch ? { targetMismatch } : {}, | ||
| missingExtensionPackIds | ||
| }; | ||
| } | ||
| //#endregion | ||
| export { checkContractComponentRequirements as t }; | ||
| //# sourceMappingURL=framework-components-D6j4Y5K7.mjs.map |
| {"version":3,"file":"framework-components-D6j4Y5K7.mjs","names":[],"sources":["../src/shared/framework-components.ts"],"sourcesContent":["import type { AnyCodecDescriptor } from './codec-descriptor';\nimport type { AuthoringContributions } from './framework-authoring';\nimport type { ControlMutationDefaults } from './mutation-default-types';\nimport type { TypesImportSpec } from './types-import-spec';\n\n/**\n * Declarative fields that describe component metadata.\n */\nexport interface ComponentMetadata {\n /** Component version (semver) */\n readonly version: string;\n\n /**\n * Capabilities this component provides.\n *\n * For adapters, capabilities must be declared on the adapter descriptor (so they are emitted into the contract) and also exposed in runtime adapter code (e.g. `adapter.profile.capabilities`); keep these declarations in sync. Targets are identifiers/descriptors and typically do not declare capabilities.\n */\n readonly capabilities?: Record<string, unknown>;\n\n /** Type imports for contract.d.ts generation */\n readonly types?: {\n readonly codecTypes?: {\n /**\n * Base codec types import spec. Optional: adapters typically provide this, extensions usually don't.\n */\n readonly import?: TypesImportSpec;\n /**\n * Additional type-only imports for parameterized codec branded types.\n *\n * These imports are included in generated `contract.d.ts` but are NOT treated as codec type maps (i.e., they should not be intersected into `export type CodecTypes = ...`).\n *\n * Example: `Vector<N>` for pgvector codecs that emit `Vector<1536>`\n */\n readonly typeImports?: ReadonlyArray<TypesImportSpec>;\n /**\n * Optional control-plane hooks keyed by codecId. Used by family-specific planners/verifiers to handle storage types.\n */\n readonly controlPlaneHooks?: Record<string, unknown>;\n /**\n * Codec descriptors contributed by this component. Source of truth for codec-id-keyed metadata (`traits`, `targetTypes`, `meta`, `renderOutputType`) consumed by `extractCodecLookup`, and used to materialize representative `Codec` instances for codec-dispatched type rendering during emission.\n */\n readonly codecDescriptors?: ReadonlyArray<AnyCodecDescriptor>;\n };\n readonly queryOperationTypes?: { readonly import: TypesImportSpec };\n readonly storage?: ReadonlyArray<{\n readonly typeId: string;\n readonly familyId: string;\n readonly targetId: string;\n readonly nativeType?: string;\n }>;\n };\n\n /**\n * Optional pure-data authoring contributions exposed by this component.\n *\n * These contributions are safe to include on pack refs and descriptors because they contain only declarative metadata. Higher-level authoring packages may project them into concrete helper functions for TS-first workflows.\n */\n readonly authoring?: AuthoringContributions;\n\n /**\n * Mutation default function handlers and generator descriptors contributed by this component. Assembled by `createControlStack` with duplicate detection.\n */\n readonly controlMutationDefaults?: ControlMutationDefaults;\n}\n\n/**\n * Base descriptor for any framework component.\n *\n * All component descriptors share these fundamental properties that identify the component and provide its metadata. This interface is extended by specific descriptor types (FamilyDescriptor, TargetDescriptor, etc.).\n *\n * @template Kind - Discriminator literal identifying the component type. Built-in kinds are 'family', 'target', 'adapter', 'driver', 'extension', but the type accepts any string to allow ecosystem extensions.\n *\n * @example\n * ```ts\n * // All descriptors have these properties\n * descriptor.kind // The Kind type parameter (e.g., 'family', 'target', or custom kinds)\n * descriptor.id // Unique string identifier (e.g., 'sql', 'postgres')\n * descriptor.version // Component version (semver)\n * ```\n */\nexport interface ComponentDescriptor<Kind extends string> extends ComponentMetadata {\n /** Discriminator identifying the component type */\n readonly kind: Kind;\n\n /** Unique identifier for this component (e.g., 'sql', 'postgres', 'pgvector') */\n readonly id: string;\n}\n\nexport interface ContractComponentRequirementsCheckInput {\n readonly contract: {\n readonly target: string;\n readonly targetFamily?: string | undefined;\n readonly extensions?: Record<string, unknown> | undefined;\n };\n readonly expectedTargetFamily?: string | undefined;\n readonly expectedTargetId?: string | undefined;\n readonly providedComponentIds: Iterable<string>;\n}\n\nexport interface ContractComponentRequirementsCheckResult {\n readonly familyMismatch?: { readonly expected: string; readonly actual: string } | undefined;\n readonly targetMismatch?: { readonly expected: string; readonly actual: string } | undefined;\n readonly missingExtensionPackIds: readonly string[];\n}\n\nexport function checkContractComponentRequirements(\n input: ContractComponentRequirementsCheckInput,\n): ContractComponentRequirementsCheckResult {\n const providedIds = new Set<string>();\n for (const id of input.providedComponentIds) {\n providedIds.add(id);\n }\n\n const requiredExtensionPackIds = input.contract.extensions\n ? Object.keys(input.contract.extensions)\n : [];\n const missingExtensionPackIds = requiredExtensionPackIds.filter((id) => !providedIds.has(id));\n\n const expectedTargetFamily = input.expectedTargetFamily;\n const contractTargetFamily = input.contract.targetFamily;\n const familyMismatch =\n expectedTargetFamily !== undefined &&\n contractTargetFamily !== undefined &&\n contractTargetFamily !== expectedTargetFamily\n ? { expected: expectedTargetFamily, actual: contractTargetFamily }\n : undefined;\n\n const expectedTargetId = input.expectedTargetId;\n const contractTargetId = input.contract.target;\n const targetMismatch =\n expectedTargetId !== undefined && contractTargetId !== expectedTargetId\n ? { expected: expectedTargetId, actual: contractTargetId }\n : undefined;\n\n return {\n ...(familyMismatch ? { familyMismatch } : {}),\n ...(targetMismatch ? { targetMismatch } : {}),\n missingExtensionPackIds,\n };\n}\n\n/**\n * Descriptor for a family component.\n *\n * A \"family\" represents a category of data sources with shared semantics (e.g., SQL databases, document stores). Families define:\n * - Query semantics and operations (SELECT, INSERT, find, aggregate, etc.)\n * - Contract structure (tables vs collections, columns vs fields)\n * - Type system and codecs\n *\n * Families are the top-level grouping. Each family contains multiple targets (e.g., SQL family contains Postgres, MySQL, SQLite targets).\n *\n * Extended by plane-specific descriptors:\n * - `ControlFamilyDescriptor` - adds `emission` for CLI/tooling operations\n * - `RuntimeFamilyDescriptor` - adds runtime-specific factory methods\n *\n * @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document')\n *\n * @example\n * ```ts\n * import sql from '@prisma-next/family-sql/control';\n *\n * sql.kind // 'family'\n * sql.familyId // 'sql'\n * sql.id // 'sql'\n * ```\n */\nexport interface FamilyDescriptor<TFamilyId extends string> extends ComponentDescriptor<'family'> {\n /** The family identifier (e.g., 'sql', 'document') */\n readonly familyId: TFamilyId;\n}\n\n/**\n * Descriptor for a target component.\n *\n * A \"target\" represents a specific database or data store within a family (e.g., Postgres, MySQL, MongoDB). Targets define:\n * - Native type mappings (e.g., Postgres int4 → TypeScript number)\n * - Target-specific capabilities (e.g., RETURNING, LATERAL joins)\n *\n * Targets are bound to a family and provide the target-specific implementation details that adapters and drivers use.\n *\n * Extended by plane-specific descriptors:\n * - `ControlTargetDescriptor` - adds optional `migrations` capability\n * - `RuntimeTargetDescriptor` - adds runtime factory method\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql')\n *\n * @example\n * ```ts\n * import postgres from '@prisma-next/target-postgres/control';\n *\n * postgres.kind // 'target'\n * postgres.familyId // 'sql'\n * postgres.targetId // 'postgres'\n * ```\n */\nexport interface TargetDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'target'> {\n /** The family this target belongs to */\n readonly familyId: TFamilyId;\n\n /** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */\n readonly targetId: TTargetId;\n}\n\n/**\n * Base shape for any pack reference. Pack refs are pure JSON-friendly objects safe to import in authoring flows.\n */\nexport interface PackRefBase<Kind extends string, TFamilyId extends string>\n extends ComponentMetadata {\n readonly kind: Kind;\n readonly id: string;\n readonly familyId: TFamilyId;\n readonly targetId?: string;\n readonly authoring?: AuthoringContributions;\n}\n\nexport type FamilyPackRef<TFamilyId extends string = string> = PackRefBase<'family', TFamilyId>;\n\nexport type TargetPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'target', TFamilyId> & {\n readonly targetId: TTargetId;\n /** The namespace a bare (un-namespaced) entity name resolves to for this target (e.g. Postgres `'public'`). */\n readonly defaultNamespaceId: string;\n};\n\nexport type AdapterPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'adapter', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\nexport type ExtensionPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'extension', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\nexport type DriverPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'driver', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\n/**\n * Descriptor for an adapter component.\n *\n * An \"adapter\" provides the protocol and dialect implementation for a target. Adapters handle:\n * - SQL/query generation (lowering AST to target-specific syntax)\n * - Codec registration (encoding/decoding between JS and wire types)\n * - Type mappings and coercions\n *\n * Adapters are bound to a specific family+target combination and work with any compatible driver for that target.\n *\n * Extended by plane-specific descriptors:\n * - `ControlAdapterDescriptor` - control-plane factory\n * - `RuntimeAdapterDescriptor` - runtime factory\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import postgresAdapter from '@prisma-next/adapter-postgres/control';\n *\n * postgresAdapter.kind // 'adapter'\n * postgresAdapter.familyId // 'sql'\n * postgresAdapter.targetId // 'postgres'\n * ```\n */\nexport interface AdapterDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'adapter'> {\n /** The family this adapter belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this adapter is designed for */\n readonly targetId: TTargetId;\n}\n\n/**\n * Descriptor for a driver component.\n *\n * A \"driver\" provides the connection and execution layer for a target. Drivers handle:\n * - Connection management (pooling, timeouts, retries)\n * - Query execution (sending SQL/commands, receiving results)\n * - Transaction management\n * - Wire protocol communication\n *\n * Drivers are bound to a specific family+target and work with any compatible adapter. Multiple drivers can exist for the same target (e.g., node-postgres vs postgres.js for Postgres).\n *\n * Extended by plane-specific descriptors:\n * - `ControlDriverDescriptor` - creates driver from connection URL\n * - `RuntimeDriverDescriptor` - creates driver with runtime options\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import postgresDriver from '@prisma-next/driver-postgres/control';\n *\n * postgresDriver.kind // 'driver'\n * postgresDriver.familyId // 'sql'\n * postgresDriver.targetId // 'postgres'\n * ```\n */\nexport interface DriverDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'driver'> {\n /** The family this driver belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this driver connects to */\n readonly targetId: TTargetId;\n}\n\n/**\n * Descriptor for an extension component.\n *\n * An \"extension\" adds optional capabilities to a target. Extensions can provide:\n * - Additional operations (e.g., vector similarity search with pgvector)\n * - Custom types and codecs (e.g., vector type)\n * - Extended query capabilities\n *\n * Extensions are bound to a specific family+target and are registered in the config alongside the core components. Multiple extensions can be used together.\n *\n * Extended by plane-specific descriptors:\n * - `ControlExtensionDescriptor` - control-plane extension factory\n * - `RuntimeExtensionDescriptor` - runtime extension factory\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import pgvector from '@prisma-next/extension-pgvector/control';\n *\n * pgvector.kind // 'extension'\n * pgvector.familyId // 'sql'\n * pgvector.targetId // 'postgres'\n * ```\n */\nexport interface ExtensionDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'extension'> {\n /** The family this extension belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this extension is designed for */\n readonly targetId: TTargetId;\n}\n\n/** Components bound to a specific family+target combination. */\nexport type TargetBoundComponentDescriptor<TFamilyId extends string, TTargetId extends string> =\n | TargetDescriptor<TFamilyId, TTargetId>\n | AdapterDescriptor<TFamilyId, TTargetId>\n | DriverDescriptor<TFamilyId, TTargetId>\n | ExtensionDescriptor<TFamilyId, TTargetId>;\n\nexport interface FamilyInstance<TFamilyId extends string> {\n readonly familyId: TFamilyId;\n}\n\nexport interface TargetInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface AdapterInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface DriverInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface ExtensionInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n"],"mappings":";AAyGA,SAAgB,mCACd,OAC0C;CAC1C,MAAM,8BAAc,IAAI,IAAY;CACpC,KAAK,MAAM,MAAM,MAAM,sBACrB,YAAY,IAAI,EAAE;CAMpB,MAAM,2BAH2B,MAAM,SAAS,aAC5C,OAAO,KAAK,MAAM,SAAS,UAAU,IACrC,CAAC,EAAA,CACoD,QAAQ,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;CAE5F,MAAM,uBAAuB,MAAM;CACnC,MAAM,uBAAuB,MAAM,SAAS;CAC5C,MAAM,iBACJ,yBAAyB,KAAA,KACzB,yBAAyB,KAAA,KACzB,yBAAyB,uBACrB;EAAE,UAAU;EAAsB,QAAQ;CAAqB,IAC/D,KAAA;CAEN,MAAM,mBAAmB,MAAM;CAC/B,MAAM,mBAAmB,MAAM,SAAS;CACxC,MAAM,iBACJ,qBAAqB,KAAA,KAAa,qBAAqB,mBACnD;EAAE,UAAU;EAAkB,QAAQ;CAAiB,IACvD,KAAA;CAEN,OAAO;EACL,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;EAC3C,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;EAC3C;CACF;AACF"} |
| import { n as mergeCapabilityMatrices, t as CapabilityMatrix } from "./capabilities-Cupq4-1-.mjs"; | ||
| import { S as checkContractComponentRequirements, _ as PackRefBase, a as ComponentMetadata, b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, g as FamilyPackRef, h as FamilyInstance, i as ComponentDescriptor, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, o as ContractComponentRequirementsCheckInput, p as ExtensionPackRef, r as AdapterPackRef, s as ContractComponentRequirementsCheckResult, t as AdapterDescriptor, u as DriverPackRef, v as TargetBoundComponentDescriptor, x as TargetPackRef, y as TargetDescriptor } from "./framework-components-CDWIpbwD.mjs"; | ||
| import { S as checkContractComponentRequirements, _ as PackRefBase, a as ComponentMetadata, b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, g as FamilyPackRef, h as FamilyInstance, i as ComponentDescriptor, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, o as ContractComponentRequirementsCheckInput, p as ExtensionPackRef, r as AdapterPackRef, s as ContractComponentRequirementsCheckResult, t as AdapterDescriptor, u as DriverPackRef, v as TargetBoundComponentDescriptor, x as TargetPackRef, y as TargetDescriptor } from "./framework-components-Crm97b5Y.mjs"; | ||
| export { type AdapterDescriptor, type AdapterInstance, type AdapterPackRef, type CapabilityMatrix, type ComponentDescriptor, type ComponentMetadata, type ContractComponentRequirementsCheckInput, type ContractComponentRequirementsCheckResult, type DriverDescriptor, type DriverInstance, type DriverPackRef, type ExtensionDescriptor, type ExtensionInstance, type ExtensionPackRef, type FamilyDescriptor, type FamilyInstance, type FamilyPackRef, type PackRefBase, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetPackRef, checkContractComponentRequirements, mergeCapabilityMatrices }; |
| import { t as mergeCapabilityMatrices } from "./capabilities-BnRAFKP5.mjs"; | ||
| import { t as checkContractComponentRequirements } from "./framework-components-DbCS57go.mjs"; | ||
| import { t as checkContractComponentRequirements } from "./framework-components-D6j4Y5K7.mjs"; | ||
| export { checkContractComponentRequirements, mergeCapabilityMatrices }; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"control.d.mts","names":[],"sources":["../src/control/contract-serializer.ts","../src/control/contract-snapshot-layout.ts","../src/control/schema-diff.ts","../src/control/control-operation-results.ts","../src/control/control-instances.ts","../src/control/control-migration-types.ts","../src/control/control-spaces.ts","../src/control/control-stack.ts","../src/control/control-descriptors.ts","../src/control/control-operation-preview.ts","../src/control/control-schema-view.ts","../src/control/control-capabilities.ts","../src/control/order-issues-by-dependencies.ts","../src/control/schema-verifier.ts","../src/control/verifier-disposition.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmBiB,mBAAmB;;;;;;;;;;;;EAYlC,oBAAoB,UAAU,YAAY,WAAW,gBAAgB;;;;;;;;;;EAWrE,kBAAkB,UAAU,YAAY;;;;;;;;WAS/B,sBAAsB;;;;;;;;WAStB,cAAc;;;;cC1DZ;;iBAKG,eAAe;;iBAUf,8BACd,6BACA;;iBAMc,+BACd,6BACA;;;;;;;;;;KCpBU;WAAoC;WAA2B;;UAE1D,gBAAgB,cAAc,eAAe;;WAEnD;;WAEA,WAAW;;WAEX,SAAS;;;;;;;;WAQT;;;;;;;;;;;;;;;;KAiBC;;;;;;;iBAQI,aAAa,OAAO,kBAAkB;;;;;;;;;;;;;;;UAyBrC;WACN;WACA;;;;;;;WAOA,qBAAqB;EAC9B,UAAU,OAAO;EACjB,qBAAqB;;;;;;;;;;;iBAiDP,YACd,UAAU,cACV,QAAQ,wBACE;;;;;;;;;;;;cAiIC,WAAW,cAAc,eAAe;WAC1C,iBAAiB,gBAAgB;cAE9B,iBAAiB,gBAAgB;;EAK7C,OAAO,OAAO,OAAO,gBAAgB,qBAAqB,WAAW;;;;cC/Q1D;cACA;cACA;cACA;UAEI;WACN;WACA;WACA,OAAO,SAAS;;UAGV;WACN;WACA;WACA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA;WACA;aACE;aACA;;WAEF;aACE;;;;;;;;;;;;;;;UAgBI;WACN;WACA;WACA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE,iBAAiB;aACjB;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eAAe,eACf,UAAU,wBACT"} | ||
| {"version":3,"file":"control.d.mts","names":[],"sources":["../src/control/contract-serializer.ts","../src/control/contract-snapshot-layout.ts","../src/control/schema-diff.ts","../src/control/control-operation-results.ts","../src/control/control-instances.ts","../src/control/control-migration-types.ts","../src/control/control-spaces.ts","../src/control/control-stack.ts","../src/control/control-descriptors.ts","../src/control/control-operation-preview.ts","../src/control/control-schema-view.ts","../src/control/control-capabilities.ts","../src/control/order-issues-by-dependencies.ts","../src/control/schema-verifier.ts","../src/control/verifier-disposition.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmBiB,mBAAmB;;;;;;;;;;;;EAYlC,oBAAoB,UAAU,YAAY,WAAW,gBAAgB;;;;;;;;;;EAWrE,kBAAkB,UAAU,YAAY;;;;;;;;WAS/B,sBAAsB;;;;;;;;WAStB,cAAc;;;;cC1DZ;;iBAKG,eAAe;;iBAUf,8BACd,6BACA;;iBAMc,+BACd,6BACA;;;;;;;;;;KCpBU;WAAoC;WAA2B;;UAE1D,gBAAgB,cAAc,eAAe;;WAEnD;;WAEA,WAAW;;WAEX,SAAS;;;;;;;;WAQT;;;;;;;;;;;;;;;;KAiBC;;;;;;;iBAQI,aAAa,OAAO,kBAAkB;;;;;;;;;;;;;;;UAyBrC;WACN;WACA;;;;;;;WAOA,qBAAqB;EAC9B,UAAU,OAAO;EACjB,qBAAqB;;;;;;;;;;;iBAiDP,YACd,UAAU,cACV,QAAQ,wBACE;;;;;;;;;;;;cAiIC,WAAW,cAAc,eAAe;WAC1C,iBAAiB,gBAAgB;cAE9B,iBAAiB,gBAAgB;;EAK7C,OAAO,OAAO,OAAO,gBAAgB,qBAAqB,WAAW;;;;cC/Q1D;cACA;cACA;cACA;UAEI;WACN;WACA;WACA,OAAO,SAAS;;UAGV;WACN;WACA;WACA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA;WACA;aACE;aACA;;WAEF;aACE;;;;;;;;;;;;;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;;;;KCtChB;KAEA,kBAAkB;;;;;;;;;;;;;;;;;KAkBlB;;;;;;;;;;iBAiBI,uBACd,eAAe,eACf,UAAU,wBACT"} |
+13
-13
@@ -281,3 +281,3 @@ import { n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from "./resolve-codec-CHARBCXP.mjs"; | ||
| function readDeclaredDependencyIds(descriptor) { | ||
| const packs = descriptor.contractSpace?.contractJson?.extensionPacks; | ||
| const packs = descriptor.contractSpace?.contractJson?.extensions; | ||
| if (packs === null || typeof packs !== "object") return []; | ||
@@ -289,3 +289,3 @@ return Object.keys(packs); | ||
| * using Kahn's topological sort algorithm. Dependencies (packs declared in | ||
| * `contractSpace.contractJson.extensionPacks`) are placed before the extensions | ||
| * `contractSpace.contractJson.extensions`) are placed before the extensions | ||
| * that depend on them. | ||
@@ -297,3 +297,3 @@ * | ||
| * Throws if any extension declares a dependency on a pack ID that is not present | ||
| * in the provided list — add the missing pack to the `extensionPacks` list to | ||
| * in the provided list — add the missing pack to the `extensions` list to | ||
| * resolve the error. | ||
@@ -311,3 +311,3 @@ */ | ||
| for (const ext of extensions) for (const depId of readDeclaredDependencyIds(ext)) { | ||
| if (!idSet.has(depId)) throw new InternalError(`Extension "${ext.id}" declares a dependency on "${depId}", but "${depId}" is not in the provided extension set. Add the missing space to extensionPacks.`); | ||
| if (!idSet.has(depId)) throw new InternalError(`Extension "${ext.id}" declares a dependency on "${depId}", but "${depId}" is not in the provided extension set. Add the missing space to extensions.`); | ||
| inDegree.set(ext.id, (inDegree.get(ext.id) ?? 0) + 1); | ||
@@ -337,6 +337,6 @@ const list = dependents.get(depId); | ||
| function createControlStack(input) { | ||
| const { family, target, adapter, driver, extensionPacks = [] } = input; | ||
| const orderedIds = buildExtensionLoadOrder(extensionPacks); | ||
| const extensionById = new Map(extensionPacks.map((ext) => [ext.id, ext])); | ||
| const orderedExtensionPacks = orderedIds.map((id) => extensionById.get(id)).filter((ext) => ext !== void 0); | ||
| const { family, target, adapter, driver, extensions = [] } = input; | ||
| const orderedIds = buildExtensionLoadOrder(extensions); | ||
| const extensionById = new Map(extensions.map((ext) => [ext.id, ext])); | ||
| const orderedExtensions = orderedIds.map((id) => extensionById.get(id)).filter((ext) => ext !== void 0); | ||
| const allDescriptors = [ | ||
@@ -346,3 +346,3 @@ family, | ||
| ...adapter ? [adapter] : [], | ||
| ...orderedExtensionPacks | ||
| ...orderedExtensions | ||
| ]; | ||
@@ -356,7 +356,7 @@ const codecLookup = extractCodecLookup(allDescriptors); | ||
| driver, | ||
| extensionPacks: orderedExtensionPacks, | ||
| extensionContracts: assembleExtensionContracts(orderedExtensionPacks), | ||
| extensions: orderedExtensions, | ||
| extensionContracts: assembleExtensionContracts(orderedExtensions), | ||
| codecTypeImports: extractCodecTypeImports(allDescriptors), | ||
| queryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors), | ||
| extensionIds: extractComponentIds(family, target, adapter, orderedExtensionPacks), | ||
| extensionIds: extractComponentIds(family, target, adapter, orderedExtensions), | ||
| codecLookup, | ||
@@ -369,3 +369,3 @@ authoringContributions, | ||
| ...adapter ? [adapter] : [], | ||
| ...orderedExtensionPacks | ||
| ...orderedExtensions | ||
| ]) | ||
@@ -372,0 +372,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
| import { b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, h as FamilyInstance, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, t as AdapterDescriptor, y as TargetDescriptor } from "./framework-components-CDWIpbwD.mjs"; | ||
| import { b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, h as FamilyInstance, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, t as AdapterDescriptor, y as TargetDescriptor } from "./framework-components-Crm97b5Y.mjs"; | ||
| //#region src/execution/execution-instances.d.ts | ||
@@ -14,3 +14,3 @@ interface RuntimeFamilyInstance<TFamilyId extends string> extends FamilyInstance<TFamilyId> {} | ||
| readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance> | undefined; | ||
| readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId, TExtensionInstance>[]; | ||
| readonly extensions: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId, TExtensionInstance>[]; | ||
| } | ||
@@ -22,3 +22,3 @@ interface ExecutionStackInstance<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> { | ||
| readonly driver: TDriverInstance | undefined; | ||
| readonly extensionPacks: readonly TExtensionInstance[]; | ||
| readonly extensions: readonly TExtensionInstance[]; | ||
| } | ||
@@ -29,3 +29,3 @@ declare function createExecutionStack<TFamilyId extends string, TTargetId extends string, TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>, TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>, TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>, TDriverDescriptor extends RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance> | undefined = undefined, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>, TExtensionDescriptor extends RuntimeExtensionDescriptor<TFamilyId, TTargetId, TExtensionInstance> = never>(input: { | ||
| readonly driver?: TDriverDescriptor | undefined; | ||
| readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined; | ||
| readonly extensions?: readonly TExtensionDescriptor[] | undefined; | ||
| }): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & { | ||
@@ -35,3 +35,3 @@ readonly target: TTargetDescriptor; | ||
| readonly driver: TDriverDescriptor | undefined; | ||
| readonly extensionPacks: readonly TExtensionDescriptor[]; | ||
| readonly extensions: readonly TExtensionDescriptor[]; | ||
| }; | ||
@@ -46,3 +46,3 @@ declare function instantiateExecutionStack<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>>(stack: ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance>): ExecutionStackInstance<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance>; | ||
| readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId>; | ||
| readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| readonly extensions: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| }): TFamilyInstance; | ||
@@ -71,6 +71,6 @@ } | ||
| //#region src/execution/execution-requirements.d.ts | ||
| declare function assertRuntimeContractRequirementsSatisfied<TFamilyId extends string, TTargetId extends string>({ contract, family, target, adapter, extensionPacks }: { | ||
| declare function assertRuntimeContractRequirementsSatisfied<TFamilyId extends string, TTargetId extends string>({ contract, family, target, adapter, extensions }: { | ||
| readonly contract: { | ||
| readonly target: string; | ||
| readonly extensionPacks?: Record<string, unknown>; | ||
| readonly extensions?: Record<string, unknown>; | ||
| }; | ||
@@ -80,3 +80,3 @@ readonly family: RuntimeFamilyDescriptor<TFamilyId>; | ||
| readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>; | ||
| readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| readonly extensions: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| }): void; | ||
@@ -83,0 +83,0 @@ //#endregion |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"execution.d.mts","names":[],"sources":["../src/execution/execution-instances.ts","../src/execution/execution-stack.ts","../src/execution/execution-descriptors.ts","../src/execution/execution-requirements.ts"],"mappings":";;UAQiB,sBAAsB,kCAC7B,eAAe;UAER,sBAAsB,0BAA0B,kCACvD,eAAe,WAAW;UAEnB,uBAAuB,0BAA0B,kCACxD,gBAAgB,WAAW;UAEpB,sBAAsB,0BAA0B,kCACvD,eAAe,WAAW;UAEnB,yBAAyB,0BAA0B,kCAC1D,kBAAkB,WAAW;;;UCRtB,eACf,0BACA,0BACA,yBAAyB,uBAAuB,WAAW,aAAa,uBACtE,WACA,YAEF,wBAAwB,sBAAsB,WAAW,aAAa,sBACpE,WACA,YAEF,2BAA2B,yBACzB,WACA,aACE,yBAAyB,WAAW;WAE/B,QAAQ,wBAAwB,WAAW;WAC3C,SAAS,yBAAyB,WAAW,WAAW;WACxD,QACL,wBAAwB,WAAW,oBAAoB;WAElD,yBAAyB,2BAChC,WACA,WACA;;UAIa,uBACf,0BACA,0BACA,yBAAyB,uBAAuB,WAAW,aAAa,uBACtE,WACA,YAEF,wBAAwB,sBAAsB,WAAW,aAAa,sBACpE,WACA,YAEF,2BAA2B,yBACzB,WACA,aACE,yBAAyB,WAAW;WAE/B,OAAO,eACd,WACA,WACA,kBACA,iBACA;WAEO,QAAQ,sBAAsB,WAAW;WACzC,SAAS;WACT,QAAQ;WACR,yBAAyB;;iBAGpB,qBACd,0BACA,0BACA,wBAAwB,sBAAsB,WAAW,YACzD,0BAA0B,wBAAwB,WAAW,WAAW,kBACxE,yBAAyB,uBAAuB,WAAW,YAC3D,2BAA2B,yBAAyB,WAAW,WAAW,mBAC1E,wBAAwB,sBAAsB,WAAW,aAAa,sBACpE,WACA,YAEF,0BAC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C,SAAS,yBAAyB,WAAW;WAC7C,yBAAyB,2BAA2B,WAAW"} | ||
| {"version":3,"file":"execution.d.mts","names":[],"sources":["../src/execution/execution-instances.ts","../src/execution/execution-stack.ts","../src/execution/execution-descriptors.ts","../src/execution/execution-requirements.ts"],"mappings":";;UAQiB,sBAAsB,kCAC7B,eAAe;UAER,sBAAsB,0BAA0B,kCACvD,eAAe,WAAW;UAEnB,uBAAuB,0BAA0B,kCACxD,gBAAgB,WAAW;UAEpB,sBAAsB,0BAA0B,kCACvD,eAAe,WAAW;UAEnB,yBAAyB,0BAA0B,kCAC1D,kBAAkB,WAAW;;;UCRtB,eACf,0BACA,0BACA,yBAAyB,uBAAuB,WAAW,aAAa,uBACtE,WACA,YAEF,wBAAwB,sBAAsB,WAAW,aAAa,sBACpE,WACA,YAEF,2BAA2B,yBACzB,WACA,aACE,yBAAyB,WAAW;WAE/B,QAAQ,wBAAwB,WAAW;WAC3C,SAAS,yBAAyB,WAAW,WAAW;WACxD,QACL,wBAAwB,WAAW,oBAAoB;WAElD,qBAAqB,2BAC5B,WACA,WACA;;UAIa,uBACf,0BACA,0BACA,yBAAyB,uBAAuB,WAAW,aAAa,uBACtE,WACA,YAEF,wBAAwB,sBAAsB,WAAW,aAAa,sBACpE,WACA,YAEF,2BAA2B,yBACzB,WACA,aACE,yBAAyB,WAAW;WAE/B,OAAO,eACd,WACA,WACA,kBACA,iBACA;WAEO,QAAQ,sBAAsB,WAAW;WACzC,SAAS;WACT,QAAQ;WACR,qBAAqB;;iBAGhB,qBACd,0BACA,0BACA,wBAAwB,sBAAsB,WAAW,YACzD,0BAA0B,wBAAwB,WAAW,WAAW,kBACxE,yBAAyB,uBAAuB,WAAW,YAC3D,2BAA2B,yBAAyB,WAAW,WAAW,mBAC1E,wBAAwB,sBAAsB,WAAW,aAAa,sBACpE,WACA,YAEF,0BACI,wBAAwB,WAAW,oBAAoB,0CAE3D,2BAA2B,yBACzB,WACA,aACE,yBAAyB,WAAW,YACxC,6BAA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as checkContractComponentRequirements } from "./framework-components-DbCS57go.mjs"; | ||
| import { t as checkContractComponentRequirements } from "./framework-components-D6j4Y5K7.mjs"; | ||
| //#region src/execution/execution-requirements.ts | ||
| function assertRuntimeContractRequirementsSatisfied({ contract, family, target, adapter, extensionPacks }) { | ||
| function assertRuntimeContractRequirementsSatisfied({ contract, family, target, adapter, extensions }) { | ||
| const providedComponentIds = /* @__PURE__ */ new Set([ | ||
@@ -9,3 +9,3 @@ family.id, | ||
| ]); | ||
| for (const extension of extensionPacks) providedComponentIds.add(extension.id); | ||
| for (const extension of extensions) providedComponentIds.add(extension.id); | ||
| const result = checkContractComponentRequirements({ | ||
@@ -26,3 +26,3 @@ contract, | ||
| driver: input.driver, | ||
| extensionPacks: input.extensionPacks ?? [] | ||
| extensions: input.extensions ?? [] | ||
| }; | ||
@@ -37,3 +37,3 @@ } | ||
| driver, | ||
| extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create()) | ||
| extensions: stack.extensions.map((descriptor) => descriptor.create()) | ||
| }; | ||
@@ -40,0 +40,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"execution.mjs","names":[],"sources":["../src/execution/execution-requirements.ts","../src/execution/execution-stack.ts"],"sourcesContent":["import { checkContractComponentRequirements } from '../shared/framework-components';\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\n\nexport function assertRuntimeContractRequirementsSatisfied<\n TFamilyId extends string,\n TTargetId extends string,\n>({\n contract,\n family,\n target,\n adapter,\n extensionPacks,\n}: {\n readonly contract: { readonly target: string; readonly extensionPacks?: Record<string, unknown> };\n readonly family: RuntimeFamilyDescriptor<TFamilyId>;\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];\n}): void {\n const providedComponentIds = new Set<string>([family.id, target.id, adapter.id]);\n for (const extension of extensionPacks) {\n providedComponentIds.add(extension.id);\n }\n\n const result = checkContractComponentRequirements({\n contract,\n expectedTargetId: target.targetId,\n providedComponentIds,\n });\n\n if (result.targetMismatch) {\n throw new Error(\n `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`,\n );\n }\n\n for (const packId of result.missingExtensionPackIds) {\n throw new Error(\n `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`,\n );\n }\n}\n","import type {\n RuntimeAdapterDescriptor,\n RuntimeDriverDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\nimport type {\n RuntimeAdapterInstance,\n RuntimeDriverInstance,\n RuntimeExtensionInstance,\n RuntimeTargetInstance,\n} from './execution-instances';\n\nexport interface ExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;\n readonly driver:\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n >[];\n}\n\nexport interface ExecutionStackInstance<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >;\n readonly target: RuntimeTargetInstance<TFamilyId, TTargetId>;\n readonly adapter: TAdapterInstance;\n readonly driver: TDriverInstance | undefined;\n readonly extensionPacks: readonly TExtensionInstance[];\n}\n\nexport function createExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>,\n TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverDescriptor extends\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined = undefined,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n TExtensionDescriptor extends RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n > = never,\n>(input: {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver?: TDriverDescriptor | undefined;\n readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined;\n}): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver: TDriverDescriptor | undefined;\n readonly extensionPacks: readonly TExtensionDescriptor[];\n} {\n return {\n target: input.target,\n adapter: input.adapter,\n driver: input.driver,\n extensionPacks: input.extensionPacks ?? [],\n };\n}\n\nexport function instantiateExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>,\n TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>,\n>(\n stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >,\n): ExecutionStackInstance<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n> {\n const driver = stack.driver ? stack.driver.create() : undefined;\n\n return {\n stack,\n target: stack.target.create(),\n adapter: stack.adapter.create(stack),\n driver,\n extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create()),\n };\n}\n"],"mappings":";;AAQA,SAAgB,2CAGd,EACA,UACA,QACA,QACA,SACA,kBAOO;CACP,MAAM,uCAAuB,IAAI,IAAY;EAAC,OAAO;EAAI,OAAO;EAAI,QAAQ;CAAE,CAAC;CAC/E,KAAK,MAAM,aAAa,gBACtB,qBAAqB,IAAI,UAAU,EAAE;CAGvC,MAAM,SAAS,mCAAmC;EAChD;EACA,kBAAkB,OAAO;EACzB;CACF,CAAC;CAED,IAAI,OAAO,gBACT,MAAM,IAAI,MACR,oBAAoB,OAAO,eAAe,OAAO,8CAA8C,OAAO,eAAe,SAAS,GAChI;CAGF,KAAK,MAAM,UAAU,OAAO,yBAC1B,MAAM,IAAI,MACR,qCAAqC,OAAO,gEAC9C;AAEJ;;;ACwBA,SAAgB,qBAuBd,OAUA;CACA,OAAO;EACL,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,gBAAgB,MAAM,kBAAkB,CAAC;CAC3C;AACF;AAEA,SAAgB,0BAOd,OAaA;CACA,MAAM,SAAS,MAAM,SAAS,MAAM,OAAO,OAAO,IAAI,KAAA;CAEtD,OAAO;EACL;EACA,QAAQ,MAAM,OAAO,OAAO;EAC5B,SAAS,MAAM,QAAQ,OAAO,KAAK;EACnC;EACA,gBAAgB,MAAM,eAAe,KAAK,eAAe,WAAW,OAAO,CAAC;CAC9E;AACF"} | ||
| {"version":3,"file":"execution.mjs","names":[],"sources":["../src/execution/execution-requirements.ts","../src/execution/execution-stack.ts"],"sourcesContent":["import { checkContractComponentRequirements } from '../shared/framework-components';\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\n\nexport function assertRuntimeContractRequirementsSatisfied<\n TFamilyId extends string,\n TTargetId extends string,\n>({\n contract,\n family,\n target,\n adapter,\n extensions,\n}: {\n readonly contract: { readonly target: string; readonly extensions?: Record<string, unknown> };\n readonly family: RuntimeFamilyDescriptor<TFamilyId>;\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensions: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];\n}): void {\n const providedComponentIds = new Set<string>([family.id, target.id, adapter.id]);\n for (const extension of extensions) {\n providedComponentIds.add(extension.id);\n }\n\n const result = checkContractComponentRequirements({\n contract,\n expectedTargetId: target.targetId,\n providedComponentIds,\n });\n\n if (result.targetMismatch) {\n throw new Error(\n `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`,\n );\n }\n\n for (const packId of result.missingExtensionPackIds) {\n throw new Error(\n `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`,\n );\n }\n}\n","import type {\n RuntimeAdapterDescriptor,\n RuntimeDriverDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\nimport type {\n RuntimeAdapterInstance,\n RuntimeDriverInstance,\n RuntimeExtensionInstance,\n RuntimeTargetInstance,\n} from './execution-instances';\n\nexport interface ExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;\n readonly driver:\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined;\n readonly extensions: readonly RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n >[];\n}\n\nexport interface ExecutionStackInstance<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >;\n readonly target: RuntimeTargetInstance<TFamilyId, TTargetId>;\n readonly adapter: TAdapterInstance;\n readonly driver: TDriverInstance | undefined;\n readonly extensions: readonly TExtensionInstance[];\n}\n\nexport function createExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>,\n TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverDescriptor extends\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined = undefined,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n TExtensionDescriptor extends RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n > = never,\n>(input: {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver?: TDriverDescriptor | undefined;\n readonly extensions?: readonly TExtensionDescriptor[] | undefined;\n}): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver: TDriverDescriptor | undefined;\n readonly extensions: readonly TExtensionDescriptor[];\n} {\n return {\n target: input.target,\n adapter: input.adapter,\n driver: input.driver,\n extensions: input.extensions ?? [],\n };\n}\n\nexport function instantiateExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>,\n TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>,\n>(\n stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >,\n): ExecutionStackInstance<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n> {\n const driver = stack.driver ? stack.driver.create() : undefined;\n\n return {\n stack,\n target: stack.target.create(),\n adapter: stack.adapter.create(stack),\n driver,\n extensions: stack.extensions.map((descriptor) => descriptor.create()),\n };\n}\n"],"mappings":";;AAQA,SAAgB,2CAGd,EACA,UACA,QACA,QACA,SACA,cAOO;CACP,MAAM,uCAAuB,IAAI,IAAY;EAAC,OAAO;EAAI,OAAO;EAAI,QAAQ;CAAE,CAAC;CAC/E,KAAK,MAAM,aAAa,YACtB,qBAAqB,IAAI,UAAU,EAAE;CAGvC,MAAM,SAAS,mCAAmC;EAChD;EACA,kBAAkB,OAAO;EACzB;CACF,CAAC;CAED,IAAI,OAAO,gBACT,MAAM,IAAI,MACR,oBAAoB,OAAO,eAAe,OAAO,8CAA8C,OAAO,eAAe,SAAS,GAChI;CAGF,KAAK,MAAM,UAAU,OAAO,yBAC1B,MAAM,IAAI,MACR,qCAAqC,OAAO,gEAC9C;AAEJ;;;ACwBA,SAAgB,qBAuBd,OAUA;CACA,OAAO;EACL,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,YAAY,MAAM,cAAc,CAAC;CACnC;AACF;AAEA,SAAgB,0BAOd,OAaA;CACA,MAAM,SAAS,MAAM,SAAS,MAAM,OAAO,OAAO,IAAI,KAAA;CAEtD,OAAO;EACL;EACA,QAAQ,MAAM,OAAO,OAAO;EAC5B,SAAS,MAAM,QAAQ,OAAO,KAAK;EACnC;EACA,YAAY,MAAM,WAAW,KAAK,eAAe,WAAW,OAAO,CAAC;CACtE;AACF"} |
+7
-7
| { | ||
| "name": "@prisma-next/framework-components", | ||
| "version": "0.16.0-dev.19", | ||
| "version": "0.16.0-dev.22", | ||
| "license": "Apache-2.0", | ||
@@ -9,6 +9,6 @@ "type": "module", | ||
| "dependencies": { | ||
| "@prisma-next/contract": "0.16.0-dev.19", | ||
| "@prisma-next/operations": "0.16.0-dev.19", | ||
| "@prisma-next/ts-render": "0.16.0-dev.19", | ||
| "@prisma-next/utils": "0.16.0-dev.19", | ||
| "@prisma-next/contract": "0.16.0-dev.22", | ||
| "@prisma-next/operations": "0.16.0-dev.22", | ||
| "@prisma-next/ts-render": "0.16.0-dev.22", | ||
| "@prisma-next/utils": "0.16.0-dev.22", | ||
| "@standard-schema/spec": "^1.1.0", | ||
@@ -18,4 +18,4 @@ "arktype": "^2.2.2" | ||
| "devDependencies": { | ||
| "@prisma-next/tsconfig": "0.16.0-dev.19", | ||
| "@prisma-next/tsdown": "0.16.0-dev.19", | ||
| "@prisma-next/tsconfig": "0.16.0-dev.22", | ||
| "@prisma-next/tsdown": "0.16.0-dev.22", | ||
| "tsdown": "0.22.8", | ||
@@ -22,0 +22,0 @@ "typescript": "5.9.3", |
@@ -62,3 +62,3 @@ import type { Contract, JsonValue } from '@prisma-next/contract/types'; | ||
| readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined; | ||
| readonly extensionPacks: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| readonly extensions: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
@@ -86,5 +86,3 @@ readonly extensionContracts: ReadonlyMap<string, Contract>; | ||
| readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined; | ||
| readonly extensionPacks?: | ||
| | ReadonlyArray<ControlExtensionDescriptor<TFamilyId, TTargetId>> | ||
| | undefined; | ||
| readonly extensions?: ReadonlyArray<ControlExtensionDescriptor<TFamilyId, TTargetId>> | undefined; | ||
| } | ||
@@ -474,3 +472,3 @@ | ||
| readonly contractJson?: { | ||
| readonly extensionPacks?: Readonly<Record<string, unknown>>; | ||
| readonly extensions?: Readonly<Record<string, unknown>>; | ||
| }; | ||
@@ -494,3 +492,3 @@ }; | ||
| function readDeclaredDependencyIds(descriptor: DependencyDeclaringDescriptor): readonly string[] { | ||
| const packs = descriptor.contractSpace?.contractJson?.extensionPacks; | ||
| const packs = descriptor.contractSpace?.contractJson?.extensions; | ||
| if (packs === null || typeof packs !== 'object') return []; | ||
@@ -503,3 +501,3 @@ return Object.keys(packs); | ||
| * using Kahn's topological sort algorithm. Dependencies (packs declared in | ||
| * `contractSpace.contractJson.extensionPacks`) are placed before the extensions | ||
| * `contractSpace.contractJson.extensions`) are placed before the extensions | ||
| * that depend on them. | ||
@@ -511,3 +509,3 @@ * | ||
| * Throws if any extension declares a dependency on a pack ID that is not present | ||
| * in the provided list — add the missing pack to the `extensionPacks` list to | ||
| * in the provided list — add the missing pack to the `extensions` list to | ||
| * resolve the error. | ||
@@ -534,3 +532,3 @@ */ | ||
| throw new InternalError( | ||
| `Extension "${ext.id}" declares a dependency on "${depId}", but "${depId}" is not in the provided extension set. Add the missing space to extensionPacks.`, | ||
| `Extension "${ext.id}" declares a dependency on "${depId}", but "${depId}" is not in the provided extension set. Add the missing space to extensions.`, | ||
| ); | ||
@@ -580,11 +578,11 @@ } | ||
| ): ControlStack<TFamilyId, TTargetId> { | ||
| const { family, target, adapter, driver, extensionPacks = [] } = input; | ||
| const { family, target, adapter, driver, extensions = [] } = input; | ||
| const orderedIds = buildExtensionLoadOrder(extensionPacks); | ||
| const extensionById = new Map(extensionPacks.map((ext) => [ext.id, ext])); | ||
| const orderedExtensionPacks = orderedIds | ||
| const orderedIds = buildExtensionLoadOrder(extensions); | ||
| const extensionById = new Map(extensions.map((ext) => [ext.id, ext])); | ||
| const orderedExtensions = orderedIds | ||
| .map((id) => extensionById.get(id)) | ||
| .filter((ext): ext is ControlExtensionDescriptor<TFamilyId, TTargetId> => ext !== undefined); | ||
| const allDescriptors = [family, target, ...(adapter ? [adapter] : []), ...orderedExtensionPacks]; | ||
| const allDescriptors = [family, target, ...(adapter ? [adapter] : []), ...orderedExtensions]; | ||
@@ -599,8 +597,8 @@ const codecLookup = extractCodecLookup(allDescriptors); | ||
| driver, | ||
| extensionPacks: orderedExtensionPacks, | ||
| extensionContracts: assembleExtensionContracts(orderedExtensionPacks), | ||
| extensions: orderedExtensions, | ||
| extensionContracts: assembleExtensionContracts(orderedExtensions), | ||
| codecTypeImports: extractCodecTypeImports(allDescriptors), | ||
| queryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors), | ||
| extensionIds: extractComponentIds(family, target, adapter, orderedExtensionPacks), | ||
| extensionIds: extractComponentIds(family, target, adapter, orderedExtensions), | ||
| codecLookup, | ||
@@ -613,5 +611,5 @@ authoringContributions, | ||
| ...(adapter ? [adapter] : []), | ||
| ...orderedExtensionPacks, | ||
| ...orderedExtensions, | ||
| ]), | ||
| }; | ||
| } |
@@ -25,3 +25,3 @@ import type { | ||
| readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId>; | ||
| readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| readonly extensions: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| }): TFamilyInstance; | ||
@@ -28,0 +28,0 @@ } |
@@ -17,12 +17,12 @@ import { checkContractComponentRequirements } from '../shared/framework-components'; | ||
| adapter, | ||
| extensionPacks, | ||
| extensions, | ||
| }: { | ||
| readonly contract: { readonly target: string; readonly extensionPacks?: Record<string, unknown> }; | ||
| readonly contract: { readonly target: string; readonly extensions?: Record<string, unknown> }; | ||
| readonly family: RuntimeFamilyDescriptor<TFamilyId>; | ||
| readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>; | ||
| readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>; | ||
| readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| readonly extensions: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[]; | ||
| }): void { | ||
| const providedComponentIds = new Set<string>([family.id, target.id, adapter.id]); | ||
| for (const extension of extensionPacks) { | ||
| for (const extension of extensions) { | ||
| providedComponentIds.add(extension.id); | ||
@@ -29,0 +29,0 @@ } |
@@ -35,3 +35,3 @@ import type { | ||
| | undefined; | ||
| readonly extensionPacks: readonly RuntimeExtensionDescriptor< | ||
| readonly extensions: readonly RuntimeExtensionDescriptor< | ||
| TFamilyId, | ||
@@ -69,3 +69,3 @@ TTargetId, | ||
| readonly driver: TDriverInstance | undefined; | ||
| readonly extensionPacks: readonly TExtensionInstance[]; | ||
| readonly extensions: readonly TExtensionInstance[]; | ||
| } | ||
@@ -100,3 +100,3 @@ | ||
| readonly driver?: TDriverDescriptor | undefined; | ||
| readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined; | ||
| readonly extensions?: readonly TExtensionDescriptor[] | undefined; | ||
| }): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & { | ||
@@ -106,3 +106,3 @@ readonly target: TTargetDescriptor; | ||
| readonly driver: TDriverDescriptor | undefined; | ||
| readonly extensionPacks: readonly TExtensionDescriptor[]; | ||
| readonly extensions: readonly TExtensionDescriptor[]; | ||
| } { | ||
@@ -113,3 +113,3 @@ return { | ||
| driver: input.driver, | ||
| extensionPacks: input.extensionPacks ?? [], | ||
| extensions: input.extensions ?? [], | ||
| }; | ||
@@ -146,4 +146,4 @@ } | ||
| driver, | ||
| extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create()), | ||
| extensions: stack.extensions.map((descriptor) => descriptor.create()), | ||
| }; | ||
| } |
@@ -93,3 +93,3 @@ import type { AnyCodecDescriptor } from './codec-descriptor'; | ||
| readonly targetFamily?: string | undefined; | ||
| readonly extensionPacks?: Record<string, unknown> | undefined; | ||
| readonly extensions?: Record<string, unknown> | undefined; | ||
| }; | ||
@@ -115,4 +115,4 @@ readonly expectedTargetFamily?: string | undefined; | ||
| const requiredExtensionPackIds = input.contract.extensionPacks | ||
| ? Object.keys(input.contract.extensionPacks) | ||
| const requiredExtensionPackIds = input.contract.extensions | ||
| ? Object.keys(input.contract.extensions) | ||
| : []; | ||
@@ -119,0 +119,0 @@ const missingExtensionPackIds = requiredExtensionPackIds.filter((id) => !providedIds.has(id)); |
| import { f as AnyCodecDescriptor } from "./codec-types-4tPB4m_G.mjs"; | ||
| import { i as AuthoringContributions } from "./framework-authoring-DT8QRvDv.mjs"; | ||
| import { t as TypesImportSpec } from "./types-import-spec-DRKzrJ20.mjs"; | ||
| import { ColumnDefault, ExecutionMutationDefaultPhases, ExecutionMutationDefaultValue } from "@prisma-next/contract/types"; | ||
| //#region src/shared/mutation-default-types.d.ts | ||
| interface SourcePosition { | ||
| readonly offset: number; | ||
| readonly line: number; | ||
| readonly column: number; | ||
| } | ||
| interface SourceSpan { | ||
| readonly start: SourcePosition; | ||
| readonly end: SourcePosition; | ||
| } | ||
| interface SourceDiagnostic { | ||
| readonly code: string; | ||
| readonly message: string; | ||
| readonly sourceId?: string; | ||
| readonly span?: SourceSpan; | ||
| readonly data?: Readonly<Record<string, unknown>>; | ||
| } | ||
| interface DefaultFunctionLoweringContext { | ||
| readonly sourceId: string; | ||
| readonly modelName: string; | ||
| readonly fieldName: string; | ||
| readonly columnCodecId?: string; | ||
| } | ||
| type LoweredDefaultValue = { | ||
| readonly kind: 'storage'; | ||
| readonly defaultValue: ColumnDefault; | ||
| } | { | ||
| readonly kind: 'execution'; | ||
| readonly generated: ExecutionMutationDefaultValue; | ||
| }; | ||
| type LoweredDefaultResult = { | ||
| readonly ok: true; | ||
| readonly value: LoweredDefaultValue; | ||
| } | { | ||
| readonly ok: false; | ||
| readonly diagnostic: SourceDiagnostic; | ||
| }; | ||
| interface MutationDefaultGeneratorDescriptor { | ||
| readonly id: string; | ||
| /** | ||
| * Codec ids the generator is compatible with when the codec choice | ||
| * and the generator choice are made independently by the contract | ||
| * author. Set when the registry-coherence check is meaningful | ||
| * (the codec and the generator can be paired arbitrarily by the | ||
| * caller); omitted when the generator is only reachable through a | ||
| * descriptor that co-registers a fixed codec, so coherence is | ||
| * structural and the list would be tautological. | ||
| */ | ||
| readonly applicableCodecIds?: readonly string[]; | ||
| /** | ||
| * Construct the `onCreate`/`onUpdate` phases value owned by this | ||
| * generator. Authoring layers (PSL `temporal.updatedAt()`, TS field presets) call | ||
| * this instead of building the literal inline so PSL/TS-authored | ||
| * contracts stay byte-equivalent for any future params-bearing generator. | ||
| */ | ||
| readonly buildPhases?: (args?: Record<string, unknown>) => ExecutionMutationDefaultPhases; | ||
| } | ||
| interface TypedDefaultFunctionCall { | ||
| readonly fn: string; | ||
| readonly span: SourceSpan; | ||
| readonly args: Readonly<Record<string, unknown>>; | ||
| } | ||
| interface ControlMutationDefaultEntry { | ||
| readonly signature?: unknown; | ||
| readonly lower: (input: { | ||
| readonly call: TypedDefaultFunctionCall; | ||
| readonly context: DefaultFunctionLoweringContext; | ||
| }) => LoweredDefaultResult; | ||
| readonly usageSignatures?: readonly string[]; | ||
| } | ||
| type ControlMutationDefaultRegistry = ReadonlyMap<string, ControlMutationDefaultEntry>; | ||
| interface ControlMutationDefaults { | ||
| readonly defaultFunctionRegistry: ControlMutationDefaultRegistry; | ||
| readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[]; | ||
| } | ||
| //#endregion | ||
| //#region src/shared/framework-components.d.ts | ||
| /** | ||
| * Declarative fields that describe component metadata. | ||
| */ | ||
| interface ComponentMetadata { | ||
| /** Component version (semver) */ | ||
| readonly version: string; | ||
| /** | ||
| * Capabilities this component provides. | ||
| * | ||
| * For adapters, capabilities must be declared on the adapter descriptor (so they are emitted into the contract) and also exposed in runtime adapter code (e.g. `adapter.profile.capabilities`); keep these declarations in sync. Targets are identifiers/descriptors and typically do not declare capabilities. | ||
| */ | ||
| readonly capabilities?: Record<string, unknown>; | ||
| /** Type imports for contract.d.ts generation */ | ||
| readonly types?: { | ||
| readonly codecTypes?: { | ||
| /** | ||
| * Base codec types import spec. Optional: adapters typically provide this, extensions usually don't. | ||
| */ | ||
| readonly import?: TypesImportSpec; | ||
| /** | ||
| * Additional type-only imports for parameterized codec branded types. | ||
| * | ||
| * These imports are included in generated `contract.d.ts` but are NOT treated as codec type maps (i.e., they should not be intersected into `export type CodecTypes = ...`). | ||
| * | ||
| * Example: `Vector<N>` for pgvector codecs that emit `Vector<1536>` | ||
| */ | ||
| readonly typeImports?: ReadonlyArray<TypesImportSpec>; | ||
| /** | ||
| * Optional control-plane hooks keyed by codecId. Used by family-specific planners/verifiers to handle storage types. | ||
| */ | ||
| readonly controlPlaneHooks?: Record<string, unknown>; | ||
| /** | ||
| * Codec descriptors contributed by this component. Source of truth for codec-id-keyed metadata (`traits`, `targetTypes`, `meta`, `renderOutputType`) consumed by `extractCodecLookup`, and used to materialize representative `Codec` instances for codec-dispatched type rendering during emission. | ||
| */ | ||
| readonly codecDescriptors?: ReadonlyArray<AnyCodecDescriptor>; | ||
| }; | ||
| readonly queryOperationTypes?: { | ||
| readonly import: TypesImportSpec; | ||
| }; | ||
| readonly storage?: ReadonlyArray<{ | ||
| readonly typeId: string; | ||
| readonly familyId: string; | ||
| readonly targetId: string; | ||
| readonly nativeType?: string; | ||
| }>; | ||
| }; | ||
| /** | ||
| * Optional pure-data authoring contributions exposed by this component. | ||
| * | ||
| * These contributions are safe to include on pack refs and descriptors because they contain only declarative metadata. Higher-level authoring packages may project them into concrete helper functions for TS-first workflows. | ||
| */ | ||
| readonly authoring?: AuthoringContributions; | ||
| /** | ||
| * Mutation default function handlers and generator descriptors contributed by this component. Assembled by `createControlStack` with duplicate detection. | ||
| */ | ||
| readonly controlMutationDefaults?: ControlMutationDefaults; | ||
| } | ||
| /** | ||
| * Base descriptor for any framework component. | ||
| * | ||
| * All component descriptors share these fundamental properties that identify the component and provide its metadata. This interface is extended by specific descriptor types (FamilyDescriptor, TargetDescriptor, etc.). | ||
| * | ||
| * @template Kind - Discriminator literal identifying the component type. Built-in kinds are 'family', 'target', 'adapter', 'driver', 'extension', but the type accepts any string to allow ecosystem extensions. | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * // All descriptors have these properties | ||
| * descriptor.kind // The Kind type parameter (e.g., 'family', 'target', or custom kinds) | ||
| * descriptor.id // Unique string identifier (e.g., 'sql', 'postgres') | ||
| * descriptor.version // Component version (semver) | ||
| * ``` | ||
| */ | ||
| interface ComponentDescriptor<Kind extends string> extends ComponentMetadata { | ||
| /** Discriminator identifying the component type */ | ||
| readonly kind: Kind; | ||
| /** Unique identifier for this component (e.g., 'sql', 'postgres', 'pgvector') */ | ||
| readonly id: string; | ||
| } | ||
| interface ContractComponentRequirementsCheckInput { | ||
| readonly contract: { | ||
| readonly target: string; | ||
| readonly targetFamily?: string | undefined; | ||
| readonly extensionPacks?: Record<string, unknown> | undefined; | ||
| }; | ||
| readonly expectedTargetFamily?: string | undefined; | ||
| readonly expectedTargetId?: string | undefined; | ||
| readonly providedComponentIds: Iterable<string>; | ||
| } | ||
| interface ContractComponentRequirementsCheckResult { | ||
| readonly familyMismatch?: { | ||
| readonly expected: string; | ||
| readonly actual: string; | ||
| } | undefined; | ||
| readonly targetMismatch?: { | ||
| readonly expected: string; | ||
| readonly actual: string; | ||
| } | undefined; | ||
| readonly missingExtensionPackIds: readonly string[]; | ||
| } | ||
| declare function checkContractComponentRequirements(input: ContractComponentRequirementsCheckInput): ContractComponentRequirementsCheckResult; | ||
| /** | ||
| * Descriptor for a family component. | ||
| * | ||
| * A "family" represents a category of data sources with shared semantics (e.g., SQL databases, document stores). Families define: | ||
| * - Query semantics and operations (SELECT, INSERT, find, aggregate, etc.) | ||
| * - Contract structure (tables vs collections, columns vs fields) | ||
| * - Type system and codecs | ||
| * | ||
| * Families are the top-level grouping. Each family contains multiple targets (e.g., SQL family contains Postgres, MySQL, SQLite targets). | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlFamilyDescriptor` - adds `emission` for CLI/tooling operations | ||
| * - `RuntimeFamilyDescriptor` - adds runtime-specific factory methods | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document') | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import sql from '@prisma-next/family-sql/control'; | ||
| * | ||
| * sql.kind // 'family' | ||
| * sql.familyId // 'sql' | ||
| * sql.id // 'sql' | ||
| * ``` | ||
| */ | ||
| interface FamilyDescriptor<TFamilyId extends string> extends ComponentDescriptor<'family'> { | ||
| /** The family identifier (e.g., 'sql', 'document') */ | ||
| readonly familyId: TFamilyId; | ||
| } | ||
| /** | ||
| * Descriptor for a target component. | ||
| * | ||
| * A "target" represents a specific database or data store within a family (e.g., Postgres, MySQL, MongoDB). Targets define: | ||
| * - Native type mappings (e.g., Postgres int4 → TypeScript number) | ||
| * - Target-specific capabilities (e.g., RETURNING, LATERAL joins) | ||
| * | ||
| * Targets are bound to a family and provide the target-specific implementation details that adapters and drivers use. | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlTargetDescriptor` - adds optional `migrations` capability | ||
| * - `RuntimeTargetDescriptor` - adds runtime factory method | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql') | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import postgres from '@prisma-next/target-postgres/control'; | ||
| * | ||
| * postgres.kind // 'target' | ||
| * postgres.familyId // 'sql' | ||
| * postgres.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface TargetDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'target'> { | ||
| /** The family this target belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** | ||
| * Base shape for any pack reference. Pack refs are pure JSON-friendly objects safe to import in authoring flows. | ||
| */ | ||
| interface PackRefBase<Kind extends string, TFamilyId extends string> extends ComponentMetadata { | ||
| readonly kind: Kind; | ||
| readonly id: string; | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId?: string; | ||
| readonly authoring?: AuthoringContributions; | ||
| } | ||
| type FamilyPackRef<TFamilyId extends string = string> = PackRefBase<'family', TFamilyId>; | ||
| type TargetPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'target', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| /** The namespace a bare (un-namespaced) entity name resolves to for this target (e.g. Postgres `'public'`). */ | ||
| readonly defaultNamespaceId: string; | ||
| }; | ||
| type AdapterPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'adapter', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| }; | ||
| type ExtensionPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'extension', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| }; | ||
| type DriverPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'driver', TFamilyId> & { | ||
| readonly targetId: TTargetId; | ||
| }; | ||
| /** | ||
| * Descriptor for an adapter component. | ||
| * | ||
| * An "adapter" provides the protocol and dialect implementation for a target. Adapters handle: | ||
| * - SQL/query generation (lowering AST to target-specific syntax) | ||
| * - Codec registration (encoding/decoding between JS and wire types) | ||
| * - Type mappings and coercions | ||
| * | ||
| * Adapters are bound to a specific family+target combination and work with any compatible driver for that target. | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlAdapterDescriptor` - control-plane factory | ||
| * - `RuntimeAdapterDescriptor` - runtime factory | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import postgresAdapter from '@prisma-next/adapter-postgres/control'; | ||
| * | ||
| * postgresAdapter.kind // 'adapter' | ||
| * postgresAdapter.familyId // 'sql' | ||
| * postgresAdapter.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface AdapterDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'adapter'> { | ||
| /** The family this adapter belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target this adapter is designed for */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** | ||
| * Descriptor for a driver component. | ||
| * | ||
| * A "driver" provides the connection and execution layer for a target. Drivers handle: | ||
| * - Connection management (pooling, timeouts, retries) | ||
| * - Query execution (sending SQL/commands, receiving results) | ||
| * - Transaction management | ||
| * - Wire protocol communication | ||
| * | ||
| * Drivers are bound to a specific family+target and work with any compatible adapter. Multiple drivers can exist for the same target (e.g., node-postgres vs postgres.js for Postgres). | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlDriverDescriptor` - creates driver from connection URL | ||
| * - `RuntimeDriverDescriptor` - creates driver with runtime options | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import postgresDriver from '@prisma-next/driver-postgres/control'; | ||
| * | ||
| * postgresDriver.kind // 'driver' | ||
| * postgresDriver.familyId // 'sql' | ||
| * postgresDriver.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface DriverDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'driver'> { | ||
| /** The family this driver belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target this driver connects to */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** | ||
| * Descriptor for an extension component. | ||
| * | ||
| * An "extension" adds optional capabilities to a target. Extensions can provide: | ||
| * - Additional operations (e.g., vector similarity search with pgvector) | ||
| * - Custom types and codecs (e.g., vector type) | ||
| * - Extended query capabilities | ||
| * | ||
| * Extensions are bound to a specific family+target and are registered in the config alongside the core components. Multiple extensions can be used together. | ||
| * | ||
| * Extended by plane-specific descriptors: | ||
| * - `ControlExtensionDescriptor` - control-plane extension factory | ||
| * - `RuntimeExtensionDescriptor` - runtime extension factory | ||
| * | ||
| * @template TFamilyId - Literal type for the family identifier | ||
| * @template TTargetId - Literal type for the target identifier | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * import pgvector from '@prisma-next/extension-pgvector/control'; | ||
| * | ||
| * pgvector.kind // 'extension' | ||
| * pgvector.familyId // 'sql' | ||
| * pgvector.targetId // 'postgres' | ||
| * ``` | ||
| */ | ||
| interface ExtensionDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'extension'> { | ||
| /** The family this extension belongs to */ | ||
| readonly familyId: TFamilyId; | ||
| /** The target this extension is designed for */ | ||
| readonly targetId: TTargetId; | ||
| } | ||
| /** Components bound to a specific family+target combination. */ | ||
| type TargetBoundComponentDescriptor<TFamilyId extends string, TTargetId extends string> = TargetDescriptor<TFamilyId, TTargetId> | AdapterDescriptor<TFamilyId, TTargetId> | DriverDescriptor<TFamilyId, TTargetId> | ExtensionDescriptor<TFamilyId, TTargetId>; | ||
| interface FamilyInstance<TFamilyId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| } | ||
| interface TargetInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| interface AdapterInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| interface DriverInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| interface ExtensionInstance<TFamilyId extends string, TTargetId extends string> { | ||
| readonly familyId: TFamilyId; | ||
| readonly targetId: TTargetId; | ||
| } | ||
| //#endregion | ||
| export { SourceDiagnostic as A, ControlMutationDefaultEntry as C, LoweredDefaultResult as D, DefaultFunctionLoweringContext as E, TypedDefaultFunctionCall as M, LoweredDefaultValue as O, checkContractComponentRequirements as S, ControlMutationDefaults as T, PackRefBase as _, ComponentMetadata as a, TargetInstance as b, DriverDescriptor as c, ExtensionDescriptor as d, ExtensionInstance as f, FamilyPackRef as g, FamilyInstance as h, ComponentDescriptor as i, SourceSpan as j, MutationDefaultGeneratorDescriptor as k, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, AdapterPackRef as r, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, DriverPackRef as u, TargetBoundComponentDescriptor as v, ControlMutationDefaultRegistry as w, TargetPackRef as x, TargetDescriptor as y }; | ||
| //# sourceMappingURL=framework-components-CDWIpbwD.d.mts.map |
| {"version":3,"file":"framework-components-CDWIpbwD.d.mts","names":[],"sources":["../src/shared/mutation-default-types.ts","../src/shared/framework-components.ts"],"mappings":";;;;;UAMU;WACC;WACA;WACA;;UAGM;WACN,OAAO;WACP,KAAK;;UAGC;WACN;WACA;WACA;WACA,OAAO;WACP,OAAO,SAAS;;UAGV;WACN;WACA;WACA;WACA;;KAGC;WACG;WAA0B,cAAc;;WACxC;WAA4B,WAAW;;KAE1C;WACG;WAAmB,OAAO;;WAC1B;WAAoB,YAAY;;UAE9B;WACN;;;;;;;;;;WAUA;;;;;;;WAOA,eAAe,OAAO,4BAA4B;;UAK5C;WACN;WACA,MAAM;WACN,MAAM,SAAS;;UAGT;WAIN;WACA,QAAQ;aACN,MAAM;aACN,SAAS;QACd;WACG;;KAGC,iCAAiC,oBAAoB;UAEhD;WACN,yBAAyB;WACzB,+BAA+B;;;;;;;UC7EzB;;WAEN;;;;;;WAOA,eAAe;;WAGf;aACE;;;;eAIE,SAAS;;;;;;;;eAQT,cAAc,cAAc;;;;eAI5B,oBAAoB;;;;eAIpB,mBAAmB,cAAc;;aAEnC;eAAiC,QAAQ;;aACzC,UAAU;eACR;eACA;eACA;eACA;;;;;;;;WASJ,YAAY;;;;WAKZ,0BAA0B;;;;;;;;;;;;;;;;;UAkBpB,oBAAoB,6BAA6B;;WAEvD,MAAM;;WAGN;;UAGM;WACN;aACE;aACA;aACA,iBAAiB;;WAEnB;WACA;WACA,sBAAsB;;UAGhB;WACN;aAA4B;aAA2B;;WACvD;aAA4B;aAA2B;;WACvD;;iBAGK,mCACd,OAAO,0CACN;;;;;;;;;;;;;;;;;;;;;;;;;;UA2Dc,iBAAiB,kCAAkC;;WAEzD,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BJ,iBAAiB,0BAA0B,kCAClD;;WAEC,UAAU;;WAGV,UAAU;;;;;UAMJ,YAAY,qBAAqB,kCACxC;WACC,MAAM;WACN;WACA,UAAU;WACV;WACA,YAAY;;KAGX,cAAc,qCAAqC,sBAAsB;KAEzE,cACV,mCACA,qCACE,sBAAsB;WACf,UAAU;;WAEV;;KAGC,eACV,mCACA,qCACE,uBAAuB;WAChB,UAAU;;KAGT,iBACV,mCACA,qCACE,yBAAyB;WAClB,UAAU;;KAGT,cACV,mCACA,qCACE,sBAAsB;WACf,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BJ,kBAAkB,0BAA0B,kCACnD;;WAEC,UAAU;;WAGV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BJ,iBAAiB,0BAA0B,kCAClD;;WAEC,UAAU;;WAGV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BJ,oBAAoB,0BAA0B,kCACrD;;WAEC,UAAU;;WAGV,UAAU;;;KAIT,+BAA+B,0BAA0B,4BACjE,iBAAiB,WAAW,aAC5B,kBAAkB,WAAW,aAC7B,iBAAiB,WAAW,aAC5B,oBAAoB,WAAW;UAElB,eAAe;WACrB,UAAU;;UAGJ,eAAe,0BAA0B;WAC/C,UAAU;WACV,UAAU;;UAGJ,gBAAgB,0BAA0B;WAChD,UAAU;WACV,UAAU;;UAGJ,eAAe,0BAA0B;WAC/C,UAAU;WACV,UAAU;;UAGJ,kBAAkB,0BAA0B;WAClD,UAAU;WACV,UAAU"} |
| //#region src/shared/framework-components.ts | ||
| function checkContractComponentRequirements(input) { | ||
| const providedIds = /* @__PURE__ */ new Set(); | ||
| for (const id of input.providedComponentIds) providedIds.add(id); | ||
| const missingExtensionPackIds = (input.contract.extensionPacks ? Object.keys(input.contract.extensionPacks) : []).filter((id) => !providedIds.has(id)); | ||
| const expectedTargetFamily = input.expectedTargetFamily; | ||
| const contractTargetFamily = input.contract.targetFamily; | ||
| const familyMismatch = expectedTargetFamily !== void 0 && contractTargetFamily !== void 0 && contractTargetFamily !== expectedTargetFamily ? { | ||
| expected: expectedTargetFamily, | ||
| actual: contractTargetFamily | ||
| } : void 0; | ||
| const expectedTargetId = input.expectedTargetId; | ||
| const contractTargetId = input.contract.target; | ||
| const targetMismatch = expectedTargetId !== void 0 && contractTargetId !== expectedTargetId ? { | ||
| expected: expectedTargetId, | ||
| actual: contractTargetId | ||
| } : void 0; | ||
| return { | ||
| ...familyMismatch ? { familyMismatch } : {}, | ||
| ...targetMismatch ? { targetMismatch } : {}, | ||
| missingExtensionPackIds | ||
| }; | ||
| } | ||
| //#endregion | ||
| export { checkContractComponentRequirements as t }; | ||
| //# sourceMappingURL=framework-components-DbCS57go.mjs.map |
| {"version":3,"file":"framework-components-DbCS57go.mjs","names":[],"sources":["../src/shared/framework-components.ts"],"sourcesContent":["import type { AnyCodecDescriptor } from './codec-descriptor';\nimport type { AuthoringContributions } from './framework-authoring';\nimport type { ControlMutationDefaults } from './mutation-default-types';\nimport type { TypesImportSpec } from './types-import-spec';\n\n/**\n * Declarative fields that describe component metadata.\n */\nexport interface ComponentMetadata {\n /** Component version (semver) */\n readonly version: string;\n\n /**\n * Capabilities this component provides.\n *\n * For adapters, capabilities must be declared on the adapter descriptor (so they are emitted into the contract) and also exposed in runtime adapter code (e.g. `adapter.profile.capabilities`); keep these declarations in sync. Targets are identifiers/descriptors and typically do not declare capabilities.\n */\n readonly capabilities?: Record<string, unknown>;\n\n /** Type imports for contract.d.ts generation */\n readonly types?: {\n readonly codecTypes?: {\n /**\n * Base codec types import spec. Optional: adapters typically provide this, extensions usually don't.\n */\n readonly import?: TypesImportSpec;\n /**\n * Additional type-only imports for parameterized codec branded types.\n *\n * These imports are included in generated `contract.d.ts` but are NOT treated as codec type maps (i.e., they should not be intersected into `export type CodecTypes = ...`).\n *\n * Example: `Vector<N>` for pgvector codecs that emit `Vector<1536>`\n */\n readonly typeImports?: ReadonlyArray<TypesImportSpec>;\n /**\n * Optional control-plane hooks keyed by codecId. Used by family-specific planners/verifiers to handle storage types.\n */\n readonly controlPlaneHooks?: Record<string, unknown>;\n /**\n * Codec descriptors contributed by this component. Source of truth for codec-id-keyed metadata (`traits`, `targetTypes`, `meta`, `renderOutputType`) consumed by `extractCodecLookup`, and used to materialize representative `Codec` instances for codec-dispatched type rendering during emission.\n */\n readonly codecDescriptors?: ReadonlyArray<AnyCodecDescriptor>;\n };\n readonly queryOperationTypes?: { readonly import: TypesImportSpec };\n readonly storage?: ReadonlyArray<{\n readonly typeId: string;\n readonly familyId: string;\n readonly targetId: string;\n readonly nativeType?: string;\n }>;\n };\n\n /**\n * Optional pure-data authoring contributions exposed by this component.\n *\n * These contributions are safe to include on pack refs and descriptors because they contain only declarative metadata. Higher-level authoring packages may project them into concrete helper functions for TS-first workflows.\n */\n readonly authoring?: AuthoringContributions;\n\n /**\n * Mutation default function handlers and generator descriptors contributed by this component. Assembled by `createControlStack` with duplicate detection.\n */\n readonly controlMutationDefaults?: ControlMutationDefaults;\n}\n\n/**\n * Base descriptor for any framework component.\n *\n * All component descriptors share these fundamental properties that identify the component and provide its metadata. This interface is extended by specific descriptor types (FamilyDescriptor, TargetDescriptor, etc.).\n *\n * @template Kind - Discriminator literal identifying the component type. Built-in kinds are 'family', 'target', 'adapter', 'driver', 'extension', but the type accepts any string to allow ecosystem extensions.\n *\n * @example\n * ```ts\n * // All descriptors have these properties\n * descriptor.kind // The Kind type parameter (e.g., 'family', 'target', or custom kinds)\n * descriptor.id // Unique string identifier (e.g., 'sql', 'postgres')\n * descriptor.version // Component version (semver)\n * ```\n */\nexport interface ComponentDescriptor<Kind extends string> extends ComponentMetadata {\n /** Discriminator identifying the component type */\n readonly kind: Kind;\n\n /** Unique identifier for this component (e.g., 'sql', 'postgres', 'pgvector') */\n readonly id: string;\n}\n\nexport interface ContractComponentRequirementsCheckInput {\n readonly contract: {\n readonly target: string;\n readonly targetFamily?: string | undefined;\n readonly extensionPacks?: Record<string, unknown> | undefined;\n };\n readonly expectedTargetFamily?: string | undefined;\n readonly expectedTargetId?: string | undefined;\n readonly providedComponentIds: Iterable<string>;\n}\n\nexport interface ContractComponentRequirementsCheckResult {\n readonly familyMismatch?: { readonly expected: string; readonly actual: string } | undefined;\n readonly targetMismatch?: { readonly expected: string; readonly actual: string } | undefined;\n readonly missingExtensionPackIds: readonly string[];\n}\n\nexport function checkContractComponentRequirements(\n input: ContractComponentRequirementsCheckInput,\n): ContractComponentRequirementsCheckResult {\n const providedIds = new Set<string>();\n for (const id of input.providedComponentIds) {\n providedIds.add(id);\n }\n\n const requiredExtensionPackIds = input.contract.extensionPacks\n ? Object.keys(input.contract.extensionPacks)\n : [];\n const missingExtensionPackIds = requiredExtensionPackIds.filter((id) => !providedIds.has(id));\n\n const expectedTargetFamily = input.expectedTargetFamily;\n const contractTargetFamily = input.contract.targetFamily;\n const familyMismatch =\n expectedTargetFamily !== undefined &&\n contractTargetFamily !== undefined &&\n contractTargetFamily !== expectedTargetFamily\n ? { expected: expectedTargetFamily, actual: contractTargetFamily }\n : undefined;\n\n const expectedTargetId = input.expectedTargetId;\n const contractTargetId = input.contract.target;\n const targetMismatch =\n expectedTargetId !== undefined && contractTargetId !== expectedTargetId\n ? { expected: expectedTargetId, actual: contractTargetId }\n : undefined;\n\n return {\n ...(familyMismatch ? { familyMismatch } : {}),\n ...(targetMismatch ? { targetMismatch } : {}),\n missingExtensionPackIds,\n };\n}\n\n/**\n * Descriptor for a family component.\n *\n * A \"family\" represents a category of data sources with shared semantics (e.g., SQL databases, document stores). Families define:\n * - Query semantics and operations (SELECT, INSERT, find, aggregate, etc.)\n * - Contract structure (tables vs collections, columns vs fields)\n * - Type system and codecs\n *\n * Families are the top-level grouping. Each family contains multiple targets (e.g., SQL family contains Postgres, MySQL, SQLite targets).\n *\n * Extended by plane-specific descriptors:\n * - `ControlFamilyDescriptor` - adds `emission` for CLI/tooling operations\n * - `RuntimeFamilyDescriptor` - adds runtime-specific factory methods\n *\n * @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document')\n *\n * @example\n * ```ts\n * import sql from '@prisma-next/family-sql/control';\n *\n * sql.kind // 'family'\n * sql.familyId // 'sql'\n * sql.id // 'sql'\n * ```\n */\nexport interface FamilyDescriptor<TFamilyId extends string> extends ComponentDescriptor<'family'> {\n /** The family identifier (e.g., 'sql', 'document') */\n readonly familyId: TFamilyId;\n}\n\n/**\n * Descriptor for a target component.\n *\n * A \"target\" represents a specific database or data store within a family (e.g., Postgres, MySQL, MongoDB). Targets define:\n * - Native type mappings (e.g., Postgres int4 → TypeScript number)\n * - Target-specific capabilities (e.g., RETURNING, LATERAL joins)\n *\n * Targets are bound to a family and provide the target-specific implementation details that adapters and drivers use.\n *\n * Extended by plane-specific descriptors:\n * - `ControlTargetDescriptor` - adds optional `migrations` capability\n * - `RuntimeTargetDescriptor` - adds runtime factory method\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql')\n *\n * @example\n * ```ts\n * import postgres from '@prisma-next/target-postgres/control';\n *\n * postgres.kind // 'target'\n * postgres.familyId // 'sql'\n * postgres.targetId // 'postgres'\n * ```\n */\nexport interface TargetDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'target'> {\n /** The family this target belongs to */\n readonly familyId: TFamilyId;\n\n /** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */\n readonly targetId: TTargetId;\n}\n\n/**\n * Base shape for any pack reference. Pack refs are pure JSON-friendly objects safe to import in authoring flows.\n */\nexport interface PackRefBase<Kind extends string, TFamilyId extends string>\n extends ComponentMetadata {\n readonly kind: Kind;\n readonly id: string;\n readonly familyId: TFamilyId;\n readonly targetId?: string;\n readonly authoring?: AuthoringContributions;\n}\n\nexport type FamilyPackRef<TFamilyId extends string = string> = PackRefBase<'family', TFamilyId>;\n\nexport type TargetPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'target', TFamilyId> & {\n readonly targetId: TTargetId;\n /** The namespace a bare (un-namespaced) entity name resolves to for this target (e.g. Postgres `'public'`). */\n readonly defaultNamespaceId: string;\n};\n\nexport type AdapterPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'adapter', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\nexport type ExtensionPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'extension', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\nexport type DriverPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'driver', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\n/**\n * Descriptor for an adapter component.\n *\n * An \"adapter\" provides the protocol and dialect implementation for a target. Adapters handle:\n * - SQL/query generation (lowering AST to target-specific syntax)\n * - Codec registration (encoding/decoding between JS and wire types)\n * - Type mappings and coercions\n *\n * Adapters are bound to a specific family+target combination and work with any compatible driver for that target.\n *\n * Extended by plane-specific descriptors:\n * - `ControlAdapterDescriptor` - control-plane factory\n * - `RuntimeAdapterDescriptor` - runtime factory\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import postgresAdapter from '@prisma-next/adapter-postgres/control';\n *\n * postgresAdapter.kind // 'adapter'\n * postgresAdapter.familyId // 'sql'\n * postgresAdapter.targetId // 'postgres'\n * ```\n */\nexport interface AdapterDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'adapter'> {\n /** The family this adapter belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this adapter is designed for */\n readonly targetId: TTargetId;\n}\n\n/**\n * Descriptor for a driver component.\n *\n * A \"driver\" provides the connection and execution layer for a target. Drivers handle:\n * - Connection management (pooling, timeouts, retries)\n * - Query execution (sending SQL/commands, receiving results)\n * - Transaction management\n * - Wire protocol communication\n *\n * Drivers are bound to a specific family+target and work with any compatible adapter. Multiple drivers can exist for the same target (e.g., node-postgres vs postgres.js for Postgres).\n *\n * Extended by plane-specific descriptors:\n * - `ControlDriverDescriptor` - creates driver from connection URL\n * - `RuntimeDriverDescriptor` - creates driver with runtime options\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import postgresDriver from '@prisma-next/driver-postgres/control';\n *\n * postgresDriver.kind // 'driver'\n * postgresDriver.familyId // 'sql'\n * postgresDriver.targetId // 'postgres'\n * ```\n */\nexport interface DriverDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'driver'> {\n /** The family this driver belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this driver connects to */\n readonly targetId: TTargetId;\n}\n\n/**\n * Descriptor for an extension component.\n *\n * An \"extension\" adds optional capabilities to a target. Extensions can provide:\n * - Additional operations (e.g., vector similarity search with pgvector)\n * - Custom types and codecs (e.g., vector type)\n * - Extended query capabilities\n *\n * Extensions are bound to a specific family+target and are registered in the config alongside the core components. Multiple extensions can be used together.\n *\n * Extended by plane-specific descriptors:\n * - `ControlExtensionDescriptor` - control-plane extension factory\n * - `RuntimeExtensionDescriptor` - runtime extension factory\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import pgvector from '@prisma-next/extension-pgvector/control';\n *\n * pgvector.kind // 'extension'\n * pgvector.familyId // 'sql'\n * pgvector.targetId // 'postgres'\n * ```\n */\nexport interface ExtensionDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'extension'> {\n /** The family this extension belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this extension is designed for */\n readonly targetId: TTargetId;\n}\n\n/** Components bound to a specific family+target combination. */\nexport type TargetBoundComponentDescriptor<TFamilyId extends string, TTargetId extends string> =\n | TargetDescriptor<TFamilyId, TTargetId>\n | AdapterDescriptor<TFamilyId, TTargetId>\n | DriverDescriptor<TFamilyId, TTargetId>\n | ExtensionDescriptor<TFamilyId, TTargetId>;\n\nexport interface FamilyInstance<TFamilyId extends string> {\n readonly familyId: TFamilyId;\n}\n\nexport interface TargetInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface AdapterInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface DriverInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface ExtensionInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n"],"mappings":";AAyGA,SAAgB,mCACd,OAC0C;CAC1C,MAAM,8BAAc,IAAI,IAAY;CACpC,KAAK,MAAM,MAAM,MAAM,sBACrB,YAAY,IAAI,EAAE;CAMpB,MAAM,2BAH2B,MAAM,SAAS,iBAC5C,OAAO,KAAK,MAAM,SAAS,cAAc,IACzC,CAAC,EAAA,CACoD,QAAQ,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;CAE5F,MAAM,uBAAuB,MAAM;CACnC,MAAM,uBAAuB,MAAM,SAAS;CAC5C,MAAM,iBACJ,yBAAyB,KAAA,KACzB,yBAAyB,KAAA,KACzB,yBAAyB,uBACrB;EAAE,UAAU;EAAsB,QAAQ;CAAqB,IAC/D,KAAA;CAEN,MAAM,mBAAmB,MAAM;CAC/B,MAAM,mBAAmB,MAAM,SAAS;CACxC,MAAM,iBACJ,qBAAqB,KAAA,KAAa,qBAAqB,mBACnD;EAAE,UAAU;EAAkB,QAAQ;CAAiB,IACvD,KAAA;CAEN,OAAO;EACL,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;EAC3C,GAAI,iBAAiB,EAAE,eAAe,IAAI,CAAC;EAC3C;CACF;AACF"} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1141524
-0.04%11112
-0.02%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed