UNPKG

@prisma/client

Version:

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.

1,409 lines (1,393 loc) • 351 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); // ../../node_modules/.pnpm/@prisma+engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60/node_modules/@prisma/engines-version/package.json var require_package = __commonJS({ "../../node_modules/.pnpm/@prisma+engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60/node_modules/@prisma/engines-version/package.json"(exports2, module2) { module2.exports = { name: "@prisma/engines-version", version: "6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60", main: "index.js", types: "index.d.ts", license: "Apache-2.0", author: "Tim Suchanek <suchanek@prisma.io>", prisma: { enginesVersion: "173f8d54f8d52e692c7e27e72a88314ec7aeff60" }, repository: { type: "git", url: "https://github.com/prisma/engines-wrapper.git", directory: "packages/engines-version" }, devDependencies: { "@types/node": "18.19.76", typescript: "4.9.5" }, files: [ "index.js", "index.d.ts" ], scripts: { build: "tsc -d" } }; } }); // ../../node_modules/.pnpm/@prisma+engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60/node_modules/@prisma/engines-version/index.js var require_engines_version = __commonJS({ "../../node_modules/.pnpm/@prisma+engines-version@6.5.0-73.173f8d54f8d52e692c7e27e72a88314ec7aeff60/node_modules/@prisma/engines-version/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.enginesVersion = void 0; exports2.enginesVersion = require_package().prisma.enginesVersion; } }); // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js var require_universalify = __commonJS({ "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports2) { "use strict"; exports2.fromCallback = function(fn) { return Object.defineProperty(function(...args) { if (typeof args[args.length - 1] === "function") fn.apply(this, args); else { return new Promise((resolve, reject) => { args.push((err, res) => err != null ? reject(err) : resolve(res)); fn.apply(this, args); }); } }, "name", { value: fn.name }); }; exports2.fromPromise = function(fn) { return Object.defineProperty(function(...args) { const cb = args[args.length - 1]; if (typeof cb !== "function") return fn.apply(this, args); else { args.pop(); fn.apply(this, args).then((r) => cb(null, r), cb); } }, "name", { value: fn.name }); }; } }); // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js var require_polyfills = __commonJS({ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports2, module2) { "use strict"; var constants = require("constants"); var origCwd = process.cwd; var cwd2 = null; var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; process.cwd = function() { if (!cwd2) cwd2 = origCwd.call(process); return cwd2; }; try { process.cwd(); } catch (er) { } if (typeof process.chdir === "function") { chdir = process.chdir; process.chdir = function(d) { cwd2 = null; chdir.call(process, d); }; if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir); } var chdir; module2.exports = patch; function patch(fs3) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs3); } if (!fs3.lutimes) { patchLutimes(fs3); } fs3.chown = chownFix(fs3.chown); fs3.fchown = chownFix(fs3.fchown); fs3.lchown = chownFix(fs3.lchown); fs3.chmod = chmodFix(fs3.chmod); fs3.fchmod = chmodFix(fs3.fchmod); fs3.lchmod = chmodFix(fs3.lchmod); fs3.chownSync = chownFixSync(fs3.chownSync); fs3.fchownSync = chownFixSync(fs3.fchownSync); fs3.lchownSync = chownFixSync(fs3.lchownSync); fs3.chmodSync = chmodFixSync(fs3.chmodSync); fs3.fchmodSync = chmodFixSync(fs3.fchmodSync); fs3.lchmodSync = chmodFixSync(fs3.lchmodSync); fs3.stat = statFix(fs3.stat); fs3.fstat = statFix(fs3.fstat); fs3.lstat = statFix(fs3.lstat); fs3.statSync = statFixSync(fs3.statSync); fs3.fstatSync = statFixSync(fs3.fstatSync); fs3.lstatSync = statFixSync(fs3.lstatSync); if (fs3.chmod && !fs3.lchmod) { fs3.lchmod = function(path5, mode, cb) { if (cb) process.nextTick(cb); }; fs3.lchmodSync = function() { }; } if (fs3.chown && !fs3.lchown) { fs3.lchown = function(path5, uid, gid, cb) { if (cb) process.nextTick(cb); }; fs3.lchownSync = function() { }; } if (platform === "win32") { fs3.rename = typeof fs3.rename !== "function" ? fs3.rename : function(fs$rename) { function rename(from, to, cb) { var start = Date.now(); var backoff = 0; fs$rename(from, to, function CB(er) { if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { setTimeout(function() { fs3.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er); }); }, backoff); if (backoff < 100) backoff += 10; return; } if (cb) cb(er); }); } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); return rename; }(fs3.rename); } fs3.read = typeof fs3.read !== "function" ? fs3.read : function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { var eagCounter = 0; callback = function(er, _, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; return fs$read.call(fs3, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } return fs$read.call(fs3, fd, buffer, offset, length, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; }(fs3.read); fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { return fs$readSync.call(fs3, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; continue; } throw er; } } }; }(fs3.readSync); function patchLchmod(fs4) { fs4.lchmod = function(path5, mode, callback) { fs4.open( path5, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { if (err) { if (callback) callback(err); return; } fs4.fchmod(fd, mode, function(err2) { fs4.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); } ); }; fs4.lchmodSync = function(path5, mode) { var fd = fs4.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { ret = fs4.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { fs4.closeSync(fd); } catch (er) { } } else { fs4.closeSync(fd); } } return ret; }; } function patchLutimes(fs4) { if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) { fs4.lutimes = function(path5, at, mt, cb) { fs4.open(path5, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } fs4.futimes(fd, at, mt, function(er2) { fs4.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; fs4.lutimesSync = function(path5, at, mt) { var fd = fs4.openSync(path5, constants.O_SYMLINK); var ret; var threw = true; try { ret = fs4.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { fs4.closeSync(fd); } catch (er) { } } else { fs4.closeSync(fd); } } return ret; }; } else if (fs4.futimes) { fs4.lutimes = function(_a, _b, _c, cb) { if (cb) process.nextTick(cb); }; fs4.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { return orig.call(fs3, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); }; } function chmodFixSync(orig) { if (!orig) return orig; return function(target, mode) { try { return orig.call(fs3, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } }; } function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { return orig.call(fs3, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); }; } function chownFixSync(orig) { if (!orig) return orig; return function(target, uid, gid) { try { return orig.call(fs3, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } }; } function statFix(orig) { if (!orig) return orig; return function(target, options, cb) { if (typeof options === "function") { cb = options; options = null; } function callback(er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; } if (cb) cb.apply(this, arguments); } return options ? orig.call(fs3, target, options, callback) : orig.call(fs3, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { var stats = options ? orig.call(fs3, target, options) : orig.call(fs3, target); if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; } return stats; }; } function chownErOk(er) { if (!er) return true; if (er.code === "ENOSYS") return true; var nonroot = !process.getuid || process.getuid() !== 0; if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true; } return false; } } } }); // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js var require_legacy_streams = __commonJS({ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { "use strict"; var Stream = require("stream").Stream; module2.exports = legacy; function legacy(fs3) { return { ReadStream, WriteStream }; function ReadStream(path5, options) { if (!(this instanceof ReadStream)) return new ReadStream(path5, options); Stream.call(this); var self = this; this.path = path5; this.fd = null; this.readable = true; this.paused = false; this.flags = "r"; this.mode = 438; this.bufferSize = 64 * 1024; options = options || {}; var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== void 0) { if ("number" !== typeof this.start) { throw TypeError("start must be a Number"); } if (this.end === void 0) { this.end = Infinity; } else if ("number" !== typeof this.end) { throw TypeError("end must be a Number"); } if (this.start > this.end) { throw new Error("start must be <= end"); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs3.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self.emit("error", err); self.readable = false; return; } self.fd = fd; self.emit("open", fd); self._read(); }); } function WriteStream(path5, options) { if (!(this instanceof WriteStream)) return new WriteStream(path5, options); Stream.call(this); this.path = path5; this.fd = null; this.writable = true; this.flags = "w"; this.encoding = "binary"; this.mode = 438; this.bytesWritten = 0; options = options || {}; var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== void 0) { if ("number" !== typeof this.start) { throw TypeError("start must be a Number"); } if (this.start < 0) { throw new Error("start must be >= zero"); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs3.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } } } } }); // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js var require_clone = __commonJS({ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports2, module2) { "use strict"; module2.exports = clone; var getPrototypeOf = Object.getPrototypeOf || function(obj) { return obj.__proto__; }; function clone(obj) { if (obj === null || typeof obj !== "object") return obj; if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) }; else var copy = /* @__PURE__ */ Object.create(null); Object.getOwnPropertyNames(obj).forEach(function(key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); }); return copy; } } }); // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js var require_graceful_fs = __commonJS({ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { "use strict"; var fs3 = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); var util2 = require("util"); var gracefulQueue; var previousSymbol; if (typeof Symbol === "function" && typeof Symbol.for === "function") { gracefulQueue = Symbol.for("graceful-fs.queue"); previousSymbol = Symbol.for("graceful-fs.previous"); } else { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; } function noop() { } function publishQueue(context, queue2) { Object.defineProperty(context, gracefulQueue, { get: function() { return queue2; } }); } var debug4 = noop; if (util2.debuglog) debug4 = util2.debuglog("gfs4"); else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug4 = function() { var m = util2.format.apply(util2, arguments); m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; if (!fs3[gracefulQueue]) { queue = global[gracefulQueue] || []; publishQueue(fs3, queue); fs3.close = function(fs$close) { function close(fd, cb) { return fs$close.call(fs3, fd, function(err) { if (!err) { resetQueue(); } if (typeof cb === "function") cb.apply(this, arguments); }); } Object.defineProperty(close, previousSymbol, { value: fs$close }); return close; }(fs3.close); fs3.closeSync = function(fs$closeSync) { function closeSync(fd) { fs$closeSync.apply(fs3, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; }(fs3.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { debug4(fs3[gracefulQueue]); require("assert").equal(fs3[gracefulQueue].length, 0); }); } } var queue; if (!global[gracefulQueue]) { publishQueue(global, fs3[gracefulQueue]); } module2.exports = patch(clone(fs3)); if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) { module2.exports = patch(fs3); fs3.__patched = true; } function patch(fs4) { polyfills(fs4); fs4.gracefulify = patch; fs4.createReadStream = createReadStream; fs4.createWriteStream = createWriteStream; var fs$readFile = fs4.readFile; fs4.readFile = readFile; function readFile(path5, options, cb) { if (typeof options === "function") cb = options, options = null; return go$readFile(path5, options, cb); function go$readFile(path6, options2, cb2, startTime) { return fs$readFile(path6, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); } }); } } var fs$writeFile = fs4.writeFile; fs4.writeFile = writeFile; function writeFile(path5, data, options, cb) { if (typeof options === "function") cb = options, options = null; return go$writeFile(path5, data, options, cb); function go$writeFile(path6, data2, options2, cb2, startTime) { return fs$writeFile(path6, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); } }); } } var fs$appendFile = fs4.appendFile; if (fs$appendFile) fs4.appendFile = appendFile; function appendFile(path5, data, options, cb) { if (typeof options === "function") cb = options, options = null; return go$appendFile(path5, data, options, cb); function go$appendFile(path6, data2, options2, cb2, startTime) { return fs$appendFile(path6, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); } }); } } var fs$copyFile = fs4.copyFile; if (fs$copyFile) fs4.copyFile = copyFile; function copyFile(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; flags = 0; } return go$copyFile(src, dest, flags, cb); function go$copyFile(src2, dest2, flags2, cb2, startTime) { return fs$copyFile(src2, dest2, flags2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); } }); } } var fs$readdir = fs4.readdir; fs4.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; function readdir(path5, options, cb) { if (typeof options === "function") cb = options, options = null; var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) { return fs$readdir(path6, fs$readdirCallback( path6, options2, cb2, startTime )); } : function go$readdir2(path6, options2, cb2, startTime) { return fs$readdir(path6, options2, fs$readdirCallback( path6, options2, cb2, startTime )); }; return go$readdir(path5, options, cb); function fs$readdirCallback(path6, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, [path6, options2, cb2], err, startTime || Date.now(), Date.now() ]); else { if (files && files.sort) files.sort(); if (typeof cb2 === "function") cb2.call(this, err, files); } }; } } if (process.version.substr(0, 4) === "v0.8") { var legStreams = legacy(fs4); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } var fs$ReadStream = fs4.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } var fs$WriteStream = fs4.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } Object.defineProperty(fs4, "ReadStream", { get: function() { return ReadStream; }, set: function(val) { ReadStream = val; }, enumerable: true, configurable: true }); Object.defineProperty(fs4, "WriteStream", { get: function() { return WriteStream; }, set: function(val) { WriteStream = val; }, enumerable: true, configurable: true }); var FileReadStream = ReadStream; Object.defineProperty(fs4, "FileReadStream", { get: function() { return FileReadStream; }, set: function(val) { FileReadStream = val; }, enumerable: true, configurable: true }); var FileWriteStream = WriteStream; Object.defineProperty(fs4, "FileWriteStream", { get: function() { return FileWriteStream; }, set: function(val) { FileWriteStream = val; }, enumerable: true, configurable: true }); function ReadStream(path5, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else return ReadStream.apply(Object.create(ReadStream.prototype), arguments); } function ReadStream$open() { var that = this; open(that.path, that.flags, that.mode, function(err, fd) { if (err) { if (that.autoClose) that.destroy(); that.emit("error", err); } else { that.fd = fd; that.emit("open", fd); that.read(); } }); } function WriteStream(path5, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else return WriteStream.apply(Object.create(WriteStream.prototype), arguments); } function WriteStream$open() { var that = this; open(that.path, that.flags, that.mode, function(err, fd) { if (err) { that.destroy(); that.emit("error", err); } else { that.fd = fd; that.emit("open", fd); } }); } function createReadStream(path5, options) { return new fs4.ReadStream(path5, options); } function createWriteStream(path5, options) { return new fs4.WriteStream(path5, options); } var fs$open = fs4.open; fs4.open = open; function open(path5, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; return go$open(path5, flags, mode, cb); function go$open(path6, flags2, mode2, cb2, startTime) { return fs$open(path6, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); } }); } } return fs4; } function enqueue(elem) { debug4("ENQUEUE", elem[0].name, elem[1]); fs3[gracefulQueue].push(elem); retry(); } var retryTimer; function resetQueue() { var now = Date.now(); for (var i = 0; i < fs3[gracefulQueue].length; ++i) { if (fs3[gracefulQueue][i].length > 2) { fs3[gracefulQueue][i][3] = now; fs3[gracefulQueue][i][4] = now; } } retry(); } function retry() { clearTimeout(retryTimer); retryTimer = void 0; if (fs3[gracefulQueue].length === 0) return; var elem = fs3[gracefulQueue].shift(); var fn = elem[0]; var args = elem[1]; var err = elem[2]; var startTime = elem[3]; var lastTime = elem[4]; if (startTime === void 0) { debug4("RETRY", fn.name, args); fn.apply(null, args); } else if (Date.now() - startTime >= 6e4) { debug4("TIMEOUT", fn.name, args); var cb = args.pop(); if (typeof cb === "function") cb.call(null, err); } else { var sinceAttempt = Date.now() - lastTime; var sinceStart = Math.max(lastTime - startTime, 1); var desiredDelay = Math.min(sinceStart * 1.2, 100); if (sinceAttempt >= desiredDelay) { debug4("RETRY", fn.name, args); fn.apply(null, args.concat([startTime])); } else { fs3[gracefulQueue].push(elem); } } if (retryTimer === void 0) { retryTimer = setTimeout(retry, 0); } } } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/fs/index.js var require_fs = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/fs/index.js"(exports2) { "use strict"; var u = require_universalify().fromCallback; var fs3 = require_graceful_fs(); var api = [ "access", "appendFile", "chmod", "chown", "close", "copyFile", "cp", "fchmod", "fchown", "fdatasync", "fstat", "fsync", "ftruncate", "futimes", "glob", "lchmod", "lchown", "lutimes", "link", "lstat", "mkdir", "mkdtemp", "open", "opendir", "readdir", "readFile", "readlink", "realpath", "rename", "rm", "rmdir", "stat", "statfs", "symlink", "truncate", "unlink", "utimes", "writeFile" ].filter((key) => { return typeof fs3[key] === "function"; }); Object.assign(exports2, fs3); api.forEach((method2) => { exports2[method2] = u(fs3[method2]); }); exports2.exists = function(filename, callback) { if (typeof callback === "function") { return fs3.exists(filename, callback); } return new Promise((resolve) => { return fs3.exists(filename, resolve); }); }; exports2.read = function(fd, buffer, offset, length, position, callback) { if (typeof callback === "function") { return fs3.read(fd, buffer, offset, length, position, callback); } return new Promise((resolve, reject) => { fs3.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => { if (err) return reject(err); resolve({ bytesRead, buffer: buffer2 }); }); }); }; exports2.write = function(fd, buffer, ...args) { if (typeof args[args.length - 1] === "function") { return fs3.write(fd, buffer, ...args); } return new Promise((resolve, reject) => { fs3.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => { if (err) return reject(err); resolve({ bytesWritten, buffer: buffer2 }); }); }); }; exports2.readv = function(fd, buffers, ...args) { if (typeof args[args.length - 1] === "function") { return fs3.readv(fd, buffers, ...args); } return new Promise((resolve, reject) => { fs3.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => { if (err) return reject(err); resolve({ bytesRead, buffers: buffers2 }); }); }); }; exports2.writev = function(fd, buffers, ...args) { if (typeof args[args.length - 1] === "function") { return fs3.writev(fd, buffers, ...args); } return new Promise((resolve, reject) => { fs3.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => { if (err) return reject(err); resolve({ bytesWritten, buffers: buffers2 }); }); }); }; if (typeof fs3.realpath.native === "function") { exports2.realpath.native = u(fs3.realpath.native); } else { process.emitWarning( "fs.realpath.native is not a function. Is fs being monkey-patched?", "Warning", "fs-extra-WARN0003" ); } } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js var require_utils = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) { "use strict"; var path5 = require("path"); module2.exports.checkPath = function checkPath(pth) { if (process.platform === "win32") { const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, "")); if (pathHasInvalidWinCharacters) { const error = new Error(`Path contains invalid characters: ${pth}`); error.code = "EINVAL"; throw error; } } }; } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/make-dir.js var require_make_dir = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) { "use strict"; var fs3 = require_fs(); var { checkPath } = require_utils(); var getMode = (options) => { const defaults = { mode: 511 }; if (typeof options === "number") return options; return { ...defaults, ...options }.mode; }; module2.exports.makeDir = async (dir, options) => { checkPath(dir); return fs3.mkdir(dir, { mode: getMode(options), recursive: true }); }; module2.exports.makeDirSync = (dir, options) => { checkPath(dir); return fs3.mkdirSync(dir, { mode: getMode(options), recursive: true }); }; } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/index.js var require_mkdirs = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) { "use strict"; var u = require_universalify().fromPromise; var { makeDir: _makeDir, makeDirSync } = require_make_dir(); var makeDir = u(_makeDir); module2.exports = { mkdirs: makeDir, mkdirsSync: makeDirSync, // alias mkdirp: makeDir, mkdirpSync: makeDirSync, ensureDir: makeDir, ensureDirSync: makeDirSync }; } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/path-exists/index.js var require_path_exists = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) { "use strict"; var u = require_universalify().fromPromise; var fs3 = require_fs(); function pathExists2(path5) { return fs3.access(path5).then(() => true).catch(() => false); } module2.exports = { pathExists: u(pathExists2), pathExistsSync: fs3.existsSync }; } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/utimes.js var require_utimes = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) { "use strict"; var fs3 = require_fs(); var u = require_universalify().fromPromise; async function utimesMillis(path5, atime, mtime) { const fd = await fs3.open(path5, "r+"); let closeErr = null; try { await fs3.futimes(fd, atime, mtime); } finally { try { await fs3.close(fd); } catch (e) { closeErr = e; } } if (closeErr) { throw closeErr; } } function utimesMillisSync(path5, atime, mtime) { const fd = fs3.openSync(path5, "r+"); fs3.futimesSync(fd, atime, mtime); return fs3.closeSync(fd); } module2.exports = { utimesMillis: u(utimesMillis), utimesMillisSync }; } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js var require_stat = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js"(exports2, module2) { "use strict"; var fs3 = require_fs(); var path5 = require("path"); var u = require_universalify().fromPromise; function getStats(src, dest, opts) { const statFunc = opts.dereference ? (file2) => fs3.stat(file2, { bigint: true }) : (file2) => fs3.lstat(file2, { bigint: true }); return Promise.all([ statFunc(src), statFunc(dest).catch((err) => { if (err.code === "ENOENT") return null; throw err; }) ]).then(([srcStat, destStat]) => ({ srcStat, destStat })); } function getStatsSync(src, dest, opts) { let destStat; const statFunc = opts.dereference ? (file2) => fs3.statSync(file2, { bigint: true }) : (file2) => fs3.lstatSync(file2, { bigint: true }); const srcStat = statFunc(src); try { destStat = statFunc(dest); } catch (err) { if (err.code === "ENOENT") return { srcStat, destStat: null }; throw err; } return { srcStat, destStat }; } async function checkPaths(src, dest, funcName, opts) { const { srcStat, destStat } = await getStats(src, dest, opts); if (destStat) { if (areIdentical(srcStat, destStat)) { const srcBaseName = path5.basename(src); const destBaseName = path5.basename(dest); if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { return { srcStat, destStat, isChangingCase: true }; } throw new Error("Source and destination must not be the same."); } if (srcStat.isDirectory() && !destStat.isDirectory()) { throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); } if (!srcStat.isDirectory() && destStat.isDirectory()) { throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); } } if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { throw new Error(errMsg(src, dest, funcName)); } return { srcStat, destStat }; } function checkPathsSync(src, dest, funcName, opts) { const { srcStat, destStat } = getStatsSync(src, dest, opts); if (destStat) { if (areIdentical(srcStat, destStat)) { const srcBaseName = path5.basename(src); const destBaseName = path5.basename(dest); if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { return { srcStat, destStat, isChangingCase: true }; } throw new Error("Source and destination must not be the same."); } if (srcStat.isDirectory() && !destStat.isDirectory()) { throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); } if (!srcStat.isDirectory() && destStat.isDirectory()) { throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); } } if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { throw new Error(errMsg(src, dest, funcName)); } return { srcStat, destStat }; } async function checkParentPaths(src, srcStat, dest, funcName) { const srcParent = path5.resolve(path5.dirname(src)); const destParent = path5.resolve(path5.dirname(dest)); if (destParent === srcParent || destParent === path5.parse(destParent).root) return; let destStat; try { destStat = await fs3.stat(destParent, { bigint: true }); } catch (err) { if (err.code === "ENOENT") return; throw err; } if (areIdentical(srcStat, destStat)) { throw new Error(errMsg(src, dest, funcName)); } return checkParentPaths(src, srcStat, destParent, funcName); } function checkParentPathsSync(src, srcStat, dest, funcName) { const srcParent = path5.resolve(path5.dirname(src)); const destParent = path5.resolve(path5.dirname(dest)); if (destParent === srcParent || destParent === path5.parse(destParent).root) return; let destStat; try { destStat = fs3.statSync(destParent, { bigint: true }); } catch (err) { if (err.code === "ENOENT") return; throw err; } if (areIdentical(srcStat, destStat)) { throw new Error(errMsg(src, dest, funcName)); } return checkParentPathsSync(src, srcStat, destParent, funcName); } function areIdentical(srcStat, destStat) { return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev; } function isSrcSubdir(src, dest) { const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i); const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i); return srcArr.every((cur, i) => destArr[i] === cur); } function errMsg(src, dest, funcName) { return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`; } module2.exports = { // checkPaths checkPaths: u(checkPaths), checkPathsSync, // checkParent checkParentPaths: u(checkParentPaths), checkParentPathsSync, // Misc isSrcSubdir, areIdentical }; } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js var require_copy = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) { "use strict"; var fs3 = require_fs(); var path5 = require("path"); var { mkdirs } = require_mkdirs(); var { pathExists: pathExists2 } = require_path_exists(); var { utimesMillis } = require_utimes(); var stat = require_stat(); async function copy(src, dest, opts = {}) { if (typeof opts === "function") { opts = { filter: opts }; } opts.clobber = "clobber" in opts ? !!opts.clobber : true; opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; if (opts.preserveTimestamps && process.arch === "ia32") { process.emitWarning( "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0001" ); } const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts); await stat.checkParentPaths(src, srcStat, dest, "copy"); const include = await runFilter(src, dest, opts); if (!include) return; const destParent = path5.dirname(dest); const dirExists = await pathExists2(destParent); if (!dirExists) { await mkdirs(destParent); } await getStatsAndPerformCopy(destStat, src, dest, opts); } async function runFilter(src, dest, opts) { if (!opts.filter) return true; return opts.filter(src, dest); } async function getStatsAndPerformCopy(destStat, src, dest, opts) { const statFn = opts.dereference ? fs3.stat : fs3.lstat; const srcStat = await statFn(src); if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts); if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts); if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts); if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`); if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`); throw new Error(`Unknown file: ${src}`); } async function onFile(srcStat, destStat, src, dest, opts) { if (!destStat) return copyFile(srcStat, src, dest, opts); if (opts.overwrite) { await fs3.unlink(dest); return copyFile(srcStat, src, dest, opts); } if (opts.errorOnExist) { throw new Error(`'${dest}' already exists`); } } async function copyFile(srcStat, src, dest, opts) { await fs3.copyFile(src, dest); if (opts.preserveTimestamps) { if (fileIsNotWritable(srcStat.mode)) { await makeFileWritable(dest, srcStat.mode); } const updatedSrcStat = await fs3.stat(src); await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime); } return fs3.chmod(dest, srcStat.mode); } function fileIsNotWritable(srcMode) { return (srcMode & 128) === 0; } function makeFileWritable(dest, srcMode) { return fs3.chmod(dest, srcMode | 128); } async function onDir(srcStat, destStat, src, dest, opts) { if (!destStat) { await fs3.mkdir(dest); } const promises = []; for await (const item of await fs3.opendir(src)) { const srcItem = path5.join(src, item.name); const destItem = path5.join(dest, item.name); promises.push( runFilter(srcItem, destItem, opts).then((include) => { if (include) { return stat.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => { return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts); }); } }) ); } await Promise.all(promises); if (!destStat) { await fs3.chmod(dest, srcStat.mode); } } async function onLink(destStat, src, dest, opts) { let resolvedSrc = await fs3.readlink(src); if (opts.dereference) { resolvedSrc = path5.resolve(process.cwd(), resolvedSrc); } if (!destStat) { return fs3.symlink(resolvedSrc, dest); } let resolvedDest = null; try { resolvedDest = await fs3.readlink(dest); } catch (e) { if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs3.symlink(resolvedSrc, dest); throw e; } if (opts.dereference) { resolvedDest = path5.resolve(process.cwd(), resolvedDest); } if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); } if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); } await fs3.unlink(dest); return fs3.symlink(resolvedSrc, dest); } module2.exports = copy; } }); // ../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js var require_copy_sync = __commonJS({ "../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) { "use strict"; var fs3 = require_graceful_fs(); var path5 = require("path"); var mkdirsSync = require_mkdirs().mkdirsSync; var utimesMillisSync = require_utimes().utimesMillisSync; var stat = require_stat(); function copySync(src, dest, opts) { if (typeof opts === "function") { opts = { filter: opts }; } opts = opts || {}; opts.clobber = "clobber" in opts ? !!opts.clobber : true; opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; if (opts.preserveTimestamps && process.arch === "ia32") { process.emitWarning( "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", "Warning", "fs-extra-WARN0002" ); } const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts); stat.checkParentPathsSync(src, srcStat, dest, "copy"); if (opts.filter && !opts.filter(src, dest)) return; const destParent = path5.dirname(dest); if (!fs3.existsSync(destParent)) mkdirsSync(destParent); return getStats(de