@prisma/dmmf 6.6.0-dev.58 → 6.6.0-dev.60
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/convert.js +33 -0
- package/dist/convert.mjs +9 -0
- package/dist/convert.test.js +18 -0
- package/dist/convert.test.mjs +17 -0
- package/dist/dmmf.js +49 -0
- package/dist/dmmf.mjs +25 -0
- package/dist/index.d.ts +2 -279
- package/dist/index.js +5 -44
- package/dist/index.mjs +2 -35
- package/dist/util.js +16 -0
- package/dist/util.mjs +0 -0
- package/package.json +2 -2
- package/dist/index.d.mts +0 -279
package/dist/convert.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
var convert_exports = {};
|
|
20
|
+
__export(convert_exports, {
|
|
21
|
+
datamodelEnumToSchemaEnum: () => datamodelEnumToSchemaEnum
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(convert_exports);
|
|
24
|
+
function datamodelEnumToSchemaEnum(datamodelEnum) {
|
|
25
|
+
return {
|
|
26
|
+
name: datamodelEnum.name,
|
|
27
|
+
values: datamodelEnum.values.map((v) => v.name)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
datamodelEnumToSchemaEnum
|
|
33
|
+
});
|
package/dist/convert.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_vitest = require("vitest");
|
|
3
|
+
var import_convert = require("./convert");
|
|
4
|
+
(0, import_vitest.test)("datamodelEnumToSchemaEnum", () => {
|
|
5
|
+
const datamodelEnum = {
|
|
6
|
+
name: "Color",
|
|
7
|
+
values: [
|
|
8
|
+
{ name: "Red", dbName: "red" },
|
|
9
|
+
{ name: "Green", dbName: null },
|
|
10
|
+
{ name: "Blue", dbName: null }
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
const dmmfEnum = (0, import_convert.datamodelEnumToSchemaEnum)(datamodelEnum);
|
|
14
|
+
(0, import_vitest.expect)(dmmfEnum).toEqual({
|
|
15
|
+
name: "Color",
|
|
16
|
+
values: ["Red", "Green", "Blue"]
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { expect, test } from "vitest";
|
|
2
|
+
import { datamodelEnumToSchemaEnum } from "./convert";
|
|
3
|
+
test("datamodelEnumToSchemaEnum", () => {
|
|
4
|
+
const datamodelEnum = {
|
|
5
|
+
name: "Color",
|
|
6
|
+
values: [
|
|
7
|
+
{ name: "Red", dbName: "red" },
|
|
8
|
+
{ name: "Green", dbName: null },
|
|
9
|
+
{ name: "Blue", dbName: null }
|
|
10
|
+
]
|
|
11
|
+
};
|
|
12
|
+
const dmmfEnum = datamodelEnumToSchemaEnum(datamodelEnum);
|
|
13
|
+
expect(dmmfEnum).toEqual({
|
|
14
|
+
name: "Color",
|
|
15
|
+
values: ["Red", "Green", "Blue"]
|
|
16
|
+
});
|
|
17
|
+
});
|
package/dist/dmmf.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
var dmmf_exports = {};
|
|
20
|
+
__export(dmmf_exports, {
|
|
21
|
+
ModelAction: () => ModelAction
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(dmmf_exports);
|
|
24
|
+
var ModelAction = /* @__PURE__ */ ((ModelAction2) => {
|
|
25
|
+
ModelAction2["findUnique"] = "findUnique";
|
|
26
|
+
ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
|
|
27
|
+
ModelAction2["findFirst"] = "findFirst";
|
|
28
|
+
ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
|
|
29
|
+
ModelAction2["findMany"] = "findMany";
|
|
30
|
+
ModelAction2["create"] = "create";
|
|
31
|
+
ModelAction2["createMany"] = "createMany";
|
|
32
|
+
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
33
|
+
ModelAction2["update"] = "update";
|
|
34
|
+
ModelAction2["updateMany"] = "updateMany";
|
|
35
|
+
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
36
|
+
ModelAction2["upsert"] = "upsert";
|
|
37
|
+
ModelAction2["delete"] = "delete";
|
|
38
|
+
ModelAction2["deleteMany"] = "deleteMany";
|
|
39
|
+
ModelAction2["groupBy"] = "groupBy";
|
|
40
|
+
ModelAction2["count"] = "count";
|
|
41
|
+
ModelAction2["aggregate"] = "aggregate";
|
|
42
|
+
ModelAction2["findRaw"] = "findRaw";
|
|
43
|
+
ModelAction2["aggregateRaw"] = "aggregateRaw";
|
|
44
|
+
return ModelAction2;
|
|
45
|
+
})(ModelAction || {});
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
ModelAction
|
|
49
|
+
});
|
package/dist/dmmf.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var ModelAction = /* @__PURE__ */ ((ModelAction2) => {
|
|
2
|
+
ModelAction2["findUnique"] = "findUnique";
|
|
3
|
+
ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
|
|
4
|
+
ModelAction2["findFirst"] = "findFirst";
|
|
5
|
+
ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
|
|
6
|
+
ModelAction2["findMany"] = "findMany";
|
|
7
|
+
ModelAction2["create"] = "create";
|
|
8
|
+
ModelAction2["createMany"] = "createMany";
|
|
9
|
+
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
10
|
+
ModelAction2["update"] = "update";
|
|
11
|
+
ModelAction2["updateMany"] = "updateMany";
|
|
12
|
+
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
13
|
+
ModelAction2["upsert"] = "upsert";
|
|
14
|
+
ModelAction2["delete"] = "delete";
|
|
15
|
+
ModelAction2["deleteMany"] = "deleteMany";
|
|
16
|
+
ModelAction2["groupBy"] = "groupBy";
|
|
17
|
+
ModelAction2["count"] = "count";
|
|
18
|
+
ModelAction2["aggregate"] = "aggregate";
|
|
19
|
+
ModelAction2["findRaw"] = "findRaw";
|
|
20
|
+
ModelAction2["aggregateRaw"] = "aggregateRaw";
|
|
21
|
+
return ModelAction2;
|
|
22
|
+
})(ModelAction || {});
|
|
23
|
+
export {
|
|
24
|
+
ModelAction
|
|
25
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,279 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
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 { }
|
|
1
|
+
export * from './convert';
|
|
2
|
+
export * from './dmmf';
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
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
6
|
var __copyProps = (to, from, except, desc) => {
|
|
11
7
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
8
|
for (let key of __getOwnPropNames(from))
|
|
@@ -15,49 +11,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
11
|
}
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
16
|
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
ModelAction: () => ModelAction,
|
|
24
|
-
datamodelEnumToSchemaEnum: () => datamodelEnumToSchemaEnum
|
|
25
|
-
});
|
|
26
17
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
|
|
28
|
-
|
|
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 || {});
|
|
18
|
+
__reExport(index_exports, require("./convert"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./dmmf"), module.exports);
|
|
59
20
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
21
|
0 && (module.exports = {
|
|
61
|
-
|
|
62
|
-
|
|
22
|
+
...require("./convert"),
|
|
23
|
+
...require("./dmmf")
|
|
63
24
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
};
|
|
1
|
+
export * from "./convert";
|
|
2
|
+
export * from "./dmmf";
|
package/dist/util.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var util_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(util_exports);
|
package/dist/util.mjs
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/dmmf",
|
|
3
|
-
"version": "6.6.0-dev.
|
|
3
|
+
"version": "6.6.0-dev.60",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"import": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.mjs"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
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 { }
|