@prisma/dmmf 0.1.26 → 6.6.0-dev.50
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/LICENSE +201 -0
- package/README.md +4 -13
- package/dist/convert.d.ts +2 -0
- package/dist/convert.test.d.ts +1 -0
- package/dist/dmmf.d.ts +237 -0
- package/dist/index.d.mts +279 -0
- package/dist/index.d.ts +279 -1
- package/dist/index.js +62 -4
- package/dist/index.mjs +35 -0
- package/dist/util.d.ts +2 -6
- package/package.json +28 -35
- package/dist/Argument.d.ts +0 -20
- package/dist/Argument.js +0 -52
- package/dist/Argument.js.map +0 -1
- package/dist/DMMF.d.ts +0 -15
- package/dist/DMMF.js +0 -49
- package/dist/DMMF.js.map +0 -1
- package/dist/DMMFNode.d.ts +0 -4
- package/dist/DMMFNode.js +0 -12
- package/dist/DMMFNode.js.map +0 -1
- package/dist/Datamodel.d.ts +0 -29
- package/dist/Datamodel.js +0 -47
- package/dist/Datamodel.js.map +0 -1
- package/dist/Enum.d.ts +0 -12
- package/dist/Enum.js +0 -43
- package/dist/Enum.js.map +0 -1
- package/dist/Field.d.ts +0 -29
- package/dist/Field.js +0 -63
- package/dist/Field.js.map +0 -1
- package/dist/InputType.d.ts +0 -20
- package/dist/InputType.js +0 -55
- package/dist/InputType.js.map +0 -1
- package/dist/Mapping.d.ts +0 -37
- package/dist/Mapping.js +0 -87
- package/dist/Mapping.js.map +0 -1
- package/dist/Model.d.ts +0 -28
- package/dist/Model.js +0 -51
- package/dist/Model.js.map +0 -1
- package/dist/Mutation.d.ts +0 -26
- package/dist/Mutation.js +0 -41
- package/dist/Mutation.js.map +0 -1
- package/dist/Output.d.ts +0 -13
- package/dist/Output.js +0 -43
- package/dist/Output.js.map +0 -1
- package/dist/OutputType.d.ts +0 -22
- package/dist/OutputType.js +0 -53
- package/dist/OutputType.js.map +0 -1
- package/dist/Query.d.ts +0 -26
- package/dist/Query.js +0 -41
- package/dist/Query.js.map +0 -1
- package/dist/Schema.d.ts +0 -61
- package/dist/Schema.js +0 -58
- package/dist/Schema.js.map +0 -1
- package/dist/dmmfFromDatamodel.d.ts +0 -3
- package/dist/dmmfFromDatamodel.js +0 -22
- package/dist/dmmfFromDatamodel.js.map +0 -1
- package/dist/enums.d.ts +0 -5
- package/dist/enums.js +0 -9
- package/dist/enums.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/isSchema.d.ts +0 -2
- package/dist/isSchema.js +0 -13
- package/dist/isSchema.js.map +0 -1
- package/dist/types.d.ts +0 -16
- package/dist/types.js +0 -34
- package/dist/types.js.map +0 -1
- package/dist/util.js +0 -16
- package/dist/util.js.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
export declare type Datamodel = ReadonlyDeep<{
|
|
2
|
+
models: Model[];
|
|
3
|
+
enums: DatamodelEnum[];
|
|
4
|
+
types: Model[];
|
|
5
|
+
indexes: Index[];
|
|
6
|
+
}>;
|
|
7
|
+
|
|
8
|
+
export declare type DatamodelEnum = ReadonlyDeep<{
|
|
9
|
+
name: string;
|
|
10
|
+
values: EnumValue[];
|
|
11
|
+
dbName?: string | null;
|
|
12
|
+
documentation?: string;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export declare function datamodelEnumToSchemaEnum(datamodelEnum: DatamodelEnum): SchemaEnum;
|
|
16
|
+
|
|
17
|
+
export declare type Deprecation = ReadonlyDeep<{
|
|
18
|
+
sinceVersion: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
plannedRemovalVersion?: string;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
declare type Document_2 = ReadonlyDeep<{
|
|
24
|
+
datamodel: Datamodel;
|
|
25
|
+
schema: Schema;
|
|
26
|
+
mappings: Mappings;
|
|
27
|
+
}>;
|
|
28
|
+
export { Document_2 as Document }
|
|
29
|
+
|
|
30
|
+
export declare type EnumValue = ReadonlyDeep<{
|
|
31
|
+
name: string;
|
|
32
|
+
dbName: string | null;
|
|
33
|
+
}>;
|
|
34
|
+
|
|
35
|
+
export declare type Field = ReadonlyDeep<{
|
|
36
|
+
kind: FieldKind;
|
|
37
|
+
name: string;
|
|
38
|
+
isRequired: boolean;
|
|
39
|
+
isList: boolean;
|
|
40
|
+
isUnique: boolean;
|
|
41
|
+
isId: boolean;
|
|
42
|
+
isReadOnly: boolean;
|
|
43
|
+
isGenerated?: boolean;
|
|
44
|
+
isUpdatedAt?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Describes the data type in the same the way it is defined in the Prisma schema:
|
|
47
|
+
* BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
|
|
48
|
+
*/
|
|
49
|
+
type: string;
|
|
50
|
+
/**
|
|
51
|
+
* Native database type, if specified.
|
|
52
|
+
* For example, `@db.VarChar(191)` is encoded as `['VarChar', ['191']]`,
|
|
53
|
+
* `@db.Text` is encoded as `['Text', []]`.
|
|
54
|
+
*/
|
|
55
|
+
nativeType?: [string, string[]] | null;
|
|
56
|
+
dbName?: string | null;
|
|
57
|
+
hasDefaultValue: boolean;
|
|
58
|
+
default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
|
|
59
|
+
relationFromFields?: string[];
|
|
60
|
+
relationToFields?: string[];
|
|
61
|
+
relationOnDelete?: string;
|
|
62
|
+
relationOnUpdate?: string;
|
|
63
|
+
relationName?: string;
|
|
64
|
+
documentation?: string;
|
|
65
|
+
}>;
|
|
66
|
+
|
|
67
|
+
export declare type FieldDefault = ReadonlyDeep<{
|
|
68
|
+
name: string;
|
|
69
|
+
args: Array<string | number>;
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
export declare type FieldDefaultScalar = string | boolean | number;
|
|
73
|
+
|
|
74
|
+
export declare type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
|
|
75
|
+
|
|
76
|
+
export declare type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
|
|
77
|
+
|
|
78
|
+
export declare type FieldNamespace = 'model' | 'prisma';
|
|
79
|
+
|
|
80
|
+
export declare type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>;
|
|
81
|
+
|
|
82
|
+
export declare type FieldRefType = ReadonlyDeep<{
|
|
83
|
+
name: string;
|
|
84
|
+
allowTypes: FieldRefAllowType[];
|
|
85
|
+
fields: SchemaArg[];
|
|
86
|
+
}>;
|
|
87
|
+
|
|
88
|
+
export declare type Index = ReadonlyDeep<{
|
|
89
|
+
model: string;
|
|
90
|
+
type: IndexType;
|
|
91
|
+
isDefinedOnField: boolean;
|
|
92
|
+
name?: string;
|
|
93
|
+
dbName?: string;
|
|
94
|
+
algorithm?: string;
|
|
95
|
+
clustered?: boolean;
|
|
96
|
+
fields: IndexField[];
|
|
97
|
+
}>;
|
|
98
|
+
|
|
99
|
+
export declare type IndexField = ReadonlyDeep<{
|
|
100
|
+
name: string;
|
|
101
|
+
sortOrder?: SortOrder;
|
|
102
|
+
length?: number;
|
|
103
|
+
operatorClass?: string;
|
|
104
|
+
}>;
|
|
105
|
+
|
|
106
|
+
export declare type IndexType = 'id' | 'normal' | 'unique' | 'fulltext';
|
|
107
|
+
|
|
108
|
+
export declare type InputType = ReadonlyDeep<{
|
|
109
|
+
name: string;
|
|
110
|
+
constraints: {
|
|
111
|
+
maxNumFields: number | null;
|
|
112
|
+
minNumFields: number | null;
|
|
113
|
+
fields?: string[];
|
|
114
|
+
};
|
|
115
|
+
meta?: {
|
|
116
|
+
source?: string;
|
|
117
|
+
};
|
|
118
|
+
fields: SchemaArg[];
|
|
119
|
+
}>;
|
|
120
|
+
|
|
121
|
+
export declare type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>;
|
|
122
|
+
|
|
123
|
+
export declare type Mappings = ReadonlyDeep<{
|
|
124
|
+
modelOperations: ModelMapping[];
|
|
125
|
+
otherOperations: {
|
|
126
|
+
read: string[];
|
|
127
|
+
write: string[];
|
|
128
|
+
};
|
|
129
|
+
}>;
|
|
130
|
+
|
|
131
|
+
export declare type Model = ReadonlyDeep<{
|
|
132
|
+
name: string;
|
|
133
|
+
dbName: string | null;
|
|
134
|
+
schema: string | null;
|
|
135
|
+
fields: Field[];
|
|
136
|
+
uniqueFields: string[][];
|
|
137
|
+
uniqueIndexes: uniqueIndex[];
|
|
138
|
+
documentation?: string;
|
|
139
|
+
primaryKey: PrimaryKey | null;
|
|
140
|
+
isGenerated?: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
|
|
143
|
+
export declare enum ModelAction {
|
|
144
|
+
findUnique = "findUnique",
|
|
145
|
+
findUniqueOrThrow = "findUniqueOrThrow",
|
|
146
|
+
findFirst = "findFirst",
|
|
147
|
+
findFirstOrThrow = "findFirstOrThrow",
|
|
148
|
+
findMany = "findMany",
|
|
149
|
+
create = "create",
|
|
150
|
+
createMany = "createMany",
|
|
151
|
+
createManyAndReturn = "createManyAndReturn",
|
|
152
|
+
update = "update",
|
|
153
|
+
updateMany = "updateMany",
|
|
154
|
+
updateManyAndReturn = "updateManyAndReturn",
|
|
155
|
+
upsert = "upsert",
|
|
156
|
+
delete = "delete",
|
|
157
|
+
deleteMany = "deleteMany",
|
|
158
|
+
groupBy = "groupBy",
|
|
159
|
+
count = "count",// TODO: count does not actually exist in DMMF
|
|
160
|
+
aggregate = "aggregate",
|
|
161
|
+
findRaw = "findRaw",
|
|
162
|
+
aggregateRaw = "aggregateRaw"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare type ModelMapping = ReadonlyDeep<{
|
|
166
|
+
model: string;
|
|
167
|
+
plural: string;
|
|
168
|
+
findUnique?: string | null;
|
|
169
|
+
findUniqueOrThrow?: string | null;
|
|
170
|
+
findFirst?: string | null;
|
|
171
|
+
findFirstOrThrow?: string | null;
|
|
172
|
+
findMany?: string | null;
|
|
173
|
+
create?: string | null;
|
|
174
|
+
createMany?: string | null;
|
|
175
|
+
createManyAndReturn?: string | null;
|
|
176
|
+
update?: string | null;
|
|
177
|
+
updateMany?: string | null;
|
|
178
|
+
updateManyAndReturn?: string | null;
|
|
179
|
+
upsert?: string | null;
|
|
180
|
+
delete?: string | null;
|
|
181
|
+
deleteMany?: string | null;
|
|
182
|
+
aggregate?: string | null;
|
|
183
|
+
groupBy?: string | null;
|
|
184
|
+
count?: string | null;
|
|
185
|
+
findRaw?: string | null;
|
|
186
|
+
aggregateRaw?: string | null;
|
|
187
|
+
}>;
|
|
188
|
+
|
|
189
|
+
export declare type OtherOperationMappings = ReadonlyDeep<{
|
|
190
|
+
read: string[];
|
|
191
|
+
write: string[];
|
|
192
|
+
}>;
|
|
193
|
+
|
|
194
|
+
export declare type OutputType = ReadonlyDeep<{
|
|
195
|
+
name: string;
|
|
196
|
+
fields: SchemaField[];
|
|
197
|
+
}>;
|
|
198
|
+
|
|
199
|
+
export declare type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>;
|
|
200
|
+
|
|
201
|
+
export declare type PrimaryKey = ReadonlyDeep<{
|
|
202
|
+
name: string | null;
|
|
203
|
+
fields: string[];
|
|
204
|
+
}>;
|
|
205
|
+
|
|
206
|
+
export declare type Query = ReadonlyDeep<{
|
|
207
|
+
name: string;
|
|
208
|
+
args: SchemaArg[];
|
|
209
|
+
output: QueryOutput;
|
|
210
|
+
}>;
|
|
211
|
+
|
|
212
|
+
export declare type QueryOutput = ReadonlyDeep<{
|
|
213
|
+
name: string;
|
|
214
|
+
isRequired: boolean;
|
|
215
|
+
isList: boolean;
|
|
216
|
+
}>;
|
|
217
|
+
|
|
218
|
+
declare type ReadonlyDeep<O> = {
|
|
219
|
+
+readonly [K in keyof O]: ReadonlyDeep<O[K]>;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export declare type Schema = ReadonlyDeep<{
|
|
223
|
+
rootQueryType?: string;
|
|
224
|
+
rootMutationType?: string;
|
|
225
|
+
inputObjectTypes: {
|
|
226
|
+
model?: InputType[];
|
|
227
|
+
prisma: InputType[];
|
|
228
|
+
};
|
|
229
|
+
outputObjectTypes: {
|
|
230
|
+
model: OutputType[];
|
|
231
|
+
prisma: OutputType[];
|
|
232
|
+
};
|
|
233
|
+
enumTypes: {
|
|
234
|
+
model?: SchemaEnum[];
|
|
235
|
+
prisma: SchemaEnum[];
|
|
236
|
+
};
|
|
237
|
+
fieldRefTypes: {
|
|
238
|
+
prisma?: FieldRefType[];
|
|
239
|
+
};
|
|
240
|
+
}>;
|
|
241
|
+
|
|
242
|
+
export declare type SchemaArg = ReadonlyDeep<{
|
|
243
|
+
name: string;
|
|
244
|
+
comment?: string;
|
|
245
|
+
isNullable: boolean;
|
|
246
|
+
isRequired: boolean;
|
|
247
|
+
inputTypes: InputTypeRef[];
|
|
248
|
+
deprecation?: Deprecation;
|
|
249
|
+
}>;
|
|
250
|
+
|
|
251
|
+
export declare type SchemaEnum = ReadonlyDeep<{
|
|
252
|
+
name: string;
|
|
253
|
+
values: string[];
|
|
254
|
+
}>;
|
|
255
|
+
|
|
256
|
+
export declare type SchemaField = ReadonlyDeep<{
|
|
257
|
+
name: string;
|
|
258
|
+
isNullable?: boolean;
|
|
259
|
+
outputType: OutputTypeRef;
|
|
260
|
+
args: SchemaArg[];
|
|
261
|
+
deprecation?: Deprecation;
|
|
262
|
+
documentation?: string;
|
|
263
|
+
}>;
|
|
264
|
+
|
|
265
|
+
export declare type SortOrder = 'asc' | 'desc';
|
|
266
|
+
|
|
267
|
+
export declare type TypeRef<AllowedLocations extends FieldLocation> = {
|
|
268
|
+
isList: boolean;
|
|
269
|
+
type: string;
|
|
270
|
+
location: AllowedLocations;
|
|
271
|
+
namespace?: FieldNamespace;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export declare type uniqueIndex = ReadonlyDeep<{
|
|
275
|
+
name: string;
|
|
276
|
+
fields: string[];
|
|
277
|
+
}>;
|
|
278
|
+
|
|
279
|
+
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,279 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare type Datamodel = ReadonlyDeep<{
|
|
2
|
+
models: Model[];
|
|
3
|
+
enums: DatamodelEnum[];
|
|
4
|
+
types: Model[];
|
|
5
|
+
indexes: Index[];
|
|
6
|
+
}>;
|
|
7
|
+
|
|
8
|
+
export declare type DatamodelEnum = ReadonlyDeep<{
|
|
9
|
+
name: string;
|
|
10
|
+
values: EnumValue[];
|
|
11
|
+
dbName?: string | null;
|
|
12
|
+
documentation?: string;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export declare function datamodelEnumToSchemaEnum(datamodelEnum: DatamodelEnum): SchemaEnum;
|
|
16
|
+
|
|
17
|
+
export declare type Deprecation = ReadonlyDeep<{
|
|
18
|
+
sinceVersion: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
plannedRemovalVersion?: string;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
declare type Document_2 = ReadonlyDeep<{
|
|
24
|
+
datamodel: Datamodel;
|
|
25
|
+
schema: Schema;
|
|
26
|
+
mappings: Mappings;
|
|
27
|
+
}>;
|
|
28
|
+
export { Document_2 as Document }
|
|
29
|
+
|
|
30
|
+
export declare type EnumValue = ReadonlyDeep<{
|
|
31
|
+
name: string;
|
|
32
|
+
dbName: string | null;
|
|
33
|
+
}>;
|
|
34
|
+
|
|
35
|
+
export declare type Field = ReadonlyDeep<{
|
|
36
|
+
kind: FieldKind;
|
|
37
|
+
name: string;
|
|
38
|
+
isRequired: boolean;
|
|
39
|
+
isList: boolean;
|
|
40
|
+
isUnique: boolean;
|
|
41
|
+
isId: boolean;
|
|
42
|
+
isReadOnly: boolean;
|
|
43
|
+
isGenerated?: boolean;
|
|
44
|
+
isUpdatedAt?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Describes the data type in the same the way it is defined in the Prisma schema:
|
|
47
|
+
* BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName
|
|
48
|
+
*/
|
|
49
|
+
type: string;
|
|
50
|
+
/**
|
|
51
|
+
* Native database type, if specified.
|
|
52
|
+
* For example, `@db.VarChar(191)` is encoded as `['VarChar', ['191']]`,
|
|
53
|
+
* `@db.Text` is encoded as `['Text', []]`.
|
|
54
|
+
*/
|
|
55
|
+
nativeType?: [string, string[]] | null;
|
|
56
|
+
dbName?: string | null;
|
|
57
|
+
hasDefaultValue: boolean;
|
|
58
|
+
default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[];
|
|
59
|
+
relationFromFields?: string[];
|
|
60
|
+
relationToFields?: string[];
|
|
61
|
+
relationOnDelete?: string;
|
|
62
|
+
relationOnUpdate?: string;
|
|
63
|
+
relationName?: string;
|
|
64
|
+
documentation?: string;
|
|
65
|
+
}>;
|
|
66
|
+
|
|
67
|
+
export declare type FieldDefault = ReadonlyDeep<{
|
|
68
|
+
name: string;
|
|
69
|
+
args: Array<string | number>;
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
export declare type FieldDefaultScalar = string | boolean | number;
|
|
73
|
+
|
|
74
|
+
export declare type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported';
|
|
75
|
+
|
|
76
|
+
export declare type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes';
|
|
77
|
+
|
|
78
|
+
export declare type FieldNamespace = 'model' | 'prisma';
|
|
79
|
+
|
|
80
|
+
export declare type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>;
|
|
81
|
+
|
|
82
|
+
export declare type FieldRefType = ReadonlyDeep<{
|
|
83
|
+
name: string;
|
|
84
|
+
allowTypes: FieldRefAllowType[];
|
|
85
|
+
fields: SchemaArg[];
|
|
86
|
+
}>;
|
|
87
|
+
|
|
88
|
+
export declare type Index = ReadonlyDeep<{
|
|
89
|
+
model: string;
|
|
90
|
+
type: IndexType;
|
|
91
|
+
isDefinedOnField: boolean;
|
|
92
|
+
name?: string;
|
|
93
|
+
dbName?: string;
|
|
94
|
+
algorithm?: string;
|
|
95
|
+
clustered?: boolean;
|
|
96
|
+
fields: IndexField[];
|
|
97
|
+
}>;
|
|
98
|
+
|
|
99
|
+
export declare type IndexField = ReadonlyDeep<{
|
|
100
|
+
name: string;
|
|
101
|
+
sortOrder?: SortOrder;
|
|
102
|
+
length?: number;
|
|
103
|
+
operatorClass?: string;
|
|
104
|
+
}>;
|
|
105
|
+
|
|
106
|
+
export declare type IndexType = 'id' | 'normal' | 'unique' | 'fulltext';
|
|
107
|
+
|
|
108
|
+
export declare type InputType = ReadonlyDeep<{
|
|
109
|
+
name: string;
|
|
110
|
+
constraints: {
|
|
111
|
+
maxNumFields: number | null;
|
|
112
|
+
minNumFields: number | null;
|
|
113
|
+
fields?: string[];
|
|
114
|
+
};
|
|
115
|
+
meta?: {
|
|
116
|
+
source?: string;
|
|
117
|
+
};
|
|
118
|
+
fields: SchemaArg[];
|
|
119
|
+
}>;
|
|
120
|
+
|
|
121
|
+
export declare type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>;
|
|
122
|
+
|
|
123
|
+
export declare type Mappings = ReadonlyDeep<{
|
|
124
|
+
modelOperations: ModelMapping[];
|
|
125
|
+
otherOperations: {
|
|
126
|
+
read: string[];
|
|
127
|
+
write: string[];
|
|
128
|
+
};
|
|
129
|
+
}>;
|
|
130
|
+
|
|
131
|
+
export declare type Model = ReadonlyDeep<{
|
|
132
|
+
name: string;
|
|
133
|
+
dbName: string | null;
|
|
134
|
+
schema: string | null;
|
|
135
|
+
fields: Field[];
|
|
136
|
+
uniqueFields: string[][];
|
|
137
|
+
uniqueIndexes: uniqueIndex[];
|
|
138
|
+
documentation?: string;
|
|
139
|
+
primaryKey: PrimaryKey | null;
|
|
140
|
+
isGenerated?: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
|
|
143
|
+
export declare enum ModelAction {
|
|
144
|
+
findUnique = "findUnique",
|
|
145
|
+
findUniqueOrThrow = "findUniqueOrThrow",
|
|
146
|
+
findFirst = "findFirst",
|
|
147
|
+
findFirstOrThrow = "findFirstOrThrow",
|
|
148
|
+
findMany = "findMany",
|
|
149
|
+
create = "create",
|
|
150
|
+
createMany = "createMany",
|
|
151
|
+
createManyAndReturn = "createManyAndReturn",
|
|
152
|
+
update = "update",
|
|
153
|
+
updateMany = "updateMany",
|
|
154
|
+
updateManyAndReturn = "updateManyAndReturn",
|
|
155
|
+
upsert = "upsert",
|
|
156
|
+
delete = "delete",
|
|
157
|
+
deleteMany = "deleteMany",
|
|
158
|
+
groupBy = "groupBy",
|
|
159
|
+
count = "count",// TODO: count does not actually exist in DMMF
|
|
160
|
+
aggregate = "aggregate",
|
|
161
|
+
findRaw = "findRaw",
|
|
162
|
+
aggregateRaw = "aggregateRaw"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare type ModelMapping = ReadonlyDeep<{
|
|
166
|
+
model: string;
|
|
167
|
+
plural: string;
|
|
168
|
+
findUnique?: string | null;
|
|
169
|
+
findUniqueOrThrow?: string | null;
|
|
170
|
+
findFirst?: string | null;
|
|
171
|
+
findFirstOrThrow?: string | null;
|
|
172
|
+
findMany?: string | null;
|
|
173
|
+
create?: string | null;
|
|
174
|
+
createMany?: string | null;
|
|
175
|
+
createManyAndReturn?: string | null;
|
|
176
|
+
update?: string | null;
|
|
177
|
+
updateMany?: string | null;
|
|
178
|
+
updateManyAndReturn?: string | null;
|
|
179
|
+
upsert?: string | null;
|
|
180
|
+
delete?: string | null;
|
|
181
|
+
deleteMany?: string | null;
|
|
182
|
+
aggregate?: string | null;
|
|
183
|
+
groupBy?: string | null;
|
|
184
|
+
count?: string | null;
|
|
185
|
+
findRaw?: string | null;
|
|
186
|
+
aggregateRaw?: string | null;
|
|
187
|
+
}>;
|
|
188
|
+
|
|
189
|
+
export declare type OtherOperationMappings = ReadonlyDeep<{
|
|
190
|
+
read: string[];
|
|
191
|
+
write: string[];
|
|
192
|
+
}>;
|
|
193
|
+
|
|
194
|
+
export declare type OutputType = ReadonlyDeep<{
|
|
195
|
+
name: string;
|
|
196
|
+
fields: SchemaField[];
|
|
197
|
+
}>;
|
|
198
|
+
|
|
199
|
+
export declare type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>;
|
|
200
|
+
|
|
201
|
+
export declare type PrimaryKey = ReadonlyDeep<{
|
|
202
|
+
name: string | null;
|
|
203
|
+
fields: string[];
|
|
204
|
+
}>;
|
|
205
|
+
|
|
206
|
+
export declare type Query = ReadonlyDeep<{
|
|
207
|
+
name: string;
|
|
208
|
+
args: SchemaArg[];
|
|
209
|
+
output: QueryOutput;
|
|
210
|
+
}>;
|
|
211
|
+
|
|
212
|
+
export declare type QueryOutput = ReadonlyDeep<{
|
|
213
|
+
name: string;
|
|
214
|
+
isRequired: boolean;
|
|
215
|
+
isList: boolean;
|
|
216
|
+
}>;
|
|
217
|
+
|
|
218
|
+
declare type ReadonlyDeep<O> = {
|
|
219
|
+
+readonly [K in keyof O]: ReadonlyDeep<O[K]>;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export declare type Schema = ReadonlyDeep<{
|
|
223
|
+
rootQueryType?: string;
|
|
224
|
+
rootMutationType?: string;
|
|
225
|
+
inputObjectTypes: {
|
|
226
|
+
model?: InputType[];
|
|
227
|
+
prisma: InputType[];
|
|
228
|
+
};
|
|
229
|
+
outputObjectTypes: {
|
|
230
|
+
model: OutputType[];
|
|
231
|
+
prisma: OutputType[];
|
|
232
|
+
};
|
|
233
|
+
enumTypes: {
|
|
234
|
+
model?: SchemaEnum[];
|
|
235
|
+
prisma: SchemaEnum[];
|
|
236
|
+
};
|
|
237
|
+
fieldRefTypes: {
|
|
238
|
+
prisma?: FieldRefType[];
|
|
239
|
+
};
|
|
240
|
+
}>;
|
|
241
|
+
|
|
242
|
+
export declare type SchemaArg = ReadonlyDeep<{
|
|
243
|
+
name: string;
|
|
244
|
+
comment?: string;
|
|
245
|
+
isNullable: boolean;
|
|
246
|
+
isRequired: boolean;
|
|
247
|
+
inputTypes: InputTypeRef[];
|
|
248
|
+
deprecation?: Deprecation;
|
|
249
|
+
}>;
|
|
250
|
+
|
|
251
|
+
export declare type SchemaEnum = ReadonlyDeep<{
|
|
252
|
+
name: string;
|
|
253
|
+
values: string[];
|
|
254
|
+
}>;
|
|
255
|
+
|
|
256
|
+
export declare type SchemaField = ReadonlyDeep<{
|
|
257
|
+
name: string;
|
|
258
|
+
isNullable?: boolean;
|
|
259
|
+
outputType: OutputTypeRef;
|
|
260
|
+
args: SchemaArg[];
|
|
261
|
+
deprecation?: Deprecation;
|
|
262
|
+
documentation?: string;
|
|
263
|
+
}>;
|
|
264
|
+
|
|
265
|
+
export declare type SortOrder = 'asc' | 'desc';
|
|
266
|
+
|
|
267
|
+
export declare type TypeRef<AllowedLocations extends FieldLocation> = {
|
|
268
|
+
isList: boolean;
|
|
269
|
+
type: string;
|
|
270
|
+
location: AllowedLocations;
|
|
271
|
+
namespace?: FieldNamespace;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
export declare type uniqueIndex = ReadonlyDeep<{
|
|
275
|
+
name: string;
|
|
276
|
+
fields: string[];
|
|
277
|
+
}>;
|
|
278
|
+
|
|
279
|
+
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ModelAction: () => ModelAction,
|
|
24
|
+
datamodelEnumToSchemaEnum: () => datamodelEnumToSchemaEnum
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
|
|
28
|
+
// src/convert.ts
|
|
29
|
+
function datamodelEnumToSchemaEnum(datamodelEnum) {
|
|
30
|
+
return {
|
|
31
|
+
name: datamodelEnum.name,
|
|
32
|
+
values: datamodelEnum.values.map((v) => v.name)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/dmmf.ts
|
|
37
|
+
var ModelAction = /* @__PURE__ */ ((ModelAction2) => {
|
|
38
|
+
ModelAction2["findUnique"] = "findUnique";
|
|
39
|
+
ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
|
|
40
|
+
ModelAction2["findFirst"] = "findFirst";
|
|
41
|
+
ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
|
|
42
|
+
ModelAction2["findMany"] = "findMany";
|
|
43
|
+
ModelAction2["create"] = "create";
|
|
44
|
+
ModelAction2["createMany"] = "createMany";
|
|
45
|
+
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
46
|
+
ModelAction2["update"] = "update";
|
|
47
|
+
ModelAction2["updateMany"] = "updateMany";
|
|
48
|
+
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
49
|
+
ModelAction2["upsert"] = "upsert";
|
|
50
|
+
ModelAction2["delete"] = "delete";
|
|
51
|
+
ModelAction2["deleteMany"] = "deleteMany";
|
|
52
|
+
ModelAction2["groupBy"] = "groupBy";
|
|
53
|
+
ModelAction2["count"] = "count";
|
|
54
|
+
ModelAction2["aggregate"] = "aggregate";
|
|
55
|
+
ModelAction2["findRaw"] = "findRaw";
|
|
56
|
+
ModelAction2["aggregateRaw"] = "aggregateRaw";
|
|
57
|
+
return ModelAction2;
|
|
58
|
+
})(ModelAction || {});
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
ModelAction,
|
|
62
|
+
datamodelEnumToSchemaEnum
|
|
63
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/convert.ts
|
|
2
|
+
function datamodelEnumToSchemaEnum(datamodelEnum) {
|
|
3
|
+
return {
|
|
4
|
+
name: datamodelEnum.name,
|
|
5
|
+
values: datamodelEnum.values.map((v) => v.name)
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/dmmf.ts
|
|
10
|
+
var ModelAction = /* @__PURE__ */ ((ModelAction2) => {
|
|
11
|
+
ModelAction2["findUnique"] = "findUnique";
|
|
12
|
+
ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
|
|
13
|
+
ModelAction2["findFirst"] = "findFirst";
|
|
14
|
+
ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
|
|
15
|
+
ModelAction2["findMany"] = "findMany";
|
|
16
|
+
ModelAction2["create"] = "create";
|
|
17
|
+
ModelAction2["createMany"] = "createMany";
|
|
18
|
+
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
19
|
+
ModelAction2["update"] = "update";
|
|
20
|
+
ModelAction2["updateMany"] = "updateMany";
|
|
21
|
+
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
22
|
+
ModelAction2["upsert"] = "upsert";
|
|
23
|
+
ModelAction2["delete"] = "delete";
|
|
24
|
+
ModelAction2["deleteMany"] = "deleteMany";
|
|
25
|
+
ModelAction2["groupBy"] = "groupBy";
|
|
26
|
+
ModelAction2["count"] = "count";
|
|
27
|
+
ModelAction2["aggregate"] = "aggregate";
|
|
28
|
+
ModelAction2["findRaw"] = "findRaw";
|
|
29
|
+
ModelAction2["aggregateRaw"] = "aggregateRaw";
|
|
30
|
+
return ModelAction2;
|
|
31
|
+
})(ModelAction || {});
|
|
32
|
+
export {
|
|
33
|
+
ModelAction,
|
|
34
|
+
datamodelEnumToSchemaEnum
|
|
35
|
+
};
|
package/dist/util.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare type Dictionary<T> = {
|
|
4
|
-
[key: string]: T;
|
|
1
|
+
export type ReadonlyDeep<O> = {
|
|
2
|
+
+readonly [K in keyof O]: ReadonlyDeep<O[K]>;
|
|
5
3
|
};
|
|
6
|
-
export declare const keyBy: <T>(collection: Array<T>, iteratee: (value: T) => string) => Dictionary<T>;
|
|
7
|
-
export declare function getEnumMap(enums: Enum[]): EnumMap;
|