@prisma/internals 7.6.0 → 7.7.0-dev.2

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 (47) hide show
  1. package/dist/{chunk-W7KSZAZR.js → chunk-23FCYS36.js} +5 -5
  2. package/dist/{chunk-XG2EEDCS.js → chunk-AYKHFUHB.js} +5 -5
  3. package/dist/{chunk-LDN2T2EE.js → chunk-B7X6GLGJ.js} +7 -7
  4. package/dist/{chunk-D27PKXGJ.js → chunk-E644FVCY.js} +8 -8
  5. package/dist/{chunk-KICDQAEF.js → chunk-EQ7XM232.js} +8 -8
  6. package/dist/{chunk-6JKAPABH.js → chunk-FIDYCH4Q.js} +5 -5
  7. package/dist/chunk-IVPOBWVG.js +104 -0
  8. package/dist/{chunk-NNEILADH.js → chunk-JWTZIJ4N.js} +5 -4
  9. package/dist/{chunk-AHF2BN3G.js → chunk-MPKKUOYA.js} +5 -5
  10. package/dist/{chunk-SFNNUEKP.js → chunk-N7SNWLKR.js} +15 -20
  11. package/dist/{chunk-FUDRGWAF.js → chunk-NWDOSRX2.js} +4 -3
  12. package/dist/chunk-QH3JKKFJ.js +104 -0
  13. package/dist/{chunk-OMJOKO7H.js → chunk-SZ735VHI.js} +5 -5
  14. package/dist/{chunk-KAFC7IGG.js → chunk-TMUYUMBB.js} +5 -5
  15. package/dist/{chunk-7RSE6ZPN.js → chunk-USHXVHZH.js} +7 -7
  16. package/dist/{chunk-DTWLDI62.js → chunk-VL7TE7XG.js} +5 -5
  17. package/dist/{chunk-XZUFIKIC.js → chunk-VV6EBVZS.js} +5 -5
  18. package/dist/{chunk-6S76OKUD.js → chunk-WJPDCCIW.js} +8 -8
  19. package/dist/{chunk-UF2U3QP5.js → chunk-YE3EKTIE.js} +8 -8
  20. package/dist/{chunk-VAD6ZZ6O.js → chunk-ZI7BX3VK.js} +15 -20
  21. package/dist/cli/checkUnsupportedDataProxy.js +12 -12
  22. package/dist/cli/schemaContext.js +13 -13
  23. package/dist/engine-commands/errorHelpers.js +4 -4
  24. package/dist/engine-commands/formatSchema.d.ts +1 -1
  25. package/dist/engine-commands/formatSchema.js +11 -11
  26. package/dist/engine-commands/getConfig.d.ts +1 -1
  27. package/dist/engine-commands/getConfig.js +7 -7
  28. package/dist/engine-commands/getDmmf.d.ts +3 -2
  29. package/dist/engine-commands/getDmmf.js +9 -8
  30. package/dist/engine-commands/index.d.ts +1 -1
  31. package/dist/engine-commands/index.js +20 -18
  32. package/dist/engine-commands/lintSchema.d.ts +1 -1
  33. package/dist/engine-commands/lintSchema.js +8 -8
  34. package/dist/engine-commands/mergeSchemas.d.ts +1 -1
  35. package/dist/engine-commands/mergeSchemas.js +7 -7
  36. package/dist/engine-commands/validate.d.ts +1 -1
  37. package/dist/engine-commands/validate.js +7 -7
  38. package/dist/get-generators/getGenerators.js +14 -14
  39. package/dist/index.d.ts +2 -2
  40. package/dist/index.js +29 -27
  41. package/dist/utils/getVersionFromPackageJson.js +3 -3
  42. package/dist/utils/schemaFileInput.d.ts +1 -4
  43. package/dist/utils/toSchemasContainer.d.ts +1 -1
  44. package/dist/wasm.js +5 -5
  45. package/package.json +12 -11
  46. package/dist/chunk-NBF7VTDY.js +0 -193
  47. package/dist/chunk-OPOVQ5PN.js +0 -193
@@ -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_W7KSZAZR_exports = {};
20
- __export(chunk_W7KSZAZR_exports, {
19
+ var chunk_23FCYS36_exports = {};
20
+ __export(chunk_23FCYS36_exports, {
21
21
  addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
22
22
  });
23
- module.exports = __toCommonJS(chunk_W7KSZAZR_exports);
24
- var import_chunk_XZUFIKIC = require("./chunk-XZUFIKIC.js");
23
+ module.exports = __toCommonJS(chunk_23FCYS36_exports);
24
+ var import_chunk_VV6EBVZS = require("./chunk-VV6EBVZS.js");
25
25
  var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
26
26
  function addVersionDetailsToErrorMessage(message) {
27
- const rows = [["Prisma CLI Version", import_chunk_XZUFIKIC.version]];
27
+ const rows = [["Prisma CLI Version", import_chunk_VV6EBVZS.version]];
28
28
  return `${message}
29
29
 
30
30
  ${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_XG2EEDCS_exports = {};
30
- __export(chunk_XG2EEDCS_exports, {
29
+ var chunk_AYKHFUHB_exports = {};
30
+ __export(chunk_AYKHFUHB_exports, {
31
31
  prismaSchemaWasm: () => import_prisma_schema_wasm.default,
32
32
  prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
33
33
  schemaEngineWasmVersion: () => schemaEngineWasmVersion,
34
34
  wasm_exports: () => wasm_exports
35
35
  });
36
- module.exports = __toCommonJS(chunk_XG2EEDCS_exports);
37
- var import_chunk_NNEILADH = require("./chunk-NNEILADH.js");
36
+ module.exports = __toCommonJS(chunk_AYKHFUHB_exports);
37
+ var import_chunk_NWDOSRX2 = require("./chunk-NWDOSRX2.js");
38
38
  var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
39
39
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
40
40
  var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
@@ -46,6 +46,6 @@ var wasm_exports = {};
46
46
  });
47
47
  var globalWithPanicRegistry = globalThis;
48
48
  globalWithPanicRegistry.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
49
- var { dependencies } = (0, import_chunk_NNEILADH.require_package)();
49
+ var { dependencies } = (0, import_chunk_NWDOSRX2.require_package)();
50
50
  var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
51
51
  var schemaEngineWasmVersion = dependencies["@prisma/schema-engine-wasm"];
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_LDN2T2EE_exports = {};
30
- __export(chunk_LDN2T2EE_exports, {
29
+ var chunk_B7X6GLGJ_exports = {};
30
+ __export(chunk_B7X6GLGJ_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_LDN2T2EE_exports);
34
+ module.exports = __toCommonJS(chunk_B7X6GLGJ_exports);
35
35
  var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_DTWLDI62 = require("./chunk-DTWLDI62.js");
39
- var import_chunk_KAFC7IGG = require("./chunk-KAFC7IGG.js");
38
+ var import_chunk_23FCYS36 = require("./chunk-23FCYS36.js");
39
+ var import_chunk_TMUYUMBB = require("./chunk-TMUYUMBB.js");
40
40
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
41
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
42
42
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: mergeSchemas]`;
62
- super((0, import_chunk_DTWLDI62.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_23FCYS36.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "MergeSchemasError";
64
64
  }
65
65
  };
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
72
72
  const params = JSON.stringify({
73
73
  schema: options.schemas
74
74
  });
75
- return import_chunk_KAFC7IGG.prismaSchemaWasm.merge_schemas(params);
75
+ return import_chunk_TMUYUMBB.prismaSchemaWasm.merge_schemas(params);
76
76
  },
77
77
  (e) => ({
78
78
  type: "wasm-error",
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_D27PKXGJ_exports = {};
30
- __export(chunk_D27PKXGJ_exports, {
29
+ var chunk_E644FVCY_exports = {};
30
+ __export(chunk_E644FVCY_exports, {
31
31
  ValidateError: () => ValidateError,
32
32
  validate: () => validate
33
33
  });
34
- module.exports = __toCommonJS(chunk_D27PKXGJ_exports);
34
+ module.exports = __toCommonJS(chunk_E644FVCY_exports);
35
35
  var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_DTWLDI62 = require("./chunk-DTWLDI62.js");
39
- var import_chunk_KAFC7IGG = require("./chunk-KAFC7IGG.js");
38
+ var import_chunk_VL7TE7XG = require("./chunk-VL7TE7XG.js");
39
+ var import_chunk_AYKHFUHB = require("./chunk-AYKHFUHB.js");
40
40
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
41
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
42
42
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: validate]`;
62
- super((0, import_chunk_DTWLDI62.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_VL7TE7XG.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "ValidateError";
64
64
  }
65
65
  };
@@ -71,13 +71,13 @@ function validate(options) {
71
71
  () => {
72
72
  if (process.env.FORCE_PANIC_GET_DMMF) {
73
73
  debug("Triggering a Rust panic...");
74
- import_chunk_KAFC7IGG.prismaSchemaWasm.debug_panic();
74
+ import_chunk_AYKHFUHB.prismaSchemaWasm.debug_panic();
75
75
  }
76
76
  const params = JSON.stringify({
77
77
  prismaSchema: options.schemas,
78
78
  noColor: Boolean(process.env.NO_COLOR)
79
79
  });
80
- import_chunk_KAFC7IGG.prismaSchemaWasm.validate(params);
80
+ import_chunk_AYKHFUHB.prismaSchemaWasm.validate(params);
81
81
  },
82
82
  (e) => ({
83
83
  type: "wasm-error",
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_KICDQAEF_exports = {};
30
- __export(chunk_KICDQAEF_exports, {
29
+ var chunk_EQ7XM232_exports = {};
30
+ __export(chunk_EQ7XM232_exports, {
31
31
  ValidateError: () => ValidateError,
32
32
  validate: () => validate
33
33
  });
34
- module.exports = __toCommonJS(chunk_KICDQAEF_exports);
34
+ module.exports = __toCommonJS(chunk_EQ7XM232_exports);
35
35
  var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_W7KSZAZR = require("./chunk-W7KSZAZR.js");
39
- var import_chunk_XG2EEDCS = require("./chunk-XG2EEDCS.js");
38
+ var import_chunk_23FCYS36 = require("./chunk-23FCYS36.js");
39
+ var import_chunk_TMUYUMBB = require("./chunk-TMUYUMBB.js");
40
40
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
41
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
42
42
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: validate]`;
62
- super((0, import_chunk_W7KSZAZR.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_23FCYS36.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "ValidateError";
64
64
  }
65
65
  };
@@ -71,13 +71,13 @@ function validate(options) {
71
71
  () => {
72
72
  if (process.env.FORCE_PANIC_GET_DMMF) {
73
73
  debug("Triggering a Rust panic...");
74
- import_chunk_XG2EEDCS.prismaSchemaWasm.debug_panic();
74
+ import_chunk_TMUYUMBB.prismaSchemaWasm.debug_panic();
75
75
  }
76
76
  const params = JSON.stringify({
77
77
  prismaSchema: options.schemas,
78
78
  noColor: Boolean(process.env.NO_COLOR)
79
79
  });
80
- import_chunk_XG2EEDCS.prismaSchemaWasm.validate(params);
80
+ import_chunk_TMUYUMBB.prismaSchemaWasm.validate(params);
81
81
  },
82
82
  (e) => ({
83
83
  type: "wasm-error",
@@ -16,20 +16,20 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_6JKAPABH_exports = {};
20
- __export(chunk_6JKAPABH_exports, {
19
+ var chunk_FIDYCH4Q_exports = {};
20
+ __export(chunk_FIDYCH4Q_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_6JKAPABH_exports);
28
- var import_chunk_KAFC7IGG = require("./chunk-KAFC7IGG.js");
27
+ module.exports = __toCommonJS(chunk_FIDYCH4Q_exports);
28
+ var import_chunk_AYKHFUHB = require("./chunk-AYKHFUHB.js");
29
29
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
30
30
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
31
31
  function lintSchema({ schemas }) {
32
- const lintResult = import_chunk_KAFC7IGG.prismaSchemaWasm.lint(JSON.stringify(schemas));
32
+ const lintResult = import_chunk_AYKHFUHB.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
33
  const lintDiagnostics = JSON.parse(lintResult);
34
34
  return lintDiagnostics;
35
35
  }
@@ -0,0 +1,104 @@
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_IVPOBWVG_exports = {};
30
+ __export(chunk_IVPOBWVG_exports, {
31
+ GetDmmfError: () => GetDmmfError,
32
+ externalToInternalDmmf: () => import_get_dmmf2.externalToInternalDmmf,
33
+ getDMMF: () => getDMMF,
34
+ getInternalDMMF: () => getInternalDMMF
35
+ });
36
+ module.exports = __toCommonJS(chunk_IVPOBWVG_exports);
37
+ var import_chunk_IL7PSY44 = require("./chunk-IL7PSY44.js");
38
+ var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
39
+ var import_chunk_VL7TE7XG = require("./chunk-VL7TE7XG.js");
40
+ var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
41
+ var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
42
+ var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
43
+ var import_debug = __toESM(require("@prisma/debug"));
44
+ var import_get_dmmf = require("@prisma/get-dmmf");
45
+ var import_get_dmmf2 = require("@prisma/get-dmmf");
46
+ var debug = (0, import_debug.default)("prisma:getDMMF");
47
+ var debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "getDmmfWasm");
48
+ var GetDmmfError = class extends Error {
49
+ constructor(params) {
50
+ const constructedErrorMessage = (0, import_chunk_XKZ6CBLA.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
51
+ const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
52
+ return `${reason}
53
+ ${errorCodeMessage}
54
+ ${message}`;
55
+ }).with({ _tag: "unparsed" }, ({ message, reason }) => {
56
+ const detailsHeader = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)("Details:"));
57
+ return `${reason}
58
+ ${detailsHeader} ${message}`;
59
+ }).exhaustive();
60
+ const errorMessageWithContext = `${constructedErrorMessage}
61
+ [Context: getDmmf]`;
62
+ super((0, import_chunk_VL7TE7XG.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ this.name = "GetDmmfError";
64
+ }
65
+ };
66
+ async function getDMMF(options) {
67
+ return Promise.resolve(handleGetDmmfResult((0, import_get_dmmf.getDMMF)(options)));
68
+ }
69
+ async function getInternalDMMF(options) {
70
+ return Promise.resolve(handleGetDmmfResult((0, import_get_dmmf.getInternalDMMF)(options)));
71
+ }
72
+ function handleGetDmmfResult(result) {
73
+ if ("error" in result) {
74
+ debugErrorType(result);
75
+ switch (result.type) {
76
+ case "wasm-error":
77
+ throw mapWasmPanicToGetDmmfError(result.error, result.reason);
78
+ case "parse-json":
79
+ throw new GetDmmfError({ _tag: "unparsed", message: result.error.message, reason: result.reason });
80
+ default:
81
+ (0, import_chunk_IL7PSY44.assertNever)(result.type, "Unknown getDmmf error type");
82
+ }
83
+ } else {
84
+ return result;
85
+ }
86
+ }
87
+ function mapWasmPanicToGetDmmfError(error, reason) {
88
+ if ((0, import_chunk_LMVSIVKQ.isWasmPanic)(error)) {
89
+ const { message, stack } = (0, import_chunk_LMVSIVKQ.getWasmError)(error);
90
+ const panic = new import_chunk_LMVSIVKQ.RustPanic(
91
+ /* message */
92
+ message,
93
+ /* rustStack */
94
+ stack,
95
+ /* request */
96
+ "@prisma/prisma-schema-wasm get_dmmf",
97
+ "FMT_CLI"
98
+ /* FMT_CLI */
99
+ );
100
+ return panic;
101
+ }
102
+ const errorOutput = error.message;
103
+ return new GetDmmfError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason }));
104
+ }
@@ -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_NNEILADH_exports = {};
20
- __export(chunk_NNEILADH_exports, {
19
+ var chunk_JWTZIJ4N_exports = {};
20
+ __export(chunk_JWTZIJ4N_exports, {
21
21
  require_package: () => require_package
22
22
  });
23
- module.exports = __toCommonJS(chunk_NNEILADH_exports);
23
+ module.exports = __toCommonJS(chunk_JWTZIJ4N_exports);
24
24
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
25
25
  var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
26
26
  "package.json"(exports, module2) {
27
27
  module2.exports = {
28
28
  name: "@prisma/internals",
29
- version: "7.6.0",
29
+ version: "7.7.0-dev.2",
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",
@@ -99,6 +99,7 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
99
99
  "@prisma/fetch-engine": "workspace:*",
100
100
  "@prisma/generator": "workspace:*",
101
101
  "@prisma/generator-helper": "workspace:*",
102
+ "@prisma/get-dmmf": "workspace:*",
102
103
  "@prisma/get-platform": "workspace:*",
103
104
  "@prisma/prisma-schema-wasm": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711",
104
105
  "@prisma/schema-engine-wasm": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711",
@@ -16,20 +16,20 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_AHF2BN3G_exports = {};
20
- __export(chunk_AHF2BN3G_exports, {
19
+ var chunk_MPKKUOYA_exports = {};
20
+ __export(chunk_MPKKUOYA_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_AHF2BN3G_exports);
28
- var import_chunk_XG2EEDCS = require("./chunk-XG2EEDCS.js");
27
+ module.exports = __toCommonJS(chunk_MPKKUOYA_exports);
28
+ var import_chunk_TMUYUMBB = require("./chunk-TMUYUMBB.js");
29
29
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
30
30
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
31
31
  function lintSchema({ schemas }) {
32
- const lintResult = import_chunk_XG2EEDCS.prismaSchemaWasm.lint(JSON.stringify(schemas));
32
+ const lintResult = import_chunk_TMUYUMBB.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
33
  const lintDiagnostics = JSON.parse(lintResult);
34
34
  return lintDiagnostics;
35
35
  }
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_SFNNUEKP_exports = {};
30
- __export(chunk_SFNNUEKP_exports, {
29
+ var chunk_N7SNWLKR_exports = {};
30
+ __export(chunk_N7SNWLKR_exports, {
31
31
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
32
32
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
33
33
  formatSchema: () => formatSchema,
@@ -40,7 +40,7 @@ __export(chunk_SFNNUEKP_exports, {
40
40
  processSchemaResult: () => processSchemaResult,
41
41
  skipIndex: () => skipIndex
42
42
  });
43
- module.exports = __toCommonJS(chunk_SFNNUEKP_exports);
43
+ module.exports = __toCommonJS(chunk_N7SNWLKR_exports);
44
44
  var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
45
45
  var import_chunk_PKOQQT7I = require("./chunk-PKOQQT7I.js");
46
46
  var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
@@ -50,12 +50,11 @@ var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
50
50
  var import_chunk_DXWYZA7B = require("./chunk-DXWYZA7B.js");
51
51
  var import_chunk_DRWHCM7T = require("./chunk-DRWHCM7T.js");
52
52
  var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
53
- var import_chunk_EKGEKB22 = require("./chunk-EKGEKB22.js");
54
- var import_chunk_NBF7VTDY = require("./chunk-NBF7VTDY.js");
55
- var import_chunk_AHF2BN3G = require("./chunk-AHF2BN3G.js");
56
- var import_chunk_7RSE6ZPN = require("./chunk-7RSE6ZPN.js");
57
- var import_chunk_UF2U3QP5 = require("./chunk-UF2U3QP5.js");
58
- var import_chunk_XG2EEDCS = require("./chunk-XG2EEDCS.js");
53
+ var import_chunk_QH3JKKFJ = require("./chunk-QH3JKKFJ.js");
54
+ var import_chunk_MPKKUOYA = require("./chunk-MPKKUOYA.js");
55
+ var import_chunk_B7X6GLGJ = require("./chunk-B7X6GLGJ.js");
56
+ var import_chunk_YE3EKTIE = require("./chunk-YE3EKTIE.js");
57
+ var import_chunk_TMUYUMBB = require("./chunk-TMUYUMBB.js");
59
58
  var import_chunk_2BXDHSSY = require("./chunk-2BXDHSSY.js");
60
59
  var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
61
60
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
@@ -77,7 +76,7 @@ var debug = (0, import_debug.default)("prisma:format");
77
76
  async function formatSchema({ schemas }, inputFormattingOptions) {
78
77
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
79
78
  handleFormatPanic(() => {
80
- import_chunk_XG2EEDCS.prismaSchemaWasm.debug_panic();
79
+ import_chunk_TMUYUMBB.prismaSchemaWasm.debug_panic();
81
80
  });
82
81
  }
83
82
  const defaultFormattingOptions = {
@@ -94,10 +93,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
94
93
  const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
95
94
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
96
95
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
97
- const lintDiagnostics2 = (0, import_chunk_AHF2BN3G.lintSchema)({ schemas: formattedMultipleSchemas2 });
96
+ const lintDiagnostics2 = (0, import_chunk_MPKKUOYA.lintSchema)({ schemas: formattedMultipleSchemas2 });
98
97
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
99
98
  });
100
- const lintWarnings = (0, import_chunk_AHF2BN3G.getLintWarningsAsText)(lintDiagnostics);
99
+ const lintWarnings = (0, import_chunk_MPKKUOYA.getLintWarningsAsText)(lintDiagnostics);
101
100
  if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
102
101
  console.warn(lintWarnings);
103
102
  }
@@ -124,7 +123,7 @@ function handleFormatPanic(tryCb) {
124
123
  }
125
124
  }
126
125
  function formatWasm(schema, documentFormattingParams) {
127
- const formattedSchema = import_chunk_XG2EEDCS.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
126
+ const formattedSchema = import_chunk_TMUYUMBB.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
128
127
  return formattedSchema;
129
128
  }
130
129
  async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
@@ -153,7 +152,7 @@ async function processSchemaResult({
153
152
  if (printLoadMessage) {
154
153
  (0, import_chunk_2BXDHSSY.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
155
154
  }
156
- const configFromPsl = await (0, import_chunk_UF2U3QP5.getConfig)({ datamodel: schemaResult.schemas });
155
+ const configFromPsl = await (0, import_chunk_YE3EKTIE.getConfig)({ datamodel: schemaResult.schemas });
157
156
  const primaryDatasource = configFromPsl.datasources.at(0);
158
157
  return {
159
158
  schemaFiles: schemaResult.schemas,
@@ -207,11 +206,7 @@ async function getGenerators(options) {
207
206
  throw new Error(import_chunk_DXWYZA7B.missingDatasource);
208
207
  }
209
208
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
210
- const previewFeatures = (0, import_chunk_EKGEKB22.extractPreviewFeatures)(schemaContext.generators);
211
- const dmmf = await (0, import_chunk_NBF7VTDY.getDMMF)({
212
- datamodel: schemaContext.schemaFiles,
213
- previewFeatures
214
- });
209
+ const dmmf = await (0, import_chunk_QH3JKKFJ.getDMMF)({ datamodel: schemaContext.schemaFiles });
215
210
  if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
216
211
  if (schemaContext.primaryDatasource.provider === "mongodb") {
217
212
  throw new Error(import_chunk_DRWHCM7T.missingModelMessageMongoDB);
@@ -259,7 +254,7 @@ You need to define \`output\` in the generator block in the schema file.`
259
254
  fromEnvVar: null
260
255
  };
261
256
  }
262
- const datamodel = (0, import_chunk_7RSE6ZPN.mergeSchemas)({ schemas: schemaContext.schemaFiles });
257
+ const datamodel = (0, import_chunk_B7X6GLGJ.mergeSchemas)({ schemas: schemaContext.schemaFiles });
263
258
  const options2 = {
264
259
  datamodel,
265
260
  datasources: schemaContext.datasources,
@@ -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_FUDRGWAF_exports = {};
20
- __export(chunk_FUDRGWAF_exports, {
19
+ var chunk_NWDOSRX2_exports = {};
20
+ __export(chunk_NWDOSRX2_exports, {
21
21
  require_package: () => require_package
22
22
  });
23
- module.exports = __toCommonJS(chunk_FUDRGWAF_exports);
23
+ module.exports = __toCommonJS(chunk_NWDOSRX2_exports);
24
24
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
25
25
  var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
26
26
  "package.json"(exports, module2) {
@@ -99,6 +99,7 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
99
99
  "@prisma/fetch-engine": "workspace:*",
100
100
  "@prisma/generator": "workspace:*",
101
101
  "@prisma/generator-helper": "workspace:*",
102
+ "@prisma/get-dmmf": "workspace:*",
102
103
  "@prisma/get-platform": "workspace:*",
103
104
  "@prisma/prisma-schema-wasm": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711",
104
105
  "@prisma/schema-engine-wasm": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711",
@@ -0,0 +1,104 @@
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_QH3JKKFJ_exports = {};
30
+ __export(chunk_QH3JKKFJ_exports, {
31
+ GetDmmfError: () => GetDmmfError,
32
+ externalToInternalDmmf: () => import_get_dmmf2.externalToInternalDmmf,
33
+ getDMMF: () => getDMMF,
34
+ getInternalDMMF: () => getInternalDMMF
35
+ });
36
+ module.exports = __toCommonJS(chunk_QH3JKKFJ_exports);
37
+ var import_chunk_IL7PSY44 = require("./chunk-IL7PSY44.js");
38
+ var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
39
+ var import_chunk_23FCYS36 = require("./chunk-23FCYS36.js");
40
+ var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
41
+ var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
42
+ var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
43
+ var import_debug = __toESM(require("@prisma/debug"));
44
+ var import_get_dmmf = require("@prisma/get-dmmf");
45
+ var import_get_dmmf2 = require("@prisma/get-dmmf");
46
+ var debug = (0, import_debug.default)("prisma:getDMMF");
47
+ var debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "getDmmfWasm");
48
+ var GetDmmfError = class extends Error {
49
+ constructor(params) {
50
+ const constructedErrorMessage = (0, import_chunk_XKZ6CBLA.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
51
+ const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
52
+ return `${reason}
53
+ ${errorCodeMessage}
54
+ ${message}`;
55
+ }).with({ _tag: "unparsed" }, ({ message, reason }) => {
56
+ const detailsHeader = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)("Details:"));
57
+ return `${reason}
58
+ ${detailsHeader} ${message}`;
59
+ }).exhaustive();
60
+ const errorMessageWithContext = `${constructedErrorMessage}
61
+ [Context: getDmmf]`;
62
+ super((0, import_chunk_23FCYS36.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ this.name = "GetDmmfError";
64
+ }
65
+ };
66
+ async function getDMMF(options) {
67
+ return Promise.resolve(handleGetDmmfResult((0, import_get_dmmf.getDMMF)(options)));
68
+ }
69
+ async function getInternalDMMF(options) {
70
+ return Promise.resolve(handleGetDmmfResult((0, import_get_dmmf.getInternalDMMF)(options)));
71
+ }
72
+ function handleGetDmmfResult(result) {
73
+ if ("error" in result) {
74
+ debugErrorType(result);
75
+ switch (result.type) {
76
+ case "wasm-error":
77
+ throw mapWasmPanicToGetDmmfError(result.error, result.reason);
78
+ case "parse-json":
79
+ throw new GetDmmfError({ _tag: "unparsed", message: result.error.message, reason: result.reason });
80
+ default:
81
+ (0, import_chunk_IL7PSY44.assertNever)(result.type, "Unknown getDmmf error type");
82
+ }
83
+ } else {
84
+ return result;
85
+ }
86
+ }
87
+ function mapWasmPanicToGetDmmfError(error, reason) {
88
+ if ((0, import_chunk_LMVSIVKQ.isWasmPanic)(error)) {
89
+ const { message, stack } = (0, import_chunk_LMVSIVKQ.getWasmError)(error);
90
+ const panic = new import_chunk_LMVSIVKQ.RustPanic(
91
+ /* message */
92
+ message,
93
+ /* rustStack */
94
+ stack,
95
+ /* request */
96
+ "@prisma/prisma-schema-wasm get_dmmf",
97
+ "FMT_CLI"
98
+ /* FMT_CLI */
99
+ );
100
+ return panic;
101
+ }
102
+ const errorOutput = error.message;
103
+ return new GetDmmfError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason }));
104
+ }
@@ -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_OMJOKO7H_exports = {};
20
- __export(chunk_OMJOKO7H_exports, {
19
+ var chunk_SZ735VHI_exports = {};
20
+ __export(chunk_SZ735VHI_exports, {
21
21
  version: () => version
22
22
  });
23
- module.exports = __toCommonJS(chunk_OMJOKO7H_exports);
24
- var import_chunk_FUDRGWAF = require("./chunk-FUDRGWAF.js");
25
- var packageJson = (0, import_chunk_FUDRGWAF.require_package)();
23
+ module.exports = __toCommonJS(chunk_SZ735VHI_exports);
24
+ var import_chunk_NWDOSRX2 = require("./chunk-NWDOSRX2.js");
25
+ var packageJson = (0, import_chunk_NWDOSRX2.require_package)();
26
26
  var version = packageJson.version;
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_KAFC7IGG_exports = {};
30
- __export(chunk_KAFC7IGG_exports, {
29
+ var chunk_TMUYUMBB_exports = {};
30
+ __export(chunk_TMUYUMBB_exports, {
31
31
  prismaSchemaWasm: () => import_prisma_schema_wasm.default,
32
32
  prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
33
33
  schemaEngineWasmVersion: () => schemaEngineWasmVersion,
34
34
  wasm_exports: () => wasm_exports
35
35
  });
36
- module.exports = __toCommonJS(chunk_KAFC7IGG_exports);
37
- var import_chunk_FUDRGWAF = require("./chunk-FUDRGWAF.js");
36
+ module.exports = __toCommonJS(chunk_TMUYUMBB_exports);
37
+ var import_chunk_JWTZIJ4N = require("./chunk-JWTZIJ4N.js");
38
38
  var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
39
39
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
40
40
  var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
@@ -46,6 +46,6 @@ var wasm_exports = {};
46
46
  });
47
47
  var globalWithPanicRegistry = globalThis;
48
48
  globalWithPanicRegistry.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
49
- var { dependencies } = (0, import_chunk_FUDRGWAF.require_package)();
49
+ var { dependencies } = (0, import_chunk_JWTZIJ4N.require_package)();
50
50
  var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
51
51
  var schemaEngineWasmVersion = dependencies["@prisma/schema-engine-wasm"];