@prisma/internals 7.10.0-dev.2 → 7.10.0-dev.20
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/{chunk-B3AOONBY.js → chunk-3APCYQQN.js} +10 -10
- package/dist/{chunk-L2BUQUNG.js → chunk-3FC2IETP.js} +5 -5
- package/dist/{chunk-EBLNHWW6.js → chunk-3VD46SL7.js} +9 -9
- package/dist/{chunk-6PILE32P.js → chunk-6QMGKJXI.js} +17 -17
- package/dist/{chunk-TZJROXB3.js → chunk-6Z766KGR.js} +6 -6
- package/dist/{chunk-3GIVRMID.js → chunk-7AQHVIZQ.js} +5 -5
- package/dist/{chunk-MD47SEWA.js → chunk-7JVIMWL6.js} +14 -14
- package/dist/{chunk-GZLJZGHX.js → chunk-DUDEWDFC.js} +7 -7
- package/dist/{chunk-KV7Z2TFQ.js → chunk-EBMNBGC2.js} +5 -5
- package/dist/{chunk-JB7D7QBL.js → chunk-EHQKOEDJ.js} +17 -17
- package/dist/{chunk-ZB2V476P.js → chunk-EQOD2M33.js} +10 -10
- package/dist/{chunk-WYC4YSOB.js → chunk-FHVK7GLR.js} +13 -13
- package/dist/{chunk-YXCPS3WU.js → chunk-FRVJZOHP.js} +6 -6
- package/dist/{chunk-LZ2DP3UC.js → chunk-GZXEG6LD.js} +5 -5
- package/dist/{chunk-VNNZDBYK.js → chunk-LKEBUK2C.js} +5 -5
- package/dist/{chunk-GZY7QBBF.js → chunk-QLUYPEP7.js} +5 -5
- package/dist/{chunk-AWZAOJRY.js → chunk-V5CWT56G.js} +5 -5
- package/dist/{chunk-CKEAAB42.js → chunk-VVL23XA2.js} +6 -6
- package/dist/{chunk-5P4WR3QW.js → chunk-VZPJTD4R.js} +13 -13
- package/dist/{chunk-DPECJANV.js → chunk-WOJ4CXUO.js} +15 -15
- package/dist/{chunk-55VLOA5R.js → chunk-YFZXDFYC.js} +14 -14
- package/dist/{chunk-IPODTOYM.js → chunk-YJIXBRNH.js} +5 -5
- package/dist/chunk-YNDZCLVL.js +307 -0
- package/dist/{chunk-4YZJJPK2.js → chunk-YVPSSX24.js} +15 -15
- package/dist/{chunk-7IKUTPWQ.js → chunk-YXB6APHS.js} +5 -5
- package/dist/{chunk-PP22IZ7I.js → chunk-ZB2EMLG6.js} +5 -5
- package/dist/cli/checkUnsupportedDataProxy.js +18 -18
- package/dist/cli/schemaContext.js +19 -19
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +17 -17
- package/dist/engine-commands/getConfig.js +9 -9
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEnginesInfo.js +4 -4
- package/dist/engine-commands/index.js +28 -28
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +9 -9
- package/dist/engine-commands/queryEngineCommons.js +6 -6
- package/dist/engine-commands/validate.js +9 -9
- package/dist/get-generators/getGenerators.js +20 -20
- package/dist/index.js +39 -39
- package/dist/sendPanic.js +3 -3
- package/dist/utils/getGitHubIssueUrl.js +4 -4
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +5 -5
- package/dist/wasm.js +5 -5
- package/package.json +14 -14
- package/dist/chunk-XKZ6CBLA.js +0 -281
|
@@ -26,28 +26,28 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_3APCYQQN_exports = {};
|
|
30
|
+
__export(chunk_3APCYQQN_exports, {
|
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
|
32
32
|
externalToInternalDmmf: () => import_get_dmmf2.externalToInternalDmmf,
|
|
33
33
|
getDMMF: () => getDMMF,
|
|
34
34
|
getInternalDMMF: () => getInternalDMMF
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(chunk_3APCYQQN_exports);
|
|
37
37
|
var import_chunk_IL7PSY44 = require("./chunk-IL7PSY44.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
38
|
+
var import_chunk_6Z766KGR = require("./chunk-6Z766KGR.js");
|
|
39
|
+
var import_chunk_QLUYPEP7 = require("./chunk-QLUYPEP7.js");
|
|
40
|
+
var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
|
|
41
41
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
42
42
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
43
43
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
44
44
|
var import_get_dmmf = require("@prisma/get-dmmf");
|
|
45
45
|
var import_get_dmmf2 = require("@prisma/get-dmmf");
|
|
46
46
|
var debug = (0, import_debug.default)("prisma:getDMMF");
|
|
47
|
-
var debugErrorType = (0,
|
|
47
|
+
var debugErrorType = (0, import_chunk_6Z766KGR.createDebugErrorType)(debug, "getDmmfWasm");
|
|
48
48
|
var GetDmmfError = class extends Error {
|
|
49
49
|
constructor(params) {
|
|
50
|
-
const constructedErrorMessage = (0,
|
|
50
|
+
const constructedErrorMessage = (0, import_chunk_YNDZCLVL.M)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
|
51
51
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
|
52
52
|
return `${reason}
|
|
53
53
|
${errorCodeMessage}
|
|
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: getDmmf]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_QLUYPEP7.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "GetDmmfError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
@@ -100,5 +100,5 @@ function mapWasmPanicToGetDmmfError(error, reason) {
|
|
|
100
100
|
return panic;
|
|
101
101
|
}
|
|
102
102
|
const errorOutput = error.message;
|
|
103
|
-
return new GetDmmfError((0,
|
|
103
|
+
return new GetDmmfError((0, import_chunk_6Z766KGR.parseQueryEngineError)({ errorOutput, reason }));
|
|
104
104
|
}
|
|
@@ -16,20 +16,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_3FC2IETP_exports = {};
|
|
20
|
+
__export(chunk_3FC2IETP_exports, {
|
|
21
21
|
getLintWarnings: () => getLintWarnings,
|
|
22
22
|
getLintWarningsAsText: () => getLintWarningsAsText,
|
|
23
23
|
handleLintPanic: () => handleLintPanic,
|
|
24
24
|
lintSchema: () => lintSchema,
|
|
25
25
|
warningToString: () => warningToString
|
|
26
26
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
28
|
-
var
|
|
27
|
+
module.exports = __toCommonJS(chunk_3FC2IETP_exports);
|
|
28
|
+
var import_chunk_ZB2EMLG6 = require("./chunk-ZB2EMLG6.js");
|
|
29
29
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
30
30
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
31
31
|
function lintSchema({ schemas }) {
|
|
32
|
-
const lintResult =
|
|
32
|
+
const lintResult = import_chunk_ZB2EMLG6.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
|
33
33
|
const lintDiagnostics = JSON.parse(lintResult);
|
|
34
34
|
return lintDiagnostics;
|
|
35
35
|
}
|
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_3VD46SL7_exports = {};
|
|
30
|
+
__export(chunk_3VD46SL7_exports, {
|
|
31
31
|
getEnginesInfo: () => getEnginesInfo,
|
|
32
32
|
resolveEngine: () => resolveEngine
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_3VD46SL7_exports);
|
|
35
35
|
var import_chunk_L6V54WGO = require("./chunk-L6V54WGO.js");
|
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
37
|
var import_chunk_5PJQQKQI = require("./chunk-5PJQQKQI.js");
|
|
38
38
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
39
|
-
var
|
|
39
|
+
var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
|
|
40
40
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
41
41
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
42
42
|
var import_path = __toESM(require("path"));
|
|
@@ -104,18 +104,18 @@ var fromNullable = function(a) {
|
|
|
104
104
|
};
|
|
105
105
|
function getEnginesInfo(enginesInfo) {
|
|
106
106
|
const errors = [];
|
|
107
|
-
const resolved = (0,
|
|
107
|
+
const resolved = (0, import_chunk_YNDZCLVL.M)(enginesInfo).with({ fromEnvVar: import_chunk_YNDZCLVL.z.when(isSome2) }, (_engineInfo) => {
|
|
108
108
|
return `, resolved by ${_engineInfo.fromEnvVar.value}`;
|
|
109
109
|
}).otherwise(() => "");
|
|
110
|
-
const absolutePath = (0,
|
|
110
|
+
const absolutePath = (0, import_chunk_YNDZCLVL.M)(enginesInfo).with({ path: import_chunk_YNDZCLVL.z.when(import_chunk_5DBOS77Y.isRight) }, (_engineInfo) => {
|
|
111
111
|
return _engineInfo.path.right;
|
|
112
|
-
}).with({ path:
|
|
112
|
+
}).with({ path: import_chunk_YNDZCLVL.z.when(import_chunk_5DBOS77Y.isLeft) }, (_engineInfo) => {
|
|
113
113
|
errors.push(_engineInfo.path.left);
|
|
114
114
|
return "E_CANNOT_RESOLVE_PATH";
|
|
115
115
|
}).exhaustive();
|
|
116
|
-
const version = (0,
|
|
116
|
+
const version = (0, import_chunk_YNDZCLVL.M)(enginesInfo).with({ version: import_chunk_YNDZCLVL.z.when(import_chunk_5DBOS77Y.isRight) }, (_engineInfo) => {
|
|
117
117
|
return _engineInfo.version.right;
|
|
118
|
-
}).with({ version:
|
|
118
|
+
}).with({ version: import_chunk_YNDZCLVL.z.when(import_chunk_5DBOS77Y.isLeft) }, (_engineInfo) => {
|
|
119
119
|
errors.push(_engineInfo.version.left);
|
|
120
120
|
return "E_CANNOT_RESOLVE_VERSION";
|
|
121
121
|
}).exhaustive();
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_6QMGKJXI_exports = {};
|
|
30
|
+
__export(chunk_6QMGKJXI_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
33
33
|
formatSchema: () => formatSchema,
|
|
@@ -40,7 +40,7 @@ __export(chunk_6PILE32P_exports, {
|
|
|
40
40
|
processSchemaResult: () => processSchemaResult,
|
|
41
41
|
skipIndex: () => skipIndex
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_6QMGKJXI_exports);
|
|
44
44
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
45
|
var import_chunk_DZ4QWHTB = require("./chunk-DZ4QWHTB.js");
|
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
@@ -50,15 +50,15 @@ var import_chunk_NUKBOD54 = require("./chunk-NUKBOD54.js");
|
|
|
50
50
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
51
51
|
var import_chunk_BGMZPA2F = require("./chunk-BGMZPA2F.js");
|
|
52
52
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
53
|
+
var import_chunk_YVPSSX24 = require("./chunk-YVPSSX24.js");
|
|
54
|
+
var import_chunk_EQOD2M33 = require("./chunk-EQOD2M33.js");
|
|
55
|
+
var import_chunk_3FC2IETP = require("./chunk-3FC2IETP.js");
|
|
56
|
+
var import_chunk_VZPJTD4R = require("./chunk-VZPJTD4R.js");
|
|
57
57
|
var import_chunk_2BXDHSSY = require("./chunk-2BXDHSSY.js");
|
|
58
|
-
var
|
|
58
|
+
var import_chunk_ZB2EMLG6 = require("./chunk-ZB2EMLG6.js");
|
|
59
59
|
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
60
60
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
61
|
-
var
|
|
61
|
+
var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
|
|
62
62
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
63
63
|
var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
|
|
64
64
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
@@ -76,7 +76,7 @@ var debug = (0, import_debug.default)("prisma:format");
|
|
|
76
76
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
77
77
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
78
78
|
handleFormatPanic(() => {
|
|
79
|
-
|
|
79
|
+
import_chunk_ZB2EMLG6.prismaSchemaWasm.debug_panic();
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
const defaultFormattingOptions = {
|
|
@@ -93,10 +93,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
|
93
93
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
|
94
94
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
|
95
95
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
96
|
-
const lintDiagnostics2 = (0,
|
|
96
|
+
const lintDiagnostics2 = (0, import_chunk_3FC2IETP.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
97
97
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
98
98
|
});
|
|
99
|
-
const lintWarnings = (0,
|
|
99
|
+
const lintWarnings = (0, import_chunk_3FC2IETP.getLintWarningsAsText)(lintDiagnostics);
|
|
100
100
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
101
101
|
console.warn(lintWarnings);
|
|
102
102
|
}
|
|
@@ -123,7 +123,7 @@ function handleFormatPanic(tryCb) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
function formatWasm(schema, documentFormattingParams) {
|
|
126
|
-
const formattedSchema =
|
|
126
|
+
const formattedSchema = import_chunk_ZB2EMLG6.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
127
127
|
return formattedSchema;
|
|
128
128
|
}
|
|
129
129
|
async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
|
|
@@ -152,7 +152,7 @@ async function processSchemaResult({
|
|
|
152
152
|
if (printLoadMessage) {
|
|
153
153
|
(0, import_chunk_2BXDHSSY.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
154
154
|
}
|
|
155
|
-
const configFromPsl = await (0,
|
|
155
|
+
const configFromPsl = await (0, import_chunk_YVPSSX24.getConfig)({ datamodel: schemaResult.schemas });
|
|
156
156
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
|
157
157
|
return {
|
|
158
158
|
schemaFiles: schemaResult.schemas,
|
|
@@ -206,7 +206,7 @@ async function getGenerators(options) {
|
|
|
206
206
|
throw new Error(import_chunk_BGMZPA2F.missingDatasource);
|
|
207
207
|
}
|
|
208
208
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
209
|
-
const dmmf = await (0,
|
|
209
|
+
const dmmf = await (0, import_chunk_EQOD2M33.getDMMF)({ datamodel: schemaContext.schemaFiles });
|
|
210
210
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
211
211
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
212
212
|
throw new Error(import_chunk_NUKBOD54.missingModelMessageMongoDB);
|
|
@@ -226,7 +226,7 @@ async function getGenerators(options) {
|
|
|
226
226
|
type: "rpc",
|
|
227
227
|
generatorPath: providerValue
|
|
228
228
|
};
|
|
229
|
-
const generatorInstance = (0,
|
|
229
|
+
const generatorInstance = (0, import_chunk_YNDZCLVL.M)(generatorDefinition).with({ type: "in-process" }, ({ generator }) => new import_chunk_BPDMLM32.InProcessGenerator(generatorConfig, generator)).with(
|
|
230
230
|
{ type: "rpc" },
|
|
231
231
|
({ generatorPath, isNode }) => new import_chunk_BPDMLM32.JsonRpcGenerator(generatorPath, generatorConfig, isNode)
|
|
232
232
|
).exhaustive();
|
|
@@ -254,7 +254,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
254
254
|
fromEnvVar: null
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
const datamodel = (0,
|
|
257
|
+
const datamodel = (0, import_chunk_VZPJTD4R.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
258
258
|
const options2 = {
|
|
259
259
|
datamodel,
|
|
260
260
|
datasources: schemaContext.datasources,
|
|
@@ -26,18 +26,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_6Z766KGR_exports = {};
|
|
30
|
+
__export(chunk_6Z766KGR_exports, {
|
|
31
31
|
createDebugErrorType: () => createDebugErrorType,
|
|
32
32
|
createSchemaValidationError: () => createSchemaValidationError,
|
|
33
33
|
parseQueryEngineError: () => parseQueryEngineError,
|
|
34
34
|
unlinkTempDatamodelPath: () => unlinkTempDatamodelPath
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(chunk_6Z766KGR_exports);
|
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
38
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
39
39
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
|
|
41
41
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
42
42
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
43
43
|
var import_fs = __toESM(require("fs"));
|
|
@@ -72,12 +72,12 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
|
72
72
|
),
|
|
73
73
|
(0, import_chunk_5DBOS77Y.map)((errorOutputAsJSON) => {
|
|
74
74
|
const defaultMessage = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)((0, import_chunk_C47SCASR.relativizePathInPSLError)(errorOutputAsJSON.message)));
|
|
75
|
-
const getConfigErrorInit = (0,
|
|
75
|
+
const getConfigErrorInit = (0, import_chunk_YNDZCLVL.M)(errorOutputAsJSON).with({ error_code: "P1012" }, (eJSON) => {
|
|
76
76
|
return {
|
|
77
77
|
reason: createSchemaValidationError(reason),
|
|
78
78
|
errorCode: eJSON.error_code
|
|
79
79
|
};
|
|
80
|
-
}).with({ error_code:
|
|
80
|
+
}).with({ error_code: import_chunk_YNDZCLVL.z.string }, (eJSON) => {
|
|
81
81
|
return {
|
|
82
82
|
reason,
|
|
83
83
|
errorCode: eJSON.error_code
|
|
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_7AQHVIZQ_exports = {};
|
|
20
|
+
__export(chunk_7AQHVIZQ_exports, {
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var packageJson = (0,
|
|
23
|
+
module.exports = __toCommonJS(chunk_7AQHVIZQ_exports);
|
|
24
|
+
var import_chunk_VVL23XA2 = require("./chunk-VVL23XA2.js");
|
|
25
|
+
var packageJson = (0, import_chunk_VVL23XA2.require_package)();
|
|
26
26
|
var version = packageJson.version;
|
|
@@ -26,19 +26,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_7JVIMWL6_exports = {};
|
|
30
|
+
__export(chunk_7JVIMWL6_exports, {
|
|
31
31
|
ValidateError: () => ValidateError,
|
|
32
32
|
validate: () => validate
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_7JVIMWL6_exports);
|
|
35
|
+
var import_chunk_6Z766KGR = require("./chunk-6Z766KGR.js");
|
|
36
36
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
37
37
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var import_chunk_EBMNBGC2 = require("./chunk-EBMNBGC2.js");
|
|
39
|
+
var import_chunk_ZB2EMLG6 = require("./chunk-ZB2EMLG6.js");
|
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
|
-
var
|
|
41
|
+
var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
|
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
43
43
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
44
44
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
@@ -47,7 +47,7 @@ var import_function = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_R6QH57
|
|
|
47
47
|
var debug = (0, import_debug.default)("prisma:validate");
|
|
48
48
|
var ValidateError = class extends Error {
|
|
49
49
|
constructor(params) {
|
|
50
|
-
const constructedErrorMessage = (0,
|
|
50
|
+
const constructedErrorMessage = (0, import_chunk_YNDZCLVL.M)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
|
51
51
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
|
52
52
|
return `${reason}
|
|
53
53
|
${errorCodeMessage}
|
|
@@ -59,25 +59,25 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: validate]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_EBMNBGC2.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "ValidateError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
function validate(options) {
|
|
67
|
-
const debugErrorType = (0,
|
|
67
|
+
const debugErrorType = (0, import_chunk_6Z766KGR.createDebugErrorType)(debug, "validateWasm");
|
|
68
68
|
debug(`Using validate Wasm`);
|
|
69
69
|
const validateEither = (0, import_function.pipe)(
|
|
70
70
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
71
71
|
() => {
|
|
72
72
|
if (process.env.FORCE_PANIC_GET_DMMF) {
|
|
73
73
|
debug("Triggering a Rust panic...");
|
|
74
|
-
|
|
74
|
+
import_chunk_ZB2EMLG6.prismaSchemaWasm.debug_panic();
|
|
75
75
|
}
|
|
76
76
|
const params = JSON.stringify({
|
|
77
77
|
prismaSchema: options.schemas,
|
|
78
78
|
noColor: Boolean(process.env.NO_COLOR)
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
import_chunk_ZB2EMLG6.prismaSchemaWasm.validate(params);
|
|
81
81
|
},
|
|
82
82
|
(e) => ({
|
|
83
83
|
type: "wasm-error",
|
|
@@ -89,7 +89,7 @@ function validate(options) {
|
|
|
89
89
|
if ((0, import_chunk_5DBOS77Y.isRight)(validateEither)) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
const error = (0,
|
|
92
|
+
const error = (0, import_chunk_YNDZCLVL.M)(validateEither.left).with({ type: "wasm-error" }, (e) => {
|
|
93
93
|
debugErrorType(e);
|
|
94
94
|
console.error("");
|
|
95
95
|
if ((0, import_chunk_LMVSIVKQ.isWasmPanic)(e.error)) {
|
|
@@ -109,7 +109,7 @@ function validate(options) {
|
|
|
109
109
|
return panic;
|
|
110
110
|
}
|
|
111
111
|
const errorOutput = e.error.message;
|
|
112
|
-
return new ValidateError((0,
|
|
112
|
+
return new ValidateError((0, import_chunk_6Z766KGR.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
113
113
|
}).exhaustive();
|
|
114
114
|
throw error;
|
|
115
115
|
}
|
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_DUDEWDFC_exports = {};
|
|
30
|
+
__export(chunk_DUDEWDFC_exports, {
|
|
31
31
|
handlePanic: () => handlePanic
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_DUDEWDFC_exports);
|
|
34
34
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_YXB6APHS = require("./chunk-YXB6APHS.js");
|
|
36
36
|
var import_chunk_FCYHZHVW = require("./chunk-FCYHZHVW.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_FRVJZOHP = require("./chunk-FRVJZOHP.js");
|
|
38
38
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
39
39
|
var import_prompts = __toESM(require("prompts"));
|
|
40
40
|
async function handlePanic(args) {
|
|
@@ -79,7 +79,7 @@ ${(0, import_chunk_PG5FDKSF.dim)(`Learn more: ${(0, import_chunk_I6WLABB2.link)(
|
|
|
79
79
|
if (shouldSubmitReport) {
|
|
80
80
|
try {
|
|
81
81
|
console.log("Submitting...");
|
|
82
|
-
const reportId = await (0,
|
|
82
|
+
const reportId = await (0, import_chunk_FRVJZOHP.sendPanic)({ error, cliVersion, enginesVersion, getDatabaseVersionSafe });
|
|
83
83
|
console.log(`
|
|
84
84
|
${(0, import_chunk_PG5FDKSF.bold)(`We successfully received the error report id: ${reportId}`)}`);
|
|
85
85
|
console.log(`
|
|
@@ -90,7 +90,7 @@ ${(0, import_chunk_PG5FDKSF.bold)("Thanks a lot for your help! \u{1F64F}")}`);
|
|
|
90
90
|
console.error(`${(0, import_chunk_PG5FDKSF.gray)("Error report submission failed due to: ")}`, error2);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
await (0,
|
|
93
|
+
await (0, import_chunk_YXB6APHS.wouldYouLikeToCreateANewIssue)({
|
|
94
94
|
prompt: !shouldSubmitReport,
|
|
95
95
|
error,
|
|
96
96
|
cliVersion,
|
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_EBMNBGC2_exports = {};
|
|
20
|
+
__export(chunk_EBMNBGC2_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_EBMNBGC2_exports);
|
|
24
24
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_LKEBUK2C = require("./chunk-LKEBUK2C.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_LKEBUK2C.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_EHQKOEDJ_exports = {};
|
|
30
|
+
__export(chunk_EHQKOEDJ_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
33
33
|
formatSchema: () => formatSchema,
|
|
@@ -40,7 +40,7 @@ __export(chunk_JB7D7QBL_exports, {
|
|
|
40
40
|
processSchemaResult: () => processSchemaResult,
|
|
41
41
|
skipIndex: () => skipIndex
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_EHQKOEDJ_exports);
|
|
44
44
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
45
|
var import_chunk_DZ4QWHTB = require("./chunk-DZ4QWHTB.js");
|
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
@@ -50,15 +50,15 @@ var import_chunk_NUKBOD54 = require("./chunk-NUKBOD54.js");
|
|
|
50
50
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
51
51
|
var import_chunk_BGMZPA2F = require("./chunk-BGMZPA2F.js");
|
|
52
52
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
53
|
+
var import_chunk_WOJ4CXUO = require("./chunk-WOJ4CXUO.js");
|
|
54
|
+
var import_chunk_3APCYQQN = require("./chunk-3APCYQQN.js");
|
|
55
|
+
var import_chunk_YJIXBRNH = require("./chunk-YJIXBRNH.js");
|
|
56
|
+
var import_chunk_FHVK7GLR = require("./chunk-FHVK7GLR.js");
|
|
57
57
|
var import_chunk_2BXDHSSY = require("./chunk-2BXDHSSY.js");
|
|
58
|
-
var
|
|
58
|
+
var import_chunk_V5CWT56G = require("./chunk-V5CWT56G.js");
|
|
59
59
|
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
60
60
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
61
|
-
var
|
|
61
|
+
var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
|
|
62
62
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
63
63
|
var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
|
|
64
64
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
@@ -76,7 +76,7 @@ var debug = (0, import_debug.default)("prisma:format");
|
|
|
76
76
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
77
77
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
78
78
|
handleFormatPanic(() => {
|
|
79
|
-
|
|
79
|
+
import_chunk_V5CWT56G.prismaSchemaWasm.debug_panic();
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
const defaultFormattingOptions = {
|
|
@@ -93,10 +93,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
|
93
93
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
|
94
94
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
|
95
95
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
96
|
-
const lintDiagnostics2 = (0,
|
|
96
|
+
const lintDiagnostics2 = (0, import_chunk_YJIXBRNH.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
97
97
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
98
98
|
});
|
|
99
|
-
const lintWarnings = (0,
|
|
99
|
+
const lintWarnings = (0, import_chunk_YJIXBRNH.getLintWarningsAsText)(lintDiagnostics);
|
|
100
100
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
101
101
|
console.warn(lintWarnings);
|
|
102
102
|
}
|
|
@@ -123,7 +123,7 @@ function handleFormatPanic(tryCb) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
function formatWasm(schema, documentFormattingParams) {
|
|
126
|
-
const formattedSchema =
|
|
126
|
+
const formattedSchema = import_chunk_V5CWT56G.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
127
127
|
return formattedSchema;
|
|
128
128
|
}
|
|
129
129
|
async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
|
|
@@ -152,7 +152,7 @@ async function processSchemaResult({
|
|
|
152
152
|
if (printLoadMessage) {
|
|
153
153
|
(0, import_chunk_2BXDHSSY.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
154
154
|
}
|
|
155
|
-
const configFromPsl = await (0,
|
|
155
|
+
const configFromPsl = await (0, import_chunk_WOJ4CXUO.getConfig)({ datamodel: schemaResult.schemas });
|
|
156
156
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
|
157
157
|
return {
|
|
158
158
|
schemaFiles: schemaResult.schemas,
|
|
@@ -206,7 +206,7 @@ async function getGenerators(options) {
|
|
|
206
206
|
throw new Error(import_chunk_BGMZPA2F.missingDatasource);
|
|
207
207
|
}
|
|
208
208
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
209
|
-
const dmmf = await (0,
|
|
209
|
+
const dmmf = await (0, import_chunk_3APCYQQN.getDMMF)({ datamodel: schemaContext.schemaFiles });
|
|
210
210
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
211
211
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
212
212
|
throw new Error(import_chunk_NUKBOD54.missingModelMessageMongoDB);
|
|
@@ -226,7 +226,7 @@ async function getGenerators(options) {
|
|
|
226
226
|
type: "rpc",
|
|
227
227
|
generatorPath: providerValue
|
|
228
228
|
};
|
|
229
|
-
const generatorInstance = (0,
|
|
229
|
+
const generatorInstance = (0, import_chunk_YNDZCLVL.M)(generatorDefinition).with({ type: "in-process" }, ({ generator }) => new import_chunk_BPDMLM32.InProcessGenerator(generatorConfig, generator)).with(
|
|
230
230
|
{ type: "rpc" },
|
|
231
231
|
({ generatorPath, isNode }) => new import_chunk_BPDMLM32.JsonRpcGenerator(generatorPath, generatorConfig, isNode)
|
|
232
232
|
).exhaustive();
|
|
@@ -254,7 +254,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
254
254
|
fromEnvVar: null
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
const datamodel = (0,
|
|
257
|
+
const datamodel = (0, import_chunk_FHVK7GLR.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
258
258
|
const options2 = {
|
|
259
259
|
datamodel,
|
|
260
260
|
datasources: schemaContext.datasources,
|
|
@@ -26,28 +26,28 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_EQOD2M33_exports = {};
|
|
30
|
+
__export(chunk_EQOD2M33_exports, {
|
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
|
32
32
|
externalToInternalDmmf: () => import_get_dmmf2.externalToInternalDmmf,
|
|
33
33
|
getDMMF: () => getDMMF,
|
|
34
34
|
getInternalDMMF: () => getInternalDMMF
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(chunk_EQOD2M33_exports);
|
|
37
37
|
var import_chunk_IL7PSY44 = require("./chunk-IL7PSY44.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
38
|
+
var import_chunk_6Z766KGR = require("./chunk-6Z766KGR.js");
|
|
39
|
+
var import_chunk_EBMNBGC2 = require("./chunk-EBMNBGC2.js");
|
|
40
|
+
var import_chunk_YNDZCLVL = require("./chunk-YNDZCLVL.js");
|
|
41
41
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
42
42
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
43
43
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
44
44
|
var import_get_dmmf = require("@prisma/get-dmmf");
|
|
45
45
|
var import_get_dmmf2 = require("@prisma/get-dmmf");
|
|
46
46
|
var debug = (0, import_debug.default)("prisma:getDMMF");
|
|
47
|
-
var debugErrorType = (0,
|
|
47
|
+
var debugErrorType = (0, import_chunk_6Z766KGR.createDebugErrorType)(debug, "getDmmfWasm");
|
|
48
48
|
var GetDmmfError = class extends Error {
|
|
49
49
|
constructor(params) {
|
|
50
|
-
const constructedErrorMessage = (0,
|
|
50
|
+
const constructedErrorMessage = (0, import_chunk_YNDZCLVL.M)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
|
51
51
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
|
52
52
|
return `${reason}
|
|
53
53
|
${errorCodeMessage}
|
|
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: getDmmf]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_EBMNBGC2.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "GetDmmfError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
@@ -100,5 +100,5 @@ function mapWasmPanicToGetDmmfError(error, reason) {
|
|
|
100
100
|
return panic;
|
|
101
101
|
}
|
|
102
102
|
const errorOutput = error.message;
|
|
103
|
-
return new GetDmmfError((0,
|
|
103
|
+
return new GetDmmfError((0, import_chunk_6Z766KGR.parseQueryEngineError)({ errorOutput, reason }));
|
|
104
104
|
}
|