@prisma-next/sql-contract 0.5.0-dev.82 → 0.5.0-dev.83
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/factories.d.mts +1 -1
- package/dist/index-type-validation.d.mts +1 -1
- package/dist/types-hgzy8ME1.mjs.map +1 -1
- package/dist/{types-BTYquqSU.d.mts → types-njsiV-Ck.d.mts} +3 -8
- package/dist/types-njsiV-Ck.d.mts.map +1 -0
- package/dist/types.d.mts +2 -2
- package/dist/validate.d.mts +1 -1
- package/dist/validators.d.mts +1 -1
- package/package.json +4 -4
- package/src/exports/types.ts +0 -2
- package/src/types.ts +0 -12
- package/dist/types-BTYquqSU.d.mts.map +0 -1
package/dist/factories.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as UniqueConstraint, O as StorageColumn, T as SqlModelStorage, f as ForeignKey, g as PrimaryKey, h as Index, k as StorageTable, p as ForeignKeyOptions, w as SqlModelFieldStorage } from "./types-njsiV-Ck.mjs";
|
|
2
2
|
import { ScalarFieldType } from "@prisma-next/contract/types";
|
|
3
3
|
|
|
4
4
|
//#region src/factories.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-hgzy8ME1.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { ColumnDefault, StorageBase } from '@prisma-next/contract/types';\nimport type { CodecTrait } from '@prisma-next/framework-components/codec';\n\n/**\n * A column definition in storage.\n *\n * `typeParams` is optional because most columns use non-parameterized types.\n * Columns with parameterized types can either inline `typeParams` or reference\n * a named {@link StorageTypeInstance} via `typeRef`.\n */\nexport type StorageColumn = {\n readonly nativeType: string;\n readonly codecId: string;\n readonly nullable: boolean;\n /**\n * Opaque, codec-owned JS/type parameters.\n * The codec that owns `codecId` defines the shape and semantics.\n * Mutually exclusive with `typeRef`.\n */\n readonly typeParams?: Record<string, unknown>;\n /**\n * Reference to a named type instance in `storage.types`.\n * Mutually exclusive with `typeParams`.\n */\n readonly typeRef?: string;\n /**\n * Default value for the column.\n * Can be a literal value or database function.\n */\n readonly default?: ColumnDefault;\n};\n\nexport type PrimaryKey = {\n readonly columns: readonly string[];\n readonly name?: string;\n};\n\nexport type UniqueConstraint = {\n readonly columns: readonly string[];\n readonly name?: string;\n};\n\nexport type Index = {\n readonly columns: readonly string[];\n readonly name?: string;\n readonly type?: string;\n readonly options?: Record<string, unknown>;\n};\n\nexport type ForeignKeyReferences = {\n readonly table: string;\n readonly columns: readonly string[];\n};\n\nexport type ReferentialAction = 'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault';\n\nexport type ForeignKeyOptions = {\n readonly name?: string;\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n};\n\nexport type ForeignKey = {\n readonly columns: readonly string[];\n readonly references: ForeignKeyReferences;\n readonly name?: string;\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n /** Whether to emit FK constraint DDL (ALTER TABLE … ADD CONSTRAINT … FOREIGN KEY). */\n readonly constraint: boolean;\n /** Whether to emit a backing index for the FK columns. */\n readonly index: boolean;\n};\n\nexport type StorageTable = {\n readonly columns: Record<string, StorageColumn>;\n readonly primaryKey?: PrimaryKey;\n readonly uniques: ReadonlyArray<UniqueConstraint>;\n readonly indexes: ReadonlyArray<Index>;\n readonly foreignKeys: ReadonlyArray<ForeignKey>;\n};\n\n/**\n * A named, parameterized type instance.\n * These are registered in `storage.types` for reuse across columns\n * and to enable ergonomic schema surfaces like `schema.types.MyType`.\n *\n * Unlike {@link StorageColumn}, `typeParams` is required here because\n * `StorageTypeInstance` exists specifically to define reusable parameterized types.\n * A type instance without parameters would be redundant—columns can reference\n * the codec directly via `codecId`.\n */\nexport type StorageTypeInstance = {\n readonly codecId: string;\n readonly nativeType: string;\n readonly typeParams: Record<string, unknown>;\n};\n\nexport type SqlStorage<THash extends string = string> = StorageBase<THash> & {\n readonly tables: Record<string, StorageTable>;\n /**\n * Named type instances for parameterized/custom types.\n * Columns can reference these via `typeRef`.\n */\n readonly types?: Record<string, StorageTypeInstance>;\n};\n\nexport type SqlModelFieldStorage = {\n readonly column: string;\n readonly codecId?: string;\n readonly nullable?: boolean;\n};\n\nexport type SqlModelStorage = {\n readonly table: string;\n readonly fields: Record<string, SqlModelFieldStorage>;\n};\n\nexport const DEFAULT_FK_CONSTRAINT = true;\nexport const DEFAULT_FK_INDEX = true;\n\nexport function applyFkDefaults(\n fk: { constraint?: boolean | undefined; index?: boolean | undefined },\n overrideDefaults?: { constraint?: boolean | undefined; index?: boolean | undefined },\n): { constraint: boolean; index: boolean } {\n return {\n constraint: fk.constraint ?? overrideDefaults?.constraint ?? DEFAULT_FK_CONSTRAINT,\n index: fk.index ?? overrideDefaults?.index ?? DEFAULT_FK_INDEX,\n };\n}\n\nexport type TypeMaps<\n TCodecTypes extends Record<string, { output: unknown }> = Record<string, never>,\n
|
|
1
|
+
{"version":3,"file":"types-hgzy8ME1.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { ColumnDefault, StorageBase } from '@prisma-next/contract/types';\nimport type { CodecTrait } from '@prisma-next/framework-components/codec';\n\n/**\n * A column definition in storage.\n *\n * `typeParams` is optional because most columns use non-parameterized types.\n * Columns with parameterized types can either inline `typeParams` or reference\n * a named {@link StorageTypeInstance} via `typeRef`.\n */\nexport type StorageColumn = {\n readonly nativeType: string;\n readonly codecId: string;\n readonly nullable: boolean;\n /**\n * Opaque, codec-owned JS/type parameters.\n * The codec that owns `codecId` defines the shape and semantics.\n * Mutually exclusive with `typeRef`.\n */\n readonly typeParams?: Record<string, unknown>;\n /**\n * Reference to a named type instance in `storage.types`.\n * Mutually exclusive with `typeParams`.\n */\n readonly typeRef?: string;\n /**\n * Default value for the column.\n * Can be a literal value or database function.\n */\n readonly default?: ColumnDefault;\n};\n\nexport type PrimaryKey = {\n readonly columns: readonly string[];\n readonly name?: string;\n};\n\nexport type UniqueConstraint = {\n readonly columns: readonly string[];\n readonly name?: string;\n};\n\nexport type Index = {\n readonly columns: readonly string[];\n readonly name?: string;\n readonly type?: string;\n readonly options?: Record<string, unknown>;\n};\n\nexport type ForeignKeyReferences = {\n readonly table: string;\n readonly columns: readonly string[];\n};\n\nexport type ReferentialAction = 'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault';\n\nexport type ForeignKeyOptions = {\n readonly name?: string;\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n};\n\nexport type ForeignKey = {\n readonly columns: readonly string[];\n readonly references: ForeignKeyReferences;\n readonly name?: string;\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n /** Whether to emit FK constraint DDL (ALTER TABLE … ADD CONSTRAINT … FOREIGN KEY). */\n readonly constraint: boolean;\n /** Whether to emit a backing index for the FK columns. */\n readonly index: boolean;\n};\n\nexport type StorageTable = {\n readonly columns: Record<string, StorageColumn>;\n readonly primaryKey?: PrimaryKey;\n readonly uniques: ReadonlyArray<UniqueConstraint>;\n readonly indexes: ReadonlyArray<Index>;\n readonly foreignKeys: ReadonlyArray<ForeignKey>;\n};\n\n/**\n * A named, parameterized type instance.\n * These are registered in `storage.types` for reuse across columns\n * and to enable ergonomic schema surfaces like `schema.types.MyType`.\n *\n * Unlike {@link StorageColumn}, `typeParams` is required here because\n * `StorageTypeInstance` exists specifically to define reusable parameterized types.\n * A type instance without parameters would be redundant—columns can reference\n * the codec directly via `codecId`.\n */\nexport type StorageTypeInstance = {\n readonly codecId: string;\n readonly nativeType: string;\n readonly typeParams: Record<string, unknown>;\n};\n\nexport type SqlStorage<THash extends string = string> = StorageBase<THash> & {\n readonly tables: Record<string, StorageTable>;\n /**\n * Named type instances for parameterized/custom types.\n * Columns can reference these via `typeRef`.\n */\n readonly types?: Record<string, StorageTypeInstance>;\n};\n\nexport type SqlModelFieldStorage = {\n readonly column: string;\n readonly codecId?: string;\n readonly nullable?: boolean;\n};\n\nexport type SqlModelStorage = {\n readonly table: string;\n readonly fields: Record<string, SqlModelFieldStorage>;\n};\n\nexport const DEFAULT_FK_CONSTRAINT = true;\nexport const DEFAULT_FK_INDEX = true;\n\nexport function applyFkDefaults(\n fk: { constraint?: boolean | undefined; index?: boolean | undefined },\n overrideDefaults?: { constraint?: boolean | undefined; index?: boolean | undefined },\n): { constraint: boolean; index: boolean } {\n return {\n constraint: fk.constraint ?? overrideDefaults?.constraint ?? DEFAULT_FK_CONSTRAINT,\n index: fk.index ?? overrideDefaults?.index ?? DEFAULT_FK_INDEX,\n };\n}\n\nexport type TypeMaps<\n TCodecTypes extends Record<string, { output: unknown }> = Record<string, never>,\n TQueryOperationTypes extends Record<string, unknown> = Record<string, never>,\n TFieldOutputTypes extends Record<string, Record<string, unknown>> = Record<string, never>,\n TFieldInputTypes extends Record<string, Record<string, unknown>> = Record<string, never>,\n> = {\n readonly codecTypes: TCodecTypes;\n readonly queryOperationTypes: TQueryOperationTypes;\n readonly fieldOutputTypes: TFieldOutputTypes;\n readonly fieldInputTypes: TFieldInputTypes;\n};\n\nexport type CodecTypesOf<T> = [T] extends [never]\n ? Record<string, never>\n : T extends { readonly codecTypes: infer C }\n ? C extends Record<string, { output: unknown }>\n ? C\n : Record<string, never>\n : Record<string, never>;\n\n/**\n * Dispatch hint identifying the first-argument target of an operation.\n *\n * Used by ORM column helpers to decide whether an operation is reachable on a\n * field. Either names a concrete codec identity or a set of capability traits\n * that the field's codec must carry.\n */\nexport type QueryOperationSelfSpec =\n | { readonly codecId: string; readonly traits?: never }\n | { readonly traits: readonly CodecTrait[]; readonly codecId?: never };\n\n/**\n * Structural shape an operation's impl must return: any value carrying a\n * codec-exact `returnType` descriptor. `Expression<T>` (from\n * `@prisma-next/sql-relational-core/expression`, with `T extends ScopeField`)\n * extends this. Trait-targeted returns are deliberately excluded — predicate\n * detection and result decoding both depend on knowing the concrete return\n * codec.\n */\nexport type QueryOperationReturn = {\n readonly returnType: { readonly codecId: string; readonly nullable: boolean };\n};\n\nexport type QueryOperationTypeEntry = {\n readonly self?: QueryOperationSelfSpec;\n readonly impl: (...args: never[]) => QueryOperationReturn;\n};\n\nexport type SqlQueryOperationTypes<\n _CT extends Record<string, { readonly input: unknown; readonly output: unknown }>,\n T extends Record<string, QueryOperationTypeEntry>,\n> = T;\n\nexport type QueryOperationTypesBase = Record<string, QueryOperationTypeEntry>;\n\nexport type QueryOperationTypesOf<T> = [T] extends [never]\n ? Record<string, never>\n : T extends { readonly queryOperationTypes: infer Q }\n ? Q extends Record<string, unknown>\n ? Q\n : Record<string, never>\n : Record<string, never>;\n\nexport type TypeMapsPhantomKey = '__@prisma-next/sql-contract/typeMaps@__';\n\nexport type ContractWithTypeMaps<TContract, TTypeMaps> = TContract & {\n readonly [K in TypeMapsPhantomKey]?: TTypeMaps;\n};\n\nexport type ExtractTypeMapsFromContract<T> = TypeMapsPhantomKey extends keyof T\n ? NonNullable<T[TypeMapsPhantomKey & keyof T]>\n : never;\n\nexport type FieldOutputTypesOf<T> = [T] extends [never]\n ? Record<string, never>\n : T extends { readonly fieldOutputTypes: infer F }\n ? F extends Record<string, Record<string, unknown>>\n ? F\n : Record<string, never>\n : Record<string, never>;\n\nexport type FieldInputTypesOf<T> = [T] extends [never]\n ? Record<string, never>\n : T extends { readonly fieldInputTypes: infer F }\n ? F extends Record<string, Record<string, unknown>>\n ? F\n : Record<string, never>\n : Record<string, never>;\n\nexport type ExtractCodecTypes<T> = CodecTypesOf<ExtractTypeMapsFromContract<T>>;\nexport type ExtractQueryOperationTypes<T> = QueryOperationTypesOf<ExtractTypeMapsFromContract<T>>;\nexport type ExtractFieldOutputTypes<T> = FieldOutputTypesOf<ExtractTypeMapsFromContract<T>>;\nexport type ExtractFieldInputTypes<T> = FieldInputTypesOf<ExtractTypeMapsFromContract<T>>;\n\nexport type ResolveCodecTypes<TContract, TTypeMaps> = [TTypeMaps] extends [never]\n ? ExtractCodecTypes<TContract>\n : CodecTypesOf<TTypeMaps>;\n"],"mappings":";AAsHA,MAAa,wBAAwB;AACrC,MAAa,mBAAmB;AAEhC,SAAgB,gBACd,IACA,kBACyC;CACzC,OAAO;EACL,YAAY,GAAG,cAAc,kBAAkB,cAAA;EAC/C,OAAO,GAAG,SAAS,kBAAkB,SAAA;EACtC"}
|
|
@@ -116,9 +116,8 @@ declare function applyFkDefaults(fk: {
|
|
|
116
116
|
};
|
|
117
117
|
type TypeMaps<TCodecTypes extends Record<string, {
|
|
118
118
|
output: unknown;
|
|
119
|
-
}> = Record<string, never>,
|
|
119
|
+
}> = Record<string, never>, TQueryOperationTypes extends Record<string, unknown> = Record<string, never>, TFieldOutputTypes extends Record<string, Record<string, unknown>> = Record<string, never>, TFieldInputTypes extends Record<string, Record<string, unknown>> = Record<string, never>> = {
|
|
120
120
|
readonly codecTypes: TCodecTypes;
|
|
121
|
-
readonly operationTypes: TOperationTypes;
|
|
122
121
|
readonly queryOperationTypes: TQueryOperationTypes;
|
|
123
122
|
readonly fieldOutputTypes: TFieldOutputTypes;
|
|
124
123
|
readonly fieldInputTypes: TFieldInputTypes;
|
|
@@ -128,9 +127,6 @@ type CodecTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends {
|
|
|
128
127
|
} ? C extends Record<string, {
|
|
129
128
|
output: unknown;
|
|
130
129
|
}> ? C : Record<string, never> : Record<string, never>;
|
|
131
|
-
type OperationTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends {
|
|
132
|
-
readonly operationTypes: infer O;
|
|
133
|
-
} ? O extends Record<string, unknown> ? O : Record<string, never> : Record<string, never>;
|
|
134
130
|
/**
|
|
135
131
|
* Dispatch hint identifying the first-argument target of an operation.
|
|
136
132
|
*
|
|
@@ -185,7 +181,6 @@ type ExtractQueryOperationTypes<T> = QueryOperationTypesOf<ExtractTypeMapsFromCo
|
|
|
185
181
|
type ExtractFieldOutputTypes<T> = FieldOutputTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
186
182
|
type ExtractFieldInputTypes<T> = FieldInputTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
187
183
|
type ResolveCodecTypes<TContract, TTypeMaps> = [TTypeMaps] extends [never] ? ExtractCodecTypes<TContract> : CodecTypesOf<TTypeMaps>;
|
|
188
|
-
type ResolveOperationTypes<_TContract, TTypeMaps> = OperationTypesOf<TTypeMaps>;
|
|
189
184
|
//#endregion
|
|
190
|
-
export {
|
|
191
|
-
//# sourceMappingURL=types-
|
|
185
|
+
export { StorageTypeInstance as A, ResolveCodecTypes as C, SqlStorage as D, SqlQueryOperationTypes as E, TypeMapsPhantomKey as M, UniqueConstraint as N, StorageColumn as O, applyFkDefaults as P, ReferentialAction as S, SqlModelStorage as T, QueryOperationReturn as _, ExtractCodecTypes as a, QueryOperationTypesBase as b, ExtractQueryOperationTypes as c, FieldOutputTypesOf as d, ForeignKey as f, PrimaryKey as g, Index as h, DEFAULT_FK_INDEX as i, TypeMaps as j, StorageTable as k, ExtractTypeMapsFromContract as l, ForeignKeyReferences as m, ContractWithTypeMaps as n, ExtractFieldInputTypes as o, ForeignKeyOptions as p, DEFAULT_FK_CONSTRAINT as r, ExtractFieldOutputTypes as s, CodecTypesOf as t, FieldInputTypesOf as u, QueryOperationSelfSpec as v, SqlModelFieldStorage as w, QueryOperationTypesOf as x, QueryOperationTypeEntry as y };
|
|
186
|
+
//# sourceMappingURL=types-njsiV-Ck.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-njsiV-Ck.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;AAUA;;;;;KAAY,aAAA;EAAA,SACD,UAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;EAWA;;;;;EAAA,SALA,UAAA,GAAa,MAAA;EAaF;;;;EAAA,SARX,OAAA;EAaiB;;;;EAAA,SARjB,OAAA,GAAU,aAAA;AAAA;AAAA,KAGT,UAAA;EAAA,SACD,OAAA;EAAA,SACA,IAAA;AAAA;AAAA,KAGC,gBAAA;EAAA,SACD,OAAA;EAAA,SACA,IAAA;AAAA;AAAA,KA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,kBAAA,eAAiC,CAAA,GAC1E,WAAA,CAAY,CAAA,CAAE,kBAAA,SAA2B,CAAA;AAAA,KAGjC,kBAAA,OAAyB,CAAA,oBACjC,MAAA,kBACA,CAAA;EAAA,SAAqB,gBAAA;AAAA,IACnB,CAAA,SAAU,MAAA,SAAe,MAAA,qBACvB,CAAA,GACA,MAAA,kBACF,MAAA;AAAA,KAEM,iBAAA,OAAwB,CAAA,oBAChC,MAAA,kBACA,CAAA;EAAA,SAAqB,eAAA;AAAA,IACnB,CAAA,SAAU,MAAA,SAAe,MAAA,qBACvB,CAAA,GACA,MAAA,kBACF,MAAA;AAAA,KAEM,iBAAA,MAAuB,YAAA,CAAa,2BAAA,CAA4B,CAAA;AAAA,KAChE,0BAAA,MAAgC,qBAAA,CAAsB,2BAAA,CAA4B,CAAA;AAAA,KAClF,uBAAA,MAA6B,kBAAA,CAAmB,2BAAA,CAA4B,CAAA;AAAA,KAC5E,sBAAA,MAA4B,iBAAA,CAAkB,2BAAA,CAA4B,CAAA;AAAA,KAE1E,iBAAA,0BAA2C,SAAA,oBACnD,iBAAA,CAAkB,SAAA,IAClB,YAAA,CAAa,SAAA"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { type CodecTypesOf, type ContractWithTypeMaps, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, type ExtractCodecTypes, type ExtractFieldInputTypes, type ExtractFieldOutputTypes, type ExtractQueryOperationTypes, type ExtractTypeMapsFromContract, type FieldInputTypesOf, type FieldOutputTypesOf, type ForeignKey, type ForeignKeyOptions, type ForeignKeyReferences, type Index, type
|
|
1
|
+
import { A as StorageTypeInstance, C as ResolveCodecTypes, D as SqlStorage, E as SqlQueryOperationTypes, M as TypeMapsPhantomKey, N as UniqueConstraint, O as StorageColumn, P as applyFkDefaults, S as ReferentialAction, T as SqlModelStorage, _ as QueryOperationReturn, a as ExtractCodecTypes, b as QueryOperationTypesBase, c as ExtractQueryOperationTypes, d as FieldOutputTypesOf, f as ForeignKey, g as PrimaryKey, h as Index, i as DEFAULT_FK_INDEX, j as TypeMaps, k as StorageTable, l as ExtractTypeMapsFromContract, m as ForeignKeyReferences, n as ContractWithTypeMaps, o as ExtractFieldInputTypes, p as ForeignKeyOptions, r as DEFAULT_FK_CONSTRAINT, s as ExtractFieldOutputTypes, t as CodecTypesOf, u as FieldInputTypesOf, v as QueryOperationSelfSpec, w as SqlModelFieldStorage, x as QueryOperationTypesOf, y as QueryOperationTypeEntry } from "./types-njsiV-Ck.mjs";
|
|
2
|
+
export { type CodecTypesOf, type ContractWithTypeMaps, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, type ExtractCodecTypes, type ExtractFieldInputTypes, type ExtractFieldOutputTypes, type ExtractQueryOperationTypes, type ExtractTypeMapsFromContract, type FieldInputTypesOf, type FieldOutputTypesOf, type ForeignKey, type ForeignKeyOptions, type ForeignKeyReferences, type Index, type PrimaryKey, type QueryOperationReturn, type QueryOperationSelfSpec, type QueryOperationTypeEntry, type QueryOperationTypesBase, type QueryOperationTypesOf, type ReferentialAction, type ResolveCodecTypes, type SqlModelFieldStorage, type SqlModelStorage, type SqlQueryOperationTypes, type SqlStorage, type StorageColumn, type StorageTable, type StorageTypeInstance, type TypeMaps, type TypeMapsPhantomKey, type UniqueConstraint, applyFkDefaults };
|
package/dist/validate.d.mts
CHANGED
package/dist/validators.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as SqlStorage, S as ReferentialAction, f as ForeignKey, m as ForeignKeyReferences } from "./types-njsiV-Ck.mjs";
|
|
2
2
|
import { Contract } from "@prisma-next/contract/types";
|
|
3
3
|
import * as _$arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
|
|
4
4
|
import * as _$arktype_internal_variants_string_ts0 from "arktype/internal/variants/string.ts";
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/sql-contract",
|
|
3
|
-
"version": "0.5.0-dev.
|
|
3
|
+
"version": "0.5.0-dev.83",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"description": "SQL contract types, validators, and IR factories for Prisma Next",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"arktype": "^2.1.29",
|
|
10
|
-
"@prisma-next/
|
|
11
|
-
"@prisma-next/
|
|
10
|
+
"@prisma-next/framework-components": "0.5.0-dev.83",
|
|
11
|
+
"@prisma-next/contract": "0.5.0-dev.83"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"tsdown": "0.22.0",
|
|
15
15
|
"typescript": "5.9.3",
|
|
16
16
|
"vitest": "4.1.5",
|
|
17
|
-
"@prisma-next/test-utils": "0.0.1",
|
|
18
17
|
"@prisma-next/tsconfig": "0.0.0",
|
|
18
|
+
"@prisma-next/test-utils": "0.0.1",
|
|
19
19
|
"@prisma-next/tsdown": "0.0.0"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
package/src/exports/types.ts
CHANGED
|
@@ -12,7 +12,6 @@ export type {
|
|
|
12
12
|
ForeignKeyOptions,
|
|
13
13
|
ForeignKeyReferences,
|
|
14
14
|
Index,
|
|
15
|
-
OperationTypesOf,
|
|
16
15
|
PrimaryKey,
|
|
17
16
|
QueryOperationReturn,
|
|
18
17
|
QueryOperationSelfSpec,
|
|
@@ -21,7 +20,6 @@ export type {
|
|
|
21
20
|
QueryOperationTypesOf,
|
|
22
21
|
ReferentialAction,
|
|
23
22
|
ResolveCodecTypes,
|
|
24
|
-
ResolveOperationTypes,
|
|
25
23
|
SqlModelFieldStorage,
|
|
26
24
|
SqlModelStorage,
|
|
27
25
|
SqlQueryOperationTypes,
|
package/src/types.ts
CHANGED
|
@@ -131,13 +131,11 @@ export function applyFkDefaults(
|
|
|
131
131
|
|
|
132
132
|
export type TypeMaps<
|
|
133
133
|
TCodecTypes extends Record<string, { output: unknown }> = Record<string, never>,
|
|
134
|
-
TOperationTypes extends Record<string, unknown> = Record<string, never>,
|
|
135
134
|
TQueryOperationTypes extends Record<string, unknown> = Record<string, never>,
|
|
136
135
|
TFieldOutputTypes extends Record<string, Record<string, unknown>> = Record<string, never>,
|
|
137
136
|
TFieldInputTypes extends Record<string, Record<string, unknown>> = Record<string, never>,
|
|
138
137
|
> = {
|
|
139
138
|
readonly codecTypes: TCodecTypes;
|
|
140
|
-
readonly operationTypes: TOperationTypes;
|
|
141
139
|
readonly queryOperationTypes: TQueryOperationTypes;
|
|
142
140
|
readonly fieldOutputTypes: TFieldOutputTypes;
|
|
143
141
|
readonly fieldInputTypes: TFieldInputTypes;
|
|
@@ -151,14 +149,6 @@ export type CodecTypesOf<T> = [T] extends [never]
|
|
|
151
149
|
: Record<string, never>
|
|
152
150
|
: Record<string, never>;
|
|
153
151
|
|
|
154
|
-
export type OperationTypesOf<T> = [T] extends [never]
|
|
155
|
-
? Record<string, never>
|
|
156
|
-
: T extends { readonly operationTypes: infer O }
|
|
157
|
-
? O extends Record<string, unknown>
|
|
158
|
-
? O
|
|
159
|
-
: Record<string, never>
|
|
160
|
-
: Record<string, never>;
|
|
161
|
-
|
|
162
152
|
/**
|
|
163
153
|
* Dispatch hint identifying the first-argument target of an operation.
|
|
164
154
|
*
|
|
@@ -236,5 +226,3 @@ export type ExtractFieldInputTypes<T> = FieldInputTypesOf<ExtractTypeMapsFromCon
|
|
|
236
226
|
export type ResolveCodecTypes<TContract, TTypeMaps> = [TTypeMaps] extends [never]
|
|
237
227
|
? ExtractCodecTypes<TContract>
|
|
238
228
|
: CodecTypesOf<TTypeMaps>;
|
|
239
|
-
|
|
240
|
-
export type ResolveOperationTypes<_TContract, TTypeMaps> = OperationTypesOf<TTypeMaps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-BTYquqSU.d.mts","names":[],"sources":["../src/types.ts"],"m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