@prisma-next/sql-contract-ts 0.3.0-dev.135 → 0.3.0-dev.146

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @prisma-next/sql-contract-ts
2
2
 
3
- **Status:** Phase 2 - SQL-specific contract authoring surface composed with generic core
3
+ **Status:** Current SQL TypeScript contract authoring surface
4
4
 
5
- This package contains the SQL-specific TypeScript contract authoring surface for Prisma Next.
5
+ This package owns the SQL TypeScript authoring API for Prisma Next.
6
6
 
7
7
  ## Package Classification
8
8
 
@@ -10,116 +10,118 @@ This package contains the SQL-specific TypeScript contract authoring surface for
10
10
  - **Layer**: authoring
11
11
  - **Plane**: migration
12
12
 
13
- **Note**: SQL authoring may depend on SQL core layer (e.g., `@prisma-next/sql-contract/types`) within the same domain.
14
-
15
13
  ## Overview
16
14
 
17
15
  This package is part of the SQL family namespace (`packages/2-sql/2-authoring/contract-ts`) and provides:
18
- - SQL contract builder (`defineContract`) in two forms:
19
- - legacy chain builder
20
- - staged contract DSL object-literal authoring with `model('User', { fields, relations }).attributes(...).sql(...)`
21
- - SQL contract JSON schema - JSON schema for validating contract structure
16
+
17
+ - the SQL contract DSL centered on `defineContract(...)`
18
+ - the base structural helpers exported from `./contract-builder`: `field.column(...)`, `field.generated(...)`, `field.namedType(...)`, plus `model(...)` and `rel.*`
19
+ - an optional callback overload that exposes pack-composed helper namespaces such as `field.id.uuidv7()`, `field.text()`, `field.createdAt()`, and `type.enum(...)`
20
+ - lowering from authored model definitions into the canonical SQL `Contract`
21
+ - a SQL contract JSON schema export via `./schema-sql`
22
22
 
23
23
  ## Responsibilities
24
24
 
25
- - **SQL Contract Builder**: Provides both the existing chain builder and the staged contract DSL authoring surface for creating SQL contracts programmatically with type safety
26
- - **Storage Type Authoring**: Supports `storage.types` declarations and `typeRef` columns via the SQL builder
27
- - **SQL Contract JSON Schema**: Provides JSON schema for validating contract structure in IDEs and tooling
28
- - **Composition Layer**: Composes the target-agnostic builder core from `@prisma-next/contract-authoring` with SQL-specific types and validation logic
29
- - **Generated Defaults**: Supports client-generated defaults via `ColumnDefault.kind = 'generated'` in contract authoring
25
+ - **SQL contract authoring**: Build SQL contracts programmatically with type safety
26
+ - **Pack-composed helper vocabulary**: Merge family, target, and extension authoring contributions into the callback helper namespaces
27
+ - **Lowering pipeline**: Turn authored model definitions into the canonical SQL contract artifacts consumed by the rest of the stack
28
+ - **Config helper**: Provide `typescriptContract(...)` for `prisma-next.config.ts`
29
+ - **Schema export**: Publish the SQL JSON schema used by editors and tooling
30
30
 
31
31
  ## Package Status
32
32
 
33
- This package was created in Phase 1 and refactored in Phase 2. It now composes the target-agnostic builder core from `@prisma-next/contract-authoring` with SQL-specific types and validation logic.
33
+ This is the current SQL TypeScript authoring implementation. Shared descriptor types live in `@prisma-next/contract-authoring`. Contract validation lives in `@prisma-next/sql-contract/validate`.
34
34
 
35
35
  ## Architecture
36
36
 
37
- - **Composes generic core**: Uses `@prisma-next/contract-authoring` for generic builder state management (`TableBuilder`, `ModelBuilder`, `ContractBuilder` base class)
38
- - **SQL-specific types**: Provides SQL-specific contract types (`SqlContract`, `SqlStorage`, `SqlModelStorage`) from `@prisma-next/sql-contract/types`
39
- - **SQL-specific build()**: Implements SQL-specific `build()` method in `SqlContractBuilder` that constructs `SqlContract` instances with SQL-specific structure (uniques, indexes, foreignKeys arrays)
37
+ - **Base DSL**: `./contract-builder` exports the stable structural DSL (`defineContract`, `field`, `model`, `rel`)
38
+ - **Composed helper namespaces**: `defineContract(config, (helpers) => ...)` synthesizes `helpers.field.*` and `helpers.type.*` from the selected family, target, and extension packs
39
+ - **SQL resolution and contract generation**: internal resolution normalizes names, relations, indexes, and FK materialization before producing the canonical SQL contract artifacts
40
+ - **Shared descriptor layer**: `@prisma-next/contract-authoring` provides the target-neutral descriptor types used by the DSL and by authoring-adjacent packs
41
+
42
+ Contributor-facing lowering notes and detailed warning semantics live in [DEVELOPING.md](./DEVELOPING.md).
40
43
 
41
44
  ```mermaid
42
45
  flowchart LR
43
- builderInput[TS builder calls] --> sqlContractTs[@prisma-next/sql-contract-ts]
46
+ builderInput[TypeScript contract input] --> sqlContractTs[@prisma-next/sql-contract-ts]
44
47
  sqlContractTs --> authoringCore[@prisma-next/contract-authoring]
45
48
  sqlContractTs --> sqlTypes[@prisma-next/sql-contract/types]
46
- sqlContractTs --> contractIR[SQL ContractIR]
49
+ sqlContractTs --> contract[SQL Contract]
47
50
  ```
48
51
 
49
- This package is part of the package layering architecture:
50
- - **Location**: `packages/2-sql/2-authoring/contract-ts` (SQL family namespace)
51
- - **Ring**: SQL family namespace (can import from core, authoring, targets, and other SQL family packages)
52
-
53
52
  ## Exports
54
53
 
55
- - `./contract-builder` - Contract builder API (`defineContract`, `field`, `model`, `rel`, `ColumnBuilder`)
56
- - `./config-types` - TypeScript contract config helper (`typescriptContract`)
54
+ - `./contract-builder` - SQL contract DSL (`defineContract`, `field`, `model`, `rel`)
55
+ - `./config-types` - `typescriptContract(...)` config helper
57
56
  - `./schema-sql` - SQL contract JSON schema (`data-contract-sql-v1.json`)
58
57
 
59
58
  ## Usage
60
59
 
61
- ### Building Contracts
60
+ ### Direct Structural DSL
62
61
 
63
- #### Staged Contract DSL
62
+ Direct imports expose the base structural helpers. Use this surface when you want to author with explicit column descriptors, explicit generators, or named storage types.
64
63
 
65
- The refined surface keeps domain meaning close to the model:
66
- - field-level `id()` and `unique()` for the common single-field case
67
- - portable helper presets such as `field.id.uuidv4()`, `field.id.uuidv7()`, `field.id.nanoid({ size: 16 })`, `field.uuid()`, `field.nanoid({ size: 16 })`, `field.text()`, and `field.createdAt()`
68
- - field-local `.sql({ column | id | unique })` and belongsTo-local `.sql({ fk })` overlays for one-off storage detail
69
- - an optional integrated callback form where `defineContract(config, ({ type, field, model, rel }) => ...)` exposes composition-shaped `type.*` and pack-owned `field.*` helper namespaces
70
- - `.attributes(...)` for compound `id` and compound `unique`
71
- - optional staged `.relations(...)` for mutually recursive model graphs
72
- - model-level `.sql(...)` for table naming, indexes, and advanced fallback storage detail
64
+ Built-in ID helpers from `@prisma-next/ids` already return the generated-field spec accepted by `field.generated(...)`, so `field.generated(uuidv4())` is a valid structural DSL call.
73
65
 
74
66
  ```typescript
67
+ import { textColumn, timestamptzColumn } from '@prisma-next/adapter-postgres/column-types';
68
+ import sqlFamily from '@prisma-next/family-sql/pack';
69
+ import { uuidv4 } from '@prisma-next/ids';
75
70
  import { defineContract, field, model, rel } from '@prisma-next/sql-contract-ts/contract-builder';
76
71
  import postgresPack from '@prisma-next/target-postgres/pack';
77
72
 
78
73
  const User = model('User', {
79
74
  fields: {
80
- id: field.id.uuidv7().sql({ id: { name: 'app_user_pkey' } }),
81
- email: field.text().unique().sql({ unique: { name: 'app_user_email_key' } }),
82
- createdAt: field.createdAt(),
75
+ id: field.generated(uuidv4()).id(),
76
+ email: field.column(textColumn).unique(),
77
+ createdAt: field.column(timestamptzColumn).defaultSql('now()'),
83
78
  },
84
- });
79
+ })
80
+ .relations({
81
+ posts: rel.hasMany('Post', { by: 'userId' }),
82
+ })
83
+ .sql({
84
+ table: 'app_user',
85
+ });
85
86
 
86
87
  const Post = model('Post', {
87
88
  fields: {
88
- id: field.id.uuidv7(),
89
- userId: field.uuid(),
90
- title: field.text(),
89
+ id: field.generated(uuidv4()).id(),
90
+ userId: field.column(textColumn),
91
+ title: field.column(textColumn),
91
92
  },
92
- });
93
+ })
94
+ .relations({
95
+ user: rel.belongsTo(User, { from: 'userId', to: 'id' }),
96
+ })
97
+ .sql({
98
+ table: 'blog_post',
99
+ });
93
100
 
94
101
  export const contract = defineContract({
102
+ family: sqlFamily,
95
103
  target: postgresPack,
96
104
  naming: { tables: 'snake_case', columns: 'snake_case' },
97
105
  models: {
98
- User: User.relations({
99
- posts: rel.hasMany(Post, { by: 'userId' }),
100
- }).sql({
101
- table: 'app_user',
102
- }),
103
- Post: Post.relations({
104
- user: rel
105
- .belongsTo(User, { from: 'userId', to: 'id' })
106
- .sql({ fk: { name: 'blog_post_user_id_fkey', onDelete: 'cascade' } }),
107
- }).sql({
108
- table: 'blog_post',
109
- }),
106
+ User,
107
+ Post,
110
108
  },
111
109
  });
112
110
  ```
113
111
 
114
- If you want the helper vocabulary to be wired directly into the contract shell, use the callback overload:
112
+ ### Callback Helper Vocabulary
113
+
114
+ Pack-provided helper presets are available through the callback overload. This is the surface that exposes `field.id.*`, `field.text()`, `field.createdAt()`, and `type.*`.
115
115
 
116
116
  ```typescript
117
117
  import pgvector from '@prisma-next/extension-pgvector/pack';
118
+ import sqlFamily from '@prisma-next/family-sql/pack';
118
119
  import { defineContract } from '@prisma-next/sql-contract-ts/contract-builder';
119
120
  import postgresPack from '@prisma-next/target-postgres/pack';
120
121
 
121
122
  export const contract = defineContract(
122
123
  {
124
+ family: sqlFamily,
123
125
  target: postgresPack,
124
126
  extensionPacks: { pgvector },
125
127
  },
@@ -135,15 +137,28 @@ export const contract = defineContract(
135
137
  role: field.namedType(types.Role),
136
138
  embedding: field.namedType(types.Embedding1536).optional(),
137
139
  },
138
- }).sql({
139
- table: 'user',
140
+ });
141
+
142
+ const Post = model('Post', {
143
+ fields: {
144
+ id: field.id.uuidv7(),
145
+ authorId: field.uuid(),
146
+ title: field.text(),
147
+ },
140
148
  });
141
149
 
142
150
  return {
143
151
  types,
144
152
  models: {
145
153
  User: User.relations({
146
- posts: rel.hasMany(() => Post, { by: 'authorId' }),
154
+ posts: rel.hasMany(Post, { by: 'authorId' }),
155
+ }).sql({
156
+ table: 'user',
157
+ }),
158
+ Post: Post.relations({
159
+ author: rel.belongsTo(User, { from: 'authorId', to: 'id' }),
160
+ }).sql({
161
+ table: 'post',
147
162
  }),
148
163
  },
149
164
  };
@@ -151,7 +166,9 @@ export const contract = defineContract(
151
166
  );
152
167
  ```
153
168
 
154
- Compound model-level constraints live in `.attributes(...)`:
169
+ ### Constraint Placement
170
+
171
+ Single-field constraints are usually most readable inline on the field, while compound constraints live in `.attributes(...)` or model-level `.sql(...)`.
155
172
 
156
173
  ```typescript
157
174
  const Membership = model('Membership', {
@@ -172,94 +189,34 @@ const Membership = model('Membership', {
172
189
  .sql({ table: 'membership' });
173
190
  ```
174
191
 
175
- This first slice now includes a small portable helper vocabulary:
176
-
177
- - use `field.id.uuidv4()` or `field.id.uuidv7()` for single-field UUID primary keys with explicit generator choice
178
- - use `field.id.nanoid({ size })`, `field.id.ulid()`, `field.id.cuid2()`, and `field.id.ksuid()` for other generated primary-key strategies
179
- - use `field.uuid()` for portable UUID-shaped foreign keys and other scalar fields
180
- - use `field.nanoid({ size })`, `field.ulid()`, `field.cuid2()`, and `field.ksuid()` when you want those scalar storage shapes without generation
181
- - use `field.text()`, `field.timestamp()`, and `field.createdAt()` for portable common SQL scalars
182
- - use `field.sql({ column | id | unique })` and belongsTo-local `.sql({ fk })` when the storage override belongs next to one field or one FK
183
- - use pack-provided column descriptors with `field.column(...)` when you need target-specific types
184
- - use generated-column specs with `field.generated(...)` when you want explicit generator control
185
- - use root `types` directly with `field.namedType(types.Role)` for `storage.types` references
186
- - `field.namedType('Role')` still works as a fallback, but when `types.Role` exists in the same contract the builder emits `PN_CONTRACT_TYPED_FALLBACK_AVAILABLE`; prefer `field.namedType(types.Role)` for autocomplete and typed local refs
187
- - use the callback overload when you want target- and extension-composed `type.*` and pack-owned `field.*` helper autocomplete inside `contract.ts`
188
- - use named model tokens plus `User.refs.id` or `User.ref('id')` for cross-model foreign-key targets
189
- - `constraints.ref('Model', 'field')` still works as a fallback, but when the named model token exists in the same contract the builder emits `PN_CONTRACT_TYPED_FALLBACK_AVAILABLE`; prefer `User.refs.id`-style refs for autocomplete and typed model refs
190
- - string relation targets such as `rel.belongsTo('User', ...)`, `rel.hasMany('Post', ...)`, and `rel.manyToMany('Tag', { through: 'PostTag', ... })` still work, but when named model tokens exist in the same contract the builder emits `PN_CONTRACT_TYPED_FALLBACK_AVAILABLE`; prefer model tokens so cross-model authoring stays typed end-to-end
191
- - use inline `.id()` for single-field identity and `.attributes(({ fields, constraints }) => ({ id: constraints.id([...]) }))` for compound identity
192
- - use inline `.unique()` for single-field uniqueness and `.attributes(({ fields, constraints }) => ({ uniques: [constraints.unique([...])] }))` for compound uniqueness
193
- - duplicate named primary keys, uniques, indexes, and foreign keys are rejected during build/validation instead of silently overriding each other
194
-
195
- #### Legacy Chain Builder
196
-
197
- ```typescript
198
- import { defineContract } from '@prisma-next/sql-contract-ts/contract-builder';
199
- import postgresPack from '@prisma-next/target-postgres/pack';
200
- import pgvector from '@prisma-next/extension-pgvector/pack';
201
- import { enumColumn, enumType, int4Column, textColumn } from '@prisma-next/adapter-postgres/column-types';
202
-
203
- const contract = defineContract()
204
- .target(postgresPack)
205
- .extensionPacks({ pgvector })
206
- .storageType('Role', enumType('role', ['USER', 'ADMIN']))
207
- .table('user', (t) =>
208
- t
209
- .column('id', { type: int4Column, nullable: false })
210
- .column('email', { type: textColumn, nullable: false })
211
- .column('role', { type: enumColumn('Role', 'role') })
212
- .primaryKey(['id'], 'user_pkey') // Named primary key
213
- .unique(['email'], 'user_email_unique') // Named unique constraint
214
- .index(['email'], 'user_email_idx'), // Named index
215
- )
216
- .table('post', (t) =>
217
- t
218
- .column('id', { type: int4Column, nullable: false })
219
- .column('userId', { type: int4Column, nullable: false })
220
- .column('title', { type: textColumn, nullable: false })
221
- .primaryKey(['id'])
222
- .foreignKey(['userId'], { table: 'user', columns: ['id'] }, 'post_userId_fkey'), // Named FK
223
- )
224
- .model('User', 'user', (m) => m.field('id', 'id').field('email', 'email'))
225
- .model('Post', 'post', (m) => m.field('id', 'id').field('userId', 'userId').field('title', 'title'))
226
- .foreignKeys({ constraints: true, indexes: false }) // Optional FK config
227
- .build();
228
- ```
229
-
230
- #### Table Builder Methods
231
-
232
- The table builder supports the following constraint methods:
192
+ ### Helper Notes
233
193
 
234
- | Method | Description |
235
- |--------|-------------|
236
- | `.primaryKey(columns, name?)` | Define primary key with optional name |
237
- | `.unique(columns, name?)` | Add unique constraint with optional name |
238
- | `.index(columns, name?)` | Add index with optional name |
239
- | `.foreignKey(columns, references, name?)` | Add foreign key with optional name |
194
+ - Structural helpers: `field.column(...)`, `field.generated(...)`, `field.namedType(...)`, plus `model(...)` and `rel.*`
195
+ - Callback helper presets: `field.id.uuidv4()`, `field.id.uuidv7()`, `field.id.nanoid({ size })`, `field.uuid()`, `field.text()`, `field.timestamp()`, `field.createdAt()`, and `type.*`
196
+ - Keep field-local and FK-local storage overrides next to the authoring site with `field.sql(...)` and `rel.belongsTo(...).sql({ fk })`
197
+ - Prefer typed local refs such as `field.namedType(types.Role)`, `User.refs.id`, and `User.ref('id')` when those tokens are available
198
+ - See [API.md](./API.md) for generated-field spec semantics, validation rules, and typed-reference warning behavior
240
199
 
241
- #### Contract-Level Foreign Key Configuration
200
+ ### Foreign Key Defaults
242
201
 
243
- The builder supports a `.foreignKeys()` method to control FK constraint and index emission:
202
+ Use the root-level `foreignKeyDefaults` option when a contract wants non-default FK materialization:
244
203
 
245
204
  ```typescript
246
- const contract = defineContract<CodecTypes>()
247
- .target(postgresPack)
248
- // ...tables and models...
249
- .foreignKeys({ constraints: true, indexes: false }) // Emit FK constraints but skip backing indexes
250
- .build();
205
+ const contract = defineContract({
206
+ family: sqlFamily,
207
+ target: postgresPack,
208
+ foreignKeyDefaults: { constraint: true, index: false },
209
+ models: {
210
+ // ...
211
+ },
212
+ });
251
213
  ```
252
214
 
253
- | Config | Default | Description |
254
- |--------|---------|-------------|
255
- | `constraints` | `true` | Emit `FOREIGN KEY` constraints in DDL |
256
- | `indexes` | `true` | Emit FK-backing indexes (e.g., `CREATE INDEX ... ON post (user_id)`) |
257
-
258
- When `.foreignKeys()` is not called, defaults to `{ constraints: true, indexes: true }`. See [ADR 161](../../../docs/architecture%20docs/adrs/ADR%20161%20-%20Explicit%20foreign%20key%20constraint%20and%20index%20configuration.md).
215
+ Per-FK overrides still live next to the FK authoring site, either via `constraints.foreignKey(...)` inside model `.sql(...)` or via `rel.belongsTo(...).sql({ fk: ... })`. See [ADR 161](../../../../docs/architecture%20docs/adrs/ADR%20161%20-%20Explicit%20foreign%20key%20constraint%20and%20index%20configuration.md).
259
216
 
260
217
  ### Validating Contracts
261
218
 
262
- Contract JSON validation now lives in `@prisma-next/sql-contract/validate` (shared plane), while this package focuses on authoring/building contracts.
219
+ Contract JSON validation lives in `@prisma-next/sql-contract/validate`, while this package focuses on authoring and lowering.
263
220
 
264
221
  ```typescript
265
222
  import { validateContract } from '@prisma-next/sql-contract/validate';
@@ -278,34 +235,30 @@ import { typescriptContract } from '@prisma-next/sql-contract-ts/config-types';
278
235
  import { contract } from './src/prisma/contract';
279
236
 
280
237
  export default defineConfig({
281
- // ...
282
238
  contract: typescriptContract(contract, 'src/prisma/contract.json'),
283
239
  });
284
240
  ```
285
241
 
286
242
  ## Dependencies
287
243
 
288
- - **`@prisma-next/contract-authoring`** - Target-agnostic builder core (builder state types, builder classes, type helpers)
289
- - **`@prisma-next/contract`** - Core contract types (`ContractBase`)
290
- - **`@prisma-next/core-control-plane`** - Contract config types used by `typescriptContract`
291
- - **`@prisma-next/sql-contract`** - SQL contract types (`SqlContract`, `SqlStorage`, `SqlModelStorage`)
292
- - **`arktype`** - Runtime validation
293
- - **`ts-toolbelt`** - Type utilities
244
+ - **`@prisma-next/config`** - `ContractConfig` types used by `typescriptContract(...)`
245
+ - **`@prisma-next/contract-authoring`** - Shared descriptor types
246
+ - **`@prisma-next/framework-components`** - Pack refs, authoring contributions, and codec lookup types
247
+ - **`@prisma-next/sql-contract`** - SQL contract types and validation target
294
248
 
295
249
  ## Testing
296
250
 
297
- Integration tests that depend on both `sql-contract-ts` and `sql-query` are located in `@prisma-next/integration-tests` to avoid cyclic dependencies.
251
+ Unit tests for the authoring DSL live in this package. Broader integration tests that span authoring, emission, CLI, and runtime packages live in `@prisma-next/integration-tests`.
298
252
 
299
253
  ## Migration Notes
300
254
 
301
- - **Staged contract DSL is the long-term direction**: `defineContract({ ... })` plus `model('User', { fields, relations }).sql(...)`
302
- - **The first slice keeps the helper vocabulary intentionally small**: prefer pack-provided descriptors over a large built-in preset surface for now
303
- - **Backward Compatibility**: `@prisma-next/sql-query` re-exports contract authoring functions for backward compatibility (will be removed in Slice 7)
304
- - **Import Path**: New code should import directly from `@prisma-next/sql-contract-ts`
305
- - **Phase 2 Complete**: The target-agnostic core has been extracted to `@prisma-next/contract-authoring`. This package composes the generic core with SQL-specific types.
255
+ - Direct imports give you the structural DSL
256
+ - The callback overload gives you pack-composed helper vocabularies
257
+ - Import authoring helpers directly from `@prisma-next/sql-contract-ts`
258
+ - Import validation from `@prisma-next/sql-contract/validate`
306
259
 
307
260
  ## See Also
308
261
 
309
- - `@prisma-next/contract-authoring` - Target-agnostic builder core that this package composes
310
- - `@prisma-next/sql-contract-psl` - PSL parser-output to SQL `ContractIR` interpreter for provider-based flows
311
- - `@prisma-next/sql-contract-psl/provider` - SQL PSL-first `prismaContract()` helper (read -> parse -> interpret)
262
+ - `@prisma-next/contract-authoring` - Shared target-neutral authoring descriptor types
263
+ - `@prisma-next/sql-contract-psl` - PSL parser-output to SQL contract interpreter
264
+ - `@prisma-next/sql-contract-psl/provider` - SQL PSL-first `prismaContract()` helper
@@ -1,8 +1,8 @@
1
+ import { Contract } from "@prisma-next/contract/types";
1
2
  import { ContractConfig, ContractConfig as ContractConfig$1 } from "@prisma-next/config/config-types";
2
- import { ContractIR } from "@prisma-next/contract/ir";
3
3
 
4
4
  //#region src/config-types.d.ts
5
- declare function typescriptContract(contractIR: ContractIR, output?: string): ContractConfig$1;
5
+ declare function typescriptContract(contract: Contract, output?: string): ContractConfig$1;
6
6
  //#endregion
7
7
  export { type ContractConfig, typescriptContract };
8
8
  //# sourceMappingURL=config-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.d.mts","names":[],"sources":["../src/config-types.ts"],"sourcesContent":[],"mappings":";;;;iBAKgB,kBAAA,aAA+B,8BAA8B"}
1
+ {"version":3,"file":"config-types.d.mts","names":[],"sources":["../src/config-types.ts"],"sourcesContent":[],"mappings":";;;;iBAKgB,kBAAA,WAA6B,4BAA4B"}
@@ -2,9 +2,9 @@ import { ifDefined } from "@prisma-next/utils/defined";
2
2
  import { ok } from "@prisma-next/utils/result";
3
3
 
4
4
  //#region src/config-types.ts
5
- function typescriptContract(contractIR, output) {
5
+ function typescriptContract(contract, output) {
6
6
  return {
7
- source: async (_context) => ok(contractIR),
7
+ source: async (_context) => ok(contract),
8
8
  ...ifDefined("output", output)
9
9
  };
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.mjs","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["import type { ContractConfig } from '@prisma-next/config/config-types';\nimport type { ContractIR } from '@prisma-next/contract/ir';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { ok } from '@prisma-next/utils/result';\n\nexport function typescriptContract(contractIR: ContractIR, output?: string): ContractConfig {\n return {\n source: async (_context) => ok(contractIR),\n ...ifDefined('output', output),\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAAmB,YAAwB,QAAiC;AAC1F,QAAO;EACL,QAAQ,OAAO,aAAa,GAAG,WAAW;EAC1C,GAAG,UAAU,UAAU,OAAO;EAC/B"}
1
+ {"version":3,"file":"config-types.mjs","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["import type { ContractConfig } from '@prisma-next/config/config-types';\nimport type { Contract } from '@prisma-next/contract/types';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { ok } from '@prisma-next/utils/result';\n\nexport function typescriptContract(contract: Contract, output?: string): ContractConfig {\n return {\n source: async (_context) => ok(contract),\n ...ifDefined('output', output),\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAAmB,UAAoB,QAAiC;AACtF,QAAO;EACL,QAAQ,OAAO,aAAa,GAAG,SAAS;EACxC,GAAG,UAAU,UAAU,OAAO;EAC/B"}