@prisma/internals 6.1.0-dev.22 → 6.1.0-dev.24

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 (45) hide show
  1. package/dist/{chunk-HMGEWJDY.js → chunk-3BND5XB4.js} +232 -47
  2. package/dist/{chunk-D6Z7NTDK.js → chunk-5ZL6NLVK.js} +7 -7
  3. package/dist/{chunk-CD67VLYZ.js → chunk-6SZXSQAO.js} +8 -8
  4. package/dist/{chunk-5OU6MVBS.js → chunk-7IIJRICE.js} +5 -5
  5. package/dist/{chunk-FJMPZX7V.js → chunk-AH3GPD6Y.js} +22 -22
  6. package/dist/{chunk-MQPNGZW2.js → chunk-B3DLMU4A.js} +5 -5
  7. package/dist/{chunk-6FIYAVRW.js → chunk-BF6YTYCD.js} +4 -4
  8. package/dist/{chunk-KARDWM6B.js → chunk-CBGGN32K.js} +5 -5
  9. package/dist/{chunk-367S2MBR.js → chunk-DNGFSCXC.js} +8 -8
  10. package/dist/{chunk-ASOGQPA4.js → chunk-H2FO7ZRY.js} +7 -7
  11. package/dist/{chunk-FNDMR7HU.js → chunk-JCVEFZKA.js} +5 -5
  12. package/dist/{chunk-H7C262NW.js → chunk-MCZCM3MI.js} +8 -8
  13. package/dist/{chunk-43VUK3MC.js → chunk-MGN5LIPA.js} +5 -5
  14. package/dist/{chunk-ENP2MLZD.js → chunk-POVBDRUB.js} +8 -8
  15. package/dist/{chunk-VDIJTVA3.js → chunk-SLJ4QK2H.js} +8 -8
  16. package/dist/{chunk-7MM2QZYT.js → chunk-SRCJIEKQ.js} +8 -8
  17. package/dist/{chunk-6BHYPXCB.js → chunk-UZDP7Q6K.js} +5 -5
  18. package/dist/{chunk-XWZZEGZ4.js → chunk-VN6O6ZJL.js} +5 -5
  19. package/dist/{chunk-TK4CUCEH.js → chunk-XD3T4WM7.js} +5 -5
  20. package/dist/{chunk-3H62S3WD.js → chunk-XTGINKG6.js} +22 -22
  21. package/dist/{chunk-5AHKO4VZ.js → chunk-Z4DFKGWG.js} +5 -5
  22. package/dist/cli/checkUnsupportedDataProxy.js +13 -13
  23. package/dist/cli/getSchema.js +18 -18
  24. package/dist/cli/hashes.js +13 -13
  25. package/dist/engine-commands/errorHelpers.js +4 -4
  26. package/dist/engine-commands/formatSchema.js +12 -12
  27. package/dist/engine-commands/getConfig.js +10 -10
  28. package/dist/engine-commands/getDmmf.js +7 -7
  29. package/dist/engine-commands/index.js +21 -21
  30. package/dist/engine-commands/lintSchema.js +8 -8
  31. package/dist/engine-commands/mergeSchemas.js +7 -7
  32. package/dist/engine-commands/validate.js +7 -7
  33. package/dist/get-generators/generatorResolvers/generatorResolvers.js +12 -12
  34. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +12 -12
  35. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +13 -13
  36. package/dist/get-generators/getGenerators.js +15 -15
  37. package/dist/index.js +41 -41
  38. package/dist/sendPanic.js +12 -12
  39. package/dist/utils/getEnvPaths.js +12 -12
  40. package/dist/utils/getVersionFromPackageJson.js +3 -3
  41. package/dist/utils/handlePanic.js +12 -12
  42. package/dist/utils/loadEnvFile.js +12 -12
  43. package/dist/utils/tryLoadEnvs.js +5 -5
  44. package/dist/wasm.js +4 -4
  45. package/package.json +8 -8
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_HMGEWJDY_exports = {};
30
- __export(chunk_HMGEWJDY_exports, {
29
+ var chunk_3BND5XB4_exports = {};
30
+ __export(chunk_3BND5XB4_exports, {
31
31
  exists: () => exists,
32
32
  loadEnv: () => loadEnv,
33
33
  pathsEqual: () => pathsEqual,
34
34
  tryLoadEnvs: () => tryLoadEnvs
35
35
  });
36
- module.exports = __toCommonJS(chunk_HMGEWJDY_exports);
36
+ module.exports = __toCommonJS(chunk_3BND5XB4_exports);
37
37
  var import_chunk_T2PM5TKT = require("./chunk-T2PM5TKT.js");
38
38
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
39
39
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
@@ -41,17 +41,17 @@ var import_debug = __toESM(require("@prisma/debug"));
41
41
  var import_fs = __toESM(require("fs"));
42
42
  var import_path = __toESM(require("path"));
43
43
  var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
44
- "../../node_modules/.pnpm/dotenv@16.0.3/node_modules/dotenv/package.json"(exports, module2) {
44
+ "../../node_modules/.pnpm/dotenv@16.4.7/node_modules/dotenv/package.json"(exports, module2) {
45
45
  module2.exports = {
46
46
  name: "dotenv",
47
- version: "16.0.3",
47
+ version: "16.4.7",
48
48
  description: "Loads environment variables from .env file",
49
49
  main: "lib/main.js",
50
50
  types: "lib/main.d.ts",
51
51
  exports: {
52
52
  ".": {
53
- require: "./lib/main.js",
54
53
  types: "./lib/main.d.ts",
54
+ require: "./lib/main.js",
55
55
  default: "./lib/main.js"
56
56
  },
57
57
  "./config": "./config.js",
@@ -65,9 +65,9 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
65
65
  scripts: {
66
66
  "dts-check": "tsc --project tests/types/tsconfig.json",
67
67
  lint: "standard",
68
- "lint-readme": "standard-markdown",
69
68
  pretest: "npm run lint && npm run dts-check",
70
- test: "tap tests/*.js --100 -Rspec",
69
+ test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
70
+ "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",
71
71
  prerelease: "npm test",
72
72
  release: "standard-version"
73
73
  },
@@ -75,6 +75,7 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
75
75
  type: "git",
76
76
  url: "git://github.com/motdotla/dotenv.git"
77
77
  },
78
+ funding: "https://dotenvx.com",
78
79
  keywords: [
79
80
  "dotenv",
80
81
  "env",
@@ -87,29 +88,30 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
87
88
  readmeFilename: "README.md",
88
89
  license: "BSD-2-Clause",
89
90
  devDependencies: {
90
- "@types/node": "^17.0.9",
91
- decache: "^4.6.1",
92
- dtslint: "^3.7.0",
93
- sinon: "^12.0.1",
94
- standard: "^16.0.4",
95
- "standard-markdown": "^7.1.0",
96
- "standard-version": "^9.3.2",
97
- tap: "^15.1.6",
98
- tar: "^6.1.11",
99
- typescript: "^4.5.4"
91
+ "@types/node": "^18.11.3",
92
+ decache: "^4.6.2",
93
+ sinon: "^14.0.1",
94
+ standard: "^17.0.0",
95
+ "standard-version": "^9.5.0",
96
+ tap: "^19.2.0",
97
+ typescript: "^4.8.4"
100
98
  },
101
99
  engines: {
102
100
  node: ">=12"
101
+ },
102
+ browser: {
103
+ fs: false
103
104
  }
104
105
  };
105
106
  }
106
107
  });
107
108
  var require_main = (0, import_chunk_WWAWV7DQ.__commonJS)({
108
- "../../node_modules/.pnpm/dotenv@16.0.3/node_modules/dotenv/lib/main.js"(exports, module2) {
109
+ "../../node_modules/.pnpm/dotenv@16.4.7/node_modules/dotenv/lib/main.js"(exports, module2) {
109
110
  "use strict";
110
111
  var fs2 = (0, import_chunk_WWAWV7DQ.__require)("fs");
111
112
  var path2 = (0, import_chunk_WWAWV7DQ.__require)("path");
112
113
  var os = (0, import_chunk_WWAWV7DQ.__require)("os");
114
+ var crypto = (0, import_chunk_WWAWV7DQ.__require)("crypto");
113
115
  var packageJson = require_package();
114
116
  var version = packageJson.version;
115
117
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
@@ -132,57 +134,240 @@ var require_main = (0, import_chunk_WWAWV7DQ.__commonJS)({
132
134
  }
133
135
  return obj;
134
136
  }
137
+ function _parseVault(options) {
138
+ const vaultPath = _vaultPath(options);
139
+ const result = DotenvModule.configDotenv({ path: vaultPath });
140
+ if (!result.parsed) {
141
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
142
+ err.code = "MISSING_DATA";
143
+ throw err;
144
+ }
145
+ const keys = _dotenvKey(options).split(",");
146
+ const length = keys.length;
147
+ let decrypted;
148
+ for (let i = 0; i < length; i++) {
149
+ try {
150
+ const key = keys[i].trim();
151
+ const attrs = _instructions(result, key);
152
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
153
+ break;
154
+ } catch (error) {
155
+ if (i + 1 >= length) {
156
+ throw error;
157
+ }
158
+ }
159
+ }
160
+ return DotenvModule.parse(decrypted);
161
+ }
135
162
  function _log(message) {
163
+ console.log(`[dotenv@${version}][INFO] ${message}`);
164
+ }
165
+ function _warn(message) {
166
+ console.log(`[dotenv@${version}][WARN] ${message}`);
167
+ }
168
+ function _debug(message) {
136
169
  console.log(`[dotenv@${version}][DEBUG] ${message}`);
137
170
  }
171
+ function _dotenvKey(options) {
172
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
173
+ return options.DOTENV_KEY;
174
+ }
175
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
176
+ return process.env.DOTENV_KEY;
177
+ }
178
+ return "";
179
+ }
180
+ function _instructions(result, dotenvKey) {
181
+ let uri;
182
+ try {
183
+ uri = new URL(dotenvKey);
184
+ } catch (error) {
185
+ if (error.code === "ERR_INVALID_URL") {
186
+ const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
187
+ err.code = "INVALID_DOTENV_KEY";
188
+ throw err;
189
+ }
190
+ throw error;
191
+ }
192
+ const key = uri.password;
193
+ if (!key) {
194
+ const err = new Error("INVALID_DOTENV_KEY: Missing key part");
195
+ err.code = "INVALID_DOTENV_KEY";
196
+ throw err;
197
+ }
198
+ const environment = uri.searchParams.get("environment");
199
+ if (!environment) {
200
+ const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
201
+ err.code = "INVALID_DOTENV_KEY";
202
+ throw err;
203
+ }
204
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
205
+ const ciphertext = result.parsed[environmentKey];
206
+ if (!ciphertext) {
207
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
208
+ err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
209
+ throw err;
210
+ }
211
+ return { ciphertext, key };
212
+ }
213
+ function _vaultPath(options) {
214
+ let possibleVaultPath = null;
215
+ if (options && options.path && options.path.length > 0) {
216
+ if (Array.isArray(options.path)) {
217
+ for (const filepath of options.path) {
218
+ if (fs2.existsSync(filepath)) {
219
+ possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
220
+ }
221
+ }
222
+ } else {
223
+ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
224
+ }
225
+ } else {
226
+ possibleVaultPath = path2.resolve(process.cwd(), ".env.vault");
227
+ }
228
+ if (fs2.existsSync(possibleVaultPath)) {
229
+ return possibleVaultPath;
230
+ }
231
+ return null;
232
+ }
138
233
  function _resolveHome(envPath) {
139
234
  return envPath[0] === "~" ? path2.join(os.homedir(), envPath.slice(1)) : envPath;
140
235
  }
141
- function config(options) {
142
- let dotenvPath = path2.resolve(process.cwd(), ".env");
236
+ function _configVault(options) {
237
+ _log("Loading env from encrypted .env.vault");
238
+ const parsed = DotenvModule._parseVault(options);
239
+ let processEnv = process.env;
240
+ if (options && options.processEnv != null) {
241
+ processEnv = options.processEnv;
242
+ }
243
+ DotenvModule.populate(processEnv, parsed, options);
244
+ return { parsed };
245
+ }
246
+ function configDotenv(options) {
247
+ const dotenvPath = path2.resolve(process.cwd(), ".env");
143
248
  let encoding = "utf8";
144
249
  const debug2 = Boolean(options && options.debug);
145
- const override = Boolean(options && options.override);
146
- if (options) {
147
- if (options.path != null) {
148
- dotenvPath = _resolveHome(options.path);
250
+ if (options && options.encoding) {
251
+ encoding = options.encoding;
252
+ } else {
253
+ if (debug2) {
254
+ _debug("No encoding is specified. UTF-8 is used by default");
149
255
  }
150
- if (options.encoding != null) {
151
- encoding = options.encoding;
256
+ }
257
+ let optionPaths = [dotenvPath];
258
+ if (options && options.path) {
259
+ if (!Array.isArray(options.path)) {
260
+ optionPaths = [_resolveHome(options.path)];
261
+ } else {
262
+ optionPaths = [];
263
+ for (const filepath of options.path) {
264
+ optionPaths.push(_resolveHome(filepath));
265
+ }
152
266
  }
153
267
  }
268
+ let lastError;
269
+ const parsedAll = {};
270
+ for (const path3 of optionPaths) {
271
+ try {
272
+ const parsed = DotenvModule.parse(fs2.readFileSync(path3, { encoding }));
273
+ DotenvModule.populate(parsedAll, parsed, options);
274
+ } catch (e) {
275
+ if (debug2) {
276
+ _debug(`Failed to load ${path3} ${e.message}`);
277
+ }
278
+ lastError = e;
279
+ }
280
+ }
281
+ let processEnv = process.env;
282
+ if (options && options.processEnv != null) {
283
+ processEnv = options.processEnv;
284
+ }
285
+ DotenvModule.populate(processEnv, parsedAll, options);
286
+ if (lastError) {
287
+ return { parsed: parsedAll, error: lastError };
288
+ } else {
289
+ return { parsed: parsedAll };
290
+ }
291
+ }
292
+ function config(options) {
293
+ if (_dotenvKey(options).length === 0) {
294
+ return DotenvModule.configDotenv(options);
295
+ }
296
+ const vaultPath = _vaultPath(options);
297
+ if (!vaultPath) {
298
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
299
+ return DotenvModule.configDotenv(options);
300
+ }
301
+ return DotenvModule._configVault(options);
302
+ }
303
+ function decrypt(encrypted, keyStr) {
304
+ const key = Buffer.from(keyStr.slice(-64), "hex");
305
+ let ciphertext = Buffer.from(encrypted, "base64");
306
+ const nonce = ciphertext.subarray(0, 12);
307
+ const authTag = ciphertext.subarray(-16);
308
+ ciphertext = ciphertext.subarray(12, -16);
154
309
  try {
155
- const parsed = DotenvModule.parse(fs2.readFileSync(dotenvPath, { encoding }));
156
- Object.keys(parsed).forEach(function(key) {
157
- if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
158
- process.env[key] = parsed[key];
159
- } else {
310
+ const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
311
+ aesgcm.setAuthTag(authTag);
312
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
313
+ } catch (error) {
314
+ const isRange = error instanceof RangeError;
315
+ const invalidKeyLength = error.message === "Invalid key length";
316
+ const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
317
+ if (isRange || invalidKeyLength) {
318
+ const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
319
+ err.code = "INVALID_DOTENV_KEY";
320
+ throw err;
321
+ } else if (decryptionFailed) {
322
+ const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
323
+ err.code = "DECRYPTION_FAILED";
324
+ throw err;
325
+ } else {
326
+ throw error;
327
+ }
328
+ }
329
+ }
330
+ function populate(processEnv, parsed, options = {}) {
331
+ const debug2 = Boolean(options && options.debug);
332
+ const override = Boolean(options && options.override);
333
+ if (typeof parsed !== "object") {
334
+ const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
335
+ err.code = "OBJECT_REQUIRED";
336
+ throw err;
337
+ }
338
+ for (const key of Object.keys(parsed)) {
339
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
340
+ if (override === true) {
341
+ processEnv[key] = parsed[key];
342
+ }
343
+ if (debug2) {
160
344
  if (override === true) {
161
- process.env[key] = parsed[key];
162
- }
163
- if (debug2) {
164
- if (override === true) {
165
- _log(`"${key}" is already defined in \`process.env\` and WAS overwritten`);
166
- } else {
167
- _log(`"${key}" is already defined in \`process.env\` and was NOT overwritten`);
168
- }
345
+ _debug(`"${key}" is already defined and WAS overwritten`);
346
+ } else {
347
+ _debug(`"${key}" is already defined and was NOT overwritten`);
169
348
  }
170
349
  }
171
- });
172
- return { parsed };
173
- } catch (e) {
174
- if (debug2) {
175
- _log(`Failed to load ${dotenvPath} ${e.message}`);
350
+ } else {
351
+ processEnv[key] = parsed[key];
176
352
  }
177
- return { error: e };
178
353
  }
179
354
  }
180
355
  var DotenvModule = {
356
+ configDotenv,
357
+ _configVault,
358
+ _parseVault,
181
359
  config,
182
- parse
360
+ decrypt,
361
+ parse,
362
+ populate
183
363
  };
364
+ module2.exports.configDotenv = DotenvModule.configDotenv;
365
+ module2.exports._configVault = DotenvModule._configVault;
366
+ module2.exports._parseVault = DotenvModule._parseVault;
184
367
  module2.exports.config = DotenvModule.config;
368
+ module2.exports.decrypt = DotenvModule.decrypt;
185
369
  module2.exports.parse = DotenvModule.parse;
370
+ module2.exports.populate = DotenvModule.populate;
186
371
  module2.exports = DotenvModule;
187
372
  }
188
373
  });
@@ -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_D6Z7NTDK_exports = {};
30
- __export(chunk_D6Z7NTDK_exports, {
29
+ var chunk_5ZL6NLVK_exports = {};
30
+ __export(chunk_5ZL6NLVK_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_D6Z7NTDK_exports);
34
+ module.exports = __toCommonJS(chunk_5ZL6NLVK_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
36
  var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_6BHYPXCB = require("./chunk-6BHYPXCB.js");
38
+ var import_chunk_UZDP7Q6K = require("./chunk-UZDP7Q6K.js");
39
39
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
40
40
  var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
41
- var import_chunk_XWZZEGZ4 = require("./chunk-XWZZEGZ4.js");
41
+ var import_chunk_VN6O6ZJL = require("./chunk-VN6O6ZJL.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_6BHYPXCB.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ super((0, import_chunk_UZDP7Q6K.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_XWZZEGZ4.prismaSchemaWasm.merge_schemas(params);
76
+ return import_chunk_VN6O6ZJL.prismaSchemaWasm.merge_schemas(params);
77
77
  },
78
78
  (e) => ({
79
79
  type: "wasm-error",
@@ -26,18 +26,18 @@ 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_CD67VLYZ_exports = {};
30
- __export(chunk_CD67VLYZ_exports, {
29
+ var chunk_6SZXSQAO_exports = {};
30
+ __export(chunk_6SZXSQAO_exports, {
31
31
  GetDmmfError: () => GetDmmfError,
32
32
  getDMMF: () => getDMMF
33
33
  });
34
- module.exports = __toCommonJS(chunk_CD67VLYZ_exports);
34
+ module.exports = __toCommonJS(chunk_6SZXSQAO_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
36
  var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
37
- var import_chunk_TK4CUCEH = require("./chunk-TK4CUCEH.js");
37
+ var import_chunk_XD3T4WM7 = require("./chunk-XD3T4WM7.js");
38
38
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
39
39
  var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
40
- var import_chunk_MQPNGZW2 = require("./chunk-MQPNGZW2.js");
40
+ var import_chunk_B3DLMU4A = require("./chunk-B3DLMU4A.js");
41
41
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
42
42
  var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
43
43
  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: getDmmf]`;
63
- super((0, import_chunk_TK4CUCEH.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ super((0, import_chunk_XD3T4WM7.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
64
  this.name = "GetDmmfError";
65
65
  }
66
66
  };
@@ -90,13 +90,13 @@ async function getDMMF(options) {
90
90
  () => {
91
91
  if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
92
92
  debug("Triggering a Rust panic...");
93
- import_chunk_MQPNGZW2.prismaSchemaWasm.debug_panic();
93
+ import_chunk_B3DLMU4A.prismaSchemaWasm.debug_panic();
94
94
  }
95
95
  const params = JSON.stringify({
96
96
  prismaSchema: datamodel,
97
97
  noColor: Boolean(process.env.NO_COLOR)
98
98
  });
99
- const data = import_chunk_MQPNGZW2.prismaSchemaWasm.get_dmmf(params);
99
+ const data = import_chunk_B3DLMU4A.prismaSchemaWasm.get_dmmf(params);
100
100
  return data;
101
101
  },
102
102
  (e) => ({
@@ -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_5OU6MVBS_exports = {};
20
- __export(chunk_5OU6MVBS_exports, {
19
+ var chunk_7IIJRICE_exports = {};
20
+ __export(chunk_7IIJRICE_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_5OU6MVBS_exports);
27
+ module.exports = __toCommonJS(chunk_7IIJRICE_exports);
28
28
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
29
- var import_chunk_XWZZEGZ4 = require("./chunk-XWZZEGZ4.js");
29
+ var import_chunk_B3DLMU4A = require("./chunk-B3DLMU4A.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_XWZZEGZ4.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
+ const lintResult = import_chunk_B3DLMU4A.prismaSchemaWasm.lint(JSON.stringify(schemas));
34
34
  const lintDiagnostics = JSON.parse(lintResult);
35
35
  return lintDiagnostics;
36
36
  }
@@ -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_FJMPZX7V_exports = {};
30
- __export2(chunk_FJMPZX7V_exports, {
29
+ var chunk_AH3GPD6Y_exports = {};
30
+ __export2(chunk_AH3GPD6Y_exports, {
31
31
  checkTypeScriptVersion: () => checkTypeScriptVersion,
32
32
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
33
33
  debug: () => debug5,
@@ -55,7 +55,7 @@ __export2(chunk_FJMPZX7V_exports, {
55
55
  sendPanic: () => sendPanic,
56
56
  skipIndex: () => skipIndex
57
57
  });
58
- module.exports = __toCommonJS2(chunk_FJMPZX7V_exports);
58
+ module.exports = __toCommonJS2(chunk_AH3GPD6Y_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");
@@ -70,7 +70,7 @@ var import_chunk_ONHKZPSV = require("./chunk-ONHKZPSV.js");
70
70
  var import_chunk_5V36RLCO = require("./chunk-5V36RLCO.js");
71
71
  var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
72
72
  var import_chunk_JHQHVXIR = require("./chunk-JHQHVXIR.js");
73
- var import_chunk_HMGEWJDY = require("./chunk-HMGEWJDY.js");
73
+ var import_chunk_3BND5XB4 = require("./chunk-3BND5XB4.js");
74
74
  var import_chunk_BGFWFIPR = require("./chunk-BGFWFIPR.js");
75
75
  var import_chunk_2MWIMEFK = require("./chunk-2MWIMEFK.js");
76
76
  var import_chunk_L6GBFCXG = require("./chunk-L6GBFCXG.js");
@@ -80,13 +80,13 @@ var import_chunk_QTXYAZFX = require("./chunk-QTXYAZFX.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_KARDWM6B = require("./chunk-KARDWM6B.js");
84
- var import_chunk_ASOGQPA4 = require("./chunk-ASOGQPA4.js");
85
- var import_chunk_H7C262NW = require("./chunk-H7C262NW.js");
86
- var import_chunk_CD67VLYZ = require("./chunk-CD67VLYZ.js");
83
+ var import_chunk_CBGGN32K = require("./chunk-CBGGN32K.js");
84
+ var import_chunk_5ZL6NLVK = require("./chunk-5ZL6NLVK.js");
85
+ var import_chunk_MCZCM3MI = require("./chunk-MCZCM3MI.js");
86
+ var import_chunk_SRCJIEKQ = require("./chunk-SRCJIEKQ.js");
87
87
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
88
88
  var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
89
- var import_chunk_MQPNGZW2 = require("./chunk-MQPNGZW2.js");
89
+ var import_chunk_VN6O6ZJL = require("./chunk-VN6O6ZJL.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");
@@ -14751,7 +14751,7 @@ async function readSchemaFromDirectory(schemaPath2) {
14751
14751
  }
14752
14752
  const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
14753
14753
  debug2("Loading config");
14754
- const config2 = await (0, import_chunk_H7C262NW.getConfig)({
14754
+ const config2 = await (0, import_chunk_MCZCM3MI.getConfig)({
14755
14755
  datamodel: files,
14756
14756
  ignoreEnvVarErrors: true
14757
14757
  });
@@ -14988,7 +14988,7 @@ async function getEnvPaths(schemaPath2, opts = { cwd: process.cwd() }) {
14988
14988
  "./.env"
14989
14989
  // 4 - Check cwd for .env
14990
14990
  ];
14991
- const schemaEnvPath = schemaEnvPaths.find(import_chunk_HMGEWJDY.exists);
14991
+ const schemaEnvPath = schemaEnvPaths.find(import_chunk_3BND5XB4.exists);
14992
14992
  return { rootEnvPath, schemaEnvPath };
14993
14993
  }
14994
14994
  async function readSchemaPathFromPkgJson() {
@@ -15036,7 +15036,7 @@ async function loadEnvFile({
15036
15036
  printMessage = false
15037
15037
  } = {}) {
15038
15038
  const envPaths2 = await getEnvPaths(schemaPath2);
15039
- const envData = (0, import_chunk_HMGEWJDY.tryLoadEnvs)(envPaths2, { conflictCheck: "error" });
15039
+ const envData = (0, import_chunk_3BND5XB4.tryLoadEnvs)(envPaths2, { conflictCheck: "error" });
15040
15040
  if (printMessage && envData && envData.message) {
15041
15041
  process.stdout.write(envData.message + "\n");
15042
15042
  }
@@ -15059,8 +15059,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
15059
15059
  if (argName.includes("schema")) {
15060
15060
  await loadEnvFile({ schemaPath: argValue, printMessage: false });
15061
15061
  const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
15062
- const config2 = await (0, import_chunk_H7C262NW.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15063
- const url = (0, import_chunk_H7C262NW.resolveUrl)((0, import_chunk_H7C262NW.getEffectiveUrl)(config2.datasources[0]));
15062
+ const config2 = await (0, import_chunk_MCZCM3MI.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15063
+ const url = (0, import_chunk_MCZCM3MI.resolveUrl)((0, import_chunk_MCZCM3MI.getEffectiveUrl)(config2.datasources[0]));
15064
15064
  if (url?.startsWith("prisma://")) {
15065
15065
  return forbiddenCmdWithDataProxyFlagMessage(command);
15066
15066
  }
@@ -15232,7 +15232,7 @@ async function getGenerators(options) {
15232
15232
  prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
15233
15233
  }
15234
15234
  }
15235
- const config = await (0, import_chunk_H7C262NW.getConfig)({
15235
+ const config = await (0, import_chunk_MCZCM3MI.getConfig)({
15236
15236
  datamodel: schemas,
15237
15237
  datamodelPath: schemaPath,
15238
15238
  prismaPath,
@@ -15243,7 +15243,7 @@ async function getGenerators(options) {
15243
15243
  }
15244
15244
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
15245
15245
  const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
15246
- const dmmf = await (0, import_chunk_CD67VLYZ.getDMMF)({
15246
+ const dmmf = await (0, import_chunk_SRCJIEKQ.getDMMF)({
15247
15247
  datamodel: schemas,
15248
15248
  datamodelPath: schemaPath,
15249
15249
  prismaPath,
@@ -15304,7 +15304,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
15304
15304
  fromEnvVar: "null"
15305
15305
  };
15306
15306
  }
15307
- const datamodel = (0, import_chunk_ASOGQPA4.mergeSchemas)({ schemas });
15307
+ const datamodel = (0, import_chunk_5ZL6NLVK.mergeSchemas)({ schemas });
15308
15308
  const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
15309
15309
  const options2 = {
15310
15310
  datamodel,
@@ -15387,7 +15387,7 @@ generator gen {
15387
15387
  debug6({ generatorBinaryPaths });
15388
15388
  generator.setBinaryPaths(generatorBinaryPaths);
15389
15389
  if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
15390
- const customDmmf = await (0, import_chunk_CD67VLYZ.getDMMF)({
15390
+ const customDmmf = await (0, import_chunk_SRCJIEKQ.getDMMF)({
15391
15391
  datamodel: schemas,
15392
15392
  datamodelPath: schemaPath,
15393
15393
  prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
@@ -15685,7 +15685,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
15685
15685
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
15686
15686
  handleFormatPanic(
15687
15687
  () => {
15688
- import_chunk_MQPNGZW2.prismaSchemaWasm.debug_panic();
15688
+ import_chunk_VN6O6ZJL.prismaSchemaWasm.debug_panic();
15689
15689
  },
15690
15690
  { schemas: schemas2 }
15691
15691
  );
@@ -15705,12 +15705,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
15705
15705
  () => {
15706
15706
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
15707
15707
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
15708
- const lintDiagnostics2 = (0, import_chunk_KARDWM6B.lintSchema)({ schemas: formattedMultipleSchemas2 });
15708
+ const lintDiagnostics2 = (0, import_chunk_CBGGN32K.lintSchema)({ schemas: formattedMultipleSchemas2 });
15709
15709
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
15710
15710
  },
15711
15711
  { schemas: schemas2 }
15712
15712
  );
15713
- const lintWarnings = (0, import_chunk_KARDWM6B.getLintWarningsAsText)(lintDiagnostics);
15713
+ const lintWarnings = (0, import_chunk_CBGGN32K.getLintWarningsAsText)(lintDiagnostics);
15714
15714
  if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
15715
15715
  console.warn(lintWarnings);
15716
15716
  }
@@ -15740,7 +15740,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
15740
15740
  }
15741
15741
  }
15742
15742
  function formatWasm(schema, documentFormattingParams) {
15743
- const formattedSchema = import_chunk_MQPNGZW2.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
15743
+ const formattedSchema = import_chunk_VN6O6ZJL.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
15744
15744
  return formattedSchema;
15745
15745
  }
15746
15746
  /*! Bundled license information:
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_MQPNGZW2_exports = {};
30
- __export(chunk_MQPNGZW2_exports, {
29
+ var chunk_B3DLMU4A_exports = {};
30
+ __export(chunk_B3DLMU4A_exports, {
31
31
  prismaSchemaWasm: () => import_prisma_schema_wasm.default,
32
32
  prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
33
33
  wasm_exports: () => wasm_exports
34
34
  });
35
- module.exports = __toCommonJS(chunk_MQPNGZW2_exports);
36
- var import_chunk_FNDMR7HU = require("./chunk-FNDMR7HU.js");
35
+ module.exports = __toCommonJS(chunk_B3DLMU4A_exports);
36
+ var import_chunk_BF6YTYCD = require("./chunk-BF6YTYCD.js");
37
37
  var import_chunk_HOZFIXMD = require("./chunk-HOZFIXMD.js");
38
38
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
39
39
  var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
@@ -42,6 +42,6 @@ var wasm_exports = {};
42
42
  prismaSchemaWasm: () => import_prisma_schema_wasm.default,
43
43
  prismaSchemaWasmVersion: () => prismaSchemaWasmVersion
44
44
  });
45
- var { dependencies } = (0, import_chunk_FNDMR7HU.require_package)();
45
+ var { dependencies } = (0, import_chunk_BF6YTYCD.require_package)();
46
46
  var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
47
47
  globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_HOZFIXMD.WasmPanicRegistry();