@prisma/internals 5.17.0-integration-show-platform-auth-token.3 → 5.17.0-integration-show-platform-auth-token.4

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 (64) hide show
  1. package/dist/{chunk-EOTOEWEG.js → chunk-2QFQJTM3.js} +16 -16
  2. package/dist/{chunk-JM6ICT4D.js → chunk-4A5ZK522.js} +3 -3
  3. package/dist/{chunk-22WWDCBL.js → chunk-5R627ZMI.js} +7 -7
  4. package/dist/chunk-5XRQ7ONW.js +122 -0
  5. package/dist/{chunk-7QFKPVEI.js → chunk-63WDBN55.js} +5 -5
  6. package/dist/{chunk-KRU3ZK3W.js → chunk-6GOPQDH2.js} +19 -19
  7. package/dist/{chunk-3CRBDWPU.js → chunk-6QMBX5PW.js} +5 -5
  8. package/dist/{chunk-HNFCHBPX.js → chunk-6WETF56C.js} +5 -5
  9. package/dist/{chunk-V3GTH2TA.js → chunk-7GBD3GZZ.js} +5 -5
  10. package/dist/{chunk-IEOLMIMU.js → chunk-ALIEF3BE.js} +15 -15
  11. package/dist/{chunk-OI5GDSG6.js → chunk-EDDYQ5ZF.js} +5 -5
  12. package/dist/{chunk-6HXOL3QF.js → chunk-EYOPVHNV.js} +28 -28
  13. package/dist/{chunk-Z2NHAREC.js → chunk-GHYJGM56.js} +5 -5
  14. package/dist/{chunk-BDXNOGJ3.js → chunk-GJMGCWTR.js} +5 -5
  15. package/dist/chunk-JTMEVPXK.js +177 -0
  16. package/dist/chunk-JUIG32DW.js +110 -0
  17. package/dist/{chunk-EKSAMZHR.js → chunk-KUMD5MBR.js} +10 -10
  18. package/dist/{chunk-IJK3NGWG.js → chunk-NCYBGN3M.js} +5 -5
  19. package/dist/chunk-PN2OFBAO.js +166 -0
  20. package/dist/{chunk-5TGIEWON.js → chunk-QCERIVWN.js} +22 -22
  21. package/dist/chunk-QIVUAERL.js +2202 -0
  22. package/dist/chunk-QL3K6JIN.js +54 -0
  23. package/dist/{chunk-SMHAELKS.js → chunk-QOTVZEEZ.js} +17 -17
  24. package/dist/{chunk-LQD72ZI2.js → chunk-QTT3VIQ3.js} +15 -15
  25. package/dist/{chunk-WPDXG7BG.js → chunk-QVK4UV4F.js} +5 -5
  26. package/dist/{chunk-4SKD6RMZ.js → chunk-TEGKDZJW.js} +6 -6
  27. package/dist/{chunk-HHHZRX5T.js → chunk-TWCV53Y5.js} +16 -16
  28. package/dist/{chunk-ZMLBYV2S.js → chunk-U3FOR7Z4.js} +24 -795
  29. package/dist/{chunk-FTFPVECN.js → chunk-UGBKVZL5.js} +5 -5
  30. package/dist/{chunk-P6T3CL5R.js → chunk-W4W3SS5M.js} +5 -5
  31. package/dist/{chunk-5SEXCYQP.js → chunk-WZYDGIB3.js} +23 -23
  32. package/dist/{chunk-BQ3ZVZLP.js → chunk-XY27KEAX.js} +22 -22
  33. package/dist/{chunk-QEMHOJR6.js → chunk-YM3CE76B.js} +147 -160
  34. package/dist/{chunk-2HYB2BOP.js → chunk-ZH2S54SA.js} +23 -23
  35. package/dist/cli/checkUnsupportedDataProxy.js +20 -20
  36. package/dist/cli/getSchema.js +25 -25
  37. package/dist/cli/hashes.js +20 -20
  38. package/dist/engine-commands/errorHelpers.js +4 -4
  39. package/dist/engine-commands/formatSchema.js +19 -19
  40. package/dist/engine-commands/getConfig.js +13 -13
  41. package/dist/engine-commands/getDmmf.js +10 -10
  42. package/dist/engine-commands/getEngineVersion.js +5 -5
  43. package/dist/engine-commands/getEnginesMetaInfo.js +8 -8
  44. package/dist/engine-commands/index.js +30 -30
  45. package/dist/engine-commands/lintSchema.js +8 -8
  46. package/dist/engine-commands/mergeSchemas.js +10 -10
  47. package/dist/engine-commands/queryEngineCommons.js +7 -7
  48. package/dist/engine-commands/validate.js +10 -10
  49. package/dist/get-generators/generatorResolvers/generatorResolvers.js +19 -19
  50. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +19 -19
  51. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.js +19 -19
  52. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +20 -20
  53. package/dist/get-generators/getGenerators.js +22 -22
  54. package/dist/index.js +57 -57
  55. package/dist/resolveBinary.js +7 -7
  56. package/dist/schemaEngineCommands.js +8 -8
  57. package/dist/sendPanic.js +19 -19
  58. package/dist/utils/fs-functional.js +9 -9
  59. package/dist/utils/getEnvPaths.js +19 -19
  60. package/dist/utils/getVersionFromPackageJson.js +3 -3
  61. package/dist/utils/handlePanic.js +19 -19
  62. package/dist/utils/loadEnvFile.js +19 -19
  63. package/dist/wasm.js +4 -4
  64. package/package.json +9 -9
@@ -26,33 +26,33 @@ 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_6HXOL3QF_exports = {};
30
- __export(chunk_6HXOL3QF_exports, {
29
+ var chunk_EYOPVHNV_exports = {};
30
+ __export(chunk_EYOPVHNV_exports, {
31
31
  getEnginesInfo: () => getEnginesInfo,
32
32
  getEnginesMetaInfo: () => getEnginesMetaInfo,
33
33
  resolveEngine: () => resolveEngine
34
34
  });
35
- module.exports = __toCommonJS(chunk_6HXOL3QF_exports);
36
- var import_chunk_SMHAELKS = require("./chunk-SMHAELKS.js");
37
- var import_chunk_22WWDCBL = require("./chunk-22WWDCBL.js");
35
+ module.exports = __toCommonJS(chunk_EYOPVHNV_exports);
36
+ var import_chunk_QOTVZEEZ = require("./chunk-QOTVZEEZ.js");
37
+ var import_chunk_QL3K6JIN = require("./chunk-QL3K6JIN.js");
38
38
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
39
- var import_chunk_Z2NHAREC = require("./chunk-Z2NHAREC.js");
40
- var import_chunk_JM6ICT4D = require("./chunk-JM6ICT4D.js");
39
+ var import_chunk_GHYJGM56 = require("./chunk-GHYJGM56.js");
40
+ var import_chunk_4A5ZK522 = require("./chunk-4A5ZK522.js");
41
41
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
42
42
  var import_engines = require("@prisma/engines");
43
43
  var import_fetch_engine = require("@prisma/fetch-engine");
44
44
  var import_path = __toESM(require("path"));
45
- var import_function2 = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_SMHAELKS.require_function)());
46
- var none2 = import_chunk_JM6ICT4D.none;
47
- var some2 = import_chunk_JM6ICT4D.some;
45
+ var import_function2 = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_QOTVZEEZ.require_function)());
46
+ var none2 = import_chunk_4A5ZK522.none;
47
+ var some2 = import_chunk_4A5ZK522.some;
48
48
  var getRight = function(ma) {
49
49
  return ma._tag === "Left" ? none2 : some2(ma.right);
50
50
  };
51
51
  var _map = function(fa, f) {
52
- return (0, import_chunk_JM6ICT4D.pipe)(fa, map(f));
52
+ return (0, import_chunk_4A5ZK522.pipe)(fa, map(f));
53
53
  };
54
54
  var _ap = function(fab, fa) {
55
- return (0, import_chunk_JM6ICT4D.pipe)(fab, ap(fa));
55
+ return (0, import_chunk_4A5ZK522.pipe)(fab, ap(fa));
56
56
  };
57
57
  var URI = "Option";
58
58
  var map = function(f) {
@@ -64,14 +64,14 @@ var Functor = {
64
64
  URI,
65
65
  map: _map
66
66
  };
67
- var as2 = (0, import_chunk_JM6ICT4D.dual)(2, (0, import_chunk_JM6ICT4D.as)(Functor));
68
- var asUnit2 = (0, import_chunk_JM6ICT4D.asUnit)(Functor);
67
+ var as2 = (0, import_chunk_4A5ZK522.dual)(2, (0, import_chunk_4A5ZK522.as)(Functor));
68
+ var asUnit2 = (0, import_chunk_4A5ZK522.asUnit)(Functor);
69
69
  var ap = function(fa) {
70
70
  return function(fab) {
71
71
  return isNone(fab) ? none2 : isNone(fa) ? none2 : some2(fab.value(fa.value));
72
72
  };
73
73
  };
74
- var flatMap = /* @__PURE__ */ (0, import_chunk_JM6ICT4D.dual)(2, function(ma, f) {
74
+ var flatMap = /* @__PURE__ */ (0, import_chunk_4A5ZK522.dual)(2, function(ma, f) {
75
75
  return isNone(ma) ? none2 : f(ma.value);
76
76
  });
77
77
  var Chain = {
@@ -80,7 +80,7 @@ var Chain = {
80
80
  ap: _ap,
81
81
  chain: flatMap
82
82
  };
83
- var orElse = (0, import_chunk_JM6ICT4D.dual)(2, function(self, that) {
83
+ var orElse = (0, import_chunk_4A5ZK522.dual)(2, function(self, that) {
84
84
  return isNone(self) ? that() : self;
85
85
  });
86
86
  var fromEither2 = getRight;
@@ -88,7 +88,7 @@ var FromEither = {
88
88
  URI,
89
89
  fromEither: fromEither2
90
90
  };
91
- var isSome2 = import_chunk_JM6ICT4D.isSome;
91
+ var isSome2 = import_chunk_4A5ZK522.isSome;
92
92
  var isNone = function(fa) {
93
93
  return fa._tag === "None";
94
94
  };
@@ -99,8 +99,8 @@ var matchW = function(onNone, onSome) {
99
99
  };
100
100
  var match = matchW;
101
101
  var fold = match;
102
- var tap2 = /* @__PURE__ */ (0, import_chunk_JM6ICT4D.dual)(2, (0, import_chunk_JM6ICT4D.tap)(Chain));
103
- var tapEither2 = /* @__PURE__ */ (0, import_chunk_JM6ICT4D.dual)(2, (0, import_chunk_JM6ICT4D.tapEither)(FromEither, Chain));
102
+ var tap2 = /* @__PURE__ */ (0, import_chunk_4A5ZK522.dual)(2, (0, import_chunk_4A5ZK522.tap)(Chain));
103
+ var tapEither2 = /* @__PURE__ */ (0, import_chunk_4A5ZK522.dual)(2, (0, import_chunk_4A5ZK522.tapEither)(FromEither, Chain));
104
104
  var fromNullable = function(a) {
105
105
  return a == null ? none2 : some2(a);
106
106
  };
@@ -133,15 +133,15 @@ function getEnginesInfo(enginesInfo) {
133
133
  const resolved = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ fromEnvVar: import_chunk_H3T4L34H.N.when(isSome2) }, (_engineInfo) => {
134
134
  return `, resolved by ${_engineInfo.fromEnvVar.value}`;
135
135
  }).otherwise(() => "");
136
- const absolutePath = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_JM6ICT4D.isRight) }, (_engineInfo) => {
136
+ const absolutePath = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_4A5ZK522.isRight) }, (_engineInfo) => {
137
137
  return _engineInfo.path.right;
138
- }).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_JM6ICT4D.isLeft) }, (_engineInfo) => {
138
+ }).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_4A5ZK522.isLeft) }, (_engineInfo) => {
139
139
  errors.push(_engineInfo.path.left);
140
140
  return "E_CANNOT_RESOLVE_PATH";
141
141
  }).exhaustive();
142
- const version = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_JM6ICT4D.isRight) }, (_engineInfo) => {
142
+ const version = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_4A5ZK522.isRight) }, (_engineInfo) => {
143
143
  return _engineInfo.version.right;
144
- }).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_JM6ICT4D.isLeft) }, (_engineInfo) => {
144
+ }).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_4A5ZK522.isLeft) }, (_engineInfo) => {
145
145
  errors.push(_engineInfo.version.left);
146
146
  return "E_CANNOT_RESOLVE_VERSION";
147
147
  }).exhaustive();
@@ -157,15 +157,15 @@ async function resolveEngine(binaryName) {
157
157
  const enginePathEither = await (0, import_function2.pipe)(
158
158
  pathFromEnvOption,
159
159
  fold(
160
- () => (0, import_chunk_Z2NHAREC.safeResolveBinary)(binaryName),
161
- (pathFromEnv) => (0, import_chunk_JM6ICT4D.right2)(pathFromEnv.path)
160
+ () => (0, import_chunk_GHYJGM56.safeResolveBinary)(binaryName),
161
+ (pathFromEnv) => (0, import_chunk_4A5ZK522.right2)(pathFromEnv.path)
162
162
  )
163
163
  )();
164
164
  const versionEither = await (0, import_function2.pipe)(
165
165
  enginePathEither,
166
- import_chunk_JM6ICT4D.fromEither,
167
- (0, import_chunk_JM6ICT4D.chain)((enginePath) => {
168
- return (0, import_chunk_22WWDCBL.safeGetEngineVersion)(enginePath, binaryName);
166
+ import_chunk_4A5ZK522.fromEither,
167
+ (0, import_chunk_4A5ZK522.chain)((enginePath) => {
168
+ return (0, import_chunk_QL3K6JIN.safeGetEngineVersion)(enginePath, binaryName);
169
169
  })
170
170
  )();
171
171
  const engineInfo = {
@@ -26,19 +26,19 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_Z2NHAREC_exports = {};
30
- __export(chunk_Z2NHAREC_exports, {
29
+ var chunk_GHYJGM56_exports = {};
30
+ __export(chunk_GHYJGM56_exports, {
31
31
  BinaryType: () => import_fetch_engine.BinaryType,
32
32
  engineEnvVarMap: () => import_fetch_engine.engineEnvVarMap,
33
33
  maybeCopyToTmp: () => maybeCopyToTmp,
34
34
  resolveBinary: () => resolveBinary,
35
35
  safeResolveBinary: () => safeResolveBinary
36
36
  });
37
- module.exports = __toCommonJS(chunk_Z2NHAREC_exports);
37
+ module.exports = __toCommonJS(chunk_GHYJGM56_exports);
38
38
  var import_chunk_RQPDQSHK = require("./chunk-RQPDQSHK.js");
39
39
  var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
40
40
  var import_chunk_TWSLDIFL = require("./chunk-TWSLDIFL.js");
41
- var import_chunk_JM6ICT4D = require("./chunk-JM6ICT4D.js");
41
+ var import_chunk_4A5ZK522 = require("./chunk-4A5ZK522.js");
42
42
  var import_chunk_TZCE3PWZ = require("./chunk-TZCE3PWZ.js");
43
43
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
44
44
  var import_engines = require("@prisma/engines");
@@ -90,7 +90,7 @@ async function resolveBinary(name, proposedPath) {
90
90
  );
91
91
  }
92
92
  function safeResolveBinary(name, proposedPath) {
93
- return (0, import_chunk_JM6ICT4D.tryCatch2)(
93
+ return (0, import_chunk_4A5ZK522.tryCatch2)(
94
94
  () => resolveBinary(name, proposedPath),
95
95
  (error) => error
96
96
  );
@@ -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 chunk_BDXNOGJ3_exports = {};
20
- __export(chunk_BDXNOGJ3_exports, {
19
+ var chunk_GJMGCWTR_exports = {};
20
+ __export(chunk_GJMGCWTR_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(chunk_BDXNOGJ3_exports);
27
+ module.exports = __toCommonJS(chunk_GJMGCWTR_exports);
28
28
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
29
- var import_chunk_HNFCHBPX = require("./chunk-HNFCHBPX.js");
29
+ var import_chunk_6WETF56C = require("./chunk-6WETF56C.js");
30
30
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
31
31
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
32
32
  function lintSchema({ schemas }) {
33
- const lintResult = import_chunk_HNFCHBPX.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
+ const lintResult = import_chunk_6WETF56C.prismaSchemaWasm.lint(JSON.stringify(schemas));
34
34
  const lintDiagnostics = JSON.parse(lintResult);
35
35
  return lintDiagnostics;
36
36
  }
@@ -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_JTMEVPXK_exports = {};
30
+ __export(chunk_JTMEVPXK_exports, {
31
+ getEnginesInfo: () => getEnginesInfo,
32
+ getEnginesMetaInfo: () => getEnginesMetaInfo,
33
+ resolveEngine: () => resolveEngine
34
+ });
35
+ module.exports = __toCommonJS(chunk_JTMEVPXK_exports);
36
+ var import_chunk_QOTVZEEZ = require("./chunk-QOTVZEEZ.js");
37
+ var import_chunk_5R627ZMI = require("./chunk-5R627ZMI.js");
38
+ var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
39
+ var import_chunk_JUIG32DW = require("./chunk-JUIG32DW.js");
40
+ var import_chunk_4A5ZK522 = require("./chunk-4A5ZK522.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_QOTVZEEZ.require_function)());
46
+ var none2 = import_chunk_4A5ZK522.none;
47
+ var some2 = import_chunk_4A5ZK522.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_4A5ZK522.pipe)(fa, map(f));
53
+ };
54
+ var _ap = function(fab, fa) {
55
+ return (0, import_chunk_4A5ZK522.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_4A5ZK522.dual)(2, (0, import_chunk_4A5ZK522.as)(Functor));
68
+ var asUnit2 = (0, import_chunk_4A5ZK522.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_4A5ZK522.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_4A5ZK522.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_4A5ZK522.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_4A5ZK522.dual)(2, (0, import_chunk_4A5ZK522.tap)(Chain));
103
+ var tapEither2 = /* @__PURE__ */ (0, import_chunk_4A5ZK522.dual)(2, (0, import_chunk_4A5ZK522.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_4A5ZK522.isRight) }, (_engineInfo) => {
137
+ return _engineInfo.path.right;
138
+ }).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_4A5ZK522.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_4A5ZK522.isRight) }, (_engineInfo) => {
143
+ return _engineInfo.version.right;
144
+ }).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_4A5ZK522.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_JUIG32DW.safeResolveBinary)(binaryName),
161
+ (pathFromEnv) => (0, import_chunk_4A5ZK522.right2)(pathFromEnv.path)
162
+ )
163
+ )();
164
+ const versionEither = await (0, import_function2.pipe)(
165
+ enginePathEither,
166
+ import_chunk_4A5ZK522.fromEither,
167
+ (0, import_chunk_4A5ZK522.chain)((enginePath) => {
168
+ return (0, import_chunk_5R627ZMI.safeGetEngineVersion)(enginePath, binaryName);
169
+ })
170
+ )();
171
+ const engineInfo = {
172
+ path: enginePathEither,
173
+ version: versionEither,
174
+ fromEnvVar: fromEnvVarOption
175
+ };
176
+ return engineInfo;
177
+ }
@@ -0,0 +1,110 @@
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_JUIG32DW_exports = {};
30
+ __export(chunk_JUIG32DW_exports, {
31
+ BinaryType: () => import_fetch_engine.BinaryType,
32
+ engineEnvVarMap: () => import_fetch_engine.engineEnvVarMap,
33
+ maybeCopyToTmp: () => maybeCopyToTmp,
34
+ resolveBinary: () => resolveBinary,
35
+ safeResolveBinary: () => safeResolveBinary
36
+ });
37
+ module.exports = __toCommonJS(chunk_JUIG32DW_exports);
38
+ var import_chunk_QIVUAERL = require("./chunk-QIVUAERL.js");
39
+ var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
40
+ var import_chunk_TWSLDIFL = require("./chunk-TWSLDIFL.js");
41
+ var import_chunk_4A5ZK522 = require("./chunk-4A5ZK522.js");
42
+ var import_chunk_TZCE3PWZ = require("./chunk-TZCE3PWZ.js");
43
+ var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
44
+ var import_engines = require("@prisma/engines");
45
+ var import_fetch_engine = require("@prisma/fetch-engine");
46
+ var import_get_platform = require("@prisma/get-platform");
47
+ var import_fs = __toESM2(require("fs"));
48
+ var import_path = __toESM2(require("path"));
49
+ var import_fs_extra = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_QIVUAERL.require_lib)());
50
+ var import_temp_dir = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_TZCE3PWZ.require_temp_dir)());
51
+ async function getBinaryName(name) {
52
+ const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
53
+ const extension = binaryTarget === "windows" ? ".exe" : "";
54
+ if (name === import_fetch_engine.BinaryType.QueryEngineLibrary) {
55
+ return (0, import_get_platform.getNodeAPIName)(binaryTarget, "fs");
56
+ }
57
+ return `${name}-${binaryTarget}${extension}`;
58
+ }
59
+ async function resolveBinary(name, proposedPath) {
60
+ if (proposedPath && !proposedPath.match(import_chunk_M3GBKLGE.vercelPkgPathRegex) && import_fs.default.existsSync(proposedPath)) {
61
+ return proposedPath;
62
+ }
63
+ const pathFromEnvVar = (0, import_fetch_engine.getBinaryEnvVarPath)(name);
64
+ if (pathFromEnvVar !== null) {
65
+ return pathFromEnvVar.path;
66
+ }
67
+ const binaryName = await getBinaryName(name);
68
+ const prismaPath = import_path.default.join((0, import_engines.getEnginesPath)(), binaryName);
69
+ if (import_fs.default.existsSync(prismaPath)) {
70
+ return maybeCopyToTmp(prismaPath);
71
+ }
72
+ const prismaPath2 = import_path.default.join(__dirname, "..", binaryName);
73
+ if (import_fs.default.existsSync(prismaPath2)) {
74
+ return maybeCopyToTmp(prismaPath2);
75
+ }
76
+ const prismaPath3 = import_path.default.join(__dirname, "../..", binaryName);
77
+ if (import_fs.default.existsSync(prismaPath3)) {
78
+ return maybeCopyToTmp(prismaPath3);
79
+ }
80
+ const prismaPath4 = import_path.default.join(__dirname, "../runtime", binaryName);
81
+ if (import_fs.default.existsSync(prismaPath4)) {
82
+ return maybeCopyToTmp(prismaPath4);
83
+ }
84
+ throw new Error(
85
+ `Could not find ${name} binary. Searched in:
86
+ - ${prismaPath}
87
+ - ${prismaPath2}
88
+ - ${prismaPath3}
89
+ - ${prismaPath4}`
90
+ );
91
+ }
92
+ function safeResolveBinary(name, proposedPath) {
93
+ return (0, import_chunk_4A5ZK522.tryCatch2)(
94
+ () => resolveBinary(name, proposedPath),
95
+ (error) => error
96
+ );
97
+ }
98
+ async function maybeCopyToTmp(file) {
99
+ const dir = eval("__dirname");
100
+ if (dir.match(import_chunk_M3GBKLGE.vercelPkgPathRegex)) {
101
+ const targetDir = import_path.default.join(import_temp_dir.default, "prisma-binaries");
102
+ await (0, import_fs_extra.ensureDir)(targetDir);
103
+ const target = import_path.default.join(targetDir, import_path.default.basename(file));
104
+ const data = await import_fs.default.promises.readFile(file);
105
+ await import_fs.default.promises.writeFile(target, data);
106
+ (0, import_chunk_TWSLDIFL.chmodPlusX)(target);
107
+ return target;
108
+ }
109
+ return file;
110
+ }
@@ -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 chunk_EKSAMZHR_exports = {};
30
- __export(chunk_EKSAMZHR_exports, {
29
+ var chunk_KUMD5MBR_exports = {};
30
+ __export(chunk_KUMD5MBR_exports, {
31
31
  createDebugErrorType: () => createDebugErrorType,
32
32
  createSchemaValidationError: () => createSchemaValidationError,
33
33
  parseQueryEngineError: () => parseQueryEngineError,
34
34
  unlinkTempDatamodelPath: () => unlinkTempDatamodelPath
35
35
  });
36
- module.exports = __toCommonJS(chunk_EKSAMZHR_exports);
36
+ module.exports = __toCommonJS(chunk_KUMD5MBR_exports);
37
37
  var import_chunk_WMIBAVWZ = require("./chunk-WMIBAVWZ.js");
38
- var import_chunk_SMHAELKS = require("./chunk-SMHAELKS.js");
38
+ var import_chunk_QOTVZEEZ = require("./chunk-QOTVZEEZ.js");
39
39
  var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
40
- var import_chunk_JM6ICT4D = require("./chunk-JM6ICT4D.js");
40
+ var import_chunk_4A5ZK522 = require("./chunk-4A5ZK522.js");
41
41
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
42
42
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
43
43
  var import_fs = __toESM(require("fs"));
44
- var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_SMHAELKS.require_function)());
44
+ var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_QOTVZEEZ.require_function)());
45
45
  function unlinkTempDatamodelPath(options, tempDatamodelPath) {
46
- return (0, import_chunk_JM6ICT4D.tryCatch2)(
46
+ return (0, import_chunk_4A5ZK522.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, import_chunk_JM6ICT4D.tryCatch)(
69
+ (0, import_chunk_4A5ZK522.tryCatch)(
70
70
  () => JSON.parse(errorOutput),
71
71
  () => ({ _tag: "unparsed", message: errorOutput, reason })
72
72
  ),
73
- (0, import_chunk_JM6ICT4D.map)((errorOutputAsJSON) => {
73
+ (0, import_chunk_4A5ZK522.map)((errorOutputAsJSON) => {
74
74
  const defaultMessage = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)((0, import_chunk_WMIBAVWZ.relativizePathInPSLError)(errorOutputAsJSON.message)));
75
75
  const getConfigErrorInit = (0, import_chunk_H3T4L34H.$)(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, import_chunk_JM6ICT4D.getOrElseW)(import_function.identity)
92
+ (0, import_chunk_4A5ZK522.getOrElseW)(import_function.identity)
93
93
  );
94
94
  return actualError;
95
95
  }
@@ -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_IJK3NGWG_exports = {};
20
- __export(chunk_IJK3NGWG_exports, {
19
+ var chunk_NCYBGN3M_exports = {};
20
+ __export(chunk_NCYBGN3M_exports, {
21
21
  version: () => version
22
22
  });
23
- module.exports = __toCommonJS(chunk_IJK3NGWG_exports);
24
- var import_chunk_3CRBDWPU = require("./chunk-3CRBDWPU.js");
25
- var packageJson = (0, import_chunk_3CRBDWPU.require_package)();
23
+ module.exports = __toCommonJS(chunk_NCYBGN3M_exports);
24
+ var import_chunk_6QMBX5PW = require("./chunk-6QMBX5PW.js");
25
+ var packageJson = (0, import_chunk_6QMBX5PW.require_package)();
26
26
  var version = packageJson.version;