@prisma/internals 6.6.0-dev.33 → 6.6.0-dev.35
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-WD2267J3.js → chunk-2VT4AM4Y.js} +17 -17
- package/dist/{chunk-US3GVDJU.js → chunk-2WQVHYBS.js} +5 -5
- package/dist/{chunk-7MD6344A.js → chunk-5DBOS77Y.js} +3 -5
- package/dist/{chunk-KTB2HCCO.js → chunk-7FH5JKIS.js} +7 -7
- package/dist/{chunk-JAWGW6LI.js → chunk-BXZXLEEH.js} +9 -9
- package/dist/{chunk-PSYMCJ4B.js → chunk-CMIKSBKL.js} +8 -8
- package/dist/{chunk-TSJICM5S.js → chunk-CRVLHWC5.js} +5 -5
- package/dist/{chunk-Y5IIJ464.js → chunk-DJYSR6QD.js} +22 -22
- package/dist/{chunk-P62PZLW4.js → chunk-GNK3AD6X.js} +13 -13
- package/dist/{chunk-LN2AVE5M.js → chunk-LR3WWKZI.js} +5 -5
- package/dist/{chunk-25XBBR4V.js → chunk-NZDLSDLM.js} +5 -5
- package/dist/{chunk-UBYXOLCN.js → chunk-O3MUXTZX.js} +78 -92
- package/dist/{chunk-N4QYGJOZ.js → chunk-OKJT45NT.js} +38 -67
- package/dist/{chunk-SXCF4HKZ.js → chunk-OQZDUJAJ.js} +5 -5
- package/dist/{chunk-MM4PIVNT.js → chunk-PAIGKNMY.js} +26 -26
- package/dist/{chunk-GNEFDTJE.js → chunk-PEB6D6GV.js} +72 -86
- package/dist/{chunk-2TQR7BKX.js → chunk-Q6VZHKYE.js} +9 -9
- package/dist/{chunk-YBYBY7QI.js → chunk-U4WXIU7C.js} +5 -5
- package/dist/{chunk-EORSBI5P.js → chunk-UCI7OFQ4.js} +5 -5
- package/dist/{chunk-SK3BZQHX.js → chunk-VEWDTOV5.js} +14 -14
- package/dist/{chunk-X3CLVIIZ.js → chunk-VLBKBUPL.js} +35 -64
- package/dist/{chunk-63QLYXZV.js → chunk-WCWE5A2C.js} +4 -4
- package/dist/cli/checkUnsupportedDataProxy.js +20 -21
- package/dist/cli/getSchema.js +24 -25
- package/dist/cli/hashes.js +20 -21
- package/dist/cli/schemaContext.d.ts +16 -2
- package/dist/cli/schemaContext.js +20 -20
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +19 -20
- package/dist/engine-commands/getConfig.d.ts +0 -4
- package/dist/engine-commands/getConfig.js +12 -12
- package/dist/engine-commands/getDmmf.d.ts +1 -5
- package/dist/engine-commands/getDmmf.js +9 -9
- package/dist/engine-commands/getEngineVersion.js +5 -5
- package/dist/engine-commands/getEnginesMetaInfo.js +7 -7
- package/dist/engine-commands/index.js +30 -31
- 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/generatorResolvers/generatorResolvers.js +19 -20
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +19 -20
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +20 -21
- package/dist/get-generators/getGenerators.d.ts +7 -3
- package/dist/get-generators/getGenerators.js +22 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +59 -59
- package/dist/resolveBinary.js +7 -7
- package/dist/schemaEngineCommands.js +8 -8
- package/dist/sendPanic.js +19 -20
- package/dist/utils/extractPreviewFeatures.d.ts +2 -2
- package/dist/utils/extractPreviewFeatures.js +2 -2
- package/dist/utils/getEnvPaths.js +19 -20
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +19 -20
- package/dist/utils/loadEnvFile.js +19 -20
- package/dist/wasm.js +4 -4
- package/package.json +8 -8
- package/dist/chunk-IPKE37QC.js +0 -25
- package/dist/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
- package/dist/get-generators/utils/check-feature-flags/checkFeatureFlags.js +0 -25
@@ -26,24 +26,24 @@ 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_2VT4AM4Y_exports = {};
|
30
|
+
__export(chunk_2VT4AM4Y_exports, {
|
31
31
|
GetConfigError: () => GetConfigError,
|
32
32
|
getConfig: () => getConfig,
|
33
33
|
getDirectUrl: () => getDirectUrl,
|
34
34
|
getEffectiveUrl: () => getEffectiveUrl,
|
35
35
|
resolveUrl: () => resolveUrl
|
36
36
|
});
|
37
|
-
module.exports = __toCommonJS(
|
37
|
+
module.exports = __toCommonJS(chunk_2VT4AM4Y_exports);
|
38
38
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
39
|
-
var
|
39
|
+
var import_chunk_CMIKSBKL = require("./chunk-CMIKSBKL.js");
|
40
40
|
var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
|
41
41
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
42
42
|
var import_chunk_QKPV6M3S = require("./chunk-QKPV6M3S.js");
|
43
43
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
44
44
|
var import_chunk_R7U45FIQ = require("./chunk-R7U45FIQ.js");
|
45
45
|
var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
|
46
|
-
var
|
46
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
47
47
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
48
48
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
49
49
|
var import_debug = __toESM(require("@prisma/debug"));
|
@@ -83,10 +83,10 @@ function resolveUrl(envValue) {
|
|
83
83
|
return urlFromValue ?? urlEnvVarValue;
|
84
84
|
}
|
85
85
|
async function getConfig(options) {
|
86
|
-
const debugErrorType = (0,
|
86
|
+
const debugErrorType = (0, import_chunk_CMIKSBKL.createDebugErrorType)(debug, "getConfigWasm");
|
87
87
|
debug(`Using getConfig Wasm`);
|
88
88
|
const configEither = (0, import_function.pipe)(
|
89
|
-
(0,
|
89
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
92
92
|
debug("Triggering a Rust panic...");
|
@@ -107,11 +107,11 @@ async function getConfig(options) {
|
|
107
107
|
error: e
|
108
108
|
})
|
109
109
|
),
|
110
|
-
(0,
|
111
|
-
(0,
|
110
|
+
(0, import_chunk_5DBOS77Y.map)((result) => ({ result })),
|
111
|
+
(0, import_chunk_5DBOS77Y.chainW)(
|
112
112
|
({ result }) => (
|
113
113
|
// NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
|
114
|
-
(0,
|
114
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
115
115
|
() => JSON.parse(result),
|
116
116
|
(e) => ({
|
117
117
|
type: "parse-json",
|
@@ -121,18 +121,18 @@ async function getConfig(options) {
|
|
121
121
|
)
|
122
122
|
)
|
123
123
|
),
|
124
|
-
(0,
|
124
|
+
(0, import_chunk_5DBOS77Y.chainW)((response) => {
|
125
125
|
if (response.errors.length > 0) {
|
126
|
-
return (0,
|
126
|
+
return (0, import_chunk_5DBOS77Y.left)({
|
127
127
|
type: "validation-error",
|
128
128
|
reason: "(get-config wasm)",
|
129
129
|
error: response.errors
|
130
130
|
});
|
131
131
|
}
|
132
|
-
return (0,
|
132
|
+
return (0, import_chunk_5DBOS77Y.right)(response.config);
|
133
133
|
})
|
134
134
|
);
|
135
|
-
if ((0,
|
135
|
+
if ((0, import_chunk_5DBOS77Y.isRight)(configEither)) {
|
136
136
|
debug("config data retrieved without errors in getConfig Wasm");
|
137
137
|
const { right: data } = configEither;
|
138
138
|
for (const generator of data.generators) {
|
@@ -153,19 +153,19 @@ async function getConfig(options) {
|
|
153
153
|
"@prisma/prisma-schema-wasm get_config",
|
154
154
|
"FMT_CLI",
|
155
155
|
/* schemaPath */
|
156
|
-
|
156
|
+
void 0,
|
157
157
|
/* schema */
|
158
158
|
(0, import_chunk_YRBRUREX.toMultipleSchemas)(options.datamodel)
|
159
159
|
);
|
160
160
|
return panic;
|
161
161
|
}
|
162
162
|
const errorOutput = e.error.message;
|
163
|
-
return new GetConfigError((0,
|
163
|
+
return new GetConfigError((0, import_chunk_CMIKSBKL.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
164
164
|
}).with({ type: "validation-error" }, (e) => {
|
165
165
|
return new GetConfigError({
|
166
166
|
_tag: "parsed",
|
167
167
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
168
|
-
reason: (0,
|
168
|
+
reason: (0, import_chunk_CMIKSBKL.createSchemaValidationError)(e.reason),
|
169
169
|
message: formatErrors(e.error)
|
170
170
|
});
|
171
171
|
}).otherwise((e) => {
|
@@ -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_2WQVHYBS_exports = {};
|
20
|
+
__export(chunk_2WQVHYBS_exports, {
|
21
21
|
version: () => version
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
25
|
-
var packageJson = (0,
|
23
|
+
module.exports = __toCommonJS(chunk_2WQVHYBS_exports);
|
24
|
+
var import_chunk_WCWE5A2C = require("./chunk-WCWE5A2C.js");
|
25
|
+
var packageJson = (0, import_chunk_WCWE5A2C.require_package)();
|
26
26
|
var version = packageJson.version;
|
@@ -16,13 +16,12 @@ 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_5DBOS77Y_exports = {};
|
20
|
+
__export(chunk_5DBOS77Y_exports, {
|
21
21
|
as: () => as,
|
22
22
|
asUnit: () => asUnit,
|
23
23
|
chain: () => chain,
|
24
24
|
chainW: () => chainW,
|
25
|
-
chainW2: () => chainW2,
|
26
25
|
dual: () => dual,
|
27
26
|
fromEither: () => fromEither,
|
28
27
|
getOrElseW: () => getOrElseW,
|
@@ -41,7 +40,7 @@ __export(chunk_7MD6344A_exports, {
|
|
41
40
|
tryCatch: () => tryCatch,
|
42
41
|
tryCatch2: () => tryCatch2
|
43
42
|
});
|
44
|
-
module.exports = __toCommonJS(
|
43
|
+
module.exports = __toCommonJS(chunk_5DBOS77Y_exports);
|
45
44
|
var __spreadArray = function(to, from, pack) {
|
46
45
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
47
46
|
if (ar || !(i in from)) {
|
@@ -608,4 +607,3 @@ var _FromIO2 = {
|
|
608
607
|
fromIO: FromIO2.fromIO
|
609
608
|
};
|
610
609
|
var chain = flatMap4;
|
611
|
-
var chainW2 = flatMap4;
|
@@ -16,16 +16,16 @@ 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_7FH5JKIS_exports = {};
|
20
|
+
__export(chunk_7FH5JKIS_exports, {
|
21
21
|
getEngineVersion: () => getEngineVersion,
|
22
22
|
safeGetEngineVersion: () => safeGetEngineVersion
|
23
23
|
});
|
24
|
-
module.exports = __toCommonJS(
|
24
|
+
module.exports = __toCommonJS(chunk_7FH5JKIS_exports);
|
25
25
|
var import_chunk_LSYWDURQ = require("./chunk-LSYWDURQ.js");
|
26
26
|
var import_chunk_2WR3PY2L = require("./chunk-2WR3PY2L.js");
|
27
|
-
var
|
28
|
-
var
|
27
|
+
var import_chunk_U4WXIU7C = require("./chunk-U4WXIU7C.js");
|
28
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
29
29
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
30
30
|
var import_engines = require("@prisma/engines");
|
31
31
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
@@ -35,7 +35,7 @@ async function getEngineVersion(enginePath, binaryName) {
|
|
35
35
|
if (!binaryName) {
|
36
36
|
binaryName = (0, import_engines.getCliQueryEngineBinaryType)();
|
37
37
|
}
|
38
|
-
enginePath = await (0,
|
38
|
+
enginePath = await (0, import_chunk_U4WXIU7C.resolveBinary)(binaryName, enginePath);
|
39
39
|
const platformInfo = await (0, import_get_platform.getPlatformInfo)();
|
40
40
|
if (binaryName === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
41
41
|
(0, import_get_platform.assertNodeAPISupported)();
|
@@ -47,7 +47,7 @@ async function getEngineVersion(enginePath, binaryName) {
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
function safeGetEngineVersion(enginePath, binaryName) {
|
50
|
-
return (0,
|
50
|
+
return (0, import_chunk_5DBOS77Y.tryCatch2)(
|
51
51
|
() => getEngineVersion(enginePath, binaryName),
|
52
52
|
(error) => error
|
53
53
|
);
|
@@ -26,21 +26,21 @@ 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_BXZXLEEH_exports = {};
|
30
|
+
__export(chunk_BXZXLEEH_exports, {
|
31
31
|
ValidateError: () => ValidateError,
|
32
32
|
validate: () => validate
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_BXZXLEEH_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
|
-
var
|
36
|
+
var import_chunk_CMIKSBKL = require("./chunk-CMIKSBKL.js");
|
37
37
|
var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
|
38
38
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
39
39
|
var import_chunk_QKPV6M3S = require("./chunk-QKPV6M3S.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
41
|
var import_chunk_R7U45FIQ = require("./chunk-R7U45FIQ.js");
|
42
42
|
var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
|
43
|
-
var
|
43
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
44
44
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
45
45
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
46
46
|
var import_debug = __toESM(require("@prisma/debug"));
|
@@ -65,10 +65,10 @@ ${detailsHeader} ${message}`;
|
|
65
65
|
}
|
66
66
|
};
|
67
67
|
function validate(options) {
|
68
|
-
const debugErrorType = (0,
|
68
|
+
const debugErrorType = (0, import_chunk_CMIKSBKL.createDebugErrorType)(debug, "validateWasm");
|
69
69
|
debug(`Using validate Wasm`);
|
70
70
|
const validateEither = (0, import_function.pipe)(
|
71
|
-
(0,
|
71
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
72
72
|
() => {
|
73
73
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
74
74
|
debug("Triggering a Rust panic...");
|
@@ -87,7 +87,7 @@ function validate(options) {
|
|
87
87
|
})
|
88
88
|
)
|
89
89
|
);
|
90
|
-
if ((0,
|
90
|
+
if ((0, import_chunk_5DBOS77Y.isRight)(validateEither)) {
|
91
91
|
return;
|
92
92
|
}
|
93
93
|
const error = (0, import_chunk_XKZ6CBLA.z)(validateEither.left).with({ type: "wasm-error" }, (e) => {
|
@@ -113,7 +113,7 @@ function validate(options) {
|
|
113
113
|
return panic;
|
114
114
|
}
|
115
115
|
const errorOutput = e.error.message;
|
116
|
-
return new ValidateError((0,
|
116
|
+
return new ValidateError((0, import_chunk_CMIKSBKL.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
117
117
|
}).exhaustive();
|
118
118
|
throw error;
|
119
119
|
}
|
@@ -26,24 +26,24 @@ 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_CMIKSBKL_exports = {};
|
30
|
+
__export(chunk_CMIKSBKL_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_CMIKSBKL_exports);
|
37
37
|
var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
|
38
38
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
39
39
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
40
|
-
var
|
40
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
41
41
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
42
42
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
43
43
|
var import_fs = __toESM(require("fs"));
|
44
44
|
var import_function = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_ZGAIRZ32.require_function)());
|
45
45
|
function unlinkTempDatamodelPath(options, tempDatamodelPath) {
|
46
|
-
return (0,
|
46
|
+
return (0, import_chunk_5DBOS77Y.tryCatch2)(
|
47
47
|
() => {
|
48
48
|
if (!options.datamodelPath && tempDatamodelPath) {
|
49
49
|
return import_fs.default.promises.unlink(tempDatamodelPath);
|
@@ -66,11 +66,11 @@ function createSchemaValidationError(reason) {
|
|
66
66
|
}
|
67
67
|
function parseQueryEngineError({ errorOutput, reason }) {
|
68
68
|
const actualError = (0, import_function.pipe)(
|
69
|
-
(0,
|
69
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
70
70
|
() => JSON.parse(errorOutput),
|
71
71
|
() => ({ _tag: "unparsed", message: errorOutput, reason })
|
72
72
|
),
|
73
|
-
(0,
|
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
75
|
const getConfigErrorInit = (0, import_chunk_XKZ6CBLA.z)(errorOutputAsJSON).with({ error_code: "P1012" }, (eJSON) => {
|
76
76
|
return {
|
@@ -89,7 +89,7 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
89
89
|
});
|
90
90
|
return { _tag: "parsed", message: defaultMessage, ...getConfigErrorInit };
|
91
91
|
}),
|
92
|
-
(0,
|
92
|
+
(0, import_chunk_5DBOS77Y.getOrElseW)(import_function.identity)
|
93
93
|
);
|
94
94
|
return actualError;
|
95
95
|
}
|
@@ -16,12 +16,12 @@ 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_CRVLHWC5_exports = {};
|
20
|
+
__export(chunk_CRVLHWC5_exports, {
|
21
21
|
extractPreviewFeatures: () => extractPreviewFeatures
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
23
|
+
module.exports = __toCommonJS(chunk_CRVLHWC5_exports);
|
24
24
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
25
|
-
function extractPreviewFeatures(
|
26
|
-
return
|
25
|
+
function extractPreviewFeatures(generators) {
|
26
|
+
return generators.find((g) => (0, import_chunk_IOIAK7V7.parseEnvValue)(g.provider) === "prisma-client-js")?.previewFeatures || [];
|
27
27
|
}
|
@@ -26,24 +26,24 @@ 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_DJYSR6QD_exports = {};
|
30
|
+
__export(chunk_DJYSR6QD_exports, {
|
31
31
|
GetConfigError: () => GetConfigError,
|
32
32
|
getConfig: () => getConfig,
|
33
33
|
getDirectUrl: () => getDirectUrl,
|
34
34
|
getEffectiveUrl: () => getEffectiveUrl,
|
35
35
|
resolveUrl: () => resolveUrl
|
36
36
|
});
|
37
|
-
module.exports = __toCommonJS(
|
37
|
+
module.exports = __toCommonJS(chunk_DJYSR6QD_exports);
|
38
38
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
39
|
-
var
|
39
|
+
var import_chunk_CMIKSBKL = require("./chunk-CMIKSBKL.js");
|
40
40
|
var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
|
41
41
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
42
|
-
var
|
42
|
+
var import_chunk_OQZDUJAJ = require("./chunk-OQZDUJAJ.js");
|
43
43
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
44
|
-
var
|
44
|
+
var import_chunk_LR3WWKZI = require("./chunk-LR3WWKZI.js");
|
45
45
|
var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
|
46
|
-
var
|
46
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
47
47
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
48
48
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
49
49
|
var import_debug = __toESM(require("@prisma/debug"));
|
@@ -65,7 +65,7 @@ ${detailsHeader} ${message}`;
|
|
65
65
|
}).exhaustive();
|
66
66
|
const errorMessageWithContext = `${constructedErrorMessage}
|
67
67
|
[Context: getConfig]`;
|
68
|
-
super((0,
|
68
|
+
super((0, import_chunk_OQZDUJAJ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
69
69
|
this.name = "GetConfigError";
|
70
70
|
}
|
71
71
|
};
|
@@ -83,14 +83,14 @@ function resolveUrl(envValue) {
|
|
83
83
|
return urlFromValue ?? urlEnvVarValue;
|
84
84
|
}
|
85
85
|
async function getConfig(options) {
|
86
|
-
const debugErrorType = (0,
|
86
|
+
const debugErrorType = (0, import_chunk_CMIKSBKL.createDebugErrorType)(debug, "getConfigWasm");
|
87
87
|
debug(`Using getConfig Wasm`);
|
88
88
|
const configEither = (0, import_function.pipe)(
|
89
|
-
(0,
|
89
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
92
92
|
debug("Triggering a Rust panic...");
|
93
|
-
|
93
|
+
import_chunk_LR3WWKZI.prismaSchemaWasm.debug_panic();
|
94
94
|
}
|
95
95
|
const params = JSON.stringify({
|
96
96
|
prismaSchema: options.datamodel,
|
@@ -98,7 +98,7 @@ async function getConfig(options) {
|
|
98
98
|
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
99
99
|
env: process.env
|
100
100
|
});
|
101
|
-
const data =
|
101
|
+
const data = import_chunk_LR3WWKZI.prismaSchemaWasm.get_config(params);
|
102
102
|
return data;
|
103
103
|
},
|
104
104
|
(e) => ({
|
@@ -107,11 +107,11 @@ async function getConfig(options) {
|
|
107
107
|
error: e
|
108
108
|
})
|
109
109
|
),
|
110
|
-
(0,
|
111
|
-
(0,
|
110
|
+
(0, import_chunk_5DBOS77Y.map)((result) => ({ result })),
|
111
|
+
(0, import_chunk_5DBOS77Y.chainW)(
|
112
112
|
({ result }) => (
|
113
113
|
// NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
|
114
|
-
(0,
|
114
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
115
115
|
() => JSON.parse(result),
|
116
116
|
(e) => ({
|
117
117
|
type: "parse-json",
|
@@ -121,18 +121,18 @@ async function getConfig(options) {
|
|
121
121
|
)
|
122
122
|
)
|
123
123
|
),
|
124
|
-
(0,
|
124
|
+
(0, import_chunk_5DBOS77Y.chainW)((response) => {
|
125
125
|
if (response.errors.length > 0) {
|
126
|
-
return (0,
|
126
|
+
return (0, import_chunk_5DBOS77Y.left)({
|
127
127
|
type: "validation-error",
|
128
128
|
reason: "(get-config wasm)",
|
129
129
|
error: response.errors
|
130
130
|
});
|
131
131
|
}
|
132
|
-
return (0,
|
132
|
+
return (0, import_chunk_5DBOS77Y.right)(response.config);
|
133
133
|
})
|
134
134
|
);
|
135
|
-
if ((0,
|
135
|
+
if ((0, import_chunk_5DBOS77Y.isRight)(configEither)) {
|
136
136
|
debug("config data retrieved without errors in getConfig Wasm");
|
137
137
|
const { right: data } = configEither;
|
138
138
|
for (const generator of data.generators) {
|
@@ -153,19 +153,19 @@ async function getConfig(options) {
|
|
153
153
|
"@prisma/prisma-schema-wasm get_config",
|
154
154
|
"FMT_CLI",
|
155
155
|
/* schemaPath */
|
156
|
-
|
156
|
+
void 0,
|
157
157
|
/* schema */
|
158
158
|
(0, import_chunk_YRBRUREX.toMultipleSchemas)(options.datamodel)
|
159
159
|
);
|
160
160
|
return panic;
|
161
161
|
}
|
162
162
|
const errorOutput = e.error.message;
|
163
|
-
return new GetConfigError((0,
|
163
|
+
return new GetConfigError((0, import_chunk_CMIKSBKL.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
164
164
|
}).with({ type: "validation-error" }, (e) => {
|
165
165
|
return new GetConfigError({
|
166
166
|
_tag: "parsed",
|
167
167
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
168
|
-
reason: (0,
|
168
|
+
reason: (0, import_chunk_CMIKSBKL.createSchemaValidationError)(e.reason),
|
169
169
|
message: formatErrors(e.error)
|
170
170
|
});
|
171
171
|
}).otherwise((e) => {
|
@@ -26,21 +26,21 @@ 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_GNK3AD6X_exports = {};
|
30
|
+
__export(chunk_GNK3AD6X_exports, {
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
32
32
|
mergeSchemas: () => mergeSchemas
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_GNK3AD6X_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
|
-
var
|
36
|
+
var import_chunk_CMIKSBKL = require("./chunk-CMIKSBKL.js");
|
37
37
|
var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
|
38
38
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
39
|
-
var
|
39
|
+
var import_chunk_OQZDUJAJ = require("./chunk-OQZDUJAJ.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
|
-
var
|
41
|
+
var import_chunk_LR3WWKZI = require("./chunk-LR3WWKZI.js");
|
42
42
|
var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
|
43
|
-
var
|
43
|
+
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
44
44
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
45
45
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
46
46
|
var import_debug = __toESM(require("@prisma/debug"));
|
@@ -60,20 +60,20 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: mergeSchemas]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_OQZDUJAJ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "MergeSchemasError";
|
65
65
|
}
|
66
66
|
};
|
67
67
|
function mergeSchemas(options) {
|
68
|
-
const debugErrorType = (0,
|
68
|
+
const debugErrorType = (0, import_chunk_CMIKSBKL.createDebugErrorType)(debug, "mergeSchemasWasm");
|
69
69
|
debug(`Using mergeSchemas Wasm`);
|
70
70
|
const mergeSchemasEither = (0, import_function.pipe)(
|
71
|
-
(0,
|
71
|
+
(0, import_chunk_5DBOS77Y.tryCatch)(
|
72
72
|
() => {
|
73
73
|
const params = JSON.stringify({
|
74
74
|
schema: options.schemas
|
75
75
|
});
|
76
|
-
return
|
76
|
+
return import_chunk_LR3WWKZI.prismaSchemaWasm.merge_schemas(params);
|
77
77
|
},
|
78
78
|
(e) => ({
|
79
79
|
type: "wasm-error",
|
@@ -82,7 +82,7 @@ function mergeSchemas(options) {
|
|
82
82
|
})
|
83
83
|
)
|
84
84
|
);
|
85
|
-
if ((0,
|
85
|
+
if ((0, import_chunk_5DBOS77Y.isRight)(mergeSchemasEither)) {
|
86
86
|
return mergeSchemasEither.right;
|
87
87
|
}
|
88
88
|
const error = (0, import_chunk_XKZ6CBLA.z)(mergeSchemasEither.left).with({ type: "wasm-error" }, (e) => {
|
@@ -108,7 +108,7 @@ function mergeSchemas(options) {
|
|
108
108
|
return panic;
|
109
109
|
}
|
110
110
|
const errorOutput = e.error.message;
|
111
|
-
return new MergeSchemasError((0,
|
111
|
+
return new MergeSchemasError((0, import_chunk_CMIKSBKL.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
112
112
|
}).exhaustive();
|
113
113
|
throw error;
|
114
114
|
}
|
@@ -26,14 +26,14 @@ 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_LR3WWKZI_exports = {};
|
30
|
+
__export(chunk_LR3WWKZI_exports, {
|
31
31
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
32
32
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
|
33
33
|
wasm_exports: () => wasm_exports
|
34
34
|
});
|
35
|
-
module.exports = __toCommonJS(
|
36
|
-
var
|
35
|
+
module.exports = __toCommonJS(chunk_LR3WWKZI_exports);
|
36
|
+
var import_chunk_WCWE5A2C = require("./chunk-WCWE5A2C.js");
|
37
37
|
var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
|
38
38
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
39
39
|
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
@@ -42,6 +42,6 @@ var wasm_exports = {};
|
|
42
42
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
43
43
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion
|
44
44
|
});
|
45
|
-
var { dependencies } = (0,
|
45
|
+
var { dependencies } = (0, import_chunk_WCWE5A2C.require_package)();
|
46
46
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
47
47
|
globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
|
@@ -16,21 +16,21 @@ 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_NZDLSDLM_exports = {};
|
20
|
+
__export(chunk_NZDLSDLM_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(
|
27
|
+
module.exports = __toCommonJS(chunk_NZDLSDLM_exports);
|
28
28
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
29
|
-
var
|
29
|
+
var import_chunk_LR3WWKZI = require("./chunk-LR3WWKZI.js");
|
30
30
|
var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
|
31
31
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
32
32
|
function lintSchema({ schemas }) {
|
33
|
-
const lintResult =
|
33
|
+
const lintResult = import_chunk_LR3WWKZI.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
34
34
|
const lintDiagnostics = JSON.parse(lintResult);
|
35
35
|
return lintDiagnostics;
|
36
36
|
}
|