@prisma-next/contract 0.3.0-dev.135 → 0.3.0-dev.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ir-BPkihpFL.d.mts → ir-DkfZ4S60.d.mts} +1 -1
- package/dist/{ir-BPkihpFL.d.mts.map → ir-DkfZ4S60.d.mts.map} +1 -1
- package/dist/ir.d.mts +1 -1
- package/dist/types.d.mts +443 -2
- package/dist/types.d.mts.map +1 -0
- package/package.json +3 -4
- package/dist/framework-components.d.mts +0 -520
- package/dist/framework-components.d.mts.map +0 -1
- package/dist/framework-components.mjs +0 -190
- package/dist/framework-components.mjs.map +0 -1
- package/dist/types-BwcW0HFt.d.mts +0 -443
- package/dist/types-BwcW0HFt.d.mts.map +0 -1
- package/src/exports/framework-components.ts +0 -54
- package/src/framework-authoring.ts +0 -383
- package/src/framework-components.ts +0 -552
|
@@ -1,520 +0,0 @@
|
|
|
1
|
-
import { O as RenderTypeContext, z as TypesImportSpec } from "./types-BwcW0HFt.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/framework-authoring.d.ts
|
|
4
|
-
type AuthoringArgRef = {
|
|
5
|
-
readonly kind: 'arg';
|
|
6
|
-
readonly index: number;
|
|
7
|
-
readonly path?: readonly string[];
|
|
8
|
-
readonly default?: AuthoringTemplateValue;
|
|
9
|
-
};
|
|
10
|
-
type AuthoringTemplateValue = string | number | boolean | null | AuthoringArgRef | readonly AuthoringTemplateValue[] | {
|
|
11
|
-
readonly [key: string]: AuthoringTemplateValue;
|
|
12
|
-
};
|
|
13
|
-
type AuthoringArgumentDescriptor = {
|
|
14
|
-
readonly kind: 'string';
|
|
15
|
-
readonly optional?: boolean;
|
|
16
|
-
} | {
|
|
17
|
-
readonly kind: 'number';
|
|
18
|
-
readonly optional?: boolean;
|
|
19
|
-
readonly integer?: boolean;
|
|
20
|
-
readonly minimum?: number;
|
|
21
|
-
readonly maximum?: number;
|
|
22
|
-
} | {
|
|
23
|
-
readonly kind: 'stringArray';
|
|
24
|
-
readonly optional?: boolean;
|
|
25
|
-
} | {
|
|
26
|
-
readonly kind: 'object';
|
|
27
|
-
readonly optional?: boolean;
|
|
28
|
-
readonly properties: Record<string, AuthoringArgumentDescriptor>;
|
|
29
|
-
};
|
|
30
|
-
interface AuthoringStorageTypeTemplate {
|
|
31
|
-
readonly codecId: string;
|
|
32
|
-
readonly nativeType: AuthoringTemplateValue;
|
|
33
|
-
readonly typeParams?: Record<string, AuthoringTemplateValue>;
|
|
34
|
-
}
|
|
35
|
-
interface AuthoringTypeConstructorDescriptor {
|
|
36
|
-
readonly kind: 'typeConstructor';
|
|
37
|
-
readonly args?: readonly AuthoringArgumentDescriptor[];
|
|
38
|
-
readonly output: AuthoringStorageTypeTemplate;
|
|
39
|
-
}
|
|
40
|
-
interface AuthoringColumnDefaultTemplateLiteral {
|
|
41
|
-
readonly kind: 'literal';
|
|
42
|
-
readonly value: AuthoringTemplateValue;
|
|
43
|
-
}
|
|
44
|
-
interface AuthoringColumnDefaultTemplateFunction {
|
|
45
|
-
readonly kind: 'function';
|
|
46
|
-
readonly expression: AuthoringTemplateValue;
|
|
47
|
-
}
|
|
48
|
-
type AuthoringColumnDefaultTemplate = AuthoringColumnDefaultTemplateLiteral | AuthoringColumnDefaultTemplateFunction;
|
|
49
|
-
interface AuthoringFieldPresetOutput extends AuthoringStorageTypeTemplate {
|
|
50
|
-
readonly nullable?: boolean;
|
|
51
|
-
readonly default?: AuthoringColumnDefaultTemplate;
|
|
52
|
-
readonly executionDefault?: AuthoringTemplateValue;
|
|
53
|
-
readonly id?: boolean;
|
|
54
|
-
readonly unique?: boolean;
|
|
55
|
-
}
|
|
56
|
-
interface AuthoringFieldPresetDescriptor {
|
|
57
|
-
readonly kind: 'fieldPreset';
|
|
58
|
-
readonly args?: readonly AuthoringArgumentDescriptor[];
|
|
59
|
-
readonly output: AuthoringFieldPresetOutput;
|
|
60
|
-
}
|
|
61
|
-
type AuthoringTypeNamespace = {
|
|
62
|
-
readonly [name: string]: AuthoringTypeConstructorDescriptor | AuthoringTypeNamespace;
|
|
63
|
-
};
|
|
64
|
-
type AuthoringFieldNamespace = {
|
|
65
|
-
readonly [name: string]: AuthoringFieldPresetDescriptor | AuthoringFieldNamespace;
|
|
66
|
-
};
|
|
67
|
-
interface AuthoringContributions {
|
|
68
|
-
readonly type?: AuthoringTypeNamespace;
|
|
69
|
-
readonly field?: AuthoringFieldNamespace;
|
|
70
|
-
}
|
|
71
|
-
declare function isAuthoringArgRef(value: unknown): value is AuthoringArgRef;
|
|
72
|
-
declare function isAuthoringTypeConstructorDescriptor(value: unknown): value is AuthoringTypeConstructorDescriptor;
|
|
73
|
-
declare function isAuthoringFieldPresetDescriptor(value: unknown): value is AuthoringFieldPresetDescriptor;
|
|
74
|
-
declare function resolveAuthoringTemplateValue(template: AuthoringTemplateValue, args: readonly unknown[]): unknown;
|
|
75
|
-
declare function validateAuthoringHelperArguments(helperPath: string, descriptors: readonly AuthoringArgumentDescriptor[] | undefined, args: readonly unknown[]): void;
|
|
76
|
-
declare function instantiateAuthoringTypeConstructor(descriptor: AuthoringTypeConstructorDescriptor, args: readonly unknown[]): {
|
|
77
|
-
readonly codecId: string;
|
|
78
|
-
readonly nativeType: string;
|
|
79
|
-
readonly typeParams?: Record<string, unknown>;
|
|
80
|
-
};
|
|
81
|
-
declare function instantiateAuthoringFieldPreset(descriptor: AuthoringFieldPresetDescriptor, args: readonly unknown[]): {
|
|
82
|
-
readonly descriptor: {
|
|
83
|
-
readonly codecId: string;
|
|
84
|
-
readonly nativeType: string;
|
|
85
|
-
readonly typeParams?: Record<string, unknown>;
|
|
86
|
-
};
|
|
87
|
-
readonly nullable: boolean;
|
|
88
|
-
readonly default?: {
|
|
89
|
-
readonly kind: 'literal';
|
|
90
|
-
readonly value: unknown;
|
|
91
|
-
} | {
|
|
92
|
-
readonly kind: 'function';
|
|
93
|
-
readonly expression: string;
|
|
94
|
-
};
|
|
95
|
-
readonly executionDefault?: unknown;
|
|
96
|
-
readonly id: boolean;
|
|
97
|
-
readonly unique: boolean;
|
|
98
|
-
};
|
|
99
|
-
//#endregion
|
|
100
|
-
//#region src/framework-components.d.ts
|
|
101
|
-
/**
|
|
102
|
-
* A template-based type renderer (structured form).
|
|
103
|
-
* Uses mustache-style placeholders (e.g., `Vector<{{length}}>`) that are
|
|
104
|
-
* replaced with typeParams values during rendering.
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```ts
|
|
108
|
-
* { kind: 'template', template: 'Vector<{{length}}>' }
|
|
109
|
-
* // With typeParams { length: 1536 }, renders: 'Vector<1536>'
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
interface TypeRendererTemplate {
|
|
113
|
-
readonly kind: 'template';
|
|
114
|
-
/** Template string with `{{key}}` placeholders for typeParams values */
|
|
115
|
-
readonly template: string;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* A function-based type renderer for full control over type expression generation.
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```ts
|
|
122
|
-
* {
|
|
123
|
-
* kind: 'function',
|
|
124
|
-
* render: (params, ctx) => `Vector<${params.length}>`
|
|
125
|
-
* }
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
interface TypeRendererFunction {
|
|
129
|
-
readonly kind: 'function';
|
|
130
|
-
/** Render function that produces a TypeScript type expression */
|
|
131
|
-
readonly render: (params: Record<string, unknown>, ctx: RenderTypeContext) => string;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* A raw template string type renderer (convenience form).
|
|
135
|
-
* Shorthand for TypeRendererTemplate - just the template string without wrapper.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```ts
|
|
139
|
-
* 'Vector<{{length}}>'
|
|
140
|
-
* // Equivalent to: { kind: 'template', template: 'Vector<{{length}}>' }
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
type TypeRendererString = string;
|
|
144
|
-
/**
|
|
145
|
-
* A raw function type renderer (convenience form).
|
|
146
|
-
* Shorthand for TypeRendererFunction - just the function without wrapper.
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
* ```ts
|
|
150
|
-
* (params, ctx) => `Vector<${params.length}>`
|
|
151
|
-
* // Equivalent to: { kind: 'function', render: ... }
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
type TypeRendererRawFunction = (params: Record<string, unknown>, ctx: RenderTypeContext) => string;
|
|
155
|
-
/**
|
|
156
|
-
* Union of type renderer formats.
|
|
157
|
-
*
|
|
158
|
-
* Supports both structured forms (with `kind` discriminator) and convenience forms:
|
|
159
|
-
* - `string` - Template string with `{{key}}` placeholders (manifest-safe, JSON-serializable)
|
|
160
|
-
* - `function` - Render function for full control (requires runtime execution)
|
|
161
|
-
* - `{ kind: 'template', template: string }` - Structured template form
|
|
162
|
-
* - `{ kind: 'function', render: fn }` - Structured function form
|
|
163
|
-
*
|
|
164
|
-
* Templates are normalized to functions during pack assembly.
|
|
165
|
-
* **Prefer template strings** for most cases - they are JSON-serializable.
|
|
166
|
-
*/
|
|
167
|
-
type TypeRenderer = TypeRendererString | TypeRendererRawFunction | TypeRendererTemplate | TypeRendererFunction;
|
|
168
|
-
/**
|
|
169
|
-
* Normalized type renderer - always a function after assembly.
|
|
170
|
-
* This is the form received by the emitter.
|
|
171
|
-
*/
|
|
172
|
-
interface NormalizedTypeRenderer {
|
|
173
|
-
readonly codecId: string;
|
|
174
|
-
readonly render: (params: Record<string, unknown>, ctx: RenderTypeContext) => string;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Interpolates a template string with params values.
|
|
178
|
-
* Used internally by normalizeRenderer to compile templates to functions.
|
|
179
|
-
*
|
|
180
|
-
* @throws Error if a placeholder key is not found in params (except 'CodecTypes')
|
|
181
|
-
*/
|
|
182
|
-
declare function interpolateTypeTemplate(template: string, params: Record<string, unknown>, ctx: RenderTypeContext): string;
|
|
183
|
-
/**
|
|
184
|
-
* Normalizes a TypeRenderer to function form.
|
|
185
|
-
* Called during pack assembly, not at emission time.
|
|
186
|
-
*
|
|
187
|
-
* Handles all TypeRenderer forms:
|
|
188
|
-
* - Raw string template: `'Vector<{{length}}>'`
|
|
189
|
-
* - Raw function: `(params, ctx) => ...`
|
|
190
|
-
* - Structured template: `{ kind: 'template', template: '...' }`
|
|
191
|
-
* - Structured function: `{ kind: 'function', render: fn }`
|
|
192
|
-
*/
|
|
193
|
-
declare function normalizeRenderer(codecId: string, renderer: TypeRenderer): NormalizedTypeRenderer;
|
|
194
|
-
/**
|
|
195
|
-
* Declarative fields that describe component metadata.
|
|
196
|
-
*/
|
|
197
|
-
interface ComponentMetadata {
|
|
198
|
-
/** Component version (semver) */
|
|
199
|
-
readonly version: string;
|
|
200
|
-
/**
|
|
201
|
-
* Capabilities this component provides.
|
|
202
|
-
*
|
|
203
|
-
* For adapters, capabilities must be declared on the adapter descriptor (so they are emitted into
|
|
204
|
-
* the contract) and also exposed in runtime adapter code (e.g. `adapter.profile.capabilities`);
|
|
205
|
-
* keep these declarations in sync. Targets are identifiers/descriptors and typically do not
|
|
206
|
-
* declare capabilities.
|
|
207
|
-
*/
|
|
208
|
-
readonly capabilities?: Record<string, unknown>;
|
|
209
|
-
/** Type imports for contract.d.ts generation */
|
|
210
|
-
readonly types?: {
|
|
211
|
-
readonly codecTypes?: {
|
|
212
|
-
/**
|
|
213
|
-
* Base codec types import spec.
|
|
214
|
-
* Optional: adapters typically provide this, extensions usually don't.
|
|
215
|
-
*/
|
|
216
|
-
readonly import?: TypesImportSpec;
|
|
217
|
-
/**
|
|
218
|
-
* Optional renderers for parameterized codecs owned by this component.
|
|
219
|
-
* Key is codecId (e.g., 'pg/vector@1'), value is the type renderer.
|
|
220
|
-
*
|
|
221
|
-
* Templates are normalized to functions during pack assembly.
|
|
222
|
-
* Duplicate codecId across descriptors is a hard error.
|
|
223
|
-
*/
|
|
224
|
-
readonly parameterized?: Record<string, TypeRenderer>;
|
|
225
|
-
/**
|
|
226
|
-
* Optional additional type-only imports required by parameterized renderers.
|
|
227
|
-
*
|
|
228
|
-
* These imports are included in generated `contract.d.ts` but are NOT treated as
|
|
229
|
-
* codec type maps (i.e., they should not be intersected into `export type CodecTypes = ...`).
|
|
230
|
-
*
|
|
231
|
-
* Example: `Vector<N>` for pgvector renderers that emit `Vector<{{length}}>`
|
|
232
|
-
*/
|
|
233
|
-
readonly typeImports?: ReadonlyArray<TypesImportSpec>;
|
|
234
|
-
/**
|
|
235
|
-
* Optional control-plane hooks keyed by codecId.
|
|
236
|
-
* Used by family-specific planners/verifiers to handle storage types.
|
|
237
|
-
*/
|
|
238
|
-
readonly controlPlaneHooks?: Record<string, unknown>;
|
|
239
|
-
};
|
|
240
|
-
readonly operationTypes?: {
|
|
241
|
-
readonly import: TypesImportSpec;
|
|
242
|
-
};
|
|
243
|
-
readonly storage?: ReadonlyArray<{
|
|
244
|
-
readonly typeId: string;
|
|
245
|
-
readonly familyId: string;
|
|
246
|
-
readonly targetId: string;
|
|
247
|
-
readonly nativeType?: string;
|
|
248
|
-
}>;
|
|
249
|
-
};
|
|
250
|
-
/**
|
|
251
|
-
* Optional pure-data authoring contributions exposed by this component.
|
|
252
|
-
*
|
|
253
|
-
* These contributions are safe to include on pack refs and descriptors because
|
|
254
|
-
* they contain only declarative metadata. Higher-level authoring packages may
|
|
255
|
-
* project them into concrete helper functions for TS-first workflows.
|
|
256
|
-
*/
|
|
257
|
-
readonly authoring?: AuthoringContributions;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Base descriptor for any framework component.
|
|
261
|
-
*
|
|
262
|
-
* All component descriptors share these fundamental properties that identify
|
|
263
|
-
* the component and provide its metadata. This interface is extended by
|
|
264
|
-
* specific descriptor types (FamilyDescriptor, TargetDescriptor, etc.).
|
|
265
|
-
*
|
|
266
|
-
* @template Kind - Discriminator literal identifying the component type.
|
|
267
|
-
* Built-in kinds are 'family', 'target', 'adapter', 'driver', 'extension',
|
|
268
|
-
* but the type accepts any string to allow ecosystem extensions.
|
|
269
|
-
*
|
|
270
|
-
* @example
|
|
271
|
-
* ```ts
|
|
272
|
-
* // All descriptors have these properties
|
|
273
|
-
* descriptor.kind // The Kind type parameter (e.g., 'family', 'target', or custom kinds)
|
|
274
|
-
* descriptor.id // Unique string identifier (e.g., 'sql', 'postgres')
|
|
275
|
-
* descriptor.version // Component version (semver)
|
|
276
|
-
* ```
|
|
277
|
-
*/
|
|
278
|
-
interface ComponentDescriptor<Kind extends string> extends ComponentMetadata {
|
|
279
|
-
/** Discriminator identifying the component type */
|
|
280
|
-
readonly kind: Kind;
|
|
281
|
-
/** Unique identifier for this component (e.g., 'sql', 'postgres', 'pgvector') */
|
|
282
|
-
readonly id: string;
|
|
283
|
-
}
|
|
284
|
-
interface ContractComponentRequirementsCheckInput {
|
|
285
|
-
readonly contract: {
|
|
286
|
-
readonly target: string;
|
|
287
|
-
readonly targetFamily?: string | undefined;
|
|
288
|
-
readonly extensionPacks?: Record<string, unknown> | undefined;
|
|
289
|
-
};
|
|
290
|
-
readonly expectedTargetFamily?: string | undefined;
|
|
291
|
-
readonly expectedTargetId?: string | undefined;
|
|
292
|
-
readonly providedComponentIds: Iterable<string>;
|
|
293
|
-
}
|
|
294
|
-
interface ContractComponentRequirementsCheckResult {
|
|
295
|
-
readonly familyMismatch?: {
|
|
296
|
-
readonly expected: string;
|
|
297
|
-
readonly actual: string;
|
|
298
|
-
} | undefined;
|
|
299
|
-
readonly targetMismatch?: {
|
|
300
|
-
readonly expected: string;
|
|
301
|
-
readonly actual: string;
|
|
302
|
-
} | undefined;
|
|
303
|
-
readonly missingExtensionPackIds: readonly string[];
|
|
304
|
-
}
|
|
305
|
-
declare function checkContractComponentRequirements(input: ContractComponentRequirementsCheckInput): ContractComponentRequirementsCheckResult;
|
|
306
|
-
/**
|
|
307
|
-
* Descriptor for a family component.
|
|
308
|
-
*
|
|
309
|
-
* A "family" represents a category of data sources with shared semantics
|
|
310
|
-
* (e.g., SQL databases, document stores). Families define:
|
|
311
|
-
* - Query semantics and operations (SELECT, INSERT, find, aggregate, etc.)
|
|
312
|
-
* - Contract structure (tables vs collections, columns vs fields)
|
|
313
|
-
* - Type system and codecs
|
|
314
|
-
*
|
|
315
|
-
* Families are the top-level grouping. Each family contains multiple targets
|
|
316
|
-
* (e.g., SQL family contains Postgres, MySQL, SQLite targets).
|
|
317
|
-
*
|
|
318
|
-
* Extended by plane-specific descriptors:
|
|
319
|
-
* - `ControlFamilyDescriptor` - adds `hook` for CLI/tooling operations
|
|
320
|
-
* - `RuntimeFamilyDescriptor` - adds runtime-specific factory methods
|
|
321
|
-
*
|
|
322
|
-
* @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document')
|
|
323
|
-
*
|
|
324
|
-
* @example
|
|
325
|
-
* ```ts
|
|
326
|
-
* import sql from '@prisma-next/family-sql/control';
|
|
327
|
-
*
|
|
328
|
-
* sql.kind // 'family'
|
|
329
|
-
* sql.familyId // 'sql'
|
|
330
|
-
* sql.id // 'sql'
|
|
331
|
-
* ```
|
|
332
|
-
*/
|
|
333
|
-
interface FamilyDescriptor<TFamilyId extends string> extends ComponentDescriptor<'family'> {
|
|
334
|
-
/** The family identifier (e.g., 'sql', 'document') */
|
|
335
|
-
readonly familyId: TFamilyId;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Descriptor for a target component.
|
|
339
|
-
*
|
|
340
|
-
* A "target" represents a specific database or data store within a family
|
|
341
|
-
* (e.g., Postgres, MySQL, MongoDB). Targets define:
|
|
342
|
-
* - Native type mappings (e.g., Postgres int4 → TypeScript number)
|
|
343
|
-
* - Target-specific capabilities (e.g., RETURNING, LATERAL joins)
|
|
344
|
-
*
|
|
345
|
-
* Targets are bound to a family and provide the target-specific implementation
|
|
346
|
-
* details that adapters and drivers use.
|
|
347
|
-
*
|
|
348
|
-
* Extended by plane-specific descriptors:
|
|
349
|
-
* - `ControlTargetDescriptor` - adds optional `migrations` capability
|
|
350
|
-
* - `RuntimeTargetDescriptor` - adds runtime factory method
|
|
351
|
-
*
|
|
352
|
-
* @template TFamilyId - Literal type for the family identifier
|
|
353
|
-
* @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql')
|
|
354
|
-
*
|
|
355
|
-
* @example
|
|
356
|
-
* ```ts
|
|
357
|
-
* import postgres from '@prisma-next/target-postgres/control';
|
|
358
|
-
*
|
|
359
|
-
* postgres.kind // 'target'
|
|
360
|
-
* postgres.familyId // 'sql'
|
|
361
|
-
* postgres.targetId // 'postgres'
|
|
362
|
-
* ```
|
|
363
|
-
*/
|
|
364
|
-
interface TargetDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'target'> {
|
|
365
|
-
/** The family this target belongs to */
|
|
366
|
-
readonly familyId: TFamilyId;
|
|
367
|
-
/** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */
|
|
368
|
-
readonly targetId: TTargetId;
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Base shape for any pack reference.
|
|
372
|
-
* Pack refs are pure JSON-friendly objects safe to import in authoring flows.
|
|
373
|
-
*/
|
|
374
|
-
interface PackRefBase<Kind extends string, TFamilyId extends string> extends ComponentMetadata {
|
|
375
|
-
readonly kind: Kind;
|
|
376
|
-
readonly id: string;
|
|
377
|
-
readonly familyId: TFamilyId;
|
|
378
|
-
readonly targetId?: string;
|
|
379
|
-
readonly authoring?: AuthoringContributions;
|
|
380
|
-
}
|
|
381
|
-
type FamilyPackRef<TFamilyId extends string = string> = PackRefBase<'family', TFamilyId>;
|
|
382
|
-
type TargetPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'target', TFamilyId> & {
|
|
383
|
-
readonly targetId: TTargetId;
|
|
384
|
-
};
|
|
385
|
-
type AdapterPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'adapter', TFamilyId> & {
|
|
386
|
-
readonly targetId: TTargetId;
|
|
387
|
-
};
|
|
388
|
-
type ExtensionPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'extension', TFamilyId> & {
|
|
389
|
-
readonly targetId: TTargetId;
|
|
390
|
-
};
|
|
391
|
-
type DriverPackRef<TFamilyId extends string = string, TTargetId extends string = string> = PackRefBase<'driver', TFamilyId> & {
|
|
392
|
-
readonly targetId: TTargetId;
|
|
393
|
-
};
|
|
394
|
-
/**
|
|
395
|
-
* Descriptor for an adapter component.
|
|
396
|
-
*
|
|
397
|
-
* An "adapter" provides the protocol and dialect implementation for a target.
|
|
398
|
-
* Adapters handle:
|
|
399
|
-
* - SQL/query generation (lowering AST to target-specific syntax)
|
|
400
|
-
* - Codec registration (encoding/decoding between JS and wire types)
|
|
401
|
-
* - Type mappings and coercions
|
|
402
|
-
*
|
|
403
|
-
* Adapters are bound to a specific family+target combination and work with
|
|
404
|
-
* any compatible driver for that target.
|
|
405
|
-
*
|
|
406
|
-
* Extended by plane-specific descriptors:
|
|
407
|
-
* - `ControlAdapterDescriptor` - control-plane factory
|
|
408
|
-
* - `RuntimeAdapterDescriptor` - runtime factory
|
|
409
|
-
*
|
|
410
|
-
* @template TFamilyId - Literal type for the family identifier
|
|
411
|
-
* @template TTargetId - Literal type for the target identifier
|
|
412
|
-
*
|
|
413
|
-
* @example
|
|
414
|
-
* ```ts
|
|
415
|
-
* import postgresAdapter from '@prisma-next/adapter-postgres/control';
|
|
416
|
-
*
|
|
417
|
-
* postgresAdapter.kind // 'adapter'
|
|
418
|
-
* postgresAdapter.familyId // 'sql'
|
|
419
|
-
* postgresAdapter.targetId // 'postgres'
|
|
420
|
-
* ```
|
|
421
|
-
*/
|
|
422
|
-
interface AdapterDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'adapter'> {
|
|
423
|
-
/** The family this adapter belongs to */
|
|
424
|
-
readonly familyId: TFamilyId;
|
|
425
|
-
/** The target this adapter is designed for */
|
|
426
|
-
readonly targetId: TTargetId;
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* Descriptor for a driver component.
|
|
430
|
-
*
|
|
431
|
-
* A "driver" provides the connection and execution layer for a target.
|
|
432
|
-
* Drivers handle:
|
|
433
|
-
* - Connection management (pooling, timeouts, retries)
|
|
434
|
-
* - Query execution (sending SQL/commands, receiving results)
|
|
435
|
-
* - Transaction management
|
|
436
|
-
* - Wire protocol communication
|
|
437
|
-
*
|
|
438
|
-
* Drivers are bound to a specific family+target and work with any compatible
|
|
439
|
-
* adapter. Multiple drivers can exist for the same target (e.g., node-postgres
|
|
440
|
-
* vs postgres.js for Postgres).
|
|
441
|
-
*
|
|
442
|
-
* Extended by plane-specific descriptors:
|
|
443
|
-
* - `ControlDriverDescriptor` - creates driver from connection URL
|
|
444
|
-
* - `RuntimeDriverDescriptor` - creates driver with runtime options
|
|
445
|
-
*
|
|
446
|
-
* @template TFamilyId - Literal type for the family identifier
|
|
447
|
-
* @template TTargetId - Literal type for the target identifier
|
|
448
|
-
*
|
|
449
|
-
* @example
|
|
450
|
-
* ```ts
|
|
451
|
-
* import postgresDriver from '@prisma-next/driver-postgres/control';
|
|
452
|
-
*
|
|
453
|
-
* postgresDriver.kind // 'driver'
|
|
454
|
-
* postgresDriver.familyId // 'sql'
|
|
455
|
-
* postgresDriver.targetId // 'postgres'
|
|
456
|
-
* ```
|
|
457
|
-
*/
|
|
458
|
-
interface DriverDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'driver'> {
|
|
459
|
-
/** The family this driver belongs to */
|
|
460
|
-
readonly familyId: TFamilyId;
|
|
461
|
-
/** The target this driver connects to */
|
|
462
|
-
readonly targetId: TTargetId;
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Descriptor for an extension component.
|
|
466
|
-
*
|
|
467
|
-
* An "extension" adds optional capabilities to a target. Extensions can provide:
|
|
468
|
-
* - Additional operations (e.g., vector similarity search with pgvector)
|
|
469
|
-
* - Custom types and codecs (e.g., vector type)
|
|
470
|
-
* - Extended query capabilities
|
|
471
|
-
*
|
|
472
|
-
* Extensions are bound to a specific family+target and are registered in the
|
|
473
|
-
* config alongside the core components. Multiple extensions can be used together.
|
|
474
|
-
*
|
|
475
|
-
* Extended by plane-specific descriptors:
|
|
476
|
-
* - `ControlExtensionDescriptor` - control-plane extension factory
|
|
477
|
-
* - `RuntimeExtensionDescriptor` - runtime extension factory
|
|
478
|
-
*
|
|
479
|
-
* @template TFamilyId - Literal type for the family identifier
|
|
480
|
-
* @template TTargetId - Literal type for the target identifier
|
|
481
|
-
*
|
|
482
|
-
* @example
|
|
483
|
-
* ```ts
|
|
484
|
-
* import pgvector from '@prisma-next/extension-pgvector/control';
|
|
485
|
-
*
|
|
486
|
-
* pgvector.kind // 'extension'
|
|
487
|
-
* pgvector.familyId // 'sql'
|
|
488
|
-
* pgvector.targetId // 'postgres'
|
|
489
|
-
* ```
|
|
490
|
-
*/
|
|
491
|
-
interface ExtensionDescriptor<TFamilyId extends string, TTargetId extends string> extends ComponentDescriptor<'extension'> {
|
|
492
|
-
/** The family this extension belongs to */
|
|
493
|
-
readonly familyId: TFamilyId;
|
|
494
|
-
/** The target this extension is designed for */
|
|
495
|
-
readonly targetId: TTargetId;
|
|
496
|
-
}
|
|
497
|
-
/** Components bound to a specific family+target combination. */
|
|
498
|
-
type TargetBoundComponentDescriptor<TFamilyId extends string, TTargetId extends string> = TargetDescriptor<TFamilyId, TTargetId> | AdapterDescriptor<TFamilyId, TTargetId> | DriverDescriptor<TFamilyId, TTargetId> | ExtensionDescriptor<TFamilyId, TTargetId>;
|
|
499
|
-
interface FamilyInstance<TFamilyId extends string> {
|
|
500
|
-
readonly familyId: TFamilyId;
|
|
501
|
-
}
|
|
502
|
-
interface TargetInstance<TFamilyId extends string, TTargetId extends string> {
|
|
503
|
-
readonly familyId: TFamilyId;
|
|
504
|
-
readonly targetId: TTargetId;
|
|
505
|
-
}
|
|
506
|
-
interface AdapterInstance<TFamilyId extends string, TTargetId extends string> {
|
|
507
|
-
readonly familyId: TFamilyId;
|
|
508
|
-
readonly targetId: TTargetId;
|
|
509
|
-
}
|
|
510
|
-
interface DriverInstance<TFamilyId extends string, TTargetId extends string> {
|
|
511
|
-
readonly familyId: TFamilyId;
|
|
512
|
-
readonly targetId: TTargetId;
|
|
513
|
-
}
|
|
514
|
-
interface ExtensionInstance<TFamilyId extends string, TTargetId extends string> {
|
|
515
|
-
readonly familyId: TFamilyId;
|
|
516
|
-
readonly targetId: TTargetId;
|
|
517
|
-
}
|
|
518
|
-
//#endregion
|
|
519
|
-
export { type AdapterDescriptor, type AdapterInstance, type AdapterPackRef, type AuthoringArgRef, type AuthoringArgumentDescriptor, type AuthoringColumnDefaultTemplate, type AuthoringContributions, type AuthoringFieldNamespace, type AuthoringFieldPresetDescriptor, type AuthoringFieldPresetOutput, type AuthoringStorageTypeTemplate, type AuthoringTemplateValue, type AuthoringTypeConstructorDescriptor, type AuthoringTypeNamespace, 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 NormalizedTypeRenderer, type PackRefBase, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetPackRef, type TypeRenderer, type TypeRendererFunction, type TypeRendererTemplate, checkContractComponentRequirements, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, interpolateTypeTemplate, isAuthoringArgRef, isAuthoringFieldPresetDescriptor, isAuthoringTypeConstructorDescriptor, normalizeRenderer, resolveAuthoringTemplateValue, validateAuthoringHelperArguments };
|
|
520
|
-
//# sourceMappingURL=framework-components.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"framework-components.d.mts","names":[],"sources":["../src/framework-authoring.ts","../src/framework-components.ts"],"sourcesContent":[],"mappings":";;;KAEY,eAAA;;;EAAA,SAAA,IAAA,CAAA,EA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