@prisma/internals 6.1.0-dev.3 → 6.1.0-dev.5

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.
Files changed (40) hide show
  1. package/dist/{chunk-LEGPENYH.js → chunk-2BJ42CN6.js} +4 -4
  2. package/dist/chunk-2DXAGCPS.js +177 -0
  3. package/dist/{chunk-UFRXTLJ3.js → chunk-4ZNFJ6GK.js} +8 -8
  4. package/dist/{chunk-UGN2IMJV.js → chunk-574MLPZZ.js} +19 -19
  5. package/dist/chunk-5XRQ7ONW.js +122 -0
  6. package/dist/{chunk-EWWCVGRX.js → chunk-DAAAGJCX.js} +5 -5
  7. package/dist/{chunk-HM5POBB4.js → chunk-LAVMCJNP.js} +5 -5
  8. package/dist/{chunk-6VXLRSIV.js → chunk-P2KRC6ZJ.js} +7 -7
  9. package/dist/chunk-QIVUAERL.js +2202 -0
  10. package/dist/{chunk-2CHJ6JM2.js → chunk-QJLDGGR4.js} +5 -5
  11. package/dist/chunk-QJZIYUVB.js +110 -0
  12. package/dist/{chunk-W64BQ3QW.js → chunk-RHW5COKI.js} +8 -8
  13. package/dist/{chunk-7CXYD5ZJ.js → chunk-T4HOXYJZ.js} +5 -5
  14. package/dist/chunk-TFSZCVKC.js +166 -0
  15. package/dist/chunk-V2VWODV3.js +54 -0
  16. package/dist/{chunk-UIGFAS6M.js → chunk-WHYRSZHC.js} +8 -8
  17. package/dist/{chunk-WCWDW6XL.js → chunk-X3H655OX.js} +24 -795
  18. package/dist/cli/checkUnsupportedDataProxy.js +12 -12
  19. package/dist/cli/getSchema.js +17 -17
  20. package/dist/cli/hashes.js +12 -12
  21. package/dist/engine-commands/errorHelpers.js +4 -4
  22. package/dist/engine-commands/formatSchema.js +11 -11
  23. package/dist/engine-commands/getConfig.js +10 -10
  24. package/dist/engine-commands/getDmmf.js +7 -7
  25. package/dist/engine-commands/index.js +20 -20
  26. package/dist/engine-commands/lintSchema.js +8 -8
  27. package/dist/engine-commands/mergeSchemas.js +7 -7
  28. package/dist/engine-commands/validate.js +7 -7
  29. package/dist/get-generators/generatorResolvers/generatorResolvers.js +11 -11
  30. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +11 -11
  31. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +12 -12
  32. package/dist/get-generators/getGenerators.js +14 -14
  33. package/dist/index.js +39 -39
  34. package/dist/sendPanic.js +11 -11
  35. package/dist/utils/getEnvPaths.js +11 -11
  36. package/dist/utils/getVersionFromPackageJson.js +3 -3
  37. package/dist/utils/handlePanic.js +11 -11
  38. package/dist/utils/loadEnvFile.js +11 -11
  39. package/dist/wasm.js +4 -4
  40. package/package.json +7 -7
@@ -16,17 +16,17 @@ 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 chunk_LEGPENYH_exports = {};
20
- __export(chunk_LEGPENYH_exports, {
19
+ var chunk_2BJ42CN6_exports = {};
20
+ __export(chunk_2BJ42CN6_exports, {
21
21
  require_package: () => require_package
22
22
  });
23
- module.exports = __toCommonJS(chunk_LEGPENYH_exports);
23
+ module.exports = __toCommonJS(chunk_2BJ42CN6_exports);
24
24
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
25
25
  var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
26
26
  "package.json"(exports, module2) {
27
27
  module2.exports = {
28
28
  name: "@prisma/internals",
29
- version: "6.1.0-dev.3",
29
+ version: "6.1.0-dev.5",
30
30
  description: "This package is intended for Prisma's internal use",
31
31
  main: "dist/index.js",
32
32
  types: "dist/index.d.ts",
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_2DXAGCPS_exports = {};
30
+ __export(chunk_2DXAGCPS_exports, {
31
+ getEnginesInfo: () => getEnginesInfo,
32
+ getEnginesMetaInfo: () => getEnginesMetaInfo,
33
+ resolveEngine: () => resolveEngine
34
+ });
35
+ module.exports = __toCommonJS(chunk_2DXAGCPS_exports);
36
+ var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
37
+ var import_chunk_V2VWODV3 = require("./chunk-V2VWODV3.js");
38
+ var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
39
+ var import_chunk_QJZIYUVB = require("./chunk-QJZIYUVB.js");
40
+ var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
41
+ var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
42
+ var import_engines = require("@prisma/engines");
43
+ var import_fetch_engine = require("@prisma/fetch-engine");
44
+ var import_path = __toESM(require("path"));
45
+ var import_function2 = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_PFLLVWZX.require_function)());
46
+ var none2 = import_chunk_7MD6344A.none;
47
+ var some2 = import_chunk_7MD6344A.some;
48
+ var getRight = function(ma) {
49
+ return ma._tag === "Left" ? none2 : some2(ma.right);
50
+ };
51
+ var _map = function(fa, f) {
52
+ return (0, import_chunk_7MD6344A.pipe)(fa, map(f));
53
+ };
54
+ var _ap = function(fab, fa) {
55
+ return (0, import_chunk_7MD6344A.pipe)(fab, ap(fa));
56
+ };
57
+ var URI = "Option";
58
+ var map = function(f) {
59
+ return function(fa) {
60
+ return isNone(fa) ? none2 : some2(f(fa.value));
61
+ };
62
+ };
63
+ var Functor = {
64
+ URI,
65
+ map: _map
66
+ };
67
+ var as2 = (0, import_chunk_7MD6344A.dual)(2, (0, import_chunk_7MD6344A.as)(Functor));
68
+ var asUnit2 = (0, import_chunk_7MD6344A.asUnit)(Functor);
69
+ var ap = function(fa) {
70
+ return function(fab) {
71
+ return isNone(fab) ? none2 : isNone(fa) ? none2 : some2(fab.value(fa.value));
72
+ };
73
+ };
74
+ var flatMap = /* @__PURE__ */ (0, import_chunk_7MD6344A.dual)(2, function(ma, f) {
75
+ return isNone(ma) ? none2 : f(ma.value);
76
+ });
77
+ var Chain = {
78
+ URI,
79
+ map: _map,
80
+ ap: _ap,
81
+ chain: flatMap
82
+ };
83
+ var orElse = (0, import_chunk_7MD6344A.dual)(2, function(self, that) {
84
+ return isNone(self) ? that() : self;
85
+ });
86
+ var fromEither2 = getRight;
87
+ var FromEither = {
88
+ URI,
89
+ fromEither: fromEither2
90
+ };
91
+ var isSome2 = import_chunk_7MD6344A.isSome;
92
+ var isNone = function(fa) {
93
+ return fa._tag === "None";
94
+ };
95
+ var matchW = function(onNone, onSome) {
96
+ return function(ma) {
97
+ return isNone(ma) ? onNone() : onSome(ma.value);
98
+ };
99
+ };
100
+ var match = matchW;
101
+ var fold = match;
102
+ var tap2 = /* @__PURE__ */ (0, import_chunk_7MD6344A.dual)(2, (0, import_chunk_7MD6344A.tap)(Chain));
103
+ var tapEither2 = /* @__PURE__ */ (0, import_chunk_7MD6344A.dual)(2, (0, import_chunk_7MD6344A.tapEither)(FromEither, Chain));
104
+ var fromNullable = function(a) {
105
+ return a == null ? none2 : some2(a);
106
+ };
107
+ async function getEnginesMetaInfo() {
108
+ const cliQueryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
109
+ const engines = [
110
+ {
111
+ name: "query-engine",
112
+ type: cliQueryEngineBinaryType
113
+ },
114
+ {
115
+ name: "schema-engine",
116
+ type: import_fetch_engine.BinaryType.SchemaEngineBinary
117
+ }
118
+ ];
119
+ const enginePromises = engines.map(({ name, type }) => {
120
+ return resolveEngine(type).then((result) => [name, result]);
121
+ });
122
+ const engineMatrix = await Promise.all(enginePromises).then(Object.fromEntries);
123
+ const engineDataAcc = engines.map(({ name }) => {
124
+ const [engineInfo, errors] = getEnginesInfo(engineMatrix[name]);
125
+ return [{ [name]: engineInfo }, errors];
126
+ });
127
+ const engineMetaInfo = engineDataAcc.map((arr) => arr[0]);
128
+ const enginesMetaInfoErrors = engineDataAcc.flatMap((arr) => arr[1]);
129
+ return [engineMetaInfo, enginesMetaInfoErrors];
130
+ }
131
+ function getEnginesInfo(enginesInfo) {
132
+ const errors = [];
133
+ const resolved = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ fromEnvVar: import_chunk_H3T4L34H.N.when(isSome2) }, (_engineInfo) => {
134
+ return `, resolved by ${_engineInfo.fromEnvVar.value}`;
135
+ }).otherwise(() => "");
136
+ const absolutePath = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isRight) }, (_engineInfo) => {
137
+ return _engineInfo.path.right;
138
+ }).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isLeft) }, (_engineInfo) => {
139
+ errors.push(_engineInfo.path.left);
140
+ return "E_CANNOT_RESOLVE_PATH";
141
+ }).exhaustive();
142
+ const version = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isRight) }, (_engineInfo) => {
143
+ return _engineInfo.version.right;
144
+ }).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isLeft) }, (_engineInfo) => {
145
+ errors.push(_engineInfo.version.left);
146
+ return "E_CANNOT_RESOLVE_VERSION";
147
+ }).exhaustive();
148
+ const versionMessage = `${version} (at ${import_path.default.relative(process.cwd(), absolutePath)}${resolved})`;
149
+ return [versionMessage, errors];
150
+ }
151
+ async function resolveEngine(binaryName) {
152
+ const pathFromEnvOption = fromNullable((0, import_fetch_engine.getBinaryEnvVarPath)(binaryName));
153
+ const fromEnvVarOption = (0, import_function2.pipe)(
154
+ pathFromEnvOption,
155
+ map((p) => p.fromEnvVar)
156
+ );
157
+ const enginePathEither = await (0, import_function2.pipe)(
158
+ pathFromEnvOption,
159
+ fold(
160
+ () => (0, import_chunk_QJZIYUVB.safeResolveBinary)(binaryName),
161
+ (pathFromEnv) => (0, import_chunk_7MD6344A.right2)(pathFromEnv.path)
162
+ )
163
+ )();
164
+ const versionEither = await (0, import_function2.pipe)(
165
+ enginePathEither,
166
+ import_chunk_7MD6344A.fromEither,
167
+ (0, import_chunk_7MD6344A.chain)((enginePath) => {
168
+ return (0, import_chunk_V2VWODV3.safeGetEngineVersion)(enginePath, binaryName);
169
+ })
170
+ )();
171
+ const engineInfo = {
172
+ path: enginePathEither,
173
+ version: versionEither,
174
+ fromEnvVar: fromEnvVarOption
175
+ };
176
+ return engineInfo;
177
+ }
@@ -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 chunk_UFRXTLJ3_exports = {};
30
- __export(chunk_UFRXTLJ3_exports, {
29
+ var chunk_4ZNFJ6GK_exports = {};
30
+ __export(chunk_4ZNFJ6GK_exports, {
31
31
  ValidateError: () => ValidateError,
32
32
  validate: () => validate
33
33
  });
34
- module.exports = __toCommonJS(chunk_UFRXTLJ3_exports);
34
+ module.exports = __toCommonJS(chunk_4ZNFJ6GK_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
36
  var import_chunk_I4467NNA = require("./chunk-I4467NNA.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_EWWCVGRX = require("./chunk-EWWCVGRX.js");
38
+ var import_chunk_DAAAGJCX = require("./chunk-DAAAGJCX.js");
39
39
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
40
40
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
41
- var import_chunk_7CXYD5ZJ = require("./chunk-7CXYD5ZJ.js");
41
+ var import_chunk_T4HOXYJZ = require("./chunk-T4HOXYJZ.js");
42
42
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
43
43
  var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
44
44
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
60
60
  }).exhaustive();
61
61
  const errorMessageWithContext = `${constructedErrorMessage}
62
62
  [Context: validate]`;
63
- super((0, import_chunk_EWWCVGRX.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ super((0, import_chunk_DAAAGJCX.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
64
  this.name = "ValidateError";
65
65
  }
66
66
  };
@@ -72,13 +72,13 @@ function validate(options) {
72
72
  () => {
73
73
  if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
74
74
  debug("Triggering a Rust panic...");
75
- import_chunk_7CXYD5ZJ.prismaSchemaWasm.debug_panic();
75
+ import_chunk_T4HOXYJZ.prismaSchemaWasm.debug_panic();
76
76
  }
77
77
  const params = JSON.stringify({
78
78
  prismaSchema: options.schemas,
79
79
  noColor: Boolean(process.env.NO_COLOR)
80
80
  });
81
- import_chunk_7CXYD5ZJ.prismaSchemaWasm.validate(params);
81
+ import_chunk_T4HOXYJZ.prismaSchemaWasm.validate(params);
82
82
  },
83
83
  (e) => ({
84
84
  type: "wasm-error",
@@ -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 chunk_UGN2IMJV_exports = {};
30
- __export2(chunk_UGN2IMJV_exports, {
29
+ var chunk_574MLPZZ_exports = {};
30
+ __export2(chunk_574MLPZZ_exports, {
31
31
  checkTypeScriptVersion: () => checkTypeScriptVersion,
32
32
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
33
33
  debug: () => debug5,
@@ -55,7 +55,7 @@ __export2(chunk_UGN2IMJV_exports, {
55
55
  sendPanic: () => sendPanic,
56
56
  skipIndex: () => skipIndex
57
57
  });
58
- module.exports = __toCommonJS2(chunk_UGN2IMJV_exports);
58
+ module.exports = __toCommonJS2(chunk_574MLPZZ_exports);
59
59
  var import_chunk_77IC3DNO = require("./chunk-77IC3DNO.js");
60
60
  var import_chunk_MGZOEY6N = require("./chunk-MGZOEY6N.js");
61
61
  var import_chunk_S57RMXZW = require("./chunk-S57RMXZW.js");
@@ -80,13 +80,13 @@ var import_chunk_SLBBRUQS = require("./chunk-SLBBRUQS.js");
80
80
  var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
81
81
  var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
82
82
  var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
83
- var import_chunk_ZW637L2K = require("./chunk-ZW637L2K.js");
84
- var import_chunk_X4K6SW2Y = require("./chunk-X4K6SW2Y.js");
85
- var import_chunk_ZADYZQO7 = require("./chunk-ZADYZQO7.js");
86
- var import_chunk_XAL6KTHD = require("./chunk-XAL6KTHD.js");
83
+ var import_chunk_QJLDGGR4 = require("./chunk-QJLDGGR4.js");
84
+ var import_chunk_P2KRC6ZJ = require("./chunk-P2KRC6ZJ.js");
85
+ var import_chunk_RHW5COKI = require("./chunk-RHW5COKI.js");
86
+ var import_chunk_WHYRSZHC = require("./chunk-WHYRSZHC.js");
87
87
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
88
88
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
89
- var import_chunk_GWBZ6Z6W = require("./chunk-GWBZ6Z6W.js");
89
+ var import_chunk_T4HOXYJZ = require("./chunk-T4HOXYJZ.js");
90
90
  var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
91
91
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
92
92
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
@@ -15522,7 +15522,7 @@ async function readSchemaFromDirectory(schemaPath2) {
15522
15522
  }
15523
15523
  const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
15524
15524
  debug2("Loading config");
15525
- const config2 = await (0, import_chunk_ZADYZQO7.getConfig)({
15525
+ const config2 = await (0, import_chunk_RHW5COKI.getConfig)({
15526
15526
  datamodel: files,
15527
15527
  ignoreEnvVarErrors: true
15528
15528
  });
@@ -15830,8 +15830,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
15830
15830
  if (argName.includes("schema")) {
15831
15831
  await loadEnvFile({ schemaPath: argValue, printMessage: false });
15832
15832
  const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
15833
- const config2 = await (0, import_chunk_ZADYZQO7.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15834
- const url = (0, import_chunk_ZADYZQO7.resolveUrl)((0, import_chunk_ZADYZQO7.getEffectiveUrl)(config2.datasources[0]));
15833
+ const config2 = await (0, import_chunk_RHW5COKI.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15834
+ const url = (0, import_chunk_RHW5COKI.resolveUrl)((0, import_chunk_RHW5COKI.getEffectiveUrl)(config2.datasources[0]));
15835
15835
  if (url?.startsWith("prisma://")) {
15836
15836
  return forbiddenCmdWithDataProxyFlagMessage(command);
15837
15837
  }
@@ -16003,7 +16003,7 @@ async function getGenerators(options) {
16003
16003
  prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
16004
16004
  }
16005
16005
  }
16006
- const config = await (0, import_chunk_ZADYZQO7.getConfig)({
16006
+ const config = await (0, import_chunk_RHW5COKI.getConfig)({
16007
16007
  datamodel: schemas,
16008
16008
  datamodelPath: schemaPath,
16009
16009
  prismaPath,
@@ -16014,7 +16014,7 @@ async function getGenerators(options) {
16014
16014
  }
16015
16015
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
16016
16016
  const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
16017
- const dmmf = await (0, import_chunk_XAL6KTHD.getDMMF)({
16017
+ const dmmf = await (0, import_chunk_WHYRSZHC.getDMMF)({
16018
16018
  datamodel: schemas,
16019
16019
  datamodelPath: schemaPath,
16020
16020
  prismaPath,
@@ -16075,7 +16075,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
16075
16075
  fromEnvVar: "null"
16076
16076
  };
16077
16077
  }
16078
- const datamodel = (0, import_chunk_X4K6SW2Y.mergeSchemas)({ schemas });
16078
+ const datamodel = (0, import_chunk_P2KRC6ZJ.mergeSchemas)({ schemas });
16079
16079
  const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
16080
16080
  const options2 = {
16081
16081
  datamodel,
@@ -16158,7 +16158,7 @@ generator gen {
16158
16158
  debug6({ generatorBinaryPaths });
16159
16159
  generator.setBinaryPaths(generatorBinaryPaths);
16160
16160
  if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
16161
- const customDmmf = await (0, import_chunk_XAL6KTHD.getDMMF)({
16161
+ const customDmmf = await (0, import_chunk_WHYRSZHC.getDMMF)({
16162
16162
  datamodel: schemas,
16163
16163
  datamodelPath: schemaPath,
16164
16164
  prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
@@ -16456,7 +16456,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
16456
16456
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
16457
16457
  handleFormatPanic(
16458
16458
  () => {
16459
- import_chunk_GWBZ6Z6W.prismaSchemaWasm.debug_panic();
16459
+ import_chunk_T4HOXYJZ.prismaSchemaWasm.debug_panic();
16460
16460
  },
16461
16461
  { schemas: schemas2 }
16462
16462
  );
@@ -16476,12 +16476,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
16476
16476
  () => {
16477
16477
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
16478
16478
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
16479
- const lintDiagnostics2 = (0, import_chunk_ZW637L2K.lintSchema)({ schemas: formattedMultipleSchemas2 });
16479
+ const lintDiagnostics2 = (0, import_chunk_QJLDGGR4.lintSchema)({ schemas: formattedMultipleSchemas2 });
16480
16480
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
16481
16481
  },
16482
16482
  { schemas: schemas2 }
16483
16483
  );
16484
- const lintWarnings = (0, import_chunk_ZW637L2K.getLintWarningsAsText)(lintDiagnostics);
16484
+ const lintWarnings = (0, import_chunk_QJLDGGR4.getLintWarningsAsText)(lintDiagnostics);
16485
16485
  if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
16486
16486
  console.warn(lintWarnings);
16487
16487
  }
@@ -16511,7 +16511,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
16511
16511
  }
16512
16512
  }
16513
16513
  function formatWasm(schema, documentFormattingParams) {
16514
- const formattedSchema = import_chunk_GWBZ6Z6W.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
16514
+ const formattedSchema = import_chunk_T4HOXYJZ.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
16515
16515
  return formattedSchema;
16516
16516
  }
16517
16517
  /*! Bundled license information:
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_5XRQ7ONW_exports = {};
30
+ __export(chunk_5XRQ7ONW_exports, {
31
+ getBinaryPathsByVersion: () => getBinaryPathsByVersion
32
+ });
33
+ module.exports = __toCommonJS(chunk_5XRQ7ONW_exports);
34
+ var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
35
+ var import_chunk_4CGPN5SR = require("./chunk-4CGPN5SR.js");
36
+ var import_chunk_2SDPW6AX = require("./chunk-2SDPW6AX.js");
37
+ var import_chunk_7B5PXS6N = require("./chunk-7B5PXS6N.js");
38
+ var import_chunk_QIVUAERL = require("./chunk-QIVUAERL.js");
39
+ var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
40
+ var import_engines = require("@prisma/engines");
41
+ var import_fetch_engine = require("@prisma/fetch-engine");
42
+ var import_path = __toESM2(require("path"));
43
+ var import_fs_extra = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_QIVUAERL.require_lib)());
44
+ async function getBinaryPathsByVersion({
45
+ neededVersions,
46
+ binaryTarget,
47
+ version,
48
+ printDownloadProgress,
49
+ skipDownload,
50
+ binaryPathsOverride
51
+ }) {
52
+ const binaryPathsByVersion = /* @__PURE__ */ Object.create(null);
53
+ for (const currentVersion in neededVersions) {
54
+ binaryPathsByVersion[currentVersion] = {};
55
+ const neededVersion = neededVersions[currentVersion];
56
+ if (neededVersion.binaryTargets.length === 0) {
57
+ neededVersion.binaryTargets = [{ fromEnvVar: null, value: binaryTarget }];
58
+ }
59
+ if (process.env.NETLIFY) {
60
+ const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20;
61
+ const awsRuntimeVersion = (0, import_chunk_2SDPW6AX.parseAWSNodejsRuntimeEnvVarVersion)();
62
+ const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20;
63
+ const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18;
64
+ const isRhelBinaryTarget1xInNeededVersions = neededVersion.binaryTargets.find(
65
+ (object) => object.value === "rhel-openssl-1.0.x"
66
+ );
67
+ const isRhelBinaryTarget3xInNeededVersions = neededVersion.binaryTargets.find(
68
+ (object) => object.value === "rhel-openssl-3.0.x"
69
+ );
70
+ if (!isRhelBinaryTarget3xInNeededVersions && (isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) {
71
+ neededVersion.binaryTargets.push({
72
+ fromEnvVar: null,
73
+ value: "rhel-openssl-3.0.x"
74
+ });
75
+ } else if (!isRhelBinaryTarget1xInNeededVersions) {
76
+ neededVersion.binaryTargets.push({
77
+ fromEnvVar: null,
78
+ value: "rhel-openssl-1.0.x"
79
+ });
80
+ }
81
+ }
82
+ let binaryTargetBaseDir = eval(`require('path').join(__dirname, '..')`);
83
+ if (version !== currentVersion) {
84
+ binaryTargetBaseDir = import_path.default.join(binaryTargetBaseDir, `./engines/${currentVersion}/`);
85
+ await (0, import_fs_extra.ensureDir)(binaryTargetBaseDir).catch((e) => console.error(e));
86
+ }
87
+ const binariesConfig = neededVersion.engines.reduce((acc, curr) => {
88
+ if (!binaryPathsOverride?.[curr]) {
89
+ acc[(0, import_chunk_4CGPN5SR.engineTypeToBinaryType)(curr)] = binaryTargetBaseDir;
90
+ }
91
+ return acc;
92
+ }, /* @__PURE__ */ Object.create(null));
93
+ if (Object.values(binariesConfig).length > 0) {
94
+ const binaryTargets = neededVersion.binaryTargets.map(
95
+ (binaryTarget2) => binaryTarget2.value
96
+ );
97
+ const downloadParams = {
98
+ binaries: binariesConfig,
99
+ binaryTargets,
100
+ showProgress: typeof printDownloadProgress === "boolean" ? printDownloadProgress : true,
101
+ version: currentVersion && currentVersion !== "latest" ? currentVersion : import_engines.enginesVersion,
102
+ skipDownload
103
+ };
104
+ const binaryPathsWithEngineType = await (0, import_fetch_engine.download)(downloadParams);
105
+ const binaryPaths = (0, import_chunk_7B5PXS6N.mapKeys)(binaryPathsWithEngineType, import_chunk_RS2R7COT.binaryTypeToEngineType);
106
+ binaryPathsByVersion[currentVersion] = binaryPaths;
107
+ }
108
+ if (binaryPathsOverride) {
109
+ const overrideEngines = Object.keys(binaryPathsOverride);
110
+ const enginesCoveredByOverride = neededVersion.engines.filter((engine) => overrideEngines.includes(engine));
111
+ if (enginesCoveredByOverride.length > 0) {
112
+ for (const engine of enginesCoveredByOverride) {
113
+ const enginePath = binaryPathsOverride[engine];
114
+ binaryPathsByVersion[currentVersion][engine] = {
115
+ [binaryTarget]: enginePath
116
+ };
117
+ }
118
+ }
119
+ }
120
+ }
121
+ return binaryPathsByVersion;
122
+ }
@@ -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 chunk_EWWCVGRX_exports = {};
20
- __export(chunk_EWWCVGRX_exports, {
19
+ var chunk_DAAAGJCX_exports = {};
20
+ __export(chunk_DAAAGJCX_exports, {
21
21
  addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
22
22
  });
23
- module.exports = __toCommonJS(chunk_EWWCVGRX_exports);
24
- var import_chunk_HM5POBB4 = require("./chunk-HM5POBB4.js");
23
+ module.exports = __toCommonJS(chunk_DAAAGJCX_exports);
24
+ var import_chunk_LAVMCJNP = require("./chunk-LAVMCJNP.js");
25
25
  var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
26
26
  function addVersionDetailsToErrorMessage(message) {
27
- const rows = [["Prisma CLI Version", import_chunk_HM5POBB4.version]];
27
+ const rows = [["Prisma CLI Version", import_chunk_LAVMCJNP.version]];
28
28
  return `${message}
29
29
 
30
30
  ${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
@@ -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 chunk_HM5POBB4_exports = {};
20
- __export(chunk_HM5POBB4_exports, {
19
+ var chunk_LAVMCJNP_exports = {};
20
+ __export(chunk_LAVMCJNP_exports, {
21
21
  version: () => version
22
22
  });
23
- module.exports = __toCommonJS(chunk_HM5POBB4_exports);
24
- var import_chunk_LEGPENYH = require("./chunk-LEGPENYH.js");
25
- var packageJson = (0, import_chunk_LEGPENYH.require_package)();
23
+ module.exports = __toCommonJS(chunk_LAVMCJNP_exports);
24
+ var import_chunk_2BJ42CN6 = require("./chunk-2BJ42CN6.js");
25
+ var packageJson = (0, import_chunk_2BJ42CN6.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 chunk_6VXLRSIV_exports = {};
30
- __export(chunk_6VXLRSIV_exports, {
29
+ var chunk_P2KRC6ZJ_exports = {};
30
+ __export(chunk_P2KRC6ZJ_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_6VXLRSIV_exports);
34
+ module.exports = __toCommonJS(chunk_P2KRC6ZJ_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
36
  var import_chunk_I4467NNA = require("./chunk-I4467NNA.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_EWWCVGRX = require("./chunk-EWWCVGRX.js");
38
+ var import_chunk_DAAAGJCX = require("./chunk-DAAAGJCX.js");
39
39
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
40
40
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
41
- var import_chunk_7CXYD5ZJ = require("./chunk-7CXYD5ZJ.js");
41
+ var import_chunk_T4HOXYJZ = require("./chunk-T4HOXYJZ.js");
42
42
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
43
43
  var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
44
44
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
60
60
  }).exhaustive();
61
61
  const errorMessageWithContext = `${constructedErrorMessage}
62
62
  [Context: mergeSchemas]`;
63
- super((0, import_chunk_EWWCVGRX.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ super((0, import_chunk_DAAAGJCX.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
64
  this.name = "MergeSchemasError";
65
65
  }
66
66
  };
@@ -73,7 +73,7 @@ function mergeSchemas(options) {
73
73
  const params = JSON.stringify({
74
74
  schema: options.schemas
75
75
  });
76
- return import_chunk_7CXYD5ZJ.prismaSchemaWasm.merge_schemas(params);
76
+ return import_chunk_T4HOXYJZ.prismaSchemaWasm.merge_schemas(params);
77
77
  },
78
78
  (e) => ({
79
79
  type: "wasm-error",