@prisma/client 6.3.0-integration-simpler-typeinfo-query.1 → 6.3.0-integration-studio-ux-refinements.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 +987 -196
- package/package.json +38 -38
- package/runtime/binary.js +196 -120
- package/runtime/edge-esm.js +18 -18
- package/runtime/edge.js +18 -18
- package/runtime/index-browser.d.ts +1 -1
- package/runtime/library.d.ts +93 -100
- package/runtime/library.js +47 -47
- 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 +93 -100
- package/runtime/react-native.js +27 -27
- package/runtime/wasm.js +19 -19
- 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@6.3.0-
|
|
36
|
+
// ../../node_modules/.pnpm/@prisma+engines-version@6.3.0-13.1635fdddbcd54b9f4b16ffcd9eb726b58d5408da/node_modules/@prisma/engines-version/package.json
|
|
37
37
|
var require_package = __commonJS({
|
|
38
|
-
"../../node_modules/.pnpm/@prisma+engines-version@6.3.0-
|
|
38
|
+
"../../node_modules/.pnpm/@prisma+engines-version@6.3.0-13.1635fdddbcd54b9f4b16ffcd9eb726b58d5408da/node_modules/@prisma/engines-version/package.json"(exports2, module2) {
|
|
39
39
|
module2.exports = {
|
|
40
40
|
name: "@prisma/engines-version",
|
|
41
|
-
version: "6.3.0-
|
|
41
|
+
version: "6.3.0-13.1635fdddbcd54b9f4b16ffcd9eb726b58d5408da",
|
|
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: "1635fdddbcd54b9f4b16ffcd9eb726b58d5408da"
|
|
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@6.3.0-
|
|
69
|
+
// ../../node_modules/.pnpm/@prisma+engines-version@6.3.0-13.1635fdddbcd54b9f4b16ffcd9eb726b58d5408da/node_modules/@prisma/engines-version/index.js
|
|
70
70
|
var require_engines_version = __commonJS({
|
|
71
|
-
"../../node_modules/.pnpm/@prisma+engines-version@6.3.0-
|
|
71
|
+
"../../node_modules/.pnpm/@prisma+engines-version@6.3.0-13.1635fdddbcd54b9f4b16ffcd9eb726b58d5408da/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;
|
|
@@ -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, buffer, 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, buffer, 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, buffer, 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, buffer, 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, buffer, 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, buffer, offset, length, position, callback) {
|
|
944
944
|
if (typeof callback === "function") {
|
|
945
|
-
return fs3.read(fd,
|
|
945
|
+
return fs3.read(fd, buffer, offset, length, position, callback);
|
|
946
946
|
}
|
|
947
947
|
return new Promise((resolve, reject) => {
|
|
948
|
-
fs3.read(fd,
|
|
948
|
+
fs3.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
949
949
|
if (err) return reject(err);
|
|
950
|
-
resolve({ bytesRead, buffer:
|
|
950
|
+
resolve({ bytesRead, buffer: buffer2 });
|
|
951
951
|
});
|
|
952
952
|
});
|
|
953
953
|
};
|
|
954
|
-
exports2.write = function(fd,
|
|
954
|
+
exports2.write = function(fd, buffer, ...args) {
|
|
955
955
|
if (typeof args[args.length - 1] === "function") {
|
|
956
|
-
return fs3.write(fd,
|
|
956
|
+
return fs3.write(fd, buffer, ...args);
|
|
957
957
|
}
|
|
958
958
|
return new Promise((resolve, reject) => {
|
|
959
|
-
fs3.write(fd,
|
|
959
|
+
fs3.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
960
960
|
if (err) return reject(err);
|
|
961
|
-
resolve({ bytesWritten, buffer:
|
|
961
|
+
resolve({ bytesWritten, buffer: buffer2 });
|
|
962
962
|
});
|
|
963
963
|
});
|
|
964
964
|
};
|
|
@@ -1971,6 +1971,786 @@ var require_ensure = __commonJS({
|
|
|
1971
1971
|
}
|
|
1972
1972
|
});
|
|
1973
1973
|
|
|
1974
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
1975
|
+
var require_polyfills2 = __commonJS({
|
|
1976
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
|
1977
|
+
"use strict";
|
|
1978
|
+
var constants = require("constants");
|
|
1979
|
+
var origCwd = process.cwd;
|
|
1980
|
+
var cwd2 = null;
|
|
1981
|
+
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
1982
|
+
process.cwd = function() {
|
|
1983
|
+
if (!cwd2)
|
|
1984
|
+
cwd2 = origCwd.call(process);
|
|
1985
|
+
return cwd2;
|
|
1986
|
+
};
|
|
1987
|
+
try {
|
|
1988
|
+
process.cwd();
|
|
1989
|
+
} catch (er) {
|
|
1990
|
+
}
|
|
1991
|
+
if (typeof process.chdir === "function") {
|
|
1992
|
+
chdir = process.chdir;
|
|
1993
|
+
process.chdir = function(d) {
|
|
1994
|
+
cwd2 = null;
|
|
1995
|
+
chdir.call(process, d);
|
|
1996
|
+
};
|
|
1997
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
|
1998
|
+
}
|
|
1999
|
+
var chdir;
|
|
2000
|
+
module2.exports = patch;
|
|
2001
|
+
function patch(fs3) {
|
|
2002
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
2003
|
+
patchLchmod(fs3);
|
|
2004
|
+
}
|
|
2005
|
+
if (!fs3.lutimes) {
|
|
2006
|
+
patchLutimes(fs3);
|
|
2007
|
+
}
|
|
2008
|
+
fs3.chown = chownFix(fs3.chown);
|
|
2009
|
+
fs3.fchown = chownFix(fs3.fchown);
|
|
2010
|
+
fs3.lchown = chownFix(fs3.lchown);
|
|
2011
|
+
fs3.chmod = chmodFix(fs3.chmod);
|
|
2012
|
+
fs3.fchmod = chmodFix(fs3.fchmod);
|
|
2013
|
+
fs3.lchmod = chmodFix(fs3.lchmod);
|
|
2014
|
+
fs3.chownSync = chownFixSync(fs3.chownSync);
|
|
2015
|
+
fs3.fchownSync = chownFixSync(fs3.fchownSync);
|
|
2016
|
+
fs3.lchownSync = chownFixSync(fs3.lchownSync);
|
|
2017
|
+
fs3.chmodSync = chmodFixSync(fs3.chmodSync);
|
|
2018
|
+
fs3.fchmodSync = chmodFixSync(fs3.fchmodSync);
|
|
2019
|
+
fs3.lchmodSync = chmodFixSync(fs3.lchmodSync);
|
|
2020
|
+
fs3.stat = statFix(fs3.stat);
|
|
2021
|
+
fs3.fstat = statFix(fs3.fstat);
|
|
2022
|
+
fs3.lstat = statFix(fs3.lstat);
|
|
2023
|
+
fs3.statSync = statFixSync(fs3.statSync);
|
|
2024
|
+
fs3.fstatSync = statFixSync(fs3.fstatSync);
|
|
2025
|
+
fs3.lstatSync = statFixSync(fs3.lstatSync);
|
|
2026
|
+
if (fs3.chmod && !fs3.lchmod) {
|
|
2027
|
+
fs3.lchmod = function(path5, mode, cb) {
|
|
2028
|
+
if (cb) process.nextTick(cb);
|
|
2029
|
+
};
|
|
2030
|
+
fs3.lchmodSync = function() {
|
|
2031
|
+
};
|
|
2032
|
+
}
|
|
2033
|
+
if (fs3.chown && !fs3.lchown) {
|
|
2034
|
+
fs3.lchown = function(path5, uid, gid, cb) {
|
|
2035
|
+
if (cb) process.nextTick(cb);
|
|
2036
|
+
};
|
|
2037
|
+
fs3.lchownSync = function() {
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
if (platform === "win32") {
|
|
2041
|
+
fs3.rename = typeof fs3.rename !== "function" ? fs3.rename : function(fs$rename) {
|
|
2042
|
+
function rename(from, to, cb) {
|
|
2043
|
+
var start = Date.now();
|
|
2044
|
+
var backoff = 0;
|
|
2045
|
+
fs$rename(from, to, function CB(er) {
|
|
2046
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
2047
|
+
setTimeout(function() {
|
|
2048
|
+
fs3.stat(to, function(stater, st) {
|
|
2049
|
+
if (stater && stater.code === "ENOENT")
|
|
2050
|
+
fs$rename(from, to, CB);
|
|
2051
|
+
else
|
|
2052
|
+
cb(er);
|
|
2053
|
+
});
|
|
2054
|
+
}, backoff);
|
|
2055
|
+
if (backoff < 100)
|
|
2056
|
+
backoff += 10;
|
|
2057
|
+
return;
|
|
2058
|
+
}
|
|
2059
|
+
if (cb) cb(er);
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
2063
|
+
return rename;
|
|
2064
|
+
}(fs3.rename);
|
|
2065
|
+
}
|
|
2066
|
+
fs3.read = typeof fs3.read !== "function" ? fs3.read : function(fs$read) {
|
|
2067
|
+
function read(fd, buffer, offset, length, position, callback_) {
|
|
2068
|
+
var callback;
|
|
2069
|
+
if (callback_ && typeof callback_ === "function") {
|
|
2070
|
+
var eagCounter = 0;
|
|
2071
|
+
callback = function(er, _, __) {
|
|
2072
|
+
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
2073
|
+
eagCounter++;
|
|
2074
|
+
return fs$read.call(fs3, fd, buffer, offset, length, position, callback);
|
|
2075
|
+
}
|
|
2076
|
+
callback_.apply(this, arguments);
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
return fs$read.call(fs3, fd, buffer, offset, length, position, callback);
|
|
2080
|
+
}
|
|
2081
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
2082
|
+
return read;
|
|
2083
|
+
}(fs3.read);
|
|
2084
|
+
fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
2085
|
+
return function(fd, buffer, offset, length, position) {
|
|
2086
|
+
var eagCounter = 0;
|
|
2087
|
+
while (true) {
|
|
2088
|
+
try {
|
|
2089
|
+
return fs$readSync.call(fs3, fd, buffer, offset, length, position);
|
|
2090
|
+
} catch (er) {
|
|
2091
|
+
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
2092
|
+
eagCounter++;
|
|
2093
|
+
continue;
|
|
2094
|
+
}
|
|
2095
|
+
throw er;
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
};
|
|
2099
|
+
}(fs3.readSync);
|
|
2100
|
+
function patchLchmod(fs4) {
|
|
2101
|
+
fs4.lchmod = function(path5, mode, callback) {
|
|
2102
|
+
fs4.open(
|
|
2103
|
+
path5,
|
|
2104
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
2105
|
+
mode,
|
|
2106
|
+
function(err, fd) {
|
|
2107
|
+
if (err) {
|
|
2108
|
+
if (callback) callback(err);
|
|
2109
|
+
return;
|
|
2110
|
+
}
|
|
2111
|
+
fs4.fchmod(fd, mode, function(err2) {
|
|
2112
|
+
fs4.close(fd, function(err22) {
|
|
2113
|
+
if (callback) callback(err2 || err22);
|
|
2114
|
+
});
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
);
|
|
2118
|
+
};
|
|
2119
|
+
fs4.lchmodSync = function(path5, mode) {
|
|
2120
|
+
var fd = fs4.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
2121
|
+
var threw = true;
|
|
2122
|
+
var ret;
|
|
2123
|
+
try {
|
|
2124
|
+
ret = fs4.fchmodSync(fd, mode);
|
|
2125
|
+
threw = false;
|
|
2126
|
+
} finally {
|
|
2127
|
+
if (threw) {
|
|
2128
|
+
try {
|
|
2129
|
+
fs4.closeSync(fd);
|
|
2130
|
+
} catch (er) {
|
|
2131
|
+
}
|
|
2132
|
+
} else {
|
|
2133
|
+
fs4.closeSync(fd);
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
return ret;
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
function patchLutimes(fs4) {
|
|
2140
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
|
|
2141
|
+
fs4.lutimes = function(path5, at, mt, cb) {
|
|
2142
|
+
fs4.open(path5, constants.O_SYMLINK, function(er, fd) {
|
|
2143
|
+
if (er) {
|
|
2144
|
+
if (cb) cb(er);
|
|
2145
|
+
return;
|
|
2146
|
+
}
|
|
2147
|
+
fs4.futimes(fd, at, mt, function(er2) {
|
|
2148
|
+
fs4.close(fd, function(er22) {
|
|
2149
|
+
if (cb) cb(er2 || er22);
|
|
2150
|
+
});
|
|
2151
|
+
});
|
|
2152
|
+
});
|
|
2153
|
+
};
|
|
2154
|
+
fs4.lutimesSync = function(path5, at, mt) {
|
|
2155
|
+
var fd = fs4.openSync(path5, constants.O_SYMLINK);
|
|
2156
|
+
var ret;
|
|
2157
|
+
var threw = true;
|
|
2158
|
+
try {
|
|
2159
|
+
ret = fs4.futimesSync(fd, at, mt);
|
|
2160
|
+
threw = false;
|
|
2161
|
+
} finally {
|
|
2162
|
+
if (threw) {
|
|
2163
|
+
try {
|
|
2164
|
+
fs4.closeSync(fd);
|
|
2165
|
+
} catch (er) {
|
|
2166
|
+
}
|
|
2167
|
+
} else {
|
|
2168
|
+
fs4.closeSync(fd);
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
return ret;
|
|
2172
|
+
};
|
|
2173
|
+
} else if (fs4.futimes) {
|
|
2174
|
+
fs4.lutimes = function(_a, _b, _c, cb) {
|
|
2175
|
+
if (cb) process.nextTick(cb);
|
|
2176
|
+
};
|
|
2177
|
+
fs4.lutimesSync = function() {
|
|
2178
|
+
};
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
function chmodFix(orig) {
|
|
2182
|
+
if (!orig) return orig;
|
|
2183
|
+
return function(target, mode, cb) {
|
|
2184
|
+
return orig.call(fs3, target, mode, function(er) {
|
|
2185
|
+
if (chownErOk(er)) er = null;
|
|
2186
|
+
if (cb) cb.apply(this, arguments);
|
|
2187
|
+
});
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
function chmodFixSync(orig) {
|
|
2191
|
+
if (!orig) return orig;
|
|
2192
|
+
return function(target, mode) {
|
|
2193
|
+
try {
|
|
2194
|
+
return orig.call(fs3, target, mode);
|
|
2195
|
+
} catch (er) {
|
|
2196
|
+
if (!chownErOk(er)) throw er;
|
|
2197
|
+
}
|
|
2198
|
+
};
|
|
2199
|
+
}
|
|
2200
|
+
function chownFix(orig) {
|
|
2201
|
+
if (!orig) return orig;
|
|
2202
|
+
return function(target, uid, gid, cb) {
|
|
2203
|
+
return orig.call(fs3, target, uid, gid, function(er) {
|
|
2204
|
+
if (chownErOk(er)) er = null;
|
|
2205
|
+
if (cb) cb.apply(this, arguments);
|
|
2206
|
+
});
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
function chownFixSync(orig) {
|
|
2210
|
+
if (!orig) return orig;
|
|
2211
|
+
return function(target, uid, gid) {
|
|
2212
|
+
try {
|
|
2213
|
+
return orig.call(fs3, target, uid, gid);
|
|
2214
|
+
} catch (er) {
|
|
2215
|
+
if (!chownErOk(er)) throw er;
|
|
2216
|
+
}
|
|
2217
|
+
};
|
|
2218
|
+
}
|
|
2219
|
+
function statFix(orig) {
|
|
2220
|
+
if (!orig) return orig;
|
|
2221
|
+
return function(target, options, cb) {
|
|
2222
|
+
if (typeof options === "function") {
|
|
2223
|
+
cb = options;
|
|
2224
|
+
options = null;
|
|
2225
|
+
}
|
|
2226
|
+
function callback(er, stats) {
|
|
2227
|
+
if (stats) {
|
|
2228
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
|
2229
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
|
2230
|
+
}
|
|
2231
|
+
if (cb) cb.apply(this, arguments);
|
|
2232
|
+
}
|
|
2233
|
+
return options ? orig.call(fs3, target, options, callback) : orig.call(fs3, target, callback);
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
function statFixSync(orig) {
|
|
2237
|
+
if (!orig) return orig;
|
|
2238
|
+
return function(target, options) {
|
|
2239
|
+
var stats = options ? orig.call(fs3, target, options) : orig.call(fs3, target);
|
|
2240
|
+
if (stats) {
|
|
2241
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
|
2242
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
|
2243
|
+
}
|
|
2244
|
+
return stats;
|
|
2245
|
+
};
|
|
2246
|
+
}
|
|
2247
|
+
function chownErOk(er) {
|
|
2248
|
+
if (!er)
|
|
2249
|
+
return true;
|
|
2250
|
+
if (er.code === "ENOSYS")
|
|
2251
|
+
return true;
|
|
2252
|
+
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
2253
|
+
if (nonroot) {
|
|
2254
|
+
if (er.code === "EINVAL" || er.code === "EPERM")
|
|
2255
|
+
return true;
|
|
2256
|
+
}
|
|
2257
|
+
return false;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
|
|
2263
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
2264
|
+
var require_legacy_streams2 = __commonJS({
|
|
2265
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
|
|
2266
|
+
"use strict";
|
|
2267
|
+
var Stream = require("stream").Stream;
|
|
2268
|
+
module2.exports = legacy;
|
|
2269
|
+
function legacy(fs3) {
|
|
2270
|
+
return {
|
|
2271
|
+
ReadStream,
|
|
2272
|
+
WriteStream
|
|
2273
|
+
};
|
|
2274
|
+
function ReadStream(path5, options) {
|
|
2275
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
|
|
2276
|
+
Stream.call(this);
|
|
2277
|
+
var self = this;
|
|
2278
|
+
this.path = path5;
|
|
2279
|
+
this.fd = null;
|
|
2280
|
+
this.readable = true;
|
|
2281
|
+
this.paused = false;
|
|
2282
|
+
this.flags = "r";
|
|
2283
|
+
this.mode = 438;
|
|
2284
|
+
this.bufferSize = 64 * 1024;
|
|
2285
|
+
options = options || {};
|
|
2286
|
+
var keys = Object.keys(options);
|
|
2287
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
2288
|
+
var key = keys[index];
|
|
2289
|
+
this[key] = options[key];
|
|
2290
|
+
}
|
|
2291
|
+
if (this.encoding) this.setEncoding(this.encoding);
|
|
2292
|
+
if (this.start !== void 0) {
|
|
2293
|
+
if ("number" !== typeof this.start) {
|
|
2294
|
+
throw TypeError("start must be a Number");
|
|
2295
|
+
}
|
|
2296
|
+
if (this.end === void 0) {
|
|
2297
|
+
this.end = Infinity;
|
|
2298
|
+
} else if ("number" !== typeof this.end) {
|
|
2299
|
+
throw TypeError("end must be a Number");
|
|
2300
|
+
}
|
|
2301
|
+
if (this.start > this.end) {
|
|
2302
|
+
throw new Error("start must be <= end");
|
|
2303
|
+
}
|
|
2304
|
+
this.pos = this.start;
|
|
2305
|
+
}
|
|
2306
|
+
if (this.fd !== null) {
|
|
2307
|
+
process.nextTick(function() {
|
|
2308
|
+
self._read();
|
|
2309
|
+
});
|
|
2310
|
+
return;
|
|
2311
|
+
}
|
|
2312
|
+
fs3.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
2313
|
+
if (err) {
|
|
2314
|
+
self.emit("error", err);
|
|
2315
|
+
self.readable = false;
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
self.fd = fd;
|
|
2319
|
+
self.emit("open", fd);
|
|
2320
|
+
self._read();
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2323
|
+
function WriteStream(path5, options) {
|
|
2324
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
|
|
2325
|
+
Stream.call(this);
|
|
2326
|
+
this.path = path5;
|
|
2327
|
+
this.fd = null;
|
|
2328
|
+
this.writable = true;
|
|
2329
|
+
this.flags = "w";
|
|
2330
|
+
this.encoding = "binary";
|
|
2331
|
+
this.mode = 438;
|
|
2332
|
+
this.bytesWritten = 0;
|
|
2333
|
+
options = options || {};
|
|
2334
|
+
var keys = Object.keys(options);
|
|
2335
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
2336
|
+
var key = keys[index];
|
|
2337
|
+
this[key] = options[key];
|
|
2338
|
+
}
|
|
2339
|
+
if (this.start !== void 0) {
|
|
2340
|
+
if ("number" !== typeof this.start) {
|
|
2341
|
+
throw TypeError("start must be a Number");
|
|
2342
|
+
}
|
|
2343
|
+
if (this.start < 0) {
|
|
2344
|
+
throw new Error("start must be >= zero");
|
|
2345
|
+
}
|
|
2346
|
+
this.pos = this.start;
|
|
2347
|
+
}
|
|
2348
|
+
this.busy = false;
|
|
2349
|
+
this._queue = [];
|
|
2350
|
+
if (this.fd === null) {
|
|
2351
|
+
this._open = fs3.open;
|
|
2352
|
+
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
2353
|
+
this.flush();
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
});
|
|
2359
|
+
|
|
2360
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
|
|
2361
|
+
var require_clone2 = __commonJS({
|
|
2362
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports2, module2) {
|
|
2363
|
+
"use strict";
|
|
2364
|
+
module2.exports = clone;
|
|
2365
|
+
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
2366
|
+
return obj.__proto__;
|
|
2367
|
+
};
|
|
2368
|
+
function clone(obj) {
|
|
2369
|
+
if (obj === null || typeof obj !== "object")
|
|
2370
|
+
return obj;
|
|
2371
|
+
if (obj instanceof Object)
|
|
2372
|
+
var copy = { __proto__: getPrototypeOf(obj) };
|
|
2373
|
+
else
|
|
2374
|
+
var copy = /* @__PURE__ */ Object.create(null);
|
|
2375
|
+
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
2376
|
+
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
2377
|
+
});
|
|
2378
|
+
return copy;
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
});
|
|
2382
|
+
|
|
2383
|
+
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
2384
|
+
var require_graceful_fs2 = __commonJS({
|
|
2385
|
+
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
2386
|
+
"use strict";
|
|
2387
|
+
var fs3 = require("fs");
|
|
2388
|
+
var polyfills = require_polyfills2();
|
|
2389
|
+
var legacy = require_legacy_streams2();
|
|
2390
|
+
var clone = require_clone2();
|
|
2391
|
+
var util2 = require("util");
|
|
2392
|
+
var gracefulQueue;
|
|
2393
|
+
var previousSymbol;
|
|
2394
|
+
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
2395
|
+
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
2396
|
+
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
2397
|
+
} else {
|
|
2398
|
+
gracefulQueue = "___graceful-fs.queue";
|
|
2399
|
+
previousSymbol = "___graceful-fs.previous";
|
|
2400
|
+
}
|
|
2401
|
+
function noop() {
|
|
2402
|
+
}
|
|
2403
|
+
function publishQueue(context, queue2) {
|
|
2404
|
+
Object.defineProperty(context, gracefulQueue, {
|
|
2405
|
+
get: function() {
|
|
2406
|
+
return queue2;
|
|
2407
|
+
}
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
var debug4 = noop;
|
|
2411
|
+
if (util2.debuglog)
|
|
2412
|
+
debug4 = util2.debuglog("gfs4");
|
|
2413
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
2414
|
+
debug4 = function() {
|
|
2415
|
+
var m = util2.format.apply(util2, arguments);
|
|
2416
|
+
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
2417
|
+
console.error(m);
|
|
2418
|
+
};
|
|
2419
|
+
if (!fs3[gracefulQueue]) {
|
|
2420
|
+
queue = global[gracefulQueue] || [];
|
|
2421
|
+
publishQueue(fs3, queue);
|
|
2422
|
+
fs3.close = function(fs$close) {
|
|
2423
|
+
function close(fd, cb) {
|
|
2424
|
+
return fs$close.call(fs3, fd, function(err) {
|
|
2425
|
+
if (!err) {
|
|
2426
|
+
resetQueue();
|
|
2427
|
+
}
|
|
2428
|
+
if (typeof cb === "function")
|
|
2429
|
+
cb.apply(this, arguments);
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2432
|
+
Object.defineProperty(close, previousSymbol, {
|
|
2433
|
+
value: fs$close
|
|
2434
|
+
});
|
|
2435
|
+
return close;
|
|
2436
|
+
}(fs3.close);
|
|
2437
|
+
fs3.closeSync = function(fs$closeSync) {
|
|
2438
|
+
function closeSync(fd) {
|
|
2439
|
+
fs$closeSync.apply(fs3, arguments);
|
|
2440
|
+
resetQueue();
|
|
2441
|
+
}
|
|
2442
|
+
Object.defineProperty(closeSync, previousSymbol, {
|
|
2443
|
+
value: fs$closeSync
|
|
2444
|
+
});
|
|
2445
|
+
return closeSync;
|
|
2446
|
+
}(fs3.closeSync);
|
|
2447
|
+
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
2448
|
+
process.on("exit", function() {
|
|
2449
|
+
debug4(fs3[gracefulQueue]);
|
|
2450
|
+
require("assert").equal(fs3[gracefulQueue].length, 0);
|
|
2451
|
+
});
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
var queue;
|
|
2455
|
+
if (!global[gracefulQueue]) {
|
|
2456
|
+
publishQueue(global, fs3[gracefulQueue]);
|
|
2457
|
+
}
|
|
2458
|
+
module2.exports = patch(clone(fs3));
|
|
2459
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) {
|
|
2460
|
+
module2.exports = patch(fs3);
|
|
2461
|
+
fs3.__patched = true;
|
|
2462
|
+
}
|
|
2463
|
+
function patch(fs4) {
|
|
2464
|
+
polyfills(fs4);
|
|
2465
|
+
fs4.gracefulify = patch;
|
|
2466
|
+
fs4.createReadStream = createReadStream;
|
|
2467
|
+
fs4.createWriteStream = createWriteStream;
|
|
2468
|
+
var fs$readFile = fs4.readFile;
|
|
2469
|
+
fs4.readFile = readFile;
|
|
2470
|
+
function readFile(path5, options, cb) {
|
|
2471
|
+
if (typeof options === "function")
|
|
2472
|
+
cb = options, options = null;
|
|
2473
|
+
return go$readFile(path5, options, cb);
|
|
2474
|
+
function go$readFile(path6, options2, cb2, startTime) {
|
|
2475
|
+
return fs$readFile(path6, options2, function(err) {
|
|
2476
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2477
|
+
enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2478
|
+
else {
|
|
2479
|
+
if (typeof cb2 === "function")
|
|
2480
|
+
cb2.apply(this, arguments);
|
|
2481
|
+
}
|
|
2482
|
+
});
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
var fs$writeFile = fs4.writeFile;
|
|
2486
|
+
fs4.writeFile = writeFile;
|
|
2487
|
+
function writeFile(path5, data, options, cb) {
|
|
2488
|
+
if (typeof options === "function")
|
|
2489
|
+
cb = options, options = null;
|
|
2490
|
+
return go$writeFile(path5, data, options, cb);
|
|
2491
|
+
function go$writeFile(path6, data2, options2, cb2, startTime) {
|
|
2492
|
+
return fs$writeFile(path6, data2, options2, function(err) {
|
|
2493
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2494
|
+
enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2495
|
+
else {
|
|
2496
|
+
if (typeof cb2 === "function")
|
|
2497
|
+
cb2.apply(this, arguments);
|
|
2498
|
+
}
|
|
2499
|
+
});
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
var fs$appendFile = fs4.appendFile;
|
|
2503
|
+
if (fs$appendFile)
|
|
2504
|
+
fs4.appendFile = appendFile;
|
|
2505
|
+
function appendFile(path5, data, options, cb) {
|
|
2506
|
+
if (typeof options === "function")
|
|
2507
|
+
cb = options, options = null;
|
|
2508
|
+
return go$appendFile(path5, data, options, cb);
|
|
2509
|
+
function go$appendFile(path6, data2, options2, cb2, startTime) {
|
|
2510
|
+
return fs$appendFile(path6, data2, options2, function(err) {
|
|
2511
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2512
|
+
enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2513
|
+
else {
|
|
2514
|
+
if (typeof cb2 === "function")
|
|
2515
|
+
cb2.apply(this, arguments);
|
|
2516
|
+
}
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
var fs$copyFile = fs4.copyFile;
|
|
2521
|
+
if (fs$copyFile)
|
|
2522
|
+
fs4.copyFile = copyFile;
|
|
2523
|
+
function copyFile(src, dest, flags, cb) {
|
|
2524
|
+
if (typeof flags === "function") {
|
|
2525
|
+
cb = flags;
|
|
2526
|
+
flags = 0;
|
|
2527
|
+
}
|
|
2528
|
+
return go$copyFile(src, dest, flags, cb);
|
|
2529
|
+
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
2530
|
+
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
2531
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2532
|
+
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2533
|
+
else {
|
|
2534
|
+
if (typeof cb2 === "function")
|
|
2535
|
+
cb2.apply(this, arguments);
|
|
2536
|
+
}
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
var fs$readdir = fs4.readdir;
|
|
2541
|
+
fs4.readdir = readdir;
|
|
2542
|
+
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
2543
|
+
function readdir(path5, options, cb) {
|
|
2544
|
+
if (typeof options === "function")
|
|
2545
|
+
cb = options, options = null;
|
|
2546
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
|
|
2547
|
+
return fs$readdir(path6, fs$readdirCallback(
|
|
2548
|
+
path6,
|
|
2549
|
+
options2,
|
|
2550
|
+
cb2,
|
|
2551
|
+
startTime
|
|
2552
|
+
));
|
|
2553
|
+
} : function go$readdir2(path6, options2, cb2, startTime) {
|
|
2554
|
+
return fs$readdir(path6, options2, fs$readdirCallback(
|
|
2555
|
+
path6,
|
|
2556
|
+
options2,
|
|
2557
|
+
cb2,
|
|
2558
|
+
startTime
|
|
2559
|
+
));
|
|
2560
|
+
};
|
|
2561
|
+
return go$readdir(path5, options, cb);
|
|
2562
|
+
function fs$readdirCallback(path6, options2, cb2, startTime) {
|
|
2563
|
+
return function(err, files) {
|
|
2564
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2565
|
+
enqueue([
|
|
2566
|
+
go$readdir,
|
|
2567
|
+
[path6, options2, cb2],
|
|
2568
|
+
err,
|
|
2569
|
+
startTime || Date.now(),
|
|
2570
|
+
Date.now()
|
|
2571
|
+
]);
|
|
2572
|
+
else {
|
|
2573
|
+
if (files && files.sort)
|
|
2574
|
+
files.sort();
|
|
2575
|
+
if (typeof cb2 === "function")
|
|
2576
|
+
cb2.call(this, err, files);
|
|
2577
|
+
}
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
if (process.version.substr(0, 4) === "v0.8") {
|
|
2582
|
+
var legStreams = legacy(fs4);
|
|
2583
|
+
ReadStream = legStreams.ReadStream;
|
|
2584
|
+
WriteStream = legStreams.WriteStream;
|
|
2585
|
+
}
|
|
2586
|
+
var fs$ReadStream = fs4.ReadStream;
|
|
2587
|
+
if (fs$ReadStream) {
|
|
2588
|
+
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
2589
|
+
ReadStream.prototype.open = ReadStream$open;
|
|
2590
|
+
}
|
|
2591
|
+
var fs$WriteStream = fs4.WriteStream;
|
|
2592
|
+
if (fs$WriteStream) {
|
|
2593
|
+
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
2594
|
+
WriteStream.prototype.open = WriteStream$open;
|
|
2595
|
+
}
|
|
2596
|
+
Object.defineProperty(fs4, "ReadStream", {
|
|
2597
|
+
get: function() {
|
|
2598
|
+
return ReadStream;
|
|
2599
|
+
},
|
|
2600
|
+
set: function(val) {
|
|
2601
|
+
ReadStream = val;
|
|
2602
|
+
},
|
|
2603
|
+
enumerable: true,
|
|
2604
|
+
configurable: true
|
|
2605
|
+
});
|
|
2606
|
+
Object.defineProperty(fs4, "WriteStream", {
|
|
2607
|
+
get: function() {
|
|
2608
|
+
return WriteStream;
|
|
2609
|
+
},
|
|
2610
|
+
set: function(val) {
|
|
2611
|
+
WriteStream = val;
|
|
2612
|
+
},
|
|
2613
|
+
enumerable: true,
|
|
2614
|
+
configurable: true
|
|
2615
|
+
});
|
|
2616
|
+
var FileReadStream = ReadStream;
|
|
2617
|
+
Object.defineProperty(fs4, "FileReadStream", {
|
|
2618
|
+
get: function() {
|
|
2619
|
+
return FileReadStream;
|
|
2620
|
+
},
|
|
2621
|
+
set: function(val) {
|
|
2622
|
+
FileReadStream = val;
|
|
2623
|
+
},
|
|
2624
|
+
enumerable: true,
|
|
2625
|
+
configurable: true
|
|
2626
|
+
});
|
|
2627
|
+
var FileWriteStream = WriteStream;
|
|
2628
|
+
Object.defineProperty(fs4, "FileWriteStream", {
|
|
2629
|
+
get: function() {
|
|
2630
|
+
return FileWriteStream;
|
|
2631
|
+
},
|
|
2632
|
+
set: function(val) {
|
|
2633
|
+
FileWriteStream = val;
|
|
2634
|
+
},
|
|
2635
|
+
enumerable: true,
|
|
2636
|
+
configurable: true
|
|
2637
|
+
});
|
|
2638
|
+
function ReadStream(path5, options) {
|
|
2639
|
+
if (this instanceof ReadStream)
|
|
2640
|
+
return fs$ReadStream.apply(this, arguments), this;
|
|
2641
|
+
else
|
|
2642
|
+
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
2643
|
+
}
|
|
2644
|
+
function ReadStream$open() {
|
|
2645
|
+
var that = this;
|
|
2646
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
2647
|
+
if (err) {
|
|
2648
|
+
if (that.autoClose)
|
|
2649
|
+
that.destroy();
|
|
2650
|
+
that.emit("error", err);
|
|
2651
|
+
} else {
|
|
2652
|
+
that.fd = fd;
|
|
2653
|
+
that.emit("open", fd);
|
|
2654
|
+
that.read();
|
|
2655
|
+
}
|
|
2656
|
+
});
|
|
2657
|
+
}
|
|
2658
|
+
function WriteStream(path5, options) {
|
|
2659
|
+
if (this instanceof WriteStream)
|
|
2660
|
+
return fs$WriteStream.apply(this, arguments), this;
|
|
2661
|
+
else
|
|
2662
|
+
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
2663
|
+
}
|
|
2664
|
+
function WriteStream$open() {
|
|
2665
|
+
var that = this;
|
|
2666
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
2667
|
+
if (err) {
|
|
2668
|
+
that.destroy();
|
|
2669
|
+
that.emit("error", err);
|
|
2670
|
+
} else {
|
|
2671
|
+
that.fd = fd;
|
|
2672
|
+
that.emit("open", fd);
|
|
2673
|
+
}
|
|
2674
|
+
});
|
|
2675
|
+
}
|
|
2676
|
+
function createReadStream(path5, options) {
|
|
2677
|
+
return new fs4.ReadStream(path5, options);
|
|
2678
|
+
}
|
|
2679
|
+
function createWriteStream(path5, options) {
|
|
2680
|
+
return new fs4.WriteStream(path5, options);
|
|
2681
|
+
}
|
|
2682
|
+
var fs$open = fs4.open;
|
|
2683
|
+
fs4.open = open;
|
|
2684
|
+
function open(path5, flags, mode, cb) {
|
|
2685
|
+
if (typeof mode === "function")
|
|
2686
|
+
cb = mode, mode = null;
|
|
2687
|
+
return go$open(path5, flags, mode, cb);
|
|
2688
|
+
function go$open(path6, flags2, mode2, cb2, startTime) {
|
|
2689
|
+
return fs$open(path6, flags2, mode2, function(err, fd) {
|
|
2690
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2691
|
+
enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2692
|
+
else {
|
|
2693
|
+
if (typeof cb2 === "function")
|
|
2694
|
+
cb2.apply(this, arguments);
|
|
2695
|
+
}
|
|
2696
|
+
});
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
return fs4;
|
|
2700
|
+
}
|
|
2701
|
+
function enqueue(elem) {
|
|
2702
|
+
debug4("ENQUEUE", elem[0].name, elem[1]);
|
|
2703
|
+
fs3[gracefulQueue].push(elem);
|
|
2704
|
+
retry();
|
|
2705
|
+
}
|
|
2706
|
+
var retryTimer;
|
|
2707
|
+
function resetQueue() {
|
|
2708
|
+
var now = Date.now();
|
|
2709
|
+
for (var i = 0; i < fs3[gracefulQueue].length; ++i) {
|
|
2710
|
+
if (fs3[gracefulQueue][i].length > 2) {
|
|
2711
|
+
fs3[gracefulQueue][i][3] = now;
|
|
2712
|
+
fs3[gracefulQueue][i][4] = now;
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
retry();
|
|
2716
|
+
}
|
|
2717
|
+
function retry() {
|
|
2718
|
+
clearTimeout(retryTimer);
|
|
2719
|
+
retryTimer = void 0;
|
|
2720
|
+
if (fs3[gracefulQueue].length === 0)
|
|
2721
|
+
return;
|
|
2722
|
+
var elem = fs3[gracefulQueue].shift();
|
|
2723
|
+
var fn = elem[0];
|
|
2724
|
+
var args = elem[1];
|
|
2725
|
+
var err = elem[2];
|
|
2726
|
+
var startTime = elem[3];
|
|
2727
|
+
var lastTime = elem[4];
|
|
2728
|
+
if (startTime === void 0) {
|
|
2729
|
+
debug4("RETRY", fn.name, args);
|
|
2730
|
+
fn.apply(null, args);
|
|
2731
|
+
} else if (Date.now() - startTime >= 6e4) {
|
|
2732
|
+
debug4("TIMEOUT", fn.name, args);
|
|
2733
|
+
var cb = args.pop();
|
|
2734
|
+
if (typeof cb === "function")
|
|
2735
|
+
cb.call(null, err);
|
|
2736
|
+
} else {
|
|
2737
|
+
var sinceAttempt = Date.now() - lastTime;
|
|
2738
|
+
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
2739
|
+
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
2740
|
+
if (sinceAttempt >= desiredDelay) {
|
|
2741
|
+
debug4("RETRY", fn.name, args);
|
|
2742
|
+
fn.apply(null, args.concat([startTime]));
|
|
2743
|
+
} else {
|
|
2744
|
+
fs3[gracefulQueue].push(elem);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
if (retryTimer === void 0) {
|
|
2748
|
+
retryTimer = setTimeout(retry, 0);
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
});
|
|
2753
|
+
|
|
1974
2754
|
// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
|
|
1975
2755
|
var require_utils2 = __commonJS({
|
|
1976
2756
|
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports2, module2) {
|
|
@@ -1994,7 +2774,7 @@ var require_jsonfile = __commonJS({
|
|
|
1994
2774
|
"use strict";
|
|
1995
2775
|
var _fs;
|
|
1996
2776
|
try {
|
|
1997
|
-
_fs =
|
|
2777
|
+
_fs = require_graceful_fs2();
|
|
1998
2778
|
} catch (_) {
|
|
1999
2779
|
_fs = require("fs");
|
|
2000
2780
|
}
|
|
@@ -3166,7 +3946,7 @@ var require_package2 = __commonJS({
|
|
|
3166
3946
|
"package.json"(exports2, module2) {
|
|
3167
3947
|
module2.exports = {
|
|
3168
3948
|
name: "@prisma/client",
|
|
3169
|
-
version: "6.3.0-integration-
|
|
3949
|
+
version: "6.3.0-integration-studio-ux-refinements.1",
|
|
3170
3950
|
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
3951
|
keywords: [
|
|
3172
3952
|
"ORM",
|
|
@@ -3290,7 +4070,7 @@ var require_package2 = __commonJS({
|
|
|
3290
4070
|
},
|
|
3291
4071
|
license: "Apache-2.0",
|
|
3292
4072
|
engines: {
|
|
3293
|
-
node: ">=
|
|
4073
|
+
node: ">=18.18"
|
|
3294
4074
|
},
|
|
3295
4075
|
homepage: "https://www.prisma.io",
|
|
3296
4076
|
repository: {
|
|
@@ -3342,19 +4122,19 @@ var require_package2 = __commonJS({
|
|
|
3342
4122
|
"@cloudflare/workers-types": "4.20240614.0",
|
|
3343
4123
|
"@codspeed/benchmark.js-plugin": "3.1.1",
|
|
3344
4124
|
"@faker-js/faker": "8.4.1",
|
|
3345
|
-
"@fast-check/jest": "
|
|
4125
|
+
"@fast-check/jest": "2.0.3",
|
|
3346
4126
|
"@inquirer/prompts": "5.0.5",
|
|
3347
4127
|
"@jest/create-cache-key-function": "29.7.0",
|
|
3348
4128
|
"@jest/globals": "29.7.0",
|
|
3349
4129
|
"@jest/test-sequencer": "29.7.0",
|
|
3350
4130
|
"@libsql/client": "0.8.0",
|
|
3351
|
-
"@neondatabase/serverless": "0.
|
|
4131
|
+
"@neondatabase/serverless": "0.10.2",
|
|
3352
4132
|
"@opentelemetry/api": "1.9.0",
|
|
3353
|
-
"@opentelemetry/context-async-hooks": "1.
|
|
3354
|
-
"@opentelemetry/instrumentation": "0.
|
|
3355
|
-
"@opentelemetry/resources": "1.
|
|
3356
|
-
"@opentelemetry/sdk-trace-base": "1.
|
|
3357
|
-
"@opentelemetry/semantic-conventions": "1.
|
|
4133
|
+
"@opentelemetry/context-async-hooks": "1.29.0",
|
|
4134
|
+
"@opentelemetry/instrumentation": "0.56.0",
|
|
4135
|
+
"@opentelemetry/resources": "1.29.0",
|
|
4136
|
+
"@opentelemetry/sdk-trace-base": "1.29.0",
|
|
4137
|
+
"@opentelemetry/semantic-conventions": "1.28.0",
|
|
3358
4138
|
"@planetscale/database": "1.18.0",
|
|
3359
4139
|
"@prisma/adapter-d1": "workspace:*",
|
|
3360
4140
|
"@prisma/adapter-libsql": "workspace:*",
|
|
@@ -3365,7 +4145,7 @@ var require_package2 = __commonJS({
|
|
|
3365
4145
|
"@prisma/debug": "workspace:*",
|
|
3366
4146
|
"@prisma/driver-adapter-utils": "workspace:*",
|
|
3367
4147
|
"@prisma/engines": "workspace:*",
|
|
3368
|
-
"@prisma/engines-version": "6.3.0-
|
|
4148
|
+
"@prisma/engines-version": "6.3.0-13.1635fdddbcd54b9f4b16ffcd9eb726b58d5408da",
|
|
3369
4149
|
"@prisma/fetch-engine": "workspace:*",
|
|
3370
4150
|
"@prisma/generator-helper": "workspace:*",
|
|
3371
4151
|
"@prisma/get-platform": "workspace:*",
|
|
@@ -3374,15 +4154,15 @@ var require_package2 = __commonJS({
|
|
|
3374
4154
|
"@prisma/migrate": "workspace:*",
|
|
3375
4155
|
"@prisma/mini-proxy": "0.9.5",
|
|
3376
4156
|
"@prisma/pg-worker": "workspace:*",
|
|
3377
|
-
"@prisma/query-engine-wasm": "6.3.0-
|
|
4157
|
+
"@prisma/query-engine-wasm": "6.3.0-13.1635fdddbcd54b9f4b16ffcd9eb726b58d5408da",
|
|
3378
4158
|
"@snaplet/copycat": "0.17.3",
|
|
3379
4159
|
"@swc-node/register": "1.10.9",
|
|
3380
|
-
"@swc/core": "1.
|
|
3381
|
-
"@swc/jest": "0.2.
|
|
4160
|
+
"@swc/core": "1.10.1",
|
|
4161
|
+
"@swc/jest": "0.2.37",
|
|
3382
4162
|
"@timsuchanek/copy": "1.4.5",
|
|
3383
4163
|
"@types/debug": "4.1.12",
|
|
3384
4164
|
"@types/fs-extra": "9.0.13",
|
|
3385
|
-
"@types/jest": "29.5.
|
|
4165
|
+
"@types/jest": "29.5.14",
|
|
3386
4166
|
"@types/js-levenshtein": "1.1.3",
|
|
3387
4167
|
"@types/mssql": "9.1.5",
|
|
3388
4168
|
"@types/node": "18.19.31",
|
|
@@ -3393,7 +4173,7 @@ var require_package2 = __commonJS({
|
|
|
3393
4173
|
"decimal.js": "10.4.3",
|
|
3394
4174
|
"detect-runtime": "1.0.4",
|
|
3395
4175
|
"env-paths": "2.2.1",
|
|
3396
|
-
esbuild: "0.
|
|
4176
|
+
esbuild: "0.24.2",
|
|
3397
4177
|
execa: "5.1.1",
|
|
3398
4178
|
"expect-type": "0.19.0",
|
|
3399
4179
|
"flat-map-polyfill": "0.3.8",
|
|
@@ -3404,13 +4184,13 @@ var require_package2 = __commonJS({
|
|
|
3404
4184
|
jest: "29.7.0",
|
|
3405
4185
|
"jest-extended": "4.0.2",
|
|
3406
4186
|
"jest-junit": "16.0.0",
|
|
3407
|
-
"jest-serializer-ansi-escapes": "
|
|
4187
|
+
"jest-serializer-ansi-escapes": "4.0.0",
|
|
3408
4188
|
"jest-snapshot": "29.7.0",
|
|
3409
4189
|
"js-levenshtein": "1.1.6",
|
|
3410
4190
|
kleur: "4.1.5",
|
|
3411
4191
|
klona: "2.0.6",
|
|
3412
4192
|
mariadb: "3.3.1",
|
|
3413
|
-
memfs: "4.
|
|
4193
|
+
memfs: "4.15.0",
|
|
3414
4194
|
mssql: "11.0.1",
|
|
3415
4195
|
"new-github-issue-url": "0.2.1",
|
|
3416
4196
|
"node-fetch": "3.3.2",
|
|
@@ -3420,7 +4200,7 @@ var require_package2 = __commonJS({
|
|
|
3420
4200
|
pluralize: "8.0.0",
|
|
3421
4201
|
resolve: "1.22.8",
|
|
3422
4202
|
rimraf: "3.0.2",
|
|
3423
|
-
"simple-statistics": "7.8.
|
|
4203
|
+
"simple-statistics": "7.8.7",
|
|
3424
4204
|
"sort-keys": "4.2.0",
|
|
3425
4205
|
"source-map-support": "0.5.21",
|
|
3426
4206
|
"sql-template-tag": "5.2.1",
|
|
@@ -3428,11 +4208,11 @@ var require_package2 = __commonJS({
|
|
|
3428
4208
|
"strip-ansi": "6.0.1",
|
|
3429
4209
|
"strip-indent": "3.0.0",
|
|
3430
4210
|
"ts-node": "10.9.2",
|
|
3431
|
-
"ts-pattern": "5.
|
|
3432
|
-
tsd: "0.31.
|
|
4211
|
+
"ts-pattern": "5.6.0",
|
|
4212
|
+
tsd: "0.31.2",
|
|
3433
4213
|
typescript: "5.4.5",
|
|
3434
|
-
undici: "
|
|
3435
|
-
wrangler: "3.
|
|
4214
|
+
undici: "7.2.1",
|
|
4215
|
+
wrangler: "3.91.0",
|
|
3436
4216
|
zx: "7.2.3"
|
|
3437
4217
|
},
|
|
3438
4218
|
peerDependencies: {
|
|
@@ -4255,6 +5035,12 @@ var src_default = Debug;
|
|
|
4255
5035
|
var import_engines_version = __toESM(require_engines_version());
|
|
4256
5036
|
|
|
4257
5037
|
// ../generator-helper/src/dmmf.ts
|
|
5038
|
+
function datamodelEnumToSchemaEnum(datamodelEnum) {
|
|
5039
|
+
return {
|
|
5040
|
+
name: datamodelEnum.name,
|
|
5041
|
+
values: datamodelEnum.values.map((v) => v.name)
|
|
5042
|
+
};
|
|
5043
|
+
}
|
|
4258
5044
|
var DMMF;
|
|
4259
5045
|
((DMMF2) => {
|
|
4260
5046
|
let ModelAction;
|
|
@@ -4269,6 +5055,7 @@ var DMMF;
|
|
|
4269
5055
|
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
|
4270
5056
|
ModelAction2["update"] = "update";
|
|
4271
5057
|
ModelAction2["updateMany"] = "updateMany";
|
|
5058
|
+
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
|
4272
5059
|
ModelAction2["upsert"] = "upsert";
|
|
4273
5060
|
ModelAction2["delete"] = "delete";
|
|
4274
5061
|
ModelAction2["deleteMany"] = "deleteMany";
|
|
@@ -4454,7 +5241,7 @@ function getNodeAPIName(binaryTarget, type) {
|
|
|
4454
5241
|
}
|
|
4455
5242
|
|
|
4456
5243
|
// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js
|
|
4457
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
5244
|
+
var import_node_process = __toESM(require("node:process"), 1);
|
|
4458
5245
|
var import_common_path_prefix = __toESM(require_common_path_prefix(), 1);
|
|
4459
5246
|
|
|
4460
5247
|
// ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
|
|
@@ -4609,7 +5396,7 @@ var GraphQLScalarToJSTypeTable = {
|
|
|
4609
5396
|
ID: "string",
|
|
4610
5397
|
UUID: "string",
|
|
4611
5398
|
Json: "JsonValue",
|
|
4612
|
-
Bytes: "
|
|
5399
|
+
Bytes: "Uint8Array",
|
|
4613
5400
|
Decimal: ["Decimal", "DecimalJsLike", "number", "string"],
|
|
4614
5401
|
BigInt: ["bigint", "number"]
|
|
4615
5402
|
};
|
|
@@ -4653,6 +5440,7 @@ function getMappings(mappings, datamodel) {
|
|
|
4653
5440
|
update: mapping.updateOne || mapping.updateSingle || mapping.update,
|
|
4654
5441
|
deleteMany: mapping.deleteMany,
|
|
4655
5442
|
updateMany: mapping.updateMany,
|
|
5443
|
+
updateManyAndReturn: mapping.updateManyAndReturn,
|
|
4656
5444
|
upsert: mapping.upsertOne || mapping.upsertSingle || mapping.upsert,
|
|
4657
5445
|
aggregate: mapping.aggregate,
|
|
4658
5446
|
groupBy: mapping.groupBy,
|
|
@@ -5803,15 +6591,24 @@ function getSelectName(modelName) {
|
|
|
5803
6591
|
function getSelectCreateManyAndReturnName(modelName) {
|
|
5804
6592
|
return `${modelName}SelectCreateManyAndReturn`;
|
|
5805
6593
|
}
|
|
6594
|
+
function getSelectUpdateManyAndReturnName(modelName) {
|
|
6595
|
+
return `${modelName}SelectUpdateManyAndReturn`;
|
|
6596
|
+
}
|
|
5806
6597
|
function getIncludeName(modelName) {
|
|
5807
6598
|
return `${modelName}Include`;
|
|
5808
6599
|
}
|
|
5809
6600
|
function getIncludeCreateManyAndReturnName(modelName) {
|
|
5810
6601
|
return `${modelName}IncludeCreateManyAndReturn`;
|
|
5811
6602
|
}
|
|
6603
|
+
function getIncludeUpdateManyAndReturnName(modelName) {
|
|
6604
|
+
return `${modelName}IncludeUpdateManyAndReturn`;
|
|
6605
|
+
}
|
|
5812
6606
|
function getCreateManyAndReturnOutputType(modelName) {
|
|
5813
6607
|
return `CreateMany${modelName}AndReturnOutputType`;
|
|
5814
6608
|
}
|
|
6609
|
+
function getUpdateManyAndReturnOutputType(modelName) {
|
|
6610
|
+
return `UpdateMany${modelName}AndReturnOutputType`;
|
|
6611
|
+
}
|
|
5815
6612
|
function getOmitName(modelName) {
|
|
5816
6613
|
return `${modelName}Omit`;
|
|
5817
6614
|
}
|
|
@@ -5863,9 +6660,6 @@ function getFieldArgName(field, modelName) {
|
|
|
5863
6660
|
function getModelFieldArgsName(field, modelName) {
|
|
5864
6661
|
return `${modelName}$${field.name}Args`;
|
|
5865
6662
|
}
|
|
5866
|
-
function getLegacyModelArgName(modelName) {
|
|
5867
|
-
return `${modelName}Args`;
|
|
5868
|
-
}
|
|
5869
6663
|
function getModelArgName(modelName, action) {
|
|
5870
6664
|
if (!action) {
|
|
5871
6665
|
return `${modelName}DefaultArgs`;
|
|
@@ -5887,6 +6681,8 @@ function getModelArgName(modelName, action) {
|
|
|
5887
6681
|
return `${modelName}UpdateArgs`;
|
|
5888
6682
|
case DMMF.ModelAction.updateMany:
|
|
5889
6683
|
return `${modelName}UpdateManyArgs`;
|
|
6684
|
+
case DMMF.ModelAction.updateManyAndReturn:
|
|
6685
|
+
return `${modelName}UpdateManyAndReturnArgs`;
|
|
5890
6686
|
case DMMF.ModelAction.delete:
|
|
5891
6687
|
return `${modelName}DeleteArgs`;
|
|
5892
6688
|
case DMMF.ModelAction.create:
|
|
@@ -6218,7 +7014,7 @@ const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
|
|
|
6218
7014
|
body: (ctx) => {
|
|
6219
7015
|
const onlySelect = ctx.firstScalar ? `
|
|
6220
7016
|
// Create many ${ctx.plural} and only return the \`${ctx.firstScalar.name}\`
|
|
6221
|
-
const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({
|
|
7017
|
+
const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({
|
|
6222
7018
|
select: { ${ctx.firstScalar.name}: true },
|
|
6223
7019
|
data: [
|
|
6224
7020
|
// ... provide data here
|
|
@@ -6256,7 +7052,7 @@ const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
|
|
|
6256
7052
|
}
|
|
6257
7053
|
},
|
|
6258
7054
|
findUniqueOrThrow: {
|
|
6259
|
-
body: (ctx) => `Find one ${ctx.singular} that matches the filter or throw an error with \`error.code='P2025'\`
|
|
7055
|
+
body: (ctx) => `Find one ${ctx.singular} that matches the filter or throw an error with \`error.code='P2025'\`
|
|
6260
7056
|
if no matches were found.
|
|
6261
7057
|
@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular}
|
|
6262
7058
|
@example
|
|
@@ -6465,7 +7261,43 @@ const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
|
|
|
6465
7261
|
`,
|
|
6466
7262
|
fields: {
|
|
6467
7263
|
data: (singular, plural) => `The data used to update ${plural}.`,
|
|
6468
|
-
where: (singular, plural) => `Filter which ${plural} to update
|
|
7264
|
+
where: (singular, plural) => `Filter which ${plural} to update`,
|
|
7265
|
+
limit: (singular, plural) => `Limit how many ${plural} to update.`
|
|
7266
|
+
}
|
|
7267
|
+
},
|
|
7268
|
+
updateManyAndReturn: {
|
|
7269
|
+
body: (ctx) => {
|
|
7270
|
+
const onlySelect = ctx.firstScalar ? `
|
|
7271
|
+
// Update zero or more ${ctx.plural} and only return the \`${ctx.firstScalar.name}\`
|
|
7272
|
+
const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({
|
|
7273
|
+
select: { ${ctx.firstScalar.name}: true },
|
|
7274
|
+
where: {
|
|
7275
|
+
// ... provide filter here
|
|
7276
|
+
},
|
|
7277
|
+
data: [
|
|
7278
|
+
// ... provide data here
|
|
7279
|
+
]
|
|
7280
|
+
})` : "";
|
|
7281
|
+
return `Update zero or more ${ctx.plural} and returns the data updated in the database.
|
|
7282
|
+
@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update many ${ctx.plural}.
|
|
7283
|
+
@example
|
|
7284
|
+
// Update many ${ctx.plural}
|
|
7285
|
+
const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
|
|
7286
|
+
where: {
|
|
7287
|
+
// ... provide filter here
|
|
7288
|
+
},
|
|
7289
|
+
data: [
|
|
7290
|
+
// ... provide data here
|
|
7291
|
+
]
|
|
7292
|
+
})
|
|
7293
|
+
${onlySelect}
|
|
7294
|
+
${undefinedNote}
|
|
7295
|
+
`;
|
|
7296
|
+
},
|
|
7297
|
+
fields: {
|
|
7298
|
+
data: (singular, plural) => `The data used to update ${plural}.`,
|
|
7299
|
+
where: (singular, plural) => `Filter which ${plural} to update`,
|
|
7300
|
+
limit: (singular, plural) => `Limit how many ${plural} to update.`
|
|
6469
7301
|
}
|
|
6470
7302
|
},
|
|
6471
7303
|
deleteMany: {
|
|
@@ -6480,7 +7312,8 @@ const { count } = await ${ctx.method}({
|
|
|
6480
7312
|
})
|
|
6481
7313
|
`,
|
|
6482
7314
|
fields: {
|
|
6483
|
-
where: (singular, plural) => `Filter which ${plural} to delete
|
|
7315
|
+
where: (singular, plural) => `Filter which ${plural} to delete`,
|
|
7316
|
+
limit: (singular, plural) => `Limit how many ${plural} to delete.`
|
|
6484
7317
|
}
|
|
6485
7318
|
},
|
|
6486
7319
|
aggregateRaw: {
|
|
@@ -6503,7 +7336,7 @@ const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
|
|
|
6503
7336
|
@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Select which filters you would like to apply.
|
|
6504
7337
|
@example
|
|
6505
7338
|
const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({
|
|
6506
|
-
filter: { age: { $gt: 25 } }
|
|
7339
|
+
filter: { age: { $gt: 25 } }
|
|
6507
7340
|
})`,
|
|
6508
7341
|
fields: {
|
|
6509
7342
|
filter: () => "The query predicate filter. If unspecified, then all documents in the collection will match the predicate. ${@link https://docs.mongodb.com/manual/reference/operator/query MongoDB Docs}.",
|
|
@@ -6597,9 +7430,6 @@ var ArgsTypeBuilder = class {
|
|
|
6597
7430
|
return this;
|
|
6598
7431
|
}
|
|
6599
7432
|
addOmitArg() {
|
|
6600
|
-
if (!this.context.isPreviewFeatureOn("omitApi")) {
|
|
6601
|
-
return this;
|
|
6602
|
-
}
|
|
6603
7433
|
this.addProperty(
|
|
6604
7434
|
property(
|
|
6605
7435
|
"omit",
|
|
@@ -6621,13 +7451,6 @@ var ArgsTypeBuilder = class {
|
|
|
6621
7451
|
return this;
|
|
6622
7452
|
}
|
|
6623
7453
|
createExport() {
|
|
6624
|
-
if (!this.action && this.hasDefaultName) {
|
|
6625
|
-
this.context.defaultArgsAliases.addPossibleAlias(
|
|
6626
|
-
getModelArgName(this.type.name),
|
|
6627
|
-
getLegacyModelArgName(this.type.name)
|
|
6628
|
-
);
|
|
6629
|
-
}
|
|
6630
|
-
this.context.defaultArgsAliases.registerArgName(this.moduleExport.declaration.name);
|
|
6631
7454
|
return this.moduleExport;
|
|
6632
7455
|
}
|
|
6633
7456
|
};
|
|
@@ -6838,6 +7661,7 @@ var Model = class {
|
|
|
6838
7661
|
this.dmmf = context.dmmf;
|
|
6839
7662
|
this.type = this.context.dmmf.outputTypeMap.model[model.name];
|
|
6840
7663
|
this.createManyAndReturnType = this.context.dmmf.outputTypeMap.model[getCreateManyAndReturnOutputType(model.name)];
|
|
7664
|
+
this.updateManyAndReturnType = this.context.dmmf.outputTypeMap.model[getUpdateManyAndReturnOutputType(model.name)];
|
|
6841
7665
|
this.mapping = this.context.dmmf.mappings.modelOperations.find((m) => m.model === model.name);
|
|
6842
7666
|
}
|
|
6843
7667
|
get argsTypes() {
|
|
@@ -6864,6 +7688,15 @@ var Model = class {
|
|
|
6864
7688
|
);
|
|
6865
7689
|
}
|
|
6866
7690
|
argsTypes.push(args.createExport());
|
|
7691
|
+
} else if (action === "updateManyAndReturn") {
|
|
7692
|
+
const args = new ArgsTypeBuilder(this.type, this.context, action).addSelectArg(getSelectUpdateManyAndReturnName(this.type.name)).addOmitArg().addSchemaArgs(field.args);
|
|
7693
|
+
if (this.updateManyAndReturnType) {
|
|
7694
|
+
args.addIncludeArgIfHasRelations(
|
|
7695
|
+
getIncludeUpdateManyAndReturnName(this.model.name),
|
|
7696
|
+
this.updateManyAndReturnType
|
|
7697
|
+
);
|
|
7698
|
+
}
|
|
7699
|
+
argsTypes.push(args.createExport());
|
|
6867
7700
|
} else if (action !== "groupBy" && action !== "aggregate") {
|
|
6868
7701
|
argsTypes.push(
|
|
6869
7702
|
new ArgsTypeBuilder(this.type, this.context, action).addSelectArg().addOmitArg().addIncludeArgIfHasRelations().addSchemaArgs(field.args).createExport()
|
|
@@ -6901,7 +7734,6 @@ var Model = class {
|
|
|
6901
7734
|
throw new Error(`Could not find groupBy root field for model ${model.name}. Mapping: ${mapping?.groupBy}`);
|
|
6902
7735
|
}
|
|
6903
7736
|
const groupByArgsName = getGroupByArgsName(model.name);
|
|
6904
|
-
this.context.defaultArgsAliases.registerArgName(groupByArgsName);
|
|
6905
7737
|
return `
|
|
6906
7738
|
|
|
6907
7739
|
|
|
@@ -6971,7 +7803,6 @@ type ${getGroupByPayloadName(model.name)}<T extends ${groupByArgsName}> = Prisma
|
|
|
6971
7803
|
aggregateTypes.push(countType);
|
|
6972
7804
|
}
|
|
6973
7805
|
const aggregateArgsName = getAggregateArgsName(model.name);
|
|
6974
|
-
this.context.defaultArgsAliases.registerArgName(aggregateArgsName);
|
|
6975
7806
|
const aggregateName = getAggregateName(model.name);
|
|
6976
7807
|
return `${aggregateTypes.map(buildOutputType).map((type) => stringify(type)).join("\n\n")}
|
|
6977
7808
|
|
|
@@ -7046,9 +7877,12 @@ export type ${getAggregateGetName(model.name)}<T extends ${getAggregateArgsName(
|
|
|
7046
7877
|
toTS() {
|
|
7047
7878
|
const { model } = this;
|
|
7048
7879
|
const isComposite = this.dmmf.isComposite(model.name);
|
|
7049
|
-
const omitType =
|
|
7050
|
-
|
|
7051
|
-
|
|
7880
|
+
const omitType = stringify(
|
|
7881
|
+
buildOmitType({ modelName: this.model.name, context: this.context, fields: this.type.fields }),
|
|
7882
|
+
{
|
|
7883
|
+
newLine: "leading"
|
|
7884
|
+
}
|
|
7885
|
+
);
|
|
7052
7886
|
const hasRelationField = model.fields.some((f) => f.kind === "object");
|
|
7053
7887
|
const includeType = hasRelationField ? stringify(
|
|
7054
7888
|
buildIncludeType({ modelName: this.model.name, context: this.context, fields: this.type.fields }),
|
|
@@ -7067,6 +7901,17 @@ export type ${getAggregateGetName(model.name)}<T extends ${getAggregateArgsName(
|
|
|
7067
7901
|
newLine: "leading"
|
|
7068
7902
|
}
|
|
7069
7903
|
) : "";
|
|
7904
|
+
const updateManyAndReturnIncludeType = hasRelationField && this.updateManyAndReturnType ? stringify(
|
|
7905
|
+
buildIncludeType({
|
|
7906
|
+
typeName: getIncludeUpdateManyAndReturnName(this.model.name),
|
|
7907
|
+
modelName: this.model.name,
|
|
7908
|
+
context: this.context,
|
|
7909
|
+
fields: this.updateManyAndReturnType.fields
|
|
7910
|
+
}),
|
|
7911
|
+
{
|
|
7912
|
+
newLine: "leading"
|
|
7913
|
+
}
|
|
7914
|
+
) : "";
|
|
7070
7915
|
return `
|
|
7071
7916
|
/**
|
|
7072
7917
|
* Model ${model.name}
|
|
@@ -7086,10 +7931,19 @@ ${this.createManyAndReturnType ? stringify(
|
|
|
7086
7931
|
}),
|
|
7087
7932
|
{ newLine: "leading" }
|
|
7088
7933
|
) : ""}
|
|
7934
|
+
${this.updateManyAndReturnType ? stringify(
|
|
7935
|
+
buildSelectType({
|
|
7936
|
+
modelName: this.model.name,
|
|
7937
|
+
fields: this.updateManyAndReturnType.fields,
|
|
7938
|
+
context: this.context,
|
|
7939
|
+
typeName: getSelectUpdateManyAndReturnName(this.model.name)
|
|
7940
|
+
}),
|
|
7941
|
+
{ newLine: "leading" }
|
|
7942
|
+
) : ""}
|
|
7089
7943
|
${stringify(buildScalarSelectType({ modelName: this.model.name, fields: this.type.fields, context: this.context }), {
|
|
7090
7944
|
newLine: "leading"
|
|
7091
7945
|
})}
|
|
7092
|
-
${omitType}${includeType}${createManyAndReturnIncludeType}
|
|
7946
|
+
${omitType}${includeType}${createManyAndReturnIncludeType}${updateManyAndReturnIncludeType}
|
|
7093
7947
|
|
|
7094
7948
|
${stringify(buildModelPayload(this.model, this.context), { newLine: "none" })}
|
|
7095
7949
|
|
|
@@ -7133,18 +7987,13 @@ var ModelDelegate = class {
|
|
|
7133
7987
|
const nonAggregateActions = this.getNonAggregateActions(availableActions);
|
|
7134
7988
|
const groupByArgsName = getGroupByArgsName(name);
|
|
7135
7989
|
const countArgsName = getModelArgName(name, DMMF.ModelAction.count);
|
|
7136
|
-
|
|
7137
|
-
const
|
|
7138
|
-
const excludedArgsForCount = ["select", "include", "distinct"];
|
|
7139
|
-
if (this.context.isPreviewFeatureOn("omitApi")) {
|
|
7140
|
-
excludedArgsForCount.push("omit");
|
|
7141
|
-
genericDelegateParams.push(genericParameter("ClientOptions").default(objectType()));
|
|
7142
|
-
}
|
|
7990
|
+
const genericDelegateParams = [extArgsParam, genericParameter("ClientOptions").default(objectType())];
|
|
7991
|
+
const excludedArgsForCount = ["select", "include", "distinct", "omit"];
|
|
7143
7992
|
if (this.context.isPreviewFeatureOn("relationJoins")) {
|
|
7144
7993
|
excludedArgsForCount.push("relationLoadStrategy");
|
|
7145
7994
|
}
|
|
7146
7995
|
const excludedArgsForCountType = excludedArgsForCount.map((name2) => `'${name2}'`).join(" | ");
|
|
7147
|
-
return `${availableActions.includes(DMMF.ModelAction.aggregate) ? `type ${countArgsName}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
|
|
7996
|
+
return `${availableActions.includes(DMMF.ModelAction.aggregate) ? `type ${countArgsName}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
|
|
7148
7997
|
Omit<${getModelArgName(name, DMMF.ModelAction.findMany)}, ${excludedArgsForCountType}> & {
|
|
7149
7998
|
select?: ${getCountAggregateInputName(name)} | true
|
|
7150
7999
|
}
|
|
@@ -7246,7 +8095,7 @@ ${stringify(buildFluentWrapperDefinition(name, this.outputType, this.context))}
|
|
|
7246
8095
|
function buildModelDelegateMethod(modelName, actionName, context) {
|
|
7247
8096
|
const mapping = context.dmmf.mappingsMap[modelName] ?? { model: modelName, plural: `${modelName}s` };
|
|
7248
8097
|
const modelOrType = context.dmmf.typeAndModelMap[modelName];
|
|
7249
|
-
const method2 = method(actionName).setDocComment(docComment(getMethodJSDocBody(actionName, mapping, modelOrType))).addParameter(getNonAggregateMethodArgs(modelName, actionName)).setReturnType(getReturnType({ modelName, actionName
|
|
8098
|
+
const method2 = method(actionName).setDocComment(docComment(getMethodJSDocBody(actionName, mapping, modelOrType))).addParameter(getNonAggregateMethodArgs(modelName, actionName)).setReturnType(getReturnType({ modelName, actionName }));
|
|
7250
8099
|
const generic = getNonAggregateMethodGenericParam(modelName, actionName);
|
|
7251
8100
|
if (generic) {
|
|
7252
8101
|
method2.addGenericParameter(generic);
|
|
@@ -7254,7 +8103,6 @@ function buildModelDelegateMethod(modelName, actionName, context) {
|
|
|
7254
8103
|
return method2;
|
|
7255
8104
|
}
|
|
7256
8105
|
function getNonAggregateMethodArgs(modelName, actionName) {
|
|
7257
|
-
getReturnType;
|
|
7258
8106
|
const makeParameter = (type2) => parameter("args", type2);
|
|
7259
8107
|
if (actionName === DMMF.ModelAction.count) {
|
|
7260
8108
|
const type2 = omit(
|
|
@@ -7288,7 +8136,6 @@ function getNonAggregateMethodGenericParam(modelName, actionName) {
|
|
|
7288
8136
|
function getReturnType({
|
|
7289
8137
|
modelName,
|
|
7290
8138
|
actionName,
|
|
7291
|
-
context,
|
|
7292
8139
|
isChaining = false,
|
|
7293
8140
|
isNullable = false
|
|
7294
8141
|
}) {
|
|
@@ -7304,9 +8151,9 @@ function getReturnType({
|
|
|
7304
8151
|
if (actionName === DMMF.ModelAction.deleteMany || actionName === DMMF.ModelAction.updateMany || actionName === DMMF.ModelAction.createMany) {
|
|
7305
8152
|
return prismaPromise(namedType("BatchPayload"));
|
|
7306
8153
|
}
|
|
7307
|
-
const isList = actionName === DMMF.ModelAction.findMany || actionName === DMMF.ModelAction.createManyAndReturn;
|
|
8154
|
+
const isList = actionName === DMMF.ModelAction.findMany || actionName === DMMF.ModelAction.createManyAndReturn || actionName === DMMF.ModelAction.updateManyAndReturn;
|
|
7308
8155
|
if (isList) {
|
|
7309
|
-
let result = getResultType(modelName, actionName
|
|
8156
|
+
let result = getResultType(modelName, actionName);
|
|
7310
8157
|
if (isChaining) {
|
|
7311
8158
|
result = unionType(result).addVariant(namedType("Null"));
|
|
7312
8159
|
}
|
|
@@ -7314,35 +8161,24 @@ function getReturnType({
|
|
|
7314
8161
|
}
|
|
7315
8162
|
if (isChaining && actionName === DMMF.ModelAction.findUniqueOrThrow) {
|
|
7316
8163
|
const nullType2 = isNullable ? nullType : namedType("Null");
|
|
7317
|
-
const result = unionType(getResultType(modelName, actionName
|
|
7318
|
-
return getFluentWrapper(modelName,
|
|
8164
|
+
const result = unionType(getResultType(modelName, actionName)).addVariant(nullType2);
|
|
8165
|
+
return getFluentWrapper(modelName, result, nullType2);
|
|
7319
8166
|
}
|
|
7320
8167
|
if (actionName === DMMF.ModelAction.findFirst || actionName === DMMF.ModelAction.findUnique) {
|
|
7321
|
-
const result = unionType(getResultType(modelName, actionName
|
|
7322
|
-
return getFluentWrapper(modelName,
|
|
8168
|
+
const result = unionType(getResultType(modelName, actionName)).addVariant(nullType);
|
|
8169
|
+
return getFluentWrapper(modelName, result, nullType);
|
|
7323
8170
|
}
|
|
7324
|
-
return getFluentWrapper(modelName,
|
|
8171
|
+
return getFluentWrapper(modelName, getResultType(modelName, actionName));
|
|
7325
8172
|
}
|
|
7326
|
-
function getFluentWrapper(modelName,
|
|
7327
|
-
|
|
7328
|
-
if (context.isPreviewFeatureOn("omitApi")) {
|
|
7329
|
-
result.addGenericArgument(namedType("ClientOptions"));
|
|
7330
|
-
}
|
|
7331
|
-
return result;
|
|
8173
|
+
function getFluentWrapper(modelName, resultType, nullType2 = neverType) {
|
|
8174
|
+
return namedType(fluentWrapperName(modelName)).addGenericArgument(resultType).addGenericArgument(nullType2).addGenericArgument(extArgsParam.toArgument()).addGenericArgument(namedType("ClientOptions"));
|
|
7332
8175
|
}
|
|
7333
|
-
function getResultType(modelName, actionName
|
|
7334
|
-
|
|
7335
|
-
if (context.isPreviewFeatureOn("omitApi")) {
|
|
7336
|
-
result.addGenericArgument(namedType("ClientOptions"));
|
|
7337
|
-
}
|
|
7338
|
-
return result;
|
|
8176
|
+
function getResultType(modelName, actionName) {
|
|
8177
|
+
return namedType("$Result.GetResult").addGenericArgument(namedType(getPayloadName(modelName)).addGenericArgument(extArgsParam.toArgument())).addGenericArgument(namedType("T")).addGenericArgument(stringLiteral(actionName)).addGenericArgument(namedType("ClientOptions"));
|
|
7339
8178
|
}
|
|
7340
8179
|
function buildFluentWrapperDefinition(modelName, outputType, context) {
|
|
7341
8180
|
const definition = interfaceDeclaration(fluentWrapperName(modelName));
|
|
7342
|
-
definition.addGenericParameter(genericParameter("T")).addGenericParameter(genericParameter("Null").default(neverType)).addGenericParameter(extArgsParam).extends(prismaPromise(namedType("T")));
|
|
7343
|
-
if (context.isPreviewFeatureOn("omitApi")) {
|
|
7344
|
-
definition.addGenericParameter(genericParameter("ClientOptions").default(objectType()));
|
|
7345
|
-
}
|
|
8181
|
+
definition.addGenericParameter(genericParameter("T")).addGenericParameter(genericParameter("Null").default(neverType)).addGenericParameter(extArgsParam).addGenericParameter(genericParameter("ClientOptions").default(objectType())).extends(prismaPromise(namedType("T")));
|
|
7346
8182
|
definition.add(property(toStringTag, stringLiteral("PrismaPromise")).readonly());
|
|
7347
8183
|
definition.addMultiple(
|
|
7348
8184
|
outputType.fields.filter(
|
|
@@ -7355,7 +8191,6 @@ function buildFluentWrapperDefinition(modelName, outputType, context) {
|
|
|
7355
8191
|
modelName: field.outputType.type,
|
|
7356
8192
|
actionName: field.outputType.isList ? DMMF.ModelAction.findMany : DMMF.ModelAction.findUniqueOrThrow,
|
|
7357
8193
|
isChaining: true,
|
|
7358
|
-
context,
|
|
7359
8194
|
isNullable: field.isNullable
|
|
7360
8195
|
})
|
|
7361
8196
|
);
|
|
@@ -7875,7 +8710,6 @@ import {
|
|
|
7875
8710
|
PrismaClientRustPanicError,
|
|
7876
8711
|
PrismaClientInitializationError,
|
|
7877
8712
|
PrismaClientValidationError,
|
|
7878
|
-
NotFoundError,
|
|
7879
8713
|
getPrismaClient,
|
|
7880
8714
|
sqltag,
|
|
7881
8715
|
empty,
|
|
@@ -7906,7 +8740,6 @@ const {
|
|
|
7906
8740
|
PrismaClientRustPanicError,
|
|
7907
8741
|
PrismaClientInitializationError,
|
|
7908
8742
|
PrismaClientValidationError,
|
|
7909
|
-
NotFoundError,
|
|
7910
8743
|
getPrismaClient,
|
|
7911
8744
|
sqltag,
|
|
7912
8745
|
empty,
|
|
@@ -7944,7 +8777,6 @@ Prisma.PrismaClientUnknownRequestError = ${notSupportOnBrowser("PrismaClientUnkn
|
|
|
7944
8777
|
Prisma.PrismaClientRustPanicError = ${notSupportOnBrowser("PrismaClientRustPanicError", browser)}
|
|
7945
8778
|
Prisma.PrismaClientInitializationError = ${notSupportOnBrowser("PrismaClientInitializationError", browser)}
|
|
7946
8779
|
Prisma.PrismaClientValidationError = ${notSupportOnBrowser("PrismaClientValidationError", browser)}
|
|
7947
|
-
Prisma.NotFoundError = ${notSupportOnBrowser("NotFoundError", browser)}
|
|
7948
8780
|
Prisma.Decimal = Decimal
|
|
7949
8781
|
|
|
7950
8782
|
/**
|
|
@@ -8020,7 +8852,6 @@ export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownReque
|
|
|
8020
8852
|
export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError
|
|
8021
8853
|
export import PrismaClientInitializationError = runtime.PrismaClientInitializationError
|
|
8022
8854
|
export import PrismaClientValidationError = runtime.PrismaClientValidationError
|
|
8023
|
-
export import NotFoundError = runtime.NotFoundError
|
|
8024
8855
|
|
|
8025
8856
|
/**
|
|
8026
8857
|
* Re-export of sql-template-tag
|
|
@@ -8502,37 +9333,6 @@ function getCountArgsType(typeName, fieldName) {
|
|
|
8502
9333
|
return `${typeName}Count${capitalize2(fieldName)}Args`;
|
|
8503
9334
|
}
|
|
8504
9335
|
|
|
8505
|
-
// src/generation/TSClient/DefaultArgsAliases.ts
|
|
8506
|
-
var DefaultArgsAliases = class {
|
|
8507
|
-
constructor() {
|
|
8508
|
-
this.existingArgTypes = /* @__PURE__ */ new Set();
|
|
8509
|
-
this.possibleAliases = [];
|
|
8510
|
-
}
|
|
8511
|
-
addPossibleAlias(newName, legacyName) {
|
|
8512
|
-
this.possibleAliases.push({ newName, legacyName });
|
|
8513
|
-
}
|
|
8514
|
-
registerArgName(name) {
|
|
8515
|
-
this.existingArgTypes.add(name);
|
|
8516
|
-
}
|
|
8517
|
-
generateAliases() {
|
|
8518
|
-
const aliases = [];
|
|
8519
|
-
for (const { newName, legacyName } of this.possibleAliases) {
|
|
8520
|
-
if (this.existingArgTypes.has(legacyName)) {
|
|
8521
|
-
continue;
|
|
8522
|
-
}
|
|
8523
|
-
aliases.push(
|
|
8524
|
-
stringify(
|
|
8525
|
-
moduleExport(
|
|
8526
|
-
typeDeclaration(legacyName, namedType(newName).addGenericArgument(extArgsParam.toArgument())).addGenericParameter(extArgsParam)
|
|
8527
|
-
).setDocComment(docComment(`@deprecated Use ${newName} instead`)),
|
|
8528
|
-
{ indentLevel: 1 }
|
|
8529
|
-
)
|
|
8530
|
-
);
|
|
8531
|
-
}
|
|
8532
|
-
return aliases.join("\n");
|
|
8533
|
-
}
|
|
8534
|
-
};
|
|
8535
|
-
|
|
8536
9336
|
// src/generation/TSClient/FieldRefInput.ts
|
|
8537
9337
|
var FieldRefInput = class {
|
|
8538
9338
|
constructor(type) {
|
|
@@ -8554,10 +9354,9 @@ export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${
|
|
|
8554
9354
|
|
|
8555
9355
|
// src/generation/TSClient/GenerateContext.ts
|
|
8556
9356
|
var GenerateContext = class {
|
|
8557
|
-
constructor({ dmmf, genericArgsInfo,
|
|
9357
|
+
constructor({ dmmf, genericArgsInfo, generator }) {
|
|
8558
9358
|
this.dmmf = dmmf;
|
|
8559
9359
|
this.genericArgsInfo = genericArgsInfo;
|
|
8560
|
-
this.defaultArgsAliases = defaultArgsAliases;
|
|
8561
9360
|
this.generator = generator;
|
|
8562
9361
|
}
|
|
8563
9362
|
isPreviewFeatureOn(previewFeature) {
|
|
@@ -8648,6 +9447,7 @@ function clientTypeMapModelsResultDefinition(modelName, action) {
|
|
|
8648
9447
|
if (action === "createMany") return namedType("BatchPayload");
|
|
8649
9448
|
if (action === "createManyAndReturn") return array(payloadToResult(modelName));
|
|
8650
9449
|
if (action === "updateMany") return namedType("BatchPayload");
|
|
9450
|
+
if (action === "updateManyAndReturn") return array(payloadToResult(modelName));
|
|
8651
9451
|
if (action === "findMany") return array(payloadToResult(modelName));
|
|
8652
9452
|
if (action === "findFirst") return unionType([payloadToResult(modelName), nullType]);
|
|
8653
9453
|
if (action === "findUnique") return unionType([payloadToResult(modelName), nullType]);
|
|
@@ -8714,13 +9514,10 @@ function clientExtensionsDefinitions(context) {
|
|
|
8714
9514
|
);
|
|
8715
9515
|
return [typeMap, stringify(define2)].join("\n");
|
|
8716
9516
|
}
|
|
8717
|
-
function extendsPropertyDefinition(
|
|
8718
|
-
const extendsDefinition = namedType("$Extensions.ExtendsHook").addGenericArgument(stringLiteral("extends")).addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(namedType("ExtArgs"))
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
namedType("$Utils.Call").addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(objectType().add(property("extArgs", namedType("ExtArgs"))))
|
|
8722
|
-
).addGenericArgument(namedType("ClientOptions"));
|
|
8723
|
-
}
|
|
9517
|
+
function extendsPropertyDefinition() {
|
|
9518
|
+
const extendsDefinition = namedType("$Extensions.ExtendsHook").addGenericArgument(stringLiteral("extends")).addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(namedType("ExtArgs")).addGenericArgument(
|
|
9519
|
+
namedType("$Utils.Call").addGenericArgument(namedType("Prisma.TypeMapCb")).addGenericArgument(objectType().add(property("extArgs", namedType("ExtArgs"))))
|
|
9520
|
+
).addGenericArgument(namedType("ClientOptions"));
|
|
8724
9521
|
return stringify(property("$extends", extendsDefinition), { indentLevel: 1 });
|
|
8725
9522
|
}
|
|
8726
9523
|
function batchingTransactionDefinition(context) {
|
|
@@ -8769,7 +9566,7 @@ function queryRawDefinition(context) {
|
|
|
8769
9566
|
* \`\`\`
|
|
8770
9567
|
* const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
|
|
8771
9568
|
* \`\`\`
|
|
8772
|
-
*
|
|
9569
|
+
*
|
|
8773
9570
|
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
|
|
8774
9571
|
*/
|
|
8775
9572
|
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
@@ -8781,7 +9578,7 @@ function queryRawDefinition(context) {
|
|
|
8781
9578
|
* \`\`\`
|
|
8782
9579
|
* const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
|
|
8783
9580
|
* \`\`\`
|
|
8784
|
-
*
|
|
9581
|
+
*
|
|
8785
9582
|
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
|
|
8786
9583
|
*/
|
|
8787
9584
|
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`;
|
|
@@ -8797,7 +9594,7 @@ function executeRawDefinition(context) {
|
|
|
8797
9594
|
* \`\`\`
|
|
8798
9595
|
* const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
|
|
8799
9596
|
* \`\`\`
|
|
8800
|
-
*
|
|
9597
|
+
*
|
|
8801
9598
|
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
|
|
8802
9599
|
*/
|
|
8803
9600
|
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
@@ -8809,7 +9606,7 @@ function executeRawDefinition(context) {
|
|
|
8809
9606
|
* \`\`\`
|
|
8810
9607
|
* const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
|
|
8811
9608
|
* \`\`\`
|
|
8812
|
-
*
|
|
9609
|
+
*
|
|
8813
9610
|
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
|
|
8814
9611
|
*/
|
|
8815
9612
|
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
|
|
@@ -8847,7 +9644,7 @@ function metricDefinition(context) {
|
|
|
8847
9644
|
const property2 = property("$metrics", namedType(`runtime.${runtimeImport("MetricsClient")}`)).setDocComment(
|
|
8848
9645
|
docComment`
|
|
8849
9646
|
Gives access to the client metrics in json or prometheus format.
|
|
8850
|
-
|
|
9647
|
+
|
|
8851
9648
|
@example
|
|
8852
9649
|
\`\`\`
|
|
8853
9650
|
const metrics = await prisma.$metrics.json()
|
|
@@ -8872,7 +9669,7 @@ function runCommandRawDefinition(context) {
|
|
|
8872
9669
|
explain: false,
|
|
8873
9670
|
})
|
|
8874
9671
|
\`\`\`
|
|
8875
|
-
|
|
9672
|
+
|
|
8876
9673
|
Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
|
|
8877
9674
|
`);
|
|
8878
9675
|
return stringify(method2, { indentLevel: 1, newLine: "leading" });
|
|
@@ -8914,7 +9711,7 @@ var PrismaClientClass = class {
|
|
|
8914
9711
|
}
|
|
8915
9712
|
return `/**
|
|
8916
9713
|
* ## Prisma Client \u02B2\u02E2
|
|
8917
|
-
*
|
|
9714
|
+
*
|
|
8918
9715
|
* Type-safe database client for TypeScript & Node.js
|
|
8919
9716
|
* @example
|
|
8920
9717
|
* \`\`\`
|
|
@@ -8923,7 +9720,7 @@ var PrismaClientClass = class {
|
|
|
8923
9720
|
* const ${lowerCase(example.plural)} = await prisma.${lowerCase(example.model)}.findMany()
|
|
8924
9721
|
* \`\`\`
|
|
8925
9722
|
*
|
|
8926
|
-
*
|
|
9723
|
+
*
|
|
8927
9724
|
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
|
|
8928
9725
|
*/`;
|
|
8929
9726
|
}
|
|
@@ -8968,7 +9765,7 @@ ${[
|
|
|
8968
9765
|
runCommandRawDefinition(this.context),
|
|
8969
9766
|
metricDefinition(this.context),
|
|
8970
9767
|
applyPendingMigrationsDefinition.bind(this)(),
|
|
8971
|
-
extendsPropertyDefinition(
|
|
9768
|
+
extendsPropertyDefinition()
|
|
8972
9769
|
].filter((d) => d !== null).join("\n").trim()}
|
|
8973
9770
|
|
|
8974
9771
|
${(0, import_indent_string7.default)(
|
|
@@ -8977,10 +9774,7 @@ ${[
|
|
|
8977
9774
|
if (methodName === "constructor") {
|
|
8978
9775
|
methodName = '["constructor"]';
|
|
8979
9776
|
}
|
|
8980
|
-
const generics = ["ExtArgs"];
|
|
8981
|
-
if (this.context.isPreviewFeatureOn("omitApi")) {
|
|
8982
|
-
generics.push("ClientOptions");
|
|
8983
|
-
}
|
|
9777
|
+
const generics = ["ExtArgs", "ClientOptions"];
|
|
8984
9778
|
return `/**
|
|
8985
9779
|
* \`prisma.${methodName}\`: Exposes CRUD operations for the **${m.model}** model.
|
|
8986
9780
|
* Example usage:
|
|
@@ -8997,13 +9791,12 @@ get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`;
|
|
|
8997
9791
|
}
|
|
8998
9792
|
toTS() {
|
|
8999
9793
|
const clientOptions = this.buildClientOptions();
|
|
9000
|
-
const isOmitEnabled = this.context.isPreviewFeatureOn("omitApi");
|
|
9001
9794
|
return `${new Datasources(this.internalDatasources).toTS()}
|
|
9002
9795
|
${clientExtensionsDefinitions(this.context)}
|
|
9003
9796
|
export type DefaultPrismaClient = PrismaClient
|
|
9004
9797
|
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
|
|
9005
9798
|
${stringify(moduleExport(clientOptions))}
|
|
9006
|
-
${
|
|
9799
|
+
${stringify(globalOmitConfig(this.context.dmmf))}
|
|
9007
9800
|
|
|
9008
9801
|
/* Types for Logging */
|
|
9009
9802
|
export type LogLevel = 'info' | 'query' | 'warn' | 'error'
|
|
@@ -9044,6 +9837,7 @@ export type PrismaAction =
|
|
|
9044
9837
|
| 'createManyAndReturn'
|
|
9045
9838
|
| 'update'
|
|
9046
9839
|
| 'updateMany'
|
|
9840
|
+
| 'updateManyAndReturn'
|
|
9047
9841
|
| 'upsert'
|
|
9048
9842
|
| 'delete'
|
|
9049
9843
|
| 'deleteMany'
|
|
@@ -9096,7 +9890,7 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
|
9096
9890
|
\`\`\`
|
|
9097
9891
|
// Defaults to stdout
|
|
9098
9892
|
log: ['query', 'info', 'warn', 'error']
|
|
9099
|
-
|
|
9893
|
+
|
|
9100
9894
|
// Emit as events
|
|
9101
9895
|
log: [
|
|
9102
9896
|
{ emit: 'stdout', level: 'query' },
|
|
@@ -9126,24 +9920,22 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
|
9126
9920
|
)
|
|
9127
9921
|
);
|
|
9128
9922
|
}
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
);
|
|
9146
|
-
}
|
|
9923
|
+
clientOptions.add(
|
|
9924
|
+
property("omit", namedType("Prisma.GlobalOmitConfig")).optional().setDocComment(docComment`
|
|
9925
|
+
Global configuration for omitting model fields by default.
|
|
9926
|
+
|
|
9927
|
+
@example
|
|
9928
|
+
\`\`\`
|
|
9929
|
+
const prisma = new PrismaClient({
|
|
9930
|
+
omit: {
|
|
9931
|
+
user: {
|
|
9932
|
+
password: true
|
|
9933
|
+
}
|
|
9934
|
+
}
|
|
9935
|
+
})
|
|
9936
|
+
\`\`\`
|
|
9937
|
+
`)
|
|
9938
|
+
);
|
|
9147
9939
|
return clientOptions;
|
|
9148
9940
|
}
|
|
9149
9941
|
};
|
|
@@ -9208,7 +10000,7 @@ ${buildRequirePath(edge)}
|
|
|
9208
10000
|
* Enums
|
|
9209
10001
|
*/
|
|
9210
10002
|
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
|
|
9211
|
-
${this.dmmf.
|
|
10003
|
+
${this.dmmf.datamodel.enums.map((datamodelEnum) => new Enum(datamodelEnumToSchemaEnum(datamodelEnum), false).toJS()).join("\n\n")}
|
|
9212
10004
|
|
|
9213
10005
|
${new Enum(
|
|
9214
10006
|
{
|
|
@@ -9243,8 +10035,7 @@ ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, rela
|
|
|
9243
10035
|
const context = new GenerateContext({
|
|
9244
10036
|
dmmf: this.dmmf,
|
|
9245
10037
|
genericArgsInfo: this.genericsInfo,
|
|
9246
|
-
generator: this.options.generator
|
|
9247
|
-
defaultArgsAliases: new DefaultArgsAliases()
|
|
10038
|
+
generator: this.options.generator
|
|
9248
10039
|
});
|
|
9249
10040
|
const prismaClientClass = new PrismaClientClass(
|
|
9250
10041
|
context,
|
|
@@ -9263,12 +10054,14 @@ ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, rela
|
|
|
9263
10054
|
const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toTS());
|
|
9264
10055
|
const modelEnums = [];
|
|
9265
10056
|
const modelEnumsAliases = [];
|
|
9266
|
-
for (const
|
|
9267
|
-
modelEnums.push(new Enum(
|
|
10057
|
+
for (const datamodelEnum of this.dmmf.datamodel.enums) {
|
|
10058
|
+
modelEnums.push(new Enum(datamodelEnumToSchemaEnum(datamodelEnum), false).toTS());
|
|
9268
10059
|
modelEnumsAliases.push(
|
|
9269
|
-
stringify(moduleExport(typeDeclaration(enumType.name, namedType(`$Enums.${enumType.name}`)))),
|
|
9270
10060
|
stringify(
|
|
9271
|
-
moduleExport(
|
|
10061
|
+
moduleExport(typeDeclaration(datamodelEnum.name, namedType(`$Enums.${datamodelEnum.name}`)))
|
|
10062
|
+
),
|
|
10063
|
+
stringify(
|
|
10064
|
+
moduleExport(constDeclaration(datamodelEnum.name, namedType(`typeof $Enums.${datamodelEnum.name}`)))
|
|
9272
10065
|
)
|
|
9273
10066
|
);
|
|
9274
10067
|
}
|
|
@@ -9357,11 +10150,6 @@ ${this.dmmf.inputObjectTypes.prisma?.reduce((acc, inputType) => {
|
|
|
9357
10150
|
|
|
9358
10151
|
${this.dmmf.inputObjectTypes.model?.map((inputType) => new InputType(inputType, context).toTS()).join("\n") ?? ""}
|
|
9359
10152
|
|
|
9360
|
-
/**
|
|
9361
|
-
* Aliases for legacy arg types
|
|
9362
|
-
*/
|
|
9363
|
-
${context.defaultArgsAliases.generateAliases()}
|
|
9364
|
-
|
|
9365
10153
|
/**
|
|
9366
10154
|
* Batch Payload for updateMany & deleteMany & createMany
|
|
9367
10155
|
*/
|
|
@@ -9525,7 +10313,7 @@ function buildIndexEsm(queries, edgeRuntimeSuffix) {
|
|
|
9525
10313
|
|
|
9526
10314
|
// src/generation/typedSql/mapTypes.ts
|
|
9527
10315
|
var decimal = namedType("$runtime.Decimal");
|
|
9528
|
-
var
|
|
10316
|
+
var uint8Array = namedType("Uint8Array");
|
|
9529
10317
|
var date = namedType("Date");
|
|
9530
10318
|
var inputJsonValue = namedType("$runtime.InputJsonObject");
|
|
9531
10319
|
var jsonValue = namedType("$runtime.JsonValue");
|
|
@@ -9547,7 +10335,7 @@ var typeMappings = {
|
|
|
9547
10335
|
double: numberType,
|
|
9548
10336
|
enum: stringType,
|
|
9549
10337
|
// TODO:
|
|
9550
|
-
bytes:
|
|
10338
|
+
bytes: uint8Array,
|
|
9551
10339
|
bool: booleanType,
|
|
9552
10340
|
char: stringType,
|
|
9553
10341
|
json: {
|
|
@@ -9575,7 +10363,7 @@ var typeMappings = {
|
|
|
9575
10363
|
"float-array": array(numberType),
|
|
9576
10364
|
"double-array": array(numberType),
|
|
9577
10365
|
"char-array": array(stringType),
|
|
9578
|
-
"bytes-array": array(
|
|
10366
|
+
"bytes-array": array(uint8Array),
|
|
9579
10367
|
"bool-array": array(booleanType),
|
|
9580
10368
|
"date-array": array(date),
|
|
9581
10369
|
"time-array": array(date),
|
|
@@ -10080,6 +10868,8 @@ function validateDmmfAgainstDenylists(prismaClientDmmf) {
|
|
|
10080
10868
|
"PrismaClient",
|
|
10081
10869
|
"Prisma",
|
|
10082
10870
|
// JavaScript keywords
|
|
10871
|
+
"async",
|
|
10872
|
+
"await",
|
|
10083
10873
|
"break",
|
|
10084
10874
|
"case",
|
|
10085
10875
|
"catch",
|
|
@@ -10118,6 +10908,7 @@ function validateDmmfAgainstDenylists(prismaClientDmmf) {
|
|
|
10118
10908
|
"throw",
|
|
10119
10909
|
"true",
|
|
10120
10910
|
"try",
|
|
10911
|
+
"using",
|
|
10121
10912
|
"typeof",
|
|
10122
10913
|
"var",
|
|
10123
10914
|
"void",
|