@prisma/client-generator-js 7.2.0-integration-engines-7-2-0-3-aqrln-zpupkzknszlw-04d61c41ec1a025cabe14093fa3121a5f45040ab.1 → 7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1

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 (33) hide show
  1. package/dist/TSClient/Args.d.ts +5 -5
  2. package/dist/TSClient/Datasources.d.ts +7 -0
  3. package/dist/TSClient/GenerateContext.d.ts +2 -5
  4. package/dist/TSClient/PrismaClient.d.ts +2 -2
  5. package/dist/TSClient/TSClient.d.ts +7 -2
  6. package/dist/TSClient/common.d.ts +2 -2
  7. package/dist/extractSqliteSources.d.ts +6 -0
  8. package/dist/extractSqliteSources.test.d.ts +1 -0
  9. package/dist/generateClient.d.ts +7 -1
  10. package/dist/generator.d.ts +1 -1
  11. package/dist/index.d.mts +7 -1
  12. package/dist/index.d.ts +7 -1
  13. package/dist/index.js +2973 -351
  14. package/dist/index.mjs +2962 -334
  15. package/dist/resolveDatasources.d.ts +1 -0
  16. package/dist/resolveDatasources.test.d.ts +1 -0
  17. package/dist/resolvePrismaClient.d.ts +5 -0
  18. package/dist/serializeDatasources.d.ts +4 -0
  19. package/dist/serializeDatasources.test.d.ts +1 -0
  20. package/dist/typedSql/buildIndex.d.ts +2 -2
  21. package/dist/typedSql/typedSql.d.ts +1 -1
  22. package/dist/utils/buildDMMF.d.ts +1 -1
  23. package/dist/utils/buildDebugInitialization.d.ts +1 -1
  24. package/dist/utils/buildDirname.d.ts +7 -0
  25. package/dist/utils/buildGetQueryCompilerWasmModule.d.ts +1 -1
  26. package/dist/utils/buildGetQueryEngineWasmModule.d.ts +6 -0
  27. package/dist/utils/buildInjectableEdgeEnv.d.ts +20 -0
  28. package/dist/utils/buildInlineDatasources.d.ts +3 -0
  29. package/dist/utils/buildNFTAnnotations.d.ts +11 -0
  30. package/dist/utils/buildNFTAnnotations.test.d.ts +1 -0
  31. package/dist/utils/buildWarnEnvConflicts.d.ts +10 -0
  32. package/dist/utils/runtimeImport.d.ts +8 -1
  33. package/package.json +11 -10
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ var require_universalify = __commonJS({
62
62
  var require_polyfills = __commonJS({
63
63
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
64
64
  "use strict";
65
- var constants = require("constants");
65
+ var constants3 = require("constants");
66
66
  var origCwd = process.cwd;
67
67
  var cwd = null;
68
68
  var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
@@ -86,7 +86,7 @@ var require_polyfills = __commonJS({
86
86
  var chdir;
87
87
  module2.exports = patch;
88
88
  function patch(fs3) {
89
- if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
89
+ if (constants3.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
90
90
  patchLchmod(fs3);
91
91
  }
92
92
  if (!fs3.lutimes) {
@@ -111,14 +111,14 @@ var require_polyfills = __commonJS({
111
111
  fs3.fstatSync = statFixSync(fs3.fstatSync);
112
112
  fs3.lstatSync = statFixSync(fs3.lstatSync);
113
113
  if (fs3.chmod && !fs3.lchmod) {
114
- fs3.lchmod = function(path5, mode, cb) {
114
+ fs3.lchmod = function(path9, mode, cb) {
115
115
  if (cb) process.nextTick(cb);
116
116
  };
117
117
  fs3.lchmodSync = function() {
118
118
  };
119
119
  }
120
120
  if (fs3.chown && !fs3.lchown) {
121
- fs3.lchown = function(path5, uid, gid, cb) {
121
+ fs3.lchown = function(path9, uid, gid, cb) {
122
122
  if (cb) process.nextTick(cb);
123
123
  };
124
124
  fs3.lchownSync = function() {
@@ -185,10 +185,10 @@ var require_polyfills = __commonJS({
185
185
  };
186
186
  }(fs3.readSync);
187
187
  function patchLchmod(fs4) {
188
- fs4.lchmod = function(path5, mode, callback) {
188
+ fs4.lchmod = function(path9, mode, callback) {
189
189
  fs4.open(
190
- path5,
191
- constants.O_WRONLY | constants.O_SYMLINK,
190
+ path9,
191
+ constants3.O_WRONLY | constants3.O_SYMLINK,
192
192
  mode,
193
193
  function(err, fd) {
194
194
  if (err) {
@@ -203,8 +203,8 @@ var require_polyfills = __commonJS({
203
203
  }
204
204
  );
205
205
  };
206
- fs4.lchmodSync = function(path5, mode) {
207
- var fd = fs4.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
206
+ fs4.lchmodSync = function(path9, mode) {
207
+ var fd = fs4.openSync(path9, constants3.O_WRONLY | constants3.O_SYMLINK, mode);
208
208
  var threw = true;
209
209
  var ret;
210
210
  try {
@@ -224,9 +224,9 @@ var require_polyfills = __commonJS({
224
224
  };
225
225
  }
226
226
  function patchLutimes(fs4) {
227
- if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
228
- fs4.lutimes = function(path5, at, mt, cb) {
229
- fs4.open(path5, constants.O_SYMLINK, function(er, fd) {
227
+ if (constants3.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
228
+ fs4.lutimes = function(path9, at, mt, cb) {
229
+ fs4.open(path9, constants3.O_SYMLINK, function(er, fd) {
230
230
  if (er) {
231
231
  if (cb) cb(er);
232
232
  return;
@@ -238,8 +238,8 @@ var require_polyfills = __commonJS({
238
238
  });
239
239
  });
240
240
  };
241
- fs4.lutimesSync = function(path5, at, mt) {
242
- var fd = fs4.openSync(path5, constants.O_SYMLINK);
241
+ fs4.lutimesSync = function(path9, at, mt) {
242
+ var fd = fs4.openSync(path9, constants3.O_SYMLINK);
243
243
  var ret;
244
244
  var threw = true;
245
245
  try {
@@ -358,11 +358,11 @@ var require_legacy_streams = __commonJS({
358
358
  ReadStream,
359
359
  WriteStream
360
360
  };
361
- function ReadStream(path5, options) {
362
- if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
361
+ function ReadStream(path9, options) {
362
+ if (!(this instanceof ReadStream)) return new ReadStream(path9, options);
363
363
  Stream.call(this);
364
364
  var self = this;
365
- this.path = path5;
365
+ this.path = path9;
366
366
  this.fd = null;
367
367
  this.readable = true;
368
368
  this.paused = false;
@@ -407,10 +407,10 @@ var require_legacy_streams = __commonJS({
407
407
  self._read();
408
408
  });
409
409
  }
410
- function WriteStream(path5, options) {
411
- if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
410
+ function WriteStream(path9, options) {
411
+ if (!(this instanceof WriteStream)) return new WriteStream(path9, options);
412
412
  Stream.call(this);
413
- this.path = path5;
413
+ this.path = path9;
414
414
  this.fd = null;
415
415
  this.writable = true;
416
416
  this.flags = "w";
@@ -485,7 +485,7 @@ var require_graceful_fs = __commonJS({
485
485
  gracefulQueue = "___graceful-fs.queue";
486
486
  previousSymbol = "___graceful-fs.previous";
487
487
  }
488
- function noop() {
488
+ function noop2() {
489
489
  }
490
490
  function publishQueue(context, queue2) {
491
491
  Object.defineProperty(context, gracefulQueue, {
@@ -494,11 +494,11 @@ var require_graceful_fs = __commonJS({
494
494
  }
495
495
  });
496
496
  }
497
- var debug2 = noop;
497
+ var debug4 = noop2;
498
498
  if (util.debuglog)
499
- debug2 = util.debuglog("gfs4");
499
+ debug4 = util.debuglog("gfs4");
500
500
  else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
501
- debug2 = function() {
501
+ debug4 = function() {
502
502
  var m = util.format.apply(util, arguments);
503
503
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
504
504
  console.error(m);
@@ -533,7 +533,7 @@ var require_graceful_fs = __commonJS({
533
533
  }(fs3.closeSync);
534
534
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
535
535
  process.on("exit", function() {
536
- debug2(fs3[gracefulQueue]);
536
+ debug4(fs3[gracefulQueue]);
537
537
  require("assert").equal(fs3[gracefulQueue].length, 0);
538
538
  });
539
539
  }
@@ -550,18 +550,18 @@ var require_graceful_fs = __commonJS({
550
550
  function patch(fs4) {
551
551
  polyfills(fs4);
552
552
  fs4.gracefulify = patch;
553
- fs4.createReadStream = createReadStream;
554
- fs4.createWriteStream = createWriteStream;
553
+ fs4.createReadStream = createReadStream2;
554
+ fs4.createWriteStream = createWriteStream2;
555
555
  var fs$readFile = fs4.readFile;
556
556
  fs4.readFile = readFile;
557
- function readFile(path5, options, cb) {
557
+ function readFile(path9, options, cb) {
558
558
  if (typeof options === "function")
559
559
  cb = options, options = null;
560
- return go$readFile(path5, options, cb);
561
- function go$readFile(path6, options2, cb2, startTime) {
562
- return fs$readFile(path6, options2, function(err) {
560
+ return go$readFile(path9, options, cb);
561
+ function go$readFile(path10, options2, cb2, startTime) {
562
+ return fs$readFile(path10, options2, function(err) {
563
563
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
564
- enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
564
+ enqueue([go$readFile, [path10, options2, cb2], err, startTime || Date.now(), Date.now()]);
565
565
  else {
566
566
  if (typeof cb2 === "function")
567
567
  cb2.apply(this, arguments);
@@ -571,14 +571,14 @@ var require_graceful_fs = __commonJS({
571
571
  }
572
572
  var fs$writeFile = fs4.writeFile;
573
573
  fs4.writeFile = writeFile;
574
- function writeFile(path5, data, options, cb) {
574
+ function writeFile(path9, data, options, cb) {
575
575
  if (typeof options === "function")
576
576
  cb = options, options = null;
577
- return go$writeFile(path5, data, options, cb);
578
- function go$writeFile(path6, data2, options2, cb2, startTime) {
579
- return fs$writeFile(path6, data2, options2, function(err) {
577
+ return go$writeFile(path9, data, options, cb);
578
+ function go$writeFile(path10, data2, options2, cb2, startTime) {
579
+ return fs$writeFile(path10, data2, options2, function(err) {
580
580
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
581
- enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
581
+ enqueue([go$writeFile, [path10, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
582
582
  else {
583
583
  if (typeof cb2 === "function")
584
584
  cb2.apply(this, arguments);
@@ -589,14 +589,14 @@ var require_graceful_fs = __commonJS({
589
589
  var fs$appendFile = fs4.appendFile;
590
590
  if (fs$appendFile)
591
591
  fs4.appendFile = appendFile;
592
- function appendFile(path5, data, options, cb) {
592
+ function appendFile(path9, data, options, cb) {
593
593
  if (typeof options === "function")
594
594
  cb = options, options = null;
595
- return go$appendFile(path5, data, options, cb);
596
- function go$appendFile(path6, data2, options2, cb2, startTime) {
597
- return fs$appendFile(path6, data2, options2, function(err) {
595
+ return go$appendFile(path9, data, options, cb);
596
+ function go$appendFile(path10, data2, options2, cb2, startTime) {
597
+ return fs$appendFile(path10, data2, options2, function(err) {
598
598
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
599
- enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
599
+ enqueue([go$appendFile, [path10, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
600
600
  else {
601
601
  if (typeof cb2 === "function")
602
602
  cb2.apply(this, arguments);
@@ -627,31 +627,31 @@ var require_graceful_fs = __commonJS({
627
627
  var fs$readdir = fs4.readdir;
628
628
  fs4.readdir = readdir;
629
629
  var noReaddirOptionVersions = /^v[0-5]\./;
630
- function readdir(path5, options, cb) {
630
+ function readdir(path9, options, cb) {
631
631
  if (typeof options === "function")
632
632
  cb = options, options = null;
633
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
634
- return fs$readdir(path6, fs$readdirCallback(
635
- path6,
633
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path10, options2, cb2, startTime) {
634
+ return fs$readdir(path10, fs$readdirCallback(
635
+ path10,
636
636
  options2,
637
637
  cb2,
638
638
  startTime
639
639
  ));
640
- } : function go$readdir2(path6, options2, cb2, startTime) {
641
- return fs$readdir(path6, options2, fs$readdirCallback(
642
- path6,
640
+ } : function go$readdir2(path10, options2, cb2, startTime) {
641
+ return fs$readdir(path10, options2, fs$readdirCallback(
642
+ path10,
643
643
  options2,
644
644
  cb2,
645
645
  startTime
646
646
  ));
647
647
  };
648
- return go$readdir(path5, options, cb);
649
- function fs$readdirCallback(path6, options2, cb2, startTime) {
648
+ return go$readdir(path9, options, cb);
649
+ function fs$readdirCallback(path10, options2, cb2, startTime) {
650
650
  return function(err, files) {
651
651
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
652
652
  enqueue([
653
653
  go$readdir,
654
- [path6, options2, cb2],
654
+ [path10, options2, cb2],
655
655
  err,
656
656
  startTime || Date.now(),
657
657
  Date.now()
@@ -722,7 +722,7 @@ var require_graceful_fs = __commonJS({
722
722
  enumerable: true,
723
723
  configurable: true
724
724
  });
725
- function ReadStream(path5, options) {
725
+ function ReadStream(path9, options) {
726
726
  if (this instanceof ReadStream)
727
727
  return fs$ReadStream.apply(this, arguments), this;
728
728
  else
@@ -742,7 +742,7 @@ var require_graceful_fs = __commonJS({
742
742
  }
743
743
  });
744
744
  }
745
- function WriteStream(path5, options) {
745
+ function WriteStream(path9, options) {
746
746
  if (this instanceof WriteStream)
747
747
  return fs$WriteStream.apply(this, arguments), this;
748
748
  else
@@ -760,22 +760,22 @@ var require_graceful_fs = __commonJS({
760
760
  }
761
761
  });
762
762
  }
763
- function createReadStream(path5, options) {
764
- return new fs4.ReadStream(path5, options);
763
+ function createReadStream2(path9, options) {
764
+ return new fs4.ReadStream(path9, options);
765
765
  }
766
- function createWriteStream(path5, options) {
767
- return new fs4.WriteStream(path5, options);
766
+ function createWriteStream2(path9, options) {
767
+ return new fs4.WriteStream(path9, options);
768
768
  }
769
769
  var fs$open = fs4.open;
770
770
  fs4.open = open;
771
- function open(path5, flags, mode, cb) {
771
+ function open(path9, flags, mode, cb) {
772
772
  if (typeof mode === "function")
773
773
  cb = mode, mode = null;
774
- return go$open(path5, flags, mode, cb);
775
- function go$open(path6, flags2, mode2, cb2, startTime) {
776
- return fs$open(path6, flags2, mode2, function(err, fd) {
774
+ return go$open(path9, flags, mode, cb);
775
+ function go$open(path10, flags2, mode2, cb2, startTime) {
776
+ return fs$open(path10, flags2, mode2, function(err, fd) {
777
777
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
778
- enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
778
+ enqueue([go$open, [path10, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
779
779
  else {
780
780
  if (typeof cb2 === "function")
781
781
  cb2.apply(this, arguments);
@@ -786,7 +786,7 @@ var require_graceful_fs = __commonJS({
786
786
  return fs4;
787
787
  }
788
788
  function enqueue(elem) {
789
- debug2("ENQUEUE", elem[0].name, elem[1]);
789
+ debug4("ENQUEUE", elem[0].name, elem[1]);
790
790
  fs3[gracefulQueue].push(elem);
791
791
  retry();
792
792
  }
@@ -813,10 +813,10 @@ var require_graceful_fs = __commonJS({
813
813
  var startTime = elem[3];
814
814
  var lastTime = elem[4];
815
815
  if (startTime === void 0) {
816
- debug2("RETRY", fn.name, args);
816
+ debug4("RETRY", fn.name, args);
817
817
  fn.apply(null, args);
818
818
  } else if (Date.now() - startTime >= 6e4) {
819
- debug2("TIMEOUT", fn.name, args);
819
+ debug4("TIMEOUT", fn.name, args);
820
820
  var cb = args.pop();
821
821
  if (typeof cb === "function")
822
822
  cb.call(null, err);
@@ -825,7 +825,7 @@ var require_graceful_fs = __commonJS({
825
825
  var sinceStart = Math.max(lastTime - startTime, 1);
826
826
  var desiredDelay = Math.min(sinceStart * 1.2, 100);
827
827
  if (sinceAttempt >= desiredDelay) {
828
- debug2("RETRY", fn.name, args);
828
+ debug4("RETRY", fn.name, args);
829
829
  fn.apply(null, args.concat([startTime]));
830
830
  } else {
831
831
  fs3[gracefulQueue].push(elem);
@@ -958,10 +958,10 @@ var require_fs = __commonJS({
958
958
  var require_utils = __commonJS({
959
959
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
960
960
  "use strict";
961
- var path5 = require("path");
961
+ var path9 = require("path");
962
962
  module2.exports.checkPath = function checkPath(pth) {
963
963
  if (process.platform === "win32") {
964
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
964
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path9.parse(pth).root, ""));
965
965
  if (pathHasInvalidWinCharacters) {
966
966
  const error = new Error(`Path contains invalid characters: ${pth}`);
967
967
  error.code = "EINVAL";
@@ -1025,8 +1025,8 @@ var require_path_exists = __commonJS({
1025
1025
  "use strict";
1026
1026
  var u = require_universalify().fromPromise;
1027
1027
  var fs3 = require_fs();
1028
- function pathExists(path5) {
1029
- return fs3.access(path5).then(() => true).catch(() => false);
1028
+ function pathExists(path9) {
1029
+ return fs3.access(path9).then(() => true).catch(() => false);
1030
1030
  }
1031
1031
  module2.exports = {
1032
1032
  pathExists: u(pathExists),
@@ -1041,8 +1041,8 @@ var require_utimes = __commonJS({
1041
1041
  "use strict";
1042
1042
  var fs3 = require_fs();
1043
1043
  var u = require_universalify().fromPromise;
1044
- async function utimesMillis(path5, atime, mtime) {
1045
- const fd = await fs3.open(path5, "r+");
1044
+ async function utimesMillis(path9, atime, mtime) {
1045
+ const fd = await fs3.open(path9, "r+");
1046
1046
  let closeErr = null;
1047
1047
  try {
1048
1048
  await fs3.futimes(fd, atime, mtime);
@@ -1057,8 +1057,8 @@ var require_utimes = __commonJS({
1057
1057
  throw closeErr;
1058
1058
  }
1059
1059
  }
1060
- function utimesMillisSync(path5, atime, mtime) {
1061
- const fd = fs3.openSync(path5, "r+");
1060
+ function utimesMillisSync(path9, atime, mtime) {
1061
+ const fd = fs3.openSync(path9, "r+");
1062
1062
  fs3.futimesSync(fd, atime, mtime);
1063
1063
  return fs3.closeSync(fd);
1064
1064
  }
@@ -1074,7 +1074,7 @@ var require_stat = __commonJS({
1074
1074
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
1075
1075
  "use strict";
1076
1076
  var fs3 = require_fs();
1077
- var path5 = require("path");
1077
+ var path9 = require("path");
1078
1078
  var u = require_universalify().fromPromise;
1079
1079
  function getStats(src, dest, opts) {
1080
1080
  const statFunc = opts.dereference ? (file4) => fs3.stat(file4, { bigint: true }) : (file4) => fs3.lstat(file4, { bigint: true });
@@ -1102,8 +1102,8 @@ var require_stat = __commonJS({
1102
1102
  const { srcStat, destStat } = await getStats(src, dest, opts);
1103
1103
  if (destStat) {
1104
1104
  if (areIdentical(srcStat, destStat)) {
1105
- const srcBaseName = path5.basename(src);
1106
- const destBaseName = path5.basename(dest);
1105
+ const srcBaseName = path9.basename(src);
1106
+ const destBaseName = path9.basename(dest);
1107
1107
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1108
1108
  return { srcStat, destStat, isChangingCase: true };
1109
1109
  }
@@ -1125,8 +1125,8 @@ var require_stat = __commonJS({
1125
1125
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
1126
1126
  if (destStat) {
1127
1127
  if (areIdentical(srcStat, destStat)) {
1128
- const srcBaseName = path5.basename(src);
1129
- const destBaseName = path5.basename(dest);
1128
+ const srcBaseName = path9.basename(src);
1129
+ const destBaseName = path9.basename(dest);
1130
1130
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1131
1131
  return { srcStat, destStat, isChangingCase: true };
1132
1132
  }
@@ -1145,9 +1145,9 @@ var require_stat = __commonJS({
1145
1145
  return { srcStat, destStat };
1146
1146
  }
1147
1147
  async function checkParentPaths(src, srcStat, dest, funcName) {
1148
- const srcParent = path5.resolve(path5.dirname(src));
1149
- const destParent = path5.resolve(path5.dirname(dest));
1150
- if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
1148
+ const srcParent = path9.resolve(path9.dirname(src));
1149
+ const destParent = path9.resolve(path9.dirname(dest));
1150
+ if (destParent === srcParent || destParent === path9.parse(destParent).root) return;
1151
1151
  let destStat;
1152
1152
  try {
1153
1153
  destStat = await fs3.stat(destParent, { bigint: true });
@@ -1161,9 +1161,9 @@ var require_stat = __commonJS({
1161
1161
  return checkParentPaths(src, srcStat, destParent, funcName);
1162
1162
  }
1163
1163
  function checkParentPathsSync(src, srcStat, dest, funcName) {
1164
- const srcParent = path5.resolve(path5.dirname(src));
1165
- const destParent = path5.resolve(path5.dirname(dest));
1166
- if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
1164
+ const srcParent = path9.resolve(path9.dirname(src));
1165
+ const destParent = path9.resolve(path9.dirname(dest));
1166
+ if (destParent === srcParent || destParent === path9.parse(destParent).root) return;
1167
1167
  let destStat;
1168
1168
  try {
1169
1169
  destStat = fs3.statSync(destParent, { bigint: true });
@@ -1180,8 +1180,8 @@ var require_stat = __commonJS({
1180
1180
  return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1181
1181
  }
1182
1182
  function isSrcSubdir(src, dest) {
1183
- const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
1184
- const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
1183
+ const srcArr = path9.resolve(src).split(path9.sep).filter((i) => i);
1184
+ const destArr = path9.resolve(dest).split(path9.sep).filter((i) => i);
1185
1185
  return srcArr.every((cur, i) => destArr[i] === cur);
1186
1186
  }
1187
1187
  function errMsg(src, dest, funcName) {
@@ -1206,7 +1206,7 @@ var require_copy = __commonJS({
1206
1206
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
1207
1207
  "use strict";
1208
1208
  var fs3 = require_fs();
1209
- var path5 = require("path");
1209
+ var path9 = require("path");
1210
1210
  var { mkdirs } = require_mkdirs();
1211
1211
  var { pathExists } = require_path_exists();
1212
1212
  var { utimesMillis } = require_utimes();
@@ -1228,7 +1228,7 @@ var require_copy = __commonJS({
1228
1228
  await stat.checkParentPaths(src, srcStat, dest, "copy");
1229
1229
  const include = await runFilter(src, dest, opts);
1230
1230
  if (!include) return;
1231
- const destParent = path5.dirname(dest);
1231
+ const destParent = path9.dirname(dest);
1232
1232
  const dirExists = await pathExists(destParent);
1233
1233
  if (!dirExists) {
1234
1234
  await mkdirs(destParent);
@@ -1282,8 +1282,8 @@ var require_copy = __commonJS({
1282
1282
  }
1283
1283
  const promises = [];
1284
1284
  for await (const item of await fs3.opendir(src)) {
1285
- const srcItem = path5.join(src, item.name);
1286
- const destItem = path5.join(dest, item.name);
1285
+ const srcItem = path9.join(src, item.name);
1286
+ const destItem = path9.join(dest, item.name);
1287
1287
  promises.push(
1288
1288
  runFilter(srcItem, destItem, opts).then((include) => {
1289
1289
  if (include) {
@@ -1302,7 +1302,7 @@ var require_copy = __commonJS({
1302
1302
  async function onLink(destStat, src, dest, opts) {
1303
1303
  let resolvedSrc = await fs3.readlink(src);
1304
1304
  if (opts.dereference) {
1305
- resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1305
+ resolvedSrc = path9.resolve(process.cwd(), resolvedSrc);
1306
1306
  }
1307
1307
  if (!destStat) {
1308
1308
  return fs3.symlink(resolvedSrc, dest);
@@ -1315,7 +1315,7 @@ var require_copy = __commonJS({
1315
1315
  throw e;
1316
1316
  }
1317
1317
  if (opts.dereference) {
1318
- resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1318
+ resolvedDest = path9.resolve(process.cwd(), resolvedDest);
1319
1319
  }
1320
1320
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1321
1321
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -1335,7 +1335,7 @@ var require_copy_sync = __commonJS({
1335
1335
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
1336
1336
  "use strict";
1337
1337
  var fs3 = require_graceful_fs();
1338
- var path5 = require("path");
1338
+ var path9 = require("path");
1339
1339
  var mkdirsSync = require_mkdirs().mkdirsSync;
1340
1340
  var utimesMillisSync = require_utimes().utimesMillisSync;
1341
1341
  var stat = require_stat();
@@ -1356,7 +1356,7 @@ var require_copy_sync = __commonJS({
1356
1356
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1357
1357
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
1358
1358
  if (opts.filter && !opts.filter(src, dest)) return;
1359
- const destParent = path5.dirname(dest);
1359
+ const destParent = path9.dirname(dest);
1360
1360
  if (!fs3.existsSync(destParent)) mkdirsSync(destParent);
1361
1361
  return getStats(destStat, src, dest, opts);
1362
1362
  }
@@ -1425,8 +1425,8 @@ var require_copy_sync = __commonJS({
1425
1425
  }
1426
1426
  }
1427
1427
  function copyDirItem(item, src, dest, opts) {
1428
- const srcItem = path5.join(src, item);
1429
- const destItem = path5.join(dest, item);
1428
+ const srcItem = path9.join(src, item);
1429
+ const destItem = path9.join(dest, item);
1430
1430
  if (opts.filter && !opts.filter(srcItem, destItem)) return;
1431
1431
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1432
1432
  return getStats(destStat, srcItem, destItem, opts);
@@ -1434,7 +1434,7 @@ var require_copy_sync = __commonJS({
1434
1434
  function onLink(destStat, src, dest, opts) {
1435
1435
  let resolvedSrc = fs3.readlinkSync(src);
1436
1436
  if (opts.dereference) {
1437
- resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1437
+ resolvedSrc = path9.resolve(process.cwd(), resolvedSrc);
1438
1438
  }
1439
1439
  if (!destStat) {
1440
1440
  return fs3.symlinkSync(resolvedSrc, dest);
@@ -1447,7 +1447,7 @@ var require_copy_sync = __commonJS({
1447
1447
  throw err;
1448
1448
  }
1449
1449
  if (opts.dereference) {
1450
- resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1450
+ resolvedDest = path9.resolve(process.cwd(), resolvedDest);
1451
1451
  }
1452
1452
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1453
1453
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -1484,11 +1484,11 @@ var require_remove = __commonJS({
1484
1484
  "use strict";
1485
1485
  var fs3 = require_graceful_fs();
1486
1486
  var u = require_universalify().fromCallback;
1487
- function remove(path5, callback) {
1488
- fs3.rm(path5, { recursive: true, force: true }, callback);
1487
+ function remove(path9, callback) {
1488
+ fs3.rm(path9, { recursive: true, force: true }, callback);
1489
1489
  }
1490
- function removeSync(path5) {
1491
- fs3.rmSync(path5, { recursive: true, force: true });
1490
+ function removeSync(path9) {
1491
+ fs3.rmSync(path9, { recursive: true, force: true });
1492
1492
  }
1493
1493
  module2.exports = {
1494
1494
  remove: u(remove),
@@ -1503,7 +1503,7 @@ var require_empty = __commonJS({
1503
1503
  "use strict";
1504
1504
  var u = require_universalify().fromPromise;
1505
1505
  var fs3 = require_fs();
1506
- var path5 = require("path");
1506
+ var path9 = require("path");
1507
1507
  var mkdir = require_mkdirs();
1508
1508
  var remove = require_remove();
1509
1509
  var emptyDir = u(async function emptyDir2(dir) {
@@ -1513,7 +1513,7 @@ var require_empty = __commonJS({
1513
1513
  } catch {
1514
1514
  return mkdir.mkdirs(dir);
1515
1515
  }
1516
- return Promise.all(items.map((item) => remove.remove(path5.join(dir, item))));
1516
+ return Promise.all(items.map((item) => remove.remove(path9.join(dir, item))));
1517
1517
  });
1518
1518
  function emptyDirSync(dir) {
1519
1519
  let items;
@@ -1523,7 +1523,7 @@ var require_empty = __commonJS({
1523
1523
  return mkdir.mkdirsSync(dir);
1524
1524
  }
1525
1525
  items.forEach((item) => {
1526
- item = path5.join(dir, item);
1526
+ item = path9.join(dir, item);
1527
1527
  remove.removeSync(item);
1528
1528
  });
1529
1529
  }
@@ -1541,7 +1541,7 @@ var require_file = __commonJS({
1541
1541
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
1542
1542
  "use strict";
1543
1543
  var u = require_universalify().fromPromise;
1544
- var path5 = require("path");
1544
+ var path9 = require("path");
1545
1545
  var fs3 = require_fs();
1546
1546
  var mkdir = require_mkdirs();
1547
1547
  async function createFile(file4) {
@@ -1551,7 +1551,7 @@ var require_file = __commonJS({
1551
1551
  } catch {
1552
1552
  }
1553
1553
  if (stats && stats.isFile()) return;
1554
- const dir = path5.dirname(file4);
1554
+ const dir = path9.dirname(file4);
1555
1555
  let dirStats = null;
1556
1556
  try {
1557
1557
  dirStats = await fs3.stat(dir);
@@ -1577,7 +1577,7 @@ var require_file = __commonJS({
1577
1577
  } catch {
1578
1578
  }
1579
1579
  if (stats && stats.isFile()) return;
1580
- const dir = path5.dirname(file4);
1580
+ const dir = path9.dirname(file4);
1581
1581
  try {
1582
1582
  if (!fs3.statSync(dir).isDirectory()) {
1583
1583
  fs3.readdirSync(dir);
@@ -1600,7 +1600,7 @@ var require_link = __commonJS({
1600
1600
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
1601
1601
  "use strict";
1602
1602
  var u = require_universalify().fromPromise;
1603
- var path5 = require("path");
1603
+ var path9 = require("path");
1604
1604
  var fs3 = require_fs();
1605
1605
  var mkdir = require_mkdirs();
1606
1606
  var { pathExists } = require_path_exists();
@@ -1619,7 +1619,7 @@ var require_link = __commonJS({
1619
1619
  throw err;
1620
1620
  }
1621
1621
  if (dstStat && areIdentical(srcStat, dstStat)) return;
1622
- const dir = path5.dirname(dstpath);
1622
+ const dir = path9.dirname(dstpath);
1623
1623
  const dirExists = await pathExists(dir);
1624
1624
  if (!dirExists) {
1625
1625
  await mkdir.mkdirs(dir);
@@ -1639,7 +1639,7 @@ var require_link = __commonJS({
1639
1639
  err.message = err.message.replace("lstat", "ensureLink");
1640
1640
  throw err;
1641
1641
  }
1642
- const dir = path5.dirname(dstpath);
1642
+ const dir = path9.dirname(dstpath);
1643
1643
  const dirExists = fs3.existsSync(dir);
1644
1644
  if (dirExists) return fs3.linkSync(srcpath, dstpath);
1645
1645
  mkdir.mkdirsSync(dir);
@@ -1656,12 +1656,12 @@ var require_link = __commonJS({
1656
1656
  var require_symlink_paths = __commonJS({
1657
1657
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
1658
1658
  "use strict";
1659
- var path5 = require("path");
1659
+ var path9 = require("path");
1660
1660
  var fs3 = require_fs();
1661
1661
  var { pathExists } = require_path_exists();
1662
1662
  var u = require_universalify().fromPromise;
1663
1663
  async function symlinkPaths(srcpath, dstpath) {
1664
- if (path5.isAbsolute(srcpath)) {
1664
+ if (path9.isAbsolute(srcpath)) {
1665
1665
  try {
1666
1666
  await fs3.lstat(srcpath);
1667
1667
  } catch (err) {
@@ -1673,8 +1673,8 @@ var require_symlink_paths = __commonJS({
1673
1673
  toDst: srcpath
1674
1674
  };
1675
1675
  }
1676
- const dstdir = path5.dirname(dstpath);
1677
- const relativeToDst = path5.join(dstdir, srcpath);
1676
+ const dstdir = path9.dirname(dstpath);
1677
+ const relativeToDst = path9.join(dstdir, srcpath);
1678
1678
  const exists = await pathExists(relativeToDst);
1679
1679
  if (exists) {
1680
1680
  return {
@@ -1690,11 +1690,11 @@ var require_symlink_paths = __commonJS({
1690
1690
  }
1691
1691
  return {
1692
1692
  toCwd: srcpath,
1693
- toDst: path5.relative(dstdir, srcpath)
1693
+ toDst: path9.relative(dstdir, srcpath)
1694
1694
  };
1695
1695
  }
1696
1696
  function symlinkPathsSync(srcpath, dstpath) {
1697
- if (path5.isAbsolute(srcpath)) {
1697
+ if (path9.isAbsolute(srcpath)) {
1698
1698
  const exists2 = fs3.existsSync(srcpath);
1699
1699
  if (!exists2) throw new Error("absolute srcpath does not exist");
1700
1700
  return {
@@ -1702,8 +1702,8 @@ var require_symlink_paths = __commonJS({
1702
1702
  toDst: srcpath
1703
1703
  };
1704
1704
  }
1705
- const dstdir = path5.dirname(dstpath);
1706
- const relativeToDst = path5.join(dstdir, srcpath);
1705
+ const dstdir = path9.dirname(dstpath);
1706
+ const relativeToDst = path9.join(dstdir, srcpath);
1707
1707
  const exists = fs3.existsSync(relativeToDst);
1708
1708
  if (exists) {
1709
1709
  return {
@@ -1715,7 +1715,7 @@ var require_symlink_paths = __commonJS({
1715
1715
  if (!srcExists) throw new Error("relative srcpath does not exist");
1716
1716
  return {
1717
1717
  toCwd: srcpath,
1718
- toDst: path5.relative(dstdir, srcpath)
1718
+ toDst: path9.relative(dstdir, srcpath)
1719
1719
  };
1720
1720
  }
1721
1721
  module2.exports = {
@@ -1763,7 +1763,7 @@ var require_symlink = __commonJS({
1763
1763
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
1764
1764
  "use strict";
1765
1765
  var u = require_universalify().fromPromise;
1766
- var path5 = require("path");
1766
+ var path9 = require("path");
1767
1767
  var fs3 = require_fs();
1768
1768
  var { mkdirs, mkdirsSync } = require_mkdirs();
1769
1769
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
@@ -1786,7 +1786,7 @@ var require_symlink = __commonJS({
1786
1786
  const relative = await symlinkPaths(srcpath, dstpath);
1787
1787
  srcpath = relative.toDst;
1788
1788
  const toType = await symlinkType(relative.toCwd, type);
1789
- const dir = path5.dirname(dstpath);
1789
+ const dir = path9.dirname(dstpath);
1790
1790
  if (!await pathExists(dir)) {
1791
1791
  await mkdirs(dir);
1792
1792
  }
@@ -1806,7 +1806,7 @@ var require_symlink = __commonJS({
1806
1806
  const relative = symlinkPathsSync(srcpath, dstpath);
1807
1807
  srcpath = relative.toDst;
1808
1808
  type = symlinkTypeSync(relative.toCwd, type);
1809
- const dir = path5.dirname(dstpath);
1809
+ const dir = path9.dirname(dstpath);
1810
1810
  const exists = fs3.existsSync(dir);
1811
1811
  if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
1812
1812
  mkdirsSync(dir);
@@ -1897,7 +1897,7 @@ var require_jsonfile = __commonJS({
1897
1897
  return obj;
1898
1898
  }
1899
1899
  var readFile = universalify.fromPromise(_readFile);
1900
- function readFileSync(file4, options = {}) {
1900
+ function readFileSync2(file4, options = {}) {
1901
1901
  if (typeof options === "string") {
1902
1902
  options = { encoding: options };
1903
1903
  }
@@ -1929,7 +1929,7 @@ var require_jsonfile = __commonJS({
1929
1929
  }
1930
1930
  var jsonfile = {
1931
1931
  readFile,
1932
- readFileSync,
1932
+ readFileSync: readFileSync2,
1933
1933
  writeFile,
1934
1934
  writeFileSync
1935
1935
  };
@@ -1958,18 +1958,18 @@ var require_output_file = __commonJS({
1958
1958
  "use strict";
1959
1959
  var u = require_universalify().fromPromise;
1960
1960
  var fs3 = require_fs();
1961
- var path5 = require("path");
1961
+ var path9 = require("path");
1962
1962
  var mkdir = require_mkdirs();
1963
1963
  var pathExists = require_path_exists().pathExists;
1964
1964
  async function outputFile(file4, data, encoding = "utf-8") {
1965
- const dir = path5.dirname(file4);
1965
+ const dir = path9.dirname(file4);
1966
1966
  if (!await pathExists(dir)) {
1967
1967
  await mkdir.mkdirs(dir);
1968
1968
  }
1969
1969
  return fs3.writeFile(file4, data, encoding);
1970
1970
  }
1971
1971
  function outputFileSync(file4, ...args) {
1972
- const dir = path5.dirname(file4);
1972
+ const dir = path9.dirname(file4);
1973
1973
  if (!fs3.existsSync(dir)) {
1974
1974
  mkdir.mkdirsSync(dir);
1975
1975
  }
@@ -2033,7 +2033,7 @@ var require_move = __commonJS({
2033
2033
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
2034
2034
  "use strict";
2035
2035
  var fs3 = require_fs();
2036
- var path5 = require("path");
2036
+ var path9 = require("path");
2037
2037
  var { copy } = require_copy2();
2038
2038
  var { remove } = require_remove();
2039
2039
  var { mkdirp } = require_mkdirs();
@@ -2043,8 +2043,8 @@ var require_move = __commonJS({
2043
2043
  const overwrite = opts.overwrite || opts.clobber || false;
2044
2044
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2045
2045
  await stat.checkParentPaths(src, srcStat, dest, "move");
2046
- const destParent = path5.dirname(dest);
2047
- const parsedParentPath = path5.parse(destParent);
2046
+ const destParent = path9.dirname(dest);
2047
+ const parsedParentPath = path9.parse(destParent);
2048
2048
  if (parsedParentPath.root !== destParent) {
2049
2049
  await mkdirp(destParent);
2050
2050
  }
@@ -2085,7 +2085,7 @@ var require_move_sync = __commonJS({
2085
2085
  "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
2086
2086
  "use strict";
2087
2087
  var fs3 = require_graceful_fs();
2088
- var path5 = require("path");
2088
+ var path9 = require("path");
2089
2089
  var copySync = require_copy2().copySync;
2090
2090
  var removeSync = require_remove().removeSync;
2091
2091
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -2095,12 +2095,12 @@ var require_move_sync = __commonJS({
2095
2095
  const overwrite = opts.overwrite || opts.clobber || false;
2096
2096
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2097
2097
  stat.checkParentPathsSync(src, srcStat, dest, "move");
2098
- if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest));
2098
+ if (!isParentRoot(dest)) mkdirpSync(path9.dirname(dest));
2099
2099
  return doRename(src, dest, overwrite, isChangingCase);
2100
2100
  }
2101
2101
  function isParentRoot(dest) {
2102
- const parent = path5.dirname(dest);
2103
- const parsedPath = path5.parse(parent);
2102
+ const parent = path9.dirname(dest);
2103
+ const parsedPath = path9.parse(parent);
2104
2104
  return parsedPath.root === parent;
2105
2105
  }
2106
2106
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -2166,6 +2166,547 @@ var require_lib = __commonJS({
2166
2166
  }
2167
2167
  });
2168
2168
 
2169
+ // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
2170
+ var require_windows = __commonJS({
2171
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module2) {
2172
+ "use strict";
2173
+ module2.exports = isexe;
2174
+ isexe.sync = sync;
2175
+ var fs3 = require("fs");
2176
+ function checkPathExt(path9, options) {
2177
+ var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
2178
+ if (!pathext) {
2179
+ return true;
2180
+ }
2181
+ pathext = pathext.split(";");
2182
+ if (pathext.indexOf("") !== -1) {
2183
+ return true;
2184
+ }
2185
+ for (var i = 0; i < pathext.length; i++) {
2186
+ var p = pathext[i].toLowerCase();
2187
+ if (p && path9.substr(-p.length).toLowerCase() === p) {
2188
+ return true;
2189
+ }
2190
+ }
2191
+ return false;
2192
+ }
2193
+ function checkStat(stat, path9, options) {
2194
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
2195
+ return false;
2196
+ }
2197
+ return checkPathExt(path9, options);
2198
+ }
2199
+ function isexe(path9, options, cb) {
2200
+ fs3.stat(path9, function(er, stat) {
2201
+ cb(er, er ? false : checkStat(stat, path9, options));
2202
+ });
2203
+ }
2204
+ function sync(path9, options) {
2205
+ return checkStat(fs3.statSync(path9), path9, options);
2206
+ }
2207
+ }
2208
+ });
2209
+
2210
+ // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
2211
+ var require_mode = __commonJS({
2212
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports2, module2) {
2213
+ "use strict";
2214
+ module2.exports = isexe;
2215
+ isexe.sync = sync;
2216
+ var fs3 = require("fs");
2217
+ function isexe(path9, options, cb) {
2218
+ fs3.stat(path9, function(er, stat) {
2219
+ cb(er, er ? false : checkStat(stat, options));
2220
+ });
2221
+ }
2222
+ function sync(path9, options) {
2223
+ return checkStat(fs3.statSync(path9), options);
2224
+ }
2225
+ function checkStat(stat, options) {
2226
+ return stat.isFile() && checkMode(stat, options);
2227
+ }
2228
+ function checkMode(stat, options) {
2229
+ var mod = stat.mode;
2230
+ var uid = stat.uid;
2231
+ var gid = stat.gid;
2232
+ var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
2233
+ var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
2234
+ var u = parseInt("100", 8);
2235
+ var g = parseInt("010", 8);
2236
+ var o = parseInt("001", 8);
2237
+ var ug = u | g;
2238
+ var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
2239
+ return ret;
2240
+ }
2241
+ }
2242
+ });
2243
+
2244
+ // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
2245
+ var require_isexe = __commonJS({
2246
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module2) {
2247
+ "use strict";
2248
+ var fs3 = require("fs");
2249
+ var core;
2250
+ if (process.platform === "win32" || global.TESTING_WINDOWS) {
2251
+ core = require_windows();
2252
+ } else {
2253
+ core = require_mode();
2254
+ }
2255
+ module2.exports = isexe;
2256
+ isexe.sync = sync;
2257
+ function isexe(path9, options, cb) {
2258
+ if (typeof options === "function") {
2259
+ cb = options;
2260
+ options = {};
2261
+ }
2262
+ if (!cb) {
2263
+ if (typeof Promise !== "function") {
2264
+ throw new TypeError("callback not provided");
2265
+ }
2266
+ return new Promise(function(resolve, reject) {
2267
+ isexe(path9, options || {}, function(er, is) {
2268
+ if (er) {
2269
+ reject(er);
2270
+ } else {
2271
+ resolve(is);
2272
+ }
2273
+ });
2274
+ });
2275
+ }
2276
+ core(path9, options || {}, function(er, is) {
2277
+ if (er) {
2278
+ if (er.code === "EACCES" || options && options.ignoreErrors) {
2279
+ er = null;
2280
+ is = false;
2281
+ }
2282
+ }
2283
+ cb(er, is);
2284
+ });
2285
+ }
2286
+ function sync(path9, options) {
2287
+ try {
2288
+ return core.sync(path9, options || {});
2289
+ } catch (er) {
2290
+ if (options && options.ignoreErrors || er.code === "EACCES") {
2291
+ return false;
2292
+ } else {
2293
+ throw er;
2294
+ }
2295
+ }
2296
+ }
2297
+ }
2298
+ });
2299
+
2300
+ // ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
2301
+ var require_which = __commonJS({
2302
+ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
2303
+ "use strict";
2304
+ var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
2305
+ var path9 = require("path");
2306
+ var COLON = isWindows ? ";" : ":";
2307
+ var isexe = require_isexe();
2308
+ var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
2309
+ var getPathInfo = (cmd, opt) => {
2310
+ const colon = opt.colon || COLON;
2311
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
2312
+ // windows always checks the cwd first
2313
+ ...isWindows ? [process.cwd()] : [],
2314
+ ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
2315
+ "").split(colon)
2316
+ ];
2317
+ const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
2318
+ const pathExt = isWindows ? pathExtExe.split(colon) : [""];
2319
+ if (isWindows) {
2320
+ if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
2321
+ pathExt.unshift("");
2322
+ }
2323
+ return {
2324
+ pathEnv,
2325
+ pathExt,
2326
+ pathExtExe
2327
+ };
2328
+ };
2329
+ var which = (cmd, opt, cb) => {
2330
+ if (typeof opt === "function") {
2331
+ cb = opt;
2332
+ opt = {};
2333
+ }
2334
+ if (!opt)
2335
+ opt = {};
2336
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
2337
+ const found = [];
2338
+ const step = (i) => new Promise((resolve, reject) => {
2339
+ if (i === pathEnv.length)
2340
+ return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
2341
+ const ppRaw = pathEnv[i];
2342
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2343
+ const pCmd = path9.join(pathPart, cmd);
2344
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2345
+ resolve(subStep(p, i, 0));
2346
+ });
2347
+ const subStep = (p, i, ii) => new Promise((resolve, reject) => {
2348
+ if (ii === pathExt.length)
2349
+ return resolve(step(i + 1));
2350
+ const ext = pathExt[ii];
2351
+ isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
2352
+ if (!er && is) {
2353
+ if (opt.all)
2354
+ found.push(p + ext);
2355
+ else
2356
+ return resolve(p + ext);
2357
+ }
2358
+ return resolve(subStep(p, i, ii + 1));
2359
+ });
2360
+ });
2361
+ return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
2362
+ };
2363
+ var whichSync = (cmd, opt) => {
2364
+ opt = opt || {};
2365
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
2366
+ const found = [];
2367
+ for (let i = 0; i < pathEnv.length; i++) {
2368
+ const ppRaw = pathEnv[i];
2369
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2370
+ const pCmd = path9.join(pathPart, cmd);
2371
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2372
+ for (let j = 0; j < pathExt.length; j++) {
2373
+ const cur = p + pathExt[j];
2374
+ try {
2375
+ const is = isexe.sync(cur, { pathExt: pathExtExe });
2376
+ if (is) {
2377
+ if (opt.all)
2378
+ found.push(cur);
2379
+ else
2380
+ return cur;
2381
+ }
2382
+ } catch (ex) {
2383
+ }
2384
+ }
2385
+ }
2386
+ if (opt.all && found.length)
2387
+ return found;
2388
+ if (opt.nothrow)
2389
+ return null;
2390
+ throw getNotFoundError(cmd);
2391
+ };
2392
+ module2.exports = which;
2393
+ which.sync = whichSync;
2394
+ }
2395
+ });
2396
+
2397
+ // ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
2398
+ var require_path_key = __commonJS({
2399
+ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports2, module2) {
2400
+ "use strict";
2401
+ var pathKey2 = (options = {}) => {
2402
+ const environment = options.env || process.env;
2403
+ const platform = options.platform || process.platform;
2404
+ if (platform !== "win32") {
2405
+ return "PATH";
2406
+ }
2407
+ return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
2408
+ };
2409
+ module2.exports = pathKey2;
2410
+ module2.exports.default = pathKey2;
2411
+ }
2412
+ });
2413
+
2414
+ // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
2415
+ var require_resolveCommand = __commonJS({
2416
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
2417
+ "use strict";
2418
+ var path9 = require("path");
2419
+ var which = require_which();
2420
+ var getPathKey = require_path_key();
2421
+ function resolveCommandAttempt(parsed, withoutPathExt) {
2422
+ const env = parsed.options.env || process.env;
2423
+ const cwd = process.cwd();
2424
+ const hasCustomCwd = parsed.options.cwd != null;
2425
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
2426
+ if (shouldSwitchCwd) {
2427
+ try {
2428
+ process.chdir(parsed.options.cwd);
2429
+ } catch (err) {
2430
+ }
2431
+ }
2432
+ let resolved;
2433
+ try {
2434
+ resolved = which.sync(parsed.command, {
2435
+ path: env[getPathKey({ env })],
2436
+ pathExt: withoutPathExt ? path9.delimiter : void 0
2437
+ });
2438
+ } catch (e) {
2439
+ } finally {
2440
+ if (shouldSwitchCwd) {
2441
+ process.chdir(cwd);
2442
+ }
2443
+ }
2444
+ if (resolved) {
2445
+ resolved = path9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
2446
+ }
2447
+ return resolved;
2448
+ }
2449
+ function resolveCommand(parsed) {
2450
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
2451
+ }
2452
+ module2.exports = resolveCommand;
2453
+ }
2454
+ });
2455
+
2456
+ // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
2457
+ var require_escape = __commonJS({
2458
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
2459
+ "use strict";
2460
+ var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
2461
+ function escapeCommand(arg) {
2462
+ arg = arg.replace(metaCharsRegExp, "^$1");
2463
+ return arg;
2464
+ }
2465
+ function escapeArgument(arg, doubleEscapeMetaChars) {
2466
+ arg = `${arg}`;
2467
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
2468
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
2469
+ arg = `"${arg}"`;
2470
+ arg = arg.replace(metaCharsRegExp, "^$1");
2471
+ if (doubleEscapeMetaChars) {
2472
+ arg = arg.replace(metaCharsRegExp, "^$1");
2473
+ }
2474
+ return arg;
2475
+ }
2476
+ module2.exports.command = escapeCommand;
2477
+ module2.exports.argument = escapeArgument;
2478
+ }
2479
+ });
2480
+
2481
+ // ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
2482
+ var require_shebang_regex = __commonJS({
2483
+ "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
2484
+ "use strict";
2485
+ module2.exports = /^#!(.*)/;
2486
+ }
2487
+ });
2488
+
2489
+ // ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
2490
+ var require_shebang_command = __commonJS({
2491
+ "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
2492
+ "use strict";
2493
+ var shebangRegex = require_shebang_regex();
2494
+ module2.exports = (string = "") => {
2495
+ const match2 = string.match(shebangRegex);
2496
+ if (!match2) {
2497
+ return null;
2498
+ }
2499
+ const [path9, argument] = match2[0].replace(/#! ?/, "").split(" ");
2500
+ const binary = path9.split("/").pop();
2501
+ if (binary === "env") {
2502
+ return argument;
2503
+ }
2504
+ return argument ? `${binary} ${argument}` : binary;
2505
+ };
2506
+ }
2507
+ });
2508
+
2509
+ // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
2510
+ var require_readShebang = __commonJS({
2511
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
2512
+ "use strict";
2513
+ var fs3 = require("fs");
2514
+ var shebangCommand = require_shebang_command();
2515
+ function readShebang(command) {
2516
+ const size = 150;
2517
+ const buffer = Buffer.alloc(size);
2518
+ let fd;
2519
+ try {
2520
+ fd = fs3.openSync(command, "r");
2521
+ fs3.readSync(fd, buffer, 0, size, 0);
2522
+ fs3.closeSync(fd);
2523
+ } catch (e) {
2524
+ }
2525
+ return shebangCommand(buffer.toString());
2526
+ }
2527
+ module2.exports = readShebang;
2528
+ }
2529
+ });
2530
+
2531
+ // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
2532
+ var require_parse = __commonJS({
2533
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
2534
+ "use strict";
2535
+ var path9 = require("path");
2536
+ var resolveCommand = require_resolveCommand();
2537
+ var escape = require_escape();
2538
+ var readShebang = require_readShebang();
2539
+ var isWin = process.platform === "win32";
2540
+ var isExecutableRegExp = /\.(?:com|exe)$/i;
2541
+ var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
2542
+ function detectShebang(parsed) {
2543
+ parsed.file = resolveCommand(parsed);
2544
+ const shebang = parsed.file && readShebang(parsed.file);
2545
+ if (shebang) {
2546
+ parsed.args.unshift(parsed.file);
2547
+ parsed.command = shebang;
2548
+ return resolveCommand(parsed);
2549
+ }
2550
+ return parsed.file;
2551
+ }
2552
+ function parseNonShell(parsed) {
2553
+ if (!isWin) {
2554
+ return parsed;
2555
+ }
2556
+ const commandFile = detectShebang(parsed);
2557
+ const needsShell = !isExecutableRegExp.test(commandFile);
2558
+ if (parsed.options.forceShell || needsShell) {
2559
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
2560
+ parsed.command = path9.normalize(parsed.command);
2561
+ parsed.command = escape.command(parsed.command);
2562
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
2563
+ const shellCommand = [parsed.command].concat(parsed.args).join(" ");
2564
+ parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
2565
+ parsed.command = process.env.comspec || "cmd.exe";
2566
+ parsed.options.windowsVerbatimArguments = true;
2567
+ }
2568
+ return parsed;
2569
+ }
2570
+ function parse(command, args, options) {
2571
+ if (args && !Array.isArray(args)) {
2572
+ options = args;
2573
+ args = null;
2574
+ }
2575
+ args = args ? args.slice(0) : [];
2576
+ options = Object.assign({}, options);
2577
+ const parsed = {
2578
+ command,
2579
+ args,
2580
+ options,
2581
+ file: void 0,
2582
+ original: {
2583
+ command,
2584
+ args
2585
+ }
2586
+ };
2587
+ return options.shell ? parsed : parseNonShell(parsed);
2588
+ }
2589
+ module2.exports = parse;
2590
+ }
2591
+ });
2592
+
2593
+ // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
2594
+ var require_enoent = __commonJS({
2595
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
2596
+ "use strict";
2597
+ var isWin = process.platform === "win32";
2598
+ function notFoundError(original, syscall) {
2599
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
2600
+ code: "ENOENT",
2601
+ errno: "ENOENT",
2602
+ syscall: `${syscall} ${original.command}`,
2603
+ path: original.command,
2604
+ spawnargs: original.args
2605
+ });
2606
+ }
2607
+ function hookChildProcess(cp, parsed) {
2608
+ if (!isWin) {
2609
+ return;
2610
+ }
2611
+ const originalEmit = cp.emit;
2612
+ cp.emit = function(name, arg1) {
2613
+ if (name === "exit") {
2614
+ const err = verifyENOENT(arg1, parsed);
2615
+ if (err) {
2616
+ return originalEmit.call(cp, "error", err);
2617
+ }
2618
+ }
2619
+ return originalEmit.apply(cp, arguments);
2620
+ };
2621
+ }
2622
+ function verifyENOENT(status, parsed) {
2623
+ if (isWin && status === 1 && !parsed.file) {
2624
+ return notFoundError(parsed.original, "spawn");
2625
+ }
2626
+ return null;
2627
+ }
2628
+ function verifyENOENTSync(status, parsed) {
2629
+ if (isWin && status === 1 && !parsed.file) {
2630
+ return notFoundError(parsed.original, "spawnSync");
2631
+ }
2632
+ return null;
2633
+ }
2634
+ module2.exports = {
2635
+ hookChildProcess,
2636
+ verifyENOENT,
2637
+ verifyENOENTSync,
2638
+ notFoundError
2639
+ };
2640
+ }
2641
+ });
2642
+
2643
+ // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
2644
+ var require_cross_spawn = __commonJS({
2645
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
2646
+ "use strict";
2647
+ var cp = require("child_process");
2648
+ var parse = require_parse();
2649
+ var enoent = require_enoent();
2650
+ function spawn(command, args, options) {
2651
+ const parsed = parse(command, args, options);
2652
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
2653
+ enoent.hookChildProcess(spawned, parsed);
2654
+ return spawned;
2655
+ }
2656
+ function spawnSync(command, args, options) {
2657
+ const parsed = parse(command, args, options);
2658
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
2659
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
2660
+ return result;
2661
+ }
2662
+ module2.exports = spawn;
2663
+ module2.exports.spawn = spawn;
2664
+ module2.exports.sync = spawnSync;
2665
+ module2.exports._parse = parse;
2666
+ module2.exports._enoent = enoent;
2667
+ }
2668
+ });
2669
+
2670
+ // ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
2671
+ var require_merge_stream = __commonJS({
2672
+ "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports2, module2) {
2673
+ "use strict";
2674
+ var { PassThrough } = require("stream");
2675
+ module2.exports = function() {
2676
+ var sources = [];
2677
+ var output = new PassThrough({ objectMode: true });
2678
+ output.setMaxListeners(0);
2679
+ output.add = add;
2680
+ output.isEmpty = isEmpty;
2681
+ output.on("unpipe", remove);
2682
+ Array.prototype.slice.call(arguments).forEach(add);
2683
+ return output;
2684
+ function add(source) {
2685
+ if (Array.isArray(source)) {
2686
+ source.forEach(add);
2687
+ return this;
2688
+ }
2689
+ sources.push(source);
2690
+ source.once("end", remove.bind(null, source));
2691
+ source.once("error", output.emit.bind(output, "error"));
2692
+ source.pipe(output, { end: false });
2693
+ return this;
2694
+ }
2695
+ function isEmpty() {
2696
+ return sources.length == 0;
2697
+ }
2698
+ function remove(source) {
2699
+ sources = sources.filter(function(it) {
2700
+ return it !== source;
2701
+ });
2702
+ if (!sources.length && output.readable) {
2703
+ output.end();
2704
+ }
2705
+ }
2706
+ };
2707
+ }
2708
+ });
2709
+
2169
2710
  // src/index.ts
2170
2711
  var index_exports = {};
2171
2712
  __export(index_exports, {
@@ -2223,9 +2764,12 @@ function getMappings(mappings, datamodel) {
2223
2764
  }
2224
2765
 
2225
2766
  // src/generateClient.ts
2226
- var import_internals7 = require("@prisma/internals");
2227
- var import_crypto = require("crypto");
2767
+ var import_debug = require("@prisma/debug");
2768
+ var import_fetch_engine = require("@prisma/fetch-engine");
2769
+ var import_internals10 = require("@prisma/internals");
2770
+ var import_crypto2 = require("crypto");
2228
2771
  var import_env_paths = __toESM(require("env-paths"));
2772
+ var import_fs = require("fs");
2229
2773
  var import_promises = __toESM(require("fs/promises"));
2230
2774
  var import_fs_extra = __toESM(require_lib());
2231
2775
 
@@ -2279,7 +2823,7 @@ var bgWhite = init(47, 49);
2279
2823
 
2280
2824
  // src/generateClient.ts
2281
2825
  var import_package_up = require("package-up");
2282
- var import_path = __toESM(require("path"));
2826
+ var import_path3 = __toESM(require("path"));
2283
2827
 
2284
2828
  // ../client/package.json
2285
2829
  var package_default = {
@@ -2311,7 +2855,8 @@ var package_default = {
2311
2855
  "MSSQL",
2312
2856
  "SQL Server",
2313
2857
  "SQLServer",
2314
- "MongoDB"
2858
+ "MongoDB",
2859
+ "react-native"
2315
2860
  ],
2316
2861
  main: "default.js",
2317
2862
  types: "default.d.ts",
@@ -2337,6 +2882,18 @@ var package_default = {
2337
2882
  },
2338
2883
  default: "./default.js"
2339
2884
  },
2885
+ "./edge": {
2886
+ types: "./edge.d.ts",
2887
+ require: "./edge.js",
2888
+ import: "./edge.js",
2889
+ default: "./edge.js"
2890
+ },
2891
+ "./react-native": {
2892
+ types: "./react-native.d.ts",
2893
+ require: "./react-native.js",
2894
+ import: "./react-native.js",
2895
+ default: "./react-native.js"
2896
+ },
2340
2897
  "./extension": {
2341
2898
  types: "./extension.d.ts",
2342
2899
  require: "./extension.js",
@@ -2355,11 +2912,11 @@ var package_default = {
2355
2912
  import: "./index.js",
2356
2913
  default: "./index.js"
2357
2914
  },
2358
- "./edge": {
2359
- types: "./edge.d.ts",
2360
- require: "./edge.js",
2361
- import: "./edge.js",
2362
- default: "./edge.js"
2915
+ "./wasm": {
2916
+ types: "./wasm.d.ts",
2917
+ require: "./wasm.js",
2918
+ import: "./wasm.mjs",
2919
+ default: "./wasm.mjs"
2363
2920
  },
2364
2921
  "./runtime/client": {
2365
2922
  types: "./runtime/client.d.ts",
@@ -2371,12 +2928,42 @@ var package_default = {
2371
2928
  import: "./runtime/client.mjs",
2372
2929
  default: "./runtime/client.mjs"
2373
2930
  },
2931
+ "./runtime/library": {
2932
+ types: "./runtime/library.d.ts",
2933
+ require: "./runtime/library.js",
2934
+ import: "./runtime/library.mjs",
2935
+ default: "./runtime/library.mjs"
2936
+ },
2937
+ "./runtime/binary": {
2938
+ types: "./runtime/binary.d.ts",
2939
+ require: "./runtime/binary.js",
2940
+ import: "./runtime/binary.mjs",
2941
+ default: "./runtime/binary.mjs"
2942
+ },
2943
+ "./runtime/wasm-engine-edge": {
2944
+ types: "./runtime/wasm-engine-edge.d.ts",
2945
+ require: "./runtime/wasm-engine-edge.js",
2946
+ import: "./runtime/wasm-engine-edge.mjs",
2947
+ default: "./runtime/wasm-engine-edge.mjs"
2948
+ },
2374
2949
  "./runtime/wasm-compiler-edge": {
2375
2950
  types: "./runtime/wasm-compiler-edge.d.ts",
2376
2951
  require: "./runtime/wasm-compiler-edge.js",
2377
2952
  import: "./runtime/wasm-compiler-edge.mjs",
2378
2953
  default: "./runtime/wasm-compiler-edge.mjs"
2379
2954
  },
2955
+ "./runtime/edge": {
2956
+ types: "./runtime/edge.d.ts",
2957
+ require: "./runtime/edge.js",
2958
+ import: "./runtime/edge-esm.js",
2959
+ default: "./runtime/edge-esm.js"
2960
+ },
2961
+ "./runtime/react-native": {
2962
+ types: "./runtime/react-native.d.ts",
2963
+ require: "./runtime/react-native.js",
2964
+ import: "./runtime/react-native.js",
2965
+ default: "./runtime/react-native.js"
2966
+ },
2380
2967
  "./runtime/index-browser": {
2381
2968
  types: "./runtime/index-browser.d.ts",
2382
2969
  require: "./runtime/index-browser.js",
@@ -2405,7 +2992,7 @@ var package_default = {
2405
2992
  },
2406
2993
  license: "Apache-2.0",
2407
2994
  engines: {
2408
- node: "^20.19 || ^22.12 || >=24.0"
2995
+ node: ">=18.18"
2409
2996
  },
2410
2997
  homepage: "https://www.prisma.io",
2411
2998
  repository: {
@@ -2421,11 +3008,13 @@ var package_default = {
2421
3008
  test: "dotenv -e ../../.db.env -- jest --silent",
2422
3009
  "test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts",
2423
3010
  "test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts",
2424
- "test:functional:client": "pnpm run test:functional --client-runtime client",
3011
+ "test:functional:client": "pnpm run test:functional --client-runtime client --engine-type client",
2425
3012
  "test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts",
2426
3013
  "test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types",
2427
3014
  "test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only",
2428
3015
  "test-notypes": "dotenv -e ../../.db.env -- jest --testPathIgnorePatterns src/__tests__/types/types.test.ts",
3016
+ generate: "node scripts/postinstall.js",
3017
+ postinstall: "node scripts/postinstall.js",
2429
3018
  prepublishOnly: "pnpm run build",
2430
3019
  "new-test": "tsx ./helpers/new-test/new-test.ts"
2431
3020
  },
@@ -2436,8 +3025,12 @@ var package_default = {
2436
3025
  "generator-build",
2437
3026
  "edge.js",
2438
3027
  "edge.d.ts",
3028
+ "wasm.js",
3029
+ "wasm.d.ts",
2439
3030
  "index.js",
2440
3031
  "index.d.ts",
3032
+ "react-native.js",
3033
+ "react-native.d.ts",
2441
3034
  "default.js",
2442
3035
  "default.d.ts",
2443
3036
  "index-browser.js",
@@ -2448,7 +3041,7 @@ var package_default = {
2448
3041
  "sql.mjs"
2449
3042
  ],
2450
3043
  devDependencies: {
2451
- "@cloudflare/workers-types": "^4.20251014.0",
3044
+ "@cloudflare/workers-types": "^4.20250408.0",
2452
3045
  "@codspeed/benchmark.js-plugin": "4.0.0",
2453
3046
  "@faker-js/faker": "9.6.0",
2454
3047
  "@fast-check/jest": "2.0.3",
@@ -2483,20 +3076,18 @@ var package_default = {
2483
3076
  "@prisma/dmmf": "workspace:*",
2484
3077
  "@prisma/driver-adapter-utils": "workspace:*",
2485
3078
  "@prisma/engines": "workspace:*",
2486
- "@prisma/engines-version": "7.2.0-3.aqrln-zpupkzknszlw-04d61c41ec1a025cabe14093fa3121a5f45040ab",
3079
+ "@prisma/engines-version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
2487
3080
  "@prisma/fetch-engine": "workspace:*",
2488
3081
  "@prisma/generator": "workspace:*",
2489
3082
  "@prisma/generator-helper": "workspace:*",
2490
3083
  "@prisma/get-platform": "workspace:*",
2491
3084
  "@prisma/instrumentation": "workspace:*",
2492
- "@prisma/instrumentation-contract": "workspace:*",
2493
3085
  "@prisma/internals": "workspace:*",
2494
- "@prisma/json-protocol": "workspace:*",
2495
3086
  "@prisma/migrate": "workspace:*",
2496
- "@prisma/query-compiler-wasm": "7.2.0-3.aqrln-zpupkzknszlw-04d61c41ec1a025cabe14093fa3121a5f45040ab",
3087
+ "@prisma/mini-proxy": "0.9.5",
3088
+ "@prisma/query-compiler-wasm": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
3089
+ "@prisma/query-engine-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
2497
3090
  "@prisma/query-plan-executor": "workspace:*",
2498
- "@prisma/sqlcommenter": "workspace:*",
2499
- "@prisma/sqlcommenter-trace-context": "workspace:*",
2500
3091
  "@prisma/ts-builders": "workspace:*",
2501
3092
  "@snaplet/copycat": "6.0.0",
2502
3093
  "@swc-node/register": "1.10.9",
@@ -2508,11 +3099,12 @@ var package_default = {
2508
3099
  "@types/jest": "29.5.14",
2509
3100
  "@types/js-levenshtein": "1.1.3",
2510
3101
  "@types/mssql": "9.1.8",
2511
- "@types/node": "~20.19.24",
3102
+ "@types/node": "18.19.76",
2512
3103
  "@types/pg": "8.11.11",
2513
3104
  arg: "5.0.2",
2514
3105
  benchmark: "2.1.4",
2515
3106
  "cookie-es": "2.0.0",
3107
+ "decimal.js": "10.5.0",
2516
3108
  execa: "8.0.1",
2517
3109
  "expect-type": "1.2.2",
2518
3110
  "fs-extra": "11.3.0",
@@ -2537,6 +3129,7 @@ var package_default = {
2537
3129
  "simple-statistics": "7.8.8",
2538
3130
  "sort-keys": "5.1.0",
2539
3131
  "source-map-support": "0.5.21",
3132
+ "sql-template-tag": "5.2.1",
2540
3133
  "stacktrace-parser": "0.1.11",
2541
3134
  "strip-ansi": "7.1.0",
2542
3135
  "strip-indent": "4.0.0",
@@ -2547,12 +3140,9 @@ var package_default = {
2547
3140
  undici: "7.4.0",
2548
3141
  zx: "8.4.1"
2549
3142
  },
2550
- dependencies: {
2551
- "@prisma/client-runtime-utils": "workspace:*"
2552
- },
2553
3143
  peerDependencies: {
2554
3144
  prisma: "*",
2555
- typescript: ">=5.4.0"
3145
+ typescript: ">=5.1.0"
2556
3146
  },
2557
3147
  peerDependenciesMeta: {
2558
3148
  prisma: {
@@ -2597,7 +3187,7 @@ var Enum = class {
2597
3187
  toJS() {
2598
3188
  const { type } = this;
2599
3189
  const enumVariants = `{
2600
- ${(0, import_indent_string.default)(type.data.map((v) => `${v.key}: ${this.getValueJS(v.value)}`).join(",\n"), TAB_SIZE)}
3190
+ ${(0, import_indent_string.default)(type.values.map((v) => `${v}: ${this.getValueJS(v)}`).join(",\n"), TAB_SIZE)}
2601
3191
  }`;
2602
3192
  const enumBody = this.isStrictEnum() ? `makeStrictEnum(${enumVariants})` : enumVariants;
2603
3193
  return this.useNamespace ? `exports.Prisma.${type.name} = ${enumBody};` : `exports.${type.name} = exports.$Enums.${type.name} = ${enumBody};`;
@@ -2608,7 +3198,7 @@ ${(0, import_indent_string.default)(type.data.map((v) => `${v.key}: ${this.getVa
2608
3198
  toTS() {
2609
3199
  const { type } = this;
2610
3200
  return `export const ${type.name}: {
2611
- ${(0, import_indent_string.default)(type.data.map((v) => `${v.key}: ${this.getValueTS(v.value)}`).join(",\n"), TAB_SIZE)}
3201
+ ${(0, import_indent_string.default)(type.values.map((v) => `${v}: ${this.getValueTS(v)}`).join(",\n"), TAB_SIZE)}
2612
3202
  };
2613
3203
 
2614
3204
  export type ${type.name} = (typeof ${type.name})[keyof typeof ${type.name}]
@@ -4335,8 +4925,12 @@ function fluentWrapperName(modelName) {
4335
4925
 
4336
4926
  // src/TSClient/TSClient.ts
4337
4927
  var import_dmmf = require("@prisma/dmmf");
4928
+ var import_internals7 = require("@prisma/internals");
4338
4929
  var ts12 = __toESM(require("@prisma/ts-builders"));
4339
- var import_indent_string7 = __toESM(require("indent-string"));
4930
+ var import_ci_info = __toESM(require("ci-info"));
4931
+ var import_crypto = __toESM(require("crypto"));
4932
+ var import_indent_string8 = __toESM(require("indent-string"));
4933
+ var import_path2 = __toESM(require("path"));
4340
4934
 
4341
4935
  // src/dmmf.ts
4342
4936
  var import_client_common10 = require("@prisma/client-common");
@@ -4531,24 +5125,87 @@ var GenericArgsInfo = class {
4531
5125
  }
4532
5126
  };
4533
5127
 
5128
+ // src/utils/buildInjectableEdgeEnv.ts
5129
+ function buildInjectableEdgeEnv(edge, datasources) {
5130
+ if (edge === true) {
5131
+ return declareInjectableEdgeEnv(datasources);
5132
+ }
5133
+ return ``;
5134
+ }
5135
+ function declareInjectableEdgeEnv(datasources) {
5136
+ const injectableEdgeEnv = { parsed: {} };
5137
+ const envVarNames = getSelectedEnvVarNames(datasources);
5138
+ for (const envVarName of envVarNames) {
5139
+ injectableEdgeEnv.parsed[envVarName] = getRuntimeEdgeEnvVar(envVarName);
5140
+ }
5141
+ const injectableEdgeEnvJson = JSON.stringify(injectableEdgeEnv, null, 2);
5142
+ const injectableEdgeEnvCode = injectableEdgeEnvJson.replace(/"/g, "");
5143
+ return `
5144
+ config.injectableEdgeEnv = () => (${injectableEdgeEnvCode})`;
5145
+ }
5146
+ function getSelectedEnvVarNames(datasources) {
5147
+ return datasources.reduce((acc, datasource) => {
5148
+ if (datasource.url.fromEnvVar) {
5149
+ return [...acc, datasource.url.fromEnvVar];
5150
+ }
5151
+ return acc;
5152
+ }, []);
5153
+ }
5154
+ function getRuntimeEdgeEnvVar(envVarName) {
5155
+ const cfwEnv = `typeof globalThis !== 'undefined' && globalThis['${envVarName}']`;
5156
+ const nodeOrVercelEnv = `typeof process !== 'undefined' && process.env && process.env.${envVarName}`;
5157
+ return `${cfwEnv} || ${nodeOrVercelEnv} || undefined`;
5158
+ }
5159
+
4534
5160
  // src/utils/buildDebugInitialization.ts
4535
5161
  function buildDebugInitialization(edge) {
4536
5162
  if (!edge) {
4537
5163
  return "";
4538
5164
  }
4539
- const debugVar = `typeof globalThis !== 'undefined' && globalThis['DEBUG'] || (typeof process !== 'undefined' && process.env && process.env.DEBUG) || undefined`;
5165
+ const debugVar = getRuntimeEdgeEnvVar("DEBUG");
4540
5166
  return `if (${debugVar}) {
4541
5167
  Debug.enable(${debugVar})
4542
5168
  }
4543
5169
  `;
4544
5170
  }
4545
5171
 
5172
+ // src/utils/buildDirname.ts
5173
+ var import_internals4 = require("@prisma/internals");
5174
+ function buildDirname(edge, relativeOutdir) {
5175
+ if (edge === true) {
5176
+ return buildDirnameDefault();
5177
+ }
5178
+ return buildDirnameFind(relativeOutdir);
5179
+ }
5180
+ function buildDirnameFind(relativeOutdir) {
5181
+ return `
5182
+ const fs = require('fs')
5183
+
5184
+ config.dirname = __dirname
5185
+ if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) {
5186
+ const alternativePaths = [
5187
+ ${JSON.stringify((0, import_internals4.pathToPosix)(relativeOutdir))},
5188
+ ${JSON.stringify((0, import_internals4.pathToPosix)(relativeOutdir).split("/").slice(1).join("/"))},
5189
+ ]
5190
+
5191
+ const alternativePath = alternativePaths.find((altPath) => {
5192
+ return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma'))
5193
+ }) ?? alternativePaths[0]
5194
+
5195
+ config.dirname = path.join(process.cwd(), alternativePath)
5196
+ config.isBundled = true
5197
+ }`;
5198
+ }
5199
+ function buildDirnameDefault() {
5200
+ return `config.dirname = '/'`;
5201
+ }
5202
+
4546
5203
  // src/utils/buildDMMF.ts
4547
5204
  var import_client_common12 = require("@prisma/client-common");
4548
- function buildRuntimeDataModel(datamodel, runtimeName) {
5205
+ function buildRuntimeDataModel(datamodel, runtimeNameJs) {
4549
5206
  const runtimeDataModel = (0, import_client_common12.dmmfToRuntimeDataModel)(datamodel);
4550
5207
  let prunedDataModel;
4551
- if (runtimeName === "wasm-compiler-edge" || runtimeName === "client") {
5208
+ if (runtimeNameJs === "wasm-engine-edge" || runtimeNameJs === "wasm-compiler-edge" || runtimeNameJs === "client") {
4552
5209
  prunedDataModel = (0, import_client_common12.pruneRuntimeDataModel)(runtimeDataModel);
4553
5210
  } else {
4554
5211
  prunedDataModel = runtimeDataModel;
@@ -4560,20 +5217,19 @@ defineDmmfProperty(exports.Prisma, config.runtimeDataModel)`;
4560
5217
  }
4561
5218
 
4562
5219
  // src/utils/buildGetQueryCompilerWasmModule.ts
4563
- function buildQueryCompilerWasmModule(forceEdgeWasmLoader, runtimeName) {
4564
- if (runtimeName === "client" && !forceEdgeWasmLoader) {
5220
+ function buildQueryCompilerWasmModule(forceEdgeWasmLoader, runtimeNameJs) {
5221
+ if (runtimeNameJs === "client" && !forceEdgeWasmLoader) {
4565
5222
  return `config.compilerWasm = {
4566
5223
  getRuntime: async () => require('./query_compiler_bg.js'),
4567
5224
  getQueryCompilerWasmModule: async () => {
4568
- const { Buffer } = require('node:buffer')
4569
- const { wasm } = require('./query_compiler_bg.wasm-base64.js')
4570
- const queryCompilerWasmFileBytes = Buffer.from(wasm, 'base64')
5225
+ const queryCompilerWasmFilePath = require('path').join(config.dirname, 'query_compiler_bg.wasm')
5226
+ const queryCompilerWasmFileBytes = require('fs').readFileSync(queryCompilerWasmFilePath)
4571
5227
 
4572
5228
  return new WebAssembly.Module(queryCompilerWasmFileBytes)
4573
5229
  }
4574
5230
  }`;
4575
5231
  }
4576
- if (runtimeName === "client" && forceEdgeWasmLoader || runtimeName === "wasm-compiler-edge") {
5232
+ if (runtimeNameJs === "client" && forceEdgeWasmLoader || runtimeNameJs === "wasm-compiler-edge") {
4577
5233
  return `config.compilerWasm = {
4578
5234
  getRuntime: async () => require('./query_compiler_bg.js'),
4579
5235
  getQueryCompilerWasmModule: async () => {
@@ -4586,6 +5242,90 @@ function buildQueryCompilerWasmModule(forceEdgeWasmLoader, runtimeName) {
4586
5242
  return `config.compilerWasm = undefined`;
4587
5243
  }
4588
5244
 
5245
+ // src/utils/buildGetQueryEngineWasmModule.ts
5246
+ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
5247
+ if (copyEngine && runtimeNameJs === "library" && process.env.PRISMA_CLIENT_FORCE_WASM) {
5248
+ return `config.engineWasm = {
5249
+ getRuntime: async () => require('./query_engine_bg.js'),
5250
+ getQueryEngineWasmModule: async () => {
5251
+ const queryEngineWasmFilePath = require('path').join(config.dirname, 'query_engine_bg.wasm')
5252
+ const queryEngineWasmFileBytes = require('fs').readFileSync(queryEngineWasmFilePath)
5253
+
5254
+ return new WebAssembly.Module(queryEngineWasmFileBytes)
5255
+ }
5256
+ }`;
5257
+ }
5258
+ if (copyEngine && wasm === true && runtimeNameJs === "wasm-engine-edge") {
5259
+ return `config.engineWasm = {
5260
+ getRuntime: async () => require('./query_engine_bg.js'),
5261
+ getQueryEngineWasmModule: async () => {
5262
+ const loader = (await import('#wasm-engine-loader')).default
5263
+ const engine = (await loader).default
5264
+ return engine
5265
+ }
5266
+ }`;
5267
+ }
5268
+ return `config.engineWasm = undefined`;
5269
+ }
5270
+
5271
+ // src/utils/buildInlineDatasources.ts
5272
+ function buildInlineDatasources(datasources) {
5273
+ return datasources.reduce((acc, ds) => {
5274
+ return acc[ds.name] = buildInlineDatasource(ds), acc;
5275
+ }, {});
5276
+ }
5277
+ function buildInlineDatasource(ds) {
5278
+ if (ds.url.fromEnvVar) {
5279
+ return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
5280
+ } else {
5281
+ return { url: { fromEnvVar: null, value: ds.url.value } };
5282
+ }
5283
+ }
5284
+
5285
+ // src/utils/buildNFTAnnotations.ts
5286
+ var import_get_platform = require("@prisma/get-platform");
5287
+ var import_internals5 = require("@prisma/internals");
5288
+ var import_path = __toESM(require("path"));
5289
+ function buildNFTAnnotations(noEngine, engineType, binaryTargets, relativeOutdir) {
5290
+ if (noEngine === true) return "";
5291
+ if (binaryTargets === void 0) {
5292
+ return "";
5293
+ }
5294
+ if (process.env.NETLIFY) {
5295
+ const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20;
5296
+ const awsRuntimeVersion = (0, import_internals5.parseAWSNodejsRuntimeEnvVarVersion)();
5297
+ const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20;
5298
+ const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18;
5299
+ if ((isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) {
5300
+ binaryTargets = ["rhel-openssl-3.0.x"];
5301
+ } else {
5302
+ binaryTargets = ["rhel-openssl-1.0.x"];
5303
+ }
5304
+ }
5305
+ const engineAnnotations = binaryTargets.map((binaryTarget) => {
5306
+ const engineFilename = getQueryEngineFilename(engineType, binaryTarget);
5307
+ return engineFilename ? buildNFTAnnotation(engineFilename, relativeOutdir) : "";
5308
+ }).join("\n");
5309
+ const schemaAnnotations = buildNFTAnnotation("schema.prisma", relativeOutdir);
5310
+ return `${engineAnnotations}${schemaAnnotations}`;
5311
+ }
5312
+ function getQueryEngineFilename(engineType, binaryTarget) {
5313
+ if (engineType === import_internals5.ClientEngineType.Library) {
5314
+ return (0, import_get_platform.getNodeAPIName)(binaryTarget, "fs");
5315
+ }
5316
+ if (engineType === import_internals5.ClientEngineType.Binary) {
5317
+ return `query-engine-${binaryTarget}`;
5318
+ }
5319
+ return void 0;
5320
+ }
5321
+ function buildNFTAnnotation(fileName, relativeOutdir) {
5322
+ const relativeFilePath = import_path.default.join(relativeOutdir, fileName);
5323
+ return `
5324
+ // file annotations for bundling tools to include these files
5325
+ path.join(__dirname, ${JSON.stringify((0, import_internals5.pathToPosix)(fileName))});
5326
+ path.join(process.cwd(), ${JSON.stringify((0, import_internals5.pathToPosix)(relativeFilePath))})`;
5327
+ }
5328
+
4589
5329
  // src/utils/buildRequirePath.ts
4590
5330
  function buildRequirePath(edge) {
4591
5331
  if (edge === true) return "";
@@ -4593,11 +5333,23 @@ function buildRequirePath(edge) {
4593
5333
  const path = require('path')`;
4594
5334
  }
4595
5335
 
5336
+ // src/utils/buildWarnEnvConflicts.ts
5337
+ function buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs) {
5338
+ if (edge === true) return "";
5339
+ return `
5340
+ const { warnEnvConflicts } = require('${runtimeBase}/${runtimeNameJs}.js')
5341
+
5342
+ warnEnvConflicts({
5343
+ rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath),
5344
+ schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath)
5345
+ })`;
5346
+ }
5347
+
4596
5348
  // src/TSClient/common.ts
4597
5349
  var import_indent_string4 = __toESM(require("indent-string"));
4598
5350
  var commonCodeJS = ({
4599
5351
  runtimeBase,
4600
- runtimeName,
5352
+ runtimeNameJs,
4601
5353
  browser,
4602
5354
  clientVersion,
4603
5355
  engineVersion,
@@ -4607,15 +5359,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
4607
5359
  ${browser ? `
4608
5360
  const {
4609
5361
  Decimal,
4610
- DbNull,
4611
- JsonNull,
4612
- AnyNull,
4613
- NullTypes,
5362
+ objectEnumValues,
4614
5363
  makeStrictEnum,
4615
5364
  Public,
4616
5365
  getRuntime,
4617
5366
  skip
4618
- } = require('${runtimeBase}/${runtimeName}.js')
5367
+ } = require('${runtimeBase}/${runtimeNameJs}.js')
4619
5368
  ` : `
4620
5369
  const {
4621
5370
  PrismaClientKnownRequestError,
@@ -4631,10 +5380,7 @@ const {
4631
5380
  skip,
4632
5381
  Decimal,
4633
5382
  Debug,
4634
- DbNull,
4635
- JsonNull,
4636
- AnyNull,
4637
- NullTypes,
5383
+ objectEnumValues,
4638
5384
  makeStrictEnum,
4639
5385
  Extensions,
4640
5386
  warnOnce,
@@ -4642,7 +5388,7 @@ const {
4642
5388
  Public,
4643
5389
  getRuntime,
4644
5390
  createParam,
4645
- } = require('${runtimeBase}/${runtimeName}.js')
5391
+ } = require('${runtimeBase}/${runtimeNameJs}.js')
4646
5392
  `}
4647
5393
 
4648
5394
  const Prisma = {}
@@ -4684,11 +5430,15 @@ Prisma.defineExtension = ${notSupportOnBrowser("Extensions.defineExtension", bro
4684
5430
  /**
4685
5431
  * Shorthand utilities for JSON filtering
4686
5432
  */
4687
- Prisma.DbNull = DbNull
4688
- Prisma.JsonNull = JsonNull
4689
- Prisma.AnyNull = AnyNull
5433
+ Prisma.DbNull = objectEnumValues.instances.DbNull
5434
+ Prisma.JsonNull = objectEnumValues.instances.JsonNull
5435
+ Prisma.AnyNull = objectEnumValues.instances.AnyNull
4690
5436
 
4691
- Prisma.NullTypes = NullTypes
5437
+ Prisma.NullTypes = {
5438
+ DbNull: objectEnumValues.classes.DbNull,
5439
+ JsonNull: objectEnumValues.classes.JsonNull,
5440
+ AnyNull: objectEnumValues.classes.AnyNull
5441
+ }
4692
5442
 
4693
5443
  ${buildPrismaSkipJs(generator.previewFeatures)}
4694
5444
  `;
@@ -4704,12 +5454,12 @@ In case this error is unexpected for you, please report it in https://pris.ly/pr
4704
5454
  };
4705
5455
  var commonCodeTS = ({
4706
5456
  runtimeBase,
4707
- runtimeName,
5457
+ runtimeNameTs,
4708
5458
  clientVersion,
4709
5459
  engineVersion,
4710
5460
  generator
4711
5461
  }) => ({
4712
- tsWithoutNamespace: () => `import * as runtime from '${runtimeBase}/${runtimeName}.js';
5462
+ tsWithoutNamespace: () => `import * as runtime from '${runtimeBase}/${runtimeNameTs}';
4713
5463
  import $Types = runtime.Types // general types
4714
5464
  import $Public = runtime.Types.Public
4715
5465
  import $Utils = runtime.Types.Utils
@@ -4754,6 +5504,14 @@ export import Decimal = runtime.Decimal
4754
5504
 
4755
5505
  export type DecimalJsLike = runtime.DecimalJsLike
4756
5506
 
5507
+ /**
5508
+ * Metrics
5509
+ */
5510
+ export type Metrics = runtime.Metrics
5511
+ export type Metric<T> = runtime.Metric<T>
5512
+ export type MetricHistogram = runtime.MetricHistogram
5513
+ export type MetricHistogramBucket = runtime.MetricHistogramBucket
5514
+
4757
5515
  /**
4758
5516
  * Extensions
4759
5517
  */
@@ -4770,7 +5528,6 @@ export import Exact = $Public.Exact
4770
5528
  */
4771
5529
  export type PrismaVersion = {
4772
5530
  client: string
4773
- engine: string
4774
5531
  }
4775
5532
 
4776
5533
  export const prismaVersion: PrismaVersion
@@ -5236,33 +5993,45 @@ var GenerateContext = class {
5236
5993
  dmmf;
5237
5994
  genericArgsInfo;
5238
5995
  generator;
5239
- provider;
5240
- constructor({ dmmf, genericArgsInfo, generator, provider }) {
5996
+ constructor({ dmmf, genericArgsInfo, generator }) {
5241
5997
  this.dmmf = dmmf;
5242
5998
  this.genericArgsInfo = genericArgsInfo;
5243
5999
  this.generator = generator;
5244
- this.provider = provider;
5245
6000
  }
5246
6001
  isPreviewFeatureOn(previewFeature) {
5247
6002
  return this.generator?.previewFeatures?.includes(previewFeature) ?? false;
5248
6003
  }
5249
- isSqlProvider() {
5250
- return this.provider !== "mongodb";
5251
- }
5252
6004
  };
5253
6005
 
5254
6006
  // src/TSClient/PrismaClient.ts
5255
6007
  var import_client_common15 = require("@prisma/client-common");
5256
- var import_internals4 = require("@prisma/internals");
6008
+ var import_internals6 = require("@prisma/internals");
5257
6009
  var ts11 = __toESM(require("@prisma/ts-builders"));
5258
- var import_indent_string6 = __toESM(require("indent-string"));
6010
+ var import_indent_string7 = __toESM(require("indent-string"));
5259
6011
 
5260
6012
  // src/utils/runtimeImport.ts
5261
6013
  var ts9 = __toESM(require("@prisma/ts-builders"));
6014
+ function runtimeImport(name) {
6015
+ return name;
6016
+ }
5262
6017
  function runtimeImportedType(name) {
5263
6018
  return ts9.namedType(`runtime.${name}`);
5264
6019
  }
5265
6020
 
6021
+ // src/TSClient/Datasources.ts
6022
+ var import_indent_string6 = __toESM(require("indent-string"));
6023
+ var Datasources = class {
6024
+ constructor(internalDatasources) {
6025
+ this.internalDatasources = internalDatasources;
6026
+ }
6027
+ toTS() {
6028
+ const sources = this.internalDatasources;
6029
+ return `export type Datasources = {
6030
+ ${(0, import_indent_string6.default)(sources.map((s) => `${s.name}?: Datasource`).join("\n"), 2)}
6031
+ }`;
6032
+ }
6033
+ };
6034
+
5266
6035
  // src/TSClient/globalOmit.ts
5267
6036
  var import_client_common14 = require("@prisma/client-common");
5268
6037
  var ts10 = __toESM(require("@prisma/ts-builders"));
@@ -5333,7 +6102,7 @@ function clientTypeMapModelsResultDefinition(modelName, action) {
5333
6102
  if (action === "update") return payloadToResult(modelName);
5334
6103
  if (action === "upsert") return payloadToResult(modelName);
5335
6104
  if (action === "delete") return payloadToResult(modelName);
5336
- (0, import_internals4.assertNever)(action, `Unknown action: ${action}`);
6105
+ (0, import_internals6.assertNever)(action, `Unknown action: ${action}`);
5337
6106
  }
5338
6107
  function payloadToResult(modelName) {
5339
6108
  return ts11.namedType("$Utils.PayloadToResult").addGenericArgument(ts11.namedType(getPayloadName(modelName)));
@@ -5443,7 +6212,7 @@ function queryRawDefinition(context) {
5443
6212
  * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
5444
6213
  * \`\`\`
5445
6214
  *
5446
- * Read more in our [docs](https://pris.ly/d/raw-queries).
6215
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5447
6216
  */
5448
6217
  $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
5449
6218
 
@@ -5455,7 +6224,7 @@ function queryRawDefinition(context) {
5455
6224
  * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
5456
6225
  * \`\`\`
5457
6226
  *
5458
- * Read more in our [docs](https://pris.ly/d/raw-queries).
6227
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5459
6228
  */
5460
6229
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`;
5461
6230
  }
@@ -5471,7 +6240,7 @@ function executeRawDefinition(context) {
5471
6240
  * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
5472
6241
  * \`\`\`
5473
6242
  *
5474
- * Read more in our [docs](https://pris.ly/d/raw-queries).
6243
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5475
6244
  */
5476
6245
  $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
5477
6246
 
@@ -5483,7 +6252,7 @@ function executeRawDefinition(context) {
5483
6252
  * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
5484
6253
  * \`\`\`
5485
6254
  *
5486
- * Read more in our [docs](https://pris.ly/d/raw-queries).
6255
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5487
6256
  */
5488
6257
  $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
5489
6258
  }
@@ -5513,14 +6282,32 @@ function queryRawTypedDefinition(context) {
5513
6282
  ).setReturnType(prismaPromise(ts11.array(param.toArgument())));
5514
6283
  return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
5515
6284
  }
5516
- function runCommandRawDefinition(context) {
5517
- if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) {
6285
+ function metricDefinition(context) {
6286
+ if (!context.isPreviewFeatureOn("metrics")) {
5518
6287
  return "";
5519
6288
  }
5520
- const method3 = ts11.method("$runCommandRaw").addParameter(ts11.parameter("command", ts11.namedType("Prisma.InputJsonObject"))).setReturnType(prismaPromise(ts11.namedType("Prisma.JsonObject"))).setDocComment(ts11.docComment`
5521
- Executes a raw MongoDB command and returns the result of it.
5522
- @example
5523
- \`\`\`
6289
+ const property11 = ts11.property("$metrics", ts11.namedType(`runtime.${runtimeImport("MetricsClient")}`)).setDocComment(
6290
+ ts11.docComment`
6291
+ Gives access to the client metrics in json or prometheus format.
6292
+
6293
+ @example
6294
+ \`\`\`
6295
+ const metrics = await prisma.$metrics.json()
6296
+ // or
6297
+ const metrics = await prisma.$metrics.prometheus()
6298
+ \`\`\`
6299
+ `
6300
+ ).readonly();
6301
+ return ts11.stringify(property11, { indentLevel: 1, newLine: "leading" });
6302
+ }
6303
+ function runCommandRawDefinition(context) {
6304
+ if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) {
6305
+ return "";
6306
+ }
6307
+ const method3 = ts11.method("$runCommandRaw").addParameter(ts11.parameter("command", ts11.namedType("Prisma.InputJsonObject"))).setReturnType(prismaPromise(ts11.namedType("Prisma.JsonObject"))).setDocComment(ts11.docComment`
6308
+ Executes a raw MongoDB command and returns the result of it.
6309
+ @example
6310
+ \`\`\`
5524
6311
  const user = await prisma.$runCommandRaw({
5525
6312
  aggregate: 'User',
5526
6313
  pipeline: [{ $match: { name: 'Bob' } }, { $project: { email: true, _id: false } }],
@@ -5528,16 +6315,32 @@ function runCommandRawDefinition(context) {
5528
6315
  })
5529
6316
  \`\`\`
5530
6317
 
5531
- Read more in our [docs](https://pris.ly/d/raw-queries).
6318
+ Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5532
6319
  `);
5533
6320
  return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
5534
6321
  }
6322
+ function applyPendingMigrationsDefinition() {
6323
+ if (this.runtimeNameTs !== "react-native") {
6324
+ return null;
6325
+ }
6326
+ const method3 = ts11.method("$applyPendingMigrations").setReturnType(promise(ts11.voidType)).setDocComment(
6327
+ ts11.docComment`Tries to apply pending migrations one by one. If a migration fails to apply, the function will stop and throw an error. You are responsible for informing the user and possibly blocking the app as we cannot guarantee the state of the database.`
6328
+ );
6329
+ return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
6330
+ }
6331
+ function eventRegistrationMethodDeclaration(runtimeNameTs) {
6332
+ if (runtimeNameTs === "binary.js") {
6333
+ return `$on<V extends (U | 'beforeExit')>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => $Utils.JsPromise<void> : Prisma.LogEvent) => void): PrismaClient;`;
6334
+ } else {
6335
+ return `$on<V extends U>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;`;
6336
+ }
6337
+ }
5535
6338
  var PrismaClientClass = class {
5536
- constructor(context, internalDatasources, outputDir, runtimeName, browser) {
6339
+ constructor(context, internalDatasources, outputDir, runtimeNameTs, browser) {
5537
6340
  this.context = context;
5538
6341
  this.internalDatasources = internalDatasources;
5539
6342
  this.outputDir = outputDir;
5540
- this.runtimeName = runtimeName;
6343
+ this.runtimeNameTs = runtimeNameTs;
5541
6344
  this.browser = browser;
5542
6345
  }
5543
6346
  get jsDoc() {
@@ -5563,7 +6366,7 @@ var PrismaClientClass = class {
5563
6366
  * \`\`\`
5564
6367
  *
5565
6368
  *
5566
- * Read more in our [docs](https://pris.ly/d/client).
6369
+ * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
5567
6370
  */`;
5568
6371
  }
5569
6372
  toTSWithoutNamespace() {
@@ -5576,10 +6379,10 @@ export class PrismaClient<
5576
6379
  > {
5577
6380
  [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
5578
6381
 
5579
- ${(0, import_indent_string6.default)(this.jsDoc, TAB_SIZE)}
6382
+ ${(0, import_indent_string7.default)(this.jsDoc, TAB_SIZE)}
5580
6383
 
5581
6384
  constructor(optionsArg ?: Prisma.Subset<ClientOptions, Prisma.PrismaClientOptions>);
5582
- $on<V extends U>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
6385
+ ${eventRegistrationMethodDeclaration(this.runtimeNameTs)}
5583
6386
 
5584
6387
  /**
5585
6388
  * Connect with the database
@@ -5598,10 +6401,12 @@ ${[
5598
6401
  batchingTransactionDefinition(this.context),
5599
6402
  interactiveTransactionDefinition(this.context),
5600
6403
  runCommandRawDefinition(this.context),
6404
+ metricDefinition(this.context),
6405
+ applyPendingMigrationsDefinition.bind(this)(),
5601
6406
  extendsPropertyDefinition()
5602
6407
  ].filter((d) => d !== null).join("\n").trim()}
5603
6408
 
5604
- ${(0, import_indent_string6.default)(
6409
+ ${(0, import_indent_string7.default)(
5605
6410
  dmmf.mappings.modelOperations.filter((m) => m.findMany).map((m) => {
5606
6411
  let methodName = (0, import_client_common15.uncapitalize)(m.model);
5607
6412
  if (methodName === "constructor") {
@@ -5624,7 +6429,8 @@ get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`;
5624
6429
  }
5625
6430
  toTS() {
5626
6431
  const clientOptions = this.buildClientOptions();
5627
- return `${clientExtensionsDefinitions(this.context)}
6432
+ return `${new Datasources(this.internalDatasources).toTS()}
6433
+ ${clientExtensionsDefinitions(this.context)}
5628
6434
  export type DefaultPrismaClient = PrismaClient
5629
6435
  export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
5630
6436
  ${ts11.stringify(ts11.moduleExport(clientOptions))}
@@ -5697,6 +6503,10 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5697
6503
  }
5698
6504
  buildClientOptions() {
5699
6505
  const clientOptions = ts11.interfaceDeclaration("PrismaClientOptions").add(
6506
+ ts11.property("datasources", ts11.namedType("Datasources")).optional().setDocComment(ts11.docComment("Overwrites the datasource url from your schema.prisma file"))
6507
+ ).add(
6508
+ ts11.property("datasourceUrl", ts11.stringType).optional().setDocComment(ts11.docComment("Overwrites the datasource url from your schema.prisma file"))
6509
+ ).add(
5700
6510
  ts11.property("errorFormat", ts11.namedType("ErrorFormat")).optional().setDocComment(ts11.docComment('@default "colorless"'))
5701
6511
  ).add(
5702
6512
  ts11.property("log", ts11.array(ts11.unionType([ts11.namedType("LogLevel"), ts11.namedType("LogDefinition")]))).optional().setDocComment(ts11.docComment`
@@ -5721,7 +6531,7 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5721
6531
  { emit: 'stdout', level: 'error' }
5722
6532
  ]
5723
6533
  \`\`\`
5724
- Read more in our [docs](https://pris.ly/d/logging).
6534
+ Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
5725
6535
  `)
5726
6536
  );
5727
6537
  const transactionOptions = ts11.objectType().add(ts11.property("maxWait", ts11.numberType).optional()).add(ts11.property("timeout", ts11.numberType).optional());
@@ -5735,23 +6545,14 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5735
6545
  timeout ?= 5000
5736
6546
  `)
5737
6547
  );
5738
- if (
5739
- // We don't support a custom adapter with MongoDB for now.
5740
- this.internalDatasources.some((d) => d.provider !== "mongodb")
5741
- ) {
6548
+ if (["library.js", "client.js"].includes(this.runtimeNameTs) && // We don't support a custom adapter with MongoDB for now.
6549
+ this.internalDatasources.some((d) => d.provider !== "mongodb")) {
5742
6550
  clientOptions.add(
5743
- ts11.property("adapter", ts11.namedType("runtime.SqlDriverAdapterFactory")).optional().setDocComment(
6551
+ ts11.property("adapter", ts11.unionType([ts11.namedType("runtime.SqlDriverAdapterFactory"), ts11.namedType("null")])).optional().setDocComment(
5744
6552
  ts11.docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`")
5745
6553
  )
5746
6554
  );
5747
6555
  }
5748
- clientOptions.add(
5749
- ts11.property("accelerateUrl", ts11.stringType).optional().setDocComment(
5750
- ts11.docComment(
5751
- "Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."
5752
- )
5753
- )
5754
- );
5755
6556
  clientOptions.add(
5756
6557
  ts11.property("omit", ts11.namedType("Prisma.GlobalOmitConfig")).optional().setDocComment(ts11.docComment`
5757
6558
  Global configuration for omitting model fields by default.
@@ -5768,25 +6569,6 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5768
6569
  \`\`\`
5769
6570
  `)
5770
6571
  );
5771
- if (this.context.isSqlProvider()) {
5772
- clientOptions.add(
5773
- ts11.property("comments", ts11.array(ts11.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts11.docComment`
5774
- SQL commenter plugins that add metadata to SQL queries as comments.
5775
- Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
5776
-
5777
- @example
5778
- \`\`\`
5779
- const prisma = new PrismaClient({
5780
- adapter,
5781
- comments: [
5782
- traceContext(),
5783
- queryInsights(),
5784
- ],
5785
- })
5786
- \`\`\`
5787
- `)
5788
- );
5789
- }
5790
6572
  return clientOptions;
5791
6573
  }
5792
6574
  };
@@ -5801,33 +6583,61 @@ var TSClient = class {
5801
6583
  dmmf;
5802
6584
  genericsInfo;
5803
6585
  toJS() {
5804
- const { edge, wasm, generator, datamodel: inlineSchema, runtimeName, reusedJs } = this.options;
6586
+ const {
6587
+ edge,
6588
+ wasm,
6589
+ binaryPaths,
6590
+ generator,
6591
+ outputDir,
6592
+ datamodel: inlineSchema,
6593
+ runtimeBase,
6594
+ runtimeNameJs,
6595
+ datasources,
6596
+ copyEngine = true,
6597
+ reusedJs,
6598
+ envPaths
6599
+ } = this.options;
5805
6600
  if (reusedJs) {
5806
6601
  return `module.exports = { ...require('${reusedJs}') }`;
5807
6602
  }
6603
+ const relativeEnvPaths = {
6604
+ rootEnvPath: envPaths.rootEnvPath && (0, import_internals7.pathToPosix)(import_path2.default.relative(outputDir, envPaths.rootEnvPath)),
6605
+ schemaEnvPath: envPaths.schemaEnvPath && (0, import_internals7.pathToPosix)(import_path2.default.relative(outputDir, envPaths.schemaEnvPath))
6606
+ };
6607
+ const clientEngineType = (0, import_internals7.getClientEngineType)(generator);
6608
+ generator.config.engineType = clientEngineType;
6609
+ const binaryTargets = clientEngineType === import_internals7.ClientEngineType.Library ? Object.keys(binaryPaths.libqueryEngine ?? {}) : Object.keys(binaryPaths.queryEngine ?? {});
6610
+ const inlineSchemaHash = import_crypto.default.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex");
6611
+ const datasourceFilePath = datasources[0].sourceFilePath;
5808
6612
  const config = {
5809
- previewFeatures: generator.previewFeatures,
6613
+ generator,
6614
+ relativeEnvPaths,
6615
+ relativePath: (0, import_internals7.pathToPosix)(import_path2.default.relative(outputDir, import_path2.default.dirname(datasourceFilePath))),
5810
6616
  clientVersion: this.options.clientVersion,
5811
6617
  engineVersion: this.options.engineVersion,
6618
+ datasourceNames: datasources.map((d) => d.name),
5812
6619
  activeProvider: this.options.activeProvider,
5813
- inlineSchema
6620
+ postinstall: this.options.postinstall,
6621
+ ciName: import_ci_info.default.name ?? void 0,
6622
+ inlineDatasources: buildInlineDatasources(datasources),
6623
+ inlineSchema,
6624
+ inlineSchemaHash,
6625
+ copyEngine
5814
6626
  };
6627
+ const relativeOutdir = import_path2.default.relative(process.cwd(), outputDir);
5815
6628
  const code = `${commonCodeJS({ ...this.options, browser: false })}
5816
6629
  ${buildRequirePath(edge)}
5817
6630
 
5818
6631
  /**
5819
6632
  * Enums
5820
6633
  */
5821
- ${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), true).toJS()).join("\n\n")}
6634
+ ${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
5822
6635
  ${this.dmmf.datamodel.enums.map((datamodelEnum) => new Enum((0, import_dmmf.datamodelEnumToSchemaEnum)(datamodelEnum), false).toJS()).join("\n\n")}
5823
6636
 
5824
6637
  ${new Enum(
5825
6638
  {
5826
6639
  name: "ModelName",
5827
- data: this.dmmf.mappings.modelOperations.map((m) => ({
5828
- key: m.model,
5829
- value: m.model
5830
- }))
6640
+ values: this.dmmf.mappings.modelOperations.map((m) => m.model)
5831
6641
  },
5832
6642
  true
5833
6643
  ).toJS()}
@@ -5835,12 +6645,17 @@ ${new Enum(
5835
6645
  * Create the Client
5836
6646
  */
5837
6647
  const config = ${JSON.stringify(config, null, 2)}
5838
- ${buildRuntimeDataModel(this.dmmf.datamodel, runtimeName)}
5839
- ${buildQueryCompilerWasmModule(wasm, runtimeName)}
6648
+ ${buildDirname(edge, relativeOutdir)}
6649
+ ${buildRuntimeDataModel(this.dmmf.datamodel, runtimeNameJs)}
6650
+ ${buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs)}
6651
+ ${buildQueryCompilerWasmModule(wasm, runtimeNameJs)}
6652
+ ${buildInjectableEdgeEnv(edge, datasources)}
6653
+ ${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
5840
6654
  ${buildDebugInitialization(edge)}
5841
6655
  const PrismaClient = getPrismaClient(config)
5842
6656
  exports.PrismaClient = PrismaClient
5843
6657
  Object.assign(exports, Prisma)
6658
+ ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
5844
6659
  `;
5845
6660
  return code;
5846
6661
  }
@@ -5853,14 +6668,13 @@ Object.assign(exports, Prisma)
5853
6668
  const context = new GenerateContext({
5854
6669
  dmmf: this.dmmf,
5855
6670
  genericArgsInfo: this.genericsInfo,
5856
- generator: this.options.generator,
5857
- provider: this.options.activeProvider
6671
+ generator: this.options.generator
5858
6672
  });
5859
6673
  const prismaClientClass = new PrismaClientClass(
5860
6674
  context,
5861
6675
  this.options.datasources,
5862
6676
  this.options.outputDir,
5863
- this.options.runtimeName,
6677
+ this.options.runtimeNameTs,
5864
6678
  this.options.browser
5865
6679
  );
5866
6680
  const commonCode = commonCodeTS(this.options);
@@ -5870,9 +6684,7 @@ Object.assign(exports, Prisma)
5870
6684
  }
5871
6685
  return acc;
5872
6686
  }, []);
5873
- const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map(
5874
- (type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), true).toTS()
5875
- );
6687
+ const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toTS());
5876
6688
  const modelEnums = [];
5877
6689
  const modelEnumsAliases = [];
5878
6690
  for (const datamodelEnum of this.dmmf.datamodel.enums) {
@@ -5909,15 +6721,12 @@ ${modelEnumsAliases.join("\n\n")}
5909
6721
  ${prismaClientClass.toTSWithoutNamespace()}
5910
6722
 
5911
6723
  export namespace Prisma {
5912
- ${(0, import_indent_string7.default)(
6724
+ ${(0, import_indent_string8.default)(
5913
6725
  `${commonCode.ts()}
5914
6726
  ${new Enum(
5915
6727
  {
5916
6728
  name: "ModelName",
5917
- data: this.dmmf.mappings.modelOperations.map((m) => ({
5918
- key: m.model,
5919
- value: m.model
5920
- }))
6729
+ values: this.dmmf.mappings.modelOperations.map((m) => m.model)
5921
6730
  },
5922
6731
  true
5923
6732
  ).toTS()}
@@ -5994,23 +6803,20 @@ export const dmmf: runtime.BaseDMMF
5994
6803
  toBrowserJS() {
5995
6804
  const code = `${commonCodeJS({
5996
6805
  ...this.options,
5997
- runtimeName: "index-browser",
6806
+ runtimeNameJs: "index-browser",
5998
6807
  browser: true
5999
6808
  })}
6000
6809
  /**
6001
6810
  * Enums
6002
6811
  */
6003
6812
 
6004
- ${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), true).toJS()).join("\n\n")}
6005
- ${this.dmmf.schema.enumTypes.model?.map((type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), false).toJS()).join("\n\n") ?? ""}
6813
+ ${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
6814
+ ${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(type, false).toJS()).join("\n\n") ?? ""}
6006
6815
 
6007
6816
  ${new Enum(
6008
6817
  {
6009
6818
  name: "ModelName",
6010
- data: this.dmmf.mappings.modelOperations.map((m) => ({
6011
- key: m.model,
6012
- value: m.model
6013
- }))
6819
+ values: this.dmmf.mappings.modelOperations.map((m) => m.model)
6014
6820
  },
6015
6821
  true
6016
6822
  ).toJS()}
@@ -6051,7 +6857,7 @@ Object.assign(exports, Prisma)
6051
6857
  };
6052
6858
 
6053
6859
  // src/typedSql/buildDbEnums.ts
6054
- var import_internals5 = require("@prisma/internals");
6860
+ var import_internals8 = require("@prisma/internals");
6055
6861
  var ts13 = __toESM(require("@prisma/ts-builders"));
6056
6862
  var DbEnumsList = class {
6057
6863
  enums;
@@ -6069,14 +6875,14 @@ var DbEnumsList = class {
6069
6875
  }
6070
6876
  *validJsIdentifiers() {
6071
6877
  for (const dbEnum of this.enums) {
6072
- if ((0, import_internals5.isValidJsIdentifier)(dbEnum.name)) {
6878
+ if ((0, import_internals8.isValidJsIdentifier)(dbEnum.name)) {
6073
6879
  yield dbEnum;
6074
6880
  }
6075
6881
  }
6076
6882
  }
6077
6883
  *invalidJsIdentifiers() {
6078
6884
  for (const dbEnum of this.enums) {
6079
- if (!(0, import_internals5.isValidJsIdentifier)(dbEnum.name)) {
6885
+ if (!(0, import_internals8.isValidJsIdentifier)(dbEnum.name)) {
6080
6886
  yield dbEnum;
6081
6887
  }
6082
6888
  }
@@ -6148,7 +6954,7 @@ var ts16 = __toESM(require("@prisma/ts-builders"));
6148
6954
  var import_ts_builders3 = require("@prisma/ts-builders");
6149
6955
 
6150
6956
  // src/typedSql/mapTypes.ts
6151
- var import_internals6 = require("@prisma/internals");
6957
+ var import_internals9 = require("@prisma/internals");
6152
6958
  var ts15 = __toESM(require("@prisma/ts-builders"));
6153
6959
  var decimal = ts15.namedType("$runtime.Decimal");
6154
6960
  var uint8Array = ts15.namedType("$runtime.Bytes");
@@ -6242,7 +7048,7 @@ function getMappingConfig(introspectionType, enums) {
6242
7048
  return config;
6243
7049
  }
6244
7050
  function getEnumType(name) {
6245
- if ((0, import_internals6.isValidJsIdentifier)(name)) {
7051
+ if ((0, import_internals9.isValidJsIdentifier)(name)) {
6246
7052
  return ts15.namedType(`$DbEnums.${name}`);
6247
7053
  }
6248
7054
  return ts15.namedType("$DbEnums").subKey(name);
@@ -6348,13 +7154,14 @@ function addPreamble(fileContent) {
6348
7154
  }
6349
7155
 
6350
7156
  // src/generateClient.ts
7157
+ var debug = (0, import_debug.Debug)("prisma:client:generateClient");
6351
7158
  var DenylistError = class extends Error {
6352
7159
  constructor(message) {
6353
7160
  super(message);
6354
7161
  this.stack = void 0;
6355
7162
  }
6356
7163
  };
6357
- (0, import_internals7.setClassName)(DenylistError, "DenylistError");
7164
+ (0, import_internals10.setClassName)(DenylistError, "DenylistError");
6358
7165
  async function buildClient({
6359
7166
  schemaPath,
6360
7167
  runtimeBase,
@@ -6368,10 +7175,15 @@ async function buildClient({
6368
7175
  engineVersion,
6369
7176
  clientVersion,
6370
7177
  activeProvider,
7178
+ postinstall,
7179
+ copyEngine,
7180
+ envPaths,
6371
7181
  typedSql
6372
7182
  }) {
7183
+ const clientEngineType = (0, import_internals10.getClientEngineType)(generator);
6373
7184
  const baseClientOptions = {
6374
7185
  dmmf: getPrismaClientDMMF(dmmf),
7186
+ envPaths: envPaths ?? { rootEnvPath: null, schemaEnvPath: void 0 },
6375
7187
  datasources,
6376
7188
  generator,
6377
7189
  binaryPaths,
@@ -6382,6 +7194,8 @@ async function buildClient({
6382
7194
  clientVersion,
6383
7195
  engineVersion,
6384
7196
  activeProvider,
7197
+ postinstall,
7198
+ copyEngine,
6385
7199
  datamodel,
6386
7200
  browser: false,
6387
7201
  edge: false,
@@ -6389,7 +7203,8 @@ async function buildClient({
6389
7203
  };
6390
7204
  const nodeClientOptions = {
6391
7205
  ...baseClientOptions,
6392
- runtimeName: "client"
7206
+ runtimeNameJs: getNodeRuntimeName(clientEngineType),
7207
+ runtimeNameTs: `${getNodeRuntimeName(clientEngineType)}.js`
6393
7208
  };
6394
7209
  const nodeClient = new TSClient(nodeClientOptions);
6395
7210
  const defaultClient = new TSClient({
@@ -6397,6 +7212,19 @@ async function buildClient({
6397
7212
  reusedTs: "index",
6398
7213
  reusedJs: "."
6399
7214
  });
7215
+ const edgeClient = new TSClient({
7216
+ ...baseClientOptions,
7217
+ runtimeNameJs: "edge",
7218
+ runtimeNameTs: "library.js",
7219
+ reusedTs: "default",
7220
+ edge: true
7221
+ });
7222
+ const rnTsClient = new TSClient({
7223
+ ...baseClientOptions,
7224
+ runtimeNameJs: "react-native",
7225
+ runtimeNameTs: "react-native",
7226
+ edge: true
7227
+ });
6400
7228
  const trampolineTsClient = new TSClient({
6401
7229
  ...nodeClientOptions,
6402
7230
  reusedTs: "index",
@@ -6404,9 +7232,9 @@ async function buildClient({
6404
7232
  });
6405
7233
  const exportsMapBase = {
6406
7234
  node: "./index.js",
6407
- "edge-light": "./edge.js",
6408
- workerd: "./edge.js",
6409
- worker: "./edge.js",
7235
+ "edge-light": "./wasm.js",
7236
+ workerd: "./wasm.js",
7237
+ worker: "./wasm.js",
6410
7238
  browser: "./index-browser.js",
6411
7239
  default: "./index.js"
6412
7240
  };
@@ -6430,10 +7258,7 @@ async function buildClient({
6430
7258
  ".": exportsMapDefault
6431
7259
  },
6432
7260
  version: clientVersion,
6433
- sideEffects: false,
6434
- dependencies: {
6435
- "@prisma/client-runtime-utils": clientVersion
6436
- }
7261
+ sideEffects: false
6437
7262
  };
6438
7263
  const fileMap = {};
6439
7264
  fileMap["index.js"] = JS(nodeClient);
@@ -6441,16 +7266,28 @@ async function buildClient({
6441
7266
  fileMap["default.js"] = JS(defaultClient);
6442
7267
  fileMap["default.d.ts"] = TS(defaultClient);
6443
7268
  fileMap["index-browser.js"] = BrowserJS(nodeClient);
7269
+ fileMap["edge.js"] = JS(edgeClient);
7270
+ fileMap["edge.d.ts"] = TS(edgeClient);
6444
7271
  fileMap["client.js"] = JS(defaultClient);
6445
7272
  fileMap["client.d.ts"] = TS(defaultClient);
7273
+ if (generator.previewFeatures.includes("reactNative")) {
7274
+ fileMap["react-native.js"] = JS(rnTsClient);
7275
+ fileMap["react-native.d.ts"] = TS(rnTsClient);
7276
+ }
7277
+ const usesClientEngine = clientEngineType === import_internals10.ClientEngineType.Client;
6446
7278
  fileMap["default.js"] = JS(trampolineTsClient);
6447
7279
  fileMap["default.d.ts"] = TS(trampolineTsClient);
6448
- fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
6449
- fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
7280
+ if (usesClientEngine) {
7281
+ fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
7282
+ fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
7283
+ } else {
7284
+ fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`;
7285
+ fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_engine_bg.wasm?module')`;
7286
+ }
6450
7287
  pkgJson["browser"] = "default.js";
6451
7288
  pkgJson["imports"] = {
6452
- // when `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
6453
- "#wasm-compiler-loader": {
7289
+ // when `import('#wasm-engine-loader')` or `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
7290
+ [usesClientEngine ? "#wasm-compiler-loader" : "#wasm-engine-loader"]: {
6454
7291
  // Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
6455
7292
  /**
6456
7293
  * Vercel Edge Functions / Next.js Middlewares
@@ -6475,15 +7312,16 @@ async function buildClient({
6475
7312
  };
6476
7313
  const wasmClient = new TSClient({
6477
7314
  ...baseClientOptions,
6478
- runtimeName: "wasm-compiler-edge",
7315
+ runtimeNameJs: usesClientEngine ? "wasm-compiler-edge" : "wasm-engine-edge",
7316
+ runtimeNameTs: "library.js",
6479
7317
  reusedTs: "default",
6480
7318
  edge: true,
6481
7319
  wasm: true
6482
7320
  });
6483
- fileMap["edge.js"] = JS(wasmClient);
6484
- fileMap["edge.d.ts"] = TS(wasmClient);
7321
+ fileMap["wasm.js"] = JS(wasmClient);
7322
+ fileMap["wasm.d.ts"] = TS(wasmClient);
6485
7323
  if (typedSql && typedSql.length > 0) {
6486
- const edgeRuntimeName = "wasm-compiler-edge";
7324
+ const edgeRuntimeName = usesClientEngine ? "wasm-compiler-edge" : "edge";
6487
7325
  const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
6488
7326
  const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
6489
7327
  pkgJson.exports["./sql"] = {
@@ -6508,7 +7346,7 @@ async function buildClient({
6508
7346
  fileMap["sql"] = buildTypedSql({
6509
7347
  dmmf,
6510
7348
  runtimeBase: getTypedSqlRuntimeBase(runtimeBase),
6511
- mainRuntimeName: "client",
7349
+ mainRuntimeName: getNodeRuntimeName(clientEngineType),
6512
7350
  queries: typedSql,
6513
7351
  edgeRuntimeName
6514
7352
  });
@@ -6531,11 +7369,20 @@ function getTypedSqlRuntimeBase(runtimeBase) {
6531
7369
  }
6532
7370
  return `../${runtimeBase}`;
6533
7371
  }
6534
- function getDefaultOutdir(outputDir) {
6535
- if (outputDir.endsWith(import_path.default.normalize("node_modules/@prisma/client"))) {
6536
- return import_path.default.join(outputDir, "../../.prisma/client");
7372
+ async function getDefaultOutdir(outputDir) {
7373
+ if (outputDir.endsWith(import_path3.default.normalize("node_modules/@prisma/client"))) {
7374
+ return import_path3.default.join(outputDir, "../../.prisma/client");
7375
+ }
7376
+ if (process.env.INIT_CWD && process.env.npm_lifecycle_event === "postinstall" && !process.env.PWD?.includes(".pnpm")) {
7377
+ if ((0, import_fs.existsSync)(import_path3.default.join(process.env.INIT_CWD, "package.json"))) {
7378
+ return import_path3.default.join(process.env.INIT_CWD, "node_modules/.prisma/client");
7379
+ }
7380
+ const packagePath = await (0, import_package_up.packageUp)({ cwd: process.env.INIT_CWD });
7381
+ if (packagePath) {
7382
+ return import_path3.default.join(import_path3.default.dirname(packagePath), "node_modules/.prisma/client");
7383
+ }
6537
7384
  }
6538
- return import_path.default.join(outputDir, "../../.prisma/client");
7385
+ return import_path3.default.join(outputDir, "../../.prisma/client");
6539
7386
  }
6540
7387
  async function generateClient(options) {
6541
7388
  const {
@@ -6552,8 +7399,12 @@ async function generateClient(options) {
6552
7399
  clientVersion,
6553
7400
  engineVersion,
6554
7401
  activeProvider,
7402
+ postinstall,
7403
+ envPaths,
7404
+ copyEngine = true,
6555
7405
  typedSql
6556
7406
  } = options;
7407
+ const clientEngineType = (0, import_internals10.getClientEngineType)(generator);
6557
7408
  const { runtimeBase, outputDir } = await getGenerationDirs(options);
6558
7409
  const { prismaClientDmmf, fileMap } = await buildClient({
6559
7410
  datamodel,
@@ -6568,7 +7419,10 @@ async function generateClient(options) {
6568
7419
  clientVersion,
6569
7420
  engineVersion,
6570
7421
  activeProvider,
7422
+ postinstall,
7423
+ copyEngine,
6571
7424
  testMode,
7425
+ envPaths,
6572
7426
  typedSql
6573
7427
  });
6574
7428
  const provider = datasources[0].provider;
@@ -6585,32 +7439,51 @@ async function generateClient(options) {
6585
7439
  To learn more about how to rename models, check out https://pris.ly/d/naming-models`;
6586
7440
  throw new DenylistError(message);
6587
7441
  }
7442
+ if (!copyEngine) {
7443
+ await deleteOutputDir(outputDir);
7444
+ }
6588
7445
  await (0, import_fs_extra.ensureDir)(outputDir);
6589
7446
  await writeFileMap(outputDir, fileMap);
6590
7447
  if (copyRuntime || generator.isCustomOutput === true) {
6591
- const copiedRuntimeDir = import_path.default.join(outputDir, "runtime");
7448
+ const copiedRuntimeDir = import_path3.default.join(outputDir, "runtime");
6592
7449
  await (0, import_fs_extra.ensureDir)(copiedRuntimeDir);
6593
7450
  await copyRuntimeFiles({
6594
7451
  from: runtimeSourcePath,
6595
7452
  to: copiedRuntimeDir,
6596
7453
  sourceMaps: copyRuntimeSourceMaps,
6597
- runtimeName: "client"
7454
+ runtimeName: getNodeRuntimeName(clientEngineType)
6598
7455
  });
6599
7456
  }
6600
- const schemaTargetPath = import_path.default.join(outputDir, "schema.prisma");
7457
+ const enginePath = clientEngineType === import_internals10.ClientEngineType.Library ? binaryPaths.libqueryEngine : binaryPaths.queryEngine;
7458
+ if (copyEngine && enginePath) {
7459
+ if (process.env.NETLIFY) {
7460
+ await (0, import_fs_extra.ensureDir)("/tmp/prisma-engines");
7461
+ }
7462
+ for (const [binaryTarget, filePath] of Object.entries(enginePath)) {
7463
+ const fileName = import_path3.default.basename(filePath);
7464
+ let target;
7465
+ if (process.env.NETLIFY && !["rhel-openssl-1.0.x", "rhel-openssl-3.0.x"].includes(binaryTarget)) {
7466
+ target = import_path3.default.join("/tmp/prisma-engines", fileName);
7467
+ } else {
7468
+ target = import_path3.default.join(outputDir, fileName);
7469
+ }
7470
+ await (0, import_fetch_engine.overwriteFile)(filePath, target);
7471
+ }
7472
+ }
7473
+ const schemaTargetPath = import_path3.default.join(outputDir, "schema.prisma");
6601
7474
  await import_promises.default.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" });
6602
- if (isWasmEngineSupported(provider)) {
7475
+ const runtimeNeedsWasmEngine = clientEngineType === import_internals10.ClientEngineType.Client || copyEngine;
7476
+ if (runtimeNeedsWasmEngine && isWasmEngineSupported(provider) && !testMode) {
6603
7477
  const suffix = provider === "postgres" ? "postgresql" : provider;
6604
- const filename = "query_compiler_bg";
6605
- const wasmJsBundlePath = import_path.default.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
7478
+ const filename = clientEngineType === import_internals10.ClientEngineType.Client ? "query_compiler_bg" : "query_engine_bg";
7479
+ const wasmJsBundlePath = import_path3.default.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
6606
7480
  const wasmBase64 = require(wasmJsBundlePath).wasm;
6607
- await import_promises.default.writeFile(import_path.default.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
6608
- await import_promises.default.copyFile(import_path.default.join(runtimeSourcePath, `${filename}.${suffix}.js`), import_path.default.join(outputDir, `${filename}.js`));
6609
- await import_promises.default.copyFile(wasmJsBundlePath, import_path.default.join(outputDir, `${filename}.wasm-base64.js`));
7481
+ await import_promises.default.writeFile(import_path3.default.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
7482
+ await import_promises.default.copyFile(import_path3.default.join(runtimeSourcePath, `${filename}.${suffix}.js`), import_path3.default.join(outputDir, `${filename}.js`));
6610
7483
  }
6611
7484
  try {
6612
7485
  const prismaCache = (0, import_env_paths.default)("prisma").cache;
6613
- const signalsPath = import_path.default.join(prismaCache, "last-generate");
7486
+ const signalsPath = import_path3.default.join(prismaCache, "last-generate");
6614
7487
  await import_promises.default.mkdir(prismaCache, { recursive: true });
6615
7488
  await import_promises.default.writeFile(signalsPath, Date.now().toString());
6616
7489
  } catch {
@@ -6619,7 +7492,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
6619
7492
  function writeFileMap(outputDir, fileMap) {
6620
7493
  return Promise.all(
6621
7494
  Object.entries(fileMap).map(async ([fileName, content]) => {
6622
- const absolutePath = import_path.default.join(outputDir, fileName);
7495
+ const absolutePath = import_path3.default.join(outputDir, fileName);
6623
7496
  await import_promises.default.rm(absolutePath, { recursive: true, force: true });
6624
7497
  if (typeof content === "string") {
6625
7498
  await import_promises.default.writeFile(absolutePath, content);
@@ -6631,7 +7504,7 @@ function writeFileMap(outputDir, fileMap) {
6631
7504
  );
6632
7505
  }
6633
7506
  function isWasmEngineSupported(provider) {
6634
- return provider === "postgresql" || provider === "postgres" || provider === "cockroachdb" || provider === "mysql" || provider === "sqlite" || provider === "sqlserver";
7507
+ return provider === "postgresql" || provider === "postgres" || provider === "mysql" || provider === "sqlite" || provider === "sqlserver";
6635
7508
  }
6636
7509
  function validateDmmfAgainstDenylists(prismaClientDmmf) {
6637
7510
  const errorArray = [];
@@ -6719,18 +7592,18 @@ async function getGenerationDirs({
6719
7592
  testMode
6720
7593
  }) {
6721
7594
  const isCustomOutput = generator.isCustomOutput === true;
6722
- const normalizedOutputDir = import_path.default.normalize(outputDir);
7595
+ const normalizedOutputDir = import_path3.default.normalize(outputDir);
6723
7596
  let userRuntimeImport = isCustomOutput ? "./runtime" : "@prisma/client/runtime";
6724
- let userOutputDir = isCustomOutput ? normalizedOutputDir : getDefaultOutdir(normalizedOutputDir);
7597
+ let userOutputDir = isCustomOutput ? normalizedOutputDir : await getDefaultOutdir(normalizedOutputDir);
6725
7598
  if (testMode && runtimeBase) {
6726
7599
  userOutputDir = outputDir;
6727
- userRuntimeImport = (0, import_internals7.pathToPosix)(runtimeBase);
7600
+ userRuntimeImport = (0, import_internals10.pathToPosix)(runtimeBase);
6728
7601
  }
6729
7602
  if (isCustomOutput) {
6730
7603
  await verifyOutputDirectory(userOutputDir, datamodel, schemaPath);
6731
7604
  }
6732
- const userPackageRoot = await (0, import_package_up.packageUp)({ cwd: import_path.default.dirname(userOutputDir) });
6733
- const userProjectRoot = userPackageRoot ? import_path.default.dirname(userPackageRoot) : process.cwd();
7605
+ const userPackageRoot = await (0, import_package_up.packageUp)({ cwd: import_path3.default.dirname(userOutputDir) });
7606
+ const userProjectRoot = userPackageRoot ? import_path3.default.dirname(userPackageRoot) : process.cwd();
6734
7607
  return {
6735
7608
  runtimeBase: userRuntimeImport,
6736
7609
  outputDir: userOutputDir,
@@ -6740,7 +7613,7 @@ async function getGenerationDirs({
6740
7613
  async function verifyOutputDirectory(directory, datamodel, schemaPath) {
6741
7614
  let content;
6742
7615
  try {
6743
- content = await import_promises.default.readFile(import_path.default.join(directory, "package.json"), "utf8");
7616
+ content = await import_promises.default.readFile(import_path3.default.join(directory, "package.json"), "utf8");
6744
7617
  } catch (e) {
6745
7618
  if (e.code === "ENOENT") {
6746
7619
  return;
@@ -6783,17 +7656,43 @@ function findOutputPathDeclaration(datamodel) {
6783
7656
  }
6784
7657
  return null;
6785
7658
  }
7659
+ function getNodeRuntimeName(engineType) {
7660
+ if (engineType === import_internals10.ClientEngineType.Binary) {
7661
+ return "binary";
7662
+ }
7663
+ if (engineType === import_internals10.ClientEngineType.Library) {
7664
+ return "library";
7665
+ }
7666
+ if (engineType === import_internals10.ClientEngineType.Client) {
7667
+ return "client";
7668
+ }
7669
+ (0, import_internals10.assertNever)(engineType, "Unknown engine type");
7670
+ }
6786
7671
  async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
6787
- const files = ["index-browser.js", "index-browser.d.ts", "wasm-compiler-edge.js"];
7672
+ const files = [
7673
+ // library.d.ts is always included, as it contains the actual runtime type
7674
+ // definitions. Rest of the `runtime.d.ts` files just re-export everything
7675
+ // from `library.d.ts`
7676
+ "library.d.ts",
7677
+ "index-browser.js",
7678
+ "index-browser.d.ts",
7679
+ "edge.js",
7680
+ "edge-esm.js",
7681
+ "react-native.js",
7682
+ "wasm-engine-edge.js",
7683
+ "wasm-compiler-edge.js"
7684
+ ];
6788
7685
  files.push(`${runtimeName}.js`);
6789
- files.push(`${runtimeName}.d.ts`);
7686
+ if (runtimeName !== "library") {
7687
+ files.push(`${runtimeName}.d.ts`);
7688
+ }
6790
7689
  if (sourceMaps) {
6791
7690
  files.push(...files.filter((file4) => file4.endsWith(".js")).map((file4) => `${file4}.map`));
6792
7691
  }
6793
7692
  await Promise.all(
6794
7693
  files.map(async (file4) => {
6795
- const sourcePath = import_path.default.join(from, file4);
6796
- const targetPath = import_path.default.join(to, file4);
7694
+ const sourcePath = import_path3.default.join(from, file4);
7695
+ const targetPath = import_path3.default.join(to, file4);
6797
7696
  if (file4.endsWith(".js")) {
6798
7697
  const content = await import_promises.default.readFile(sourcePath, "utf-8");
6799
7698
  await import_promises.default.writeFile(targetPath, addPreamble(content));
@@ -6803,31 +7702,1651 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
6803
7702
  })
6804
7703
  );
6805
7704
  }
7705
+ async function deleteOutputDir(outputDir) {
7706
+ try {
7707
+ debug(`attempting to delete ${outputDir} recursively`);
7708
+ if (require(`${outputDir}/package.json`).name?.startsWith(GENERATED_PACKAGE_NAME_PREFIX)) {
7709
+ await import_promises.default.rmdir(outputDir, { recursive: true }).catch(() => {
7710
+ debug(`failed to delete ${outputDir} recursively`);
7711
+ });
7712
+ }
7713
+ } catch {
7714
+ debug(`failed to delete ${outputDir} recursively, not found`);
7715
+ }
7716
+ }
6806
7717
  function getUniquePackageName(datamodel) {
6807
- const hash = (0, import_crypto.createHash)("sha256");
7718
+ const hash = (0, import_crypto2.createHash)("sha256");
6808
7719
  hash.write(datamodel);
6809
7720
  return `${GENERATED_PACKAGE_NAME_PREFIX}${hash.digest().toString("hex")}`;
6810
7721
  }
6811
7722
  var GENERATED_PACKAGE_NAME_PREFIX = "prisma-client-";
6812
7723
 
6813
7724
  // src/generator.ts
6814
- var import_node_path2 = __toESM(require("node:path"));
7725
+ var import_node_path4 = __toESM(require("node:path"));
7726
+ var import_debug3 = require("@prisma/debug");
6815
7727
  var import_engines_version = require("@prisma/engines-version");
6816
- var import_internals9 = require("@prisma/internals");
7728
+ var import_internals12 = require("@prisma/internals");
7729
+ var import_ts_pattern = require("ts-pattern");
6817
7730
 
6818
7731
  // package.json
6819
- var version = "7.2.0-integration-engines-7-2-0-3-aqrln-zpupkzknszlw-04d61c41ec1a025cabe14093fa3121a5f45040ab.1";
7732
+ var version = "7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.1";
6820
7733
 
6821
7734
  // src/resolvePrismaClient.ts
6822
- var import_promises2 = __toESM(require("node:fs/promises"));
6823
- var import_node_path = __toESM(require("node:path"));
7735
+ var import_promises3 = __toESM(require("node:fs/promises"));
7736
+ var import_node_path3 = __toESM(require("node:path"));
6824
7737
  var import_ni = require("@antfu/ni");
6825
- var import_debug = require("@prisma/debug");
6826
- var import_internals8 = require("@prisma/internals");
6827
- var debug = (0, import_debug.Debug)("prisma:generator");
7738
+ var import_debug2 = require("@prisma/debug");
7739
+ var import_internals11 = require("@prisma/internals");
7740
+
7741
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
7742
+ var import_node_buffer2 = require("node:buffer");
7743
+ var import_node_path2 = __toESM(require("node:path"), 1);
7744
+ var import_node_child_process3 = __toESM(require("node:child_process"), 1);
7745
+ var import_node_process4 = __toESM(require("node:process"), 1);
7746
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
7747
+
7748
+ // ../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
7749
+ function stripFinalNewline(input) {
7750
+ const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
7751
+ const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
7752
+ if (input[input.length - 1] === LF) {
7753
+ input = input.slice(0, -1);
7754
+ }
7755
+ if (input[input.length - 1] === CR) {
7756
+ input = input.slice(0, -1);
7757
+ }
7758
+ return input;
7759
+ }
7760
+
7761
+ // ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
7762
+ var import_node_process = __toESM(require("node:process"), 1);
7763
+ var import_node_path = __toESM(require("node:path"), 1);
7764
+ var import_node_url = require("node:url");
7765
+
7766
+ // ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
7767
+ function pathKey(options = {}) {
7768
+ const {
7769
+ env = process.env,
7770
+ platform = process.platform
7771
+ } = options;
7772
+ if (platform !== "win32") {
7773
+ return "PATH";
7774
+ }
7775
+ return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
7776
+ }
7777
+
7778
+ // ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
7779
+ var npmRunPath = ({
7780
+ cwd = import_node_process.default.cwd(),
7781
+ path: pathOption = import_node_process.default.env[pathKey()],
7782
+ preferLocal = true,
7783
+ execPath = import_node_process.default.execPath,
7784
+ addExecPath = true
7785
+ } = {}) => {
7786
+ const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd;
7787
+ const cwdPath = import_node_path.default.resolve(cwdString);
7788
+ const result = [];
7789
+ if (preferLocal) {
7790
+ applyPreferLocal(result, cwdPath);
7791
+ }
7792
+ if (addExecPath) {
7793
+ applyExecPath(result, execPath, cwdPath);
7794
+ }
7795
+ return [...result, pathOption].join(import_node_path.default.delimiter);
7796
+ };
7797
+ var applyPreferLocal = (result, cwdPath) => {
7798
+ let previous;
7799
+ while (previous !== cwdPath) {
7800
+ result.push(import_node_path.default.join(cwdPath, "node_modules/.bin"));
7801
+ previous = cwdPath;
7802
+ cwdPath = import_node_path.default.resolve(cwdPath, "..");
7803
+ }
7804
+ };
7805
+ var applyExecPath = (result, execPath, cwdPath) => {
7806
+ const execPathString = execPath instanceof URL ? (0, import_node_url.fileURLToPath)(execPath) : execPath;
7807
+ result.push(import_node_path.default.resolve(cwdPath, execPathString, ".."));
7808
+ };
7809
+ var npmRunPathEnv = ({ env = import_node_process.default.env, ...options } = {}) => {
7810
+ env = { ...env };
7811
+ const pathName = pathKey({ env });
7812
+ options.path = env[pathName];
7813
+ env[pathName] = npmRunPath(options);
7814
+ return env;
7815
+ };
7816
+
7817
+ // ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
7818
+ var copyProperty = (to, from, property11, ignoreNonConfigurable) => {
7819
+ if (property11 === "length" || property11 === "prototype") {
7820
+ return;
7821
+ }
7822
+ if (property11 === "arguments" || property11 === "caller") {
7823
+ return;
7824
+ }
7825
+ const toDescriptor = Object.getOwnPropertyDescriptor(to, property11);
7826
+ const fromDescriptor = Object.getOwnPropertyDescriptor(from, property11);
7827
+ if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
7828
+ return;
7829
+ }
7830
+ Object.defineProperty(to, property11, fromDescriptor);
7831
+ };
7832
+ var canCopyProperty = function(toDescriptor, fromDescriptor) {
7833
+ return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
7834
+ };
7835
+ var changePrototype = (to, from) => {
7836
+ const fromPrototype = Object.getPrototypeOf(from);
7837
+ if (fromPrototype === Object.getPrototypeOf(to)) {
7838
+ return;
7839
+ }
7840
+ Object.setPrototypeOf(to, fromPrototype);
7841
+ };
7842
+ var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
7843
+ ${fromBody}`;
7844
+ var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
7845
+ var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
7846
+ var changeToString = (to, from, name) => {
7847
+ const withName = name === "" ? "" : `with ${name.trim()}() `;
7848
+ const newToString = wrappedToString.bind(null, withName, from.toString());
7849
+ Object.defineProperty(newToString, "name", toStringName);
7850
+ Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
7851
+ };
7852
+ function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
7853
+ const { name } = to;
7854
+ for (const property11 of Reflect.ownKeys(from)) {
7855
+ copyProperty(to, from, property11, ignoreNonConfigurable);
7856
+ }
7857
+ changePrototype(to, from);
7858
+ changeToString(to, from, name);
7859
+ return to;
7860
+ }
7861
+
7862
+ // ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
7863
+ var calledFunctions = /* @__PURE__ */ new WeakMap();
7864
+ var onetime = (function_, options = {}) => {
7865
+ if (typeof function_ !== "function") {
7866
+ throw new TypeError("Expected a function");
7867
+ }
7868
+ let returnValue;
7869
+ let callCount = 0;
7870
+ const functionName = function_.displayName || function_.name || "<anonymous>";
7871
+ const onetime2 = function(...arguments_) {
7872
+ calledFunctions.set(onetime2, ++callCount);
7873
+ if (callCount === 1) {
7874
+ returnValue = function_.apply(this, arguments_);
7875
+ function_ = null;
7876
+ } else if (options.throw === true) {
7877
+ throw new Error(`Function \`${functionName}\` can only be called once`);
7878
+ }
7879
+ return returnValue;
7880
+ };
7881
+ mimicFunction(onetime2, function_);
7882
+ calledFunctions.set(onetime2, callCount);
7883
+ return onetime2;
7884
+ };
7885
+ onetime.callCount = (function_) => {
7886
+ if (!calledFunctions.has(function_)) {
7887
+ throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
7888
+ }
7889
+ return calledFunctions.get(function_);
7890
+ };
7891
+ var onetime_default = onetime;
7892
+
7893
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
7894
+ var import_node_process2 = __toESM(require("node:process"), 1);
7895
+
7896
+ // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
7897
+ var import_node_os2 = require("node:os");
7898
+
7899
+ // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
7900
+ var getRealtimeSignals = () => {
7901
+ const length = SIGRTMAX - SIGRTMIN + 1;
7902
+ return Array.from({ length }, getRealtimeSignal);
7903
+ };
7904
+ var getRealtimeSignal = (value, index) => ({
7905
+ name: `SIGRT${index + 1}`,
7906
+ number: SIGRTMIN + index,
7907
+ action: "terminate",
7908
+ description: "Application-specific signal (realtime)",
7909
+ standard: "posix"
7910
+ });
7911
+ var SIGRTMIN = 34;
7912
+ var SIGRTMAX = 64;
7913
+
7914
+ // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
7915
+ var import_node_os = require("node:os");
7916
+
7917
+ // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
7918
+ var SIGNALS = [
7919
+ {
7920
+ name: "SIGHUP",
7921
+ number: 1,
7922
+ action: "terminate",
7923
+ description: "Terminal closed",
7924
+ standard: "posix"
7925
+ },
7926
+ {
7927
+ name: "SIGINT",
7928
+ number: 2,
7929
+ action: "terminate",
7930
+ description: "User interruption with CTRL-C",
7931
+ standard: "ansi"
7932
+ },
7933
+ {
7934
+ name: "SIGQUIT",
7935
+ number: 3,
7936
+ action: "core",
7937
+ description: "User interruption with CTRL-\\",
7938
+ standard: "posix"
7939
+ },
7940
+ {
7941
+ name: "SIGILL",
7942
+ number: 4,
7943
+ action: "core",
7944
+ description: "Invalid machine instruction",
7945
+ standard: "ansi"
7946
+ },
7947
+ {
7948
+ name: "SIGTRAP",
7949
+ number: 5,
7950
+ action: "core",
7951
+ description: "Debugger breakpoint",
7952
+ standard: "posix"
7953
+ },
7954
+ {
7955
+ name: "SIGABRT",
7956
+ number: 6,
7957
+ action: "core",
7958
+ description: "Aborted",
7959
+ standard: "ansi"
7960
+ },
7961
+ {
7962
+ name: "SIGIOT",
7963
+ number: 6,
7964
+ action: "core",
7965
+ description: "Aborted",
7966
+ standard: "bsd"
7967
+ },
7968
+ {
7969
+ name: "SIGBUS",
7970
+ number: 7,
7971
+ action: "core",
7972
+ description: "Bus error due to misaligned, non-existing address or paging error",
7973
+ standard: "bsd"
7974
+ },
7975
+ {
7976
+ name: "SIGEMT",
7977
+ number: 7,
7978
+ action: "terminate",
7979
+ description: "Command should be emulated but is not implemented",
7980
+ standard: "other"
7981
+ },
7982
+ {
7983
+ name: "SIGFPE",
7984
+ number: 8,
7985
+ action: "core",
7986
+ description: "Floating point arithmetic error",
7987
+ standard: "ansi"
7988
+ },
7989
+ {
7990
+ name: "SIGKILL",
7991
+ number: 9,
7992
+ action: "terminate",
7993
+ description: "Forced termination",
7994
+ standard: "posix",
7995
+ forced: true
7996
+ },
7997
+ {
7998
+ name: "SIGUSR1",
7999
+ number: 10,
8000
+ action: "terminate",
8001
+ description: "Application-specific signal",
8002
+ standard: "posix"
8003
+ },
8004
+ {
8005
+ name: "SIGSEGV",
8006
+ number: 11,
8007
+ action: "core",
8008
+ description: "Segmentation fault",
8009
+ standard: "ansi"
8010
+ },
8011
+ {
8012
+ name: "SIGUSR2",
8013
+ number: 12,
8014
+ action: "terminate",
8015
+ description: "Application-specific signal",
8016
+ standard: "posix"
8017
+ },
8018
+ {
8019
+ name: "SIGPIPE",
8020
+ number: 13,
8021
+ action: "terminate",
8022
+ description: "Broken pipe or socket",
8023
+ standard: "posix"
8024
+ },
8025
+ {
8026
+ name: "SIGALRM",
8027
+ number: 14,
8028
+ action: "terminate",
8029
+ description: "Timeout or timer",
8030
+ standard: "posix"
8031
+ },
8032
+ {
8033
+ name: "SIGTERM",
8034
+ number: 15,
8035
+ action: "terminate",
8036
+ description: "Termination",
8037
+ standard: "ansi"
8038
+ },
8039
+ {
8040
+ name: "SIGSTKFLT",
8041
+ number: 16,
8042
+ action: "terminate",
8043
+ description: "Stack is empty or overflowed",
8044
+ standard: "other"
8045
+ },
8046
+ {
8047
+ name: "SIGCHLD",
8048
+ number: 17,
8049
+ action: "ignore",
8050
+ description: "Child process terminated, paused or unpaused",
8051
+ standard: "posix"
8052
+ },
8053
+ {
8054
+ name: "SIGCLD",
8055
+ number: 17,
8056
+ action: "ignore",
8057
+ description: "Child process terminated, paused or unpaused",
8058
+ standard: "other"
8059
+ },
8060
+ {
8061
+ name: "SIGCONT",
8062
+ number: 18,
8063
+ action: "unpause",
8064
+ description: "Unpaused",
8065
+ standard: "posix",
8066
+ forced: true
8067
+ },
8068
+ {
8069
+ name: "SIGSTOP",
8070
+ number: 19,
8071
+ action: "pause",
8072
+ description: "Paused",
8073
+ standard: "posix",
8074
+ forced: true
8075
+ },
8076
+ {
8077
+ name: "SIGTSTP",
8078
+ number: 20,
8079
+ action: "pause",
8080
+ description: 'Paused using CTRL-Z or "suspend"',
8081
+ standard: "posix"
8082
+ },
8083
+ {
8084
+ name: "SIGTTIN",
8085
+ number: 21,
8086
+ action: "pause",
8087
+ description: "Background process cannot read terminal input",
8088
+ standard: "posix"
8089
+ },
8090
+ {
8091
+ name: "SIGBREAK",
8092
+ number: 21,
8093
+ action: "terminate",
8094
+ description: "User interruption with CTRL-BREAK",
8095
+ standard: "other"
8096
+ },
8097
+ {
8098
+ name: "SIGTTOU",
8099
+ number: 22,
8100
+ action: "pause",
8101
+ description: "Background process cannot write to terminal output",
8102
+ standard: "posix"
8103
+ },
8104
+ {
8105
+ name: "SIGURG",
8106
+ number: 23,
8107
+ action: "ignore",
8108
+ description: "Socket received out-of-band data",
8109
+ standard: "bsd"
8110
+ },
8111
+ {
8112
+ name: "SIGXCPU",
8113
+ number: 24,
8114
+ action: "core",
8115
+ description: "Process timed out",
8116
+ standard: "bsd"
8117
+ },
8118
+ {
8119
+ name: "SIGXFSZ",
8120
+ number: 25,
8121
+ action: "core",
8122
+ description: "File too big",
8123
+ standard: "bsd"
8124
+ },
8125
+ {
8126
+ name: "SIGVTALRM",
8127
+ number: 26,
8128
+ action: "terminate",
8129
+ description: "Timeout or timer",
8130
+ standard: "bsd"
8131
+ },
8132
+ {
8133
+ name: "SIGPROF",
8134
+ number: 27,
8135
+ action: "terminate",
8136
+ description: "Timeout or timer",
8137
+ standard: "bsd"
8138
+ },
8139
+ {
8140
+ name: "SIGWINCH",
8141
+ number: 28,
8142
+ action: "ignore",
8143
+ description: "Terminal window size changed",
8144
+ standard: "bsd"
8145
+ },
8146
+ {
8147
+ name: "SIGIO",
8148
+ number: 29,
8149
+ action: "terminate",
8150
+ description: "I/O is available",
8151
+ standard: "other"
8152
+ },
8153
+ {
8154
+ name: "SIGPOLL",
8155
+ number: 29,
8156
+ action: "terminate",
8157
+ description: "Watched event",
8158
+ standard: "other"
8159
+ },
8160
+ {
8161
+ name: "SIGINFO",
8162
+ number: 29,
8163
+ action: "ignore",
8164
+ description: "Request for process information",
8165
+ standard: "other"
8166
+ },
8167
+ {
8168
+ name: "SIGPWR",
8169
+ number: 30,
8170
+ action: "terminate",
8171
+ description: "Device running out of power",
8172
+ standard: "systemv"
8173
+ },
8174
+ {
8175
+ name: "SIGSYS",
8176
+ number: 31,
8177
+ action: "core",
8178
+ description: "Invalid system call",
8179
+ standard: "other"
8180
+ },
8181
+ {
8182
+ name: "SIGUNUSED",
8183
+ number: 31,
8184
+ action: "terminate",
8185
+ description: "Invalid system call",
8186
+ standard: "other"
8187
+ }
8188
+ ];
8189
+
8190
+ // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
8191
+ var getSignals = () => {
8192
+ const realtimeSignals = getRealtimeSignals();
8193
+ const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
8194
+ return signals2;
8195
+ };
8196
+ var normalizeSignal = ({
8197
+ name,
8198
+ number: defaultNumber,
8199
+ description,
8200
+ action,
8201
+ forced = false,
8202
+ standard
8203
+ }) => {
8204
+ const {
8205
+ signals: { [name]: constantSignal }
8206
+ } = import_node_os.constants;
8207
+ const supported = constantSignal !== void 0;
8208
+ const number = supported ? constantSignal : defaultNumber;
8209
+ return { name, number, description, supported, action, forced, standard };
8210
+ };
8211
+
8212
+ // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
8213
+ var getSignalsByName = () => {
8214
+ const signals2 = getSignals();
8215
+ return Object.fromEntries(signals2.map(getSignalByName));
8216
+ };
8217
+ var getSignalByName = ({
8218
+ name,
8219
+ number,
8220
+ description,
8221
+ supported,
8222
+ action,
8223
+ forced,
8224
+ standard
8225
+ }) => [name, { name, number, description, supported, action, forced, standard }];
8226
+ var signalsByName = getSignalsByName();
8227
+ var getSignalsByNumber = () => {
8228
+ const signals2 = getSignals();
8229
+ const length = SIGRTMAX + 1;
8230
+ const signalsA = Array.from(
8231
+ { length },
8232
+ (value, number) => getSignalByNumber(number, signals2)
8233
+ );
8234
+ return Object.assign({}, ...signalsA);
8235
+ };
8236
+ var getSignalByNumber = (number, signals2) => {
8237
+ const signal = findSignalByNumber(number, signals2);
8238
+ if (signal === void 0) {
8239
+ return {};
8240
+ }
8241
+ const { name, description, supported, action, forced, standard } = signal;
8242
+ return {
8243
+ [number]: {
8244
+ name,
8245
+ number,
8246
+ description,
8247
+ supported,
8248
+ action,
8249
+ forced,
8250
+ standard
8251
+ }
8252
+ };
8253
+ };
8254
+ var findSignalByNumber = (number, signals2) => {
8255
+ const signal = signals2.find(({ name }) => import_node_os2.constants.signals[name] === number);
8256
+ if (signal !== void 0) {
8257
+ return signal;
8258
+ }
8259
+ return signals2.find((signalA) => signalA.number === number);
8260
+ };
8261
+ var signalsByNumber = getSignalsByNumber();
8262
+
8263
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
8264
+ var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
8265
+ if (timedOut) {
8266
+ return `timed out after ${timeout} milliseconds`;
8267
+ }
8268
+ if (isCanceled) {
8269
+ return "was canceled";
8270
+ }
8271
+ if (errorCode !== void 0) {
8272
+ return `failed with ${errorCode}`;
8273
+ }
8274
+ if (signal !== void 0) {
8275
+ return `was killed with ${signal} (${signalDescription})`;
8276
+ }
8277
+ if (exitCode !== void 0) {
8278
+ return `failed with exit code ${exitCode}`;
8279
+ }
8280
+ return "failed";
8281
+ };
8282
+ var makeError = ({
8283
+ stdout,
8284
+ stderr,
8285
+ all,
8286
+ error,
8287
+ signal,
8288
+ exitCode,
8289
+ command,
8290
+ escapedCommand,
8291
+ timedOut,
8292
+ isCanceled,
8293
+ killed,
8294
+ parsed: { options: { timeout, cwd = import_node_process2.default.cwd() } }
8295
+ }) => {
8296
+ exitCode = exitCode === null ? void 0 : exitCode;
8297
+ signal = signal === null ? void 0 : signal;
8298
+ const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
8299
+ const errorCode = error && error.code;
8300
+ const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
8301
+ const execaMessage = `Command ${prefix}: ${command}`;
8302
+ const isError = Object.prototype.toString.call(error) === "[object Error]";
8303
+ const shortMessage = isError ? `${execaMessage}
8304
+ ${error.message}` : execaMessage;
8305
+ const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
8306
+ if (isError) {
8307
+ error.originalMessage = error.message;
8308
+ error.message = message;
8309
+ } else {
8310
+ error = new Error(message);
8311
+ }
8312
+ error.shortMessage = shortMessage;
8313
+ error.command = command;
8314
+ error.escapedCommand = escapedCommand;
8315
+ error.exitCode = exitCode;
8316
+ error.signal = signal;
8317
+ error.signalDescription = signalDescription;
8318
+ error.stdout = stdout;
8319
+ error.stderr = stderr;
8320
+ error.cwd = cwd;
8321
+ if (all !== void 0) {
8322
+ error.all = all;
8323
+ }
8324
+ if ("bufferedData" in error) {
8325
+ delete error.bufferedData;
8326
+ }
8327
+ error.failed = true;
8328
+ error.timedOut = Boolean(timedOut);
8329
+ error.isCanceled = isCanceled;
8330
+ error.killed = killed && !timedOut;
8331
+ return error;
8332
+ };
8333
+
8334
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
8335
+ var aliases = ["stdin", "stdout", "stderr"];
8336
+ var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
8337
+ var normalizeStdio = (options) => {
8338
+ if (!options) {
8339
+ return;
8340
+ }
8341
+ const { stdio } = options;
8342
+ if (stdio === void 0) {
8343
+ return aliases.map((alias) => options[alias]);
8344
+ }
8345
+ if (hasAlias(options)) {
8346
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
8347
+ }
8348
+ if (typeof stdio === "string") {
8349
+ return stdio;
8350
+ }
8351
+ if (!Array.isArray(stdio)) {
8352
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
8353
+ }
8354
+ const length = Math.max(stdio.length, aliases.length);
8355
+ return Array.from({ length }, (value, index) => stdio[index]);
8356
+ };
8357
+
8358
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
8359
+ var import_node_os3 = __toESM(require("node:os"), 1);
8360
+
8361
+ // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
8362
+ var signals = [];
8363
+ signals.push("SIGHUP", "SIGINT", "SIGTERM");
8364
+ if (process.platform !== "win32") {
8365
+ signals.push(
8366
+ "SIGALRM",
8367
+ "SIGABRT",
8368
+ "SIGVTALRM",
8369
+ "SIGXCPU",
8370
+ "SIGXFSZ",
8371
+ "SIGUSR2",
8372
+ "SIGTRAP",
8373
+ "SIGSYS",
8374
+ "SIGQUIT",
8375
+ "SIGIOT"
8376
+ // should detect profiler and enable/disable accordingly.
8377
+ // see #21
8378
+ // 'SIGPROF'
8379
+ );
8380
+ }
8381
+ if (process.platform === "linux") {
8382
+ signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
8383
+ }
8384
+
8385
+ // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
8386
+ var processOk = (process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function";
8387
+ var kExitEmitter = Symbol.for("signal-exit emitter");
8388
+ var global2 = globalThis;
8389
+ var ObjectDefineProperty = Object.defineProperty.bind(Object);
8390
+ var Emitter = class {
8391
+ emitted = {
8392
+ afterExit: false,
8393
+ exit: false
8394
+ };
8395
+ listeners = {
8396
+ afterExit: [],
8397
+ exit: []
8398
+ };
8399
+ count = 0;
8400
+ id = Math.random();
8401
+ constructor() {
8402
+ if (global2[kExitEmitter]) {
8403
+ return global2[kExitEmitter];
8404
+ }
8405
+ ObjectDefineProperty(global2, kExitEmitter, {
8406
+ value: this,
8407
+ writable: false,
8408
+ enumerable: false,
8409
+ configurable: false
8410
+ });
8411
+ }
8412
+ on(ev, fn) {
8413
+ this.listeners[ev].push(fn);
8414
+ }
8415
+ removeListener(ev, fn) {
8416
+ const list = this.listeners[ev];
8417
+ const i = list.indexOf(fn);
8418
+ if (i === -1) {
8419
+ return;
8420
+ }
8421
+ if (i === 0 && list.length === 1) {
8422
+ list.length = 0;
8423
+ } else {
8424
+ list.splice(i, 1);
8425
+ }
8426
+ }
8427
+ emit(ev, code, signal) {
8428
+ if (this.emitted[ev]) {
8429
+ return false;
8430
+ }
8431
+ this.emitted[ev] = true;
8432
+ let ret = false;
8433
+ for (const fn of this.listeners[ev]) {
8434
+ ret = fn(code, signal) === true || ret;
8435
+ }
8436
+ if (ev === "exit") {
8437
+ ret = this.emit("afterExit", code, signal) || ret;
8438
+ }
8439
+ return ret;
8440
+ }
8441
+ };
8442
+ var SignalExitBase = class {
8443
+ };
8444
+ var signalExitWrap = (handler) => {
8445
+ return {
8446
+ onExit(cb, opts) {
8447
+ return handler.onExit(cb, opts);
8448
+ },
8449
+ load() {
8450
+ return handler.load();
8451
+ },
8452
+ unload() {
8453
+ return handler.unload();
8454
+ }
8455
+ };
8456
+ };
8457
+ var SignalExitFallback = class extends SignalExitBase {
8458
+ onExit() {
8459
+ return () => {
8460
+ };
8461
+ }
8462
+ load() {
8463
+ }
8464
+ unload() {
8465
+ }
8466
+ };
8467
+ var SignalExit = class extends SignalExitBase {
8468
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
8469
+ // so use a supported signal instead
8470
+ /* c8 ignore start */
8471
+ #hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
8472
+ /* c8 ignore stop */
8473
+ #emitter = new Emitter();
8474
+ #process;
8475
+ #originalProcessEmit;
8476
+ #originalProcessReallyExit;
8477
+ #sigListeners = {};
8478
+ #loaded = false;
8479
+ constructor(process7) {
8480
+ super();
8481
+ this.#process = process7;
8482
+ this.#sigListeners = {};
8483
+ for (const sig of signals) {
8484
+ this.#sigListeners[sig] = () => {
8485
+ const listeners = this.#process.listeners(sig);
8486
+ let { count } = this.#emitter;
8487
+ const p = process7;
8488
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
8489
+ count += p.__signal_exit_emitter__.count;
8490
+ }
8491
+ if (listeners.length === count) {
8492
+ this.unload();
8493
+ const ret = this.#emitter.emit("exit", null, sig);
8494
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
8495
+ if (!ret)
8496
+ process7.kill(process7.pid, s);
8497
+ }
8498
+ };
8499
+ }
8500
+ this.#originalProcessReallyExit = process7.reallyExit;
8501
+ this.#originalProcessEmit = process7.emit;
8502
+ }
8503
+ onExit(cb, opts) {
8504
+ if (!processOk(this.#process)) {
8505
+ return () => {
8506
+ };
8507
+ }
8508
+ if (this.#loaded === false) {
8509
+ this.load();
8510
+ }
8511
+ const ev = opts?.alwaysLast ? "afterExit" : "exit";
8512
+ this.#emitter.on(ev, cb);
8513
+ return () => {
8514
+ this.#emitter.removeListener(ev, cb);
8515
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
8516
+ this.unload();
8517
+ }
8518
+ };
8519
+ }
8520
+ load() {
8521
+ if (this.#loaded) {
8522
+ return;
8523
+ }
8524
+ this.#loaded = true;
8525
+ this.#emitter.count += 1;
8526
+ for (const sig of signals) {
8527
+ try {
8528
+ const fn = this.#sigListeners[sig];
8529
+ if (fn)
8530
+ this.#process.on(sig, fn);
8531
+ } catch (_) {
8532
+ }
8533
+ }
8534
+ this.#process.emit = (ev, ...a) => {
8535
+ return this.#processEmit(ev, ...a);
8536
+ };
8537
+ this.#process.reallyExit = (code) => {
8538
+ return this.#processReallyExit(code);
8539
+ };
8540
+ }
8541
+ unload() {
8542
+ if (!this.#loaded) {
8543
+ return;
8544
+ }
8545
+ this.#loaded = false;
8546
+ signals.forEach((sig) => {
8547
+ const listener = this.#sigListeners[sig];
8548
+ if (!listener) {
8549
+ throw new Error("Listener not defined for signal: " + sig);
8550
+ }
8551
+ try {
8552
+ this.#process.removeListener(sig, listener);
8553
+ } catch (_) {
8554
+ }
8555
+ });
8556
+ this.#process.emit = this.#originalProcessEmit;
8557
+ this.#process.reallyExit = this.#originalProcessReallyExit;
8558
+ this.#emitter.count -= 1;
8559
+ }
8560
+ #processReallyExit(code) {
8561
+ if (!processOk(this.#process)) {
8562
+ return 0;
8563
+ }
8564
+ this.#process.exitCode = code || 0;
8565
+ this.#emitter.emit("exit", this.#process.exitCode, null);
8566
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
8567
+ }
8568
+ #processEmit(ev, ...args) {
8569
+ const og = this.#originalProcessEmit;
8570
+ if (ev === "exit" && processOk(this.#process)) {
8571
+ if (typeof args[0] === "number") {
8572
+ this.#process.exitCode = args[0];
8573
+ }
8574
+ const ret = og.call(this.#process, ev, ...args);
8575
+ this.#emitter.emit("exit", this.#process.exitCode, null);
8576
+ return ret;
8577
+ } else {
8578
+ return og.call(this.#process, ev, ...args);
8579
+ }
8580
+ }
8581
+ };
8582
+ var process4 = globalThis.process;
8583
+ var {
8584
+ /**
8585
+ * Called when the process is exiting, whether via signal, explicit
8586
+ * exit, or running out of stuff to do.
8587
+ *
8588
+ * If the global process object is not suitable for instrumentation,
8589
+ * then this will be a no-op.
8590
+ *
8591
+ * Returns a function that may be used to unload signal-exit.
8592
+ */
8593
+ onExit,
8594
+ /**
8595
+ * Load the listeners. Likely you never need to call this, unless
8596
+ * doing a rather deep integration with signal-exit functionality.
8597
+ * Mostly exposed for the benefit of testing.
8598
+ *
8599
+ * @internal
8600
+ */
8601
+ load,
8602
+ /**
8603
+ * Unload the listeners. Likely you never need to call this, unless
8604
+ * doing a rather deep integration with signal-exit functionality.
8605
+ * Mostly exposed for the benefit of testing.
8606
+ *
8607
+ * @internal
8608
+ */
8609
+ unload
8610
+ } = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
8611
+
8612
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
8613
+ var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
8614
+ var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
8615
+ const killResult = kill(signal);
8616
+ setKillTimeout(kill, signal, options, killResult);
8617
+ return killResult;
8618
+ };
8619
+ var setKillTimeout = (kill, signal, options, killResult) => {
8620
+ if (!shouldForceKill(signal, options, killResult)) {
8621
+ return;
8622
+ }
8623
+ const timeout = getForceKillAfterTimeout(options);
8624
+ const t = setTimeout(() => {
8625
+ kill("SIGKILL");
8626
+ }, timeout);
8627
+ if (t.unref) {
8628
+ t.unref();
8629
+ }
8630
+ };
8631
+ var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
8632
+ var isSigterm = (signal) => signal === import_node_os3.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
8633
+ var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
8634
+ if (forceKillAfterTimeout === true) {
8635
+ return DEFAULT_FORCE_KILL_TIMEOUT;
8636
+ }
8637
+ if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
8638
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
8639
+ }
8640
+ return forceKillAfterTimeout;
8641
+ };
8642
+ var spawnedCancel = (spawned, context) => {
8643
+ const killResult = spawned.kill();
8644
+ if (killResult) {
8645
+ context.isCanceled = true;
8646
+ }
8647
+ };
8648
+ var timeoutKill = (spawned, signal, reject) => {
8649
+ spawned.kill(signal);
8650
+ reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
8651
+ };
8652
+ var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
8653
+ if (timeout === 0 || timeout === void 0) {
8654
+ return spawnedPromise;
8655
+ }
8656
+ let timeoutId;
8657
+ const timeoutPromise = new Promise((resolve, reject) => {
8658
+ timeoutId = setTimeout(() => {
8659
+ timeoutKill(spawned, killSignal, reject);
8660
+ }, timeout);
8661
+ });
8662
+ const safeSpawnedPromise = spawnedPromise.finally(() => {
8663
+ clearTimeout(timeoutId);
8664
+ });
8665
+ return Promise.race([timeoutPromise, safeSpawnedPromise]);
8666
+ };
8667
+ var validateTimeout = ({ timeout }) => {
8668
+ if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
8669
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
8670
+ }
8671
+ };
8672
+ var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
8673
+ if (!cleanup || detached) {
8674
+ return timedPromise;
8675
+ }
8676
+ const removeExitHandler = onExit(() => {
8677
+ spawned.kill();
8678
+ });
8679
+ return timedPromise.finally(() => {
8680
+ removeExitHandler();
8681
+ });
8682
+ };
8683
+
8684
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
8685
+ var import_node_fs = require("node:fs");
8686
+ var import_node_child_process = require("node:child_process");
8687
+
8688
+ // ../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
8689
+ function isStream(stream) {
8690
+ return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
8691
+ }
8692
+ function isWritableStream(stream) {
8693
+ return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
8694
+ }
8695
+
8696
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
8697
+ var isExecaChildProcess = (target) => target instanceof import_node_child_process.ChildProcess && typeof target.then === "function";
8698
+ var pipeToTarget = (spawned, streamName, target) => {
8699
+ if (typeof target === "string") {
8700
+ spawned[streamName].pipe((0, import_node_fs.createWriteStream)(target));
8701
+ return spawned;
8702
+ }
8703
+ if (isWritableStream(target)) {
8704
+ spawned[streamName].pipe(target);
8705
+ return spawned;
8706
+ }
8707
+ if (!isExecaChildProcess(target)) {
8708
+ throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
8709
+ }
8710
+ if (!isWritableStream(target.stdin)) {
8711
+ throw new TypeError("The target child process's stdin must be available.");
8712
+ }
8713
+ spawned[streamName].pipe(target.stdin);
8714
+ return target;
8715
+ };
8716
+ var addPipeMethods = (spawned) => {
8717
+ if (spawned.stdout !== null) {
8718
+ spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
8719
+ }
8720
+ if (spawned.stderr !== null) {
8721
+ spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
8722
+ }
8723
+ if (spawned.all !== void 0) {
8724
+ spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
8725
+ }
8726
+ };
8727
+
8728
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
8729
+ var import_node_fs2 = require("node:fs");
8730
+ var import_promises2 = require("node:timers/promises");
8731
+
8732
+ // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
8733
+ var getStreamContents = async (stream, { init: init2, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
8734
+ if (!isAsyncIterable(stream)) {
8735
+ throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
8736
+ }
8737
+ const state = init2();
8738
+ state.length = 0;
8739
+ try {
8740
+ for await (const chunk of stream) {
8741
+ const chunkType = getChunkType(chunk);
8742
+ const convertedChunk = convertChunk[chunkType](chunk, state);
8743
+ appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
8744
+ }
8745
+ appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
8746
+ return finalize(state);
8747
+ } catch (error) {
8748
+ error.bufferedData = finalize(state);
8749
+ throw error;
8750
+ }
8751
+ };
8752
+ var appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
8753
+ const convertedChunk = getFinalChunk(state);
8754
+ if (convertedChunk !== void 0) {
8755
+ appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
8756
+ }
8757
+ };
8758
+ var appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
8759
+ const chunkSize = getSize(convertedChunk);
8760
+ const newLength = state.length + chunkSize;
8761
+ if (newLength <= maxBuffer) {
8762
+ addNewChunk(convertedChunk, state, addChunk, newLength);
8763
+ return;
8764
+ }
8765
+ const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
8766
+ if (truncatedChunk !== void 0) {
8767
+ addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
8768
+ }
8769
+ throw new MaxBufferError();
8770
+ };
8771
+ var addNewChunk = (convertedChunk, state, addChunk, newLength) => {
8772
+ state.contents = addChunk(convertedChunk, state, newLength);
8773
+ state.length = newLength;
8774
+ };
8775
+ var isAsyncIterable = (stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function";
8776
+ var getChunkType = (chunk) => {
8777
+ const typeOfChunk = typeof chunk;
8778
+ if (typeOfChunk === "string") {
8779
+ return "string";
8780
+ }
8781
+ if (typeOfChunk !== "object" || chunk === null) {
8782
+ return "others";
8783
+ }
8784
+ if (globalThis.Buffer?.isBuffer(chunk)) {
8785
+ return "buffer";
8786
+ }
8787
+ const prototypeName = objectToString.call(chunk);
8788
+ if (prototypeName === "[object ArrayBuffer]") {
8789
+ return "arrayBuffer";
8790
+ }
8791
+ if (prototypeName === "[object DataView]") {
8792
+ return "dataView";
8793
+ }
8794
+ if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
8795
+ return "typedArray";
8796
+ }
8797
+ return "others";
8798
+ };
8799
+ var { toString: objectToString } = Object.prototype;
8800
+ var MaxBufferError = class extends Error {
8801
+ name = "MaxBufferError";
8802
+ constructor() {
8803
+ super("maxBuffer exceeded");
8804
+ }
8805
+ };
8806
+
8807
+ // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
8808
+ var identity = (value) => value;
8809
+ var noop = () => void 0;
8810
+ var getContentsProp = ({ contents }) => contents;
8811
+ var throwObjectStream = (chunk) => {
8812
+ throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
8813
+ };
8814
+ var getLengthProp = (convertedChunk) => convertedChunk.length;
8815
+
8816
+ // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
8817
+ async function getStreamAsArrayBuffer(stream, options) {
8818
+ return getStreamContents(stream, arrayBufferMethods, options);
8819
+ }
8820
+ var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) });
8821
+ var useTextEncoder = (chunk) => textEncoder.encode(chunk);
8822
+ var textEncoder = new TextEncoder();
8823
+ var useUint8Array = (chunk) => new Uint8Array(chunk);
8824
+ var useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
8825
+ var truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
8826
+ var addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
8827
+ const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
8828
+ new Uint8Array(newContents).set(convertedChunk, previousLength);
8829
+ return newContents;
8830
+ };
8831
+ var resizeArrayBufferSlow = (contents, length) => {
8832
+ if (length <= contents.byteLength) {
8833
+ return contents;
8834
+ }
8835
+ const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
8836
+ new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
8837
+ return arrayBuffer;
8838
+ };
8839
+ var resizeArrayBuffer = (contents, length) => {
8840
+ if (length <= contents.maxByteLength) {
8841
+ contents.resize(length);
8842
+ return contents;
8843
+ }
8844
+ const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
8845
+ new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
8846
+ return arrayBuffer;
8847
+ };
8848
+ var getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
8849
+ var SCALE_FACTOR = 2;
8850
+ var finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length);
8851
+ var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
8852
+ var arrayBufferMethods = {
8853
+ init: initArrayBuffer,
8854
+ convertChunk: {
8855
+ string: useTextEncoder,
8856
+ buffer: useUint8Array,
8857
+ arrayBuffer: useUint8Array,
8858
+ dataView: useUint8ArrayWithOffset,
8859
+ typedArray: useUint8ArrayWithOffset,
8860
+ others: throwObjectStream
8861
+ },
8862
+ getSize: getLengthProp,
8863
+ truncateChunk: truncateArrayBufferChunk,
8864
+ addChunk: addArrayBufferChunk,
8865
+ getFinalChunk: noop,
8866
+ finalize: finalizeArrayBuffer
8867
+ };
8868
+
8869
+ // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
8870
+ async function getStreamAsBuffer(stream, options) {
8871
+ if (!("Buffer" in globalThis)) {
8872
+ throw new Error("getStreamAsBuffer() is only supported in Node.js");
8873
+ }
8874
+ try {
8875
+ return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
8876
+ } catch (error) {
8877
+ if (error.bufferedData !== void 0) {
8878
+ error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
8879
+ }
8880
+ throw error;
8881
+ }
8882
+ }
8883
+ var arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
8884
+
8885
+ // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
8886
+ async function getStreamAsString(stream, options) {
8887
+ return getStreamContents(stream, stringMethods, options);
8888
+ }
8889
+ var initString = () => ({ contents: "", textDecoder: new TextDecoder() });
8890
+ var useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
8891
+ var addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
8892
+ var truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
8893
+ var getFinalStringChunk = ({ textDecoder }) => {
8894
+ const finalChunk = textDecoder.decode();
8895
+ return finalChunk === "" ? void 0 : finalChunk;
8896
+ };
8897
+ var stringMethods = {
8898
+ init: initString,
8899
+ convertChunk: {
8900
+ string: identity,
8901
+ buffer: useTextDecoder,
8902
+ arrayBuffer: useTextDecoder,
8903
+ dataView: useTextDecoder,
8904
+ typedArray: useTextDecoder,
8905
+ others: throwObjectStream
8906
+ },
8907
+ getSize: getLengthProp,
8908
+ truncateChunk: truncateStringChunk,
8909
+ addChunk: addStringChunk,
8910
+ getFinalChunk: getFinalStringChunk,
8911
+ finalize: getContentsProp
8912
+ };
8913
+
8914
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
8915
+ var import_merge_stream = __toESM(require_merge_stream(), 1);
8916
+ var validateInputOptions = (input) => {
8917
+ if (input !== void 0) {
8918
+ throw new TypeError("The `input` and `inputFile` options cannot be both set.");
8919
+ }
8920
+ };
8921
+ var getInputSync = ({ input, inputFile }) => {
8922
+ if (typeof inputFile !== "string") {
8923
+ return input;
8924
+ }
8925
+ validateInputOptions(input);
8926
+ return (0, import_node_fs2.readFileSync)(inputFile);
8927
+ };
8928
+ var handleInputSync = (options) => {
8929
+ const input = getInputSync(options);
8930
+ if (isStream(input)) {
8931
+ throw new TypeError("The `input` option cannot be a stream in sync mode");
8932
+ }
8933
+ return input;
8934
+ };
8935
+ var getInput = ({ input, inputFile }) => {
8936
+ if (typeof inputFile !== "string") {
8937
+ return input;
8938
+ }
8939
+ validateInputOptions(input);
8940
+ return (0, import_node_fs2.createReadStream)(inputFile);
8941
+ };
8942
+ var handleInput = (spawned, options) => {
8943
+ const input = getInput(options);
8944
+ if (input === void 0) {
8945
+ return;
8946
+ }
8947
+ if (isStream(input)) {
8948
+ input.pipe(spawned.stdin);
8949
+ } else {
8950
+ spawned.stdin.end(input);
8951
+ }
8952
+ };
8953
+ var makeAllStream = (spawned, { all }) => {
8954
+ if (!all || !spawned.stdout && !spawned.stderr) {
8955
+ return;
8956
+ }
8957
+ const mixed = (0, import_merge_stream.default)();
8958
+ if (spawned.stdout) {
8959
+ mixed.add(spawned.stdout);
8960
+ }
8961
+ if (spawned.stderr) {
8962
+ mixed.add(spawned.stderr);
8963
+ }
8964
+ return mixed;
8965
+ };
8966
+ var getBufferedData = async (stream, streamPromise) => {
8967
+ if (!stream || streamPromise === void 0) {
8968
+ return;
8969
+ }
8970
+ await (0, import_promises2.setTimeout)(0);
8971
+ stream.destroy();
8972
+ try {
8973
+ return await streamPromise;
8974
+ } catch (error) {
8975
+ return error.bufferedData;
8976
+ }
8977
+ };
8978
+ var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
8979
+ if (!stream || !buffer) {
8980
+ return;
8981
+ }
8982
+ if (encoding === "utf8" || encoding === "utf-8") {
8983
+ return getStreamAsString(stream, { maxBuffer });
8984
+ }
8985
+ if (encoding === null || encoding === "buffer") {
8986
+ return getStreamAsBuffer(stream, { maxBuffer });
8987
+ }
8988
+ return applyEncoding(stream, maxBuffer, encoding);
8989
+ };
8990
+ var applyEncoding = async (stream, maxBuffer, encoding) => {
8991
+ const buffer = await getStreamAsBuffer(stream, { maxBuffer });
8992
+ return buffer.toString(encoding);
8993
+ };
8994
+ var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
8995
+ const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
8996
+ const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
8997
+ const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
8998
+ try {
8999
+ return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
9000
+ } catch (error) {
9001
+ return Promise.all([
9002
+ { error, signal: error.signal, timedOut: error.timedOut },
9003
+ getBufferedData(stdout, stdoutPromise),
9004
+ getBufferedData(stderr, stderrPromise),
9005
+ getBufferedData(all, allPromise)
9006
+ ]);
9007
+ }
9008
+ };
9009
+
9010
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
9011
+ var nativePromisePrototype = (async () => {
9012
+ })().constructor.prototype;
9013
+ var descriptors = ["then", "catch", "finally"].map((property11) => [
9014
+ property11,
9015
+ Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property11)
9016
+ ]);
9017
+ var mergePromise = (spawned, promise2) => {
9018
+ for (const [property11, descriptor] of descriptors) {
9019
+ const value = typeof promise2 === "function" ? (...args) => Reflect.apply(descriptor.value, promise2(), args) : descriptor.value.bind(promise2);
9020
+ Reflect.defineProperty(spawned, property11, { ...descriptor, value });
9021
+ }
9022
+ };
9023
+ var getSpawnedPromise = (spawned) => new Promise((resolve, reject) => {
9024
+ spawned.on("exit", (exitCode, signal) => {
9025
+ resolve({ exitCode, signal });
9026
+ });
9027
+ spawned.on("error", (error) => {
9028
+ reject(error);
9029
+ });
9030
+ if (spawned.stdin) {
9031
+ spawned.stdin.on("error", (error) => {
9032
+ reject(error);
9033
+ });
9034
+ }
9035
+ });
9036
+
9037
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
9038
+ var import_node_buffer = require("node:buffer");
9039
+ var import_node_child_process2 = require("node:child_process");
9040
+ var normalizeArgs = (file4, args = []) => {
9041
+ if (!Array.isArray(args)) {
9042
+ return [file4];
9043
+ }
9044
+ return [file4, ...args];
9045
+ };
9046
+ var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
9047
+ var escapeArg = (arg) => {
9048
+ if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
9049
+ return arg;
9050
+ }
9051
+ return `"${arg.replaceAll('"', '\\"')}"`;
9052
+ };
9053
+ var joinCommand = (file4, args) => normalizeArgs(file4, args).join(" ");
9054
+ var getEscapedCommand = (file4, args) => normalizeArgs(file4, args).map((arg) => escapeArg(arg)).join(" ");
9055
+ var SPACES_REGEXP = / +/g;
9056
+ var parseCommand = (command) => {
9057
+ const tokens = [];
9058
+ for (const token of command.trim().split(SPACES_REGEXP)) {
9059
+ const previousToken = tokens.at(-1);
9060
+ if (previousToken && previousToken.endsWith("\\")) {
9061
+ tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
9062
+ } else {
9063
+ tokens.push(token);
9064
+ }
9065
+ }
9066
+ return tokens;
9067
+ };
9068
+ var parseExpression = (expression) => {
9069
+ const typeOfExpression = typeof expression;
9070
+ if (typeOfExpression === "string") {
9071
+ return expression;
9072
+ }
9073
+ if (typeOfExpression === "number") {
9074
+ return String(expression);
9075
+ }
9076
+ if (typeOfExpression === "object" && expression !== null && !(expression instanceof import_node_child_process2.ChildProcess) && "stdout" in expression) {
9077
+ const typeOfStdout = typeof expression.stdout;
9078
+ if (typeOfStdout === "string") {
9079
+ return expression.stdout;
9080
+ }
9081
+ if (import_node_buffer.Buffer.isBuffer(expression.stdout)) {
9082
+ return expression.stdout.toString();
9083
+ }
9084
+ throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
9085
+ }
9086
+ throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
9087
+ };
9088
+ var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
9089
+ ...tokens.slice(0, -1),
9090
+ `${tokens.at(-1)}${nextTokens[0]}`,
9091
+ ...nextTokens.slice(1)
9092
+ ];
9093
+ var parseTemplate = ({ templates, expressions, tokens, index, template }) => {
9094
+ const templateString = template ?? templates.raw[index];
9095
+ const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
9096
+ const newTokens = concatTokens(
9097
+ tokens,
9098
+ templateTokens,
9099
+ templateString.startsWith(" ")
9100
+ );
9101
+ if (index === expressions.length) {
9102
+ return newTokens;
9103
+ }
9104
+ const expression = expressions[index];
9105
+ const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
9106
+ return concatTokens(
9107
+ newTokens,
9108
+ expressionTokens,
9109
+ templateString.endsWith(" ")
9110
+ );
9111
+ };
9112
+ var parseTemplates = (templates, expressions) => {
9113
+ let tokens = [];
9114
+ for (const [index, template] of templates.entries()) {
9115
+ tokens = parseTemplate({ templates, expressions, tokens, index, template });
9116
+ }
9117
+ return tokens;
9118
+ };
9119
+
9120
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
9121
+ var import_node_util = require("node:util");
9122
+ var import_node_process3 = __toESM(require("node:process"), 1);
9123
+ var verboseDefault = (0, import_node_util.debuglog)("execa").enabled;
9124
+ var padField = (field, padding) => String(field).padStart(padding, "0");
9125
+ var getTimestamp = () => {
9126
+ const date2 = /* @__PURE__ */ new Date();
9127
+ return `${padField(date2.getHours(), 2)}:${padField(date2.getMinutes(), 2)}:${padField(date2.getSeconds(), 2)}.${padField(date2.getMilliseconds(), 3)}`;
9128
+ };
9129
+ var logCommand = (escapedCommand, { verbose }) => {
9130
+ if (!verbose) {
9131
+ return;
9132
+ }
9133
+ import_node_process3.default.stderr.write(`[${getTimestamp()}] ${escapedCommand}
9134
+ `);
9135
+ };
9136
+
9137
+ // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
9138
+ var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
9139
+ var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
9140
+ const env = extendEnv ? { ...import_node_process4.default.env, ...envOption } : envOption;
9141
+ if (preferLocal) {
9142
+ return npmRunPathEnv({ env, cwd: localDir, execPath });
9143
+ }
9144
+ return env;
9145
+ };
9146
+ var handleArguments = (file4, args, options = {}) => {
9147
+ const parsed = import_cross_spawn.default._parse(file4, args, options);
9148
+ file4 = parsed.command;
9149
+ args = parsed.args;
9150
+ options = parsed.options;
9151
+ options = {
9152
+ maxBuffer: DEFAULT_MAX_BUFFER,
9153
+ buffer: true,
9154
+ stripFinalNewline: true,
9155
+ extendEnv: true,
9156
+ preferLocal: false,
9157
+ localDir: options.cwd || import_node_process4.default.cwd(),
9158
+ execPath: import_node_process4.default.execPath,
9159
+ encoding: "utf8",
9160
+ reject: true,
9161
+ cleanup: true,
9162
+ all: false,
9163
+ windowsHide: true,
9164
+ verbose: verboseDefault,
9165
+ ...options
9166
+ };
9167
+ options.env = getEnv(options);
9168
+ options.stdio = normalizeStdio(options);
9169
+ if (import_node_process4.default.platform === "win32" && import_node_path2.default.basename(file4, ".exe") === "cmd") {
9170
+ args.unshift("/q");
9171
+ }
9172
+ return { file: file4, args, options, parsed };
9173
+ };
9174
+ var handleOutput = (options, value, error) => {
9175
+ if (typeof value !== "string" && !import_node_buffer2.Buffer.isBuffer(value)) {
9176
+ return error === void 0 ? void 0 : "";
9177
+ }
9178
+ if (options.stripFinalNewline) {
9179
+ return stripFinalNewline(value);
9180
+ }
9181
+ return value;
9182
+ };
9183
+ function execa(file4, args, options) {
9184
+ const parsed = handleArguments(file4, args, options);
9185
+ const command = joinCommand(file4, args);
9186
+ const escapedCommand = getEscapedCommand(file4, args);
9187
+ logCommand(escapedCommand, parsed.options);
9188
+ validateTimeout(parsed.options);
9189
+ let spawned;
9190
+ try {
9191
+ spawned = import_node_child_process3.default.spawn(parsed.file, parsed.args, parsed.options);
9192
+ } catch (error) {
9193
+ const dummySpawned = new import_node_child_process3.default.ChildProcess();
9194
+ const errorPromise = Promise.reject(makeError({
9195
+ error,
9196
+ stdout: "",
9197
+ stderr: "",
9198
+ all: "",
9199
+ command,
9200
+ escapedCommand,
9201
+ parsed,
9202
+ timedOut: false,
9203
+ isCanceled: false,
9204
+ killed: false
9205
+ }));
9206
+ mergePromise(dummySpawned, errorPromise);
9207
+ return dummySpawned;
9208
+ }
9209
+ const spawnedPromise = getSpawnedPromise(spawned);
9210
+ const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
9211
+ const processDone = setExitHandler(spawned, parsed.options, timedPromise);
9212
+ const context = { isCanceled: false };
9213
+ spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
9214
+ spawned.cancel = spawnedCancel.bind(null, spawned, context);
9215
+ const handlePromise = async () => {
9216
+ const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
9217
+ const stdout = handleOutput(parsed.options, stdoutResult);
9218
+ const stderr = handleOutput(parsed.options, stderrResult);
9219
+ const all = handleOutput(parsed.options, allResult);
9220
+ if (error || exitCode !== 0 || signal !== null) {
9221
+ const returnedError = makeError({
9222
+ error,
9223
+ exitCode,
9224
+ signal,
9225
+ stdout,
9226
+ stderr,
9227
+ all,
9228
+ command,
9229
+ escapedCommand,
9230
+ parsed,
9231
+ timedOut,
9232
+ isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
9233
+ killed: spawned.killed
9234
+ });
9235
+ if (!parsed.options.reject) {
9236
+ return returnedError;
9237
+ }
9238
+ throw returnedError;
9239
+ }
9240
+ return {
9241
+ command,
9242
+ escapedCommand,
9243
+ exitCode: 0,
9244
+ stdout,
9245
+ stderr,
9246
+ all,
9247
+ failed: false,
9248
+ timedOut: false,
9249
+ isCanceled: false,
9250
+ killed: false
9251
+ };
9252
+ };
9253
+ const handlePromiseOnce = onetime_default(handlePromise);
9254
+ handleInput(spawned, parsed.options);
9255
+ spawned.all = makeAllStream(spawned, parsed.options);
9256
+ addPipeMethods(spawned);
9257
+ mergePromise(spawned, handlePromiseOnce);
9258
+ return spawned;
9259
+ }
9260
+ function execaSync(file4, args, options) {
9261
+ const parsed = handleArguments(file4, args, options);
9262
+ const command = joinCommand(file4, args);
9263
+ const escapedCommand = getEscapedCommand(file4, args);
9264
+ logCommand(escapedCommand, parsed.options);
9265
+ const input = handleInputSync(parsed.options);
9266
+ let result;
9267
+ try {
9268
+ result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
9269
+ } catch (error) {
9270
+ throw makeError({
9271
+ error,
9272
+ stdout: "",
9273
+ stderr: "",
9274
+ all: "",
9275
+ command,
9276
+ escapedCommand,
9277
+ parsed,
9278
+ timedOut: false,
9279
+ isCanceled: false,
9280
+ killed: false
9281
+ });
9282
+ }
9283
+ const stdout = handleOutput(parsed.options, result.stdout, result.error);
9284
+ const stderr = handleOutput(parsed.options, result.stderr, result.error);
9285
+ if (result.error || result.status !== 0 || result.signal !== null) {
9286
+ const error = makeError({
9287
+ stdout,
9288
+ stderr,
9289
+ error: result.error,
9290
+ signal: result.signal,
9291
+ exitCode: result.status,
9292
+ command,
9293
+ escapedCommand,
9294
+ parsed,
9295
+ timedOut: result.error && result.error.code === "ETIMEDOUT",
9296
+ isCanceled: false,
9297
+ killed: result.signal !== null
9298
+ });
9299
+ if (!parsed.options.reject) {
9300
+ return error;
9301
+ }
9302
+ throw error;
9303
+ }
9304
+ return {
9305
+ command,
9306
+ escapedCommand,
9307
+ exitCode: 0,
9308
+ stdout,
9309
+ stderr,
9310
+ failed: false,
9311
+ timedOut: false,
9312
+ isCanceled: false,
9313
+ killed: false
9314
+ };
9315
+ }
9316
+ var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
9317
+ var normalizeScriptOptions = (options = {}) => ({
9318
+ preferLocal: true,
9319
+ ...normalizeScriptStdin(options),
9320
+ ...options
9321
+ });
9322
+ function create$(options) {
9323
+ function $3(templatesOrOptions, ...expressions) {
9324
+ if (!Array.isArray(templatesOrOptions)) {
9325
+ return create$({ ...options, ...templatesOrOptions });
9326
+ }
9327
+ const [file4, ...args] = parseTemplates(templatesOrOptions, expressions);
9328
+ return execa(file4, args, normalizeScriptOptions(options));
9329
+ }
9330
+ $3.sync = (templates, ...expressions) => {
9331
+ if (!Array.isArray(templates)) {
9332
+ throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
9333
+ }
9334
+ const [file4, ...args] = parseTemplates(templates, expressions);
9335
+ return execaSync(file4, args, normalizeScriptOptions(options));
9336
+ };
9337
+ return $3;
9338
+ }
9339
+ var $2 = create$();
9340
+ function execaCommand(command, options) {
9341
+ const [file4, ...args] = parseCommand(command);
9342
+ return execa(file4, args, options);
9343
+ }
9344
+
9345
+ // src/resolvePrismaClient.ts
9346
+ var debug2 = (0, import_debug2.Debug)("prisma:generator");
6828
9347
  async function resolvePrismaClient(baseDir) {
6829
9348
  const prismaClientDir = await findPrismaClientDir(baseDir);
6830
- debug("baseDir", baseDir);
9349
+ debug2("baseDir", baseDir);
6831
9350
  if (!prismaClientDir) {
6832
9351
  throw new Error(
6833
9352
  `Could not resolve @prisma/client.
@@ -6838,16 +9357,83 @@ Please try to install it with ${bold(
6838
9357
  }
6839
9358
  return prismaClientDir;
6840
9359
  }
9360
+ async function resolveOrInstallPrismaClient(baseDir, version2) {
9361
+ let prismaClientDir = await findPrismaClientDir(baseDir);
9362
+ debug2("baseDir", baseDir);
9363
+ if (prismaClientDir) {
9364
+ return prismaClientDir;
9365
+ }
9366
+ let projectRoot = (0, import_internals11.longestCommonPathPrefix)(baseDir, process.cwd());
9367
+ debug2("projectRoot", projectRoot);
9368
+ const warningTag = `${bold("Warning:")} ${dim("[Prisma auto-install on generate]")}`;
9369
+ if (projectRoot === void 0) {
9370
+ console.warn(
9371
+ yellow(
9372
+ `${warningTag} The Prisma schema directory ${bold(baseDir)} and the current working directory ${bold(
9373
+ process.cwd()
9374
+ )} have no common ancestor. The Prisma schema directory will be used as the project root.`
9375
+ )
9376
+ );
9377
+ projectRoot = baseDir;
9378
+ }
9379
+ try {
9380
+ await import_promises3.default.stat(import_node_path3.default.join(projectRoot, "package.json"));
9381
+ } catch (err) {
9382
+ if (err.code === "ENOENT") {
9383
+ console.warn(
9384
+ yellow(
9385
+ `${warningTag} Prisma could not find a ${bold("package.json")} file in the inferred project root ${bold(
9386
+ projectRoot
9387
+ )}. During the next step, when an auto-install of Prisma package(s) will be attempted, it will then be created by your package manager on the appropriate level if necessary.`
9388
+ )
9389
+ );
9390
+ } else {
9391
+ throw err;
9392
+ }
9393
+ }
9394
+ const prismaCliDir = await (0, import_internals11.resolvePkg)("prisma", { basedir: baseDir });
9395
+ if (process.platform === "win32" && await isYarnUsed(baseDir)) {
9396
+ const hasCli = (s) => prismaCliDir !== void 0 ? s : "";
9397
+ const missingCli = (s) => prismaCliDir === void 0 ? s : "";
9398
+ throw new Error(
9399
+ `Could not resolve ${missingCli(`${bold("prisma")} and `)}${bold(
9400
+ "@prisma/client"
9401
+ )} in the current project. Please install ${hasCli("it")}${missingCli("them")} with ${missingCli(
9402
+ `${bold(green(`${await getPackageCmd(baseDir, "add", "prisma", "-D")}`))} and `
9403
+ )}${bold(green(`${await getPackageCmd(baseDir, "add", "@prisma/client")}`))}, and rerun ${bold(
9404
+ await getPackageCmd(baseDir, "execute", "prisma generate")
9405
+ )} \u{1F64F}.`
9406
+ );
9407
+ }
9408
+ if (!prismaCliDir) {
9409
+ await runPackageCmd(projectRoot, "add", `prisma@${version2}`, "-D", "--silent");
9410
+ }
9411
+ await runPackageCmd(projectRoot, "add", `@prisma/client@${version2}`, "--silent");
9412
+ prismaClientDir = await findPrismaClientDir(import_node_path3.default.join(".", baseDir));
9413
+ if (!prismaClientDir) {
9414
+ throw new Error(
9415
+ `Could not resolve @prisma/client despite the installation that we just tried.
9416
+ Please try to install it by hand with ${bold(
9417
+ green(`${await getPackageCmd(baseDir, "add", "@prisma/client")}`)
9418
+ )} and rerun ${bold(await getPackageCmd(baseDir, "execute", "prisma generate"))} \u{1F64F}.`
9419
+ );
9420
+ }
9421
+ console.info(
9422
+ `
9423
+ \u2714 Installed the ${bold(green("@prisma/client"))} and ${bold(green("prisma"))} packages in your project`
9424
+ );
9425
+ return prismaClientDir;
9426
+ }
6841
9427
  async function findPrismaClientDir(baseDir) {
6842
9428
  const resolveOpts = { basedir: baseDir, preserveSymlinks: true };
6843
- const cliDir = await (0, import_internals8.resolvePkg)("prisma", resolveOpts);
6844
- const clientDir = await (0, import_internals8.resolvePkg)("@prisma/client", resolveOpts);
6845
- const resolvedClientDir = clientDir && await import_promises2.default.realpath(clientDir);
6846
- debug("prismaCliDir", cliDir);
6847
- debug("prismaClientDir", clientDir);
9429
+ const cliDir = await (0, import_internals11.resolvePkg)("prisma", resolveOpts);
9430
+ const clientDir = await (0, import_internals11.resolvePkg)("@prisma/client", resolveOpts);
9431
+ const resolvedClientDir = clientDir && await import_promises3.default.realpath(clientDir);
9432
+ debug2("prismaCliDir", cliDir);
9433
+ debug2("prismaClientDir", clientDir);
6848
9434
  if (cliDir === void 0) return resolvedClientDir;
6849
9435
  if (clientDir === void 0) return resolvedClientDir;
6850
- const relDir = import_node_path.default.relative(cliDir, clientDir).split(import_node_path.default.sep);
9436
+ const relDir = import_node_path3.default.relative(cliDir, clientDir).split(import_node_path3.default.sep);
6851
9437
  if (relDir[0] !== ".." || relDir[1] === "..") return void 0;
6852
9438
  return resolvedClientDir;
6853
9439
  }
@@ -6855,34 +9441,56 @@ async function getPackageCmd(cwd, cmd, ...args) {
6855
9441
  const agent = await (0, import_ni.detect)({ cwd, autoInstall: false, programmatic: true });
6856
9442
  return (0, import_ni.getCommand)(agent ?? "npm", cmd, args);
6857
9443
  }
9444
+ async function isYarnUsed(baseDir) {
9445
+ const agent = await (0, import_ni.detect)({ cwd: baseDir, autoInstall: false, programmatic: true });
9446
+ return agent === "yarn" || agent === "yarn@berry";
9447
+ }
9448
+ async function runPackageCmd(cwd, cmd, ...args) {
9449
+ await execaCommand(await getPackageCmd(cwd, cmd, ...args), {
9450
+ // we skip this because we are already in the generator
9451
+ env: { PRISMA_SKIP_POSTINSTALL_GENERATE: "true" },
9452
+ stdio: "inherit",
9453
+ cwd
9454
+ });
9455
+ }
6858
9456
 
6859
9457
  // src/generator.ts
9458
+ var debug3 = (0, import_debug3.Debug)("prisma:client:generator");
6860
9459
  var PrismaClientJsGenerator = class {
6861
9460
  name = "prisma-client-js";
6862
9461
  #shouldResolvePrismaClient;
9462
+ #shouldInstallMissingPackages;
6863
9463
  #runtimePath;
6864
9464
  #cachedPrismaClientPath;
6865
- constructor({ shouldResolvePrismaClient = true, runtimePath } = {}) {
9465
+ constructor({
9466
+ shouldResolvePrismaClient = true,
9467
+ shouldInstallMissingPackages = true,
9468
+ runtimePath
9469
+ } = {}) {
6866
9470
  this.#shouldResolvePrismaClient = shouldResolvePrismaClient;
9471
+ this.#shouldInstallMissingPackages = shouldInstallMissingPackages;
6867
9472
  this.#runtimePath = runtimePath;
6868
9473
  }
6869
9474
  async getManifest(config) {
9475
+ const requiresEngines = (0, import_ts_pattern.match)((0, import_internals12.getClientEngineType)(config)).with(import_internals12.ClientEngineType.Library, () => ["libqueryEngine"]).with(import_internals12.ClientEngineType.Binary, () => ["queryEngine"]).with(import_internals12.ClientEngineType.Client, () => []).exhaustive();
9476
+ debug3("requiresEngines", requiresEngines);
6870
9477
  const defaultOutput = this.#shouldResolvePrismaClient ? await this.#getPrismaClientPath(config) : ".prisma/client";
6871
9478
  return {
6872
9479
  defaultOutput,
6873
9480
  prettyName: "Prisma Client",
6874
9481
  version,
6875
- requiresEngines: [],
9482
+ requiresEngines,
6876
9483
  requiresEngineVersion: import_engines_version.enginesVersion
6877
9484
  };
6878
9485
  }
6879
9486
  async generate(options) {
6880
- const outputDir = (0, import_internals9.parseEnvValue)(options.generator.output);
9487
+ const outputDir = (0, import_internals12.parseEnvValue)(options.generator.output);
6881
9488
  await generateClient({
6882
9489
  datamodel: options.datamodel,
6883
9490
  schemaPath: options.schemaPath,
6884
9491
  binaryPaths: options.binaryPaths,
6885
9492
  datasources: options.datasources,
9493
+ envPaths: options.envPaths,
6886
9494
  outputDir,
6887
9495
  copyRuntime: Boolean(options.generator.config.copyRuntime),
6888
9496
  copyRuntimeSourceMaps: Boolean(process.env.PRISMA_COPY_RUNTIME_SOURCEMAPS),
@@ -6892,6 +9500,8 @@ var PrismaClientJsGenerator = class {
6892
9500
  engineVersion: options.version,
6893
9501
  clientVersion: version,
6894
9502
  activeProvider: options.datasources[0]?.activeProvider,
9503
+ postinstall: options.postinstall,
9504
+ copyEngine: !options.noEngine,
6895
9505
  typedSql: options.typedSql
6896
9506
  });
6897
9507
  }
@@ -6899,20 +9509,27 @@ var PrismaClientJsGenerator = class {
6899
9509
  if (this.#cachedPrismaClientPath) {
6900
9510
  return this.#cachedPrismaClientPath;
6901
9511
  }
6902
- this.#cachedPrismaClientPath = await resolvePrismaClient(import_node_path2.default.dirname(config.sourceFilePath));
9512
+ this.#cachedPrismaClientPath = await this.#resolveOrInstallPrismaClient(import_node_path4.default.dirname(config.sourceFilePath));
6903
9513
  return this.#cachedPrismaClientPath;
6904
9514
  }
6905
9515
  async #getRuntimePath(config) {
6906
9516
  if (this.#runtimePath) {
6907
9517
  return this.#runtimePath;
6908
9518
  }
6909
- this.#runtimePath = import_node_path2.default.join(await this.#getPrismaClientPath(config), "runtime");
9519
+ this.#runtimePath = import_node_path4.default.join(await this.#getPrismaClientPath(config), "runtime");
6910
9520
  return this.#runtimePath;
6911
9521
  }
9522
+ async #resolveOrInstallPrismaClient(baseDir) {
9523
+ if (this.#shouldInstallMissingPackages && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
9524
+ return await resolveOrInstallPrismaClient(baseDir, version);
9525
+ } else {
9526
+ return await resolvePrismaClient(baseDir);
9527
+ }
9528
+ }
6912
9529
  };
6913
9530
 
6914
9531
  // src/utils/types/dmmfToTypes.ts
6915
- var import_node_path3 = __toESM(require("node:path"));
9532
+ var import_node_path5 = __toESM(require("node:path"));
6916
9533
  function dmmfToTypes(dmmf) {
6917
9534
  return new TSClient({
6918
9535
  dmmf,
@@ -6920,8 +9537,9 @@ function dmmfToTypes(dmmf) {
6920
9537
  clientVersion: "",
6921
9538
  engineVersion: "",
6922
9539
  runtimeBase: "@prisma/client",
6923
- runtimeName: "client",
6924
- runtimeSourcePath: import_node_path3.default.join(__dirname, "../../../runtime"),
9540
+ runtimeNameJs: "library",
9541
+ runtimeNameTs: "library",
9542
+ runtimeSourcePath: import_node_path5.default.join(__dirname, "../../../runtime"),
6925
9543
  schemaPath: "",
6926
9544
  outputDir: "",
6927
9545
  activeProvider: "",
@@ -6939,7 +9557,11 @@ function dmmfToTypes(dmmf) {
6939
9557
  datamodel: "",
6940
9558
  browser: false,
6941
9559
  edge: false,
6942
- wasm: false
9560
+ wasm: false,
9561
+ envPaths: {
9562
+ rootEnvPath: null,
9563
+ schemaEnvPath: void 0
9564
+ }
6943
9565
  }).toTS();
6944
9566
  }
6945
9567
  // Annotate the CommonJS export names for ESM import in node: