@prisma-next/sql-contract-emitter 0.1.0-pr.32.8 → 0.1.0-pr.32.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +2 -69
  2. package/package.json +4 -3
package/dist/index.d.ts CHANGED
@@ -1,74 +1,7 @@
1
+ import { ContractIR } from '@prisma-next/contract/ir';
2
+ import { ValidationContext, TypesImportSpec } from '@prisma-next/contract/types';
1
3
  import { SqlStorage, ModelDefinition } from '@prisma-next/sql-contract/types';
2
4
 
3
- /**
4
- * ContractIR types and factories for building contract intermediate representation.
5
- * ContractIR is family-agnostic and used by authoring, emitter, and no-emit runtime.
6
- */
7
- /**
8
- * ContractIR represents the intermediate representation of a contract.
9
- * It is family-agnostic and contains generic storage, models, and relations.
10
- * Note: coreHash and profileHash are computed by the emitter, not part of the IR.
11
- */
12
- interface ContractIR<TStorage extends Record<string, unknown> = Record<string, unknown>, TModels extends Record<string, unknown> = Record<string, unknown>, TRelations extends Record<string, unknown> = Record<string, unknown>> {
13
- readonly schemaVersion: string;
14
- readonly targetFamily: string;
15
- readonly target: string;
16
- readonly models: TModels;
17
- readonly relations: TRelations;
18
- readonly storage: TStorage;
19
- readonly extensions: Record<string, unknown>;
20
- readonly capabilities: Record<string, Record<string, boolean>>;
21
- readonly meta: Record<string, unknown>;
22
- readonly sources: Record<string, unknown>;
23
- }
24
-
25
- type ArgSpec = {
26
- readonly kind: 'typeId';
27
- readonly type: string;
28
- } | {
29
- readonly kind: 'param';
30
- } | {
31
- readonly kind: 'literal';
32
- };
33
- type ReturnSpec = {
34
- readonly kind: 'typeId';
35
- readonly type: string;
36
- } | {
37
- readonly kind: 'builtin';
38
- readonly type: 'number' | 'boolean' | 'string';
39
- };
40
- interface OperationSignature {
41
- readonly forTypeId: string;
42
- readonly method: string;
43
- readonly args: ReadonlyArray<ArgSpec>;
44
- readonly returns: ReturnSpec;
45
- readonly capabilities?: ReadonlyArray<string>;
46
- }
47
- interface OperationRegistry {
48
- register(op: OperationSignature): void;
49
- byType(typeId: string): ReadonlyArray<OperationSignature>;
50
- }
51
-
52
- /**
53
- * Specifies how to import TypeScript types from a package.
54
- * Used in extension pack manifests to declare codec and operation type imports.
55
- */
56
- interface TypesImportSpec {
57
- readonly package: string;
58
- readonly named: string;
59
- readonly alias: string;
60
- }
61
- /**
62
- * Validation context passed to TargetFamilyHook.validateTypes().
63
- * Contains pre-assembled operation registry, type imports, and extension IDs.
64
- */
65
- interface ValidationContext {
66
- readonly operationRegistry?: OperationRegistry;
67
- readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;
68
- readonly operationTypeImports?: ReadonlyArray<TypesImportSpec>;
69
- readonly extensionIds?: ReadonlyArray<string>;
70
- }
71
-
72
5
  declare const sqlTargetFamilyHook: {
73
6
  readonly id: "sql";
74
7
  readonly validateTypes: (ir: ContractIR, ctx: ValidationContext) => void;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@prisma-next/sql-contract-emitter",
3
- "version": "0.1.0-pr.32.8",
3
+ "version": "0.1.0-pr.32.9",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "SQL emitter hook for Prisma Next",
7
7
  "dependencies": {
8
- "@prisma-next/emitter": "0.1.0-pr.32.8",
9
- "@prisma-next/sql-contract": "0.1.0-pr.32.8"
8
+ "@prisma-next/contract": "0.1.0-pr.32.9",
9
+ "@prisma-next/emitter": "0.1.0-pr.32.9",
10
+ "@prisma-next/sql-contract": "0.1.0-pr.32.9"
10
11
  },
11
12
  "devDependencies": {
12
13
  "tsup": "^8.3.0",