@prisma/internals 5.19.0-dev.12 → 5.19.0-dev.13
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-QL3K6JIN.js → chunk-244YD7SK.js} +7 -7
- package/dist/{chunk-2GL5KAYM.js → chunk-34FTC6KK.js} +5 -5
- package/dist/{chunk-3DGPDGD3.js → chunk-42K3GPYJ.js} +4 -4
- package/dist/chunk-5XRQ7ONW.js +122 -0
- package/dist/{chunk-VU4BZAMD.js → chunk-6GTQHWWT.js} +5 -5
- package/dist/{chunk-3CEAGGAZ.js → chunk-7KXMQZFT.js} +5 -5
- package/dist/{chunk-4A5ZK522.js → chunk-7MD6344A.js} +3 -3
- package/dist/{chunk-GHYJGM56.js → chunk-7SPHTPDV.js} +5 -5
- package/dist/{chunk-P7PMCE2W.js → chunk-CNKDIKWK.js} +16 -16
- package/dist/{chunk-6TPLIQJ5.js → chunk-CYKOCRN3.js} +15 -15
- package/dist/{chunk-B7JVEC2F.js → chunk-D3G3WRZU.js} +5 -5
- package/dist/{chunk-4RKJ76H7.js → chunk-DQMYNBP3.js} +5 -5
- package/dist/{chunk-SLGMG65I.js → chunk-EBLDSWRI.js} +20 -14
- package/dist/{chunk-PN2OFBAO.js → chunk-G4BGJ6IP.js} +5 -5
- package/dist/{chunk-EYOPVHNV.js → chunk-HD4N22SB.js} +28 -28
- package/dist/{chunk-RZG4NJ36.js → chunk-I3YDYYM2.js} +15 -15
- package/dist/{chunk-KUMD5MBR.js → chunk-IAEMHQAC.js} +10 -10
- package/dist/{chunk-AP37UO7C.js → chunk-IB5PDCFO.js} +5 -5
- package/dist/{chunk-J3L6JLSQ.js → chunk-IJUVQMZY.js} +5 -5
- package/dist/{chunk-JBKRHDKT.js → chunk-IY43XBPH.js} +16 -16
- package/dist/{chunk-6J3WFMQY.js → chunk-JPEBIQUM.js} +40 -811
- package/dist/{chunk-4KELZQEZ.js → chunk-KBVBWTBF.js} +23 -23
- package/dist/{chunk-RDUPLVMD.js → chunk-KK64NLNR.js} +5 -5
- package/dist/chunk-NDEGWMVS.js +177 -0
- package/dist/{chunk-AFG6YPOK.js → chunk-NK2ML3NJ.js} +5 -5
- package/dist/chunk-NXIWDQBF.js +110 -0
- package/dist/{chunk-QOTVZEEZ.js → chunk-PFLLVWZX.js} +4 -4
- package/dist/chunk-QIVUAERL.js +2202 -0
- package/dist/{chunk-OKF6INNR.js → chunk-QQJZI2CR.js} +22 -22
- package/dist/{chunk-YM3CE76B.js → chunk-S3323RUL.js} +48 -48
- package/dist/{chunk-NQ7OW3TG.js → chunk-TZ2WAB57.js} +23 -23
- package/dist/chunk-X4GRUQLB.js +166 -0
- package/dist/chunk-X6M256IK.js +54 -0
- package/dist/{chunk-3I7L4PJV.js → chunk-XKRUNUS5.js} +22 -22
- package/dist/{chunk-5M5ACSPI.js → chunk-YIJ776AZ.js} +35 -35
- package/dist/cli/checkUnsupportedDataProxy.js +21 -21
- package/dist/cli/getSchema.js +26 -26
- package/dist/cli/hashes.js +21 -21
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +20 -20
- package/dist/engine-commands/getConfig.js +13 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +5 -5
- package/dist/engine-commands/getEnginesMetaInfo.js +8 -8
- package/dist/engine-commands/index.js +31 -31
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +10 -10
- package/dist/engine-commands/queryEngineCommons.js +7 -7
- package/dist/engine-commands/validate.js +10 -10
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +20 -20
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +20 -20
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.js +20 -20
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +21 -21
- package/dist/get-generators/getGenerators.js +23 -23
- package/dist/getPackedPackage.js +2 -2
- package/dist/index.js +59 -59
- package/dist/resolveBinary.js +7 -7
- package/dist/schemaEngineCommands.js +8 -8
- package/dist/sendPanic.js +20 -20
- package/dist/utils/fs-functional.js +9 -9
- package/dist/utils/getEnvPaths.js +20 -20
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +20 -20
- package/dist/utils/loadEnvFile.js +20 -20
- package/dist/wasm.js +4 -4
- package/package.json +8 -8
|
@@ -0,0 +1,166 @@
|
|
|
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 chunk_X4GRUQLB_exports = {};
|
|
20
|
+
__export(chunk_X4GRUQLB_exports, {
|
|
21
|
+
SchemaEngineExitCode: () => SchemaEngineExitCode,
|
|
22
|
+
canConnectToDatabase: () => canConnectToDatabase,
|
|
23
|
+
createDatabase: () => createDatabase,
|
|
24
|
+
dropDatabase: () => dropDatabase,
|
|
25
|
+
execaCommand: () => execaCommand
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(chunk_X4GRUQLB_exports);
|
|
28
|
+
var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
|
|
29
|
+
var import_chunk_7SPHTPDV = require("./chunk-7SPHTPDV.js");
|
|
30
|
+
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
31
|
+
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
32
|
+
var import_execa = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_7XNZDY2V.require_execa)());
|
|
33
|
+
var SchemaEngineExitCode = /* @__PURE__ */ ((SchemaEngineExitCode2) => {
|
|
34
|
+
SchemaEngineExitCode2[SchemaEngineExitCode2["Success"] = 0] = "Success";
|
|
35
|
+
SchemaEngineExitCode2[SchemaEngineExitCode2["Error"] = 1] = "Error";
|
|
36
|
+
SchemaEngineExitCode2[SchemaEngineExitCode2["Panic"] = 101] = "Panic";
|
|
37
|
+
return SchemaEngineExitCode2;
|
|
38
|
+
})(SchemaEngineExitCode || {});
|
|
39
|
+
function parseJsonFromStderr(stderr) {
|
|
40
|
+
const lines = stderr.split(/\r?\n/).slice(1);
|
|
41
|
+
const logs = [];
|
|
42
|
+
for (const line of lines) {
|
|
43
|
+
const data = String(line);
|
|
44
|
+
try {
|
|
45
|
+
const json = JSON.parse(data);
|
|
46
|
+
logs.push(json);
|
|
47
|
+
} catch (e) {
|
|
48
|
+
throw new Error(`Could not parse schema engine response: ${e}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return logs;
|
|
52
|
+
}
|
|
53
|
+
async function canConnectToDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
|
|
54
|
+
if (!connectionString) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
"Connection url is empty. See https://www.prisma.io/docs/reference/database-reference/connection-urls"
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
await execaCommand({
|
|
61
|
+
connectionString,
|
|
62
|
+
cwd,
|
|
63
|
+
schemaEnginePath,
|
|
64
|
+
engineCommandName: "can-connect-to-database"
|
|
65
|
+
});
|
|
66
|
+
} catch (_e) {
|
|
67
|
+
const e = _e;
|
|
68
|
+
if (e.stderr) {
|
|
69
|
+
const logs = parseJsonFromStderr(e.stderr);
|
|
70
|
+
const error = logs.find((it) => it.level === "ERROR" && it.target === "schema_engine::logger");
|
|
71
|
+
if (error && error.fields.error_code && error.fields.message) {
|
|
72
|
+
return {
|
|
73
|
+
code: error.fields.error_code,
|
|
74
|
+
message: error.fields.message
|
|
75
|
+
};
|
|
76
|
+
} else {
|
|
77
|
+
throw new Error(`Schema engine error:
|
|
78
|
+
${logs.map((log) => log.fields.message).join("\n")}`);
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
throw new Error(`Schema engine exited. ${_e}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
async function createDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
|
|
87
|
+
const dbExists = await canConnectToDatabase(connectionString, cwd, schemaEnginePath);
|
|
88
|
+
if (dbExists === true) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
await execaCommand({
|
|
93
|
+
connectionString,
|
|
94
|
+
cwd,
|
|
95
|
+
schemaEnginePath,
|
|
96
|
+
engineCommandName: "create-database"
|
|
97
|
+
});
|
|
98
|
+
return true;
|
|
99
|
+
} catch (_e) {
|
|
100
|
+
const e = _e;
|
|
101
|
+
if (e.stderr) {
|
|
102
|
+
const logs = parseJsonFromStderr(e.stderr);
|
|
103
|
+
const error = logs.find((it) => it.level === "ERROR" && it.target === "schema_engine::logger");
|
|
104
|
+
if (error && error.fields.error_code && error.fields.message) {
|
|
105
|
+
throw new Error(`${error.fields.error_code}: ${error.fields.message}`);
|
|
106
|
+
} else {
|
|
107
|
+
throw new Error(`Schema engine error:
|
|
108
|
+
${logs.map((log) => log.fields.message).join("\n")}`);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
throw new Error(`Schema engine exited. ${_e}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async function dropDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
|
|
116
|
+
try {
|
|
117
|
+
const result = await execaCommand({
|
|
118
|
+
connectionString,
|
|
119
|
+
cwd,
|
|
120
|
+
schemaEnginePath,
|
|
121
|
+
engineCommandName: "drop-database"
|
|
122
|
+
});
|
|
123
|
+
if (result && result.exitCode === 0 && result.stderr.includes("The database was successfully dropped")) {
|
|
124
|
+
return true;
|
|
125
|
+
} else {
|
|
126
|
+
throw Error(`An error occurred during the drop: ${JSON.stringify(result, void 0, 2)}`);
|
|
127
|
+
}
|
|
128
|
+
} catch (e) {
|
|
129
|
+
if (e.stderr) {
|
|
130
|
+
const logs = parseJsonFromStderr(e.stderr);
|
|
131
|
+
throw new Error(`Schema engine error:
|
|
132
|
+
${logs.map((log) => log.fields.message).join("\n")}`);
|
|
133
|
+
} else {
|
|
134
|
+
throw new Error(`Schema engine exited. ${e}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function execaCommand({
|
|
139
|
+
connectionString,
|
|
140
|
+
cwd,
|
|
141
|
+
schemaEnginePath,
|
|
142
|
+
engineCommandName
|
|
143
|
+
}) {
|
|
144
|
+
schemaEnginePath = schemaEnginePath || await (0, import_chunk_7SPHTPDV.resolveBinary)(import_fetch_engine.BinaryType.SchemaEngineBinary);
|
|
145
|
+
try {
|
|
146
|
+
return await (0, import_execa.default)(schemaEnginePath, ["cli", "--datasource", connectionString, engineCommandName], {
|
|
147
|
+
cwd,
|
|
148
|
+
env: {
|
|
149
|
+
RUST_BACKTRACE: process.env.RUST_BACKTRACE ?? "1",
|
|
150
|
+
RUST_LOG: process.env.RUST_LOG ?? "info"
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
} catch (_e) {
|
|
154
|
+
const e = _e;
|
|
155
|
+
if (e.message) {
|
|
156
|
+
e.message = e.message.replace(connectionString, "<REDACTED>");
|
|
157
|
+
}
|
|
158
|
+
if (e.stdout) {
|
|
159
|
+
e.stdout = e.stdout.replace(connectionString, "<REDACTED>");
|
|
160
|
+
}
|
|
161
|
+
if (e.stderr) {
|
|
162
|
+
e.stderr = e.stderr.replace(connectionString, "<REDACTED>");
|
|
163
|
+
}
|
|
164
|
+
throw e;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 chunk_X6M256IK_exports = {};
|
|
20
|
+
__export(chunk_X6M256IK_exports, {
|
|
21
|
+
getEngineVersion: () => getEngineVersion,
|
|
22
|
+
safeGetEngineVersion: () => safeGetEngineVersion
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(chunk_X6M256IK_exports);
|
|
25
|
+
var import_chunk_S4LINK5Y = require("./chunk-S4LINK5Y.js");
|
|
26
|
+
var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
|
|
27
|
+
var import_chunk_NXIWDQBF = require("./chunk-NXIWDQBF.js");
|
|
28
|
+
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
|
29
|
+
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
30
|
+
var import_engines = require("@prisma/engines");
|
|
31
|
+
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
32
|
+
var import_get_platform = require("@prisma/get-platform");
|
|
33
|
+
var import_execa = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_7XNZDY2V.require_execa)());
|
|
34
|
+
async function getEngineVersion(enginePath, binaryName) {
|
|
35
|
+
if (!binaryName) {
|
|
36
|
+
binaryName = (0, import_engines.getCliQueryEngineBinaryType)();
|
|
37
|
+
}
|
|
38
|
+
enginePath = await (0, import_chunk_NXIWDQBF.resolveBinary)(binaryName, enginePath);
|
|
39
|
+
const platformInfo = await (0, import_get_platform.getPlatformInfo)();
|
|
40
|
+
if (binaryName === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
|
41
|
+
(0, import_get_platform.assertNodeAPISupported)();
|
|
42
|
+
const QE = (0, import_chunk_S4LINK5Y.loadLibrary)(enginePath, platformInfo);
|
|
43
|
+
return `${import_fetch_engine.BinaryType.QueryEngineLibrary} ${QE.version().commit}`;
|
|
44
|
+
} else {
|
|
45
|
+
const { stdout } = await (0, import_execa.default)(enginePath, ["--version"]);
|
|
46
|
+
return stdout;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function safeGetEngineVersion(enginePath, binaryName) {
|
|
50
|
+
return (0, import_chunk_7MD6344A.tryCatch2)(
|
|
51
|
+
() => getEngineVersion(enginePath, binaryName),
|
|
52
|
+
(error) => error
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -26,25 +26,25 @@ 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_XKRUNUS5_exports = {};
|
|
30
|
+
__export(chunk_XKRUNUS5_exports, {
|
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
|
32
32
|
getDMMF: () => getDMMF
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_XKRUNUS5_exports);
|
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
36
|
+
var import_chunk_IAEMHQAC = require("./chunk-IAEMHQAC.js");
|
|
37
|
+
var import_chunk_NK2ML3NJ = require("./chunk-NK2ML3NJ.js");
|
|
38
|
+
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
|
39
39
|
var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_IJUVQMZY = require("./chunk-IJUVQMZY.js");
|
|
41
41
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
|
42
|
-
var
|
|
42
|
+
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
|
43
43
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
44
44
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
45
45
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
46
46
|
var import_fs = __toESM(require("fs"));
|
|
47
|
-
var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0,
|
|
47
|
+
var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_PFLLVWZX.require_function)());
|
|
48
48
|
var debug = (0, import_debug.default)("prisma:getDMMF");
|
|
49
49
|
var GetDmmfError = class extends Error {
|
|
50
50
|
constructor(params) {
|
|
@@ -60,16 +60,16 @@ ${detailsHeader} ${message}`;
|
|
|
60
60
|
}).exhaustive();
|
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
62
62
|
[Context: getDmmf]`;
|
|
63
|
-
super((0,
|
|
63
|
+
super((0, import_chunk_NK2ML3NJ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
64
64
|
this.name = "GetDmmfError";
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
async function getDMMF(options) {
|
|
68
68
|
warnOnDeprecatedFeatureFlag(options.previewFeatures);
|
|
69
|
-
const debugErrorType = (0,
|
|
69
|
+
const debugErrorType = (0, import_chunk_IAEMHQAC.createDebugErrorType)(debug, "getDmmfWasm");
|
|
70
70
|
debug(`Using getDmmf Wasm`);
|
|
71
71
|
const dmmfPipeline = (0, import_function.pipe)(
|
|
72
|
-
(0,
|
|
72
|
+
(0, import_chunk_7MD6344A.tryCatch2)(
|
|
73
73
|
() => {
|
|
74
74
|
if (options.datamodel) {
|
|
75
75
|
debug("Using given datamodel");
|
|
@@ -85,19 +85,19 @@ async function getDMMF(options) {
|
|
|
85
85
|
datamodelPath: options.datamodelPath
|
|
86
86
|
})
|
|
87
87
|
),
|
|
88
|
-
(0,
|
|
88
|
+
(0, import_chunk_7MD6344A.chainW2)((datamodel) => {
|
|
89
89
|
return (0, import_function.pipe)(
|
|
90
|
-
(0,
|
|
90
|
+
(0, import_chunk_7MD6344A.tryCatch)(
|
|
91
91
|
() => {
|
|
92
92
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
|
93
93
|
debug("Triggering a Rust panic...");
|
|
94
|
-
|
|
94
|
+
import_chunk_IJUVQMZY.prismaSchemaWasm.debug_panic();
|
|
95
95
|
}
|
|
96
96
|
const params = JSON.stringify({
|
|
97
97
|
prismaSchema: datamodel,
|
|
98
98
|
noColor: Boolean(process.env.NO_COLOR)
|
|
99
99
|
});
|
|
100
|
-
const data =
|
|
100
|
+
const data = import_chunk_IJUVQMZY.prismaSchemaWasm.get_dmmf(params);
|
|
101
101
|
return data;
|
|
102
102
|
},
|
|
103
103
|
(e) => ({
|
|
@@ -106,11 +106,11 @@ async function getDMMF(options) {
|
|
|
106
106
|
error: e
|
|
107
107
|
})
|
|
108
108
|
),
|
|
109
|
-
(0,
|
|
110
|
-
(0,
|
|
109
|
+
(0, import_chunk_7MD6344A.map)((result) => ({ result })),
|
|
110
|
+
(0, import_chunk_7MD6344A.chainW)(
|
|
111
111
|
({ result }) => (
|
|
112
112
|
// NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
|
|
113
|
-
(0,
|
|
113
|
+
(0, import_chunk_7MD6344A.tryCatch)(
|
|
114
114
|
() => JSON.parse(result),
|
|
115
115
|
(e) => ({
|
|
116
116
|
type: "parse-json",
|
|
@@ -120,12 +120,12 @@ async function getDMMF(options) {
|
|
|
120
120
|
)
|
|
121
121
|
)
|
|
122
122
|
),
|
|
123
|
-
|
|
123
|
+
import_chunk_7MD6344A.fromEither
|
|
124
124
|
);
|
|
125
125
|
})
|
|
126
126
|
);
|
|
127
127
|
const dmmfEither = await dmmfPipeline();
|
|
128
|
-
if ((0,
|
|
128
|
+
if ((0, import_chunk_7MD6344A.isRight)(dmmfEither)) {
|
|
129
129
|
debug("dmmf data retrieved without errors in getDmmf Wasm");
|
|
130
130
|
const { right: data } = dmmfEither;
|
|
131
131
|
return Promise.resolve(data);
|
|
@@ -158,7 +158,7 @@ Datamodel path: "${e.datamodelPath}"`,
|
|
|
158
158
|
return panic;
|
|
159
159
|
}
|
|
160
160
|
const errorOutput = e.error.message;
|
|
161
|
-
return new GetDmmfError((0,
|
|
161
|
+
return new GetDmmfError((0, import_chunk_IAEMHQAC.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
162
162
|
}).with({ type: "parse-json" }, (e) => {
|
|
163
163
|
debugErrorType(e);
|
|
164
164
|
return new GetDmmfError({ _tag: "unparsed", message: e.error.message, reason: e.reason });
|
|
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export2(
|
|
29
|
+
var chunk_YIJ776AZ_exports = {};
|
|
30
|
+
__export2(chunk_YIJ776AZ_exports, {
|
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
33
33
|
checkYarnVersion: () => checkYarnVersion,
|
|
@@ -56,7 +56,7 @@ __export2(chunk_5M5ACSPI_exports, {
|
|
|
56
56
|
sendPanic: () => sendPanic,
|
|
57
57
|
skipIndex: () => skipIndex
|
|
58
58
|
});
|
|
59
|
-
module.exports = __toCommonJS2(
|
|
59
|
+
module.exports = __toCommonJS2(chunk_YIJ776AZ_exports);
|
|
60
60
|
var import_chunk_IABMG3F4 = require("./chunk-IABMG3F4.js");
|
|
61
61
|
var import_chunk_FTS2IEWX = require("./chunk-FTS2IEWX.js");
|
|
62
62
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
|
@@ -81,13 +81,13 @@ var import_chunk_XLYQ6PQW = require("./chunk-XLYQ6PQW.js");
|
|
|
81
81
|
var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
|
|
82
82
|
var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
|
|
83
83
|
var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
84
|
+
var import_chunk_7KXMQZFT = require("./chunk-7KXMQZFT.js");
|
|
85
|
+
var import_chunk_CYKOCRN3 = require("./chunk-CYKOCRN3.js");
|
|
86
|
+
var import_chunk_KBVBWTBF = require("./chunk-KBVBWTBF.js");
|
|
87
|
+
var import_chunk_XKRUNUS5 = require("./chunk-XKRUNUS5.js");
|
|
88
88
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
|
89
89
|
var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
|
|
90
|
-
var
|
|
90
|
+
var import_chunk_IJUVQMZY = require("./chunk-IJUVQMZY.js");
|
|
91
91
|
var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
|
|
92
92
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
|
93
93
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
@@ -96,7 +96,7 @@ var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
|
|
96
96
|
var import_chunk_635TMBAP = require("./chunk-635TMBAP.js");
|
|
97
97
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
98
98
|
var import_chunk_4NFLAUKD = require("./chunk-4NFLAUKD.js");
|
|
99
|
-
var
|
|
99
|
+
var import_chunk_EBLDSWRI = require("./chunk-EBLDSWRI.js");
|
|
100
100
|
var import_chunk_FUUQ6FJ4 = require("./chunk-FUUQ6FJ4.js");
|
|
101
101
|
var import_chunk_KKMREGHN = require("./chunk-KKMREGHN.js");
|
|
102
102
|
var import_chunk_AZNLB67U = require("./chunk-AZNLB67U.js");
|
|
@@ -440,7 +440,7 @@ var require_readdir_glob = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
440
440
|
module2.exports = readdirGlob;
|
|
441
441
|
var fs8 = (0, import_chunk_WWAWV7DQ.__require)("fs");
|
|
442
442
|
var { EventEmitter } = (0, import_chunk_WWAWV7DQ.__require)("events");
|
|
443
|
-
var { Minimatch } = (0,
|
|
443
|
+
var { Minimatch } = (0, import_chunk_EBLDSWRI.require_minimatch)();
|
|
444
444
|
var { resolve } = (0, import_chunk_WWAWV7DQ.__require)("path");
|
|
445
445
|
function readdir(dir2, strict) {
|
|
446
446
|
return new Promise((resolve2, reject2) => {
|
|
@@ -3619,7 +3619,7 @@ var require_stream_writable = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3619
3619
|
var Duplex;
|
|
3620
3620
|
Writable.WritableState = WritableState;
|
|
3621
3621
|
var util = Object.create(require_util());
|
|
3622
|
-
util.inherits = (0,
|
|
3622
|
+
util.inherits = (0, import_chunk_EBLDSWRI.require_inherits)();
|
|
3623
3623
|
var internalUtil = {
|
|
3624
3624
|
deprecate: require_node()
|
|
3625
3625
|
};
|
|
@@ -4057,7 +4057,7 @@ var require_stream_duplex = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
4057
4057
|
};
|
|
4058
4058
|
module2.exports = Duplex;
|
|
4059
4059
|
var util = Object.create(require_util());
|
|
4060
|
-
util.inherits = (0,
|
|
4060
|
+
util.inherits = (0, import_chunk_EBLDSWRI.require_inherits)();
|
|
4061
4061
|
var Readable = require_stream_readable();
|
|
4062
4062
|
var Writable = require_stream_writable();
|
|
4063
4063
|
util.inherits(Duplex, Readable);
|
|
@@ -4378,7 +4378,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
4378
4378
|
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
4379
4379
|
}
|
|
4380
4380
|
var util = Object.create(require_util());
|
|
4381
|
-
util.inherits = (0,
|
|
4381
|
+
util.inherits = (0, import_chunk_EBLDSWRI.require_inherits)();
|
|
4382
4382
|
var debugUtil = (0, import_chunk_WWAWV7DQ.__require)("util");
|
|
4383
4383
|
var debug8 = void 0;
|
|
4384
4384
|
if (debugUtil && debugUtil.debuglog) {
|
|
@@ -5045,7 +5045,7 @@ var require_stream_transform = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5045
5045
|
module2.exports = Transform;
|
|
5046
5046
|
var Duplex = require_stream_duplex();
|
|
5047
5047
|
var util = Object.create(require_util());
|
|
5048
|
-
util.inherits = (0,
|
|
5048
|
+
util.inherits = (0, import_chunk_EBLDSWRI.require_inherits)();
|
|
5049
5049
|
util.inherits(Transform, Duplex);
|
|
5050
5050
|
function afterTransform(er, data) {
|
|
5051
5051
|
var ts = this._transformState;
|
|
@@ -5143,7 +5143,7 @@ var require_stream_passthrough = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5143
5143
|
module2.exports = PassThrough;
|
|
5144
5144
|
var Transform = require_stream_transform();
|
|
5145
5145
|
var util = Object.create(require_util());
|
|
5146
|
-
util.inherits = (0,
|
|
5146
|
+
util.inherits = (0, import_chunk_EBLDSWRI.require_inherits)();
|
|
5147
5147
|
util.inherits(PassThrough, Transform);
|
|
5148
5148
|
function PassThrough(options2) {
|
|
5149
5149
|
if (!(this instanceof PassThrough)) return new PassThrough(options2);
|
|
@@ -6429,7 +6429,7 @@ var require_stream_writable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6429
6429
|
var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
|
|
6430
6430
|
var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
6431
6431
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
6432
|
-
(0,
|
|
6432
|
+
(0, import_chunk_EBLDSWRI.require_inherits)()(Writable, Stream);
|
|
6433
6433
|
function nop() {
|
|
6434
6434
|
}
|
|
6435
6435
|
function WritableState(options2, stream, isDuplex) {
|
|
@@ -6871,7 +6871,7 @@ var require_stream_duplex2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6871
6871
|
module2.exports = Duplex;
|
|
6872
6872
|
var Readable = require_stream_readable2();
|
|
6873
6873
|
var Writable = require_stream_writable2();
|
|
6874
|
-
(0,
|
|
6874
|
+
(0, import_chunk_EBLDSWRI.require_inherits)()(Duplex, Readable);
|
|
6875
6875
|
{
|
|
6876
6876
|
keys = objectKeys(Writable.prototype);
|
|
6877
6877
|
for (v = 0; v < keys.length; v++) {
|
|
@@ -7648,7 +7648,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7648
7648
|
var StringDecoder;
|
|
7649
7649
|
var createReadableStreamAsyncIterator;
|
|
7650
7650
|
var from;
|
|
7651
|
-
(0,
|
|
7651
|
+
(0, import_chunk_EBLDSWRI.require_inherits)()(Readable, Stream);
|
|
7652
7652
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
7653
7653
|
var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
|
|
7654
7654
|
function prependListener(emitter, event, fn) {
|
|
@@ -8353,7 +8353,7 @@ var require_stream_transform2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8353
8353
|
var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING;
|
|
8354
8354
|
var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
8355
8355
|
var Duplex = require_stream_duplex2();
|
|
8356
|
-
(0,
|
|
8356
|
+
(0, import_chunk_EBLDSWRI.require_inherits)()(Transform, Duplex);
|
|
8357
8357
|
function afterTransform(er, data) {
|
|
8358
8358
|
var ts = this._transformState;
|
|
8359
8359
|
ts.transforming = false;
|
|
@@ -8447,7 +8447,7 @@ var require_stream_passthrough2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8447
8447
|
"use strict";
|
|
8448
8448
|
module2.exports = PassThrough;
|
|
8449
8449
|
var Transform = require_stream_transform2();
|
|
8450
|
-
(0,
|
|
8450
|
+
(0, import_chunk_EBLDSWRI.require_inherits)()(PassThrough, Transform);
|
|
8451
8451
|
function PassThrough(options2) {
|
|
8452
8452
|
if (!(this instanceof PassThrough)) return new PassThrough(options2);
|
|
8453
8453
|
Transform.call(this, options2);
|
|
@@ -9321,7 +9321,7 @@ var require_file = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
9321
9321
|
var difference = require_difference();
|
|
9322
9322
|
var union = require_union();
|
|
9323
9323
|
var isPlainObject = require_isPlainObject();
|
|
9324
|
-
var glob = (0,
|
|
9324
|
+
var glob = (0, import_chunk_EBLDSWRI.require_glob)();
|
|
9325
9325
|
var file = module2.exports = {};
|
|
9326
9326
|
var pathSeparatorRe = /[\/\\]/g;
|
|
9327
9327
|
var processPatterns = function(patterns, fn) {
|
|
@@ -15517,7 +15517,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
|
15517
15517
|
}
|
|
15518
15518
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
|
15519
15519
|
debug2("Loading config");
|
|
15520
|
-
const config2 = await (0,
|
|
15520
|
+
const config2 = await (0, import_chunk_KBVBWTBF.getConfig)({
|
|
15521
15521
|
datamodel: files,
|
|
15522
15522
|
ignoreEnvVarErrors: true
|
|
15523
15523
|
});
|
|
@@ -15626,7 +15626,7 @@ function renderDefaultLookupError(error, cwd) {
|
|
|
15626
15626
|
return parts.join("\n");
|
|
15627
15627
|
}
|
|
15628
15628
|
async function getPrismaConfigFromPackageJson(cwd) {
|
|
15629
|
-
const pkgJson = await (0,
|
|
15629
|
+
const pkgJson = await (0, import_chunk_EBLDSWRI.readPackageUp)({ cwd, normalize: false });
|
|
15630
15630
|
const prismaPropertyFromPkgJson = pkgJson?.packageJson?.prisma;
|
|
15631
15631
|
if (!pkgJson) {
|
|
15632
15632
|
return null;
|
|
@@ -15799,7 +15799,7 @@ function isPkgJsonWorkspaceRoot(pkgJson) {
|
|
|
15799
15799
|
return Array.isArray(workspaces) || workspaces.packages !== void 0;
|
|
15800
15800
|
}
|
|
15801
15801
|
async function isNearestPkgJsonWorkspaceRoot(cwd) {
|
|
15802
|
-
const pkgJson = await (0,
|
|
15802
|
+
const pkgJson = await (0, import_chunk_EBLDSWRI.readPackageUp)({ cwd, normalize: false });
|
|
15803
15803
|
if (!pkgJson) {
|
|
15804
15804
|
return null;
|
|
15805
15805
|
}
|
|
@@ -15909,8 +15909,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
|
|
|
15909
15909
|
if (argName.includes("schema")) {
|
|
15910
15910
|
await loadEnvFile({ schemaPath: argValue, printMessage: false });
|
|
15911
15911
|
const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
|
|
15912
|
-
const config2 = await (0,
|
|
15913
|
-
const url = (0,
|
|
15912
|
+
const config2 = await (0, import_chunk_KBVBWTBF.getConfig)({ datamodel, ignoreEnvVarErrors: true });
|
|
15913
|
+
const url = (0, import_chunk_KBVBWTBF.resolveUrl)((0, import_chunk_KBVBWTBF.getEffectiveUrl)(config2.datasources[0]));
|
|
15914
15914
|
if (url?.startsWith("prisma://")) {
|
|
15915
15915
|
return forbiddenCmdWithDataProxyFlagMessage(command);
|
|
15916
15916
|
}
|
|
@@ -15931,7 +15931,7 @@ function getCLIPathHash() {
|
|
|
15931
15931
|
const cliPath = process.argv[1];
|
|
15932
15932
|
return import_crypto.default.createHash("sha256").update(cliPath).digest("hex").substring(0, 8);
|
|
15933
15933
|
}
|
|
15934
|
-
var import_p_map = (0, import_chunk_WWAWV7DQ.__toESM)((0,
|
|
15934
|
+
var import_p_map = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_EBLDSWRI.require_p_map)());
|
|
15935
15935
|
var debug4 = (0, import_debug6.default)("prisma:generator");
|
|
15936
15936
|
async function checkTypeScriptVersion() {
|
|
15937
15937
|
const minVersion = "4.1.0";
|
|
@@ -16113,7 +16113,7 @@ async function getGenerators(options) {
|
|
|
16113
16113
|
prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
|
|
16114
16114
|
}
|
|
16115
16115
|
}
|
|
16116
|
-
const config = await (0,
|
|
16116
|
+
const config = await (0, import_chunk_KBVBWTBF.getConfig)({
|
|
16117
16117
|
datamodel: schemas,
|
|
16118
16118
|
datamodelPath: schemaPath,
|
|
16119
16119
|
prismaPath,
|
|
@@ -16124,7 +16124,7 @@ async function getGenerators(options) {
|
|
|
16124
16124
|
}
|
|
16125
16125
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
|
|
16126
16126
|
const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
|
|
16127
|
-
const dmmf = await (0,
|
|
16127
|
+
const dmmf = await (0, import_chunk_XKRUNUS5.getDMMF)({
|
|
16128
16128
|
datamodel: schemas,
|
|
16129
16129
|
datamodelPath: schemaPath,
|
|
16130
16130
|
prismaPath,
|
|
@@ -16185,7 +16185,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
|
16185
16185
|
fromEnvVar: "null"
|
|
16186
16186
|
};
|
|
16187
16187
|
}
|
|
16188
|
-
const datamodel = (0,
|
|
16188
|
+
const datamodel = (0, import_chunk_CYKOCRN3.mergeSchemas)({ schemas });
|
|
16189
16189
|
const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
|
|
16190
16190
|
const options2 = {
|
|
16191
16191
|
datamodel,
|
|
@@ -16267,7 +16267,7 @@ generator gen {
|
|
|
16267
16267
|
debug6({ generatorBinaryPaths });
|
|
16268
16268
|
generator.setBinaryPaths(generatorBinaryPaths);
|
|
16269
16269
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
|
16270
|
-
const customDmmf = await (0,
|
|
16270
|
+
const customDmmf = await (0, import_chunk_XKRUNUS5.getDMMF)({
|
|
16271
16271
|
datamodel: schemas,
|
|
16272
16272
|
datamodelPath: schemaPath,
|
|
16273
16273
|
prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
|
|
@@ -16565,7 +16565,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
|
16565
16565
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
16566
16566
|
handleFormatPanic(
|
|
16567
16567
|
() => {
|
|
16568
|
-
|
|
16568
|
+
import_chunk_IJUVQMZY.prismaSchemaWasm.debug_panic();
|
|
16569
16569
|
},
|
|
16570
16570
|
{ schemas: schemas2 }
|
|
16571
16571
|
);
|
|
@@ -16585,12 +16585,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
|
16585
16585
|
() => {
|
|
16586
16586
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
|
|
16587
16587
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
16588
|
-
const lintDiagnostics2 = (0,
|
|
16588
|
+
const lintDiagnostics2 = (0, import_chunk_7KXMQZFT.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
16589
16589
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
16590
16590
|
},
|
|
16591
16591
|
{ schemas: schemas2 }
|
|
16592
16592
|
);
|
|
16593
|
-
const lintWarnings = (0,
|
|
16593
|
+
const lintWarnings = (0, import_chunk_7KXMQZFT.getLintWarningsAsText)(lintDiagnostics);
|
|
16594
16594
|
if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
|
|
16595
16595
|
console.warn(lintWarnings);
|
|
16596
16596
|
}
|
|
@@ -16620,7 +16620,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
|
|
|
16620
16620
|
}
|
|
16621
16621
|
}
|
|
16622
16622
|
function formatWasm(schema, documentFormattingParams) {
|
|
16623
|
-
const formattedSchema =
|
|
16623
|
+
const formattedSchema = import_chunk_IJUVQMZY.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
16624
16624
|
return formattedSchema;
|
|
16625
16625
|
}
|
|
16626
16626
|
/*! Bundled license information:
|