@prisma/client 5.20.0-integration-feat-no-nextjs-workaround.2 → 5.20.0-integration-feat-strict-undefined-checks.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/generator-build/index.js +638 -609
- package/package.json +19 -19
- package/runtime/binary.js +76 -76
- package/runtime/edge-esm.js +18 -18
- package/runtime/edge.js +18 -18
- package/runtime/library.d.ts +26 -23
- package/runtime/library.js +49 -49
- package/runtime/query_engine_bg.mysql.js +2 -2
- package/runtime/query_engine_bg.mysql.wasm +0 -0
- package/runtime/query_engine_bg.postgresql.js +2 -2
- package/runtime/query_engine_bg.postgresql.wasm +0 -0
- package/runtime/query_engine_bg.sqlite.js +2 -2
- package/runtime/query_engine_bg.sqlite.wasm +0 -0
- package/runtime/react-native.d.ts +26 -23
- package/runtime/react-native.js +26 -26
- package/runtime/wasm.js +17 -17
- package/scripts/default-index.js +3 -3
package/generator-build/index.js
CHANGED
|
@@ -33,18 +33,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/@prisma+engines-version@5.20.0-
|
|
36
|
+
// ../../node_modules/.pnpm/@prisma+engines-version@5.20.0-8.c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7/node_modules/@prisma/engines-version/package.json
|
|
37
37
|
var require_package = __commonJS({
|
|
38
|
-
"../../node_modules/.pnpm/@prisma+engines-version@5.20.0-
|
|
38
|
+
"../../node_modules/.pnpm/@prisma+engines-version@5.20.0-8.c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7/node_modules/@prisma/engines-version/package.json"(exports2, module2) {
|
|
39
39
|
module2.exports = {
|
|
40
40
|
name: "@prisma/engines-version",
|
|
41
|
-
version: "5.20.0-
|
|
41
|
+
version: "5.20.0-8.c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7",
|
|
42
42
|
main: "index.js",
|
|
43
43
|
types: "index.d.ts",
|
|
44
44
|
license: "Apache-2.0",
|
|
45
45
|
author: "Tim Suchanek <suchanek@prisma.io>",
|
|
46
46
|
prisma: {
|
|
47
|
-
enginesVersion: "
|
|
47
|
+
enginesVersion: "c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7"
|
|
48
48
|
},
|
|
49
49
|
repository: {
|
|
50
50
|
type: "git",
|
|
@@ -66,9 +66,9 @@ var require_package = __commonJS({
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
// ../../node_modules/.pnpm/@prisma+engines-version@5.20.0-
|
|
69
|
+
// ../../node_modules/.pnpm/@prisma+engines-version@5.20.0-8.c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7/node_modules/@prisma/engines-version/index.js
|
|
70
70
|
var require_engines_version = __commonJS({
|
|
71
|
-
"../../node_modules/.pnpm/@prisma+engines-version@5.20.0-
|
|
71
|
+
"../../node_modules/.pnpm/@prisma+engines-version@5.20.0-8.c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7/node_modules/@prisma/engines-version/index.js"(exports2) {
|
|
72
72
|
"use strict";
|
|
73
73
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
74
74
|
exports2.enginesVersion = void 0;
|
|
@@ -157,14 +157,14 @@ var require_polyfills = __commonJS({
|
|
|
157
157
|
fs3.fstatSync = statFixSync(fs3.fstatSync);
|
|
158
158
|
fs3.lstatSync = statFixSync(fs3.lstatSync);
|
|
159
159
|
if (fs3.chmod && !fs3.lchmod) {
|
|
160
|
-
fs3.lchmod = function(
|
|
160
|
+
fs3.lchmod = function(path5, mode, cb) {
|
|
161
161
|
if (cb) process.nextTick(cb);
|
|
162
162
|
};
|
|
163
163
|
fs3.lchmodSync = function() {
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
if (fs3.chown && !fs3.lchown) {
|
|
167
|
-
fs3.lchown = function(
|
|
167
|
+
fs3.lchown = function(path5, uid, gid, cb) {
|
|
168
168
|
if (cb) process.nextTick(cb);
|
|
169
169
|
};
|
|
170
170
|
fs3.lchownSync = function() {
|
|
@@ -231,9 +231,9 @@ var require_polyfills = __commonJS({
|
|
|
231
231
|
};
|
|
232
232
|
}(fs3.readSync);
|
|
233
233
|
function patchLchmod(fs4) {
|
|
234
|
-
fs4.lchmod = function(
|
|
234
|
+
fs4.lchmod = function(path5, mode, callback) {
|
|
235
235
|
fs4.open(
|
|
236
|
-
|
|
236
|
+
path5,
|
|
237
237
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
238
238
|
mode,
|
|
239
239
|
function(err, fd) {
|
|
@@ -249,8 +249,8 @@ var require_polyfills = __commonJS({
|
|
|
249
249
|
}
|
|
250
250
|
);
|
|
251
251
|
};
|
|
252
|
-
fs4.lchmodSync = function(
|
|
253
|
-
var fd = fs4.openSync(
|
|
252
|
+
fs4.lchmodSync = function(path5, mode) {
|
|
253
|
+
var fd = fs4.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
254
254
|
var threw = true;
|
|
255
255
|
var ret;
|
|
256
256
|
try {
|
|
@@ -271,8 +271,8 @@ var require_polyfills = __commonJS({
|
|
|
271
271
|
}
|
|
272
272
|
function patchLutimes(fs4) {
|
|
273
273
|
if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
|
|
274
|
-
fs4.lutimes = function(
|
|
275
|
-
fs4.open(
|
|
274
|
+
fs4.lutimes = function(path5, at, mt, cb) {
|
|
275
|
+
fs4.open(path5, constants.O_SYMLINK, function(er, fd) {
|
|
276
276
|
if (er) {
|
|
277
277
|
if (cb) cb(er);
|
|
278
278
|
return;
|
|
@@ -284,8 +284,8 @@ var require_polyfills = __commonJS({
|
|
|
284
284
|
});
|
|
285
285
|
});
|
|
286
286
|
};
|
|
287
|
-
fs4.lutimesSync = function(
|
|
288
|
-
var fd = fs4.openSync(
|
|
287
|
+
fs4.lutimesSync = function(path5, at, mt) {
|
|
288
|
+
var fd = fs4.openSync(path5, constants.O_SYMLINK);
|
|
289
289
|
var ret;
|
|
290
290
|
var threw = true;
|
|
291
291
|
try {
|
|
@@ -404,11 +404,11 @@ var require_legacy_streams = __commonJS({
|
|
|
404
404
|
ReadStream,
|
|
405
405
|
WriteStream
|
|
406
406
|
};
|
|
407
|
-
function ReadStream(
|
|
408
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
407
|
+
function ReadStream(path5, options) {
|
|
408
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
|
|
409
409
|
Stream.call(this);
|
|
410
410
|
var self = this;
|
|
411
|
-
this.path =
|
|
411
|
+
this.path = path5;
|
|
412
412
|
this.fd = null;
|
|
413
413
|
this.readable = true;
|
|
414
414
|
this.paused = false;
|
|
@@ -453,10 +453,10 @@ var require_legacy_streams = __commonJS({
|
|
|
453
453
|
self._read();
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
|
-
function WriteStream(
|
|
457
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
456
|
+
function WriteStream(path5, options) {
|
|
457
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
|
|
458
458
|
Stream.call(this);
|
|
459
|
-
this.path =
|
|
459
|
+
this.path = path5;
|
|
460
460
|
this.fd = null;
|
|
461
461
|
this.writable = true;
|
|
462
462
|
this.flags = "w";
|
|
@@ -600,14 +600,14 @@ var require_graceful_fs = __commonJS({
|
|
|
600
600
|
fs4.createWriteStream = createWriteStream;
|
|
601
601
|
var fs$readFile = fs4.readFile;
|
|
602
602
|
fs4.readFile = readFile;
|
|
603
|
-
function readFile(
|
|
603
|
+
function readFile(path5, options, cb) {
|
|
604
604
|
if (typeof options === "function")
|
|
605
605
|
cb = options, options = null;
|
|
606
|
-
return go$readFile(
|
|
607
|
-
function go$readFile(
|
|
608
|
-
return fs$readFile(
|
|
606
|
+
return go$readFile(path5, options, cb);
|
|
607
|
+
function go$readFile(path6, options2, cb2, startTime) {
|
|
608
|
+
return fs$readFile(path6, options2, function(err) {
|
|
609
609
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
610
|
-
enqueue([go$readFile, [
|
|
610
|
+
enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
611
611
|
else {
|
|
612
612
|
if (typeof cb2 === "function")
|
|
613
613
|
cb2.apply(this, arguments);
|
|
@@ -617,14 +617,14 @@ var require_graceful_fs = __commonJS({
|
|
|
617
617
|
}
|
|
618
618
|
var fs$writeFile = fs4.writeFile;
|
|
619
619
|
fs4.writeFile = writeFile;
|
|
620
|
-
function writeFile(
|
|
620
|
+
function writeFile(path5, data, options, cb) {
|
|
621
621
|
if (typeof options === "function")
|
|
622
622
|
cb = options, options = null;
|
|
623
|
-
return go$writeFile(
|
|
624
|
-
function go$writeFile(
|
|
625
|
-
return fs$writeFile(
|
|
623
|
+
return go$writeFile(path5, data, options, cb);
|
|
624
|
+
function go$writeFile(path6, data2, options2, cb2, startTime) {
|
|
625
|
+
return fs$writeFile(path6, data2, options2, function(err) {
|
|
626
626
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
627
|
-
enqueue([go$writeFile, [
|
|
627
|
+
enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
628
628
|
else {
|
|
629
629
|
if (typeof cb2 === "function")
|
|
630
630
|
cb2.apply(this, arguments);
|
|
@@ -635,14 +635,14 @@ var require_graceful_fs = __commonJS({
|
|
|
635
635
|
var fs$appendFile = fs4.appendFile;
|
|
636
636
|
if (fs$appendFile)
|
|
637
637
|
fs4.appendFile = appendFile;
|
|
638
|
-
function appendFile(
|
|
638
|
+
function appendFile(path5, data, options, cb) {
|
|
639
639
|
if (typeof options === "function")
|
|
640
640
|
cb = options, options = null;
|
|
641
|
-
return go$appendFile(
|
|
642
|
-
function go$appendFile(
|
|
643
|
-
return fs$appendFile(
|
|
641
|
+
return go$appendFile(path5, data, options, cb);
|
|
642
|
+
function go$appendFile(path6, data2, options2, cb2, startTime) {
|
|
643
|
+
return fs$appendFile(path6, data2, options2, function(err) {
|
|
644
644
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
645
|
-
enqueue([go$appendFile, [
|
|
645
|
+
enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
646
646
|
else {
|
|
647
647
|
if (typeof cb2 === "function")
|
|
648
648
|
cb2.apply(this, arguments);
|
|
@@ -673,31 +673,31 @@ var require_graceful_fs = __commonJS({
|
|
|
673
673
|
var fs$readdir = fs4.readdir;
|
|
674
674
|
fs4.readdir = readdir;
|
|
675
675
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
676
|
-
function readdir(
|
|
676
|
+
function readdir(path5, options, cb) {
|
|
677
677
|
if (typeof options === "function")
|
|
678
678
|
cb = options, options = null;
|
|
679
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
680
|
-
return fs$readdir(
|
|
681
|
-
|
|
679
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
|
|
680
|
+
return fs$readdir(path6, fs$readdirCallback(
|
|
681
|
+
path6,
|
|
682
682
|
options2,
|
|
683
683
|
cb2,
|
|
684
684
|
startTime
|
|
685
685
|
));
|
|
686
|
-
} : function go$readdir2(
|
|
687
|
-
return fs$readdir(
|
|
688
|
-
|
|
686
|
+
} : function go$readdir2(path6, options2, cb2, startTime) {
|
|
687
|
+
return fs$readdir(path6, options2, fs$readdirCallback(
|
|
688
|
+
path6,
|
|
689
689
|
options2,
|
|
690
690
|
cb2,
|
|
691
691
|
startTime
|
|
692
692
|
));
|
|
693
693
|
};
|
|
694
|
-
return go$readdir(
|
|
695
|
-
function fs$readdirCallback(
|
|
694
|
+
return go$readdir(path5, options, cb);
|
|
695
|
+
function fs$readdirCallback(path6, options2, cb2, startTime) {
|
|
696
696
|
return function(err, files) {
|
|
697
697
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
698
698
|
enqueue([
|
|
699
699
|
go$readdir,
|
|
700
|
-
[
|
|
700
|
+
[path6, options2, cb2],
|
|
701
701
|
err,
|
|
702
702
|
startTime || Date.now(),
|
|
703
703
|
Date.now()
|
|
@@ -768,7 +768,7 @@ var require_graceful_fs = __commonJS({
|
|
|
768
768
|
enumerable: true,
|
|
769
769
|
configurable: true
|
|
770
770
|
});
|
|
771
|
-
function ReadStream(
|
|
771
|
+
function ReadStream(path5, options) {
|
|
772
772
|
if (this instanceof ReadStream)
|
|
773
773
|
return fs$ReadStream.apply(this, arguments), this;
|
|
774
774
|
else
|
|
@@ -788,7 +788,7 @@ var require_graceful_fs = __commonJS({
|
|
|
788
788
|
}
|
|
789
789
|
});
|
|
790
790
|
}
|
|
791
|
-
function WriteStream(
|
|
791
|
+
function WriteStream(path5, options) {
|
|
792
792
|
if (this instanceof WriteStream)
|
|
793
793
|
return fs$WriteStream.apply(this, arguments), this;
|
|
794
794
|
else
|
|
@@ -806,22 +806,22 @@ var require_graceful_fs = __commonJS({
|
|
|
806
806
|
}
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
|
-
function createReadStream(
|
|
810
|
-
return new fs4.ReadStream(
|
|
809
|
+
function createReadStream(path5, options) {
|
|
810
|
+
return new fs4.ReadStream(path5, options);
|
|
811
811
|
}
|
|
812
|
-
function createWriteStream(
|
|
813
|
-
return new fs4.WriteStream(
|
|
812
|
+
function createWriteStream(path5, options) {
|
|
813
|
+
return new fs4.WriteStream(path5, options);
|
|
814
814
|
}
|
|
815
815
|
var fs$open = fs4.open;
|
|
816
816
|
fs4.open = open;
|
|
817
|
-
function open(
|
|
817
|
+
function open(path5, flags, mode, cb) {
|
|
818
818
|
if (typeof mode === "function")
|
|
819
819
|
cb = mode, mode = null;
|
|
820
|
-
return go$open(
|
|
821
|
-
function go$open(
|
|
822
|
-
return fs$open(
|
|
820
|
+
return go$open(path5, flags, mode, cb);
|
|
821
|
+
function go$open(path6, flags2, mode2, cb2, startTime) {
|
|
822
|
+
return fs$open(path6, flags2, mode2, function(err, fd) {
|
|
823
823
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
824
|
-
enqueue([go$open, [
|
|
824
|
+
enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
825
825
|
else {
|
|
826
826
|
if (typeof cb2 === "function")
|
|
827
827
|
cb2.apply(this, arguments);
|
|
@@ -1000,10 +1000,10 @@ var require_fs = __commonJS({
|
|
|
1000
1000
|
var require_utils = __commonJS({
|
|
1001
1001
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
1002
1002
|
"use strict";
|
|
1003
|
-
var
|
|
1003
|
+
var path5 = require("path");
|
|
1004
1004
|
module2.exports.checkPath = function checkPath(pth) {
|
|
1005
1005
|
if (process.platform === "win32") {
|
|
1006
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
1006
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
|
|
1007
1007
|
if (pathHasInvalidWinCharacters) {
|
|
1008
1008
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
1009
1009
|
error.code = "EINVAL";
|
|
@@ -1067,8 +1067,8 @@ var require_path_exists = __commonJS({
|
|
|
1067
1067
|
"use strict";
|
|
1068
1068
|
var u = require_universalify().fromPromise;
|
|
1069
1069
|
var fs3 = require_fs();
|
|
1070
|
-
function pathExists2(
|
|
1071
|
-
return fs3.access(
|
|
1070
|
+
function pathExists2(path5) {
|
|
1071
|
+
return fs3.access(path5).then(() => true).catch(() => false);
|
|
1072
1072
|
}
|
|
1073
1073
|
module2.exports = {
|
|
1074
1074
|
pathExists: u(pathExists2),
|
|
@@ -1082,8 +1082,8 @@ var require_utimes = __commonJS({
|
|
|
1082
1082
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
1083
1083
|
"use strict";
|
|
1084
1084
|
var fs3 = require_graceful_fs();
|
|
1085
|
-
function utimesMillis(
|
|
1086
|
-
fs3.open(
|
|
1085
|
+
function utimesMillis(path5, atime, mtime, callback) {
|
|
1086
|
+
fs3.open(path5, "r+", (err, fd) => {
|
|
1087
1087
|
if (err) return callback(err);
|
|
1088
1088
|
fs3.futimes(fd, atime, mtime, (futimesErr) => {
|
|
1089
1089
|
fs3.close(fd, (closeErr) => {
|
|
@@ -1092,8 +1092,8 @@ var require_utimes = __commonJS({
|
|
|
1092
1092
|
});
|
|
1093
1093
|
});
|
|
1094
1094
|
}
|
|
1095
|
-
function utimesMillisSync(
|
|
1096
|
-
const fd = fs3.openSync(
|
|
1095
|
+
function utimesMillisSync(path5, atime, mtime) {
|
|
1096
|
+
const fd = fs3.openSync(path5, "r+");
|
|
1097
1097
|
fs3.futimesSync(fd, atime, mtime);
|
|
1098
1098
|
return fs3.closeSync(fd);
|
|
1099
1099
|
}
|
|
@@ -1109,7 +1109,7 @@ var require_stat = __commonJS({
|
|
|
1109
1109
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
1110
1110
|
"use strict";
|
|
1111
1111
|
var fs3 = require_fs();
|
|
1112
|
-
var
|
|
1112
|
+
var path5 = require("path");
|
|
1113
1113
|
var util2 = require("util");
|
|
1114
1114
|
function getStats(src, dest, opts) {
|
|
1115
1115
|
const statFunc = opts.dereference ? (file2) => fs3.stat(file2, { bigint: true }) : (file2) => fs3.lstat(file2, { bigint: true });
|
|
@@ -1139,8 +1139,8 @@ var require_stat = __commonJS({
|
|
|
1139
1139
|
const { srcStat, destStat } = stats;
|
|
1140
1140
|
if (destStat) {
|
|
1141
1141
|
if (areIdentical(srcStat, destStat)) {
|
|
1142
|
-
const srcBaseName =
|
|
1143
|
-
const destBaseName =
|
|
1142
|
+
const srcBaseName = path5.basename(src);
|
|
1143
|
+
const destBaseName = path5.basename(dest);
|
|
1144
1144
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1145
1145
|
return cb(null, { srcStat, destStat, isChangingCase: true });
|
|
1146
1146
|
}
|
|
@@ -1163,8 +1163,8 @@ var require_stat = __commonJS({
|
|
|
1163
1163
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1164
1164
|
if (destStat) {
|
|
1165
1165
|
if (areIdentical(srcStat, destStat)) {
|
|
1166
|
-
const srcBaseName =
|
|
1167
|
-
const destBaseName =
|
|
1166
|
+
const srcBaseName = path5.basename(src);
|
|
1167
|
+
const destBaseName = path5.basename(dest);
|
|
1168
1168
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1169
1169
|
return { srcStat, destStat, isChangingCase: true };
|
|
1170
1170
|
}
|
|
@@ -1183,9 +1183,9 @@ var require_stat = __commonJS({
|
|
|
1183
1183
|
return { srcStat, destStat };
|
|
1184
1184
|
}
|
|
1185
1185
|
function checkParentPaths(src, srcStat, dest, funcName, cb) {
|
|
1186
|
-
const srcParent =
|
|
1187
|
-
const destParent =
|
|
1188
|
-
if (destParent === srcParent || destParent ===
|
|
1186
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1187
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1188
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root) return cb();
|
|
1189
1189
|
fs3.stat(destParent, { bigint: true }, (err, destStat) => {
|
|
1190
1190
|
if (err) {
|
|
1191
1191
|
if (err.code === "ENOENT") return cb();
|
|
@@ -1198,9 +1198,9 @@ var require_stat = __commonJS({
|
|
|
1198
1198
|
});
|
|
1199
1199
|
}
|
|
1200
1200
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1201
|
-
const srcParent =
|
|
1202
|
-
const destParent =
|
|
1203
|
-
if (destParent === srcParent || destParent ===
|
|
1201
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1202
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1203
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
|
|
1204
1204
|
let destStat;
|
|
1205
1205
|
try {
|
|
1206
1206
|
destStat = fs3.statSync(destParent, { bigint: true });
|
|
@@ -1217,8 +1217,8 @@ var require_stat = __commonJS({
|
|
|
1217
1217
|
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1218
1218
|
}
|
|
1219
1219
|
function isSrcSubdir(src, dest) {
|
|
1220
|
-
const srcArr =
|
|
1221
|
-
const destArr =
|
|
1220
|
+
const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
|
|
1221
|
+
const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
|
|
1222
1222
|
return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true);
|
|
1223
1223
|
}
|
|
1224
1224
|
function errMsg(src, dest, funcName) {
|
|
@@ -1240,7 +1240,7 @@ var require_copy = __commonJS({
|
|
|
1240
1240
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
1241
1241
|
"use strict";
|
|
1242
1242
|
var fs3 = require_graceful_fs();
|
|
1243
|
-
var
|
|
1243
|
+
var path5 = require("path");
|
|
1244
1244
|
var mkdirs = require_mkdirs().mkdirs;
|
|
1245
1245
|
var pathExists2 = require_path_exists().pathExists;
|
|
1246
1246
|
var utimesMillis = require_utimes().utimesMillis;
|
|
@@ -1278,7 +1278,7 @@ var require_copy = __commonJS({
|
|
|
1278
1278
|
});
|
|
1279
1279
|
}
|
|
1280
1280
|
function checkParentDir(destStat, src, dest, opts, cb) {
|
|
1281
|
-
const destParent =
|
|
1281
|
+
const destParent = path5.dirname(dest);
|
|
1282
1282
|
pathExists2(destParent, (err, dirExists) => {
|
|
1283
1283
|
if (err) return cb(err);
|
|
1284
1284
|
if (dirExists) return getStats(destStat, src, dest, opts, cb);
|
|
@@ -1380,8 +1380,8 @@ var require_copy = __commonJS({
|
|
|
1380
1380
|
return copyDirItem(items, item, src, dest, opts, cb);
|
|
1381
1381
|
}
|
|
1382
1382
|
function copyDirItem(items, item, src, dest, opts, cb) {
|
|
1383
|
-
const srcItem =
|
|
1384
|
-
const destItem =
|
|
1383
|
+
const srcItem = path5.join(src, item);
|
|
1384
|
+
const destItem = path5.join(dest, item);
|
|
1385
1385
|
runFilter(srcItem, destItem, opts, (err, include) => {
|
|
1386
1386
|
if (err) return cb(err);
|
|
1387
1387
|
if (!include) return copyDirItems(items, src, dest, opts, cb);
|
|
@@ -1399,7 +1399,7 @@ var require_copy = __commonJS({
|
|
|
1399
1399
|
fs3.readlink(src, (err, resolvedSrc) => {
|
|
1400
1400
|
if (err) return cb(err);
|
|
1401
1401
|
if (opts.dereference) {
|
|
1402
|
-
resolvedSrc =
|
|
1402
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1403
1403
|
}
|
|
1404
1404
|
if (!destStat) {
|
|
1405
1405
|
return fs3.symlink(resolvedSrc, dest, cb);
|
|
@@ -1410,7 +1410,7 @@ var require_copy = __commonJS({
|
|
|
1410
1410
|
return cb(err2);
|
|
1411
1411
|
}
|
|
1412
1412
|
if (opts.dereference) {
|
|
1413
|
-
resolvedDest =
|
|
1413
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1414
1414
|
}
|
|
1415
1415
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1416
1416
|
return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
|
|
@@ -1438,7 +1438,7 @@ var require_copy_sync = __commonJS({
|
|
|
1438
1438
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
1439
1439
|
"use strict";
|
|
1440
1440
|
var fs3 = require_graceful_fs();
|
|
1441
|
-
var
|
|
1441
|
+
var path5 = require("path");
|
|
1442
1442
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1443
1443
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1444
1444
|
var stat = require_stat();
|
|
@@ -1459,7 +1459,7 @@ var require_copy_sync = __commonJS({
|
|
|
1459
1459
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1460
1460
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1461
1461
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1462
|
-
const destParent =
|
|
1462
|
+
const destParent = path5.dirname(dest);
|
|
1463
1463
|
if (!fs3.existsSync(destParent)) mkdirsSync(destParent);
|
|
1464
1464
|
return getStats(destStat, src, dest, opts);
|
|
1465
1465
|
}
|
|
@@ -1520,8 +1520,8 @@ var require_copy_sync = __commonJS({
|
|
|
1520
1520
|
fs3.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
1521
1521
|
}
|
|
1522
1522
|
function copyDirItem(item, src, dest, opts) {
|
|
1523
|
-
const srcItem =
|
|
1524
|
-
const destItem =
|
|
1523
|
+
const srcItem = path5.join(src, item);
|
|
1524
|
+
const destItem = path5.join(dest, item);
|
|
1525
1525
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1526
1526
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1527
1527
|
return getStats(destStat, srcItem, destItem, opts);
|
|
@@ -1529,7 +1529,7 @@ var require_copy_sync = __commonJS({
|
|
|
1529
1529
|
function onLink(destStat, src, dest, opts) {
|
|
1530
1530
|
let resolvedSrc = fs3.readlinkSync(src);
|
|
1531
1531
|
if (opts.dereference) {
|
|
1532
|
-
resolvedSrc =
|
|
1532
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1533
1533
|
}
|
|
1534
1534
|
if (!destStat) {
|
|
1535
1535
|
return fs3.symlinkSync(resolvedSrc, dest);
|
|
@@ -1542,7 +1542,7 @@ var require_copy_sync = __commonJS({
|
|
|
1542
1542
|
throw err;
|
|
1543
1543
|
}
|
|
1544
1544
|
if (opts.dereference) {
|
|
1545
|
-
resolvedDest =
|
|
1545
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1546
1546
|
}
|
|
1547
1547
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1548
1548
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -1579,11 +1579,11 @@ var require_remove = __commonJS({
|
|
|
1579
1579
|
"use strict";
|
|
1580
1580
|
var fs3 = require_graceful_fs();
|
|
1581
1581
|
var u = require_universalify().fromCallback;
|
|
1582
|
-
function remove(
|
|
1583
|
-
fs3.rm(
|
|
1582
|
+
function remove(path5, callback) {
|
|
1583
|
+
fs3.rm(path5, { recursive: true, force: true }, callback);
|
|
1584
1584
|
}
|
|
1585
|
-
function removeSync(
|
|
1586
|
-
fs3.rmSync(
|
|
1585
|
+
function removeSync(path5) {
|
|
1586
|
+
fs3.rmSync(path5, { recursive: true, force: true });
|
|
1587
1587
|
}
|
|
1588
1588
|
module2.exports = {
|
|
1589
1589
|
remove: u(remove),
|
|
@@ -1598,7 +1598,7 @@ var require_empty = __commonJS({
|
|
|
1598
1598
|
"use strict";
|
|
1599
1599
|
var u = require_universalify().fromPromise;
|
|
1600
1600
|
var fs3 = require_fs();
|
|
1601
|
-
var
|
|
1601
|
+
var path5 = require("path");
|
|
1602
1602
|
var mkdir = require_mkdirs();
|
|
1603
1603
|
var remove = require_remove();
|
|
1604
1604
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
@@ -1608,7 +1608,7 @@ var require_empty = __commonJS({
|
|
|
1608
1608
|
} catch {
|
|
1609
1609
|
return mkdir.mkdirs(dir);
|
|
1610
1610
|
}
|
|
1611
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
1611
|
+
return Promise.all(items.map((item) => remove.remove(path5.join(dir, item))));
|
|
1612
1612
|
});
|
|
1613
1613
|
function emptyDirSync(dir) {
|
|
1614
1614
|
let items;
|
|
@@ -1618,7 +1618,7 @@ var require_empty = __commonJS({
|
|
|
1618
1618
|
return mkdir.mkdirsSync(dir);
|
|
1619
1619
|
}
|
|
1620
1620
|
items.forEach((item) => {
|
|
1621
|
-
item =
|
|
1621
|
+
item = path5.join(dir, item);
|
|
1622
1622
|
remove.removeSync(item);
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
@@ -1636,7 +1636,7 @@ var require_file = __commonJS({
|
|
|
1636
1636
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
1637
1637
|
"use strict";
|
|
1638
1638
|
var u = require_universalify().fromCallback;
|
|
1639
|
-
var
|
|
1639
|
+
var path5 = require("path");
|
|
1640
1640
|
var fs3 = require_graceful_fs();
|
|
1641
1641
|
var mkdir = require_mkdirs();
|
|
1642
1642
|
function createFile(file2, callback) {
|
|
@@ -1648,7 +1648,7 @@ var require_file = __commonJS({
|
|
|
1648
1648
|
}
|
|
1649
1649
|
fs3.stat(file2, (err, stats) => {
|
|
1650
1650
|
if (!err && stats.isFile()) return callback();
|
|
1651
|
-
const dir =
|
|
1651
|
+
const dir = path5.dirname(file2);
|
|
1652
1652
|
fs3.stat(dir, (err2, stats2) => {
|
|
1653
1653
|
if (err2) {
|
|
1654
1654
|
if (err2.code === "ENOENT") {
|
|
@@ -1675,7 +1675,7 @@ var require_file = __commonJS({
|
|
|
1675
1675
|
} catch {
|
|
1676
1676
|
}
|
|
1677
1677
|
if (stats && stats.isFile()) return;
|
|
1678
|
-
const dir =
|
|
1678
|
+
const dir = path5.dirname(file2);
|
|
1679
1679
|
try {
|
|
1680
1680
|
if (!fs3.statSync(dir).isDirectory()) {
|
|
1681
1681
|
fs3.readdirSync(dir);
|
|
@@ -1698,7 +1698,7 @@ var require_link = __commonJS({
|
|
|
1698
1698
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
1699
1699
|
"use strict";
|
|
1700
1700
|
var u = require_universalify().fromCallback;
|
|
1701
|
-
var
|
|
1701
|
+
var path5 = require("path");
|
|
1702
1702
|
var fs3 = require_graceful_fs();
|
|
1703
1703
|
var mkdir = require_mkdirs();
|
|
1704
1704
|
var pathExists2 = require_path_exists().pathExists;
|
|
@@ -1717,7 +1717,7 @@ var require_link = __commonJS({
|
|
|
1717
1717
|
return callback(err);
|
|
1718
1718
|
}
|
|
1719
1719
|
if (dstStat && areIdentical(srcStat, dstStat)) return callback(null);
|
|
1720
|
-
const dir =
|
|
1720
|
+
const dir = path5.dirname(dstpath);
|
|
1721
1721
|
pathExists2(dir, (err2, dirExists) => {
|
|
1722
1722
|
if (err2) return callback(err2);
|
|
1723
1723
|
if (dirExists) return makeLink(srcpath, dstpath);
|
|
@@ -1742,7 +1742,7 @@ var require_link = __commonJS({
|
|
|
1742
1742
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1743
1743
|
throw err;
|
|
1744
1744
|
}
|
|
1745
|
-
const dir =
|
|
1745
|
+
const dir = path5.dirname(dstpath);
|
|
1746
1746
|
const dirExists = fs3.existsSync(dir);
|
|
1747
1747
|
if (dirExists) return fs3.linkSync(srcpath, dstpath);
|
|
1748
1748
|
mkdir.mkdirsSync(dir);
|
|
@@ -1759,11 +1759,11 @@ var require_link = __commonJS({
|
|
|
1759
1759
|
var require_symlink_paths = __commonJS({
|
|
1760
1760
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
1761
1761
|
"use strict";
|
|
1762
|
-
var
|
|
1762
|
+
var path5 = require("path");
|
|
1763
1763
|
var fs3 = require_graceful_fs();
|
|
1764
1764
|
var pathExists2 = require_path_exists().pathExists;
|
|
1765
1765
|
function symlinkPaths(srcpath, dstpath, callback) {
|
|
1766
|
-
if (
|
|
1766
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1767
1767
|
return fs3.lstat(srcpath, (err) => {
|
|
1768
1768
|
if (err) {
|
|
1769
1769
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
@@ -1775,8 +1775,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1775
1775
|
});
|
|
1776
1776
|
});
|
|
1777
1777
|
} else {
|
|
1778
|
-
const dstdir =
|
|
1779
|
-
const relativeToDst =
|
|
1778
|
+
const dstdir = path5.dirname(dstpath);
|
|
1779
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1780
1780
|
return pathExists2(relativeToDst, (err, exists) => {
|
|
1781
1781
|
if (err) return callback(err);
|
|
1782
1782
|
if (exists) {
|
|
@@ -1792,7 +1792,7 @@ var require_symlink_paths = __commonJS({
|
|
|
1792
1792
|
}
|
|
1793
1793
|
return callback(null, {
|
|
1794
1794
|
toCwd: srcpath,
|
|
1795
|
-
toDst:
|
|
1795
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1796
1796
|
});
|
|
1797
1797
|
});
|
|
1798
1798
|
}
|
|
@@ -1801,7 +1801,7 @@ var require_symlink_paths = __commonJS({
|
|
|
1801
1801
|
}
|
|
1802
1802
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1803
1803
|
let exists;
|
|
1804
|
-
if (
|
|
1804
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1805
1805
|
exists = fs3.existsSync(srcpath);
|
|
1806
1806
|
if (!exists) throw new Error("absolute srcpath does not exist");
|
|
1807
1807
|
return {
|
|
@@ -1809,8 +1809,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1809
1809
|
toDst: srcpath
|
|
1810
1810
|
};
|
|
1811
1811
|
} else {
|
|
1812
|
-
const dstdir =
|
|
1813
|
-
const relativeToDst =
|
|
1812
|
+
const dstdir = path5.dirname(dstpath);
|
|
1813
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1814
1814
|
exists = fs3.existsSync(relativeToDst);
|
|
1815
1815
|
if (exists) {
|
|
1816
1816
|
return {
|
|
@@ -1822,7 +1822,7 @@ var require_symlink_paths = __commonJS({
|
|
|
1822
1822
|
if (!exists) throw new Error("relative srcpath does not exist");
|
|
1823
1823
|
return {
|
|
1824
1824
|
toCwd: srcpath,
|
|
1825
|
-
toDst:
|
|
1825
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1826
1826
|
};
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
@@ -1871,7 +1871,7 @@ var require_symlink = __commonJS({
|
|
|
1871
1871
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
1872
1872
|
"use strict";
|
|
1873
1873
|
var u = require_universalify().fromCallback;
|
|
1874
|
-
var
|
|
1874
|
+
var path5 = require("path");
|
|
1875
1875
|
var fs3 = require_fs();
|
|
1876
1876
|
var _mkdirs = require_mkdirs();
|
|
1877
1877
|
var mkdirs = _mkdirs.mkdirs;
|
|
@@ -1905,7 +1905,7 @@ var require_symlink = __commonJS({
|
|
|
1905
1905
|
srcpath = relative.toDst;
|
|
1906
1906
|
symlinkType(relative.toCwd, type, (err2, type2) => {
|
|
1907
1907
|
if (err2) return callback(err2);
|
|
1908
|
-
const dir =
|
|
1908
|
+
const dir = path5.dirname(dstpath);
|
|
1909
1909
|
pathExists2(dir, (err3, dirExists) => {
|
|
1910
1910
|
if (err3) return callback(err3);
|
|
1911
1911
|
if (dirExists) return fs3.symlink(srcpath, dstpath, type2, callback);
|
|
@@ -1931,7 +1931,7 @@ var require_symlink = __commonJS({
|
|
|
1931
1931
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1932
1932
|
srcpath = relative.toDst;
|
|
1933
1933
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
1934
|
-
const dir =
|
|
1934
|
+
const dir = path5.dirname(dstpath);
|
|
1935
1935
|
const exists = fs3.existsSync(dir);
|
|
1936
1936
|
if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
|
|
1937
1937
|
mkdirsSync(dir);
|
|
@@ -2083,7 +2083,7 @@ var require_output_file = __commonJS({
|
|
|
2083
2083
|
"use strict";
|
|
2084
2084
|
var u = require_universalify().fromCallback;
|
|
2085
2085
|
var fs3 = require_graceful_fs();
|
|
2086
|
-
var
|
|
2086
|
+
var path5 = require("path");
|
|
2087
2087
|
var mkdir = require_mkdirs();
|
|
2088
2088
|
var pathExists2 = require_path_exists().pathExists;
|
|
2089
2089
|
function outputFile(file2, data, encoding, callback) {
|
|
@@ -2091,7 +2091,7 @@ var require_output_file = __commonJS({
|
|
|
2091
2091
|
callback = encoding;
|
|
2092
2092
|
encoding = "utf8";
|
|
2093
2093
|
}
|
|
2094
|
-
const dir =
|
|
2094
|
+
const dir = path5.dirname(file2);
|
|
2095
2095
|
pathExists2(dir, (err, itDoes) => {
|
|
2096
2096
|
if (err) return callback(err);
|
|
2097
2097
|
if (itDoes) return fs3.writeFile(file2, data, encoding, callback);
|
|
@@ -2102,7 +2102,7 @@ var require_output_file = __commonJS({
|
|
|
2102
2102
|
});
|
|
2103
2103
|
}
|
|
2104
2104
|
function outputFileSync(file2, ...args) {
|
|
2105
|
-
const dir =
|
|
2105
|
+
const dir = path5.dirname(file2);
|
|
2106
2106
|
if (fs3.existsSync(dir)) {
|
|
2107
2107
|
return fs3.writeFileSync(file2, ...args);
|
|
2108
2108
|
}
|
|
@@ -2167,7 +2167,7 @@ var require_move = __commonJS({
|
|
|
2167
2167
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
2168
2168
|
"use strict";
|
|
2169
2169
|
var fs3 = require_graceful_fs();
|
|
2170
|
-
var
|
|
2170
|
+
var path5 = require("path");
|
|
2171
2171
|
var copy = require_copy2().copy;
|
|
2172
2172
|
var remove = require_remove().remove;
|
|
2173
2173
|
var mkdirp = require_mkdirs().mkdirp;
|
|
@@ -2186,7 +2186,7 @@ var require_move = __commonJS({
|
|
|
2186
2186
|
stat.checkParentPaths(src, srcStat, dest, "move", (err2) => {
|
|
2187
2187
|
if (err2) return cb(err2);
|
|
2188
2188
|
if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb);
|
|
2189
|
-
mkdirp(
|
|
2189
|
+
mkdirp(path5.dirname(dest), (err3) => {
|
|
2190
2190
|
if (err3) return cb(err3);
|
|
2191
2191
|
return doRename(src, dest, overwrite, isChangingCase, cb);
|
|
2192
2192
|
});
|
|
@@ -2194,8 +2194,8 @@ var require_move = __commonJS({
|
|
|
2194
2194
|
});
|
|
2195
2195
|
}
|
|
2196
2196
|
function isParentRoot(dest) {
|
|
2197
|
-
const parent =
|
|
2198
|
-
const parsedPath =
|
|
2197
|
+
const parent = path5.dirname(dest);
|
|
2198
|
+
const parsedPath = path5.parse(parent);
|
|
2199
2199
|
return parsedPath.root === parent;
|
|
2200
2200
|
}
|
|
2201
2201
|
function doRename(src, dest, overwrite, isChangingCase, cb) {
|
|
@@ -2239,7 +2239,7 @@ var require_move_sync = __commonJS({
|
|
|
2239
2239
|
"../../node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
2240
2240
|
"use strict";
|
|
2241
2241
|
var fs3 = require_graceful_fs();
|
|
2242
|
-
var
|
|
2242
|
+
var path5 = require("path");
|
|
2243
2243
|
var copySync = require_copy2().copySync;
|
|
2244
2244
|
var removeSync = require_remove().removeSync;
|
|
2245
2245
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2249,12 +2249,12 @@ var require_move_sync = __commonJS({
|
|
|
2249
2249
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2250
2250
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2251
2251
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2252
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2252
|
+
if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest));
|
|
2253
2253
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2254
2254
|
}
|
|
2255
2255
|
function isParentRoot(dest) {
|
|
2256
|
-
const parent =
|
|
2257
|
-
const parsedPath =
|
|
2256
|
+
const parent = path5.dirname(dest);
|
|
2257
|
+
const parsedPath = path5.parse(parent);
|
|
2258
2258
|
return parsedPath.root === parent;
|
|
2259
2259
|
}
|
|
2260
2260
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2326,8 +2326,8 @@ var require_common_path_prefix = __commonJS({
|
|
|
2326
2326
|
"use strict";
|
|
2327
2327
|
var { sep: DEFAULT_SEPARATOR } = require("path");
|
|
2328
2328
|
var determineSeparator = (paths2) => {
|
|
2329
|
-
for (const
|
|
2330
|
-
const match = /(\/|\\)/.exec(
|
|
2329
|
+
for (const path5 of paths2) {
|
|
2330
|
+
const match = /(\/|\\)/.exec(path5);
|
|
2331
2331
|
if (match !== null) return match[0];
|
|
2332
2332
|
}
|
|
2333
2333
|
return DEFAULT_SEPARATOR;
|
|
@@ -2337,8 +2337,8 @@ var require_common_path_prefix = __commonJS({
|
|
|
2337
2337
|
if (first === "" || remaining.length === 0) return "";
|
|
2338
2338
|
const parts = first.split(sep);
|
|
2339
2339
|
let endOfPrefix = parts.length;
|
|
2340
|
-
for (const
|
|
2341
|
-
const compare =
|
|
2340
|
+
for (const path5 of remaining) {
|
|
2341
|
+
const compare = path5.split(sep);
|
|
2342
2342
|
for (let i = 0; i < endOfPrefix; i++) {
|
|
2343
2343
|
if (compare[i] !== parts[i]) {
|
|
2344
2344
|
endOfPrefix = i;
|
|
@@ -2913,42 +2913,42 @@ var require_pluralize = __commonJS({
|
|
|
2913
2913
|
var require_env_paths = __commonJS({
|
|
2914
2914
|
"../../node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module2) {
|
|
2915
2915
|
"use strict";
|
|
2916
|
-
var
|
|
2916
|
+
var path5 = require("path");
|
|
2917
2917
|
var os = require("os");
|
|
2918
2918
|
var homedir = os.homedir();
|
|
2919
2919
|
var tmpdir = os.tmpdir();
|
|
2920
2920
|
var { env: env2 } = process;
|
|
2921
2921
|
var macos = (name) => {
|
|
2922
|
-
const library =
|
|
2922
|
+
const library = path5.join(homedir, "Library");
|
|
2923
2923
|
return {
|
|
2924
|
-
data:
|
|
2925
|
-
config:
|
|
2926
|
-
cache:
|
|
2927
|
-
log:
|
|
2928
|
-
temp:
|
|
2924
|
+
data: path5.join(library, "Application Support", name),
|
|
2925
|
+
config: path5.join(library, "Preferences", name),
|
|
2926
|
+
cache: path5.join(library, "Caches", name),
|
|
2927
|
+
log: path5.join(library, "Logs", name),
|
|
2928
|
+
temp: path5.join(tmpdir, name)
|
|
2929
2929
|
};
|
|
2930
2930
|
};
|
|
2931
2931
|
var windows = (name) => {
|
|
2932
|
-
const appData = env2.APPDATA ||
|
|
2933
|
-
const localAppData = env2.LOCALAPPDATA ||
|
|
2932
|
+
const appData = env2.APPDATA || path5.join(homedir, "AppData", "Roaming");
|
|
2933
|
+
const localAppData = env2.LOCALAPPDATA || path5.join(homedir, "AppData", "Local");
|
|
2934
2934
|
return {
|
|
2935
2935
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
2936
|
-
data:
|
|
2937
|
-
config:
|
|
2938
|
-
cache:
|
|
2939
|
-
log:
|
|
2940
|
-
temp:
|
|
2936
|
+
data: path5.join(localAppData, name, "Data"),
|
|
2937
|
+
config: path5.join(appData, name, "Config"),
|
|
2938
|
+
cache: path5.join(localAppData, name, "Cache"),
|
|
2939
|
+
log: path5.join(localAppData, name, "Log"),
|
|
2940
|
+
temp: path5.join(tmpdir, name)
|
|
2941
2941
|
};
|
|
2942
2942
|
};
|
|
2943
2943
|
var linux = (name) => {
|
|
2944
|
-
const username =
|
|
2944
|
+
const username = path5.basename(homedir);
|
|
2945
2945
|
return {
|
|
2946
|
-
data:
|
|
2947
|
-
config:
|
|
2948
|
-
cache:
|
|
2946
|
+
data: path5.join(env2.XDG_DATA_HOME || path5.join(homedir, ".local", "share"), name),
|
|
2947
|
+
config: path5.join(env2.XDG_CONFIG_HOME || path5.join(homedir, ".config"), name),
|
|
2948
|
+
cache: path5.join(env2.XDG_CACHE_HOME || path5.join(homedir, ".cache"), name),
|
|
2949
2949
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
2950
|
-
log:
|
|
2951
|
-
temp:
|
|
2950
|
+
log: path5.join(env2.XDG_STATE_HOME || path5.join(homedir, ".local", "state"), name),
|
|
2951
|
+
temp: path5.join(tmpdir, username, name)
|
|
2952
2952
|
};
|
|
2953
2953
|
};
|
|
2954
2954
|
var envPaths = (name, options) => {
|
|
@@ -3087,21 +3087,21 @@ var require_p_locate = __commonJS({
|
|
|
3087
3087
|
var require_locate_path = __commonJS({
|
|
3088
3088
|
"../../node_modules/.pnpm/locate-path@3.0.0/node_modules/locate-path/index.js"(exports2, module2) {
|
|
3089
3089
|
"use strict";
|
|
3090
|
-
var
|
|
3090
|
+
var path5 = require("path");
|
|
3091
3091
|
var pathExists2 = require_path_exists2();
|
|
3092
3092
|
var pLocate2 = require_p_locate();
|
|
3093
3093
|
module2.exports = (iterable, options) => {
|
|
3094
3094
|
options = Object.assign({
|
|
3095
3095
|
cwd: process.cwd()
|
|
3096
3096
|
}, options);
|
|
3097
|
-
return pLocate2(iterable, (el) => pathExists2(
|
|
3097
|
+
return pLocate2(iterable, (el) => pathExists2(path5.resolve(options.cwd, el)), options);
|
|
3098
3098
|
};
|
|
3099
3099
|
module2.exports.sync = (iterable, options) => {
|
|
3100
3100
|
options = Object.assign({
|
|
3101
3101
|
cwd: process.cwd()
|
|
3102
3102
|
}, options);
|
|
3103
3103
|
for (const el of iterable) {
|
|
3104
|
-
if (pathExists2.sync(
|
|
3104
|
+
if (pathExists2.sync(path5.resolve(options.cwd, el))) {
|
|
3105
3105
|
return el;
|
|
3106
3106
|
}
|
|
3107
3107
|
}
|
|
@@ -3113,39 +3113,39 @@ var require_locate_path = __commonJS({
|
|
|
3113
3113
|
var require_find_up = __commonJS({
|
|
3114
3114
|
"../../node_modules/.pnpm/find-up@3.0.0/node_modules/find-up/index.js"(exports2, module2) {
|
|
3115
3115
|
"use strict";
|
|
3116
|
-
var
|
|
3116
|
+
var path5 = require("path");
|
|
3117
3117
|
var locatePath2 = require_locate_path();
|
|
3118
3118
|
module2.exports = (filename, opts = {}) => {
|
|
3119
|
-
const startDir =
|
|
3120
|
-
const { root } =
|
|
3119
|
+
const startDir = path5.resolve(opts.cwd || "");
|
|
3120
|
+
const { root } = path5.parse(startDir);
|
|
3121
3121
|
const filenames = [].concat(filename);
|
|
3122
3122
|
return new Promise((resolve) => {
|
|
3123
3123
|
(function find(dir) {
|
|
3124
3124
|
locatePath2(filenames, { cwd: dir }).then((file2) => {
|
|
3125
3125
|
if (file2) {
|
|
3126
|
-
resolve(
|
|
3126
|
+
resolve(path5.join(dir, file2));
|
|
3127
3127
|
} else if (dir === root) {
|
|
3128
3128
|
resolve(null);
|
|
3129
3129
|
} else {
|
|
3130
|
-
find(
|
|
3130
|
+
find(path5.dirname(dir));
|
|
3131
3131
|
}
|
|
3132
3132
|
});
|
|
3133
3133
|
})(startDir);
|
|
3134
3134
|
});
|
|
3135
3135
|
};
|
|
3136
3136
|
module2.exports.sync = (filename, opts = {}) => {
|
|
3137
|
-
let dir =
|
|
3138
|
-
const { root } =
|
|
3137
|
+
let dir = path5.resolve(opts.cwd || "");
|
|
3138
|
+
const { root } = path5.parse(dir);
|
|
3139
3139
|
const filenames = [].concat(filename);
|
|
3140
3140
|
while (true) {
|
|
3141
3141
|
const file2 = locatePath2.sync(filenames, { cwd: dir });
|
|
3142
3142
|
if (file2) {
|
|
3143
|
-
return
|
|
3143
|
+
return path5.join(dir, file2);
|
|
3144
3144
|
}
|
|
3145
3145
|
if (dir === root) {
|
|
3146
3146
|
return null;
|
|
3147
3147
|
}
|
|
3148
|
-
dir =
|
|
3148
|
+
dir = path5.dirname(dir);
|
|
3149
3149
|
}
|
|
3150
3150
|
};
|
|
3151
3151
|
}
|
|
@@ -3166,7 +3166,7 @@ var require_package2 = __commonJS({
|
|
|
3166
3166
|
"package.json"(exports2, module2) {
|
|
3167
3167
|
module2.exports = {
|
|
3168
3168
|
name: "@prisma/client",
|
|
3169
|
-
version: "5.20.0-integration-feat-
|
|
3169
|
+
version: "5.20.0-integration-feat-strict-undefined-checks.1",
|
|
3170
3170
|
description: "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.",
|
|
3171
3171
|
keywords: [
|
|
3172
3172
|
"ORM",
|
|
@@ -3365,7 +3365,7 @@ var require_package2 = __commonJS({
|
|
|
3365
3365
|
"@prisma/debug": "workspace:*",
|
|
3366
3366
|
"@prisma/driver-adapter-utils": "workspace:*",
|
|
3367
3367
|
"@prisma/engines": "workspace:*",
|
|
3368
|
-
"@prisma/engines-version": "5.20.0-
|
|
3368
|
+
"@prisma/engines-version": "5.20.0-8.c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7",
|
|
3369
3369
|
"@prisma/fetch-engine": "workspace:*",
|
|
3370
3370
|
"@prisma/generator-helper": "workspace:*",
|
|
3371
3371
|
"@prisma/get-platform": "workspace:*",
|
|
@@ -3374,7 +3374,7 @@ var require_package2 = __commonJS({
|
|
|
3374
3374
|
"@prisma/migrate": "workspace:*",
|
|
3375
3375
|
"@prisma/mini-proxy": "0.9.5",
|
|
3376
3376
|
"@prisma/pg-worker": "workspace:*",
|
|
3377
|
-
"@prisma/query-engine-wasm": "5.20.0-
|
|
3377
|
+
"@prisma/query-engine-wasm": "5.20.0-8.c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7",
|
|
3378
3378
|
"@snaplet/copycat": "0.17.3",
|
|
3379
3379
|
"@swc-node/register": "1.10.9",
|
|
3380
3380
|
"@swc/core": "1.6.13",
|
|
@@ -4664,174 +4664,10 @@ var import_env_paths = __toESM(require_env_paths());
|
|
|
4664
4664
|
var import_fs2 = require("fs");
|
|
4665
4665
|
var import_promises = __toESM(require("fs/promises"));
|
|
4666
4666
|
var import_fs_extra = __toESM(require_lib());
|
|
4667
|
-
var
|
|
4667
|
+
var import_path5 = __toESM(require("path"));
|
|
4668
4668
|
var import_pkg_up = __toESM(require_pkg_up());
|
|
4669
4669
|
var import_package = __toESM(require_package2());
|
|
4670
4670
|
|
|
4671
|
-
// src/generation/binaryTargetFileMap.ts
|
|
4672
|
-
var import_path3 = __toESM(require("path"));
|
|
4673
|
-
|
|
4674
|
-
// src/generation/ts-builders/Writer.ts
|
|
4675
|
-
var INDENT_SIZE = 2;
|
|
4676
|
-
var Writer = class {
|
|
4677
|
-
constructor(startingIndent = 0, context) {
|
|
4678
|
-
this.context = context;
|
|
4679
|
-
this.lines = [];
|
|
4680
|
-
this.currentLine = "";
|
|
4681
|
-
this.currentIndent = 0;
|
|
4682
|
-
this.currentIndent = startingIndent;
|
|
4683
|
-
}
|
|
4684
|
-
/**
|
|
4685
|
-
* Adds provided value to the current line. Does not end the line.
|
|
4686
|
-
*
|
|
4687
|
-
* @param value
|
|
4688
|
-
* @returns
|
|
4689
|
-
*/
|
|
4690
|
-
write(value) {
|
|
4691
|
-
if (typeof value === "string") {
|
|
4692
|
-
this.currentLine += value;
|
|
4693
|
-
} else {
|
|
4694
|
-
value.write(this);
|
|
4695
|
-
}
|
|
4696
|
-
return this;
|
|
4697
|
-
}
|
|
4698
|
-
/**
|
|
4699
|
-
* Adds several `values` to the current line, separated by `separator`. Both values and separator
|
|
4700
|
-
* can also be `Builder` instances for more advanced formatting.
|
|
4701
|
-
*
|
|
4702
|
-
* @param separator
|
|
4703
|
-
* @param values
|
|
4704
|
-
* @param writeItem allow to customize how individual item is written
|
|
4705
|
-
* @returns
|
|
4706
|
-
*/
|
|
4707
|
-
writeJoined(separator, values, writeItem = (item, w) => w.write(item)) {
|
|
4708
|
-
const last = values.length - 1;
|
|
4709
|
-
for (let i = 0; i < values.length; i++) {
|
|
4710
|
-
writeItem(values[i], this);
|
|
4711
|
-
if (i !== last) {
|
|
4712
|
-
this.write(separator);
|
|
4713
|
-
}
|
|
4714
|
-
}
|
|
4715
|
-
return this;
|
|
4716
|
-
}
|
|
4717
|
-
/**
|
|
4718
|
-
* Adds a string to current line, flushes current line and starts a new line.
|
|
4719
|
-
* @param line
|
|
4720
|
-
* @returns
|
|
4721
|
-
*/
|
|
4722
|
-
writeLine(line) {
|
|
4723
|
-
return this.write(line).newLine();
|
|
4724
|
-
}
|
|
4725
|
-
/**
|
|
4726
|
-
* Flushes current line and starts a new line. New line starts at previously configured indentation level
|
|
4727
|
-
* @returns
|
|
4728
|
-
*/
|
|
4729
|
-
newLine() {
|
|
4730
|
-
this.lines.push(this.indentedCurrentLine());
|
|
4731
|
-
this.currentLine = "";
|
|
4732
|
-
this.marginSymbol = void 0;
|
|
4733
|
-
const afterNextNewLineCallback = this.afterNextNewLineCallback;
|
|
4734
|
-
this.afterNextNewLineCallback = void 0;
|
|
4735
|
-
afterNextNewLineCallback?.();
|
|
4736
|
-
return this;
|
|
4737
|
-
}
|
|
4738
|
-
/**
|
|
4739
|
-
* Increases indentation level by 1, calls provided callback and then decreases indentation again.
|
|
4740
|
-
* Could be used for writing indented blocks of text:
|
|
4741
|
-
*
|
|
4742
|
-
* @example
|
|
4743
|
-
* ```ts
|
|
4744
|
-
* writer
|
|
4745
|
-
* .writeLine('{')
|
|
4746
|
-
* .withIndent(() => {
|
|
4747
|
-
* writer.writeLine('foo: 123');
|
|
4748
|
-
* writer.writeLine('bar: 456');
|
|
4749
|
-
* })
|
|
4750
|
-
* .writeLine('}')
|
|
4751
|
-
* ```
|
|
4752
|
-
* @param callback
|
|
4753
|
-
* @returns
|
|
4754
|
-
*/
|
|
4755
|
-
withIndent(callback) {
|
|
4756
|
-
this.indent();
|
|
4757
|
-
callback(this);
|
|
4758
|
-
this.unindent();
|
|
4759
|
-
return this;
|
|
4760
|
-
}
|
|
4761
|
-
/**
|
|
4762
|
-
* Calls provided callback next time when new line is started.
|
|
4763
|
-
* Callback is called after old line have already been flushed and a new
|
|
4764
|
-
* line have been started. Can be used for adding "between the lines" decorations,
|
|
4765
|
-
* such as underlines.
|
|
4766
|
-
*
|
|
4767
|
-
* @param callback
|
|
4768
|
-
* @returns
|
|
4769
|
-
*/
|
|
4770
|
-
afterNextNewline(callback) {
|
|
4771
|
-
this.afterNextNewLineCallback = callback;
|
|
4772
|
-
return this;
|
|
4773
|
-
}
|
|
4774
|
-
/**
|
|
4775
|
-
* Increases indentation level of the current line by 1
|
|
4776
|
-
* @returns
|
|
4777
|
-
*/
|
|
4778
|
-
indent() {
|
|
4779
|
-
this.currentIndent++;
|
|
4780
|
-
return this;
|
|
4781
|
-
}
|
|
4782
|
-
/**
|
|
4783
|
-
* Decreases indentation level of the current line by 1, if it is possible
|
|
4784
|
-
* @returns
|
|
4785
|
-
*/
|
|
4786
|
-
unindent() {
|
|
4787
|
-
if (this.currentIndent > 0) {
|
|
4788
|
-
this.currentIndent--;
|
|
4789
|
-
}
|
|
4790
|
-
return this;
|
|
4791
|
-
}
|
|
4792
|
-
/**
|
|
4793
|
-
* Adds a symbol, that will replace the first character of the current line (including indentation)
|
|
4794
|
-
* when it is flushed. Can be used for adding markers to the line.
|
|
4795
|
-
*
|
|
4796
|
-
* Note: if indentation level of the line is 0, it will replace the first actually printed character
|
|
4797
|
-
* of the line. Use with caution.
|
|
4798
|
-
* @param symbol
|
|
4799
|
-
* @returns
|
|
4800
|
-
*/
|
|
4801
|
-
addMarginSymbol(symbol) {
|
|
4802
|
-
this.marginSymbol = symbol;
|
|
4803
|
-
return this;
|
|
4804
|
-
}
|
|
4805
|
-
toString() {
|
|
4806
|
-
return this.lines.concat(this.indentedCurrentLine()).join("\n");
|
|
4807
|
-
}
|
|
4808
|
-
getCurrentLineLength() {
|
|
4809
|
-
return this.currentLine.length;
|
|
4810
|
-
}
|
|
4811
|
-
indentedCurrentLine() {
|
|
4812
|
-
const line = this.currentLine.padStart(this.currentLine.length + INDENT_SIZE * this.currentIndent);
|
|
4813
|
-
if (this.marginSymbol) {
|
|
4814
|
-
return this.marginSymbol + line.slice(1);
|
|
4815
|
-
}
|
|
4816
|
-
return line;
|
|
4817
|
-
}
|
|
4818
|
-
};
|
|
4819
|
-
|
|
4820
|
-
// src/generation/binaryTargetFileMap.ts
|
|
4821
|
-
function buildBinaryTargetFileMap(paths2) {
|
|
4822
|
-
const writer = new Writer(0, void 0);
|
|
4823
|
-
writer.writeLine("export default (import.meta.url ? {");
|
|
4824
|
-
writer.withIndent(() => {
|
|
4825
|
-
for (const [binaryTarget, filePath] of Object.entries(paths2)) {
|
|
4826
|
-
const key = JSON.stringify(binaryTarget);
|
|
4827
|
-
const relName = JSON.stringify(`./${import_path3.default.basename(filePath)}`);
|
|
4828
|
-
writer.writeLine(`[${key}]: () => new URL(${relName}, import.meta.url).pathname,`);
|
|
4829
|
-
}
|
|
4830
|
-
});
|
|
4831
|
-
writer.writeLine("} : {})");
|
|
4832
|
-
return writer.toString();
|
|
4833
|
-
}
|
|
4834
|
-
|
|
4835
4671
|
// src/generation/getDMMF.ts
|
|
4836
4672
|
function getPrismaClientDMMF(dmmf) {
|
|
4837
4673
|
return externalToInternalDmmf(dmmf);
|
|
@@ -5641,73 +5477,219 @@ function property(name, type) {
|
|
|
5641
5477
|
return new Property(name, type);
|
|
5642
5478
|
}
|
|
5643
5479
|
|
|
5644
|
-
// src/generation/ts-builders/
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
return str + "\n";
|
|
5654
|
-
case "both":
|
|
5655
|
-
return "\n" + str + "\n";
|
|
5656
|
-
default:
|
|
5657
|
-
assertNever(newLine, "Unexpected value");
|
|
5658
|
-
}
|
|
5659
|
-
}
|
|
5660
|
-
|
|
5661
|
-
// src/generation/ts-builders/StringLiteralType.ts
|
|
5662
|
-
init_TypeBuilder();
|
|
5663
|
-
var StringLiteralType = class extends TypeBuilder {
|
|
5664
|
-
constructor(content) {
|
|
5665
|
-
super();
|
|
5666
|
-
this.content = content;
|
|
5667
|
-
}
|
|
5668
|
-
write(writer) {
|
|
5669
|
-
writer.write(JSON.stringify(this.content));
|
|
5670
|
-
}
|
|
5671
|
-
};
|
|
5672
|
-
function stringLiteral(content) {
|
|
5673
|
-
return new StringLiteralType(content);
|
|
5674
|
-
}
|
|
5675
|
-
|
|
5676
|
-
// src/generation/ts-builders/TupleType.ts
|
|
5677
|
-
init_TypeBuilder();
|
|
5678
|
-
var TupleItem = class {
|
|
5679
|
-
constructor(type) {
|
|
5680
|
-
this.type = type;
|
|
5681
|
-
}
|
|
5682
|
-
setName(name) {
|
|
5683
|
-
this.name = name;
|
|
5684
|
-
return this;
|
|
5480
|
+
// src/generation/ts-builders/Writer.ts
|
|
5481
|
+
var INDENT_SIZE = 2;
|
|
5482
|
+
var Writer = class {
|
|
5483
|
+
constructor(startingIndent = 0, context) {
|
|
5484
|
+
this.context = context;
|
|
5485
|
+
this.lines = [];
|
|
5486
|
+
this.currentLine = "";
|
|
5487
|
+
this.currentIndent = 0;
|
|
5488
|
+
this.currentIndent = startingIndent;
|
|
5685
5489
|
}
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5490
|
+
/**
|
|
5491
|
+
* Adds provided value to the current line. Does not end the line.
|
|
5492
|
+
*
|
|
5493
|
+
* @param value
|
|
5494
|
+
* @returns
|
|
5495
|
+
*/
|
|
5496
|
+
write(value) {
|
|
5497
|
+
if (typeof value === "string") {
|
|
5498
|
+
this.currentLine += value;
|
|
5499
|
+
} else {
|
|
5500
|
+
value.write(this);
|
|
5689
5501
|
}
|
|
5690
|
-
|
|
5691
|
-
}
|
|
5692
|
-
};
|
|
5693
|
-
var TupleType = class extends TypeBuilder {
|
|
5694
|
-
constructor() {
|
|
5695
|
-
super(...arguments);
|
|
5696
|
-
this.items = [];
|
|
5502
|
+
return this;
|
|
5697
5503
|
}
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5504
|
+
/**
|
|
5505
|
+
* Adds several `values` to the current line, separated by `separator`. Both values and separator
|
|
5506
|
+
* can also be `Builder` instances for more advanced formatting.
|
|
5507
|
+
*
|
|
5508
|
+
* @param separator
|
|
5509
|
+
* @param values
|
|
5510
|
+
* @param writeItem allow to customize how individual item is written
|
|
5511
|
+
* @returns
|
|
5512
|
+
*/
|
|
5513
|
+
writeJoined(separator, values, writeItem = (item, w) => w.write(item)) {
|
|
5514
|
+
const last = values.length - 1;
|
|
5515
|
+
for (let i = 0; i < values.length; i++) {
|
|
5516
|
+
writeItem(values[i], this);
|
|
5517
|
+
if (i !== last) {
|
|
5518
|
+
this.write(separator);
|
|
5519
|
+
}
|
|
5701
5520
|
}
|
|
5702
|
-
this.items.push(item);
|
|
5703
5521
|
return this;
|
|
5704
5522
|
}
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5523
|
+
/**
|
|
5524
|
+
* Adds a string to current line, flushes current line and starts a new line.
|
|
5525
|
+
* @param line
|
|
5526
|
+
* @returns
|
|
5527
|
+
*/
|
|
5528
|
+
writeLine(line) {
|
|
5529
|
+
return this.write(line).newLine();
|
|
5530
|
+
}
|
|
5531
|
+
/**
|
|
5532
|
+
* Flushes current line and starts a new line. New line starts at previously configured indentation level
|
|
5533
|
+
* @returns
|
|
5534
|
+
*/
|
|
5535
|
+
newLine() {
|
|
5536
|
+
this.lines.push(this.indentedCurrentLine());
|
|
5537
|
+
this.currentLine = "";
|
|
5538
|
+
this.marginSymbol = void 0;
|
|
5539
|
+
const afterNextNewLineCallback = this.afterNextNewLineCallback;
|
|
5540
|
+
this.afterNextNewLineCallback = void 0;
|
|
5541
|
+
afterNextNewLineCallback?.();
|
|
5542
|
+
return this;
|
|
5543
|
+
}
|
|
5544
|
+
/**
|
|
5545
|
+
* Increases indentation level by 1, calls provided callback and then decreases indentation again.
|
|
5546
|
+
* Could be used for writing indented blocks of text:
|
|
5547
|
+
*
|
|
5548
|
+
* @example
|
|
5549
|
+
* ```ts
|
|
5550
|
+
* writer
|
|
5551
|
+
* .writeLine('{')
|
|
5552
|
+
* .withIndent(() => {
|
|
5553
|
+
* writer.writeLine('foo: 123');
|
|
5554
|
+
* writer.writeLine('bar: 456');
|
|
5555
|
+
* })
|
|
5556
|
+
* .writeLine('}')
|
|
5557
|
+
* ```
|
|
5558
|
+
* @param callback
|
|
5559
|
+
* @returns
|
|
5560
|
+
*/
|
|
5561
|
+
withIndent(callback) {
|
|
5562
|
+
this.indent();
|
|
5563
|
+
callback(this);
|
|
5564
|
+
this.unindent();
|
|
5565
|
+
return this;
|
|
5566
|
+
}
|
|
5567
|
+
/**
|
|
5568
|
+
* Calls provided callback next time when new line is started.
|
|
5569
|
+
* Callback is called after old line have already been flushed and a new
|
|
5570
|
+
* line have been started. Can be used for adding "between the lines" decorations,
|
|
5571
|
+
* such as underlines.
|
|
5572
|
+
*
|
|
5573
|
+
* @param callback
|
|
5574
|
+
* @returns
|
|
5575
|
+
*/
|
|
5576
|
+
afterNextNewline(callback) {
|
|
5577
|
+
this.afterNextNewLineCallback = callback;
|
|
5578
|
+
return this;
|
|
5579
|
+
}
|
|
5580
|
+
/**
|
|
5581
|
+
* Increases indentation level of the current line by 1
|
|
5582
|
+
* @returns
|
|
5583
|
+
*/
|
|
5584
|
+
indent() {
|
|
5585
|
+
this.currentIndent++;
|
|
5586
|
+
return this;
|
|
5587
|
+
}
|
|
5588
|
+
/**
|
|
5589
|
+
* Decreases indentation level of the current line by 1, if it is possible
|
|
5590
|
+
* @returns
|
|
5591
|
+
*/
|
|
5592
|
+
unindent() {
|
|
5593
|
+
if (this.currentIndent > 0) {
|
|
5594
|
+
this.currentIndent--;
|
|
5595
|
+
}
|
|
5596
|
+
return this;
|
|
5597
|
+
}
|
|
5598
|
+
/**
|
|
5599
|
+
* Adds a symbol, that will replace the first character of the current line (including indentation)
|
|
5600
|
+
* when it is flushed. Can be used for adding markers to the line.
|
|
5601
|
+
*
|
|
5602
|
+
* Note: if indentation level of the line is 0, it will replace the first actually printed character
|
|
5603
|
+
* of the line. Use with caution.
|
|
5604
|
+
* @param symbol
|
|
5605
|
+
* @returns
|
|
5606
|
+
*/
|
|
5607
|
+
addMarginSymbol(symbol) {
|
|
5608
|
+
this.marginSymbol = symbol;
|
|
5609
|
+
return this;
|
|
5610
|
+
}
|
|
5611
|
+
toString() {
|
|
5612
|
+
return this.lines.concat(this.indentedCurrentLine()).join("\n");
|
|
5613
|
+
}
|
|
5614
|
+
getCurrentLineLength() {
|
|
5615
|
+
return this.currentLine.length;
|
|
5616
|
+
}
|
|
5617
|
+
indentedCurrentLine() {
|
|
5618
|
+
const line = this.currentLine.padStart(this.currentLine.length + INDENT_SIZE * this.currentIndent);
|
|
5619
|
+
if (this.marginSymbol) {
|
|
5620
|
+
return this.marginSymbol + line.slice(1);
|
|
5621
|
+
}
|
|
5622
|
+
return line;
|
|
5623
|
+
}
|
|
5624
|
+
};
|
|
5625
|
+
|
|
5626
|
+
// src/generation/ts-builders/stringify.ts
|
|
5627
|
+
function stringify(builder, { indentLevel = 0, newLine = "none" } = {}) {
|
|
5628
|
+
const str = new Writer(indentLevel, void 0).write(builder).toString();
|
|
5629
|
+
switch (newLine) {
|
|
5630
|
+
case "none":
|
|
5631
|
+
return str;
|
|
5632
|
+
case "leading":
|
|
5633
|
+
return "\n" + str;
|
|
5634
|
+
case "trailing":
|
|
5635
|
+
return str + "\n";
|
|
5636
|
+
case "both":
|
|
5637
|
+
return "\n" + str + "\n";
|
|
5638
|
+
default:
|
|
5639
|
+
assertNever(newLine, "Unexpected value");
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
|
|
5643
|
+
// src/generation/ts-builders/StringLiteralType.ts
|
|
5644
|
+
init_TypeBuilder();
|
|
5645
|
+
var StringLiteralType = class extends TypeBuilder {
|
|
5646
|
+
constructor(content) {
|
|
5647
|
+
super();
|
|
5648
|
+
this.content = content;
|
|
5649
|
+
}
|
|
5650
|
+
write(writer) {
|
|
5651
|
+
writer.write(JSON.stringify(this.content));
|
|
5652
|
+
}
|
|
5653
|
+
};
|
|
5654
|
+
function stringLiteral(content) {
|
|
5655
|
+
return new StringLiteralType(content);
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
// src/generation/ts-builders/TupleType.ts
|
|
5659
|
+
init_TypeBuilder();
|
|
5660
|
+
var TupleItem = class {
|
|
5661
|
+
constructor(type) {
|
|
5662
|
+
this.type = type;
|
|
5663
|
+
}
|
|
5664
|
+
setName(name) {
|
|
5665
|
+
this.name = name;
|
|
5666
|
+
return this;
|
|
5667
|
+
}
|
|
5668
|
+
write(writer) {
|
|
5669
|
+
if (this.name) {
|
|
5670
|
+
writer.write(this.name).write(": ");
|
|
5671
|
+
}
|
|
5672
|
+
writer.write(this.type);
|
|
5673
|
+
}
|
|
5674
|
+
};
|
|
5675
|
+
var TupleType = class extends TypeBuilder {
|
|
5676
|
+
constructor() {
|
|
5677
|
+
super(...arguments);
|
|
5678
|
+
this.items = [];
|
|
5679
|
+
}
|
|
5680
|
+
add(item) {
|
|
5681
|
+
if (item instanceof TypeBuilder) {
|
|
5682
|
+
item = new TupleItem(item);
|
|
5683
|
+
}
|
|
5684
|
+
this.items.push(item);
|
|
5685
|
+
return this;
|
|
5686
|
+
}
|
|
5687
|
+
write(writer) {
|
|
5688
|
+
writer.write("[").writeJoined(", ", this.items).write("]");
|
|
5689
|
+
}
|
|
5690
|
+
};
|
|
5691
|
+
function tupleType() {
|
|
5692
|
+
return new TupleType();
|
|
5711
5693
|
}
|
|
5712
5694
|
function tupleItem(type) {
|
|
5713
5695
|
return new TupleItem(type);
|
|
@@ -5807,21 +5789,163 @@ function wellKnownSymbol(name) {
|
|
|
5807
5789
|
}
|
|
5808
5790
|
var toStringTag = wellKnownSymbol("toStringTag");
|
|
5809
5791
|
|
|
5792
|
+
// src/generation/utils.ts
|
|
5793
|
+
function getSelectName(modelName) {
|
|
5794
|
+
return `${modelName}Select`;
|
|
5795
|
+
}
|
|
5796
|
+
function getSelectCreateManyAndReturnName(modelName) {
|
|
5797
|
+
return `${modelName}SelectCreateManyAndReturn`;
|
|
5798
|
+
}
|
|
5799
|
+
function getIncludeName(modelName) {
|
|
5800
|
+
return `${modelName}Include`;
|
|
5801
|
+
}
|
|
5802
|
+
function getIncludeCreateManyAndReturnName(modelName) {
|
|
5803
|
+
return `${modelName}IncludeCreateManyAndReturn`;
|
|
5804
|
+
}
|
|
5805
|
+
function getCreateManyAndReturnOutputType(modelName) {
|
|
5806
|
+
return `CreateMany${modelName}AndReturnOutputType`;
|
|
5807
|
+
}
|
|
5808
|
+
function getOmitName(modelName) {
|
|
5809
|
+
return `${modelName}Omit`;
|
|
5810
|
+
}
|
|
5811
|
+
function getAggregateName(modelName) {
|
|
5812
|
+
return `Aggregate${capitalize2(modelName)}`;
|
|
5813
|
+
}
|
|
5814
|
+
function getGroupByName(modelName) {
|
|
5815
|
+
return `${capitalize2(modelName)}GroupByOutputType`;
|
|
5816
|
+
}
|
|
5817
|
+
function getAvgAggregateName(modelName) {
|
|
5818
|
+
return `${capitalize2(modelName)}AvgAggregateOutputType`;
|
|
5819
|
+
}
|
|
5820
|
+
function getSumAggregateName(modelName) {
|
|
5821
|
+
return `${capitalize2(modelName)}SumAggregateOutputType`;
|
|
5822
|
+
}
|
|
5823
|
+
function getMinAggregateName(modelName) {
|
|
5824
|
+
return `${capitalize2(modelName)}MinAggregateOutputType`;
|
|
5825
|
+
}
|
|
5826
|
+
function getMaxAggregateName(modelName) {
|
|
5827
|
+
return `${capitalize2(modelName)}MaxAggregateOutputType`;
|
|
5828
|
+
}
|
|
5829
|
+
function getCountAggregateInputName(modelName) {
|
|
5830
|
+
return `${capitalize2(modelName)}CountAggregateInputType`;
|
|
5831
|
+
}
|
|
5832
|
+
function getCountAggregateOutputName(modelName) {
|
|
5833
|
+
return `${capitalize2(modelName)}CountAggregateOutputType`;
|
|
5834
|
+
}
|
|
5835
|
+
function getAggregateInputType(aggregateOutputType) {
|
|
5836
|
+
return aggregateOutputType.replace(/OutputType$/, "InputType");
|
|
5837
|
+
}
|
|
5838
|
+
function getGroupByArgsName(modelName) {
|
|
5839
|
+
return `${modelName}GroupByArgs`;
|
|
5840
|
+
}
|
|
5841
|
+
function getGroupByPayloadName(modelName) {
|
|
5842
|
+
return `Get${capitalize2(modelName)}GroupByPayload`;
|
|
5843
|
+
}
|
|
5844
|
+
function getAggregateArgsName(modelName) {
|
|
5845
|
+
return `${capitalize2(modelName)}AggregateArgs`;
|
|
5846
|
+
}
|
|
5847
|
+
function getAggregateGetName(modelName) {
|
|
5848
|
+
return `Get${capitalize2(modelName)}AggregateType`;
|
|
5849
|
+
}
|
|
5850
|
+
function getFieldArgName(field, modelName) {
|
|
5851
|
+
if (field.args.length) {
|
|
5852
|
+
return getModelFieldArgsName(field, modelName);
|
|
5853
|
+
}
|
|
5854
|
+
return getModelArgName(field.outputType.type);
|
|
5855
|
+
}
|
|
5856
|
+
function getModelFieldArgsName(field, modelName) {
|
|
5857
|
+
return `${modelName}$${field.name}Args`;
|
|
5858
|
+
}
|
|
5859
|
+
function getLegacyModelArgName(modelName) {
|
|
5860
|
+
return `${modelName}Args`;
|
|
5861
|
+
}
|
|
5862
|
+
function getModelArgName(modelName, action) {
|
|
5863
|
+
if (!action) {
|
|
5864
|
+
return `${modelName}DefaultArgs`;
|
|
5865
|
+
}
|
|
5866
|
+
switch (action) {
|
|
5867
|
+
case DMMF.ModelAction.findMany:
|
|
5868
|
+
return `${modelName}FindManyArgs`;
|
|
5869
|
+
case DMMF.ModelAction.findUnique:
|
|
5870
|
+
return `${modelName}FindUniqueArgs`;
|
|
5871
|
+
case DMMF.ModelAction.findUniqueOrThrow:
|
|
5872
|
+
return `${modelName}FindUniqueOrThrowArgs`;
|
|
5873
|
+
case DMMF.ModelAction.findFirst:
|
|
5874
|
+
return `${modelName}FindFirstArgs`;
|
|
5875
|
+
case DMMF.ModelAction.findFirstOrThrow:
|
|
5876
|
+
return `${modelName}FindFirstOrThrowArgs`;
|
|
5877
|
+
case DMMF.ModelAction.upsert:
|
|
5878
|
+
return `${modelName}UpsertArgs`;
|
|
5879
|
+
case DMMF.ModelAction.update:
|
|
5880
|
+
return `${modelName}UpdateArgs`;
|
|
5881
|
+
case DMMF.ModelAction.updateMany:
|
|
5882
|
+
return `${modelName}UpdateManyArgs`;
|
|
5883
|
+
case DMMF.ModelAction.delete:
|
|
5884
|
+
return `${modelName}DeleteArgs`;
|
|
5885
|
+
case DMMF.ModelAction.create:
|
|
5886
|
+
return `${modelName}CreateArgs`;
|
|
5887
|
+
case DMMF.ModelAction.createMany:
|
|
5888
|
+
return `${modelName}CreateManyArgs`;
|
|
5889
|
+
case DMMF.ModelAction.createManyAndReturn:
|
|
5890
|
+
return `${modelName}CreateManyAndReturnArgs`;
|
|
5891
|
+
case DMMF.ModelAction.deleteMany:
|
|
5892
|
+
return `${modelName}DeleteManyArgs`;
|
|
5893
|
+
case DMMF.ModelAction.groupBy:
|
|
5894
|
+
return getGroupByArgsName(modelName);
|
|
5895
|
+
case DMMF.ModelAction.aggregate:
|
|
5896
|
+
return getAggregateArgsName(modelName);
|
|
5897
|
+
case DMMF.ModelAction.count:
|
|
5898
|
+
return `${modelName}CountArgs`;
|
|
5899
|
+
case DMMF.ModelAction.findRaw:
|
|
5900
|
+
return `${modelName}FindRawArgs`;
|
|
5901
|
+
case DMMF.ModelAction.aggregateRaw:
|
|
5902
|
+
return `${modelName}AggregateRawArgs`;
|
|
5903
|
+
default:
|
|
5904
|
+
assertNever(action, `Unknown action: ${action}`);
|
|
5905
|
+
}
|
|
5906
|
+
}
|
|
5907
|
+
function getPayloadName(modelName, namespace2 = true) {
|
|
5908
|
+
if (namespace2) {
|
|
5909
|
+
return `Prisma.${getPayloadName(modelName, false)}`;
|
|
5910
|
+
}
|
|
5911
|
+
return `$${modelName}Payload`;
|
|
5912
|
+
}
|
|
5913
|
+
function getFieldRefsTypeName(name) {
|
|
5914
|
+
return `${name}FieldRefs`;
|
|
5915
|
+
}
|
|
5916
|
+
function capitalize2(str) {
|
|
5917
|
+
return str[0].toUpperCase() + str.slice(1);
|
|
5918
|
+
}
|
|
5919
|
+
function getRefAllowedTypeName(type) {
|
|
5920
|
+
let typeName = type.type;
|
|
5921
|
+
if (type.isList) {
|
|
5922
|
+
typeName += "[]";
|
|
5923
|
+
}
|
|
5924
|
+
return `'${typeName}'`;
|
|
5925
|
+
}
|
|
5926
|
+
function appendSkipType(context, type) {
|
|
5927
|
+
if (context.isPreviewFeatureOn("strictUndefinedChecks")) {
|
|
5928
|
+
return unionType([type, namedType("$Types.Skip")]);
|
|
5929
|
+
}
|
|
5930
|
+
return type;
|
|
5931
|
+
}
|
|
5932
|
+
var extArgsParam = genericParameter("ExtArgs").extends(namedType("$Extensions.InternalArgs")).default(namedType("$Extensions.DefaultArgs"));
|
|
5933
|
+
|
|
5810
5934
|
// src/generation/TSClient/Input.ts
|
|
5811
5935
|
var InputField = class {
|
|
5812
|
-
constructor(field,
|
|
5936
|
+
constructor(field, context, source) {
|
|
5813
5937
|
this.field = field;
|
|
5814
|
-
this.
|
|
5938
|
+
this.context = context;
|
|
5815
5939
|
this.source = source;
|
|
5816
5940
|
}
|
|
5817
5941
|
toTS() {
|
|
5818
|
-
const property2 = buildInputField(this.field, this.
|
|
5942
|
+
const property2 = buildInputField(this.field, this.context, this.source);
|
|
5819
5943
|
return stringify(property2);
|
|
5820
5944
|
}
|
|
5821
5945
|
};
|
|
5822
|
-
function buildInputField(field,
|
|
5823
|
-
const tsType = buildAllFieldTypes(field.inputTypes,
|
|
5824
|
-
const tsProperty = property(field.name, tsType);
|
|
5946
|
+
function buildInputField(field, context, source) {
|
|
5947
|
+
const tsType = buildAllFieldTypes(field.inputTypes, context, source);
|
|
5948
|
+
const tsProperty = property(field.name, field.isRequired ? tsType : appendSkipType(context, tsType));
|
|
5825
5949
|
if (!field.isRequired) {
|
|
5826
5950
|
tsProperty.optional();
|
|
5827
5951
|
}
|
|
@@ -5868,11 +5992,11 @@ function buildSingleFieldType(t, genericsInfo, source) {
|
|
|
5868
5992
|
function namedInputType(typeName) {
|
|
5869
5993
|
return namedType(JSOutputTypeToInputType[typeName] ?? typeName);
|
|
5870
5994
|
}
|
|
5871
|
-
function buildAllFieldTypes(inputTypes,
|
|
5995
|
+
function buildAllFieldTypes(inputTypes, context, source) {
|
|
5872
5996
|
const inputObjectTypes = inputTypes.filter((t) => t.location === "inputObjectTypes" && !t.isList);
|
|
5873
5997
|
const otherTypes = inputTypes.filter((t) => t.location !== "inputObjectTypes" || t.isList);
|
|
5874
|
-
const tsInputObjectTypes = inputObjectTypes.map((type) => buildSingleFieldType(type,
|
|
5875
|
-
const tsOtherTypes = otherTypes.map((type) => buildSingleFieldType(type,
|
|
5998
|
+
const tsInputObjectTypes = inputObjectTypes.map((type) => buildSingleFieldType(type, context.genericArgsInfo, source));
|
|
5999
|
+
const tsOtherTypes = otherTypes.map((type) => buildSingleFieldType(type, context.genericArgsInfo, source));
|
|
5876
6000
|
if (tsOtherTypes.length === 0) {
|
|
5877
6001
|
return xorTypes(tsInputObjectTypes);
|
|
5878
6002
|
}
|
|
@@ -5885,9 +6009,9 @@ function xorTypes(types) {
|
|
|
5885
6009
|
return types.reduce((prev, curr) => namedType("XOR").addGenericArgument(prev).addGenericArgument(curr));
|
|
5886
6010
|
}
|
|
5887
6011
|
var InputType = class {
|
|
5888
|
-
constructor(type,
|
|
6012
|
+
constructor(type, context) {
|
|
5889
6013
|
this.type = type;
|
|
5890
|
-
this.
|
|
6014
|
+
this.context = context;
|
|
5891
6015
|
this.generatedName = type.name;
|
|
5892
6016
|
}
|
|
5893
6017
|
toTS() {
|
|
@@ -5897,7 +6021,7 @@ var InputType = class {
|
|
|
5897
6021
|
const body = `{
|
|
5898
6022
|
${(0, import_indent_string2.default)(
|
|
5899
6023
|
fields.map((arg) => {
|
|
5900
|
-
return new InputField(arg, this.
|
|
6024
|
+
return new InputField(arg, this.context, source).toTS();
|
|
5901
6025
|
}).join("\n"),
|
|
5902
6026
|
TAB_SIZE
|
|
5903
6027
|
)}
|
|
@@ -5910,7 +6034,7 @@ export type ${this.getTypeName()} = ${wrapWithAtLeast(body, type)}`;
|
|
|
5910
6034
|
return this;
|
|
5911
6035
|
}
|
|
5912
6036
|
getTypeName() {
|
|
5913
|
-
if (this.
|
|
6037
|
+
if (this.context.genericArgsInfo.typeNeedsGenericModelArg(this.type)) {
|
|
5914
6038
|
return `${this.generatedName}<$PrismaModel = never>`;
|
|
5915
6039
|
}
|
|
5916
6040
|
return this.generatedName;
|
|
@@ -5997,142 +6121,6 @@ function klona(x) {
|
|
|
5997
6121
|
return x;
|
|
5998
6122
|
}
|
|
5999
6123
|
|
|
6000
|
-
// src/generation/utils.ts
|
|
6001
|
-
function getSelectName(modelName) {
|
|
6002
|
-
return `${modelName}Select`;
|
|
6003
|
-
}
|
|
6004
|
-
function getSelectCreateManyAndReturnName(modelName) {
|
|
6005
|
-
return `${modelName}SelectCreateManyAndReturn`;
|
|
6006
|
-
}
|
|
6007
|
-
function getIncludeName(modelName) {
|
|
6008
|
-
return `${modelName}Include`;
|
|
6009
|
-
}
|
|
6010
|
-
function getIncludeCreateManyAndReturnName(modelName) {
|
|
6011
|
-
return `${modelName}IncludeCreateManyAndReturn`;
|
|
6012
|
-
}
|
|
6013
|
-
function getCreateManyAndReturnOutputType(modelName) {
|
|
6014
|
-
return `CreateMany${modelName}AndReturnOutputType`;
|
|
6015
|
-
}
|
|
6016
|
-
function getOmitName(modelName) {
|
|
6017
|
-
return `${modelName}Omit`;
|
|
6018
|
-
}
|
|
6019
|
-
function getAggregateName(modelName) {
|
|
6020
|
-
return `Aggregate${capitalize2(modelName)}`;
|
|
6021
|
-
}
|
|
6022
|
-
function getGroupByName(modelName) {
|
|
6023
|
-
return `${capitalize2(modelName)}GroupByOutputType`;
|
|
6024
|
-
}
|
|
6025
|
-
function getAvgAggregateName(modelName) {
|
|
6026
|
-
return `${capitalize2(modelName)}AvgAggregateOutputType`;
|
|
6027
|
-
}
|
|
6028
|
-
function getSumAggregateName(modelName) {
|
|
6029
|
-
return `${capitalize2(modelName)}SumAggregateOutputType`;
|
|
6030
|
-
}
|
|
6031
|
-
function getMinAggregateName(modelName) {
|
|
6032
|
-
return `${capitalize2(modelName)}MinAggregateOutputType`;
|
|
6033
|
-
}
|
|
6034
|
-
function getMaxAggregateName(modelName) {
|
|
6035
|
-
return `${capitalize2(modelName)}MaxAggregateOutputType`;
|
|
6036
|
-
}
|
|
6037
|
-
function getCountAggregateInputName(modelName) {
|
|
6038
|
-
return `${capitalize2(modelName)}CountAggregateInputType`;
|
|
6039
|
-
}
|
|
6040
|
-
function getCountAggregateOutputName(modelName) {
|
|
6041
|
-
return `${capitalize2(modelName)}CountAggregateOutputType`;
|
|
6042
|
-
}
|
|
6043
|
-
function getAggregateInputType(aggregateOutputType) {
|
|
6044
|
-
return aggregateOutputType.replace(/OutputType$/, "InputType");
|
|
6045
|
-
}
|
|
6046
|
-
function getGroupByArgsName(modelName) {
|
|
6047
|
-
return `${modelName}GroupByArgs`;
|
|
6048
|
-
}
|
|
6049
|
-
function getGroupByPayloadName(modelName) {
|
|
6050
|
-
return `Get${capitalize2(modelName)}GroupByPayload`;
|
|
6051
|
-
}
|
|
6052
|
-
function getAggregateArgsName(modelName) {
|
|
6053
|
-
return `${capitalize2(modelName)}AggregateArgs`;
|
|
6054
|
-
}
|
|
6055
|
-
function getAggregateGetName(modelName) {
|
|
6056
|
-
return `Get${capitalize2(modelName)}AggregateType`;
|
|
6057
|
-
}
|
|
6058
|
-
function getFieldArgName(field, modelName) {
|
|
6059
|
-
if (field.args.length) {
|
|
6060
|
-
return getModelFieldArgsName(field, modelName);
|
|
6061
|
-
}
|
|
6062
|
-
return getModelArgName(field.outputType.type);
|
|
6063
|
-
}
|
|
6064
|
-
function getModelFieldArgsName(field, modelName) {
|
|
6065
|
-
return `${modelName}$${field.name}Args`;
|
|
6066
|
-
}
|
|
6067
|
-
function getLegacyModelArgName(modelName) {
|
|
6068
|
-
return `${modelName}Args`;
|
|
6069
|
-
}
|
|
6070
|
-
function getModelArgName(modelName, action) {
|
|
6071
|
-
if (!action) {
|
|
6072
|
-
return `${modelName}DefaultArgs`;
|
|
6073
|
-
}
|
|
6074
|
-
switch (action) {
|
|
6075
|
-
case DMMF.ModelAction.findMany:
|
|
6076
|
-
return `${modelName}FindManyArgs`;
|
|
6077
|
-
case DMMF.ModelAction.findUnique:
|
|
6078
|
-
return `${modelName}FindUniqueArgs`;
|
|
6079
|
-
case DMMF.ModelAction.findUniqueOrThrow:
|
|
6080
|
-
return `${modelName}FindUniqueOrThrowArgs`;
|
|
6081
|
-
case DMMF.ModelAction.findFirst:
|
|
6082
|
-
return `${modelName}FindFirstArgs`;
|
|
6083
|
-
case DMMF.ModelAction.findFirstOrThrow:
|
|
6084
|
-
return `${modelName}FindFirstOrThrowArgs`;
|
|
6085
|
-
case DMMF.ModelAction.upsert:
|
|
6086
|
-
return `${modelName}UpsertArgs`;
|
|
6087
|
-
case DMMF.ModelAction.update:
|
|
6088
|
-
return `${modelName}UpdateArgs`;
|
|
6089
|
-
case DMMF.ModelAction.updateMany:
|
|
6090
|
-
return `${modelName}UpdateManyArgs`;
|
|
6091
|
-
case DMMF.ModelAction.delete:
|
|
6092
|
-
return `${modelName}DeleteArgs`;
|
|
6093
|
-
case DMMF.ModelAction.create:
|
|
6094
|
-
return `${modelName}CreateArgs`;
|
|
6095
|
-
case DMMF.ModelAction.createMany:
|
|
6096
|
-
return `${modelName}CreateManyArgs`;
|
|
6097
|
-
case DMMF.ModelAction.createManyAndReturn:
|
|
6098
|
-
return `${modelName}CreateManyAndReturnArgs`;
|
|
6099
|
-
case DMMF.ModelAction.deleteMany:
|
|
6100
|
-
return `${modelName}DeleteManyArgs`;
|
|
6101
|
-
case DMMF.ModelAction.groupBy:
|
|
6102
|
-
return getGroupByArgsName(modelName);
|
|
6103
|
-
case DMMF.ModelAction.aggregate:
|
|
6104
|
-
return getAggregateArgsName(modelName);
|
|
6105
|
-
case DMMF.ModelAction.count:
|
|
6106
|
-
return `${modelName}CountArgs`;
|
|
6107
|
-
case DMMF.ModelAction.findRaw:
|
|
6108
|
-
return `${modelName}FindRawArgs`;
|
|
6109
|
-
case DMMF.ModelAction.aggregateRaw:
|
|
6110
|
-
return `${modelName}AggregateRawArgs`;
|
|
6111
|
-
default:
|
|
6112
|
-
assertNever(action, `Unknown action: ${action}`);
|
|
6113
|
-
}
|
|
6114
|
-
}
|
|
6115
|
-
function getPayloadName(modelName, namespace2 = true) {
|
|
6116
|
-
if (namespace2) {
|
|
6117
|
-
return `Prisma.${getPayloadName(modelName, false)}`;
|
|
6118
|
-
}
|
|
6119
|
-
return `$${modelName}Payload`;
|
|
6120
|
-
}
|
|
6121
|
-
function getFieldRefsTypeName(name) {
|
|
6122
|
-
return `${name}FieldRefs`;
|
|
6123
|
-
}
|
|
6124
|
-
function capitalize2(str) {
|
|
6125
|
-
return str[0].toUpperCase() + str.slice(1);
|
|
6126
|
-
}
|
|
6127
|
-
function getRefAllowedTypeName(type) {
|
|
6128
|
-
let typeName = type.type;
|
|
6129
|
-
if (type.isList) {
|
|
6130
|
-
typeName += "[]";
|
|
6131
|
-
}
|
|
6132
|
-
return `'${typeName}'`;
|
|
6133
|
-
}
|
|
6134
|
-
var extArgsParam = genericParameter("ExtArgs").extends(namedType("$Extensions.InternalArgs")).default(namedType("$Extensions.DefaultArgs"));
|
|
6135
|
-
|
|
6136
6124
|
// src/generation/TSClient/helpers.ts
|
|
6137
6125
|
var import_pluralize2 = __toESM(require_pluralize());
|
|
6138
6126
|
|
|
@@ -6570,7 +6558,7 @@ var ArgsTypeBuilder = class {
|
|
|
6570
6558
|
}
|
|
6571
6559
|
addSchemaArgs(args) {
|
|
6572
6560
|
for (const arg of args) {
|
|
6573
|
-
const inputField = buildInputField(arg, this.context
|
|
6561
|
+
const inputField = buildInputField(arg, this.context);
|
|
6574
6562
|
const docComment2 = getArgFieldJSDoc(this.type, this.action, arg);
|
|
6575
6563
|
if (docComment2) {
|
|
6576
6564
|
inputField.setDocComment(docComment(docComment2));
|
|
@@ -6758,37 +6746,46 @@ function buildModelPayload(model, context) {
|
|
|
6758
6746
|
function buildIncludeType({
|
|
6759
6747
|
modelName,
|
|
6760
6748
|
typeName = getIncludeName(modelName),
|
|
6761
|
-
|
|
6749
|
+
context,
|
|
6762
6750
|
fields
|
|
6763
6751
|
}) {
|
|
6764
|
-
const type = buildSelectOrIncludeObject(modelName, getIncludeFields(fields, dmmf));
|
|
6752
|
+
const type = buildSelectOrIncludeObject(modelName, getIncludeFields(fields, context.dmmf), context);
|
|
6765
6753
|
return buildExport(typeName, type);
|
|
6766
6754
|
}
|
|
6767
|
-
function buildOmitType({ modelName, fields,
|
|
6755
|
+
function buildOmitType({ modelName, fields, context }) {
|
|
6768
6756
|
const keysType = unionType(
|
|
6769
6757
|
fields.filter(
|
|
6770
|
-
(field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes" || dmmf.isComposite(field.outputType.type)
|
|
6758
|
+
(field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes" || context.dmmf.isComposite(field.outputType.type)
|
|
6771
6759
|
).map((field) => stringLiteral(field.name))
|
|
6772
6760
|
);
|
|
6773
6761
|
const omitType = namedType("$Extensions.GetOmit").addGenericArgument(keysType).addGenericArgument(modelResultExtensionsType(modelName));
|
|
6762
|
+
if (context.isPreviewFeatureOn("strictUndefinedChecks")) {
|
|
6763
|
+
omitType.addGenericArgument(namedType("$Types.Skip"));
|
|
6764
|
+
}
|
|
6774
6765
|
return buildExport(getOmitName(modelName), omitType);
|
|
6775
6766
|
}
|
|
6776
|
-
function buildSelectType({
|
|
6777
|
-
|
|
6767
|
+
function buildSelectType({
|
|
6768
|
+
modelName,
|
|
6769
|
+
typeName = getSelectName(modelName),
|
|
6770
|
+
fields,
|
|
6771
|
+
context
|
|
6772
|
+
}) {
|
|
6773
|
+
const objectType2 = buildSelectOrIncludeObject(modelName, fields, context);
|
|
6778
6774
|
const selectType = namedType("$Extensions.GetSelect").addGenericArgument(objectType2).addGenericArgument(modelResultExtensionsType(modelName));
|
|
6779
6775
|
return buildExport(typeName, selectType);
|
|
6780
6776
|
}
|
|
6781
6777
|
function modelResultExtensionsType(modelName) {
|
|
6782
6778
|
return extArgsParam.toArgument().subKey("result").subKey(lowerCase(modelName));
|
|
6783
6779
|
}
|
|
6784
|
-
function buildScalarSelectType({ modelName, fields }) {
|
|
6780
|
+
function buildScalarSelectType({ modelName, fields, context }) {
|
|
6785
6781
|
const object = buildSelectOrIncludeObject(
|
|
6786
6782
|
modelName,
|
|
6787
|
-
fields.filter((field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes")
|
|
6783
|
+
fields.filter((field) => field.outputType.location === "scalar" || field.outputType.location === "enumTypes"),
|
|
6784
|
+
context
|
|
6788
6785
|
);
|
|
6789
6786
|
return moduleExport(typeDeclaration(`${getSelectName(modelName)}Scalar`, object));
|
|
6790
6787
|
}
|
|
6791
|
-
function buildSelectOrIncludeObject(modelName, fields) {
|
|
6788
|
+
function buildSelectOrIncludeObject(modelName, fields, context) {
|
|
6792
6789
|
const objectType2 = objectType();
|
|
6793
6790
|
for (const field of fields) {
|
|
6794
6791
|
const fieldType = unionType(booleanType);
|
|
@@ -6797,7 +6794,7 @@ function buildSelectOrIncludeObject(modelName, fields) {
|
|
|
6797
6794
|
subSelectType.addGenericArgument(extArgsParam.toArgument());
|
|
6798
6795
|
fieldType.addVariant(subSelectType);
|
|
6799
6796
|
}
|
|
6800
|
-
objectType2.add(property(field.name, fieldType).optional());
|
|
6797
|
+
objectType2.add(property(field.name, appendSkipType(context, fieldType)).optional());
|
|
6801
6798
|
}
|
|
6802
6799
|
return objectType2;
|
|
6803
6800
|
}
|
|
@@ -6832,7 +6829,6 @@ var Model = class {
|
|
|
6832
6829
|
this.model = model;
|
|
6833
6830
|
this.context = context;
|
|
6834
6831
|
this.dmmf = context.dmmf;
|
|
6835
|
-
this.genericsInfo = context.genericArgsInfo;
|
|
6836
6832
|
this.type = this.context.dmmf.outputTypeMap.model[model.name];
|
|
6837
6833
|
this.createManyAndReturnType = this.context.dmmf.outputTypeMap.model[getCreateManyAndReturnOutputType(model.name)];
|
|
6838
6834
|
this.mapping = this.context.dmmf.mappings.modelOperations.find((m) => m.model === model.name);
|
|
@@ -6906,7 +6902,7 @@ export type ${groupByArgsName}<ExtArgs extends $Extensions.InternalArgs = $Exten
|
|
|
6906
6902
|
${(0, import_indent_string3.default)(
|
|
6907
6903
|
groupByRootField.args.map((arg) => {
|
|
6908
6904
|
const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, DMMF.ModelAction.groupBy, arg) };
|
|
6909
|
-
return new InputField(updatedArg, this.
|
|
6905
|
+
return new InputField(updatedArg, this.context).toTS();
|
|
6910
6906
|
}).concat(
|
|
6911
6907
|
groupByType.fields.filter((f) => f.outputType.location === "outputObjectTypes").map((f) => {
|
|
6912
6908
|
if (f.outputType.location === "outputObjectTypes") {
|
|
@@ -6993,14 +6989,14 @@ ${aggregateTypes.length > 1 ? aggregateTypes.slice(1).map((type) => {
|
|
|
6993
6989
|
]
|
|
6994
6990
|
}))
|
|
6995
6991
|
};
|
|
6996
|
-
return new InputType(newType, this.
|
|
6992
|
+
return new InputType(newType, this.context).toTS();
|
|
6997
6993
|
}).join("\n") : ""}
|
|
6998
6994
|
|
|
6999
6995
|
export type ${aggregateArgsName}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
|
|
7000
6996
|
${(0, import_indent_string3.default)(
|
|
7001
6997
|
aggregateRootField.args.map((arg) => {
|
|
7002
6998
|
const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, DMMF.ModelAction.aggregate, arg) };
|
|
7003
|
-
return new InputField(updatedArg, this.
|
|
6999
|
+
return new InputField(updatedArg, this.context).toTS();
|
|
7004
7000
|
}).concat(
|
|
7005
7001
|
aggregateType.fields.map((f) => {
|
|
7006
7002
|
let data = "";
|
|
@@ -7043,18 +7039,21 @@ export type ${getAggregateGetName(model.name)}<T extends ${getAggregateArgsName(
|
|
|
7043
7039
|
toTS() {
|
|
7044
7040
|
const { model } = this;
|
|
7045
7041
|
const isComposite = this.dmmf.isComposite(model.name);
|
|
7046
|
-
const omitType = this.context.isPreviewFeatureOn("omitApi") ? stringify(buildOmitType({ modelName: this.model.name,
|
|
7042
|
+
const omitType = this.context.isPreviewFeatureOn("omitApi") ? stringify(buildOmitType({ modelName: this.model.name, context: this.context, fields: this.type.fields }), {
|
|
7047
7043
|
newLine: "leading"
|
|
7048
7044
|
}) : "";
|
|
7049
7045
|
const hasRelationField = model.fields.some((f) => f.kind === "object");
|
|
7050
|
-
const includeType = hasRelationField ? stringify(
|
|
7051
|
-
|
|
7052
|
-
|
|
7046
|
+
const includeType = hasRelationField ? stringify(
|
|
7047
|
+
buildIncludeType({ modelName: this.model.name, context: this.context, fields: this.type.fields }),
|
|
7048
|
+
{
|
|
7049
|
+
newLine: "leading"
|
|
7050
|
+
}
|
|
7051
|
+
) : "";
|
|
7053
7052
|
const createManyAndReturnIncludeType = hasRelationField && this.createManyAndReturnType ? stringify(
|
|
7054
7053
|
buildIncludeType({
|
|
7055
7054
|
typeName: getIncludeCreateManyAndReturnName(this.model.name),
|
|
7056
7055
|
modelName: this.model.name,
|
|
7057
|
-
|
|
7056
|
+
context: this.context,
|
|
7058
7057
|
fields: this.createManyAndReturnType.fields
|
|
7059
7058
|
}),
|
|
7060
7059
|
{
|
|
@@ -7070,16 +7069,17 @@ ${!isComposite ? this.getAggregationTypes() : ""}
|
|
|
7070
7069
|
|
|
7071
7070
|
${!isComposite ? this.getGroupByTypes() : ""}
|
|
7072
7071
|
|
|
7073
|
-
${stringify(buildSelectType({ modelName: this.model.name, fields: this.type.fields }))}
|
|
7072
|
+
${stringify(buildSelectType({ modelName: this.model.name, fields: this.type.fields, context: this.context }))}
|
|
7074
7073
|
${this.createManyAndReturnType ? stringify(
|
|
7075
7074
|
buildSelectType({
|
|
7076
7075
|
modelName: this.model.name,
|
|
7077
7076
|
fields: this.createManyAndReturnType.fields,
|
|
7077
|
+
context: this.context,
|
|
7078
7078
|
typeName: getSelectCreateManyAndReturnName(this.model.name)
|
|
7079
7079
|
}),
|
|
7080
7080
|
{ newLine: "leading" }
|
|
7081
7081
|
) : ""}
|
|
7082
|
-
${stringify(buildScalarSelectType({ modelName: this.model.name, fields: this.type.fields }), {
|
|
7082
|
+
${stringify(buildScalarSelectType({ modelName: this.model.name, fields: this.type.fields, context: this.context }), {
|
|
7083
7083
|
newLine: "leading"
|
|
7084
7084
|
})}
|
|
7085
7085
|
${omitType}${includeType}${createManyAndReturnIncludeType}
|
|
@@ -7416,7 +7416,7 @@ function fluentWrapperName(modelName) {
|
|
|
7416
7416
|
var import_ci_info = __toESM(require_ci_info());
|
|
7417
7417
|
var import_crypto = __toESM(require("crypto"));
|
|
7418
7418
|
var import_indent_string8 = __toESM(require_indent_string());
|
|
7419
|
-
var
|
|
7419
|
+
var import_path4 = __toESM(require("path"));
|
|
7420
7420
|
|
|
7421
7421
|
// src/generation/dmmf.ts
|
|
7422
7422
|
var DMMFHelper = class {
|
|
@@ -7767,7 +7767,7 @@ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
|
|
|
7767
7767
|
}
|
|
7768
7768
|
|
|
7769
7769
|
// src/generation/utils/buildNFTAnnotations.ts
|
|
7770
|
-
var
|
|
7770
|
+
var import_path3 = __toESM(require("path"));
|
|
7771
7771
|
|
|
7772
7772
|
// ../../helpers/blaze/map.ts
|
|
7773
7773
|
function mapList(object, mapper) {
|
|
@@ -7823,7 +7823,7 @@ function getQueryEngineFilename(engineType, binaryTarget) {
|
|
|
7823
7823
|
return void 0;
|
|
7824
7824
|
}
|
|
7825
7825
|
function buildNFTAnnotation(fileName, relativeOutdir) {
|
|
7826
|
-
const relativeFilePath =
|
|
7826
|
+
const relativeFilePath = import_path3.default.join(relativeOutdir, fileName);
|
|
7827
7827
|
return `
|
|
7828
7828
|
// file annotations for bundling tools to include these files
|
|
7829
7829
|
path.join(__dirname, ${JSON.stringify(pathToPosix(fileName))});
|
|
@@ -7857,6 +7857,7 @@ var commonCodeJS = ({
|
|
|
7857
7857
|
browser,
|
|
7858
7858
|
clientVersion: clientVersion2,
|
|
7859
7859
|
engineVersion,
|
|
7860
|
+
generator,
|
|
7860
7861
|
deno
|
|
7861
7862
|
}) => `${deno ? "const exports = {}" : ""}
|
|
7862
7863
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -7880,14 +7881,16 @@ import {
|
|
|
7880
7881
|
Extensions,
|
|
7881
7882
|
defineDmmfProperty,
|
|
7882
7883
|
Public,
|
|
7883
|
-
getRuntime
|
|
7884
|
+
getRuntime,
|
|
7885
|
+
skip
|
|
7884
7886
|
} from '${runtimeBase}/${runtimeNameJs}.js'` : browser ? `
|
|
7885
7887
|
const {
|
|
7886
7888
|
Decimal,
|
|
7887
7889
|
objectEnumValues,
|
|
7888
7890
|
makeStrictEnum,
|
|
7889
7891
|
Public,
|
|
7890
|
-
getRuntime
|
|
7892
|
+
getRuntime,
|
|
7893
|
+
skip
|
|
7891
7894
|
} = require('${runtimeBase}/${runtimeNameJs}.js')
|
|
7892
7895
|
` : `
|
|
7893
7896
|
const {
|
|
@@ -7902,6 +7905,7 @@ const {
|
|
|
7902
7905
|
empty,
|
|
7903
7906
|
join,
|
|
7904
7907
|
raw,
|
|
7908
|
+
skip,
|
|
7905
7909
|
Decimal,
|
|
7906
7910
|
Debug,
|
|
7907
7911
|
objectEnumValues,
|
|
@@ -7963,6 +7967,8 @@ Prisma.NullTypes = {
|
|
|
7963
7967
|
JsonNull: objectEnumValues.classes.JsonNull,
|
|
7964
7968
|
AnyNull: objectEnumValues.classes.AnyNull
|
|
7965
7969
|
}
|
|
7970
|
+
|
|
7971
|
+
${buildPrismaSkipJs(generator.previewFeatures)}
|
|
7966
7972
|
`;
|
|
7967
7973
|
var notSupportOnBrowser = (fnc, browser) => {
|
|
7968
7974
|
if (browser) {
|
|
@@ -7974,7 +7980,13 @@ In case this error is unexpected for you, please report it in https://pris.ly/pr
|
|
|
7974
7980
|
}
|
|
7975
7981
|
return fnc;
|
|
7976
7982
|
};
|
|
7977
|
-
var commonCodeTS = ({
|
|
7983
|
+
var commonCodeTS = ({
|
|
7984
|
+
runtimeBase,
|
|
7985
|
+
runtimeNameTs,
|
|
7986
|
+
clientVersion: clientVersion2,
|
|
7987
|
+
engineVersion,
|
|
7988
|
+
generator
|
|
7989
|
+
}) => ({
|
|
7978
7990
|
tsWithoutNamespace: () => `import * as runtime from '${runtimeBase}/${runtimeNameTs}';
|
|
7979
7991
|
import $Types = runtime.Types // general types
|
|
7980
7992
|
import $Public = runtime.Types.Public
|
|
@@ -8012,6 +8024,8 @@ export import join = runtime.join
|
|
|
8012
8024
|
export import raw = runtime.raw
|
|
8013
8025
|
export import Sql = runtime.Sql
|
|
8014
8026
|
|
|
8027
|
+
${buildPrismaSkipTs(generator.previewFeatures)}
|
|
8028
|
+
|
|
8015
8029
|
/**
|
|
8016
8030
|
* Decimal.js
|
|
8017
8031
|
*/
|
|
@@ -8404,6 +8418,25 @@ class ${name} {
|
|
|
8404
8418
|
}`;
|
|
8405
8419
|
return (0, import_indent_string4.default)(source, TAB_SIZE);
|
|
8406
8420
|
}
|
|
8421
|
+
function buildPrismaSkipTs(previewFeatures) {
|
|
8422
|
+
if (previewFeatures.includes("strictUndefinedChecks")) {
|
|
8423
|
+
return `
|
|
8424
|
+
/**
|
|
8425
|
+
* Prisma.skip
|
|
8426
|
+
*/
|
|
8427
|
+
export import skip = runtime.skip
|
|
8428
|
+
`;
|
|
8429
|
+
}
|
|
8430
|
+
return "";
|
|
8431
|
+
}
|
|
8432
|
+
function buildPrismaSkipJs(previewFeatures) {
|
|
8433
|
+
if (previewFeatures.includes("strictUndefinedChecks")) {
|
|
8434
|
+
return `
|
|
8435
|
+
Prisma.skip = skip
|
|
8436
|
+
`;
|
|
8437
|
+
}
|
|
8438
|
+
return "";
|
|
8439
|
+
}
|
|
8407
8440
|
|
|
8408
8441
|
// src/generation/TSClient/Count.ts
|
|
8409
8442
|
var import_indent_string5 = __toESM(require_indent_string());
|
|
@@ -9135,8 +9168,8 @@ var TSClient = class {
|
|
|
9135
9168
|
return `module.exports = { ...require('${reusedJs}') }`;
|
|
9136
9169
|
}
|
|
9137
9170
|
const relativeEnvPaths = {
|
|
9138
|
-
rootEnvPath: envPaths.rootEnvPath && pathToPosix(
|
|
9139
|
-
schemaEnvPath: envPaths.schemaEnvPath && pathToPosix(
|
|
9171
|
+
rootEnvPath: envPaths.rootEnvPath && pathToPosix(import_path4.default.relative(outputDir, envPaths.rootEnvPath)),
|
|
9172
|
+
schemaEnvPath: envPaths.schemaEnvPath && pathToPosix(import_path4.default.relative(outputDir, envPaths.schemaEnvPath))
|
|
9140
9173
|
};
|
|
9141
9174
|
const clientEngineType = getClientEngineType(generator);
|
|
9142
9175
|
generator.config.engineType = clientEngineType;
|
|
@@ -9146,7 +9179,7 @@ var TSClient = class {
|
|
|
9146
9179
|
const config = {
|
|
9147
9180
|
generator,
|
|
9148
9181
|
relativeEnvPaths,
|
|
9149
|
-
relativePath: pathToPosix(
|
|
9182
|
+
relativePath: pathToPosix(import_path4.default.relative(outputDir, import_path4.default.dirname(datasourceFilePath))),
|
|
9150
9183
|
clientVersion: this.options.clientVersion,
|
|
9151
9184
|
engineVersion: this.options.engineVersion,
|
|
9152
9185
|
datasourceNames: datasources.map((d) => d.name),
|
|
@@ -9160,7 +9193,7 @@ var TSClient = class {
|
|
|
9160
9193
|
inlineSchemaHash,
|
|
9161
9194
|
copyEngine
|
|
9162
9195
|
};
|
|
9163
|
-
const relativeOutdir =
|
|
9196
|
+
const relativeOutdir = import_path4.default.relative(process.cwd(), outputDir);
|
|
9164
9197
|
const code = `${commonCodeJS({ ...this.options, browser: false })}
|
|
9165
9198
|
${buildRequirePath(edge)}
|
|
9166
9199
|
|
|
@@ -9181,7 +9214,6 @@ ${new Enum(
|
|
|
9181
9214
|
* Create the Client
|
|
9182
9215
|
*/
|
|
9183
9216
|
const config = ${JSON.stringify(config, null, 2)}
|
|
9184
|
-
config.loadBinaryTargetFileMap = () => import('./binary-target-file-map.mjs').then(module => module.default)
|
|
9185
9217
|
${buildDirname(edge, relativeOutdir)}
|
|
9186
9218
|
${buildRuntimeDataModel(this.dmmf.datamodel, runtimeNameJs)}
|
|
9187
9219
|
${buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs)}
|
|
@@ -9309,14 +9341,14 @@ ${this.dmmf.inputObjectTypes.prisma?.reduce((acc, inputType) => {
|
|
|
9309
9341
|
${baseName}
|
|
9310
9342
|
>
|
|
9311
9343
|
| OptionalFlat<Omit<${baseName}, 'path'>>`);
|
|
9312
|
-
acc.push(new InputType(inputType,
|
|
9344
|
+
acc.push(new InputType(inputType, context).overrideName(`${inputType.name}Base`).toTS());
|
|
9313
9345
|
} else {
|
|
9314
|
-
acc.push(new InputType(inputType,
|
|
9346
|
+
acc.push(new InputType(inputType, context).toTS());
|
|
9315
9347
|
}
|
|
9316
9348
|
return acc;
|
|
9317
9349
|
}, []).join("\n")}
|
|
9318
9350
|
|
|
9319
|
-
${this.dmmf.inputObjectTypes.model?.map((inputType) => new InputType(inputType,
|
|
9351
|
+
${this.dmmf.inputObjectTypes.model?.map((inputType) => new InputType(inputType, context).toTS()).join("\n") ?? ""}
|
|
9320
9352
|
|
|
9321
9353
|
/**
|
|
9322
9354
|
* Aliases for legacy arg types
|
|
@@ -9660,7 +9692,6 @@ async function buildClient({
|
|
|
9660
9692
|
postinstall,
|
|
9661
9693
|
copyEngine,
|
|
9662
9694
|
envPaths,
|
|
9663
|
-
enginePaths,
|
|
9664
9695
|
typedSql
|
|
9665
9696
|
}) {
|
|
9666
9697
|
const clientEngineType = getClientEngineType(generator);
|
|
@@ -9747,7 +9778,6 @@ async function buildClient({
|
|
|
9747
9778
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
|
9748
9779
|
fileMap["edge.js"] = JS(edgeClient);
|
|
9749
9780
|
fileMap["edge.d.ts"] = TS(edgeClient);
|
|
9750
|
-
fileMap["binary-target-file-map.mjs"] = buildBinaryTargetFileMap(enginePaths);
|
|
9751
9781
|
if (generator.previewFeatures.includes("reactNative")) {
|
|
9752
9782
|
fileMap["react-native.js"] = JS(rnTsClient);
|
|
9753
9783
|
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
@@ -9865,18 +9895,18 @@ function getTypedSqlRuntimeBase(runtimeBase) {
|
|
|
9865
9895
|
}
|
|
9866
9896
|
async function getDefaultOutdir(outputDir) {
|
|
9867
9897
|
if (outputDir.endsWith("node_modules/@prisma/client")) {
|
|
9868
|
-
return
|
|
9898
|
+
return import_path5.default.join(outputDir, "../../.prisma/client");
|
|
9869
9899
|
}
|
|
9870
9900
|
if (process.env.INIT_CWD && process.env.npm_lifecycle_event === "postinstall" && !process.env.PWD?.includes(".pnpm")) {
|
|
9871
|
-
if ((0, import_fs2.existsSync)(
|
|
9872
|
-
return
|
|
9901
|
+
if ((0, import_fs2.existsSync)(import_path5.default.join(process.env.INIT_CWD, "package.json"))) {
|
|
9902
|
+
return import_path5.default.join(process.env.INIT_CWD, "node_modules/.prisma/client");
|
|
9873
9903
|
}
|
|
9874
9904
|
const packagePath = await (0, import_pkg_up.default)({ cwd: process.env.INIT_CWD });
|
|
9875
9905
|
if (packagePath) {
|
|
9876
|
-
return
|
|
9906
|
+
return import_path5.default.join(import_path5.default.dirname(packagePath), "node_modules/.prisma/client");
|
|
9877
9907
|
}
|
|
9878
9908
|
}
|
|
9879
|
-
return
|
|
9909
|
+
return import_path5.default.join(outputDir, "../../.prisma/client");
|
|
9880
9910
|
}
|
|
9881
9911
|
async function generateClient(options) {
|
|
9882
9912
|
const {
|
|
@@ -9899,12 +9929,6 @@ async function generateClient(options) {
|
|
|
9899
9929
|
} = options;
|
|
9900
9930
|
const clientEngineType = getClientEngineType(generator);
|
|
9901
9931
|
const { runtimeBase, outputDir } = await getGenerationDirs(options);
|
|
9902
|
-
const enginePaths = clientEngineType === "library" /* Library */ ? binaryPaths.libqueryEngine : binaryPaths.queryEngine;
|
|
9903
|
-
if (!enginePaths) {
|
|
9904
|
-
throw new Error(
|
|
9905
|
-
`Prisma Client needs \`${clientEngineType === "library" /* Library */ ? "libqueryEngine" : "queryEngine"}\` in the \`binaryPaths\` object.`
|
|
9906
|
-
);
|
|
9907
|
-
}
|
|
9908
9932
|
const { prismaClientDmmf, fileMap } = await buildClient({
|
|
9909
9933
|
datamodel,
|
|
9910
9934
|
schemaPath,
|
|
@@ -9921,8 +9945,7 @@ async function generateClient(options) {
|
|
|
9921
9945
|
copyEngine,
|
|
9922
9946
|
testMode,
|
|
9923
9947
|
envPaths,
|
|
9924
|
-
typedSql
|
|
9925
|
-
enginePaths
|
|
9948
|
+
typedSql
|
|
9926
9949
|
});
|
|
9927
9950
|
const provider = datasources[0].provider;
|
|
9928
9951
|
const denylistsErrors = validateDmmfAgainstDenylists(prismaClientDmmf);
|
|
@@ -9943,12 +9966,12 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
9943
9966
|
}
|
|
9944
9967
|
await (0, import_fs_extra.ensureDir)(outputDir);
|
|
9945
9968
|
if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
|
|
9946
|
-
await (0, import_fs_extra.ensureDir)(
|
|
9969
|
+
await (0, import_fs_extra.ensureDir)(import_path5.default.join(outputDir, "deno"));
|
|
9947
9970
|
}
|
|
9948
9971
|
await writeFileMap(outputDir, fileMap);
|
|
9949
|
-
const runtimeDir =
|
|
9972
|
+
const runtimeDir = import_path5.default.join(__dirname, `${testMode ? "../" : ""}../runtime`);
|
|
9950
9973
|
if (copyRuntime || generator.isCustomOutput === true) {
|
|
9951
|
-
const copiedRuntimeDir =
|
|
9974
|
+
const copiedRuntimeDir = import_path5.default.join(outputDir, "runtime");
|
|
9952
9975
|
await (0, import_fs_extra.ensureDir)(copiedRuntimeDir);
|
|
9953
9976
|
await copyRuntimeFiles({
|
|
9954
9977
|
from: runtimeDir,
|
|
@@ -9957,34 +9980,40 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
9957
9980
|
runtimeName: getNodeRuntimeName(clientEngineType)
|
|
9958
9981
|
});
|
|
9959
9982
|
}
|
|
9983
|
+
const enginePath = clientEngineType === "library" /* Library */ ? binaryPaths.libqueryEngine : binaryPaths.queryEngine;
|
|
9984
|
+
if (!enginePath) {
|
|
9985
|
+
throw new Error(
|
|
9986
|
+
`Prisma Client needs \`${clientEngineType === "library" /* Library */ ? "libqueryEngine" : "queryEngine"}\` in the \`binaryPaths\` object.`
|
|
9987
|
+
);
|
|
9988
|
+
}
|
|
9960
9989
|
if (copyEngine) {
|
|
9961
9990
|
if (process.env.NETLIFY) {
|
|
9962
9991
|
await (0, import_fs_extra.ensureDir)("/tmp/prisma-engines");
|
|
9963
9992
|
}
|
|
9964
|
-
for (const [binaryTarget, filePath] of Object.entries(
|
|
9965
|
-
const fileName =
|
|
9993
|
+
for (const [binaryTarget, filePath] of Object.entries(enginePath)) {
|
|
9994
|
+
const fileName = import_path5.default.basename(filePath);
|
|
9966
9995
|
let target;
|
|
9967
9996
|
if (process.env.NETLIFY && !["rhel-openssl-1.0.x", "rhel-openssl-3.0.x"].includes(binaryTarget)) {
|
|
9968
|
-
target =
|
|
9997
|
+
target = import_path5.default.join("/tmp/prisma-engines", fileName);
|
|
9969
9998
|
} else {
|
|
9970
|
-
target =
|
|
9999
|
+
target = import_path5.default.join(outputDir, fileName);
|
|
9971
10000
|
}
|
|
9972
10001
|
await overwriteFile(filePath, target);
|
|
9973
10002
|
}
|
|
9974
10003
|
}
|
|
9975
|
-
const schemaTargetPath =
|
|
10004
|
+
const schemaTargetPath = import_path5.default.join(outputDir, "schema.prisma");
|
|
9976
10005
|
await import_promises.default.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" });
|
|
9977
10006
|
if (generator.previewFeatures.includes("driverAdapters") && isWasmEngineSupported(provider) && copyEngine && !testMode) {
|
|
9978
10007
|
const suffix = provider === "postgres" ? "postgresql" : provider;
|
|
9979
10008
|
await import_promises.default.copyFile(
|
|
9980
|
-
|
|
9981
|
-
|
|
10009
|
+
import_path5.default.join(runtimeDir, `query_engine_bg.${suffix}.wasm`),
|
|
10010
|
+
import_path5.default.join(outputDir, `query_engine_bg.wasm`)
|
|
9982
10011
|
);
|
|
9983
|
-
await import_promises.default.copyFile(
|
|
10012
|
+
await import_promises.default.copyFile(import_path5.default.join(runtimeDir, `query_engine_bg.${suffix}.js`), import_path5.default.join(outputDir, `query_engine_bg.js`));
|
|
9984
10013
|
}
|
|
9985
10014
|
try {
|
|
9986
10015
|
const prismaCache = (0, import_env_paths.default)("prisma").cache;
|
|
9987
|
-
const signalsPath =
|
|
10016
|
+
const signalsPath = import_path5.default.join(prismaCache, "last-generate");
|
|
9988
10017
|
await import_promises.default.mkdir(prismaCache, { recursive: true });
|
|
9989
10018
|
await import_promises.default.writeFile(signalsPath, Date.now().toString());
|
|
9990
10019
|
} catch {
|
|
@@ -9993,7 +10022,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
9993
10022
|
function writeFileMap(outputDir, fileMap) {
|
|
9994
10023
|
return Promise.all(
|
|
9995
10024
|
Object.entries(fileMap).map(async ([fileName, content]) => {
|
|
9996
|
-
const absolutePath =
|
|
10025
|
+
const absolutePath = import_path5.default.join(outputDir, fileName);
|
|
9997
10026
|
await import_promises.default.rm(absolutePath, { recursive: true, force: true });
|
|
9998
10027
|
if (typeof content === "string") {
|
|
9999
10028
|
await import_promises.default.writeFile(absolutePath, content);
|
|
@@ -10099,8 +10128,8 @@ async function getGenerationDirs({
|
|
|
10099
10128
|
if (isCustomOutput) {
|
|
10100
10129
|
await verifyOutputDirectory(userOutputDir, datamodel, schemaPath);
|
|
10101
10130
|
}
|
|
10102
|
-
const userPackageRoot = await (0, import_pkg_up.default)({ cwd:
|
|
10103
|
-
const userProjectRoot = userPackageRoot ?
|
|
10131
|
+
const userPackageRoot = await (0, import_pkg_up.default)({ cwd: import_path5.default.dirname(userOutputDir) });
|
|
10132
|
+
const userProjectRoot = userPackageRoot ? import_path5.default.dirname(userPackageRoot) : process.cwd();
|
|
10104
10133
|
return {
|
|
10105
10134
|
runtimeBase: userRuntimeImport,
|
|
10106
10135
|
outputDir: userOutputDir,
|
|
@@ -10110,7 +10139,7 @@ async function getGenerationDirs({
|
|
|
10110
10139
|
async function verifyOutputDirectory(directory, datamodel, schemaPath) {
|
|
10111
10140
|
let content;
|
|
10112
10141
|
try {
|
|
10113
|
-
content = await import_promises.default.readFile(
|
|
10142
|
+
content = await import_promises.default.readFile(import_path5.default.join(directory, "package.json"), "utf8");
|
|
10114
10143
|
} catch (e) {
|
|
10115
10144
|
if (e.code === "ENOENT") {
|
|
10116
10145
|
return;
|
|
@@ -10182,7 +10211,7 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
10182
10211
|
if (sourceMaps) {
|
|
10183
10212
|
files.push(...files.filter((file2) => file2.endsWith(".js")).map((file2) => `${file2}.map`));
|
|
10184
10213
|
}
|
|
10185
|
-
await Promise.all(files.map((file2) => import_promises.default.copyFile(
|
|
10214
|
+
await Promise.all(files.map((file2) => import_promises.default.copyFile(import_path5.default.join(from, file2), import_path5.default.join(to, file2))));
|
|
10186
10215
|
}
|
|
10187
10216
|
async function deleteOutputDir(outputDir) {
|
|
10188
10217
|
try {
|