@prisma/client-generator-ts 7.3.0-integration-prisma6-fix-cloudflare-engine.3 → 7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.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.
- package/dist/TSClient/Args.d.ts +5 -5
- package/dist/TSClient/GenerateContext.d.ts +5 -2
- package/dist/TSClient/NullTypes.d.ts +1 -1
- package/dist/TSClient/PrismaClient.d.ts +0 -1
- package/dist/TSClient/TSClient.d.ts +1 -1
- package/dist/TSClient/file-generators/BrowserFile.d.ts +1 -1
- package/dist/generateClient.d.ts +2 -7
- package/dist/index.d.mts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +320 -523
- package/dist/index.mjs +299 -508
- package/dist/runtime-targets.d.ts +3 -3
- package/dist/utils/buildDebugInitialization.d.ts +1 -1
- package/dist/utils/runtimeImport.d.ts +1 -8
- package/dist/utils/wasm.d.ts +4 -3
- package/package.json +10 -11
- package/dist/TSClient/Datasources.d.ts +0 -6
- package/dist/extractSqliteSources.d.ts +0 -6
- package/dist/extractSqliteSources.test.d.ts +0 -1
- package/dist/resolveDatasources.d.ts +0 -1
- package/dist/resolveDatasources.test.d.ts +0 -1
- package/dist/serializeDatasources.d.ts +0 -4
- package/dist/serializeDatasources.test.d.ts +0 -1
- package/dist/utils/buildInjectableEdgeEnv.d.ts +0 -20
- package/dist/utils/buildInlineDatasources.d.ts +0 -3
- package/dist/utils/buildNFTAnnotations.d.ts +0 -11
- package/dist/utils/buildNFTAnnotations.test.d.ts +0 -1
package/dist/index.mjs
CHANGED
|
@@ -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(
|
|
114
|
+
fs3.lchmod = function(path3, 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(
|
|
121
|
+
fs3.lchown = function(path3, uid, gid, cb) {
|
|
122
122
|
if (cb) process.nextTick(cb);
|
|
123
123
|
};
|
|
124
124
|
fs3.lchownSync = function() {
|
|
@@ -185,9 +185,9 @@ var require_polyfills = __commonJS({
|
|
|
185
185
|
};
|
|
186
186
|
}(fs3.readSync);
|
|
187
187
|
function patchLchmod(fs4) {
|
|
188
|
-
fs4.lchmod = function(
|
|
188
|
+
fs4.lchmod = function(path3, mode, callback) {
|
|
189
189
|
fs4.open(
|
|
190
|
-
|
|
190
|
+
path3,
|
|
191
191
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
192
192
|
mode,
|
|
193
193
|
function(err, fd) {
|
|
@@ -203,8 +203,8 @@ var require_polyfills = __commonJS({
|
|
|
203
203
|
}
|
|
204
204
|
);
|
|
205
205
|
};
|
|
206
|
-
fs4.lchmodSync = function(
|
|
207
|
-
var fd = fs4.openSync(
|
|
206
|
+
fs4.lchmodSync = function(path3, mode) {
|
|
207
|
+
var fd = fs4.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
208
208
|
var threw = true;
|
|
209
209
|
var ret;
|
|
210
210
|
try {
|
|
@@ -225,8 +225,8 @@ var require_polyfills = __commonJS({
|
|
|
225
225
|
}
|
|
226
226
|
function patchLutimes(fs4) {
|
|
227
227
|
if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
|
|
228
|
-
fs4.lutimes = function(
|
|
229
|
-
fs4.open(
|
|
228
|
+
fs4.lutimes = function(path3, at, mt, cb) {
|
|
229
|
+
fs4.open(path3, constants.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(
|
|
242
|
-
var fd = fs4.openSync(
|
|
241
|
+
fs4.lutimesSync = function(path3, at, mt) {
|
|
242
|
+
var fd = fs4.openSync(path3, constants.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(
|
|
362
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
361
|
+
function ReadStream(path3, options) {
|
|
362
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path3, options);
|
|
363
363
|
Stream.call(this);
|
|
364
364
|
var self = this;
|
|
365
|
-
this.path =
|
|
365
|
+
this.path = path3;
|
|
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(
|
|
411
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
410
|
+
function WriteStream(path3, options) {
|
|
411
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path3, options);
|
|
412
412
|
Stream.call(this);
|
|
413
|
-
this.path =
|
|
413
|
+
this.path = path3;
|
|
414
414
|
this.fd = null;
|
|
415
415
|
this.writable = true;
|
|
416
416
|
this.flags = "w";
|
|
@@ -494,11 +494,11 @@ var require_graceful_fs = __commonJS({
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
var
|
|
497
|
+
var debug2 = noop;
|
|
498
498
|
if (util.debuglog)
|
|
499
|
-
|
|
499
|
+
debug2 = util.debuglog("gfs4");
|
|
500
500
|
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
501
|
-
|
|
501
|
+
debug2 = 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
|
-
|
|
536
|
+
debug2(fs3[gracefulQueue]);
|
|
537
537
|
__require("assert").equal(fs3[gracefulQueue].length, 0);
|
|
538
538
|
});
|
|
539
539
|
}
|
|
@@ -554,14 +554,14 @@ var require_graceful_fs = __commonJS({
|
|
|
554
554
|
fs4.createWriteStream = createWriteStream;
|
|
555
555
|
var fs$readFile = fs4.readFile;
|
|
556
556
|
fs4.readFile = readFile;
|
|
557
|
-
function readFile(
|
|
557
|
+
function readFile(path3, options, cb) {
|
|
558
558
|
if (typeof options === "function")
|
|
559
559
|
cb = options, options = null;
|
|
560
|
-
return go$readFile(
|
|
561
|
-
function go$readFile(
|
|
562
|
-
return fs$readFile(
|
|
560
|
+
return go$readFile(path3, options, cb);
|
|
561
|
+
function go$readFile(path4, options2, cb2, startTime) {
|
|
562
|
+
return fs$readFile(path4, options2, function(err) {
|
|
563
563
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
564
|
-
enqueue([go$readFile, [
|
|
564
|
+
enqueue([go$readFile, [path4, 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(
|
|
574
|
+
function writeFile(path3, data, options, cb) {
|
|
575
575
|
if (typeof options === "function")
|
|
576
576
|
cb = options, options = null;
|
|
577
|
-
return go$writeFile(
|
|
578
|
-
function go$writeFile(
|
|
579
|
-
return fs$writeFile(
|
|
577
|
+
return go$writeFile(path3, data, options, cb);
|
|
578
|
+
function go$writeFile(path4, data2, options2, cb2, startTime) {
|
|
579
|
+
return fs$writeFile(path4, data2, options2, function(err) {
|
|
580
580
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
581
|
-
enqueue([go$writeFile, [
|
|
581
|
+
enqueue([go$writeFile, [path4, 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(
|
|
592
|
+
function appendFile(path3, data, options, cb) {
|
|
593
593
|
if (typeof options === "function")
|
|
594
594
|
cb = options, options = null;
|
|
595
|
-
return go$appendFile(
|
|
596
|
-
function go$appendFile(
|
|
597
|
-
return fs$appendFile(
|
|
595
|
+
return go$appendFile(path3, data, options, cb);
|
|
596
|
+
function go$appendFile(path4, data2, options2, cb2, startTime) {
|
|
597
|
+
return fs$appendFile(path4, data2, options2, function(err) {
|
|
598
598
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
599
|
-
enqueue([go$appendFile, [
|
|
599
|
+
enqueue([go$appendFile, [path4, 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(
|
|
630
|
+
function readdir(path3, 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(
|
|
634
|
-
return fs$readdir(
|
|
635
|
-
|
|
633
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path4, options2, cb2, startTime) {
|
|
634
|
+
return fs$readdir(path4, fs$readdirCallback(
|
|
635
|
+
path4,
|
|
636
636
|
options2,
|
|
637
637
|
cb2,
|
|
638
638
|
startTime
|
|
639
639
|
));
|
|
640
|
-
} : function go$readdir2(
|
|
641
|
-
return fs$readdir(
|
|
642
|
-
|
|
640
|
+
} : function go$readdir2(path4, options2, cb2, startTime) {
|
|
641
|
+
return fs$readdir(path4, options2, fs$readdirCallback(
|
|
642
|
+
path4,
|
|
643
643
|
options2,
|
|
644
644
|
cb2,
|
|
645
645
|
startTime
|
|
646
646
|
));
|
|
647
647
|
};
|
|
648
|
-
return go$readdir(
|
|
649
|
-
function fs$readdirCallback(
|
|
648
|
+
return go$readdir(path3, options, cb);
|
|
649
|
+
function fs$readdirCallback(path4, 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
|
-
[
|
|
654
|
+
[path4, 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(
|
|
725
|
+
function ReadStream(path3, 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(
|
|
745
|
+
function WriteStream(path3, 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(
|
|
764
|
-
return new fs4.ReadStream(
|
|
763
|
+
function createReadStream(path3, options) {
|
|
764
|
+
return new fs4.ReadStream(path3, options);
|
|
765
765
|
}
|
|
766
|
-
function createWriteStream(
|
|
767
|
-
return new fs4.WriteStream(
|
|
766
|
+
function createWriteStream(path3, options) {
|
|
767
|
+
return new fs4.WriteStream(path3, options);
|
|
768
768
|
}
|
|
769
769
|
var fs$open = fs4.open;
|
|
770
770
|
fs4.open = open;
|
|
771
|
-
function open(
|
|
771
|
+
function open(path3, flags, mode, cb) {
|
|
772
772
|
if (typeof mode === "function")
|
|
773
773
|
cb = mode, mode = null;
|
|
774
|
-
return go$open(
|
|
775
|
-
function go$open(
|
|
776
|
-
return fs$open(
|
|
774
|
+
return go$open(path3, flags, mode, cb);
|
|
775
|
+
function go$open(path4, flags2, mode2, cb2, startTime) {
|
|
776
|
+
return fs$open(path4, flags2, mode2, function(err, fd) {
|
|
777
777
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
778
|
-
enqueue([go$open, [
|
|
778
|
+
enqueue([go$open, [path4, 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
|
-
|
|
789
|
+
debug2("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
|
-
|
|
816
|
+
debug2("RETRY", fn.name, args);
|
|
817
817
|
fn.apply(null, args);
|
|
818
818
|
} else if (Date.now() - startTime >= 6e4) {
|
|
819
|
-
|
|
819
|
+
debug2("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
|
-
|
|
828
|
+
debug2("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"(exports, module) {
|
|
960
960
|
"use strict";
|
|
961
|
-
var
|
|
961
|
+
var path3 = __require("path");
|
|
962
962
|
module.exports.checkPath = function checkPath(pth) {
|
|
963
963
|
if (process.platform === "win32") {
|
|
964
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
964
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path3.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(
|
|
1029
|
-
return fs3.access(
|
|
1028
|
+
function pathExists(path3) {
|
|
1029
|
+
return fs3.access(path3).then(() => true).catch(() => false);
|
|
1030
1030
|
}
|
|
1031
1031
|
module.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(
|
|
1045
|
-
const fd = await fs3.open(
|
|
1044
|
+
async function utimesMillis(path3, atime, mtime) {
|
|
1045
|
+
const fd = await fs3.open(path3, "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(
|
|
1061
|
-
const fd = fs3.openSync(
|
|
1060
|
+
function utimesMillisSync(path3, atime, mtime) {
|
|
1061
|
+
const fd = fs3.openSync(path3, "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"(exports, module) {
|
|
1075
1075
|
"use strict";
|
|
1076
1076
|
var fs3 = require_fs();
|
|
1077
|
-
var
|
|
1077
|
+
var path3 = __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 =
|
|
1106
|
-
const destBaseName =
|
|
1105
|
+
const srcBaseName = path3.basename(src);
|
|
1106
|
+
const destBaseName = path3.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 =
|
|
1129
|
-
const destBaseName =
|
|
1128
|
+
const srcBaseName = path3.basename(src);
|
|
1129
|
+
const destBaseName = path3.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 =
|
|
1149
|
-
const destParent =
|
|
1150
|
-
if (destParent === srcParent || destParent ===
|
|
1148
|
+
const srcParent = path3.resolve(path3.dirname(src));
|
|
1149
|
+
const destParent = path3.resolve(path3.dirname(dest));
|
|
1150
|
+
if (destParent === srcParent || destParent === path3.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 =
|
|
1165
|
-
const destParent =
|
|
1166
|
-
if (destParent === srcParent || destParent ===
|
|
1164
|
+
const srcParent = path3.resolve(path3.dirname(src));
|
|
1165
|
+
const destParent = path3.resolve(path3.dirname(dest));
|
|
1166
|
+
if (destParent === srcParent || destParent === path3.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 =
|
|
1184
|
-
const destArr =
|
|
1183
|
+
const srcArr = path3.resolve(src).split(path3.sep).filter((i) => i);
|
|
1184
|
+
const destArr = path3.resolve(dest).split(path3.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"(exports, module) {
|
|
1207
1207
|
"use strict";
|
|
1208
1208
|
var fs3 = require_fs();
|
|
1209
|
-
var
|
|
1209
|
+
var path3 = __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 =
|
|
1231
|
+
const destParent = path3.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 =
|
|
1286
|
-
const destItem =
|
|
1285
|
+
const srcItem = path3.join(src, item.name);
|
|
1286
|
+
const destItem = path3.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 =
|
|
1305
|
+
resolvedSrc = path3.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 =
|
|
1318
|
+
resolvedDest = path3.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"(exports, module) {
|
|
1336
1336
|
"use strict";
|
|
1337
1337
|
var fs3 = require_graceful_fs();
|
|
1338
|
-
var
|
|
1338
|
+
var path3 = __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 =
|
|
1359
|
+
const destParent = path3.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 =
|
|
1429
|
-
const destItem =
|
|
1428
|
+
const srcItem = path3.join(src, item);
|
|
1429
|
+
const destItem = path3.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 =
|
|
1437
|
+
resolvedSrc = path3.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 =
|
|
1450
|
+
resolvedDest = path3.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(
|
|
1488
|
-
fs3.rm(
|
|
1487
|
+
function remove(path3, callback) {
|
|
1488
|
+
fs3.rm(path3, { recursive: true, force: true }, callback);
|
|
1489
1489
|
}
|
|
1490
|
-
function removeSync(
|
|
1491
|
-
fs3.rmSync(
|
|
1490
|
+
function removeSync(path3) {
|
|
1491
|
+
fs3.rmSync(path3, { recursive: true, force: true });
|
|
1492
1492
|
}
|
|
1493
1493
|
module.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
|
|
1506
|
+
var path3 = __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(
|
|
1516
|
+
return Promise.all(items.map((item) => remove.remove(path3.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 =
|
|
1526
|
+
item = path3.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"(exports, module) {
|
|
1542
1542
|
"use strict";
|
|
1543
1543
|
var u = require_universalify().fromPromise;
|
|
1544
|
-
var
|
|
1544
|
+
var path3 = __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 =
|
|
1554
|
+
const dir = path3.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 =
|
|
1580
|
+
const dir = path3.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"(exports, module) {
|
|
1601
1601
|
"use strict";
|
|
1602
1602
|
var u = require_universalify().fromPromise;
|
|
1603
|
-
var
|
|
1603
|
+
var path3 = __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 =
|
|
1622
|
+
const dir = path3.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 =
|
|
1642
|
+
const dir = path3.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"(exports, module) {
|
|
1658
1658
|
"use strict";
|
|
1659
|
-
var
|
|
1659
|
+
var path3 = __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 (
|
|
1664
|
+
if (path3.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 =
|
|
1677
|
-
const relativeToDst =
|
|
1676
|
+
const dstdir = path3.dirname(dstpath);
|
|
1677
|
+
const relativeToDst = path3.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:
|
|
1693
|
+
toDst: path3.relative(dstdir, srcpath)
|
|
1694
1694
|
};
|
|
1695
1695
|
}
|
|
1696
1696
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1697
|
-
if (
|
|
1697
|
+
if (path3.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 =
|
|
1706
|
-
const relativeToDst =
|
|
1705
|
+
const dstdir = path3.dirname(dstpath);
|
|
1706
|
+
const relativeToDst = path3.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:
|
|
1718
|
+
toDst: path3.relative(dstdir, srcpath)
|
|
1719
1719
|
};
|
|
1720
1720
|
}
|
|
1721
1721
|
module.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"(exports, module) {
|
|
1764
1764
|
"use strict";
|
|
1765
1765
|
var u = require_universalify().fromPromise;
|
|
1766
|
-
var
|
|
1766
|
+
var path3 = __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 =
|
|
1789
|
+
const dir = path3.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 =
|
|
1809
|
+
const dir = path3.dirname(dstpath);
|
|
1810
1810
|
const exists = fs3.existsSync(dir);
|
|
1811
1811
|
if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
|
|
1812
1812
|
mkdirsSync(dir);
|
|
@@ -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
|
|
1961
|
+
var path3 = __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 =
|
|
1965
|
+
const dir = path3.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 =
|
|
1972
|
+
const dir = path3.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"(exports, module) {
|
|
2034
2034
|
"use strict";
|
|
2035
2035
|
var fs3 = require_fs();
|
|
2036
|
-
var
|
|
2036
|
+
var path3 = __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 =
|
|
2047
|
-
const parsedParentPath =
|
|
2046
|
+
const destParent = path3.dirname(dest);
|
|
2047
|
+
const parsedParentPath = path3.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"(exports, module) {
|
|
2086
2086
|
"use strict";
|
|
2087
2087
|
var fs3 = require_graceful_fs();
|
|
2088
|
-
var
|
|
2088
|
+
var path3 = __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(
|
|
2098
|
+
if (!isParentRoot(dest)) mkdirpSync(path3.dirname(dest));
|
|
2099
2099
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2100
2100
|
}
|
|
2101
2101
|
function isParentRoot(dest) {
|
|
2102
|
-
const parent =
|
|
2103
|
-
const parsedPath =
|
|
2102
|
+
const parent = path3.dirname(dest);
|
|
2103
|
+
const parsedPath = path3.parse(parent);
|
|
2104
2104
|
return parsedPath.root === parent;
|
|
2105
2105
|
}
|
|
2106
2106
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2214,15 +2214,8 @@ function getMappings(mappings, datamodel) {
|
|
|
2214
2214
|
// src/generateClient.ts
|
|
2215
2215
|
var import_fs_extra = __toESM(require_lib());
|
|
2216
2216
|
import fs2 from "node:fs/promises";
|
|
2217
|
-
import
|
|
2218
|
-
import {
|
|
2219
|
-
import {
|
|
2220
|
-
assertNever as assertNever3,
|
|
2221
|
-
ClientEngineType as ClientEngineType3,
|
|
2222
|
-
getClientEngineType as getClientEngineType4,
|
|
2223
|
-
pathToPosix as pathToPosix3,
|
|
2224
|
-
setClassName
|
|
2225
|
-
} from "@prisma/internals";
|
|
2217
|
+
import path2 from "node:path";
|
|
2218
|
+
import { assertNever as assertNever3, pathToPosix, setClassName } from "@prisma/internals";
|
|
2226
2219
|
import { glob } from "fast-glob";
|
|
2227
2220
|
|
|
2228
2221
|
// ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs
|
|
@@ -2381,7 +2374,7 @@ var Enum = class {
|
|
|
2381
2374
|
toTS() {
|
|
2382
2375
|
const { type } = this;
|
|
2383
2376
|
const enumVariants = `{
|
|
2384
|
-
${indent(type.
|
|
2377
|
+
${indent(type.data.map((v) => `${v.key}: ${this.getValue(v.value)}`).join(",\n"), TAB_SIZE)}
|
|
2385
2378
|
} as const`;
|
|
2386
2379
|
const enumBody = this.isStrictEnum() ? `runtime.makeStrictEnum(${enumVariants})` : enumVariants;
|
|
2387
2380
|
return `export const ${type.name} = ${enumBody}
|
|
@@ -2894,9 +2887,6 @@ var GenericArgsInfo = class {
|
|
|
2894
2887
|
}
|
|
2895
2888
|
};
|
|
2896
2889
|
|
|
2897
|
-
// src/TSClient/file-generators/BrowserFile.ts
|
|
2898
|
-
import { getClientEngineType } from "@prisma/internals";
|
|
2899
|
-
|
|
2900
2890
|
// src/TSClient/ModelExports.ts
|
|
2901
2891
|
import * as ts3 from "@prisma/ts-builders";
|
|
2902
2892
|
function modelExports(context) {
|
|
@@ -2922,9 +2912,7 @@ var jsDocHeader = `/*
|
|
|
2922
2912
|
* \u{1F7E2} You can import this file directly.
|
|
2923
2913
|
*/
|
|
2924
2914
|
`;
|
|
2925
|
-
function createBrowserFile(context,
|
|
2926
|
-
const clientEngineType = getClientEngineType(options.generator);
|
|
2927
|
-
options.generator.config.engineType = clientEngineType;
|
|
2915
|
+
function createBrowserFile(context, _options) {
|
|
2928
2916
|
return `${jsDocHeader}
|
|
2929
2917
|
import * as Prisma from '${context.importFileName("./internal/prismaNamespaceBrowser")}'
|
|
2930
2918
|
export { Prisma }
|
|
@@ -2935,50 +2923,14 @@ ${modelExports(context).join("\n")}
|
|
|
2935
2923
|
}
|
|
2936
2924
|
|
|
2937
2925
|
// src/TSClient/file-generators/ClassFile.ts
|
|
2938
|
-
import crypto from "node:crypto";
|
|
2939
|
-
import path2 from "node:path";
|
|
2940
|
-
import { getClientEngineType as getClientEngineType2, pathToPosix } from "@prisma/internals";
|
|
2941
2926
|
import * as ts6 from "@prisma/ts-builders";
|
|
2942
|
-
import ciInfo from "ci-info";
|
|
2943
|
-
|
|
2944
|
-
// src/utils/buildInjectableEdgeEnv.ts
|
|
2945
|
-
function buildInjectableEdgeEnv(edge, datasources) {
|
|
2946
|
-
if (edge === true) {
|
|
2947
|
-
return declareInjectableEdgeEnv(datasources);
|
|
2948
|
-
}
|
|
2949
|
-
return ``;
|
|
2950
|
-
}
|
|
2951
|
-
function declareInjectableEdgeEnv(datasources) {
|
|
2952
|
-
const injectableEdgeEnv = { parsed: {} };
|
|
2953
|
-
const envVarNames = getSelectedEnvVarNames(datasources);
|
|
2954
|
-
for (const envVarName of envVarNames) {
|
|
2955
|
-
injectableEdgeEnv.parsed[envVarName] = getRuntimeEdgeEnvVar(envVarName);
|
|
2956
|
-
}
|
|
2957
|
-
const injectableEdgeEnvJson = JSON.stringify(injectableEdgeEnv, null, 2);
|
|
2958
|
-
const injectableEdgeEnvCode = injectableEdgeEnvJson.replace(/"/g, "");
|
|
2959
|
-
return `
|
|
2960
|
-
config.injectableEdgeEnv = () => (${injectableEdgeEnvCode})`;
|
|
2961
|
-
}
|
|
2962
|
-
function getSelectedEnvVarNames(datasources) {
|
|
2963
|
-
return datasources.reduce((acc, datasource) => {
|
|
2964
|
-
if (datasource.url.fromEnvVar) {
|
|
2965
|
-
return [...acc, datasource.url.fromEnvVar];
|
|
2966
|
-
}
|
|
2967
|
-
return acc;
|
|
2968
|
-
}, []);
|
|
2969
|
-
}
|
|
2970
|
-
function getRuntimeEdgeEnvVar(envVarName) {
|
|
2971
|
-
const cfwEnv = `typeof globalThis !== 'undefined' && globalThis['${envVarName}']`;
|
|
2972
|
-
const nodeOrVercelEnv = `typeof process !== 'undefined' && process.env && process.env.${envVarName}`;
|
|
2973
|
-
return `${cfwEnv} || ${nodeOrVercelEnv} || undefined`;
|
|
2974
|
-
}
|
|
2975
2927
|
|
|
2976
2928
|
// src/utils/buildDebugInitialization.ts
|
|
2977
2929
|
function buildDebugInitialization(edge) {
|
|
2978
2930
|
if (!edge) {
|
|
2979
2931
|
return "";
|
|
2980
2932
|
}
|
|
2981
|
-
const debugVar =
|
|
2933
|
+
const debugVar = `typeof globalThis !== 'undefined' && globalThis['DEBUG'] || (typeof process !== 'undefined' && process.env && process.env.DEBUG) || undefined`;
|
|
2982
2934
|
return `if (${debugVar}) {
|
|
2983
2935
|
runtime.Debug.enable(${debugVar})
|
|
2984
2936
|
}
|
|
@@ -3455,7 +3407,7 @@ function escapeJson(str) {
|
|
|
3455
3407
|
function buildRuntimeDataModel(datamodel, runtimeName) {
|
|
3456
3408
|
const runtimeDataModel = dmmfToRuntimeDataModel(datamodel);
|
|
3457
3409
|
let prunedDataModel;
|
|
3458
|
-
if (runtimeName === "wasm-
|
|
3410
|
+
if (runtimeName === "wasm-compiler-edge" || runtimeName === "client") {
|
|
3459
3411
|
prunedDataModel = pruneRuntimeDataModel(runtimeDataModel);
|
|
3460
3412
|
} else {
|
|
3461
3413
|
prunedDataModel = runtimeDataModel;
|
|
@@ -3465,50 +3417,35 @@ function buildRuntimeDataModel(datamodel, runtimeName) {
|
|
|
3465
3417
|
config.runtimeDataModel = JSON.parse(${JSON.stringify(datamodelString)})`;
|
|
3466
3418
|
}
|
|
3467
3419
|
|
|
3468
|
-
// src/utils/buildInlineDatasources.ts
|
|
3469
|
-
function buildInlineDatasources(datasources) {
|
|
3470
|
-
return datasources.reduce((acc, ds) => {
|
|
3471
|
-
return acc[ds.name] = buildInlineDatasource(ds), acc;
|
|
3472
|
-
}, {});
|
|
3473
|
-
}
|
|
3474
|
-
function buildInlineDatasource(ds) {
|
|
3475
|
-
if (ds.url.fromEnvVar) {
|
|
3476
|
-
return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
|
|
3477
|
-
} else {
|
|
3478
|
-
return { url: { fromEnvVar: null, value: ds.url.value } };
|
|
3479
|
-
}
|
|
3480
|
-
}
|
|
3481
|
-
|
|
3482
3420
|
// src/utils/wasm.ts
|
|
3483
3421
|
import fs from "node:fs";
|
|
3484
3422
|
import path from "node:path";
|
|
3485
|
-
import { capitalize as capitalize6 } from "@prisma/client-common";
|
|
3486
3423
|
import { Debug } from "@prisma/debug";
|
|
3487
3424
|
import { match } from "ts-pattern";
|
|
3488
3425
|
var debug = Debug("prisma:client-generator-ts:wasm");
|
|
3489
|
-
function usesEdgeWasmRuntime(
|
|
3490
|
-
return runtimeName === "wasm-
|
|
3426
|
+
function usesEdgeWasmRuntime(runtimeName) {
|
|
3427
|
+
return runtimeName === "wasm-compiler-edge";
|
|
3491
3428
|
}
|
|
3492
3429
|
function buildGetWasmModule({
|
|
3493
|
-
component,
|
|
3494
3430
|
runtimeName,
|
|
3495
3431
|
runtimeBase,
|
|
3496
3432
|
activeProvider,
|
|
3497
|
-
moduleFormat
|
|
3433
|
+
moduleFormat,
|
|
3434
|
+
compilerBuild
|
|
3498
3435
|
}) {
|
|
3499
|
-
const capitalizedComponent = capitalize6(component);
|
|
3500
3436
|
const extension = match(moduleFormat).with("esm", () => "mjs").with("cjs", () => "js").exhaustive();
|
|
3501
|
-
const buildNonEdgeLoader =
|
|
3502
|
-
const buildEdgeLoader =
|
|
3437
|
+
const buildNonEdgeLoader = runtimeName === "client";
|
|
3438
|
+
const buildEdgeLoader = !buildNonEdgeLoader;
|
|
3439
|
+
const artifactName = `query_compiler_${compilerBuild}_bg`;
|
|
3503
3440
|
let wasmPathBase;
|
|
3504
3441
|
let wasmBindingsPath;
|
|
3505
3442
|
let wasmModulePath;
|
|
3506
3443
|
if (buildEdgeLoader) {
|
|
3507
|
-
wasmPathBase =
|
|
3444
|
+
wasmPathBase = `./${artifactName}`;
|
|
3508
3445
|
wasmBindingsPath = `${wasmPathBase}.js`;
|
|
3509
3446
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3510
3447
|
} else {
|
|
3511
|
-
wasmPathBase = `${runtimeBase}
|
|
3448
|
+
wasmPathBase = `${runtimeBase}/${artifactName}.${activeProvider}`;
|
|
3512
3449
|
wasmBindingsPath = `${wasmPathBase}.mjs`;
|
|
3513
3450
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3514
3451
|
}
|
|
@@ -3522,26 +3459,30 @@ async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Modul
|
|
|
3522
3459
|
return new WebAssembly.Module(wasmArray)
|
|
3523
3460
|
}
|
|
3524
3461
|
|
|
3525
|
-
config
|
|
3462
|
+
config.compilerWasm = {
|
|
3526
3463
|
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3527
3464
|
|
|
3528
|
-
|
|
3465
|
+
getQueryCompilerWasmModule: async () => {
|
|
3529
3466
|
const { wasm } = await import(${JSON.stringify(wasmModulePath)})
|
|
3530
3467
|
return await decodeBase64AsWasm(wasm)
|
|
3531
|
-
}
|
|
3468
|
+
},
|
|
3469
|
+
|
|
3470
|
+
importName: ${JSON.stringify(`./${artifactName}.js`)}
|
|
3532
3471
|
}`;
|
|
3533
3472
|
}
|
|
3534
3473
|
if (buildEdgeLoader) {
|
|
3535
|
-
return `config
|
|
3474
|
+
return `config.compilerWasm = {
|
|
3536
3475
|
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3537
3476
|
|
|
3538
|
-
|
|
3477
|
+
getQueryCompilerWasmModule: async () => {
|
|
3539
3478
|
const { default: module } = await import(${JSON.stringify(`${wasmModulePath}?module`)})
|
|
3540
3479
|
return module
|
|
3541
|
-
}
|
|
3480
|
+
},
|
|
3481
|
+
|
|
3482
|
+
importName: ${JSON.stringify(`./${artifactName}.js`)}
|
|
3542
3483
|
}`;
|
|
3543
3484
|
}
|
|
3544
|
-
return `config
|
|
3485
|
+
return `config.compilerWasm = undefined`;
|
|
3545
3486
|
}
|
|
3546
3487
|
function readSourceFile(sourceFile) {
|
|
3547
3488
|
const bundledLocation = path.join(__dirname, sourceFile);
|
|
@@ -3556,36 +3497,32 @@ function readSourceFile(sourceFile) {
|
|
|
3556
3497
|
throw new Error(`Could not find ${sourceFile} in ${bundledLocation} or ${sourceLocation}`);
|
|
3557
3498
|
}
|
|
3558
3499
|
}
|
|
3559
|
-
function buildWasmFileMap({ activeProvider, runtimeName }) {
|
|
3500
|
+
function buildWasmFileMap({ activeProvider, runtimeName, compilerBuild }) {
|
|
3560
3501
|
const fileMap = {};
|
|
3561
3502
|
debug("buildWasmFileMap with", { runtimeName });
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
}
|
|
3503
|
+
if (!usesEdgeWasmRuntime(runtimeName)) {
|
|
3504
|
+
debug("Skipping component compiler for runtime", runtimeName);
|
|
3505
|
+
return fileMap;
|
|
3506
|
+
}
|
|
3507
|
+
const artifactName = `query_compiler_${compilerBuild}_bg`;
|
|
3508
|
+
const fileNameBase = `${artifactName}.${activeProvider}`;
|
|
3509
|
+
const files = {
|
|
3510
|
+
[`${artifactName}.wasm`]: `${fileNameBase}.wasm`,
|
|
3511
|
+
[`${artifactName}.js`]: `${fileNameBase}.mjs`
|
|
3512
|
+
};
|
|
3513
|
+
for (const [targetFile, sourceFile] of Object.entries(files)) {
|
|
3514
|
+
fileMap[targetFile] = readSourceFile(sourceFile);
|
|
3575
3515
|
}
|
|
3576
3516
|
return fileMap;
|
|
3577
3517
|
}
|
|
3578
3518
|
|
|
3579
3519
|
// src/TSClient/PrismaClient.ts
|
|
3580
|
-
import { capitalize as
|
|
3520
|
+
import { capitalize as capitalize6, uncapitalize as uncapitalize4 } from "@prisma/client-common";
|
|
3581
3521
|
import * as ts5 from "@prisma/ts-builders";
|
|
3582
3522
|
import indent3 from "indent-string";
|
|
3583
3523
|
|
|
3584
3524
|
// src/utils/runtimeImport.ts
|
|
3585
3525
|
import * as ts4 from "@prisma/ts-builders";
|
|
3586
|
-
function runtimeImport(name) {
|
|
3587
|
-
return name;
|
|
3588
|
-
}
|
|
3589
3526
|
function runtimeImportedType(name) {
|
|
3590
3527
|
return ts4.namedType(`runtime.${name}`);
|
|
3591
3528
|
}
|
|
@@ -3659,7 +3596,7 @@ function queryRawDefinition(context) {
|
|
|
3659
3596
|
* const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
|
|
3660
3597
|
* \`\`\`
|
|
3661
3598
|
*
|
|
3662
|
-
* Read more in our [docs](https://
|
|
3599
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
3663
3600
|
*/
|
|
3664
3601
|
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
3665
3602
|
|
|
@@ -3671,7 +3608,7 @@ function queryRawDefinition(context) {
|
|
|
3671
3608
|
* const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
|
|
3672
3609
|
* \`\`\`
|
|
3673
3610
|
*
|
|
3674
|
-
* Read more in our [docs](https://
|
|
3611
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
3675
3612
|
*/
|
|
3676
3613
|
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`;
|
|
3677
3614
|
}
|
|
@@ -3687,7 +3624,7 @@ function executeRawDefinition(context) {
|
|
|
3687
3624
|
* const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
|
|
3688
3625
|
* \`\`\`
|
|
3689
3626
|
*
|
|
3690
|
-
* Read more in our [docs](https://
|
|
3627
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
3691
3628
|
*/
|
|
3692
3629
|
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
3693
3630
|
|
|
@@ -3699,7 +3636,7 @@ function executeRawDefinition(context) {
|
|
|
3699
3636
|
* const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
|
|
3700
3637
|
* \`\`\`
|
|
3701
3638
|
*
|
|
3702
|
-
* Read more in our [docs](https://
|
|
3639
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
3703
3640
|
*/
|
|
3704
3641
|
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
|
|
3705
3642
|
}
|
|
@@ -3729,24 +3666,6 @@ function queryRawTypedDefinition(context) {
|
|
|
3729
3666
|
).setReturnType(prismaPromise(ts5.array(param.toArgument())));
|
|
3730
3667
|
return ts5.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
3731
3668
|
}
|
|
3732
|
-
function metricDefinition(context) {
|
|
3733
|
-
if (!context.isPreviewFeatureOn("metrics")) {
|
|
3734
|
-
return "";
|
|
3735
|
-
}
|
|
3736
|
-
const property13 = ts5.property("$metrics", ts5.namedType(`runtime.${runtimeImport("MetricsClient")}`)).setDocComment(
|
|
3737
|
-
ts5.docComment`
|
|
3738
|
-
Gives access to the client metrics in json or prometheus format.
|
|
3739
|
-
|
|
3740
|
-
@example
|
|
3741
|
-
\`\`\`
|
|
3742
|
-
const metrics = await prisma.$metrics.json()
|
|
3743
|
-
// or
|
|
3744
|
-
const metrics = await prisma.$metrics.prometheus()
|
|
3745
|
-
\`\`\`
|
|
3746
|
-
`
|
|
3747
|
-
).readonly();
|
|
3748
|
-
return ts5.stringify(property13, { indentLevel: 1, newLine: "leading" });
|
|
3749
|
-
}
|
|
3750
3669
|
function runCommandRawDefinition(context) {
|
|
3751
3670
|
if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) {
|
|
3752
3671
|
return "";
|
|
@@ -3762,17 +3681,10 @@ function runCommandRawDefinition(context) {
|
|
|
3762
3681
|
})
|
|
3763
3682
|
\`\`\`
|
|
3764
3683
|
|
|
3765
|
-
Read more in our [docs](https://
|
|
3684
|
+
Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
3766
3685
|
`);
|
|
3767
3686
|
return ts5.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
3768
3687
|
}
|
|
3769
|
-
function eventRegistrationMethodDeclaration(runtimeName) {
|
|
3770
|
-
if (runtimeName === "binary") {
|
|
3771
|
-
return `$on<V extends (LogOpts | 'beforeExit')>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => runtime.Types.Utils.JsPromise<void> : Prisma.LogEvent) => void): PrismaClient;`;
|
|
3772
|
-
} else {
|
|
3773
|
-
return `$on<V extends LogOpts>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;`;
|
|
3774
|
-
}
|
|
3775
|
-
}
|
|
3776
3688
|
function getPrismaClientClassDocComment({ dmmf }) {
|
|
3777
3689
|
let example;
|
|
3778
3690
|
if (dmmf.mappings.modelOperations.length) {
|
|
@@ -3790,11 +3702,11 @@ function getPrismaClientClassDocComment({ dmmf }) {
|
|
|
3790
3702
|
@example
|
|
3791
3703
|
\`\`\`
|
|
3792
3704
|
const prisma = new PrismaClient()
|
|
3793
|
-
// Fetch zero or more ${
|
|
3705
|
+
// Fetch zero or more ${capitalize6(example.plural)}
|
|
3794
3706
|
const ${uncapitalize4(example.plural)} = await prisma.${uncapitalize4(example.model)}.findMany()
|
|
3795
3707
|
\`\`\`
|
|
3796
3708
|
|
|
3797
|
-
Read more in our [docs](https://
|
|
3709
|
+
Read more in our [docs](https://pris.ly/d/client).
|
|
3798
3710
|
`;
|
|
3799
3711
|
}
|
|
3800
3712
|
var PrismaClientClass = class {
|
|
@@ -3817,18 +3729,18 @@ export interface PrismaClientConstructor {
|
|
|
3817
3729
|
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
3818
3730
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
3819
3731
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
3820
|
-
>(options
|
|
3732
|
+
>(options: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
3821
3733
|
}
|
|
3822
3734
|
|
|
3823
3735
|
${this.jsDoc}
|
|
3824
3736
|
export interface PrismaClient<
|
|
3825
3737
|
in LogOpts extends Prisma.LogLevel = never,
|
|
3826
|
-
in out OmitOpts extends Prisma.PrismaClientOptions['omit'] =
|
|
3738
|
+
in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = undefined,
|
|
3827
3739
|
in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
3828
3740
|
> {
|
|
3829
3741
|
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
|
|
3830
3742
|
|
|
3831
|
-
$
|
|
3743
|
+
$on<V extends LogOpts>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
|
|
3832
3744
|
|
|
3833
3745
|
/**
|
|
3834
3746
|
* Connect with the database
|
|
@@ -3847,8 +3759,6 @@ ${[
|
|
|
3847
3759
|
batchingTransactionDefinition(this.context),
|
|
3848
3760
|
interactiveTransactionDefinition(this.context),
|
|
3849
3761
|
runCommandRawDefinition(this.context),
|
|
3850
|
-
metricDefinition(this.context),
|
|
3851
|
-
this.applyPendingMigrationsDefinition(),
|
|
3852
3762
|
extendsPropertyDefinition()
|
|
3853
3763
|
].filter((d) => d !== null).join("\n").trim()}
|
|
3854
3764
|
|
|
@@ -3863,7 +3773,7 @@ ${[
|
|
|
3863
3773
|
* \`prisma.${methodName}\`: Exposes CRUD operations for the **${m.model}** model.
|
|
3864
3774
|
* Example usage:
|
|
3865
3775
|
* \`\`\`ts
|
|
3866
|
-
* // Fetch zero or more ${
|
|
3776
|
+
* // Fetch zero or more ${capitalize6(m.plural)}
|
|
3867
3777
|
* const ${uncapitalize4(m.plural)} = await prisma.${methodName}.findMany()
|
|
3868
3778
|
* \`\`\`
|
|
3869
3779
|
*/
|
|
@@ -3873,15 +3783,6 @@ get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`;
|
|
|
3873
3783
|
)}
|
|
3874
3784
|
}`;
|
|
3875
3785
|
}
|
|
3876
|
-
applyPendingMigrationsDefinition() {
|
|
3877
|
-
if (this.runtimeName !== "react-native") {
|
|
3878
|
-
return null;
|
|
3879
|
-
}
|
|
3880
|
-
const method3 = ts5.method("$applyPendingMigrations").setReturnType(promise(ts5.voidType)).setDocComment(
|
|
3881
|
-
ts5.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.`
|
|
3882
|
-
);
|
|
3883
|
-
return ts5.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
3884
|
-
}
|
|
3885
3786
|
};
|
|
3886
3787
|
|
|
3887
3788
|
// src/TSClient/file-generators/ClassFile.ts
|
|
@@ -3907,8 +3808,7 @@ ${clientConfig(context, options)}
|
|
|
3907
3808
|
|
|
3908
3809
|
${prismaClientClass.toTS()}
|
|
3909
3810
|
|
|
3910
|
-
export function getPrismaClientClass(
|
|
3911
|
-
config.dirname = dirname
|
|
3811
|
+
export function getPrismaClientClass(): PrismaClientConstructor {
|
|
3912
3812
|
return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor
|
|
3913
3813
|
}
|
|
3914
3814
|
`;
|
|
@@ -3917,105 +3817,40 @@ function clientConfig(context, options) {
|
|
|
3917
3817
|
const {
|
|
3918
3818
|
edge,
|
|
3919
3819
|
generator,
|
|
3920
|
-
outputDir,
|
|
3921
3820
|
datamodel: inlineSchema,
|
|
3922
3821
|
runtimeBase,
|
|
3923
3822
|
runtimeName,
|
|
3924
|
-
datasources,
|
|
3925
|
-
copyEngine = true,
|
|
3926
3823
|
target,
|
|
3927
3824
|
activeProvider,
|
|
3928
|
-
moduleFormat
|
|
3825
|
+
moduleFormat,
|
|
3826
|
+
compilerBuild
|
|
3929
3827
|
} = options;
|
|
3930
|
-
const clientEngineType = getClientEngineType2(generator);
|
|
3931
|
-
generator.config.engineType = clientEngineType;
|
|
3932
|
-
const inlineSchemaHash = crypto.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex");
|
|
3933
|
-
const datasourceFilePath = datasources[0].sourceFilePath;
|
|
3934
3828
|
const config = {
|
|
3935
|
-
generator,
|
|
3936
|
-
relativePath: pathToPosix(path2.relative(outputDir, path2.dirname(datasourceFilePath))),
|
|
3829
|
+
previewFeatures: generator.previewFeatures,
|
|
3937
3830
|
clientVersion: options.clientVersion,
|
|
3938
3831
|
engineVersion: options.engineVersion,
|
|
3939
|
-
datasourceNames: datasources.map((d) => d.name),
|
|
3940
3832
|
activeProvider: options.activeProvider,
|
|
3941
|
-
postinstall: options.postinstall,
|
|
3942
|
-
ciName: ciInfo.name ?? void 0,
|
|
3943
|
-
inlineDatasources: buildInlineDatasources(datasources),
|
|
3944
3833
|
inlineSchema,
|
|
3945
|
-
|
|
3946
|
-
copyEngine,
|
|
3947
|
-
runtimeDataModel: { models: {}, enums: {}, types: {} },
|
|
3948
|
-
dirname: ""
|
|
3834
|
+
runtimeDataModel: { models: {}, enums: {}, types: {} }
|
|
3949
3835
|
};
|
|
3950
3836
|
return `
|
|
3951
3837
|
const config: runtime.GetPrismaClientConfig = ${JSON.stringify(config, null, 2)}
|
|
3952
3838
|
${buildRuntimeDataModel(context.dmmf.datamodel, runtimeName)}
|
|
3953
|
-
${buildGetWasmModule({
|
|
3954
|
-
${buildGetWasmModule({ component: "compiler", runtimeBase, runtimeName, target, activeProvider, moduleFormat })}
|
|
3955
|
-
${buildInjectableEdgeEnv(edge, datasources)}
|
|
3839
|
+
${buildGetWasmModule({ runtimeBase, runtimeName, target, activeProvider, moduleFormat, compilerBuild })}
|
|
3956
3840
|
${buildDebugInitialization(edge)}
|
|
3957
3841
|
`;
|
|
3958
3842
|
}
|
|
3959
3843
|
|
|
3960
3844
|
// src/TSClient/file-generators/ClientFile.ts
|
|
3961
|
-
import path4 from "node:path";
|
|
3962
|
-
import { ClientEngineType as ClientEngineType2, getClientEngineType as getClientEngineType3 } from "@prisma/internals";
|
|
3963
3845
|
import * as ts7 from "@prisma/ts-builders";
|
|
3964
|
-
|
|
3965
|
-
// src/utils/buildNFTAnnotations.ts
|
|
3966
|
-
import { getNodeAPIName } from "@prisma/get-platform";
|
|
3967
|
-
import { ClientEngineType, parseAWSNodejsRuntimeEnvVarVersion, pathToPosix as pathToPosix2 } from "@prisma/internals";
|
|
3968
|
-
import path3 from "path";
|
|
3969
|
-
function buildNFTAnnotations(noEngine, engineType, binaryTargets, relativeOutdir) {
|
|
3970
|
-
if (noEngine === true) return "";
|
|
3971
|
-
if (binaryTargets === void 0) {
|
|
3972
|
-
return "";
|
|
3973
|
-
}
|
|
3974
|
-
if (process.env.NETLIFY) {
|
|
3975
|
-
const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20;
|
|
3976
|
-
const awsRuntimeVersion = parseAWSNodejsRuntimeEnvVarVersion();
|
|
3977
|
-
const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20;
|
|
3978
|
-
const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18;
|
|
3979
|
-
if ((isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) {
|
|
3980
|
-
binaryTargets = ["rhel-openssl-3.0.x"];
|
|
3981
|
-
} else {
|
|
3982
|
-
binaryTargets = ["rhel-openssl-1.0.x"];
|
|
3983
|
-
}
|
|
3984
|
-
}
|
|
3985
|
-
const engineAnnotations = binaryTargets.map((binaryTarget) => {
|
|
3986
|
-
const engineFilename = getQueryEngineFilename(engineType, binaryTarget);
|
|
3987
|
-
return engineFilename ? buildNFTAnnotation(engineFilename, relativeOutdir) : "";
|
|
3988
|
-
}).join("\n");
|
|
3989
|
-
return `${engineAnnotations}`;
|
|
3990
|
-
}
|
|
3991
|
-
function getQueryEngineFilename(engineType, binaryTarget) {
|
|
3992
|
-
if (engineType === ClientEngineType.Library) {
|
|
3993
|
-
return getNodeAPIName(binaryTarget, "fs");
|
|
3994
|
-
}
|
|
3995
|
-
if (engineType === ClientEngineType.Binary) {
|
|
3996
|
-
return `query-engine-${binaryTarget}`;
|
|
3997
|
-
}
|
|
3998
|
-
return void 0;
|
|
3999
|
-
}
|
|
4000
|
-
function buildNFTAnnotation(fileName, relativeOutdir) {
|
|
4001
|
-
const relativeFilePath = path3.join(relativeOutdir, fileName);
|
|
4002
|
-
return `
|
|
4003
|
-
// file annotations for bundling tools to include these files
|
|
4004
|
-
path.join(__dirname, ${JSON.stringify(pathToPosix2(fileName))})
|
|
4005
|
-
path.join(process.cwd(), ${JSON.stringify(pathToPosix2(relativeFilePath))})`;
|
|
4006
|
-
}
|
|
4007
|
-
|
|
4008
|
-
// src/TSClient/file-generators/ClientFile.ts
|
|
4009
3846
|
var jsDocHeader3 = `/*
|
|
4010
3847
|
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
|
|
4011
3848
|
* If you're looking for something you can import in the client-side of your application, please refer to the \`browser.ts\` file instead.
|
|
4012
|
-
*
|
|
3849
|
+
*
|
|
4013
3850
|
* \u{1F7E2} You can import this file directly.
|
|
4014
3851
|
*/
|
|
4015
3852
|
`;
|
|
4016
3853
|
function createClientFile(context, options) {
|
|
4017
|
-
const clientEngineType = getClientEngineType3(options.generator);
|
|
4018
|
-
options.generator.config.engineType = clientEngineType;
|
|
4019
3854
|
const imports = [
|
|
4020
3855
|
ts7.moduleImport(context.runtimeImport).asNamespace("runtime"),
|
|
4021
3856
|
ts7.moduleImport(context.importFileName("./enums")).asNamespace("$Enums"),
|
|
@@ -4025,9 +3860,7 @@ function createClientFile(context, options) {
|
|
|
4025
3860
|
const exports = [
|
|
4026
3861
|
ts7.moduleExportFrom(context.importFileName("./enums")).asNamespace("$Enums"),
|
|
4027
3862
|
ts7.moduleExportFrom(context.importFileName("./enums")),
|
|
4028
|
-
ts7.moduleExport(
|
|
4029
|
-
ts7.constDeclaration("PrismaClient").setValue(ts7.functionCall("$Class.getPrismaClientClass", [ts7.namedValue("__dirname")]))
|
|
4030
|
-
).setDocComment(getPrismaClientClassDocComment(context)),
|
|
3863
|
+
ts7.moduleExport(ts7.constDeclaration("PrismaClient").setValue(ts7.functionCall("$Class.getPrismaClientClass", []))).setDocComment(getPrismaClientClassDocComment(context)),
|
|
4031
3864
|
ts7.moduleExport(
|
|
4032
3865
|
ts7.typeDeclaration(
|
|
4033
3866
|
"PrismaClient",
|
|
@@ -4041,8 +3874,6 @@ function createClientFile(context, options) {
|
|
|
4041
3874
|
)
|
|
4042
3875
|
)
|
|
4043
3876
|
].map((e) => ts7.stringify(e));
|
|
4044
|
-
const binaryTargets = clientEngineType === ClientEngineType2.Library ? Object.keys(options.binaryPaths.libqueryEngine ?? {}) : Object.keys(options.binaryPaths.queryEngine ?? {});
|
|
4045
|
-
const relativeOutdir = path4.relative(process.cwd(), options.outputDir);
|
|
4046
3877
|
return `${jsDocHeader3}
|
|
4047
3878
|
${buildPreamble(options.edge, options.moduleFormat)}
|
|
4048
3879
|
${imports.join("\n")}
|
|
@@ -4050,8 +3881,6 @@ ${imports.join("\n")}
|
|
|
4050
3881
|
${exports.join("\n")}
|
|
4051
3882
|
export { Prisma }
|
|
4052
3883
|
|
|
4053
|
-
${buildNFTAnnotations(options.edge || !options.copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
|
|
4054
|
-
|
|
4055
3884
|
${modelExports(context).join("\n")}
|
|
4056
3885
|
`;
|
|
4057
3886
|
}
|
|
@@ -4123,7 +3952,7 @@ export {}
|
|
|
4123
3952
|
import * as ts15 from "@prisma/ts-builders";
|
|
4124
3953
|
|
|
4125
3954
|
// src/TSClient/Model.ts
|
|
4126
|
-
import { capitalize as
|
|
3955
|
+
import { capitalize as capitalize8 } from "@prisma/client-common";
|
|
4127
3956
|
import * as DMMF2 from "@prisma/dmmf";
|
|
4128
3957
|
import * as ts14 from "@prisma/ts-builders";
|
|
4129
3958
|
import indent5 from "indent-string";
|
|
@@ -4209,7 +4038,7 @@ var ArgsTypeBuilder = class {
|
|
|
4209
4038
|
};
|
|
4210
4039
|
|
|
4211
4040
|
// src/TSClient/Count.ts
|
|
4212
|
-
import { capitalize as
|
|
4041
|
+
import { capitalize as capitalize7 } from "@prisma/client-common";
|
|
4213
4042
|
import * as ts11 from "@prisma/ts-builders";
|
|
4214
4043
|
import indent4 from "indent-string";
|
|
4215
4044
|
|
|
@@ -4328,7 +4157,7 @@ ${this.argsTypes.map((typeExport) => ts11.stringify(typeExport)).join("\n\n")}
|
|
|
4328
4157
|
}
|
|
4329
4158
|
};
|
|
4330
4159
|
function getCountArgsType(typeName, fieldName) {
|
|
4331
|
-
return `${typeName}Count${
|
|
4160
|
+
return `${typeName}Count${capitalize7(fieldName)}Args`;
|
|
4332
4161
|
}
|
|
4333
4162
|
|
|
4334
4163
|
// src/TSClient/ModelFieldRefs.ts
|
|
@@ -4992,7 +4821,7 @@ function getNonAggregateMethodDependencyValidations(modelMapping, actionName, co
|
|
|
4992
4821
|
objectType11.add(ts14.property(reqArg, ts14.objectType()));
|
|
4993
4822
|
}
|
|
4994
4823
|
validators.push(
|
|
4995
|
-
ts14.genericParameter(`${
|
|
4824
|
+
ts14.genericParameter(`${capitalize8(args.name)}DependenciesValidator`).extends(
|
|
4996
4825
|
ts14.conditionalType().check(ts14.stringLiteral(args.name)).extends(ts14.namedType("Prisma.Keys<T>")).then(objectType11).else(ts14.objectType())
|
|
4997
4826
|
)
|
|
4998
4827
|
);
|
|
@@ -5152,33 +4981,36 @@ function createModelsFile(context, modelsNames) {
|
|
|
5152
4981
|
}
|
|
5153
4982
|
|
|
5154
4983
|
// src/TSClient/file-generators/PrismaNamespaceBrowserFile.ts
|
|
4984
|
+
import { datamodelSchemaEnumToSchemaEnum } from "@prisma/dmmf";
|
|
5155
4985
|
import * as ts16 from "@prisma/ts-builders";
|
|
5156
4986
|
|
|
5157
4987
|
// src/TSClient/NullTypes.ts
|
|
5158
4988
|
var nullTypes = `
|
|
5159
4989
|
export const NullTypes = {
|
|
5160
|
-
DbNull: runtime.
|
|
5161
|
-
JsonNull: runtime.
|
|
5162
|
-
AnyNull: runtime.
|
|
4990
|
+
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
|
|
4991
|
+
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
|
|
4992
|
+
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
|
|
5163
4993
|
}
|
|
5164
4994
|
/**
|
|
5165
4995
|
* Helper for filtering JSON entries that have \`null\` on the database (empty on the db)
|
|
5166
4996
|
*
|
|
5167
4997
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5168
4998
|
*/
|
|
5169
|
-
export const DbNull = runtime.
|
|
4999
|
+
export const DbNull = runtime.DbNull
|
|
5000
|
+
|
|
5170
5001
|
/**
|
|
5171
5002
|
* Helper for filtering JSON entries that have JSON \`null\` values (not empty on the db)
|
|
5172
5003
|
*
|
|
5173
5004
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5174
5005
|
*/
|
|
5175
|
-
export const JsonNull = runtime.
|
|
5006
|
+
export const JsonNull = runtime.JsonNull
|
|
5007
|
+
|
|
5176
5008
|
/**
|
|
5177
5009
|
* Helper for filtering JSON entries that are \`Prisma.DbNull\` or \`Prisma.JsonNull\`
|
|
5178
5010
|
*
|
|
5179
5011
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
5180
5012
|
*/
|
|
5181
|
-
export const AnyNull = runtime.
|
|
5013
|
+
export const AnyNull = runtime.AnyNull
|
|
5182
5014
|
`;
|
|
5183
5015
|
|
|
5184
5016
|
// src/TSClient/file-generators/PrismaNamespaceBrowserFile.ts
|
|
@@ -5195,7 +5027,9 @@ var jsDocHeader7 = `/*
|
|
|
5195
5027
|
*/
|
|
5196
5028
|
`;
|
|
5197
5029
|
function createPrismaNamespaceBrowserFile(context) {
|
|
5198
|
-
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5030
|
+
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5031
|
+
(datamodelEnum) => new Enum(datamodelSchemaEnumToSchemaEnum(datamodelEnum), false).toTS()
|
|
5032
|
+
);
|
|
5199
5033
|
return `${jsDocHeader7}
|
|
5200
5034
|
${ts16.stringify(ts16.moduleImport(`${context.runtimeBase}/index-browser`).asNamespace("runtime"))}
|
|
5201
5035
|
|
|
@@ -5209,7 +5043,10 @@ ${nullTypes}
|
|
|
5209
5043
|
${new Enum(
|
|
5210
5044
|
{
|
|
5211
5045
|
name: "ModelName",
|
|
5212
|
-
|
|
5046
|
+
data: context.dmmf.mappings.modelOperations.map((m) => ({
|
|
5047
|
+
key: m.model,
|
|
5048
|
+
value: m.model
|
|
5049
|
+
}))
|
|
5213
5050
|
},
|
|
5214
5051
|
true
|
|
5215
5052
|
).toTS()}
|
|
@@ -5222,6 +5059,7 @@ ${prismaEnums?.join("\n\n")}
|
|
|
5222
5059
|
}
|
|
5223
5060
|
|
|
5224
5061
|
// src/TSClient/file-generators/PrismaNamespaceFile.ts
|
|
5062
|
+
import { datamodelSchemaEnumToSchemaEnum as datamodelSchemaEnumToSchemaEnum2 } from "@prisma/dmmf";
|
|
5225
5063
|
import * as ts19 from "@prisma/ts-builders";
|
|
5226
5064
|
|
|
5227
5065
|
// src/TSClient/common.ts
|
|
@@ -5269,14 +5107,6 @@ export type Decimal = runtime.Decimal
|
|
|
5269
5107
|
|
|
5270
5108
|
export type DecimalJsLike = runtime.DecimalJsLike
|
|
5271
5109
|
|
|
5272
|
-
/**
|
|
5273
|
-
* Metrics
|
|
5274
|
-
*/
|
|
5275
|
-
export type Metrics = runtime.Metrics
|
|
5276
|
-
export type Metric<T> = runtime.Metric<T>
|
|
5277
|
-
export type MetricHistogram = runtime.MetricHistogram
|
|
5278
|
-
export type MetricHistogramBucket = runtime.MetricHistogramBucket
|
|
5279
|
-
|
|
5280
5110
|
/**
|
|
5281
5111
|
* Extensions
|
|
5282
5112
|
*/
|
|
@@ -5583,25 +5413,6 @@ export const skip = runtime.skip
|
|
|
5583
5413
|
return "";
|
|
5584
5414
|
}
|
|
5585
5415
|
|
|
5586
|
-
// src/TSClient/Datasources.ts
|
|
5587
|
-
import indent6 from "indent-string";
|
|
5588
|
-
var Datasources = class {
|
|
5589
|
-
constructor(internalDatasources) {
|
|
5590
|
-
this.internalDatasources = internalDatasources;
|
|
5591
|
-
}
|
|
5592
|
-
toTS() {
|
|
5593
|
-
const sources = this.internalDatasources;
|
|
5594
|
-
return `
|
|
5595
|
-
export type Datasource = {
|
|
5596
|
-
url?: string
|
|
5597
|
-
}
|
|
5598
|
-
export type Datasources = {
|
|
5599
|
-
${indent6(sources.map((s) => `${s.name}?: Datasource`).join("\n"), 2)}
|
|
5600
|
-
}
|
|
5601
|
-
`;
|
|
5602
|
-
}
|
|
5603
|
-
};
|
|
5604
|
-
|
|
5605
5416
|
// src/TSClient/FieldRefInput.ts
|
|
5606
5417
|
var FieldRefInput = class {
|
|
5607
5418
|
constructor(type) {
|
|
@@ -5761,7 +5572,9 @@ function createPrismaNamespaceFile(context, options) {
|
|
|
5761
5572
|
ts19.moduleImport(context.importFileName(`../models`)).asNamespace("Prisma").typeOnly(),
|
|
5762
5573
|
ts19.moduleImport(context.importFileName(`./class`)).named(ts19.namedImport("PrismaClient").typeOnly())
|
|
5763
5574
|
].map((i) => ts19.stringify(i));
|
|
5764
|
-
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5575
|
+
const prismaEnums = context.dmmf.schema.enumTypes.prisma?.map(
|
|
5576
|
+
(type) => new Enum(datamodelSchemaEnumToSchemaEnum2(type), true).toTS()
|
|
5577
|
+
);
|
|
5765
5578
|
const fieldRefs = context.dmmf.schema.fieldRefTypes.prisma?.map((type) => new FieldRefInput(type).toTS()) ?? [];
|
|
5766
5579
|
return `${jsDocHeader8}
|
|
5767
5580
|
${imports.join("\n")}
|
|
@@ -5772,7 +5585,10 @@ ${commonCodeTS(options)}
|
|
|
5772
5585
|
${new Enum(
|
|
5773
5586
|
{
|
|
5774
5587
|
name: "ModelName",
|
|
5775
|
-
|
|
5588
|
+
data: context.dmmf.mappings.modelOperations.map((m) => ({
|
|
5589
|
+
key: m.model,
|
|
5590
|
+
value: m.model
|
|
5591
|
+
}))
|
|
5776
5592
|
},
|
|
5777
5593
|
true
|
|
5778
5594
|
).toTS()}
|
|
@@ -5799,11 +5615,10 @@ export type BatchPayload = {
|
|
|
5799
5615
|
count: number
|
|
5800
5616
|
}
|
|
5801
5617
|
|
|
5802
|
-
${new Datasources(options.datasources).toTS()}
|
|
5803
5618
|
${clientExtensionsDefinitions()}
|
|
5804
5619
|
export type DefaultPrismaClient = PrismaClient
|
|
5805
5620
|
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
|
|
5806
|
-
${ts19.stringify(ts19.moduleExport(buildClientOptions(context
|
|
5621
|
+
${ts19.stringify(ts19.moduleExport(buildClientOptions(context)))}
|
|
5807
5622
|
${ts19.stringify(globalOmitConfig(context.dmmf))}
|
|
5808
5623
|
|
|
5809
5624
|
/* Types for Logging */
|
|
@@ -5879,12 +5694,19 @@ function clientExtensionsDefinitions() {
|
|
|
5879
5694
|
);
|
|
5880
5695
|
return ts19.stringify(define);
|
|
5881
5696
|
}
|
|
5882
|
-
function buildClientOptions(context
|
|
5883
|
-
const
|
|
5884
|
-
ts19.property("
|
|
5885
|
-
).add(
|
|
5886
|
-
|
|
5887
|
-
|
|
5697
|
+
function buildClientOptions(context) {
|
|
5698
|
+
const adapterOption = ts19.objectType().add(
|
|
5699
|
+
ts19.property("adapter", ts19.namedType("runtime.SqlDriverAdapterFactory")).setDocComment(ts19.docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-pg`."))
|
|
5700
|
+
).add(ts19.property("accelerateUrl", ts19.neverType).optional());
|
|
5701
|
+
const accelerateUrlOption = ts19.objectType().add(
|
|
5702
|
+
ts19.property("accelerateUrl", ts19.stringType).setDocComment(
|
|
5703
|
+
ts19.docComment(
|
|
5704
|
+
"Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."
|
|
5705
|
+
)
|
|
5706
|
+
)
|
|
5707
|
+
).add(ts19.property("adapter", ts19.neverType).optional());
|
|
5708
|
+
const mutuallyExclusiveOptions = ts19.unionType([adapterOption, accelerateUrlOption]);
|
|
5709
|
+
const otherOptions = ts19.objectType().add(
|
|
5888
5710
|
ts19.property("errorFormat", ts19.namedType("ErrorFormat")).optional().setDocComment(ts19.docComment('@default "colorless"'))
|
|
5889
5711
|
).add(
|
|
5890
5712
|
ts19.property("log", ts19.array(ts19.unionType([ts19.namedType("LogLevel"), ts19.namedType("LogDefinition")]))).optional().setDocComment(ts19.docComment`
|
|
@@ -5909,28 +5731,21 @@ function buildClientOptions(context, options) {
|
|
|
5909
5731
|
{ emit: 'stdout', level: 'error' }
|
|
5910
5732
|
]
|
|
5911
5733
|
\`\`\`
|
|
5912
|
-
Read more in our [docs](https://
|
|
5734
|
+
Read more in our [docs](https://pris.ly/d/logging).
|
|
5913
5735
|
`)
|
|
5914
5736
|
);
|
|
5915
5737
|
const transactionOptions = ts19.objectType().add(ts19.property("maxWait", ts19.numberType).optional()).add(ts19.property("timeout", ts19.numberType).optional());
|
|
5916
5738
|
if (context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) {
|
|
5917
5739
|
transactionOptions.add(ts19.property("isolationLevel", ts19.namedType("TransactionIsolationLevel")).optional());
|
|
5918
5740
|
}
|
|
5919
|
-
|
|
5741
|
+
otherOptions.add(
|
|
5920
5742
|
ts19.property("transactionOptions", transactionOptions).optional().setDocComment(ts19.docComment`
|
|
5921
5743
|
The default values for transactionOptions
|
|
5922
5744
|
maxWait ?= 2000
|
|
5923
5745
|
timeout ?= 5000
|
|
5924
5746
|
`)
|
|
5925
5747
|
);
|
|
5926
|
-
|
|
5927
|
-
clientOptions.add(
|
|
5928
|
-
ts19.property("adapter", ts19.unionType([ts19.namedType("runtime.SqlDriverAdapterFactory"), ts19.namedType("null")])).optional().setDocComment(
|
|
5929
|
-
ts19.docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`")
|
|
5930
|
-
)
|
|
5931
|
-
);
|
|
5932
|
-
}
|
|
5933
|
-
clientOptions.add(
|
|
5748
|
+
otherOptions.add(
|
|
5934
5749
|
ts19.property("omit", ts19.namedType("GlobalOmitConfig")).optional().setDocComment(ts19.docComment`
|
|
5935
5750
|
Global configuration for omitting model fields by default.
|
|
5936
5751
|
|
|
@@ -5946,7 +5761,27 @@ function buildClientOptions(context, options) {
|
|
|
5946
5761
|
\`\`\`
|
|
5947
5762
|
`)
|
|
5948
5763
|
);
|
|
5949
|
-
|
|
5764
|
+
if (context.isSqlProvider()) {
|
|
5765
|
+
otherOptions.add(
|
|
5766
|
+
ts19.property("comments", ts19.array(ts19.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts19.docComment`
|
|
5767
|
+
SQL commenter plugins that add metadata to SQL queries as comments.
|
|
5768
|
+
Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
|
|
5769
|
+
|
|
5770
|
+
@example
|
|
5771
|
+
\`\`\`
|
|
5772
|
+
const prisma = new PrismaClient({
|
|
5773
|
+
adapter,
|
|
5774
|
+
comments: [
|
|
5775
|
+
traceContext(),
|
|
5776
|
+
queryInsights(),
|
|
5777
|
+
],
|
|
5778
|
+
})
|
|
5779
|
+
\`\`\`
|
|
5780
|
+
`)
|
|
5781
|
+
);
|
|
5782
|
+
}
|
|
5783
|
+
const prismaClientOptions = ts19.intersectionType([mutuallyExclusiveOptions, otherOptions]);
|
|
5784
|
+
return ts19.typeDeclaration("PrismaClientOptions", prismaClientOptions);
|
|
5950
5785
|
}
|
|
5951
5786
|
|
|
5952
5787
|
// src/TSClient/GenerateContext.ts
|
|
@@ -5958,26 +5793,32 @@ var GenerateContext = class {
|
|
|
5958
5793
|
outputFileName;
|
|
5959
5794
|
importFileName;
|
|
5960
5795
|
generator;
|
|
5796
|
+
provider;
|
|
5961
5797
|
constructor({
|
|
5962
5798
|
dmmf,
|
|
5963
5799
|
genericArgsInfo,
|
|
5964
5800
|
runtimeBase,
|
|
5965
|
-
runtimeImport
|
|
5801
|
+
runtimeImport,
|
|
5966
5802
|
outputFileName,
|
|
5967
5803
|
importFileName,
|
|
5968
|
-
generator
|
|
5804
|
+
generator,
|
|
5805
|
+
provider
|
|
5969
5806
|
}) {
|
|
5970
5807
|
this.dmmf = dmmf;
|
|
5971
5808
|
this.genericArgsInfo = genericArgsInfo;
|
|
5972
5809
|
this.runtimeBase = runtimeBase;
|
|
5973
|
-
this.runtimeImport =
|
|
5810
|
+
this.runtimeImport = runtimeImport;
|
|
5974
5811
|
this.outputFileName = outputFileName;
|
|
5975
5812
|
this.importFileName = importFileName;
|
|
5976
5813
|
this.generator = generator;
|
|
5814
|
+
this.provider = provider;
|
|
5977
5815
|
}
|
|
5978
5816
|
isPreviewFeatureOn(previewFeature) {
|
|
5979
5817
|
return this.generator?.previewFeatures?.includes(previewFeature) ?? false;
|
|
5980
5818
|
}
|
|
5819
|
+
isSqlProvider() {
|
|
5820
|
+
return this.provider !== "mongodb";
|
|
5821
|
+
}
|
|
5981
5822
|
};
|
|
5982
5823
|
|
|
5983
5824
|
// src/TSClient/TSClient.ts
|
|
@@ -5997,7 +5838,8 @@ var TSClient = class {
|
|
|
5997
5838
|
runtimeImport: `${this.options.runtimeBase}/${this.options.runtimeName}`,
|
|
5998
5839
|
outputFileName: generatedFileNameMapper(this.options.generatedFileExtension),
|
|
5999
5840
|
importFileName: importFileNameMapper(this.options.importFileExtension),
|
|
6000
|
-
generator: this.options.generator
|
|
5841
|
+
generator: this.options.generator,
|
|
5842
|
+
provider: this.options.activeProvider
|
|
6001
5843
|
});
|
|
6002
5844
|
const modelNames = Object.values(context.dmmf.typeAndModelMap).filter((model) => context.dmmf.outputTypeMap.model[model.name]).map((model) => model.name);
|
|
6003
5845
|
const modelsFileMap = modelNames.reduce((acc, modelName) => {
|
|
@@ -6290,23 +6132,19 @@ function buildClient({
|
|
|
6290
6132
|
engineVersion,
|
|
6291
6133
|
clientVersion,
|
|
6292
6134
|
activeProvider,
|
|
6293
|
-
postinstall,
|
|
6294
|
-
copyEngine,
|
|
6295
|
-
envPaths,
|
|
6296
6135
|
typedSql,
|
|
6297
6136
|
target,
|
|
6298
6137
|
generatedFileExtension,
|
|
6299
6138
|
importFileExtension,
|
|
6300
6139
|
moduleFormat,
|
|
6301
|
-
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6140
|
+
tsNoCheckPreamble: tsNoCheckPreamble2,
|
|
6141
|
+
compilerBuild
|
|
6302
6142
|
}) {
|
|
6303
|
-
const
|
|
6304
|
-
const runtimeName = getRuntimeNameForTarget(target, clientEngineType);
|
|
6143
|
+
const runtimeName = getRuntimeNameForTarget(target);
|
|
6305
6144
|
const outputName = generatedFileNameMapper(generatedFileExtension);
|
|
6306
6145
|
const importName = importFileNameMapper(importFileExtension);
|
|
6307
6146
|
const clientOptions = {
|
|
6308
6147
|
dmmf: getPrismaClientDMMF(dmmf),
|
|
6309
|
-
envPaths: envPaths ?? { rootEnvPath: null, schemaEnvPath: void 0 },
|
|
6310
6148
|
datasources,
|
|
6311
6149
|
generator,
|
|
6312
6150
|
binaryPaths,
|
|
@@ -6316,20 +6154,16 @@ function buildClient({
|
|
|
6316
6154
|
clientVersion,
|
|
6317
6155
|
engineVersion,
|
|
6318
6156
|
activeProvider,
|
|
6319
|
-
postinstall,
|
|
6320
|
-
copyEngine,
|
|
6321
6157
|
datamodel,
|
|
6322
|
-
edge: ["
|
|
6158
|
+
edge: ["wasm-compiler-edge"].includes(runtimeName),
|
|
6323
6159
|
runtimeName,
|
|
6324
6160
|
target,
|
|
6325
6161
|
generatedFileExtension,
|
|
6326
6162
|
importFileExtension,
|
|
6327
6163
|
moduleFormat,
|
|
6328
|
-
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6164
|
+
tsNoCheckPreamble: tsNoCheckPreamble2,
|
|
6165
|
+
compilerBuild
|
|
6329
6166
|
};
|
|
6330
|
-
if (runtimeName === "react-native" && !generator.previewFeatures.includes("reactNative")) {
|
|
6331
|
-
throw new Error(`Using the "react-native" runtime requires the "reactNative" preview feature to be enabled.`);
|
|
6332
|
-
}
|
|
6333
6167
|
const client = new TSClient(clientOptions);
|
|
6334
6168
|
let fileMap = client.generateClientFiles();
|
|
6335
6169
|
if (typedSql && typedSql.length > 0) {
|
|
@@ -6351,7 +6185,8 @@ function buildClient({
|
|
|
6351
6185
|
...fileMap.internal,
|
|
6352
6186
|
...buildWasmFileMap({
|
|
6353
6187
|
runtimeName,
|
|
6354
|
-
activeProvider
|
|
6188
|
+
activeProvider,
|
|
6189
|
+
compilerBuild
|
|
6355
6190
|
})
|
|
6356
6191
|
}
|
|
6357
6192
|
};
|
|
@@ -6383,17 +6218,14 @@ async function generateClient(options) {
|
|
|
6383
6218
|
clientVersion,
|
|
6384
6219
|
engineVersion,
|
|
6385
6220
|
activeProvider,
|
|
6386
|
-
postinstall,
|
|
6387
|
-
envPaths,
|
|
6388
|
-
copyEngine = true,
|
|
6389
6221
|
typedSql,
|
|
6390
6222
|
target,
|
|
6391
6223
|
generatedFileExtension,
|
|
6392
6224
|
importFileExtension,
|
|
6393
6225
|
moduleFormat,
|
|
6394
|
-
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6226
|
+
tsNoCheckPreamble: tsNoCheckPreamble2,
|
|
6227
|
+
compilerBuild
|
|
6395
6228
|
} = options;
|
|
6396
|
-
const clientEngineType = getClientEngineType4(generator);
|
|
6397
6229
|
const { runtimeBase, outputDir } = await getGenerationDirs(options);
|
|
6398
6230
|
const { prismaClientDmmf, fileMap } = buildClient({
|
|
6399
6231
|
datamodel,
|
|
@@ -6407,15 +6239,13 @@ async function generateClient(options) {
|
|
|
6407
6239
|
clientVersion,
|
|
6408
6240
|
engineVersion,
|
|
6409
6241
|
activeProvider,
|
|
6410
|
-
postinstall,
|
|
6411
|
-
copyEngine,
|
|
6412
|
-
envPaths,
|
|
6413
6242
|
typedSql,
|
|
6414
6243
|
target,
|
|
6415
6244
|
generatedFileExtension,
|
|
6416
6245
|
importFileExtension,
|
|
6417
6246
|
moduleFormat,
|
|
6418
|
-
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6247
|
+
tsNoCheckPreamble: tsNoCheckPreamble2,
|
|
6248
|
+
compilerBuild
|
|
6419
6249
|
});
|
|
6420
6250
|
const denylistsErrors = validateDmmfAgainstDenylists(prismaClientDmmf);
|
|
6421
6251
|
if (denylistsErrors) {
|
|
@@ -6433,27 +6263,11 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
6433
6263
|
await deleteOutputDir(outputDir);
|
|
6434
6264
|
await (0, import_fs_extra.ensureDir)(outputDir);
|
|
6435
6265
|
await writeFileMap(outputDir, fileMap);
|
|
6436
|
-
const enginePath = clientEngineType === ClientEngineType3.Library ? binaryPaths.libqueryEngine : binaryPaths.queryEngine;
|
|
6437
|
-
if (copyEngine && enginePath) {
|
|
6438
|
-
if (process.env.NETLIFY) {
|
|
6439
|
-
await (0, import_fs_extra.ensureDir)("/tmp/prisma-engines");
|
|
6440
|
-
}
|
|
6441
|
-
for (const [binaryTarget, filePath] of Object.entries(enginePath)) {
|
|
6442
|
-
const fileName = path5.basename(filePath);
|
|
6443
|
-
let target2;
|
|
6444
|
-
if (process.env.NETLIFY && !["rhel-openssl-1.0.x", "rhel-openssl-3.0.x"].includes(binaryTarget)) {
|
|
6445
|
-
target2 = path5.join("/tmp/prisma-engines", fileName);
|
|
6446
|
-
} else {
|
|
6447
|
-
target2 = path5.join(outputDir, fileName);
|
|
6448
|
-
}
|
|
6449
|
-
await overwriteFile(filePath, target2);
|
|
6450
|
-
}
|
|
6451
|
-
}
|
|
6452
6266
|
}
|
|
6453
6267
|
function writeFileMap(outputDir, fileMap) {
|
|
6454
6268
|
return Promise.all(
|
|
6455
6269
|
Object.entries(fileMap).map(async ([fileName, content]) => {
|
|
6456
|
-
const absolutePath =
|
|
6270
|
+
const absolutePath = path2.join(outputDir, fileName);
|
|
6457
6271
|
await fs2.rm(absolutePath, { recursive: true, force: true });
|
|
6458
6272
|
if (typeof content === "string" || Buffer.isBuffer(content)) {
|
|
6459
6273
|
await fs2.writeFile(absolutePath, content);
|
|
@@ -6542,42 +6356,28 @@ function validateDmmfAgainstDenylists(prismaClientDmmf) {
|
|
|
6542
6356
|
return errorArray.length > 0 ? errorArray : null;
|
|
6543
6357
|
}
|
|
6544
6358
|
async function getGenerationDirs({ runtimeBase, outputDir }) {
|
|
6545
|
-
const normalizedOutputDir =
|
|
6546
|
-
const normalizedRuntimeBase =
|
|
6547
|
-
const userPackageRoot = await packageUp({ cwd:
|
|
6548
|
-
const userProjectRoot = userPackageRoot ?
|
|
6359
|
+
const normalizedOutputDir = path2.normalize(outputDir);
|
|
6360
|
+
const normalizedRuntimeBase = pathToPosix(runtimeBase);
|
|
6361
|
+
const userPackageRoot = await packageUp({ cwd: path2.dirname(normalizedOutputDir) });
|
|
6362
|
+
const userProjectRoot = userPackageRoot ? path2.dirname(userPackageRoot) : process.cwd();
|
|
6549
6363
|
return {
|
|
6550
6364
|
runtimeBase: normalizedRuntimeBase,
|
|
6551
6365
|
outputDir: normalizedOutputDir,
|
|
6552
6366
|
projectRoot: userProjectRoot
|
|
6553
6367
|
};
|
|
6554
6368
|
}
|
|
6555
|
-
function getRuntimeNameForTarget(target
|
|
6369
|
+
function getRuntimeNameForTarget(target) {
|
|
6556
6370
|
switch (target) {
|
|
6557
6371
|
case "nodejs":
|
|
6558
6372
|
case "deno":
|
|
6559
|
-
return
|
|
6373
|
+
return "client";
|
|
6560
6374
|
case "workerd":
|
|
6561
6375
|
case "vercel-edge":
|
|
6562
|
-
return
|
|
6563
|
-
case "react-native":
|
|
6564
|
-
return "react-native";
|
|
6376
|
+
return "wasm-compiler-edge";
|
|
6565
6377
|
default:
|
|
6566
6378
|
assertNever3(target, "Unknown runtime target");
|
|
6567
6379
|
}
|
|
6568
6380
|
}
|
|
6569
|
-
function getNodeRuntimeName(engineType) {
|
|
6570
|
-
if (engineType === ClientEngineType3.Binary) {
|
|
6571
|
-
return "binary";
|
|
6572
|
-
}
|
|
6573
|
-
if (engineType === ClientEngineType3.Library) {
|
|
6574
|
-
return "library";
|
|
6575
|
-
}
|
|
6576
|
-
if (engineType === ClientEngineType3.Client) {
|
|
6577
|
-
return "client";
|
|
6578
|
-
}
|
|
6579
|
-
assertNever3(engineType, "Unknown engine type");
|
|
6580
|
-
}
|
|
6581
6381
|
async function deleteOutputDir(outputDir) {
|
|
6582
6382
|
try {
|
|
6583
6383
|
const files = await fs2.readdir(outputDir);
|
|
@@ -6612,14 +6412,12 @@ async function deleteOutputDir(outputDir) {
|
|
|
6612
6412
|
}
|
|
6613
6413
|
|
|
6614
6414
|
// src/generator.ts
|
|
6615
|
-
import { Debug as Debug2 } from "@prisma/debug";
|
|
6616
6415
|
import { enginesVersion } from "@prisma/engines-version";
|
|
6617
|
-
import {
|
|
6416
|
+
import { parseEnvValue } from "@prisma/internals";
|
|
6618
6417
|
import { getTsconfig } from "get-tsconfig";
|
|
6619
|
-
import { match as match2 } from "ts-pattern";
|
|
6620
6418
|
|
|
6621
6419
|
// package.json
|
|
6622
|
-
var version = "7.3.0-integration-
|
|
6420
|
+
var version = "7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1";
|
|
6623
6421
|
|
|
6624
6422
|
// src/module-format.ts
|
|
6625
6423
|
function parseModuleFormat(format) {
|
|
@@ -6662,16 +6460,7 @@ function fromTsConfigModule(module) {
|
|
|
6662
6460
|
}
|
|
6663
6461
|
|
|
6664
6462
|
// src/runtime-targets.ts
|
|
6665
|
-
var supportedPublicRuntimes = [
|
|
6666
|
-
"nodejs",
|
|
6667
|
-
"deno",
|
|
6668
|
-
"bun",
|
|
6669
|
-
"workerd",
|
|
6670
|
-
"cloudflare",
|
|
6671
|
-
"vercel-edge",
|
|
6672
|
-
"edge-light",
|
|
6673
|
-
"react-native"
|
|
6674
|
-
];
|
|
6463
|
+
var supportedPublicRuntimes = ["nodejs", "deno", "bun", "workerd", "cloudflare", "vercel-edge", "edge-light"];
|
|
6675
6464
|
function parseRuntimeTarget(target) {
|
|
6676
6465
|
switch (target.toLowerCase()) {
|
|
6677
6466
|
case "workerd":
|
|
@@ -6685,8 +6474,6 @@ function parseRuntimeTarget(target) {
|
|
|
6685
6474
|
return "nodejs";
|
|
6686
6475
|
case "deno":
|
|
6687
6476
|
return "deno";
|
|
6688
|
-
case "react-native":
|
|
6689
|
-
return "react-native";
|
|
6690
6477
|
default:
|
|
6691
6478
|
throw new Error(
|
|
6692
6479
|
`Unknown target runtime: "${target}". The available options are: ${supportedPublicRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
|
|
@@ -6701,7 +6488,6 @@ function parseRuntimeTargetFromUnknown(target) {
|
|
|
6701
6488
|
}
|
|
6702
6489
|
|
|
6703
6490
|
// src/generator.ts
|
|
6704
|
-
var debug2 = Debug2("prisma:client:generator");
|
|
6705
6491
|
var missingOutputErrorMessage = `An output path is required for the \`prisma-client\` generator. Please provide an output path in your schema file:
|
|
6706
6492
|
|
|
6707
6493
|
${dim(`generator client {
|
|
@@ -6720,13 +6506,11 @@ function getOutputPath(config) {
|
|
|
6720
6506
|
var PrismaClientTsGenerator = class {
|
|
6721
6507
|
name = "prisma-client-ts";
|
|
6722
6508
|
getManifest(config) {
|
|
6723
|
-
const requiresEngines = match2(getClientEngineType5(config)).with(ClientEngineType4.Library, () => ["libqueryEngine"]).with(ClientEngineType4.Binary, () => ["queryEngine"]).with(ClientEngineType4.Client, () => []).exhaustive();
|
|
6724
|
-
debug2("requiresEngines", requiresEngines);
|
|
6725
6509
|
return Promise.resolve({
|
|
6726
6510
|
defaultOutput: getOutputPath(config),
|
|
6727
6511
|
prettyName: "Prisma Client",
|
|
6728
6512
|
version,
|
|
6729
|
-
requiresEngines,
|
|
6513
|
+
requiresEngines: [],
|
|
6730
6514
|
requiresEngineVersion: enginesVersion
|
|
6731
6515
|
});
|
|
6732
6516
|
}
|
|
@@ -6751,7 +6535,6 @@ var PrismaClientTsGenerator = class {
|
|
|
6751
6535
|
schemaPath: options.schemaPath,
|
|
6752
6536
|
binaryPaths: options.binaryPaths,
|
|
6753
6537
|
datasources: options.datasources,
|
|
6754
|
-
envPaths: options.envPaths,
|
|
6755
6538
|
outputDir,
|
|
6756
6539
|
runtimeBase: "@prisma/client/runtime",
|
|
6757
6540
|
dmmf: options.dmmf,
|
|
@@ -6759,18 +6542,26 @@ var PrismaClientTsGenerator = class {
|
|
|
6759
6542
|
engineVersion: options.version,
|
|
6760
6543
|
clientVersion: version,
|
|
6761
6544
|
activeProvider: options.datasources[0]?.activeProvider,
|
|
6762
|
-
postinstall: options.postinstall,
|
|
6763
|
-
copyEngine: !options.noEngine,
|
|
6764
6545
|
typedSql: options.typedSql,
|
|
6765
6546
|
target,
|
|
6766
6547
|
generatedFileExtension,
|
|
6767
6548
|
importFileExtension,
|
|
6768
6549
|
moduleFormat,
|
|
6769
|
-
tsNoCheckPreamble: true
|
|
6550
|
+
tsNoCheckPreamble: true,
|
|
6770
6551
|
// Set to false only during internal tests
|
|
6552
|
+
compilerBuild: parseCompilerBuildFromUnknown(options.generator.config.compilerBuild, target)
|
|
6771
6553
|
});
|
|
6772
6554
|
}
|
|
6773
6555
|
};
|
|
6556
|
+
function parseCompilerBuildFromUnknown(value, target) {
|
|
6557
|
+
if (value === void 0) {
|
|
6558
|
+
return target === "vercel-edge" ? "small" : "fast";
|
|
6559
|
+
}
|
|
6560
|
+
if (value === "small" || value === "fast") {
|
|
6561
|
+
return value;
|
|
6562
|
+
}
|
|
6563
|
+
throw new Error(`Invalid compiler build: ${JSON.stringify(value)}, expected one of: "fast", "small"`);
|
|
6564
|
+
}
|
|
6774
6565
|
export {
|
|
6775
6566
|
PrismaClientTsGenerator,
|
|
6776
6567
|
externalToInternalDmmf,
|