@prisma/client-generator-ts 6.18.0 → 6.19.0-integration-next.2
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/TSClient/NullTypes.d.ts +1 -1
- package/dist/index.js +26 -14
- package/dist/index.mjs +26 -14
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const nullTypes = "\nexport const NullTypes = {\n DbNull: runtime.
|
|
1
|
+
export declare const nullTypes = "\nexport const NullTypes = {\n DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),\n JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),\n AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),\n}\n/**\n * Helper for filtering JSON entries that have `null` on the database (empty on the db)\n *\n * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field\n */\nexport const DbNull = runtime.DbNull\n\n/**\n * Helper for filtering JSON entries that have JSON `null` values (not empty on the db)\n *\n * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field\n */\nexport const JsonNull = runtime.JsonNull\n\n/**\n * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`\n *\n * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field\n */\nexport const AnyNull = runtime.AnyNull\n";
|
package/dist/index.js
CHANGED
|
@@ -2385,7 +2385,7 @@ var Enum = class {
|
|
|
2385
2385
|
toTS() {
|
|
2386
2386
|
const { type } = this;
|
|
2387
2387
|
const enumVariants = `{
|
|
2388
|
-
${(0, import_indent_string.default)(type.
|
|
2388
|
+
${(0, import_indent_string.default)(type.data.map((v) => `${v.key}: ${this.getValue(v.value)}`).join(",\n"), TAB_SIZE)}
|
|
2389
2389
|
} as const`;
|
|
2390
2390
|
const enumBody = this.isStrictEnum() ? `runtime.makeStrictEnum(${enumVariants})` : enumVariants;
|
|
2391
2391
|
return `export const ${type.name} = ${enumBody}
|
|
@@ -5153,33 +5153,36 @@ function createModelsFile(context, modelsNames) {
|
|
|
5153
5153
|
}
|
|
5154
5154
|
|
|
5155
5155
|
// src/TSClient/file-generators/PrismaNamespaceBrowserFile.ts
|
|
5156
|
+
var import_dmmf2 = require("@prisma/dmmf");
|
|
5156
5157
|
var ts16 = __toESM(require("@prisma/ts-builders"));
|
|
5157
5158
|
|
|
5158
5159
|
// src/TSClient/NullTypes.ts
|
|
5159
5160
|
var nullTypes = `
|
|
5160
5161
|
export const NullTypes = {
|
|
5161
|
-
DbNull: runtime.
|
|
5162
|
-
JsonNull: runtime.
|
|
5163
|
-
AnyNull: runtime.
|
|
5162
|
+
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
|
|
5163
|
+
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
|
|
5164
|
+
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
|
|
5164
5165
|
}
|
|
5165
5166
|
/**
|
|
5166
5167
|
* Helper for filtering JSON entries that have \`null\` on the database (empty on the db)
|
|
5167
5168
|
*
|
|
5168
5169
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5169
5170
|
*/
|
|
5170
|
-
export const DbNull = runtime.
|
|
5171
|
+
export const DbNull = runtime.DbNull
|
|
5172
|
+
|
|
5171
5173
|
/**
|
|
5172
5174
|
* Helper for filtering JSON entries that have JSON \`null\` values (not empty on the db)
|
|
5173
5175
|
*
|
|
5174
5176
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5175
5177
|
*/
|
|
5176
|
-
export const JsonNull = runtime.
|
|
5178
|
+
export const JsonNull = runtime.JsonNull
|
|
5179
|
+
|
|
5177
5180
|
/**
|
|
5178
5181
|
* Helper for filtering JSON entries that are \`Prisma.DbNull\` or \`Prisma.JsonNull\`
|
|
5179
5182
|
*
|
|
5180
5183
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5181
5184
|
*/
|
|
5182
|
-
export const AnyNull = runtime.
|
|
5185
|
+
export const AnyNull = runtime.AnyNull
|
|
5183
5186
|
`;
|
|
5184
5187
|
|
|
5185
5188
|
// src/TSClient/file-generators/PrismaNamespaceBrowserFile.ts
|
|
@@ -5196,7 +5199,9 @@ var jsDocHeader7 = `/*
|
|
|
5196
5199
|
*/
|
|
5197
5200
|
`;
|
|
5198
5201
|
function createPrismaNamespaceBrowserFile(context) {
|
|
5199
|
-
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5202
|
+
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5203
|
+
(datamodelEnum) => new Enum((0, import_dmmf2.datamodelSchemaEnumToSchemaEnum)(datamodelEnum), false).toTS()
|
|
5204
|
+
);
|
|
5200
5205
|
return `${jsDocHeader7}
|
|
5201
5206
|
${ts16.stringify(ts16.moduleImport(`${context.runtimeBase}/index-browser`).asNamespace("runtime"))}
|
|
5202
5207
|
|
|
@@ -5210,7 +5215,10 @@ ${nullTypes}
|
|
|
5210
5215
|
${new Enum(
|
|
5211
5216
|
{
|
|
5212
5217
|
name: "ModelName",
|
|
5213
|
-
|
|
5218
|
+
data: context.dmmf.mappings.modelOperations.map((m) => ({
|
|
5219
|
+
key: m.model,
|
|
5220
|
+
value: m.model
|
|
5221
|
+
}))
|
|
5214
5222
|
},
|
|
5215
5223
|
true
|
|
5216
5224
|
).toTS()}
|
|
@@ -5223,6 +5231,7 @@ ${prismaEnums?.join("\n\n")}
|
|
|
5223
5231
|
}
|
|
5224
5232
|
|
|
5225
5233
|
// src/TSClient/file-generators/PrismaNamespaceFile.ts
|
|
5234
|
+
var import_dmmf3 = require("@prisma/dmmf");
|
|
5226
5235
|
var ts19 = __toESM(require("@prisma/ts-builders"));
|
|
5227
5236
|
|
|
5228
5237
|
// src/TSClient/common.ts
|
|
@@ -5762,7 +5771,9 @@ function createPrismaNamespaceFile(context, options) {
|
|
|
5762
5771
|
ts19.moduleImport(context.importFileName(`../models`)).asNamespace("Prisma").typeOnly(),
|
|
5763
5772
|
ts19.moduleImport(context.importFileName(`./class`)).named(ts19.namedImport("PrismaClient").typeOnly())
|
|
5764
5773
|
].map((i) => ts19.stringify(i));
|
|
5765
|
-
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5774
|
+
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5775
|
+
(type) => new Enum((0, import_dmmf3.datamodelSchemaEnumToSchemaEnum)(type), true).toTS()
|
|
5776
|
+
);
|
|
5766
5777
|
const fieldRefs = context.dmmf.schema.fieldRefTypes.prisma?.map((type) => new FieldRefInput(type).toTS()) ?? [];
|
|
5767
5778
|
return `${jsDocHeader8}
|
|
5768
5779
|
${imports.join("\n")}
|
|
@@ -5773,7 +5784,10 @@ ${commonCodeTS(options)}
|
|
|
5773
5784
|
${new Enum(
|
|
5774
5785
|
{
|
|
5775
5786
|
name: "ModelName",
|
|
5776
|
-
|
|
5787
|
+
data: context.dmmf.mappings.modelOperations.map((m) => ({
|
|
5788
|
+
key: m.model,
|
|
5789
|
+
value: m.model
|
|
5790
|
+
}))
|
|
5777
5791
|
},
|
|
5778
5792
|
true
|
|
5779
5793
|
).toTS()}
|
|
@@ -5883,8 +5897,6 @@ function clientExtensionsDefinitions() {
|
|
|
5883
5897
|
function buildClientOptions(context, options) {
|
|
5884
5898
|
const clientOptions = ts19.interfaceDeclaration("PrismaClientOptions").add(
|
|
5885
5899
|
ts19.property("datasources", ts19.namedType("Datasources")).optional().setDocComment(ts19.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
5886
|
-
).add(
|
|
5887
|
-
ts19.property("datasourceUrl", ts19.stringType).optional().setDocComment(ts19.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
5888
5900
|
).add(
|
|
5889
5901
|
ts19.property("errorFormat", ts19.namedType("ErrorFormat")).optional().setDocComment(ts19.docComment('@default "colorless"'))
|
|
5890
5902
|
).add(
|
|
@@ -6619,7 +6631,7 @@ var import_get_tsconfig = require("get-tsconfig");
|
|
|
6619
6631
|
var import_ts_pattern2 = require("ts-pattern");
|
|
6620
6632
|
|
|
6621
6633
|
// package.json
|
|
6622
|
-
var version = "6.
|
|
6634
|
+
var version = "6.19.0-integration-next.2";
|
|
6623
6635
|
|
|
6624
6636
|
// src/module-format.ts
|
|
6625
6637
|
function parseModuleFormat(format) {
|
package/dist/index.mjs
CHANGED
|
@@ -2381,7 +2381,7 @@ var Enum = class {
|
|
|
2381
2381
|
toTS() {
|
|
2382
2382
|
const { type } = this;
|
|
2383
2383
|
const enumVariants = `{
|
|
2384
|
-
${indent(type.
|
|
2384
|
+
${indent(type.data.map((v) => `${v.key}: ${this.getValue(v.value)}`).join(",\n"), TAB_SIZE)}
|
|
2385
2385
|
} as const`;
|
|
2386
2386
|
const enumBody = this.isStrictEnum() ? `runtime.makeStrictEnum(${enumVariants})` : enumVariants;
|
|
2387
2387
|
return `export const ${type.name} = ${enumBody}
|
|
@@ -5152,33 +5152,36 @@ function createModelsFile(context, modelsNames) {
|
|
|
5152
5152
|
}
|
|
5153
5153
|
|
|
5154
5154
|
// src/TSClient/file-generators/PrismaNamespaceBrowserFile.ts
|
|
5155
|
+
import { datamodelSchemaEnumToSchemaEnum } from "@prisma/dmmf";
|
|
5155
5156
|
import * as ts16 from "@prisma/ts-builders";
|
|
5156
5157
|
|
|
5157
5158
|
// src/TSClient/NullTypes.ts
|
|
5158
5159
|
var nullTypes = `
|
|
5159
5160
|
export const NullTypes = {
|
|
5160
|
-
DbNull: runtime.
|
|
5161
|
-
JsonNull: runtime.
|
|
5162
|
-
AnyNull: runtime.
|
|
5161
|
+
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
|
|
5162
|
+
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
|
|
5163
|
+
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
|
|
5163
5164
|
}
|
|
5164
5165
|
/**
|
|
5165
5166
|
* Helper for filtering JSON entries that have \`null\` on the database (empty on the db)
|
|
5166
5167
|
*
|
|
5167
5168
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5168
5169
|
*/
|
|
5169
|
-
export const DbNull = runtime.
|
|
5170
|
+
export const DbNull = runtime.DbNull
|
|
5171
|
+
|
|
5170
5172
|
/**
|
|
5171
5173
|
* Helper for filtering JSON entries that have JSON \`null\` values (not empty on the db)
|
|
5172
5174
|
*
|
|
5173
5175
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5174
5176
|
*/
|
|
5175
|
-
export const JsonNull = runtime.
|
|
5177
|
+
export const JsonNull = runtime.JsonNull
|
|
5178
|
+
|
|
5176
5179
|
/**
|
|
5177
5180
|
* Helper for filtering JSON entries that are \`Prisma.DbNull\` or \`Prisma.JsonNull\`
|
|
5178
5181
|
*
|
|
5179
5182
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5180
5183
|
*/
|
|
5181
|
-
export const AnyNull = runtime.
|
|
5184
|
+
export const AnyNull = runtime.AnyNull
|
|
5182
5185
|
`;
|
|
5183
5186
|
|
|
5184
5187
|
// src/TSClient/file-generators/PrismaNamespaceBrowserFile.ts
|
|
@@ -5195,7 +5198,9 @@ var jsDocHeader7 = `/*
|
|
|
5195
5198
|
*/
|
|
5196
5199
|
`;
|
|
5197
5200
|
function createPrismaNamespaceBrowserFile(context) {
|
|
5198
|
-
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5201
|
+
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5202
|
+
(datamodelEnum) => new Enum(datamodelSchemaEnumToSchemaEnum(datamodelEnum), false).toTS()
|
|
5203
|
+
);
|
|
5199
5204
|
return `${jsDocHeader7}
|
|
5200
5205
|
${ts16.stringify(ts16.moduleImport(`${context.runtimeBase}/index-browser`).asNamespace("runtime"))}
|
|
5201
5206
|
|
|
@@ -5209,7 +5214,10 @@ ${nullTypes}
|
|
|
5209
5214
|
${new Enum(
|
|
5210
5215
|
{
|
|
5211
5216
|
name: "ModelName",
|
|
5212
|
-
|
|
5217
|
+
data: context.dmmf.mappings.modelOperations.map((m) => ({
|
|
5218
|
+
key: m.model,
|
|
5219
|
+
value: m.model
|
|
5220
|
+
}))
|
|
5213
5221
|
},
|
|
5214
5222
|
true
|
|
5215
5223
|
).toTS()}
|
|
@@ -5222,6 +5230,7 @@ ${prismaEnums?.join("\n\n")}
|
|
|
5222
5230
|
}
|
|
5223
5231
|
|
|
5224
5232
|
// src/TSClient/file-generators/PrismaNamespaceFile.ts
|
|
5233
|
+
import { datamodelSchemaEnumToSchemaEnum as datamodelSchemaEnumToSchemaEnum2 } from "@prisma/dmmf";
|
|
5225
5234
|
import * as ts19 from "@prisma/ts-builders";
|
|
5226
5235
|
|
|
5227
5236
|
// src/TSClient/common.ts
|
|
@@ -5761,7 +5770,9 @@ function createPrismaNamespaceFile(context, options) {
|
|
|
5761
5770
|
ts19.moduleImport(context.importFileName(`../models`)).asNamespace("Prisma").typeOnly(),
|
|
5762
5771
|
ts19.moduleImport(context.importFileName(`./class`)).named(ts19.namedImport("PrismaClient").typeOnly())
|
|
5763
5772
|
].map((i) => ts19.stringify(i));
|
|
5764
|
-
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5773
|
+
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5774
|
+
(type) => new Enum(datamodelSchemaEnumToSchemaEnum2(type), true).toTS()
|
|
5775
|
+
);
|
|
5765
5776
|
const fieldRefs = context.dmmf.schema.fieldRefTypes.prisma?.map((type) => new FieldRefInput(type).toTS()) ?? [];
|
|
5766
5777
|
return `${jsDocHeader8}
|
|
5767
5778
|
${imports.join("\n")}
|
|
@@ -5772,7 +5783,10 @@ ${commonCodeTS(options)}
|
|
|
5772
5783
|
${new Enum(
|
|
5773
5784
|
{
|
|
5774
5785
|
name: "ModelName",
|
|
5775
|
-
|
|
5786
|
+
data: context.dmmf.mappings.modelOperations.map((m) => ({
|
|
5787
|
+
key: m.model,
|
|
5788
|
+
value: m.model
|
|
5789
|
+
}))
|
|
5776
5790
|
},
|
|
5777
5791
|
true
|
|
5778
5792
|
).toTS()}
|
|
@@ -5882,8 +5896,6 @@ function clientExtensionsDefinitions() {
|
|
|
5882
5896
|
function buildClientOptions(context, options) {
|
|
5883
5897
|
const clientOptions = ts19.interfaceDeclaration("PrismaClientOptions").add(
|
|
5884
5898
|
ts19.property("datasources", ts19.namedType("Datasources")).optional().setDocComment(ts19.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
5885
|
-
).add(
|
|
5886
|
-
ts19.property("datasourceUrl", ts19.stringType).optional().setDocComment(ts19.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
5887
5899
|
).add(
|
|
5888
5900
|
ts19.property("errorFormat", ts19.namedType("ErrorFormat")).optional().setDocComment(ts19.docComment('@default "colorless"'))
|
|
5889
5901
|
).add(
|
|
@@ -6618,7 +6630,7 @@ import { getTsconfig } from "get-tsconfig";
|
|
|
6618
6630
|
import { match as match2 } from "ts-pattern";
|
|
6619
6631
|
|
|
6620
6632
|
// package.json
|
|
6621
|
-
var version = "6.
|
|
6633
|
+
var version = "6.19.0-integration-next.2";
|
|
6622
6634
|
|
|
6623
6635
|
// src/module-format.ts
|
|
6624
6636
|
function parseModuleFormat(format) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-generator-ts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.19.0-integration-next.2",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"package-up": "5.0.0",
|
|
35
35
|
"pluralize": "8.0.0",
|
|
36
36
|
"ts-pattern": "5.6.2",
|
|
37
|
-
"@prisma/
|
|
38
|
-
"@prisma/
|
|
39
|
-
"@prisma/
|
|
40
|
-
"@prisma/generator": "6.
|
|
41
|
-
"@prisma/get-platform": "6.
|
|
42
|
-
"@prisma/
|
|
43
|
-
"@prisma/
|
|
44
|
-
"@prisma/
|
|
37
|
+
"@prisma/debug": "6.19.0-integration-next.2",
|
|
38
|
+
"@prisma/client-common": "6.19.0-integration-next.2",
|
|
39
|
+
"@prisma/fetch-engine": "6.19.0-integration-next.2",
|
|
40
|
+
"@prisma/generator": "6.19.0-integration-next.2",
|
|
41
|
+
"@prisma/get-platform": "6.19.0-integration-next.2",
|
|
42
|
+
"@prisma/dmmf": "6.19.0-integration-next.2",
|
|
43
|
+
"@prisma/ts-builders": "6.19.0-integration-next.2",
|
|
44
|
+
"@prisma/internals": "6.19.0-integration-next.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/pluralize": "0.0.33",
|