prisma 5.19.0-dev.14 → 5.19.0-dev.15
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/build/index.js +423 -420
- package/package.json +10 -10
- package/preinstall/index.js +1 -1
- package/prisma-client/generator-build/index.js +873 -157
- package/prisma-client/package.json +18 -2
- package/prisma-client/runtime/binary.js +71 -71
- package/prisma-client/runtime/edge-esm.js +18 -18
- package/prisma-client/runtime/edge.js +18 -18
- package/prisma-client/runtime/library.d.ts +77 -5
- package/prisma-client/runtime/library.js +51 -51
- package/prisma-client/runtime/react-native.d.ts +77 -5
- package/prisma-client/runtime/react-native.js +26 -26
- package/prisma-client/scripts/default-index.js +1 -1
- package/prisma-client/sql.d.ts +1 -0
- package/prisma-client/sql.js +4 -0
- package/prisma-client/sql.mjs +1 -0
|
@@ -197,29 +197,29 @@ var require_polyfills = __commonJS({
|
|
|
197
197
|
}(fs3.rename);
|
|
198
198
|
}
|
|
199
199
|
fs3.read = typeof fs3.read !== "function" ? fs3.read : function(fs$read) {
|
|
200
|
-
function read(fd,
|
|
200
|
+
function read(fd, buffer2, offset, length, position, callback_) {
|
|
201
201
|
var callback;
|
|
202
202
|
if (callback_ && typeof callback_ === "function") {
|
|
203
203
|
var eagCounter = 0;
|
|
204
204
|
callback = function(er, _, __) {
|
|
205
205
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
206
206
|
eagCounter++;
|
|
207
|
-
return fs$read.call(fs3, fd,
|
|
207
|
+
return fs$read.call(fs3, fd, buffer2, offset, length, position, callback);
|
|
208
208
|
}
|
|
209
209
|
callback_.apply(this, arguments);
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
return fs$read.call(fs3, fd,
|
|
212
|
+
return fs$read.call(fs3, fd, buffer2, offset, length, position, callback);
|
|
213
213
|
}
|
|
214
214
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
215
215
|
return read;
|
|
216
216
|
}(fs3.read);
|
|
217
217
|
fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
218
|
-
return function(fd,
|
|
218
|
+
return function(fd, buffer2, offset, length, position) {
|
|
219
219
|
var eagCounter = 0;
|
|
220
220
|
while (true) {
|
|
221
221
|
try {
|
|
222
|
-
return fs$readSync.call(fs3, fd,
|
|
222
|
+
return fs$readSync.call(fs3, fd, buffer2, offset, length, position);
|
|
223
223
|
} catch (er) {
|
|
224
224
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
225
225
|
eagCounter++;
|
|
@@ -940,25 +940,25 @@ var require_fs = __commonJS({
|
|
|
940
940
|
return fs3.exists(filename, resolve);
|
|
941
941
|
});
|
|
942
942
|
};
|
|
943
|
-
exports2.read = function(fd,
|
|
943
|
+
exports2.read = function(fd, buffer2, offset, length, position, callback) {
|
|
944
944
|
if (typeof callback === "function") {
|
|
945
|
-
return fs3.read(fd,
|
|
945
|
+
return fs3.read(fd, buffer2, offset, length, position, callback);
|
|
946
946
|
}
|
|
947
947
|
return new Promise((resolve, reject) => {
|
|
948
|
-
fs3.read(fd,
|
|
948
|
+
fs3.read(fd, buffer2, offset, length, position, (err, bytesRead, buffer3) => {
|
|
949
949
|
if (err) return reject(err);
|
|
950
|
-
resolve({ bytesRead, buffer:
|
|
950
|
+
resolve({ bytesRead, buffer: buffer3 });
|
|
951
951
|
});
|
|
952
952
|
});
|
|
953
953
|
};
|
|
954
|
-
exports2.write = function(fd,
|
|
954
|
+
exports2.write = function(fd, buffer2, ...args) {
|
|
955
955
|
if (typeof args[args.length - 1] === "function") {
|
|
956
|
-
return fs3.write(fd,
|
|
956
|
+
return fs3.write(fd, buffer2, ...args);
|
|
957
957
|
}
|
|
958
958
|
return new Promise((resolve, reject) => {
|
|
959
|
-
fs3.write(fd,
|
|
959
|
+
fs3.write(fd, buffer2, ...args, (err, bytesWritten, buffer3) => {
|
|
960
960
|
if (err) return reject(err);
|
|
961
|
-
resolve({ bytesWritten, buffer:
|
|
961
|
+
resolve({ bytesWritten, buffer: buffer3 });
|
|
962
962
|
});
|
|
963
963
|
});
|
|
964
964
|
};
|
|
@@ -1112,7 +1112,7 @@ var require_stat = __commonJS({
|
|
|
1112
1112
|
var path5 = require("path");
|
|
1113
1113
|
var util2 = require("util");
|
|
1114
1114
|
function getStats(src, dest, opts) {
|
|
1115
|
-
const statFunc = opts.dereference ? (
|
|
1115
|
+
const statFunc = opts.dereference ? (file2) => fs3.stat(file2, { bigint: true }) : (file2) => fs3.lstat(file2, { bigint: true });
|
|
1116
1116
|
return Promise.all([
|
|
1117
1117
|
statFunc(src),
|
|
1118
1118
|
statFunc(dest).catch((err) => {
|
|
@@ -1123,7 +1123,7 @@ var require_stat = __commonJS({
|
|
|
1123
1123
|
}
|
|
1124
1124
|
function getStatsSync(src, dest, opts) {
|
|
1125
1125
|
let destStat;
|
|
1126
|
-
const statFunc = opts.dereference ? (
|
|
1126
|
+
const statFunc = opts.dereference ? (file2) => fs3.statSync(file2, { bigint: true }) : (file2) => fs3.lstatSync(file2, { bigint: true });
|
|
1127
1127
|
const srcStat = statFunc(src);
|
|
1128
1128
|
try {
|
|
1129
1129
|
destStat = statFunc(dest);
|
|
@@ -1639,16 +1639,16 @@ var require_file = __commonJS({
|
|
|
1639
1639
|
var path5 = require("path");
|
|
1640
1640
|
var fs3 = require_graceful_fs();
|
|
1641
1641
|
var mkdir = require_mkdirs();
|
|
1642
|
-
function createFile(
|
|
1642
|
+
function createFile(file2, callback) {
|
|
1643
1643
|
function makeFile() {
|
|
1644
|
-
fs3.writeFile(
|
|
1644
|
+
fs3.writeFile(file2, "", (err) => {
|
|
1645
1645
|
if (err) return callback(err);
|
|
1646
1646
|
callback();
|
|
1647
1647
|
});
|
|
1648
1648
|
}
|
|
1649
|
-
fs3.stat(
|
|
1649
|
+
fs3.stat(file2, (err, stats) => {
|
|
1650
1650
|
if (!err && stats.isFile()) return callback();
|
|
1651
|
-
const dir = path5.dirname(
|
|
1651
|
+
const dir = path5.dirname(file2);
|
|
1652
1652
|
fs3.stat(dir, (err2, stats2) => {
|
|
1653
1653
|
if (err2) {
|
|
1654
1654
|
if (err2.code === "ENOENT") {
|
|
@@ -1668,14 +1668,14 @@ var require_file = __commonJS({
|
|
|
1668
1668
|
});
|
|
1669
1669
|
});
|
|
1670
1670
|
}
|
|
1671
|
-
function createFileSync(
|
|
1671
|
+
function createFileSync(file2) {
|
|
1672
1672
|
let stats;
|
|
1673
1673
|
try {
|
|
1674
|
-
stats = fs3.statSync(
|
|
1674
|
+
stats = fs3.statSync(file2);
|
|
1675
1675
|
} catch {
|
|
1676
1676
|
}
|
|
1677
1677
|
if (stats && stats.isFile()) return;
|
|
1678
|
-
const dir = path5.dirname(
|
|
1678
|
+
const dir = path5.dirname(file2);
|
|
1679
1679
|
try {
|
|
1680
1680
|
if (!fs3.statSync(dir).isDirectory()) {
|
|
1681
1681
|
fs3.readdirSync(dir);
|
|
@@ -1684,7 +1684,7 @@ var require_file = __commonJS({
|
|
|
1684
1684
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
1685
1685
|
else throw err;
|
|
1686
1686
|
}
|
|
1687
|
-
fs3.writeFileSync(
|
|
1687
|
+
fs3.writeFileSync(file2, "");
|
|
1688
1688
|
}
|
|
1689
1689
|
module2.exports = {
|
|
1690
1690
|
createFile: u(createFile),
|
|
@@ -2000,20 +2000,20 @@ var require_jsonfile = __commonJS({
|
|
|
2000
2000
|
}
|
|
2001
2001
|
var universalify = require_universalify();
|
|
2002
2002
|
var { stringify: stringify2, stripBom } = require_utils2();
|
|
2003
|
-
async function _readFile(
|
|
2003
|
+
async function _readFile(file2, options = {}) {
|
|
2004
2004
|
if (typeof options === "string") {
|
|
2005
2005
|
options = { encoding: options };
|
|
2006
2006
|
}
|
|
2007
2007
|
const fs3 = options.fs || _fs;
|
|
2008
2008
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2009
|
-
let data = await universalify.fromCallback(fs3.readFile)(
|
|
2009
|
+
let data = await universalify.fromCallback(fs3.readFile)(file2, options);
|
|
2010
2010
|
data = stripBom(data);
|
|
2011
2011
|
let obj;
|
|
2012
2012
|
try {
|
|
2013
2013
|
obj = JSON.parse(data, options ? options.reviver : null);
|
|
2014
2014
|
} catch (err) {
|
|
2015
2015
|
if (shouldThrow) {
|
|
2016
|
-
err.message = `${
|
|
2016
|
+
err.message = `${file2}: ${err.message}`;
|
|
2017
2017
|
throw err;
|
|
2018
2018
|
} else {
|
|
2019
2019
|
return null;
|
|
@@ -2022,35 +2022,35 @@ var require_jsonfile = __commonJS({
|
|
|
2022
2022
|
return obj;
|
|
2023
2023
|
}
|
|
2024
2024
|
var readFile = universalify.fromPromise(_readFile);
|
|
2025
|
-
function readFileSync(
|
|
2025
|
+
function readFileSync(file2, options = {}) {
|
|
2026
2026
|
if (typeof options === "string") {
|
|
2027
2027
|
options = { encoding: options };
|
|
2028
2028
|
}
|
|
2029
2029
|
const fs3 = options.fs || _fs;
|
|
2030
2030
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2031
2031
|
try {
|
|
2032
|
-
let content = fs3.readFileSync(
|
|
2032
|
+
let content = fs3.readFileSync(file2, options);
|
|
2033
2033
|
content = stripBom(content);
|
|
2034
2034
|
return JSON.parse(content, options.reviver);
|
|
2035
2035
|
} catch (err) {
|
|
2036
2036
|
if (shouldThrow) {
|
|
2037
|
-
err.message = `${
|
|
2037
|
+
err.message = `${file2}: ${err.message}`;
|
|
2038
2038
|
throw err;
|
|
2039
2039
|
} else {
|
|
2040
2040
|
return null;
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
async function _writeFile(
|
|
2044
|
+
async function _writeFile(file2, obj, options = {}) {
|
|
2045
2045
|
const fs3 = options.fs || _fs;
|
|
2046
2046
|
const str = stringify2(obj, options);
|
|
2047
|
-
await universalify.fromCallback(fs3.writeFile)(
|
|
2047
|
+
await universalify.fromCallback(fs3.writeFile)(file2, str, options);
|
|
2048
2048
|
}
|
|
2049
2049
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
2050
|
-
function writeFileSync(
|
|
2050
|
+
function writeFileSync(file2, obj, options = {}) {
|
|
2051
2051
|
const fs3 = options.fs || _fs;
|
|
2052
2052
|
const str = stringify2(obj, options);
|
|
2053
|
-
return fs3.writeFileSync(
|
|
2053
|
+
return fs3.writeFileSync(file2, str, options);
|
|
2054
2054
|
}
|
|
2055
2055
|
var jsonfile = {
|
|
2056
2056
|
readFile,
|
|
@@ -2086,28 +2086,28 @@ var require_output_file = __commonJS({
|
|
|
2086
2086
|
var path5 = require("path");
|
|
2087
2087
|
var mkdir = require_mkdirs();
|
|
2088
2088
|
var pathExists2 = require_path_exists().pathExists;
|
|
2089
|
-
function outputFile(
|
|
2089
|
+
function outputFile(file2, data, encoding, callback) {
|
|
2090
2090
|
if (typeof encoding === "function") {
|
|
2091
2091
|
callback = encoding;
|
|
2092
2092
|
encoding = "utf8";
|
|
2093
2093
|
}
|
|
2094
|
-
const dir = path5.dirname(
|
|
2094
|
+
const dir = path5.dirname(file2);
|
|
2095
2095
|
pathExists2(dir, (err, itDoes) => {
|
|
2096
2096
|
if (err) return callback(err);
|
|
2097
|
-
if (itDoes) return fs3.writeFile(
|
|
2097
|
+
if (itDoes) return fs3.writeFile(file2, data, encoding, callback);
|
|
2098
2098
|
mkdir.mkdirs(dir, (err2) => {
|
|
2099
2099
|
if (err2) return callback(err2);
|
|
2100
|
-
fs3.writeFile(
|
|
2100
|
+
fs3.writeFile(file2, data, encoding, callback);
|
|
2101
2101
|
});
|
|
2102
2102
|
});
|
|
2103
2103
|
}
|
|
2104
|
-
function outputFileSync(
|
|
2105
|
-
const dir = path5.dirname(
|
|
2104
|
+
function outputFileSync(file2, ...args) {
|
|
2105
|
+
const dir = path5.dirname(file2);
|
|
2106
2106
|
if (fs3.existsSync(dir)) {
|
|
2107
|
-
return fs3.writeFileSync(
|
|
2107
|
+
return fs3.writeFileSync(file2, ...args);
|
|
2108
2108
|
}
|
|
2109
2109
|
mkdir.mkdirsSync(dir);
|
|
2110
|
-
fs3.writeFileSync(
|
|
2110
|
+
fs3.writeFileSync(file2, ...args);
|
|
2111
2111
|
}
|
|
2112
2112
|
module2.exports = {
|
|
2113
2113
|
outputFile: u(outputFile),
|
|
@@ -2122,9 +2122,9 @@ var require_output_json = __commonJS({
|
|
|
2122
2122
|
"use strict";
|
|
2123
2123
|
var { stringify: stringify2 } = require_utils2();
|
|
2124
2124
|
var { outputFile } = require_output_file();
|
|
2125
|
-
async function outputJson(
|
|
2125
|
+
async function outputJson(file2, data, options = {}) {
|
|
2126
2126
|
const str = stringify2(data, options);
|
|
2127
|
-
await outputFile(
|
|
2127
|
+
await outputFile(file2, str, options);
|
|
2128
2128
|
}
|
|
2129
2129
|
module2.exports = outputJson;
|
|
2130
2130
|
}
|
|
@@ -2136,9 +2136,9 @@ var require_output_json_sync = __commonJS({
|
|
|
2136
2136
|
"use strict";
|
|
2137
2137
|
var { stringify: stringify2 } = require_utils2();
|
|
2138
2138
|
var { outputFileSync } = require_output_file();
|
|
2139
|
-
function outputJsonSync(
|
|
2139
|
+
function outputJsonSync(file2, data, options) {
|
|
2140
2140
|
const str = stringify2(data, options);
|
|
2141
|
-
outputFileSync(
|
|
2141
|
+
outputFileSync(file2, str, options);
|
|
2142
2142
|
}
|
|
2143
2143
|
module2.exports = outputJsonSync;
|
|
2144
2144
|
}
|
|
@@ -2386,6 +2386,177 @@ var require_indent_string = __commonJS({
|
|
|
2386
2386
|
}
|
|
2387
2387
|
});
|
|
2388
2388
|
|
|
2389
|
+
// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js
|
|
2390
|
+
var require_identifier = __commonJS({
|
|
2391
|
+
"../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports2) {
|
|
2392
|
+
"use strict";
|
|
2393
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
2394
|
+
value: true
|
|
2395
|
+
});
|
|
2396
|
+
exports2.isIdentifierChar = isIdentifierChar;
|
|
2397
|
+
exports2.isIdentifierName = isIdentifierName2;
|
|
2398
|
+
exports2.isIdentifierStart = isIdentifierStart;
|
|
2399
|
+
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
2400
|
+
var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
|
2401
|
+
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
2402
|
+
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
2403
|
+
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
2404
|
+
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
|
2405
|
+
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
2406
|
+
function isInAstralSet(code, set) {
|
|
2407
|
+
let pos = 65536;
|
|
2408
|
+
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
2409
|
+
pos += set[i];
|
|
2410
|
+
if (pos > code) return false;
|
|
2411
|
+
pos += set[i + 1];
|
|
2412
|
+
if (pos >= code) return true;
|
|
2413
|
+
}
|
|
2414
|
+
return false;
|
|
2415
|
+
}
|
|
2416
|
+
function isIdentifierStart(code) {
|
|
2417
|
+
if (code < 65) return code === 36;
|
|
2418
|
+
if (code <= 90) return true;
|
|
2419
|
+
if (code < 97) return code === 95;
|
|
2420
|
+
if (code <= 122) return true;
|
|
2421
|
+
if (code <= 65535) {
|
|
2422
|
+
return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
|
2423
|
+
}
|
|
2424
|
+
return isInAstralSet(code, astralIdentifierStartCodes);
|
|
2425
|
+
}
|
|
2426
|
+
function isIdentifierChar(code) {
|
|
2427
|
+
if (code < 48) return code === 36;
|
|
2428
|
+
if (code < 58) return true;
|
|
2429
|
+
if (code < 65) return false;
|
|
2430
|
+
if (code <= 90) return true;
|
|
2431
|
+
if (code < 97) return code === 95;
|
|
2432
|
+
if (code <= 122) return true;
|
|
2433
|
+
if (code <= 65535) {
|
|
2434
|
+
return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
|
|
2435
|
+
}
|
|
2436
|
+
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
|
2437
|
+
}
|
|
2438
|
+
function isIdentifierName2(name) {
|
|
2439
|
+
let isFirst = true;
|
|
2440
|
+
for (let i = 0; i < name.length; i++) {
|
|
2441
|
+
let cp = name.charCodeAt(i);
|
|
2442
|
+
if ((cp & 64512) === 55296 && i + 1 < name.length) {
|
|
2443
|
+
const trail = name.charCodeAt(++i);
|
|
2444
|
+
if ((trail & 64512) === 56320) {
|
|
2445
|
+
cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
if (isFirst) {
|
|
2449
|
+
isFirst = false;
|
|
2450
|
+
if (!isIdentifierStart(cp)) {
|
|
2451
|
+
return false;
|
|
2452
|
+
}
|
|
2453
|
+
} else if (!isIdentifierChar(cp)) {
|
|
2454
|
+
return false;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
return !isFirst;
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
});
|
|
2461
|
+
|
|
2462
|
+
// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js
|
|
2463
|
+
var require_keyword = __commonJS({
|
|
2464
|
+
"../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports2) {
|
|
2465
|
+
"use strict";
|
|
2466
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
2467
|
+
value: true
|
|
2468
|
+
});
|
|
2469
|
+
exports2.isKeyword = isKeyword;
|
|
2470
|
+
exports2.isReservedWord = isReservedWord;
|
|
2471
|
+
exports2.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
|
2472
|
+
exports2.isStrictBindReservedWord = isStrictBindReservedWord;
|
|
2473
|
+
exports2.isStrictReservedWord = isStrictReservedWord;
|
|
2474
|
+
var reservedWords = {
|
|
2475
|
+
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
|
2476
|
+
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
|
2477
|
+
strictBind: ["eval", "arguments"]
|
|
2478
|
+
};
|
|
2479
|
+
var keywords = new Set(reservedWords.keyword);
|
|
2480
|
+
var reservedWordsStrictSet = new Set(reservedWords.strict);
|
|
2481
|
+
var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
|
2482
|
+
function isReservedWord(word, inModule) {
|
|
2483
|
+
return inModule && word === "await" || word === "enum";
|
|
2484
|
+
}
|
|
2485
|
+
function isStrictReservedWord(word, inModule) {
|
|
2486
|
+
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
|
2487
|
+
}
|
|
2488
|
+
function isStrictBindOnlyReservedWord(word) {
|
|
2489
|
+
return reservedWordsStrictBindSet.has(word);
|
|
2490
|
+
}
|
|
2491
|
+
function isStrictBindReservedWord(word, inModule) {
|
|
2492
|
+
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
|
2493
|
+
}
|
|
2494
|
+
function isKeyword(word) {
|
|
2495
|
+
return keywords.has(word);
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
});
|
|
2499
|
+
|
|
2500
|
+
// ../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
2501
|
+
var require_lib2 = __commonJS({
|
|
2502
|
+
"../../node_modules/.pnpm/@babel+helper-validator-identifier@7.24.7/node_modules/@babel/helper-validator-identifier/lib/index.js"(exports2) {
|
|
2503
|
+
"use strict";
|
|
2504
|
+
Object.defineProperty(exports2, "__esModule", {
|
|
2505
|
+
value: true
|
|
2506
|
+
});
|
|
2507
|
+
Object.defineProperty(exports2, "isIdentifierChar", {
|
|
2508
|
+
enumerable: true,
|
|
2509
|
+
get: function() {
|
|
2510
|
+
return _identifier.isIdentifierChar;
|
|
2511
|
+
}
|
|
2512
|
+
});
|
|
2513
|
+
Object.defineProperty(exports2, "isIdentifierName", {
|
|
2514
|
+
enumerable: true,
|
|
2515
|
+
get: function() {
|
|
2516
|
+
return _identifier.isIdentifierName;
|
|
2517
|
+
}
|
|
2518
|
+
});
|
|
2519
|
+
Object.defineProperty(exports2, "isIdentifierStart", {
|
|
2520
|
+
enumerable: true,
|
|
2521
|
+
get: function() {
|
|
2522
|
+
return _identifier.isIdentifierStart;
|
|
2523
|
+
}
|
|
2524
|
+
});
|
|
2525
|
+
Object.defineProperty(exports2, "isKeyword", {
|
|
2526
|
+
enumerable: true,
|
|
2527
|
+
get: function() {
|
|
2528
|
+
return _keyword.isKeyword;
|
|
2529
|
+
}
|
|
2530
|
+
});
|
|
2531
|
+
Object.defineProperty(exports2, "isReservedWord", {
|
|
2532
|
+
enumerable: true,
|
|
2533
|
+
get: function() {
|
|
2534
|
+
return _keyword.isReservedWord;
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
Object.defineProperty(exports2, "isStrictBindOnlyReservedWord", {
|
|
2538
|
+
enumerable: true,
|
|
2539
|
+
get: function() {
|
|
2540
|
+
return _keyword.isStrictBindOnlyReservedWord;
|
|
2541
|
+
}
|
|
2542
|
+
});
|
|
2543
|
+
Object.defineProperty(exports2, "isStrictBindReservedWord", {
|
|
2544
|
+
enumerable: true,
|
|
2545
|
+
get: function() {
|
|
2546
|
+
return _keyword.isStrictBindReservedWord;
|
|
2547
|
+
}
|
|
2548
|
+
});
|
|
2549
|
+
Object.defineProperty(exports2, "isStrictReservedWord", {
|
|
2550
|
+
enumerable: true,
|
|
2551
|
+
get: function() {
|
|
2552
|
+
return _keyword.isStrictReservedWord;
|
|
2553
|
+
}
|
|
2554
|
+
});
|
|
2555
|
+
var _identifier = require_identifier();
|
|
2556
|
+
var _keyword = require_keyword();
|
|
2557
|
+
}
|
|
2558
|
+
});
|
|
2559
|
+
|
|
2389
2560
|
// ../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js
|
|
2390
2561
|
var require_pluralize = __commonJS({
|
|
2391
2562
|
"../../node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js"(exports2, module2) {
|
|
@@ -2950,9 +3121,9 @@ var require_find_up = __commonJS({
|
|
|
2950
3121
|
const filenames = [].concat(filename);
|
|
2951
3122
|
return new Promise((resolve) => {
|
|
2952
3123
|
(function find(dir) {
|
|
2953
|
-
locatePath2(filenames, { cwd: dir }).then((
|
|
2954
|
-
if (
|
|
2955
|
-
resolve(path5.join(dir,
|
|
3124
|
+
locatePath2(filenames, { cwd: dir }).then((file2) => {
|
|
3125
|
+
if (file2) {
|
|
3126
|
+
resolve(path5.join(dir, file2));
|
|
2956
3127
|
} else if (dir === root) {
|
|
2957
3128
|
resolve(null);
|
|
2958
3129
|
} else {
|
|
@@ -2967,9 +3138,9 @@ var require_find_up = __commonJS({
|
|
|
2967
3138
|
const { root } = path5.parse(dir);
|
|
2968
3139
|
const filenames = [].concat(filename);
|
|
2969
3140
|
while (true) {
|
|
2970
|
-
const
|
|
2971
|
-
if (
|
|
2972
|
-
return path5.join(dir,
|
|
3141
|
+
const file2 = locatePath2.sync(filenames, { cwd: dir });
|
|
3142
|
+
if (file2) {
|
|
3143
|
+
return path5.join(dir, file2);
|
|
2973
3144
|
}
|
|
2974
3145
|
if (dir === root) {
|
|
2975
3146
|
return null;
|
|
@@ -2995,7 +3166,7 @@ var require_package2 = __commonJS({
|
|
|
2995
3166
|
"package.json"(exports2, module2) {
|
|
2996
3167
|
module2.exports = {
|
|
2997
3168
|
name: "@prisma/client",
|
|
2998
|
-
version: "5.19.0-dev.
|
|
3169
|
+
version: "5.19.0-dev.15",
|
|
2999
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.",
|
|
3000
3171
|
keywords: [
|
|
3001
3172
|
"ORM",
|
|
@@ -3102,6 +3273,19 @@ var require_package2 = __commonJS({
|
|
|
3102
3273
|
import: "./generator-build/index.js",
|
|
3103
3274
|
default: "./generator-build/index.js"
|
|
3104
3275
|
},
|
|
3276
|
+
"./sql": {
|
|
3277
|
+
require: {
|
|
3278
|
+
types: "./sql.d.ts",
|
|
3279
|
+
node: "./sql.js",
|
|
3280
|
+
default: "./sql.js"
|
|
3281
|
+
},
|
|
3282
|
+
import: {
|
|
3283
|
+
types: "./sql.d.ts",
|
|
3284
|
+
node: "./sql.mjs",
|
|
3285
|
+
default: "./sql.mjs"
|
|
3286
|
+
},
|
|
3287
|
+
default: "./sql.js"
|
|
3288
|
+
},
|
|
3105
3289
|
"./*": "./*"
|
|
3106
3290
|
},
|
|
3107
3291
|
license: "Apache-2.0",
|
|
@@ -3149,7 +3333,10 @@ var require_package2 = __commonJS({
|
|
|
3149
3333
|
"default.d.ts",
|
|
3150
3334
|
"index-browser.js",
|
|
3151
3335
|
"extension.js",
|
|
3152
|
-
"extension.d.ts"
|
|
3336
|
+
"extension.d.ts",
|
|
3337
|
+
"sql.d.ts",
|
|
3338
|
+
"sql.js",
|
|
3339
|
+
"sql.mjs"
|
|
3153
3340
|
],
|
|
3154
3341
|
devDependencies: {
|
|
3155
3342
|
"@cloudflare/workers-types": "4.20240614.0",
|
|
@@ -3968,9 +4155,9 @@ var processEnv = typeof process !== "undefined" ? process.env : {};
|
|
|
3968
4155
|
globalThis.DEBUG ??= processEnv.DEBUG ?? "";
|
|
3969
4156
|
globalThis.DEBUG_COLORS ??= processEnv.DEBUG_COLORS ? processEnv.DEBUG_COLORS === "true" : true;
|
|
3970
4157
|
var topProps = {
|
|
3971
|
-
enable(
|
|
3972
|
-
if (typeof
|
|
3973
|
-
globalThis.DEBUG =
|
|
4158
|
+
enable(namespace2) {
|
|
4159
|
+
if (typeof namespace2 === "string") {
|
|
4160
|
+
globalThis.DEBUG = namespace2;
|
|
3974
4161
|
}
|
|
3975
4162
|
},
|
|
3976
4163
|
disable() {
|
|
@@ -3979,47 +4166,47 @@ var topProps = {
|
|
|
3979
4166
|
return prev;
|
|
3980
4167
|
},
|
|
3981
4168
|
// this is the core logic to check if logging should happen or not
|
|
3982
|
-
enabled(
|
|
4169
|
+
enabled(namespace2) {
|
|
3983
4170
|
const listenedNamespaces = globalThis.DEBUG.split(",").map((s) => {
|
|
3984
4171
|
return s.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
|
|
3985
4172
|
});
|
|
3986
4173
|
const isListened = listenedNamespaces.some((listenedNamespace) => {
|
|
3987
4174
|
if (listenedNamespace === "" || listenedNamespace[0] === "-") return false;
|
|
3988
|
-
return
|
|
4175
|
+
return namespace2.match(RegExp(listenedNamespace.split("*").join(".*") + "$"));
|
|
3989
4176
|
});
|
|
3990
4177
|
const isExcluded = listenedNamespaces.some((listenedNamespace) => {
|
|
3991
4178
|
if (listenedNamespace === "" || listenedNamespace[0] !== "-") return false;
|
|
3992
|
-
return
|
|
4179
|
+
return namespace2.match(RegExp(listenedNamespace.slice(1).split("*").join(".*") + "$"));
|
|
3993
4180
|
});
|
|
3994
4181
|
return isListened && !isExcluded;
|
|
3995
4182
|
},
|
|
3996
4183
|
log: (...args) => {
|
|
3997
|
-
const [
|
|
4184
|
+
const [namespace2, format, ...rest] = args;
|
|
3998
4185
|
const logWithFormatting = console.warn ?? console.log;
|
|
3999
|
-
logWithFormatting(`${
|
|
4186
|
+
logWithFormatting(`${namespace2} ${format}`, ...rest);
|
|
4000
4187
|
},
|
|
4001
4188
|
formatters: {}
|
|
4002
4189
|
// not implemented
|
|
4003
4190
|
};
|
|
4004
|
-
function debugCreate(
|
|
4191
|
+
function debugCreate(namespace2) {
|
|
4005
4192
|
const instanceProps = {
|
|
4006
4193
|
color: COLORS[lastColor++ % COLORS.length],
|
|
4007
|
-
enabled: topProps.enabled(
|
|
4008
|
-
namespace,
|
|
4194
|
+
enabled: topProps.enabled(namespace2),
|
|
4195
|
+
namespace: namespace2,
|
|
4009
4196
|
log: topProps.log,
|
|
4010
4197
|
extend: () => {
|
|
4011
4198
|
}
|
|
4012
4199
|
// not implemented
|
|
4013
4200
|
};
|
|
4014
4201
|
const debugCall = (...args) => {
|
|
4015
|
-
const { enabled, namespace:
|
|
4202
|
+
const { enabled, namespace: namespace3, color, log } = instanceProps;
|
|
4016
4203
|
if (args.length !== 0) {
|
|
4017
|
-
argsHistory.push([
|
|
4204
|
+
argsHistory.push([namespace3, ...args]);
|
|
4018
4205
|
}
|
|
4019
4206
|
if (argsHistory.length > MAX_ARGS_HISTORY) {
|
|
4020
4207
|
argsHistory.shift();
|
|
4021
4208
|
}
|
|
4022
|
-
if (topProps.enabled(
|
|
4209
|
+
if (topProps.enabled(namespace3) || enabled) {
|
|
4023
4210
|
const stringArgs = args.map((arg) => {
|
|
4024
4211
|
if (typeof arg === "string") {
|
|
4025
4212
|
return arg;
|
|
@@ -4029,9 +4216,9 @@ function debugCreate(namespace) {
|
|
|
4029
4216
|
const ms = `+${Date.now() - lastTimestamp}ms`;
|
|
4030
4217
|
lastTimestamp = Date.now();
|
|
4031
4218
|
if (globalThis.DEBUG_COLORS) {
|
|
4032
|
-
log(colors_exports[color](bold(
|
|
4219
|
+
log(colors_exports[color](bold(namespace3)), ...stringArgs, colors_exports[color](ms));
|
|
4033
4220
|
} else {
|
|
4034
|
-
log(
|
|
4221
|
+
log(namespace3, ...stringArgs, ms);
|
|
4035
4222
|
}
|
|
4036
4223
|
}
|
|
4037
4224
|
};
|
|
@@ -4370,6 +4557,12 @@ function hasOwnProperty(object, key) {
|
|
|
4370
4557
|
return Object.prototype.hasOwnProperty.call(object, key);
|
|
4371
4558
|
}
|
|
4372
4559
|
|
|
4560
|
+
// ../internals/src/utils/isValidJsIdentifier.ts
|
|
4561
|
+
var import_helper_validator_identifier = __toESM(require_lib2());
|
|
4562
|
+
function isValidJsIdentifier(str) {
|
|
4563
|
+
return (0, import_helper_validator_identifier.isIdentifierName)(str);
|
|
4564
|
+
}
|
|
4565
|
+
|
|
4373
4566
|
// ../internals/src/utils/setClassName.ts
|
|
4374
4567
|
function setClassName(classObject, name) {
|
|
4375
4568
|
Object.defineProperty(classObject, "name", {
|
|
@@ -4755,21 +4948,94 @@ function moduleExport(declaration) {
|
|
|
4755
4948
|
}
|
|
4756
4949
|
|
|
4757
4950
|
// src/generation/ts-builders/ExportFrom.ts
|
|
4758
|
-
var
|
|
4759
|
-
constructor(
|
|
4760
|
-
this.modules = modules;
|
|
4951
|
+
var NamespaceExport = class {
|
|
4952
|
+
constructor(from, namespace2) {
|
|
4761
4953
|
this.from = from;
|
|
4954
|
+
this.namespace = namespace2;
|
|
4762
4955
|
}
|
|
4763
4956
|
write(writer) {
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4957
|
+
writer.write(`export * as ${this.namespace} from '${this.from}'`);
|
|
4958
|
+
}
|
|
4959
|
+
};
|
|
4960
|
+
var BindingsExport = class {
|
|
4961
|
+
constructor(from) {
|
|
4962
|
+
this.from = from;
|
|
4963
|
+
this.namedExports = [];
|
|
4964
|
+
}
|
|
4965
|
+
named(namedExport) {
|
|
4966
|
+
if (typeof namedExport === "string") {
|
|
4967
|
+
namedExport = new NamedExport(namedExport);
|
|
4968
|
+
}
|
|
4969
|
+
this.namedExports.push(namedExport);
|
|
4970
|
+
return this;
|
|
4971
|
+
}
|
|
4972
|
+
write(writer) {
|
|
4973
|
+
writer.write("export ").write("{ ").writeJoined(", ", this.namedExports).write(" }").write(` from "${this.from}"`);
|
|
4974
|
+
}
|
|
4975
|
+
};
|
|
4976
|
+
var NamedExport = class {
|
|
4977
|
+
constructor(name) {
|
|
4978
|
+
this.name = name;
|
|
4979
|
+
}
|
|
4980
|
+
as(alias) {
|
|
4981
|
+
this.alias = alias;
|
|
4982
|
+
return this;
|
|
4983
|
+
}
|
|
4984
|
+
write(writer) {
|
|
4985
|
+
writer.write(this.name);
|
|
4986
|
+
if (this.alias) {
|
|
4987
|
+
writer.write(" as ").write(this.alias);
|
|
4988
|
+
}
|
|
4989
|
+
}
|
|
4990
|
+
};
|
|
4991
|
+
var ExportAllFrom = class {
|
|
4992
|
+
constructor(from) {
|
|
4993
|
+
this.from = from;
|
|
4994
|
+
}
|
|
4995
|
+
asNamespace(namespace2) {
|
|
4996
|
+
return new NamespaceExport(this.from, namespace2);
|
|
4997
|
+
}
|
|
4998
|
+
named(binding) {
|
|
4999
|
+
return new BindingsExport(this.from).named(binding);
|
|
5000
|
+
}
|
|
5001
|
+
write(writer) {
|
|
5002
|
+
writer.write(`export * from "${this.from}"`);
|
|
5003
|
+
}
|
|
5004
|
+
};
|
|
5005
|
+
function moduleExportFrom(from) {
|
|
5006
|
+
return new ExportAllFrom(from);
|
|
5007
|
+
}
|
|
5008
|
+
|
|
5009
|
+
// src/generation/ts-builders/File.ts
|
|
5010
|
+
var File = class {
|
|
5011
|
+
constructor() {
|
|
5012
|
+
this.imports = [];
|
|
5013
|
+
this.declarations = [];
|
|
5014
|
+
}
|
|
5015
|
+
addImport(moduleImport2) {
|
|
5016
|
+
this.imports.push(moduleImport2);
|
|
5017
|
+
return this;
|
|
5018
|
+
}
|
|
5019
|
+
add(declaration) {
|
|
5020
|
+
this.declarations.push(declaration);
|
|
5021
|
+
}
|
|
5022
|
+
write(writer) {
|
|
5023
|
+
for (const moduleImport2 of this.imports) {
|
|
5024
|
+
writer.writeLine(moduleImport2);
|
|
5025
|
+
}
|
|
5026
|
+
if (this.imports.length > 0) {
|
|
5027
|
+
writer.newLine();
|
|
5028
|
+
}
|
|
5029
|
+
for (const [i, declaration] of this.declarations.entries()) {
|
|
5030
|
+
writer.writeLine(declaration);
|
|
5031
|
+
if (i < this.declarations.length - 1) {
|
|
5032
|
+
writer.newLine();
|
|
5033
|
+
}
|
|
4768
5034
|
}
|
|
4769
5035
|
}
|
|
4770
5036
|
};
|
|
4771
|
-
function
|
|
4772
|
-
return new
|
|
5037
|
+
function file() {
|
|
5038
|
+
return new File();
|
|
4773
5039
|
}
|
|
4774
5040
|
|
|
4775
5041
|
// src/generation/ts-builders/PrimitiveType.ts
|
|
@@ -4897,6 +5163,85 @@ function optional(innerType) {
|
|
|
4897
5163
|
return new NamedType("$Utils.Optional").addGenericArgument(innerType);
|
|
4898
5164
|
}
|
|
4899
5165
|
|
|
5166
|
+
// src/generation/ts-builders/Import.ts
|
|
5167
|
+
var NamespaceImport = class {
|
|
5168
|
+
constructor(alias, from) {
|
|
5169
|
+
this.alias = alias;
|
|
5170
|
+
this.from = from;
|
|
5171
|
+
}
|
|
5172
|
+
write(writer) {
|
|
5173
|
+
writer.write("import * as ").write(this.alias).write(` from "${this.from}"`);
|
|
5174
|
+
}
|
|
5175
|
+
};
|
|
5176
|
+
var BindingsImport = class {
|
|
5177
|
+
constructor(from) {
|
|
5178
|
+
this.from = from;
|
|
5179
|
+
this.namedImports = [];
|
|
5180
|
+
}
|
|
5181
|
+
default(name) {
|
|
5182
|
+
this.defaultImport = name;
|
|
5183
|
+
return this;
|
|
5184
|
+
}
|
|
5185
|
+
named(namedImport) {
|
|
5186
|
+
if (typeof namedImport === "string") {
|
|
5187
|
+
namedImport = new NamedImport(namedImport);
|
|
5188
|
+
}
|
|
5189
|
+
this.namedImports.push(namedImport);
|
|
5190
|
+
return this;
|
|
5191
|
+
}
|
|
5192
|
+
write(writer) {
|
|
5193
|
+
writer.write("import ");
|
|
5194
|
+
if (this.defaultImport) {
|
|
5195
|
+
writer.write(this.defaultImport);
|
|
5196
|
+
if (this.hasNamedImports()) {
|
|
5197
|
+
writer.write(", ");
|
|
5198
|
+
}
|
|
5199
|
+
}
|
|
5200
|
+
if (this.hasNamedImports()) {
|
|
5201
|
+
writer.write("{ ").writeJoined(", ", this.namedImports).write(" }");
|
|
5202
|
+
}
|
|
5203
|
+
writer.write(` from "${this.from}"`);
|
|
5204
|
+
}
|
|
5205
|
+
hasNamedImports() {
|
|
5206
|
+
return this.namedImports.length > 0;
|
|
5207
|
+
}
|
|
5208
|
+
};
|
|
5209
|
+
var NamedImport = class {
|
|
5210
|
+
constructor(name) {
|
|
5211
|
+
this.name = name;
|
|
5212
|
+
}
|
|
5213
|
+
as(alias) {
|
|
5214
|
+
this.alias = alias;
|
|
5215
|
+
return this;
|
|
5216
|
+
}
|
|
5217
|
+
write(writer) {
|
|
5218
|
+
writer.write(this.name);
|
|
5219
|
+
if (this.alias) {
|
|
5220
|
+
writer.write(" as ").write(this.alias);
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5223
|
+
};
|
|
5224
|
+
var ModuleImport = class {
|
|
5225
|
+
constructor(from) {
|
|
5226
|
+
this.from = from;
|
|
5227
|
+
}
|
|
5228
|
+
asNamespace(alias) {
|
|
5229
|
+
return new NamespaceImport(alias, this.from);
|
|
5230
|
+
}
|
|
5231
|
+
default(alias) {
|
|
5232
|
+
return new BindingsImport(this.from).default(alias);
|
|
5233
|
+
}
|
|
5234
|
+
named(namedImport) {
|
|
5235
|
+
return new BindingsImport(this.from).named(namedImport);
|
|
5236
|
+
}
|
|
5237
|
+
write(writer) {
|
|
5238
|
+
writer.write("import ").write(`"${this.from}"`);
|
|
5239
|
+
}
|
|
5240
|
+
};
|
|
5241
|
+
function moduleImport(from) {
|
|
5242
|
+
return new ModuleImport(from);
|
|
5243
|
+
}
|
|
5244
|
+
|
|
4900
5245
|
// src/generation/ts-builders/Interface.ts
|
|
4901
5246
|
init_TypeBuilder();
|
|
4902
5247
|
var InterfaceDeclaration = class extends TypeBuilder {
|
|
@@ -4995,6 +5340,27 @@ function method(name) {
|
|
|
4995
5340
|
return new Method(name);
|
|
4996
5341
|
}
|
|
4997
5342
|
|
|
5343
|
+
// src/generation/ts-builders/NamespaceDeclaration.ts
|
|
5344
|
+
var NamespaceDeclaration = class {
|
|
5345
|
+
constructor(name) {
|
|
5346
|
+
this.name = name;
|
|
5347
|
+
this.items = [];
|
|
5348
|
+
}
|
|
5349
|
+
add(declaration) {
|
|
5350
|
+
this.items.push(declaration);
|
|
5351
|
+
}
|
|
5352
|
+
write(writer) {
|
|
5353
|
+
writer.writeLine(`namespace ${this.name} {`).withIndent(() => {
|
|
5354
|
+
for (const item of this.items) {
|
|
5355
|
+
writer.writeLine(item);
|
|
5356
|
+
}
|
|
5357
|
+
}).write("}");
|
|
5358
|
+
}
|
|
5359
|
+
};
|
|
5360
|
+
function namespace(name) {
|
|
5361
|
+
return new NamespaceDeclaration(name);
|
|
5362
|
+
}
|
|
5363
|
+
|
|
4998
5364
|
// src/generation/ts-builders/ObjectType.ts
|
|
4999
5365
|
init_TypeBuilder();
|
|
5000
5366
|
var ObjectType = class extends TypeBuilder {
|
|
@@ -5092,7 +5458,15 @@ var Property = class {
|
|
|
5092
5458
|
if (this.isReadonly) {
|
|
5093
5459
|
writer.write("readonly ");
|
|
5094
5460
|
}
|
|
5095
|
-
|
|
5461
|
+
if (typeof this.name === "string") {
|
|
5462
|
+
if (isValidJsIdentifier(this.name)) {
|
|
5463
|
+
writer.write(this.name);
|
|
5464
|
+
} else {
|
|
5465
|
+
writer.write("[").write(JSON.stringify(this.name)).write("]");
|
|
5466
|
+
}
|
|
5467
|
+
} else {
|
|
5468
|
+
writer.write("[").write(this.name).write("]");
|
|
5469
|
+
}
|
|
5096
5470
|
if (this.isOptional) {
|
|
5097
5471
|
writer.write("?");
|
|
5098
5472
|
}
|
|
@@ -5281,6 +5655,46 @@ function stringLiteral(content) {
|
|
|
5281
5655
|
return new StringLiteralType(content);
|
|
5282
5656
|
}
|
|
5283
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();
|
|
5693
|
+
}
|
|
5694
|
+
function tupleItem(type) {
|
|
5695
|
+
return new TupleItem(type);
|
|
5696
|
+
}
|
|
5697
|
+
|
|
5284
5698
|
// src/generation/ts-builders/TypeDeclaration.ts
|
|
5285
5699
|
var TypeDeclaration = class {
|
|
5286
5700
|
constructor(name, type) {
|
|
@@ -5361,6 +5775,20 @@ function unionType(types) {
|
|
|
5361
5775
|
return new UnionType(types);
|
|
5362
5776
|
}
|
|
5363
5777
|
|
|
5778
|
+
// src/generation/ts-builders/WellKnownSymbol.ts
|
|
5779
|
+
var WellKnownSymbol = class {
|
|
5780
|
+
constructor(name) {
|
|
5781
|
+
this.name = name;
|
|
5782
|
+
}
|
|
5783
|
+
write(writer) {
|
|
5784
|
+
writer.write("Symbol.").write(this.name);
|
|
5785
|
+
}
|
|
5786
|
+
};
|
|
5787
|
+
function wellKnownSymbol(name) {
|
|
5788
|
+
return new WellKnownSymbol(name);
|
|
5789
|
+
}
|
|
5790
|
+
var toStringTag = wellKnownSymbol("toStringTag");
|
|
5791
|
+
|
|
5364
5792
|
// src/generation/TSClient/Input.ts
|
|
5365
5793
|
var InputField = class {
|
|
5366
5794
|
constructor(field, genericsInfo, source) {
|
|
@@ -5666,8 +6094,8 @@ function getModelArgName(modelName, action) {
|
|
|
5666
6094
|
assertNever(action, `Unknown action: ${action}`);
|
|
5667
6095
|
}
|
|
5668
6096
|
}
|
|
5669
|
-
function getPayloadName(modelName,
|
|
5670
|
-
if (
|
|
6097
|
+
function getPayloadName(modelName, namespace2 = true) {
|
|
6098
|
+
if (namespace2) {
|
|
5671
6099
|
return `Prisma.${getPayloadName(modelName, false)}`;
|
|
5672
6100
|
}
|
|
5673
6101
|
return `$${modelName}Payload`;
|
|
@@ -6276,8 +6704,8 @@ function buildOutputField(field) {
|
|
|
6276
6704
|
}
|
|
6277
6705
|
function enumTypeName(ref) {
|
|
6278
6706
|
const name = ref.type;
|
|
6279
|
-
const
|
|
6280
|
-
return `${
|
|
6707
|
+
const namespace2 = ref.namespace === "model" ? "$Enums" : "Prisma";
|
|
6708
|
+
return `${namespace2}.${name}`;
|
|
6281
6709
|
}
|
|
6282
6710
|
|
|
6283
6711
|
// src/generation/TSClient/Payload.ts
|
|
@@ -6890,7 +7318,7 @@ function buildFluentWrapperDefinition(modelName, outputType, context) {
|
|
|
6890
7318
|
if (context.isPreviewFeatureOn("omitApi")) {
|
|
6891
7319
|
definition.addGenericParameter(genericParameter("ClientOptions").default(objectType()));
|
|
6892
7320
|
}
|
|
6893
|
-
definition.add(property(
|
|
7321
|
+
definition.add(property(toStringTag, stringLiteral("PrismaPromise")).readonly());
|
|
6894
7322
|
definition.addMultiple(
|
|
6895
7323
|
outputType.fields.filter(
|
|
6896
7324
|
(field) => field.outputType.location === "outputObjectTypes" && !context.dmmf.isComposite(field.outputType.type) && field.name !== "_count"
|
|
@@ -7019,8 +7447,8 @@ var DMMFHelper = class {
|
|
|
7019
7447
|
Object.values(this.mappings.otherOperations.read)
|
|
7020
7448
|
].flat();
|
|
7021
7449
|
}
|
|
7022
|
-
hasEnumInNamespace(enumName,
|
|
7023
|
-
return this.schema.enumTypes[
|
|
7450
|
+
hasEnumInNamespace(enumName, namespace2) {
|
|
7451
|
+
return this.schema.enumTypes[namespace2]?.find((schemaEnum) => schemaEnum.name === enumName) !== void 0;
|
|
7024
7452
|
}
|
|
7025
7453
|
resolveInputObjectType(ref) {
|
|
7026
7454
|
return this.inputTypesByName.get(fullyQualifiedName(ref.type, ref.namespace));
|
|
@@ -7075,9 +7503,9 @@ var DMMFHelper = class {
|
|
|
7075
7503
|
return result;
|
|
7076
7504
|
}
|
|
7077
7505
|
};
|
|
7078
|
-
function fullyQualifiedName(typeName,
|
|
7079
|
-
if (
|
|
7080
|
-
return `${
|
|
7506
|
+
function fullyQualifiedName(typeName, namespace2) {
|
|
7507
|
+
if (namespace2) {
|
|
7508
|
+
return `${namespace2}.${typeName}`;
|
|
7081
7509
|
}
|
|
7082
7510
|
return typeName;
|
|
7083
7511
|
}
|
|
@@ -7434,14 +7862,14 @@ import {
|
|
|
7434
7862
|
Extensions,
|
|
7435
7863
|
defineDmmfProperty,
|
|
7436
7864
|
Public,
|
|
7437
|
-
getRuntime
|
|
7865
|
+
getRuntime
|
|
7438
7866
|
} from '${runtimeBase}/${runtimeNameJs}.js'` : browser ? `
|
|
7439
7867
|
const {
|
|
7440
7868
|
Decimal,
|
|
7441
7869
|
objectEnumValues,
|
|
7442
7870
|
makeStrictEnum,
|
|
7443
7871
|
Public,
|
|
7444
|
-
getRuntime
|
|
7872
|
+
getRuntime
|
|
7445
7873
|
} = require('${runtimeBase}/${runtimeNameJs}.js')
|
|
7446
7874
|
` : `
|
|
7447
7875
|
const {
|
|
@@ -7605,51 +8033,13 @@ export const prismaVersion: PrismaVersion
|
|
|
7605
8033
|
* Utility Types
|
|
7606
8034
|
*/
|
|
7607
8035
|
|
|
7608
|
-
/**
|
|
7609
|
-
* From https://github.com/sindresorhus/type-fest/
|
|
7610
|
-
* Matches a JSON object.
|
|
7611
|
-
* This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from.
|
|
7612
|
-
*/
|
|
7613
|
-
export type JsonObject = {[Key in string]?: JsonValue}
|
|
7614
8036
|
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
export
|
|
7620
|
-
|
|
7621
|
-
/**
|
|
7622
|
-
* From https://github.com/sindresorhus/type-fest/
|
|
7623
|
-
* Matches any valid JSON value.
|
|
7624
|
-
*/
|
|
7625
|
-
export type JsonValue = string | number | boolean | JsonObject | JsonArray | null
|
|
7626
|
-
|
|
7627
|
-
/**
|
|
7628
|
-
* Matches a JSON object.
|
|
7629
|
-
* Unlike \`JsonObject\`, this type allows undefined and read-only properties.
|
|
7630
|
-
*/
|
|
7631
|
-
export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null}
|
|
7632
|
-
|
|
7633
|
-
/**
|
|
7634
|
-
* Matches a JSON array.
|
|
7635
|
-
* Unlike \`JsonArray\`, readonly arrays are assignable to this type.
|
|
7636
|
-
*/
|
|
7637
|
-
export interface InputJsonArray extends ReadonlyArray<InputJsonValue | null> {}
|
|
7638
|
-
|
|
7639
|
-
/**
|
|
7640
|
-
* Matches any valid value that can be used as an input for operations like
|
|
7641
|
-
* create and update as the value of a JSON field. Unlike \`JsonValue\`, this
|
|
7642
|
-
* type allows read-only arrays and read-only object properties and disallows
|
|
7643
|
-
* \`null\` at the top level.
|
|
7644
|
-
*
|
|
7645
|
-
* \`null\` cannot be used as the value of a JSON field because its meaning
|
|
7646
|
-
* would be ambiguous. Use \`Prisma.JsonNull\` to store the JSON null value or
|
|
7647
|
-
* \`Prisma.DbNull\` to clear the JSON value and set the field to the database
|
|
7648
|
-
* NULL value instead.
|
|
7649
|
-
*
|
|
7650
|
-
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values
|
|
7651
|
-
*/
|
|
7652
|
-
export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { toJSON(): unknown }
|
|
8037
|
+
export import JsonObject = runtime.JsonObject
|
|
8038
|
+
export import JsonArray = runtime.JsonArray
|
|
8039
|
+
export import JsonValue = runtime.JsonValue
|
|
8040
|
+
export import InputJsonObject = runtime.InputJsonObject
|
|
8041
|
+
export import InputJsonArray = runtime.InputJsonArray
|
|
8042
|
+
export import InputJsonValue = runtime.InputJsonValue
|
|
7653
8043
|
|
|
7654
8044
|
/**
|
|
7655
8045
|
* Types of the values used to represent different kinds of \`null\` values when working with JSON fields.
|
|
@@ -8124,6 +8514,9 @@ var import_indent_string7 = __toESM(require_indent_string());
|
|
|
8124
8514
|
function runtimeImport(name) {
|
|
8125
8515
|
return name;
|
|
8126
8516
|
}
|
|
8517
|
+
function runtimeImportedType(name) {
|
|
8518
|
+
return namedType(`runtime.${name}`);
|
|
8519
|
+
}
|
|
8127
8520
|
|
|
8128
8521
|
// src/generation/TSClient/Datasources.ts
|
|
8129
8522
|
var import_indent_string6 = __toESM(require_indent_string());
|
|
@@ -8212,18 +8605,23 @@ function payloadToResult(modelName) {
|
|
|
8212
8605
|
return namedType("$Utils.PayloadToResult").addGenericArgument(namedType(getPayloadName(modelName)));
|
|
8213
8606
|
}
|
|
8214
8607
|
function clientTypeMapOthersDefinition(context) {
|
|
8215
|
-
const otherOperationsNames = context.dmmf.getOtherOperationNames().flatMap((
|
|
8216
|
-
|
|
8217
|
-
|
|
8608
|
+
const otherOperationsNames = context.dmmf.getOtherOperationNames().flatMap((name) => {
|
|
8609
|
+
const results = [`$${name}`];
|
|
8610
|
+
if (name === "executeRaw" || name === "queryRaw") {
|
|
8611
|
+
results.push(`$${name}Unsafe`);
|
|
8612
|
+
}
|
|
8613
|
+
if (name === "queryRaw" && context.isPreviewFeatureOn("typedSql")) {
|
|
8614
|
+
results.push(`$queryRawTyped`);
|
|
8218
8615
|
}
|
|
8219
|
-
return
|
|
8616
|
+
return results;
|
|
8220
8617
|
});
|
|
8221
8618
|
const argsResultMap = {
|
|
8222
8619
|
$executeRaw: { args: "[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]", result: "any" },
|
|
8223
8620
|
$queryRaw: { args: "[query: TemplateStringsArray | Prisma.Sql, ...values: any[]]", result: "any" },
|
|
8224
8621
|
$executeRawUnsafe: { args: "[query: string, ...values: any[]]", result: "any" },
|
|
8225
8622
|
$queryRawUnsafe: { args: "[query: string, ...values: any[]]", result: "any" },
|
|
8226
|
-
$runCommandRaw: { args: "Prisma.InputJsonObject", result: "Prisma.JsonObject" }
|
|
8623
|
+
$runCommandRaw: { args: "Prisma.InputJsonObject", result: "Prisma.JsonObject" },
|
|
8624
|
+
$queryRawTyped: { args: "runtime.UnknownTypedSql", result: "Prisma.JsonObject" }
|
|
8227
8625
|
};
|
|
8228
8626
|
return `{
|
|
8229
8627
|
other: {
|
|
@@ -8358,6 +8756,32 @@ function executeRawDefinition(context) {
|
|
|
8358
8756
|
*/
|
|
8359
8757
|
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
|
|
8360
8758
|
}
|
|
8759
|
+
function queryRawTypedDefinition(context) {
|
|
8760
|
+
if (!context.isPreviewFeatureOn("typedSql")) {
|
|
8761
|
+
return "";
|
|
8762
|
+
}
|
|
8763
|
+
if (!context.dmmf.mappings.otherOperations.write.includes("queryRaw")) {
|
|
8764
|
+
return "";
|
|
8765
|
+
}
|
|
8766
|
+
const param = genericParameter("T");
|
|
8767
|
+
const method2 = method("$queryRawTyped").setDocComment(
|
|
8768
|
+
docComment`
|
|
8769
|
+
Executes a typed SQL query and returns a typed result
|
|
8770
|
+
@example
|
|
8771
|
+
\`\`\`
|
|
8772
|
+
import { myQuery } from '@prisma/client/sql'
|
|
8773
|
+
|
|
8774
|
+
const result = await prisma.$queryRawTyped(myQuery())
|
|
8775
|
+
\`\`\`
|
|
8776
|
+
`
|
|
8777
|
+
).addGenericParameter(param).addParameter(
|
|
8778
|
+
parameter(
|
|
8779
|
+
"typedSql",
|
|
8780
|
+
runtimeImportedType("TypedSql").addGenericArgument(array(unknownType)).addGenericArgument(param.toArgument())
|
|
8781
|
+
)
|
|
8782
|
+
).setReturnType(prismaPromise(array(param.toArgument())));
|
|
8783
|
+
return stringify(method2, { indentLevel: 1, newLine: "leading" });
|
|
8784
|
+
}
|
|
8361
8785
|
function metricDefinition(context) {
|
|
8362
8786
|
if (!context.isPreviewFeatureOn("metrics")) {
|
|
8363
8787
|
return "";
|
|
@@ -8480,6 +8904,7 @@ export class PrismaClient<
|
|
|
8480
8904
|
${[
|
|
8481
8905
|
executeRawDefinition(this.context),
|
|
8482
8906
|
queryRawDefinition(this.context),
|
|
8907
|
+
queryRawTypedDefinition(this.context),
|
|
8483
8908
|
batchingTransactionDefinition(this.context),
|
|
8484
8909
|
interactiveTransactionDefinition(this.context),
|
|
8485
8910
|
runCommandRawDefinition(this.context),
|
|
@@ -8754,7 +9179,7 @@ ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, rela
|
|
|
8754
9179
|
toTS() {
|
|
8755
9180
|
const { reusedTs } = this.options;
|
|
8756
9181
|
if (reusedTs) {
|
|
8757
|
-
const topExports = moduleExportFrom(
|
|
9182
|
+
const topExports = moduleExportFrom(`./${reusedTs}`);
|
|
8758
9183
|
return stringify(topExports);
|
|
8759
9184
|
}
|
|
8760
9185
|
const context = new GenerateContext({
|
|
@@ -8952,6 +9377,246 @@ Object.assign(exports, Prisma)
|
|
|
8952
9377
|
}
|
|
8953
9378
|
};
|
|
8954
9379
|
|
|
9380
|
+
// src/generation/typedSql/buildDbEnums.ts
|
|
9381
|
+
var DbEnumsList = class {
|
|
9382
|
+
constructor(enums) {
|
|
9383
|
+
this.enums = enums.map((dmmfEnum) => ({
|
|
9384
|
+
name: dmmfEnum.dbName ?? dmmfEnum.name,
|
|
9385
|
+
values: dmmfEnum.values.map((dmmfValue) => dmmfValue.dbName ?? dmmfValue.name)
|
|
9386
|
+
}));
|
|
9387
|
+
}
|
|
9388
|
+
isEmpty() {
|
|
9389
|
+
return this.enums.length === 0;
|
|
9390
|
+
}
|
|
9391
|
+
hasEnum(name) {
|
|
9392
|
+
return Boolean(this.enums.find((dbEnum) => dbEnum.name === name));
|
|
9393
|
+
}
|
|
9394
|
+
*[Symbol.iterator]() {
|
|
9395
|
+
for (const dbEnum of this.enums) {
|
|
9396
|
+
yield dbEnum;
|
|
9397
|
+
}
|
|
9398
|
+
}
|
|
9399
|
+
};
|
|
9400
|
+
function buildDbEnums(list) {
|
|
9401
|
+
const file2 = file();
|
|
9402
|
+
for (const dbEntry of list) {
|
|
9403
|
+
file2.add(buildDbEnum(dbEntry));
|
|
9404
|
+
}
|
|
9405
|
+
return stringify(file2);
|
|
9406
|
+
}
|
|
9407
|
+
function buildDbEnum(dbEnum) {
|
|
9408
|
+
const type = unionType(dbEnum.values.map(stringLiteral));
|
|
9409
|
+
return moduleExport(typeDeclaration(dbEnum.name, type));
|
|
9410
|
+
}
|
|
9411
|
+
function queryUsesEnums(query, enums) {
|
|
9412
|
+
if (enums.isEmpty()) {
|
|
9413
|
+
return false;
|
|
9414
|
+
}
|
|
9415
|
+
return query.parameters.some((param) => enums.hasEnum(param.typ)) || query.resultColumns.some((column) => enums.hasEnum(column.typ));
|
|
9416
|
+
}
|
|
9417
|
+
|
|
9418
|
+
// src/generation/typedSql/buildIndex.ts
|
|
9419
|
+
function buildIndexTs(queries, enums) {
|
|
9420
|
+
const file2 = file();
|
|
9421
|
+
if (!enums.isEmpty()) {
|
|
9422
|
+
file2.add(moduleExportFrom("./$DbEnums").asNamespace("$DbEnums"));
|
|
9423
|
+
}
|
|
9424
|
+
for (const query of queries) {
|
|
9425
|
+
file2.add(moduleExportFrom(`./${query.name}`));
|
|
9426
|
+
}
|
|
9427
|
+
return stringify(file2);
|
|
9428
|
+
}
|
|
9429
|
+
function buildIndexCjs(queries, edgeRuntimeSuffix) {
|
|
9430
|
+
const writer = new Writer(0, void 0);
|
|
9431
|
+
writer.writeLine('"use strict"');
|
|
9432
|
+
for (const { name } of queries) {
|
|
9433
|
+
const fileName = edgeRuntimeSuffix ? `${name}.${edgeRuntimeSuffix}` : name;
|
|
9434
|
+
writer.writeLine(`exports.${name} = require("./${fileName}.js").${name}`);
|
|
9435
|
+
}
|
|
9436
|
+
return writer.toString();
|
|
9437
|
+
}
|
|
9438
|
+
function buildIndexEsm(queries, edgeRuntimeSuffix) {
|
|
9439
|
+
const writer = new Writer(0, void 0);
|
|
9440
|
+
for (const { name } of queries) {
|
|
9441
|
+
const fileName = edgeRuntimeSuffix ? `${name}.${edgeRuntimeSuffix}` : name;
|
|
9442
|
+
writer.writeLine(`export * from "./${fileName}.mjs"`);
|
|
9443
|
+
}
|
|
9444
|
+
return writer.toString();
|
|
9445
|
+
}
|
|
9446
|
+
|
|
9447
|
+
// src/generation/typedSql/mapTypes.ts
|
|
9448
|
+
var decimal = namedType("$runtime.Decimal");
|
|
9449
|
+
var buffer = namedType("Buffer");
|
|
9450
|
+
var date = namedType("Date");
|
|
9451
|
+
var inputJsonValue = namedType("$runtime.InputJsonObject");
|
|
9452
|
+
var jsonValue = namedType("$runtime.JsonValue");
|
|
9453
|
+
var bigintIn = unionType([numberType, bigintType]);
|
|
9454
|
+
var decimalIn = unionType([numberType, decimal]);
|
|
9455
|
+
var typeMappings = {
|
|
9456
|
+
unknown: unknownType,
|
|
9457
|
+
string: stringType,
|
|
9458
|
+
int: numberType,
|
|
9459
|
+
bigint: {
|
|
9460
|
+
in: bigintIn,
|
|
9461
|
+
out: bigintType
|
|
9462
|
+
},
|
|
9463
|
+
decimal: {
|
|
9464
|
+
in: decimalIn,
|
|
9465
|
+
out: decimal
|
|
9466
|
+
},
|
|
9467
|
+
float: numberType,
|
|
9468
|
+
double: numberType,
|
|
9469
|
+
enum: stringType,
|
|
9470
|
+
// TODO:
|
|
9471
|
+
bytes: buffer,
|
|
9472
|
+
bool: booleanType,
|
|
9473
|
+
char: stringType,
|
|
9474
|
+
json: {
|
|
9475
|
+
in: inputJsonValue,
|
|
9476
|
+
out: jsonValue
|
|
9477
|
+
},
|
|
9478
|
+
xml: stringType,
|
|
9479
|
+
uuid: stringType,
|
|
9480
|
+
date,
|
|
9481
|
+
datetime: date,
|
|
9482
|
+
time: date,
|
|
9483
|
+
null: nullType,
|
|
9484
|
+
"int-array": array(numberType),
|
|
9485
|
+
"string-array": array(stringType),
|
|
9486
|
+
"json-array": {
|
|
9487
|
+
in: array(inputJsonValue),
|
|
9488
|
+
out: array(jsonValue)
|
|
9489
|
+
},
|
|
9490
|
+
"uuid-array": array(stringType),
|
|
9491
|
+
"xml-array": array(stringType),
|
|
9492
|
+
"bigint-array": {
|
|
9493
|
+
in: array(bigintIn),
|
|
9494
|
+
out: array(bigintType)
|
|
9495
|
+
},
|
|
9496
|
+
"float-array": array(numberType),
|
|
9497
|
+
"double-array": array(numberType),
|
|
9498
|
+
"char-array": array(stringType),
|
|
9499
|
+
"bytes-array": array(buffer),
|
|
9500
|
+
"bool-array": array(booleanType),
|
|
9501
|
+
"date-array": array(date),
|
|
9502
|
+
"time-array": array(date),
|
|
9503
|
+
"datetime-array": array(date),
|
|
9504
|
+
"decimal-array": {
|
|
9505
|
+
in: array(decimalIn),
|
|
9506
|
+
out: array(decimal)
|
|
9507
|
+
}
|
|
9508
|
+
};
|
|
9509
|
+
function getInputType(introspectionType, nullable, enums) {
|
|
9510
|
+
const inn = getMappingConfig(introspectionType, enums).in;
|
|
9511
|
+
if (!nullable) {
|
|
9512
|
+
return inn;
|
|
9513
|
+
} else {
|
|
9514
|
+
return new UnionType(inn).addVariant(nullType);
|
|
9515
|
+
}
|
|
9516
|
+
}
|
|
9517
|
+
function getOutputType(introspectionType, nullable, enums) {
|
|
9518
|
+
const out = getMappingConfig(introspectionType, enums).out;
|
|
9519
|
+
if (!nullable) {
|
|
9520
|
+
return out;
|
|
9521
|
+
} else {
|
|
9522
|
+
return new UnionType(out).addVariant(nullType);
|
|
9523
|
+
}
|
|
9524
|
+
}
|
|
9525
|
+
function getMappingConfig(introspectionType, enums) {
|
|
9526
|
+
const config = typeMappings[introspectionType];
|
|
9527
|
+
if (!config) {
|
|
9528
|
+
if (enums.hasEnum(introspectionType)) {
|
|
9529
|
+
const type = namedType(`$DbEnums.${introspectionType}`);
|
|
9530
|
+
return { in: type, out: type };
|
|
9531
|
+
}
|
|
9532
|
+
throw new Error("Unknown type");
|
|
9533
|
+
}
|
|
9534
|
+
if (config instanceof TypeBuilder) {
|
|
9535
|
+
return { in: config, out: config };
|
|
9536
|
+
}
|
|
9537
|
+
return config;
|
|
9538
|
+
}
|
|
9539
|
+
|
|
9540
|
+
// src/generation/typedSql/buildTypedQuery.ts
|
|
9541
|
+
function buildTypedQueryTs({ query, runtimeBase, runtimeName, enums }) {
|
|
9542
|
+
const file2 = file();
|
|
9543
|
+
file2.addImport(moduleImport(`${runtimeBase}/${runtimeName}`).asNamespace("$runtime"));
|
|
9544
|
+
if (queryUsesEnums(query, enums)) {
|
|
9545
|
+
file2.addImport(moduleImport("./$DbEnums").asNamespace("$DbEnums"));
|
|
9546
|
+
}
|
|
9547
|
+
const doc = docComment(query.documentation ?? void 0);
|
|
9548
|
+
const factoryType = functionType();
|
|
9549
|
+
const parametersType = tupleType();
|
|
9550
|
+
for (const param of query.parameters) {
|
|
9551
|
+
const paramType = getInputType(param.typ, param.nullable, enums);
|
|
9552
|
+
factoryType.addParameter(parameter(param.name, paramType));
|
|
9553
|
+
parametersType.add(tupleItem(paramType).setName(param.name));
|
|
9554
|
+
if (param.documentation) {
|
|
9555
|
+
doc.addText(`@param ${param.name} ${param.documentation}`);
|
|
9556
|
+
} else {
|
|
9557
|
+
doc.addText(`@param ${param.name}`);
|
|
9558
|
+
}
|
|
9559
|
+
}
|
|
9560
|
+
factoryType.setReturnType(
|
|
9561
|
+
namedType("$runtime.TypedSql").addGenericArgument(namedType(`${query.name}.Parameters`)).addGenericArgument(namedType(`${query.name}.Result`))
|
|
9562
|
+
);
|
|
9563
|
+
file2.add(moduleExport(constDeclaration(query.name, factoryType)).setDocComment(doc));
|
|
9564
|
+
const namespace2 = namespace(query.name);
|
|
9565
|
+
namespace2.add(moduleExport(typeDeclaration("Parameters", parametersType)));
|
|
9566
|
+
namespace2.add(buildResultType(query, enums));
|
|
9567
|
+
file2.add(moduleExport(namespace2));
|
|
9568
|
+
return stringify(file2);
|
|
9569
|
+
}
|
|
9570
|
+
function buildResultType(query, enums) {
|
|
9571
|
+
const type = objectType().addMultiple(
|
|
9572
|
+
query.resultColumns.map((column) => property(column.name, getOutputType(column.typ, column.nullable, enums)))
|
|
9573
|
+
);
|
|
9574
|
+
return moduleExport(typeDeclaration("Result", type));
|
|
9575
|
+
}
|
|
9576
|
+
function buildTypedQueryCjs({ query, runtimeBase, runtimeName }) {
|
|
9577
|
+
const writer = new Writer(0, void 0);
|
|
9578
|
+
writer.writeLine('"use strict"');
|
|
9579
|
+
writer.writeLine(`const { makeTypedQueryFactory: $mkFactory } = require("${runtimeBase}/${runtimeName}")`);
|
|
9580
|
+
writer.writeLine(`exports.${query.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(query.source)})`);
|
|
9581
|
+
return writer.toString();
|
|
9582
|
+
}
|
|
9583
|
+
function buildTypedQueryEsm({ query, runtimeBase, runtimeName }) {
|
|
9584
|
+
const writer = new Writer(0, void 0);
|
|
9585
|
+
writer.writeLine(`import { makeTypedQueryFactory as $mkFactory } from "${runtimeBase}/${runtimeName}"`);
|
|
9586
|
+
writer.writeLine(`export const ${query.name} = /*#__PURE__*/ $mkFactory(${JSON.stringify(query.source)})`);
|
|
9587
|
+
return writer.toString();
|
|
9588
|
+
}
|
|
9589
|
+
|
|
9590
|
+
// src/generation/typedSql/typedSql.ts
|
|
9591
|
+
function buildTypedSql({
|
|
9592
|
+
queries,
|
|
9593
|
+
runtimeBase,
|
|
9594
|
+
edgeRuntimeName,
|
|
9595
|
+
mainRuntimeName,
|
|
9596
|
+
dmmf
|
|
9597
|
+
}) {
|
|
9598
|
+
const fileMap = {};
|
|
9599
|
+
const enums = new DbEnumsList(dmmf.datamodel.enums);
|
|
9600
|
+
if (!enums.isEmpty()) {
|
|
9601
|
+
fileMap["$DbEnums.d.ts"] = buildDbEnums(enums);
|
|
9602
|
+
}
|
|
9603
|
+
for (const query of queries) {
|
|
9604
|
+
const options = { query, runtimeBase, runtimeName: mainRuntimeName, enums };
|
|
9605
|
+
const edgeOptions = { ...options, runtimeName: `${edgeRuntimeName}.js` };
|
|
9606
|
+
fileMap[`${query.name}.d.ts`] = buildTypedQueryTs(options);
|
|
9607
|
+
fileMap[`${query.name}.js`] = buildTypedQueryCjs(options);
|
|
9608
|
+
fileMap[`${query.name}.${edgeRuntimeName}.js`] = buildTypedQueryCjs(edgeOptions);
|
|
9609
|
+
fileMap[`${query.name}.mjs`] = buildTypedQueryEsm(options);
|
|
9610
|
+
fileMap[`${query.name}.edge.mjs`] = buildTypedQueryEsm(edgeOptions);
|
|
9611
|
+
}
|
|
9612
|
+
fileMap["index.d.ts"] = buildIndexTs(queries, enums);
|
|
9613
|
+
fileMap["index.js"] = buildIndexCjs(queries);
|
|
9614
|
+
fileMap["index.mjs"] = buildIndexEsm(queries);
|
|
9615
|
+
fileMap[`index.${edgeRuntimeName}.mjs`] = buildIndexEsm(queries, edgeRuntimeName);
|
|
9616
|
+
fileMap[`index.${edgeRuntimeName}.js`] = buildIndexCjs(queries, edgeRuntimeName);
|
|
9617
|
+
return fileMap;
|
|
9618
|
+
}
|
|
9619
|
+
|
|
8955
9620
|
// src/generation/generateClient.ts
|
|
8956
9621
|
var debug2 = src_default("prisma:client:generateClient");
|
|
8957
9622
|
var DenylistError = class extends Error {
|
|
@@ -8975,7 +9640,8 @@ async function buildClient({
|
|
|
8975
9640
|
activeProvider,
|
|
8976
9641
|
postinstall,
|
|
8977
9642
|
copyEngine,
|
|
8978
|
-
envPaths
|
|
9643
|
+
envPaths,
|
|
9644
|
+
typedSql
|
|
8979
9645
|
}) {
|
|
8980
9646
|
const clientEngineType = getClientEngineType(generator);
|
|
8981
9647
|
const baseClientOptions = {
|
|
@@ -9065,7 +9731,8 @@ async function buildClient({
|
|
|
9065
9731
|
fileMap["react-native.js"] = JS(rnTsClient);
|
|
9066
9732
|
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
9067
9733
|
}
|
|
9068
|
-
|
|
9734
|
+
const usesWasmRuntime = generator.previewFeatures.includes("driverAdapters");
|
|
9735
|
+
if (usesWasmRuntime) {
|
|
9069
9736
|
fileMap["default.js"] = JS(trampolineTsClient);
|
|
9070
9737
|
fileMap["default.d.ts"] = TS(trampolineTsClient);
|
|
9071
9738
|
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`;
|
|
@@ -9127,6 +9794,37 @@ import './polyfill.js'
|
|
|
9127
9794
|
export * from './edge.js'`;
|
|
9128
9795
|
fileMap["deno/polyfill.js"] = "globalThis.process = { env: Deno.env.toObject() }; globalThis.global = globalThis";
|
|
9129
9796
|
}
|
|
9797
|
+
if (typedSql && typedSql.length > 0) {
|
|
9798
|
+
const edgeRuntimeName = usesWasmRuntime ? "wasm" : "edge";
|
|
9799
|
+
const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
|
|
9800
|
+
const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
|
|
9801
|
+
pkgJson.exports["./sql"] = {
|
|
9802
|
+
require: {
|
|
9803
|
+
types: "./sql/index.d.ts",
|
|
9804
|
+
"edge-light": cjsEdgeIndex,
|
|
9805
|
+
workerd: cjsEdgeIndex,
|
|
9806
|
+
worker: cjsEdgeIndex,
|
|
9807
|
+
node: "./sql/index.js",
|
|
9808
|
+
default: "./sql/index.js"
|
|
9809
|
+
},
|
|
9810
|
+
import: {
|
|
9811
|
+
types: "./sql/index.d.ts",
|
|
9812
|
+
"edge-light": esmEdgeIndex,
|
|
9813
|
+
workerd: esmEdgeIndex,
|
|
9814
|
+
worker: esmEdgeIndex,
|
|
9815
|
+
node: "./sql/index.mjs",
|
|
9816
|
+
default: "./sql/index.mjs"
|
|
9817
|
+
},
|
|
9818
|
+
default: "./sql/index.js"
|
|
9819
|
+
};
|
|
9820
|
+
fileMap["sql"] = buildTypedSql({
|
|
9821
|
+
dmmf,
|
|
9822
|
+
runtimeBase: getTypedSqlRuntimeBase(runtimeBase),
|
|
9823
|
+
mainRuntimeName: getNodeRuntimeName(clientEngineType),
|
|
9824
|
+
queries: typedSql,
|
|
9825
|
+
edgeRuntimeName
|
|
9826
|
+
});
|
|
9827
|
+
}
|
|
9130
9828
|
fileMap["package.json"] = JSON.stringify(pkgJson, null, 2);
|
|
9131
9829
|
return {
|
|
9132
9830
|
fileMap,
|
|
@@ -9135,6 +9833,15 @@ export * from './edge.js'`;
|
|
|
9135
9833
|
// the DMMF document
|
|
9136
9834
|
};
|
|
9137
9835
|
}
|
|
9836
|
+
function getTypedSqlRuntimeBase(runtimeBase) {
|
|
9837
|
+
if (!runtimeBase.startsWith(".")) {
|
|
9838
|
+
return runtimeBase;
|
|
9839
|
+
}
|
|
9840
|
+
if (runtimeBase.startsWith("./")) {
|
|
9841
|
+
return `.${runtimeBase}`;
|
|
9842
|
+
}
|
|
9843
|
+
return `../${runtimeBase}`;
|
|
9844
|
+
}
|
|
9138
9845
|
async function getDefaultOutdir(outputDir) {
|
|
9139
9846
|
if (outputDir.endsWith("node_modules/@prisma/client")) {
|
|
9140
9847
|
return import_path5.default.join(outputDir, "../../.prisma/client");
|
|
@@ -9166,7 +9873,8 @@ async function generateClient(options) {
|
|
|
9166
9873
|
activeProvider,
|
|
9167
9874
|
postinstall,
|
|
9168
9875
|
envPaths,
|
|
9169
|
-
copyEngine = true
|
|
9876
|
+
copyEngine = true,
|
|
9877
|
+
typedSql
|
|
9170
9878
|
} = options;
|
|
9171
9879
|
const clientEngineType = getClientEngineType(generator);
|
|
9172
9880
|
const { runtimeBase, outputDir } = await getGenerationDirs(options);
|
|
@@ -9185,7 +9893,8 @@ async function generateClient(options) {
|
|
|
9185
9893
|
postinstall,
|
|
9186
9894
|
copyEngine,
|
|
9187
9895
|
testMode,
|
|
9188
|
-
envPaths
|
|
9896
|
+
envPaths,
|
|
9897
|
+
typedSql
|
|
9189
9898
|
});
|
|
9190
9899
|
const provider = datasources[0].provider;
|
|
9191
9900
|
const denylistsErrors = validateDmmfAgainstDenylists(prismaClientDmmf);
|
|
@@ -9208,15 +9917,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
9208
9917
|
if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
|
|
9209
9918
|
await (0, import_fs_extra.ensureDir)(import_path5.default.join(outputDir, "deno"));
|
|
9210
9919
|
}
|
|
9211
|
-
await
|
|
9212
|
-
Object.entries(fileMap).map(async ([fileName, file]) => {
|
|
9213
|
-
const filePath = import_path5.default.join(outputDir, fileName);
|
|
9214
|
-
if ((0, import_fs2.existsSync)(filePath)) {
|
|
9215
|
-
await import_promises.default.unlink(filePath);
|
|
9216
|
-
}
|
|
9217
|
-
await import_promises.default.writeFile(filePath, file);
|
|
9218
|
-
})
|
|
9219
|
-
);
|
|
9920
|
+
await writeFileMap(outputDir, fileMap);
|
|
9220
9921
|
const runtimeDir = import_path5.default.join(__dirname, `${testMode ? "../" : ""}../runtime`);
|
|
9221
9922
|
if (copyRuntime || generator.isCustomOutput === true) {
|
|
9222
9923
|
const copiedRuntimeDir = import_path5.default.join(outputDir, "runtime");
|
|
@@ -9267,6 +9968,20 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
9267
9968
|
} catch {
|
|
9268
9969
|
}
|
|
9269
9970
|
}
|
|
9971
|
+
function writeFileMap(outputDir, fileMap) {
|
|
9972
|
+
return Promise.all(
|
|
9973
|
+
Object.entries(fileMap).map(async ([fileName, content]) => {
|
|
9974
|
+
const absolutePath = import_path5.default.join(outputDir, fileName);
|
|
9975
|
+
await import_promises.default.rm(absolutePath, { recursive: true, force: true });
|
|
9976
|
+
if (typeof content === "string") {
|
|
9977
|
+
await import_promises.default.writeFile(absolutePath, content);
|
|
9978
|
+
} else {
|
|
9979
|
+
await import_promises.default.mkdir(absolutePath);
|
|
9980
|
+
await writeFileMap(absolutePath, content);
|
|
9981
|
+
}
|
|
9982
|
+
})
|
|
9983
|
+
);
|
|
9984
|
+
}
|
|
9270
9985
|
function isWasmEngineSupported(provider) {
|
|
9271
9986
|
return provider === "postgresql" || provider === "postgres" || provider === "mysql" || provider === "sqlite";
|
|
9272
9987
|
}
|
|
@@ -9443,9 +10158,9 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
9443
10158
|
files.push(`${runtimeName}.d.ts`);
|
|
9444
10159
|
}
|
|
9445
10160
|
if (sourceMaps) {
|
|
9446
|
-
files.push(...files.filter((
|
|
10161
|
+
files.push(...files.filter((file2) => file2.endsWith(".js")).map((file2) => `${file2}.map`));
|
|
9447
10162
|
}
|
|
9448
|
-
await Promise.all(files.map((
|
|
10163
|
+
await Promise.all(files.map((file2) => import_promises.default.copyFile(import_path5.default.join(from, file2), import_path5.default.join(to, file2))));
|
|
9449
10164
|
}
|
|
9450
10165
|
async function deleteOutputDir(outputDir) {
|
|
9451
10166
|
try {
|
|
@@ -9538,7 +10253,8 @@ if (process.argv[1] === __filename) {
|
|
|
9538
10253
|
clientVersion,
|
|
9539
10254
|
activeProvider: options.datasources[0]?.activeProvider,
|
|
9540
10255
|
postinstall: options.postinstall,
|
|
9541
|
-
copyEngine: !options.noEngine
|
|
10256
|
+
copyEngine: !options.noEngine,
|
|
10257
|
+
typedSql: options.typedSql
|
|
9542
10258
|
});
|
|
9543
10259
|
}
|
|
9544
10260
|
});
|