@prisma-next/core-execution-plane 0.3.0-pr.99.4 → 0.3.0-pr.99.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ import { a as RuntimeExtensionDescriptor, l as RuntimeTargetDescriptor, s as RuntimeFamilyDescriptor, t as RuntimeAdapterDescriptor } from "./types-CRenF7tV.mjs";
2
+
3
+ //#region src/framework-components.d.ts
4
+
5
+ /**
6
+ * Asserts that runtime component descriptors satisfy contract requirements.
7
+ *
8
+ * Routes the same framework composition through validation as control-plane:
9
+ * family, target, adapter, extensionPacks (all as descriptors with IDs).
10
+ *
11
+ * @throws Error if contract target doesn't match the provided target descriptor
12
+ * @throws Error if contract requires extension packs not provided in descriptors
13
+ */
14
+ declare function assertRuntimeContractRequirementsSatisfied<TFamilyId extends string, TTargetId extends string>({
15
+ contract,
16
+ family,
17
+ target,
18
+ adapter,
19
+ extensionPacks
20
+ }: {
21
+ readonly contract: {
22
+ readonly target: string;
23
+ readonly extensionPacks?: Record<string, unknown>;
24
+ };
25
+ readonly family: RuntimeFamilyDescriptor<TFamilyId>;
26
+ readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
27
+ readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
28
+ readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
29
+ }): void;
30
+ //#endregion
31
+ export { assertRuntimeContractRequirementsSatisfied };
32
+ //# sourceMappingURL=framework-components.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components.d.mts","names":[],"sources":["../src/framework-components.ts"],"sourcesContent":[],"mappings":";;;;;;AAkBA;;;;;;;AAW2C,iBAX3B,0CAW2B,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,CAAA;EAAA,QAAA;EAAA,MAAA;EAAA,MAAA;EAAA,OAAA;EAAA;CAAA,EAAA;EAAxB,SAAA,QAAA,EAAA;IACwB,SAAA,MAAA,EAAA,MAAA;IAAW,SAAA,cAAA,CAAA,EAFoB,MAEpB,CAAA,MAAA,EAAA,OAAA,CAAA;EAAnC,CAAA;EAC0B,SAAA,MAAA,EAF1B,uBAE0B,CAFF,SAEE,CAAA;EAAW,SAAA,MAAA,EADrC,uBACqC,CADb,SACa,EADF,SACE,CAAA;EAApC,SAAA,OAAA,EAAA,wBAAA,CAAyB,SAAzB,EAAoC,SAApC,CAAA;EAC2C,SAAA,cAAA,EAAA,SAA3B,0BAA2B,CAAA,SAAA,EAAW,SAAX,CAAA,EAAA;CAAW,CAAA,EAAA,IAAA"}
@@ -0,0 +1,31 @@
1
+ import { checkContractComponentRequirements } from "@prisma-next/contract/framework-components";
2
+
3
+ //#region src/framework-components.ts
4
+ /**
5
+ * Asserts that runtime component descriptors satisfy contract requirements.
6
+ *
7
+ * Routes the same framework composition through validation as control-plane:
8
+ * family, target, adapter, extensionPacks (all as descriptors with IDs).
9
+ *
10
+ * @throws Error if contract target doesn't match the provided target descriptor
11
+ * @throws Error if contract requires extension packs not provided in descriptors
12
+ */
13
+ function assertRuntimeContractRequirementsSatisfied({ contract, family, target, adapter, extensionPacks }) {
14
+ const providedComponentIds = new Set([
15
+ family.id,
16
+ target.id,
17
+ adapter.id
18
+ ]);
19
+ for (const extension of extensionPacks) providedComponentIds.add(extension.id);
20
+ const result = checkContractComponentRequirements({
21
+ contract,
22
+ expectedTargetId: target.targetId,
23
+ providedComponentIds
24
+ });
25
+ if (result.targetMismatch) throw new Error(`Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`);
26
+ for (const packId of result.missingExtensionPackIds) throw new Error(`Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`);
27
+ }
28
+
29
+ //#endregion
30
+ export { assertRuntimeContractRequirementsSatisfied };
31
+ //# sourceMappingURL=framework-components.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components.mjs","names":[],"sources":["../src/framework-components.ts"],"sourcesContent":["import { checkContractComponentRequirements } from '@prisma-next/contract/framework-components';\n\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './types';\n\n/**\n * Asserts that runtime component descriptors satisfy contract requirements.\n *\n * Routes the same framework composition through validation as control-plane:\n * family, target, adapter, extensionPacks (all as descriptors with IDs).\n *\n * @throws Error if contract target doesn't match the provided target descriptor\n * @throws Error if contract requires extension packs not provided in 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 // Build set of provided component IDs from descriptors\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 // Strict enforcement: all extension packs required by contract must be provided as descriptors\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"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,2CAGd,EACA,UACA,QACA,QACA,SACA,kBAOO;CAEP,MAAM,uBAAuB,IAAI,IAAY;EAAC,OAAO;EAAI,OAAO;EAAI,QAAQ;EAAG,CAAC;AAChF,MAAK,MAAM,aAAa,eACtB,sBAAqB,IAAI,UAAU,GAAG;CAGxC,MAAM,SAAS,mCAAmC;EAChD;EACA,kBAAkB,OAAO;EACzB;EACD,CAAC;AAEF,KAAI,OAAO,eACT,OAAM,IAAI,MACR,oBAAoB,OAAO,eAAe,OAAO,8CAA8C,OAAO,eAAe,SAAS,IAC/H;AAIH,MAAK,MAAM,UAAU,OAAO,wBAC1B,OAAM,IAAI,MACR,qCAAqC,OAAO,iEAC7C"}
@@ -0,0 +1,102 @@
1
+ import { AdapterDescriptor, AdapterInstance, DriverDescriptor, DriverInstance, ExtensionDescriptor, ExtensionInstance, FamilyDescriptor, FamilyInstance, TargetDescriptor, TargetInstance } from "@prisma-next/contract/framework-components";
2
+
3
+ //#region src/types.d.ts
4
+
5
+ /**
6
+ * Runtime-plane family instance interface.
7
+ * Extends the base FamilyInstance for runtime-plane specific methods.
8
+ *
9
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
10
+ */
11
+ interface RuntimeFamilyInstance<TFamilyId extends string> extends FamilyInstance<TFamilyId> {}
12
+ /**
13
+ * Runtime-plane target instance interface.
14
+ * Extends the base TargetInstance with runtime-plane specific behavior.
15
+ *
16
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
17
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
18
+ */
19
+ interface RuntimeTargetInstance<TFamilyId extends string, TTargetId extends string> extends TargetInstance<TFamilyId, TTargetId> {}
20
+ /**
21
+ * Runtime-plane adapter instance interface.
22
+ * Extends the base AdapterInstance with runtime-plane specific behavior.
23
+ * Families extend this with family-specific adapter interfaces.
24
+ *
25
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
26
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
27
+ */
28
+ interface RuntimeAdapterInstance<TFamilyId extends string, TTargetId extends string> extends AdapterInstance<TFamilyId, TTargetId> {}
29
+ /**
30
+ * Runtime-plane driver instance interface.
31
+ * Extends the base DriverInstance with runtime-plane specific behavior.
32
+ *
33
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
34
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
35
+ */
36
+ interface RuntimeDriverInstance<TFamilyId extends string, TTargetId extends string> extends DriverInstance<TFamilyId, TTargetId> {}
37
+ /**
38
+ * Runtime-plane extension instance interface.
39
+ * Extends the base ExtensionInstance with runtime-plane specific behavior.
40
+ *
41
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
42
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
43
+ */
44
+ interface RuntimeExtensionInstance<TFamilyId extends string, TTargetId extends string> extends ExtensionInstance<TFamilyId, TTargetId> {}
45
+ /**
46
+ * Descriptor for an execution/runtime-plane family (e.g., SQL).
47
+ * Provides factory method to create runtime family instance.
48
+ *
49
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
50
+ * @template TFamilyInstance - The family instance type
51
+ */
52
+ interface RuntimeFamilyDescriptor<TFamilyId extends string, TFamilyInstance extends RuntimeFamilyInstance<TFamilyId> = RuntimeFamilyInstance<TFamilyId>> extends FamilyDescriptor<TFamilyId> {
53
+ create<TTargetId extends string>(options: {
54
+ readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
55
+ readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
56
+ readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId>;
57
+ readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
58
+ }): TFamilyInstance;
59
+ }
60
+ /**
61
+ * Descriptor for an execution/runtime-plane target component (e.g., Postgres target).
62
+ *
63
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
64
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
65
+ * @template TTargetInstance - The target instance type
66
+ */
67
+ interface RuntimeTargetDescriptor<TFamilyId extends string, TTargetId extends string, TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId> = RuntimeTargetInstance<TFamilyId, TTargetId>> extends TargetDescriptor<TFamilyId, TTargetId> {
68
+ create(): TTargetInstance;
69
+ }
70
+ /**
71
+ * Descriptor for an execution/runtime-plane adapter component (e.g., Postgres adapter).
72
+ *
73
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
74
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
75
+ * @template TAdapterInstance - The adapter instance type
76
+ */
77
+ interface RuntimeAdapterDescriptor<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>> extends AdapterDescriptor<TFamilyId, TTargetId> {
78
+ create(): TAdapterInstance;
79
+ }
80
+ /**
81
+ * Descriptor for an execution/runtime-plane driver component (e.g., Postgres driver).
82
+ *
83
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
84
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
85
+ * @template TDriverInstance - The driver instance type
86
+ */
87
+ interface RuntimeDriverDescriptor<TFamilyId extends string, TTargetId extends string, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>> extends DriverDescriptor<TFamilyId, TTargetId> {
88
+ create(options: unknown): TDriverInstance;
89
+ }
90
+ /**
91
+ * Descriptor for an execution/runtime-plane extension component (e.g., pgvector).
92
+ *
93
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
94
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
95
+ * @template TExtensionInstance - The extension instance type
96
+ */
97
+ interface RuntimeExtensionDescriptor<TFamilyId extends string, TTargetId extends string, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> extends ExtensionDescriptor<TFamilyId, TTargetId> {
98
+ create(): TExtensionInstance;
99
+ }
100
+ //#endregion
101
+ export { RuntimeExtensionDescriptor as a, RuntimeFamilyInstance as c, RuntimeDriverInstance as i, RuntimeTargetDescriptor as l, RuntimeAdapterInstance as n, RuntimeExtensionInstance as o, RuntimeDriverDescriptor as r, RuntimeFamilyDescriptor as s, RuntimeAdapterDescriptor as t, RuntimeTargetInstance as u };
102
+ //# sourceMappingURL=types-CRenF7tV.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CRenF7tV.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAuBA;AAWA;;;AACU,UAZO,qBAYP,CAAA,kBAAA,MAAA,CAAA,SAZ+D,cAY/D,CAZ8E,SAY9E,CAAA,CAAA;AAUV;;;;;AAUA;;AACoC,UAtBnB,qBAsBmB,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SArB1B,cAqB0B,CArBX,SAqBW,EArBA,SAqBA,CAAA,CAAA;;AASpC;;;;;AAcA;;AAE0B,UApCT,sBAoCS,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SAnChB,eAmCgB,CAnCA,SAmCA,EAnCW,SAmCX,CAAA,CAAA;;;;;;;;AAIJ,UA9BL,qBA8BK,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SA7BZ,cA6BY,CA7BG,SA6BH,EA7Bc,SA6Bd,CAAA,CAAA;;;;;;;;AAHI,UAjBT,wBAiBS,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SAhBhB,iBAgBgB,CAhBE,SAgBF,EAhBa,SAgBb,CAAA,CAAA,CAgB1B;;;;;;;;AAOsC,UA1BrB,uBA0BqB,CAAA,kBAAA,MAAA,EAAA,wBAxBZ,qBAwBY,CAxBU,SAwBV,CAAA,GAxBuB,qBAwBvB,CAxB6C,SAwB7C,CAAA,CAAA,SAvB5B,gBAuB4B,CAvBX,SAuBW,CAAA,CAAA;EAC1B,MAAA,CAAA,kBAAA,MAAA,CAAA,CAAA,OAAA,EAAA;IADF,SAAA,MAAA,EArBW,uBAqBX,CArBmC,SAqBnC,EArB8C,SAqB9C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,WAAW;YAC7B"}
@@ -0,0 +1,2 @@
1
+ import { a as RuntimeExtensionDescriptor, c as RuntimeFamilyInstance, i as RuntimeDriverInstance, l as RuntimeTargetDescriptor, n as RuntimeAdapterInstance, o as RuntimeExtensionInstance, r as RuntimeDriverDescriptor, s as RuntimeFamilyDescriptor, t as RuntimeAdapterDescriptor, u as RuntimeTargetInstance } from "./types-CRenF7tV.mjs";
2
+ export { type RuntimeAdapterDescriptor, type RuntimeAdapterInstance, type RuntimeDriverDescriptor, type RuntimeDriverInstance, type RuntimeExtensionDescriptor, type RuntimeExtensionInstance, type RuntimeFamilyDescriptor, type RuntimeFamilyInstance, type RuntimeTargetDescriptor, type RuntimeTargetInstance };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
package/package.json CHANGED
@@ -1,42 +1,41 @@
1
1
  {
2
2
  "name": "@prisma-next/core-execution-plane",
3
- "version": "0.3.0-pr.99.4",
3
+ "version": "0.3.0-pr.99.6",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Execution/runtime plane descriptor and instance types for Prisma Next",
7
7
  "dependencies": {
8
- "@prisma-next/core-control-plane": "0.3.0-pr.99.4",
9
- "@prisma-next/contract": "0.3.0-pr.99.4"
8
+ "@prisma-next/core-control-plane": "0.3.0-pr.99.6",
9
+ "@prisma-next/contract": "0.3.0-pr.99.6"
10
10
  },
11
11
  "devDependencies": {
12
- "tsup": "8.5.1",
12
+ "tsdown": "0.18.4",
13
13
  "typescript": "5.9.3",
14
14
  "vitest": "4.0.16",
15
15
  "@prisma-next/test-utils": "0.0.1",
16
- "@prisma-next/tsconfig": "0.0.0"
16
+ "@prisma-next/tsconfig": "0.0.0",
17
+ "@prisma-next/tsdown": "0.0.0"
17
18
  },
18
19
  "files": [
19
20
  "dist",
20
21
  "src"
21
22
  ],
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
22
26
  "exports": {
23
- "./types": {
24
- "types": "./dist/exports/types.d.ts",
25
- "import": "./dist/exports/types.js"
26
- },
27
- "./framework-components": {
28
- "types": "./dist/exports/framework-components.d.ts",
29
- "import": "./dist/exports/framework-components.js"
30
- }
27
+ "./framework-components": "./dist/framework-components.mjs",
28
+ "./types": "./dist/types.mjs",
29
+ "./package.json": "./package.json"
31
30
  },
32
31
  "scripts": {
33
- "build": "tsup --config tsup.config.ts && tsc --project tsconfig.build.json",
32
+ "build": "tsdown",
34
33
  "test": "vitest run --passWithNoTests",
35
34
  "test:coverage": "vitest run --coverage --passWithNoTests",
36
- "typecheck": "tsc --project tsconfig.json --noEmit",
35
+ "typecheck": "tsc --noEmit",
37
36
  "lint": "biome check . --error-on-warnings",
38
37
  "lint:fix": "biome check --write .",
39
38
  "lint:fix:unsafe": "biome check --write --unsafe .",
40
- "clean": "rm -rf dist coverage .tmp-output"
39
+ "clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
41
40
  }
42
41
  }
@@ -1,2 +0,0 @@
1
- export { assertRuntimeContractRequirementsSatisfied } from '../framework-components';
2
- //# sourceMappingURL=framework-components.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components.d.ts","sourceRoot":"","sources":["../../src/exports/framework-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,33 +0,0 @@
1
- // src/framework-components.ts
2
- import { checkContractComponentRequirements } from "@prisma-next/contract/framework-components";
3
- function assertRuntimeContractRequirementsSatisfied({
4
- contract,
5
- family,
6
- target,
7
- adapter,
8
- extensionPacks
9
- }) {
10
- const providedComponentIds = /* @__PURE__ */ new Set([family.id, target.id, adapter.id]);
11
- for (const extension of extensionPacks) {
12
- providedComponentIds.add(extension.id);
13
- }
14
- const result = checkContractComponentRequirements({
15
- contract,
16
- expectedTargetId: target.targetId,
17
- providedComponentIds
18
- });
19
- if (result.targetMismatch) {
20
- throw new Error(
21
- `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`
22
- );
23
- }
24
- for (const packId of result.missingExtensionPackIds) {
25
- throw new Error(
26
- `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`
27
- );
28
- }
29
- }
30
- export {
31
- assertRuntimeContractRequirementsSatisfied
32
- };
33
- //# sourceMappingURL=framework-components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/framework-components.ts"],"sourcesContent":["import { checkContractComponentRequirements } from '@prisma-next/contract/framework-components';\n\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './types';\n\n/**\n * Asserts that runtime component descriptors satisfy contract requirements.\n *\n * Routes the same framework composition through validation as control-plane:\n * family, target, adapter, extensionPacks (all as descriptors with IDs).\n *\n * @throws Error if contract target doesn't match the provided target descriptor\n * @throws Error if contract requires extension packs not provided in 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 // Build set of provided component IDs from descriptors\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 // Strict enforcement: all extension packs required by contract must be provided as descriptors\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"],"mappings":";AAAA,SAAS,0CAA0C;AAkB5C,SAAS,2CAGd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMS;AAEP,QAAM,uBAAuB,oBAAI,IAAY,CAAC,OAAO,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;AAC/E,aAAW,aAAa,gBAAgB;AACtC,yBAAqB,IAAI,UAAU,EAAE;AAAA,EACvC;AAEA,QAAM,SAAS,mCAAmC;AAAA,IAChD;AAAA,IACA,kBAAkB,OAAO;AAAA,IACzB;AAAA,EACF,CAAC;AAED,MAAI,OAAO,gBAAgB;AACzB,UAAM,IAAI;AAAA,MACR,oBAAoB,OAAO,eAAe,MAAM,+CAA+C,OAAO,eAAe,QAAQ;AAAA,IAC/H;AAAA,EACF;AAGA,aAAW,UAAU,OAAO,yBAAyB;AACnD,UAAM,IAAI;AAAA,MACR,qCAAqC,MAAM;AAAA,IAC7C;AAAA,EACF;AACF;","names":[]}
@@ -1,2 +0,0 @@
1
- export type { RuntimeAdapterDescriptor, RuntimeAdapterInstance, RuntimeDriverDescriptor, RuntimeDriverInstance, RuntimeExtensionDescriptor, RuntimeExtensionInstance, RuntimeFamilyDescriptor, RuntimeFamilyInstance, RuntimeTargetDescriptor, RuntimeTargetInstance, } from '../types';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/exports/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,21 +0,0 @@
1
- import type { RuntimeAdapterDescriptor, RuntimeExtensionDescriptor, RuntimeFamilyDescriptor, RuntimeTargetDescriptor } from './types';
2
- /**
3
- * Asserts that runtime component descriptors satisfy contract requirements.
4
- *
5
- * Routes the same framework composition through validation as control-plane:
6
- * family, target, adapter, extensionPacks (all as descriptors with IDs).
7
- *
8
- * @throws Error if contract target doesn't match the provided target descriptor
9
- * @throws Error if contract requires extension packs not provided in descriptors
10
- */
11
- export declare function assertRuntimeContractRequirementsSatisfied<TFamilyId extends string, TTargetId extends string>({ contract, family, target, adapter, extensionPacks, }: {
12
- readonly contract: {
13
- readonly target: string;
14
- readonly extensionPacks?: Record<string, unknown>;
15
- };
16
- readonly family: RuntimeFamilyDescriptor<TFamilyId>;
17
- readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
18
- readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
19
- readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
20
- }): void;
21
- //# sourceMappingURL=framework-components.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components.d.ts","sourceRoot":"","sources":["../src/framework-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;GAQG;AACH,wBAAgB,0CAA0C,CACxD,SAAS,SAAS,MAAM,EACxB,SAAS,SAAS,MAAM,EACxB,EACA,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,cAAc,GACf,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAClG,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACjE,QAAQ,CAAC,cAAc,EAAE,SAAS,0BAA0B,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;CACtF,GAAG,IAAI,CAyBP"}
package/dist/types.d.ts DELETED
@@ -1,102 +0,0 @@
1
- import type { AdapterDescriptor, AdapterInstance, DriverDescriptor, DriverInstance, ExtensionDescriptor, ExtensionInstance, FamilyDescriptor, FamilyInstance, TargetDescriptor, TargetInstance } from '@prisma-next/contract/framework-components';
2
- /**
3
- * Runtime-plane family instance interface.
4
- * Extends the base FamilyInstance for runtime-plane specific methods.
5
- *
6
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
7
- */
8
- export interface RuntimeFamilyInstance<TFamilyId extends string> extends FamilyInstance<TFamilyId> {
9
- }
10
- /**
11
- * Runtime-plane target instance interface.
12
- * Extends the base TargetInstance with runtime-plane specific behavior.
13
- *
14
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
15
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
16
- */
17
- export interface RuntimeTargetInstance<TFamilyId extends string, TTargetId extends string> extends TargetInstance<TFamilyId, TTargetId> {
18
- }
19
- /**
20
- * Runtime-plane adapter instance interface.
21
- * Extends the base AdapterInstance with runtime-plane specific behavior.
22
- * Families extend this with family-specific adapter interfaces.
23
- *
24
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
25
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
26
- */
27
- export interface RuntimeAdapterInstance<TFamilyId extends string, TTargetId extends string> extends AdapterInstance<TFamilyId, TTargetId> {
28
- }
29
- /**
30
- * Runtime-plane driver instance interface.
31
- * Extends the base DriverInstance with runtime-plane specific behavior.
32
- *
33
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
34
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
35
- */
36
- export interface RuntimeDriverInstance<TFamilyId extends string, TTargetId extends string> extends DriverInstance<TFamilyId, TTargetId> {
37
- }
38
- /**
39
- * Runtime-plane extension instance interface.
40
- * Extends the base ExtensionInstance with runtime-plane specific behavior.
41
- *
42
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
43
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
44
- */
45
- export interface RuntimeExtensionInstance<TFamilyId extends string, TTargetId extends string> extends ExtensionInstance<TFamilyId, TTargetId> {
46
- }
47
- /**
48
- * Descriptor for an execution/runtime-plane family (e.g., SQL).
49
- * Provides factory method to create runtime family instance.
50
- *
51
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
52
- * @template TFamilyInstance - The family instance type
53
- */
54
- export interface RuntimeFamilyDescriptor<TFamilyId extends string, TFamilyInstance extends RuntimeFamilyInstance<TFamilyId> = RuntimeFamilyInstance<TFamilyId>> extends FamilyDescriptor<TFamilyId> {
55
- create<TTargetId extends string>(options: {
56
- readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
57
- readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
58
- readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId>;
59
- readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
60
- }): TFamilyInstance;
61
- }
62
- /**
63
- * Descriptor for an execution/runtime-plane target component (e.g., Postgres target).
64
- *
65
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
66
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
67
- * @template TTargetInstance - The target instance type
68
- */
69
- export interface RuntimeTargetDescriptor<TFamilyId extends string, TTargetId extends string, TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId> = RuntimeTargetInstance<TFamilyId, TTargetId>> extends TargetDescriptor<TFamilyId, TTargetId> {
70
- create(): TTargetInstance;
71
- }
72
- /**
73
- * Descriptor for an execution/runtime-plane adapter component (e.g., Postgres adapter).
74
- *
75
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
76
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
77
- * @template TAdapterInstance - The adapter instance type
78
- */
79
- export interface RuntimeAdapterDescriptor<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>> extends AdapterDescriptor<TFamilyId, TTargetId> {
80
- create(): TAdapterInstance;
81
- }
82
- /**
83
- * Descriptor for an execution/runtime-plane driver component (e.g., Postgres driver).
84
- *
85
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
86
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
87
- * @template TDriverInstance - The driver instance type
88
- */
89
- export interface RuntimeDriverDescriptor<TFamilyId extends string, TTargetId extends string, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>> extends DriverDescriptor<TFamilyId, TTargetId> {
90
- create(options: unknown): TDriverInstance;
91
- }
92
- /**
93
- * Descriptor for an execution/runtime-plane extension component (e.g., pgvector).
94
- *
95
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
96
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
97
- * @template TExtensionInstance - The extension instance type
98
- */
99
- export interface RuntimeExtensionDescriptor<TFamilyId extends string, TTargetId extends string, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> extends ExtensionDescriptor<TFamilyId, TTargetId> {
100
- create(): TExtensionInstance;
101
- }
102
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eA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