initial commit

This commit is contained in:
Bhavnoor Singh Saroya 2025-01-07 04:45:03 -08:00
commit b25eb51ff0
280 changed files with 178550 additions and 0 deletions

View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,8 @@
# @prisma/fetch-engine
Responsible for downloading and caching the latest Rust binary
⚠️ **Warning**: This package is intended for Prisma's internal use.
Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
If you are using this package, it would be helpful if you could help us gain an understanding where, how and why you are using it. Your feedback will be valuable to us to define a better API. Please share this information at https://github.com/prisma/prisma/discussions/13877 - Thanks!

View file

@ -0,0 +1,5 @@
export declare enum BinaryType {
QueryEngineBinary = "query-engine",
QueryEngineLibrary = "libquery-engine",
SchemaEngineBinary = "schema-engine"
}

View file

@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var BinaryType_exports = {};
__export(BinaryType_exports, {
BinaryType: () => import_chunk_X37PZICB.BinaryType
});
module.exports = __toCommonJS(BinaryType_exports);
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1 @@
export declare function chmodPlusX(file: string): void;

View file

@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var chmodPlusX_exports = {};
__export(chmodPlusX_exports, {
chmodPlusX: () => import_chunk_MX3HXAU2.chmodPlusX
});
module.exports = __toCommonJS(chmodPlusX_exports);
var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,161 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var chunk_4LX3XBNY_exports = {};
__export(chunk_4LX3XBNY_exports, {
getBar: () => getBar
});
module.exports = __toCommonJS(chunk_4LX3XBNY_exports);
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
var require_node_progress = (0, import_chunk_AH6QHEOA.__commonJS)({
"../../node_modules/.pnpm/progress@2.0.3/node_modules/progress/lib/node-progress.js"(exports, module2) {
"use strict";
exports = module2.exports = ProgressBar;
function ProgressBar(fmt, options) {
this.stream = options.stream || process.stderr;
if (typeof options == "number") {
var total = options;
options = {};
options.total = total;
} else {
options = options || {};
if ("string" != typeof fmt) throw new Error("format required");
if ("number" != typeof options.total) throw new Error("total required");
}
this.fmt = fmt;
this.curr = options.curr || 0;
this.total = options.total;
this.width = options.width || this.total;
this.clear = options.clear;
this.chars = {
complete: options.complete || "=",
incomplete: options.incomplete || "-",
head: options.head || (options.complete || "=")
};
this.renderThrottle = options.renderThrottle !== 0 ? options.renderThrottle || 16 : 0;
this.lastRender = -Infinity;
this.callback = options.callback || function() {
};
this.tokens = {};
this.lastDraw = "";
}
ProgressBar.prototype.tick = function(len, tokens) {
if (len !== 0)
len = len || 1;
if ("object" == typeof len) tokens = len, len = 1;
if (tokens) this.tokens = tokens;
if (0 == this.curr) this.start = /* @__PURE__ */ new Date();
this.curr += len;
this.render();
if (this.curr >= this.total) {
this.render(void 0, true);
this.complete = true;
this.terminate();
this.callback(this);
return;
}
};
ProgressBar.prototype.render = function(tokens, force) {
force = force !== void 0 ? force : false;
if (tokens) this.tokens = tokens;
if (!this.stream.isTTY) return;
var now = Date.now();
var delta = now - this.lastRender;
if (!force && delta < this.renderThrottle) {
return;
} else {
this.lastRender = now;
}
var ratio = this.curr / this.total;
ratio = Math.min(Math.max(ratio, 0), 1);
var percent = Math.floor(ratio * 100);
var incomplete, complete, completeLength;
var elapsed = /* @__PURE__ */ new Date() - this.start;
var eta = percent == 100 ? 0 : elapsed * (this.total / this.curr - 1);
var rate = this.curr / (elapsed / 1e3);
var str = this.fmt.replace(":current", this.curr).replace(":total", this.total).replace(":elapsed", isNaN(elapsed) ? "0.0" : (elapsed / 1e3).toFixed(1)).replace(":eta", isNaN(eta) || !isFinite(eta) ? "0.0" : (eta / 1e3).toFixed(1)).replace(":percent", percent.toFixed(0) + "%").replace(":rate", Math.round(rate));
var availableSpace = Math.max(0, this.stream.columns - str.replace(":bar", "").length);
if (availableSpace && process.platform === "win32") {
availableSpace = availableSpace - 1;
}
var width = Math.min(this.width, availableSpace);
completeLength = Math.round(width * ratio);
complete = Array(Math.max(0, completeLength + 1)).join(this.chars.complete);
incomplete = Array(Math.max(0, width - completeLength + 1)).join(this.chars.incomplete);
if (completeLength > 0)
complete = complete.slice(0, -1) + this.chars.head;
str = str.replace(":bar", complete + incomplete);
if (this.tokens) for (var key in this.tokens) str = str.replace(":" + key, this.tokens[key]);
if (this.lastDraw !== str) {
this.stream.cursorTo(0);
this.stream.write(str);
this.stream.clearLine(1);
this.lastDraw = str;
}
};
ProgressBar.prototype.update = function(ratio, tokens) {
var goal = Math.floor(ratio * this.total);
var delta = goal - this.curr;
this.tick(delta, tokens);
};
ProgressBar.prototype.interrupt = function(message) {
this.stream.clearLine();
this.stream.cursorTo(0);
this.stream.write(message);
this.stream.write("\n");
this.stream.write(this.lastDraw);
};
ProgressBar.prototype.terminate = function() {
if (this.clear) {
if (this.stream.clearLine) {
this.stream.clearLine();
this.stream.cursorTo(0);
}
} else {
this.stream.write("\n");
}
};
}
});
var require_progress = (0, import_chunk_AH6QHEOA.__commonJS)({
"../../node_modules/.pnpm/progress@2.0.3/node_modules/progress/index.js"(exports, module2) {
"use strict";
module2.exports = require_node_progress();
}
});
var import_progress = (0, import_chunk_AH6QHEOA.__toESM)(require_progress());
function getBar(text) {
return new import_progress.default(`> ${text} [:bar] :percent`, {
stream: process.stdout,
width: 20,
complete: "=",
incomplete: " ",
total: 100,
head: "",
clear: true
});
}
/*! Bundled license information:
progress/lib/node-progress.js:
(*!
* node-progress
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*)
*/

View file

@ -0,0 +1,66 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var chunk_AH6QHEOA_exports = {};
__export(chunk_AH6QHEOA_exports, {
__commonJS: () => __commonJS,
__privateAdd: () => __privateAdd,
__privateGet: () => __privateGet,
__privateSet: () => __privateSet,
__require: () => __require,
__toESM: () => __toESM
});
module.exports = __toCommonJS(chunk_AH6QHEOA_exports);
var __create = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __typeError = (msg) => {
throw TypeError(msg);
};
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps2 = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames2(from))
if (!__hasOwnProp2.call(to, key) && key !== except)
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
// 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 ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,49 @@
"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 __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 chunk_CWGQAQ3T_exports = {};
__export(chunk_CWGQAQ3T_exports, {
getHash: () => getHash
});
module.exports = __toCommonJS(chunk_CWGQAQ3T_exports);
var import_crypto = __toESM(require("crypto"));
var import_fs = __toESM(require("fs"));
function getHash(filePath) {
const hash = import_crypto.default.createHash("sha256");
const input = import_fs.default.createReadStream(filePath);
return new Promise((resolve) => {
input.on("readable", () => {
const data = input.read();
if (data) {
hash.update(data);
} else {
resolve(hash.digest("hex"));
}
});
});
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,70 @@
"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 __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 chunk_FKKOTNO6_exports = {};
__export(chunk_FKKOTNO6_exports, {
cleanupCache: () => cleanupCache
});
module.exports = __toCommonJS(chunk_FKKOTNO6_exports);
var import_chunk_ZAFWMCVK = require("./chunk-ZAFWMCVK.js");
var import_chunk_G7EM4XDM = require("./chunk-G7EM4XDM.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
var import_debug = __toESM(require("@prisma/debug"));
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_util = require("util");
var import_p_map = (0, import_chunk_AH6QHEOA.__toESM)((0, import_chunk_ZAFWMCVK.require_p_map)());
var import_rimraf = (0, import_chunk_AH6QHEOA.__toESM)((0, import_chunk_ZAFWMCVK.require_rimraf)());
var debug = (0, import_debug.default)("cleanupCache");
var del = (0, import_util.promisify)(import_rimraf.default);
async function cleanupCache(n = 5) {
try {
const rootCacheDir = await (0, import_chunk_G7EM4XDM.getRootCacheDir)();
if (!rootCacheDir) {
debug("no rootCacheDir found");
return;
}
const channel = "master";
const cacheDir = import_path.default.join(rootCacheDir, channel);
const dirs = await import_fs.default.promises.readdir(cacheDir);
const dirsWithMeta = await Promise.all(
dirs.map(async (dirName) => {
const dir = import_path.default.join(cacheDir, dirName);
const statResult = await import_fs.default.promises.stat(dir);
return {
dir,
created: statResult.birthtime
};
})
);
dirsWithMeta.sort((a, b) => a.created < b.created ? 1 : -1);
const dirsToRemove = dirsWithMeta.slice(n);
await (0, import_p_map.default)(dirsToRemove, (dir) => del(dir.dir), { concurrency: 20 });
} catch (e) {
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,44 @@
"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 __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 chunk_MX3HXAU2_exports = {};
__export(chunk_MX3HXAU2_exports, {
chmodPlusX: () => chmodPlusX
});
module.exports = __toCommonJS(chunk_MX3HXAU2_exports);
var import_fs = __toESM(require("fs"));
function chmodPlusX(file) {
if (process.platform === "win32") return;
const s = import_fs.default.statSync(file);
const newMode = s.mode | 64 | 8 | 1;
if (s.mode === newMode) {
return;
}
const base8 = newMode.toString(8).slice(-3);
import_fs.default.chmodSync(file, base8);
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,159 @@
"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 __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 chunk_PXQVM7NP_exports = {};
__export(chunk_PXQVM7NP_exports, {
allEngineEnvVarsSet: () => allEngineEnvVarsSet,
bold: () => bold,
deprecatedEnvVarMap: () => deprecatedEnvVarMap,
engineEnvVarMap: () => engineEnvVarMap,
getBinaryEnvVarPath: () => getBinaryEnvVarPath,
yellow: () => yellow
});
module.exports = __toCommonJS(chunk_PXQVM7NP_exports);
var import_debug = __toESM(require("@prisma/debug"));
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var FORCE_COLOR;
var NODE_DISABLE_COLORS;
var NO_COLOR;
var TERM;
var isTTY = true;
if (typeof process !== "undefined") {
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
isTTY = process.stdout && process.stdout.isTTY;
}
var $ = {
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
};
function init(x, y) {
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
let open = `\x1B[${x}m`, close = `\x1B[${y}m`;
return function(txt) {
if (!$.enabled || txt == null) return txt;
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
};
}
var reset = init(0, 0);
var bold = init(1, 22);
var dim = init(2, 22);
var italic = init(3, 23);
var underline = init(4, 24);
var inverse = init(7, 27);
var hidden = init(8, 28);
var strikethrough = init(9, 29);
var black = init(30, 39);
var red = init(31, 39);
var green = init(32, 39);
var yellow = init(33, 39);
var blue = init(34, 39);
var magenta = init(35, 39);
var cyan = init(36, 39);
var white = init(37, 39);
var gray = init(90, 39);
var grey = init(90, 39);
var bgBlack = init(40, 49);
var bgRed = init(41, 49);
var bgGreen = init(42, 49);
var bgYellow = init(43, 49);
var bgBlue = init(44, 49);
var bgMagenta = init(45, 49);
var bgCyan = init(46, 49);
var bgWhite = init(47, 49);
var debug = (0, import_debug.default)("prisma:fetch-engine:env");
var engineEnvVarMap = {
[
"query-engine"
/* QueryEngineBinary */
]: "PRISMA_QUERY_ENGINE_BINARY",
[
"libquery-engine"
/* QueryEngineLibrary */
]: "PRISMA_QUERY_ENGINE_LIBRARY",
[
"schema-engine"
/* SchemaEngineBinary */
]: "PRISMA_SCHEMA_ENGINE_BINARY"
};
var deprecatedEnvVarMap = {
[
"schema-engine"
/* SchemaEngineBinary */
]: "PRISMA_MIGRATION_ENGINE_BINARY"
};
function getBinaryEnvVarPath(binaryName) {
const envVar = getEnvVarToUse(binaryName);
if (process.env[envVar]) {
const envVarPath = import_path.default.resolve(process.cwd(), process.env[envVar]);
if (!import_fs.default.existsSync(envVarPath)) {
throw new Error(
`Env var ${bold(envVar)} is provided but provided path ${underline(process.env[envVar])} can't be resolved.`
);
}
debug(
`Using env var ${bold(envVar)} for binary ${bold(binaryName)}, which points to ${underline(
process.env[envVar]
)}`
);
return {
path: envVarPath,
fromEnvVar: envVar
};
}
return null;
}
function getEnvVarToUse(binaryType) {
const envVar = engineEnvVarMap[binaryType];
const deprecatedEnvVar = deprecatedEnvVarMap[binaryType];
if (deprecatedEnvVar && process.env[deprecatedEnvVar]) {
if (process.env[envVar]) {
console.warn(
`${yellow("prisma:warn")} Both ${bold(envVar)} and ${bold(deprecatedEnvVar)} are specified, ${bold(
envVar
)} takes precedence. ${bold(deprecatedEnvVar)} is deprecated.`
);
return envVar;
} else {
console.warn(
`${yellow("prisma:warn")} ${bold(deprecatedEnvVar)} environment variable is deprecated, please use ${bold(
envVar
)} instead`
);
return deprecatedEnvVar;
}
}
return envVar;
}
function allEngineEnvVarsSet(binaries) {
for (const binaryType of binaries) {
if (!getBinaryEnvVarPath(binaryType)) {
return false;
}
}
return true;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var chunk_X37PZICB_exports = {};
__export(chunk_X37PZICB_exports, {
BinaryType: () => BinaryType
});
module.exports = __toCommonJS(chunk_X37PZICB_exports);
var BinaryType = /* @__PURE__ */ ((BinaryType2) => {
BinaryType2["QueryEngineBinary"] = "query-engine";
BinaryType2["QueryEngineLibrary"] = "libquery-engine";
BinaryType2["SchemaEngineBinary"] = "schema-engine";
return BinaryType2;
})(BinaryType || {});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
export declare function cleanupCache(n?: number): Promise<void>;

View file

@ -0,0 +1,28 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var cleanupCache_exports = {};
__export(cleanupCache_exports, {
cleanupCache: () => import_chunk_FKKOTNO6.cleanupCache
});
module.exports = __toCommonJS(cleanupCache_exports);
var import_chunk_FKKOTNO6 = require("./chunk-FKKOTNO6.js");
var import_chunk_ZAFWMCVK = require("./chunk-ZAFWMCVK.js");
var import_chunk_G7EM4XDM = require("./chunk-G7EM4XDM.js");
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,27 @@
import { BinaryTarget } from '@prisma/get-platform';
import { BinaryType } from './BinaryType';
export declare const vercelPkgPathRegex: RegExp;
export type BinaryDownloadConfiguration = {
[binary in BinaryType]?: string;
};
export type BinaryPaths = {
[binary in BinaryType]?: {
[binaryTarget in BinaryTarget]: string;
};
};
export interface DownloadOptions {
binaries: BinaryDownloadConfiguration;
binaryTargets?: BinaryTarget[];
showProgress?: boolean;
progressCb?: (progress: number) => void;
version?: string;
skipDownload?: boolean;
failSilent?: boolean;
printVersion?: boolean;
skipCacheIntegrityCheck?: boolean;
}
export declare function download(options: DownloadOptions): Promise<BinaryPaths>;
export declare function getVersion(enginePath: string, binaryName: string): Promise<string | undefined>;
export declare function getBinaryName(binaryName: BinaryType, binaryTarget: BinaryTarget): string;
export declare function maybeCopyToTmp(file: string): Promise<string>;
export declare function plusX(file: any): void;

View file

@ -0,0 +1,41 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var download_exports = {};
__export(download_exports, {
download: () => import_chunk_DNEMWMSW.download,
getBinaryName: () => import_chunk_DNEMWMSW.getBinaryName,
getVersion: () => import_chunk_DNEMWMSW.getVersion,
maybeCopyToTmp: () => import_chunk_DNEMWMSW.maybeCopyToTmp,
plusX: () => import_chunk_DNEMWMSW.plusX,
vercelPkgPathRegex: () => import_chunk_DNEMWMSW.vercelPkgPathRegex
});
module.exports = __toCommonJS(download_exports);
var import_chunk_DNEMWMSW = require("./chunk-DNEMWMSW.js");
var import_chunk_4LX3XBNY = require("./chunk-4LX3XBNY.js");
var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
var import_chunk_FKKOTNO6 = require("./chunk-FKKOTNO6.js");
var import_chunk_BBQM2DBF = require("./chunk-BBQM2DBF.js");
var import_chunk_TIRVZJHP = require("./chunk-TIRVZJHP.js");
var import_chunk_ZAFWMCVK = require("./chunk-ZAFWMCVK.js");
var import_chunk_G7EM4XDM = require("./chunk-G7EM4XDM.js");
var import_chunk_PXQVM7NP = require("./chunk-PXQVM7NP.js");
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
var import_chunk_CWGQAQ3T = require("./chunk-CWGQAQ3T.js");
var import_chunk_OFSFRIEP = require("./chunk-OFSFRIEP.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,6 @@
export type DownloadResult = {
lastModified: string;
sha256: string | null;
zippedSha256: string | null;
};
export declare function downloadZip(url: string, target: string, progressCb?: (progress: number) => void): Promise<DownloadResult>;

View file

@ -0,0 +1,30 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var downloadZip_exports = {};
__export(downloadZip_exports, {
downloadZip: () => import_chunk_BBQM2DBF.downloadZip
});
module.exports = __toCommonJS(downloadZip_exports);
var import_chunk_BBQM2DBF = require("./chunk-BBQM2DBF.js");
var import_chunk_TIRVZJHP = require("./chunk-TIRVZJHP.js");
var import_chunk_ZAFWMCVK = require("./chunk-ZAFWMCVK.js");
var import_chunk_G7EM4XDM = require("./chunk-G7EM4XDM.js");
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
var import_chunk_OFSFRIEP = require("./chunk-OFSFRIEP.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,14 @@
import { BinaryType } from './BinaryType';
export declare const engineEnvVarMap: {
"query-engine": string;
"libquery-engine": string;
"schema-engine": string;
};
export declare const deprecatedEnvVarMap: Partial<typeof engineEnvVarMap>;
type PathFromEnvValue = {
path: string;
fromEnvVar: string;
};
export declare function getBinaryEnvVarPath(binaryName: BinaryType): PathFromEnvValue | null;
export declare function allEngineEnvVarsSet(binaries: string[]): boolean;
export {};

View file

@ -0,0 +1,29 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var env_exports = {};
__export(env_exports, {
allEngineEnvVarsSet: () => import_chunk_PXQVM7NP.allEngineEnvVarsSet,
deprecatedEnvVarMap: () => import_chunk_PXQVM7NP.deprecatedEnvVarMap,
engineEnvVarMap: () => import_chunk_PXQVM7NP.engineEnvVarMap,
getBinaryEnvVarPath: () => import_chunk_PXQVM7NP.getBinaryEnvVarPath
});
module.exports = __toCommonJS(env_exports);
var import_chunk_PXQVM7NP = require("./chunk-PXQVM7NP.js");
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1 @@
export declare function getHash(filePath: string): Promise<string>;

View file

@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var getHash_exports = {};
__export(getHash_exports, {
getHash: () => import_chunk_CWGQAQ3T.getHash
});
module.exports = __toCommonJS(getHash_exports);
var import_chunk_CWGQAQ3T = require("./chunk-CWGQAQ3T.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,3 @@
import { HttpProxyAgent } from 'http-proxy-agent';
import { HttpsProxyAgent } from 'https-proxy-agent';
export declare function getProxyAgent(url: string): HttpProxyAgent<string> | HttpsProxyAgent<string> | undefined;

View file

@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var getProxyAgent_exports = {};
__export(getProxyAgent_exports, {
getProxyAgent: () => import_chunk_OFSFRIEP.getProxyAgent
});
module.exports = __toCommonJS(getProxyAgent_exports);
var import_chunk_OFSFRIEP = require("./chunk-OFSFRIEP.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,5 @@
export * from './BinaryType';
export * from './download';
export * from './env';
export { getProxyAgent } from './getProxyAgent';
export { getCacheDir, overwriteFile } from './utils';

View file

@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var dist_exports = {};
__export(dist_exports, {
BinaryType: () => import_chunk_X37PZICB.BinaryType,
allEngineEnvVarsSet: () => import_chunk_PXQVM7NP.allEngineEnvVarsSet,
deprecatedEnvVarMap: () => import_chunk_PXQVM7NP.deprecatedEnvVarMap,
download: () => import_chunk_DNEMWMSW.download,
engineEnvVarMap: () => import_chunk_PXQVM7NP.engineEnvVarMap,
getBinaryEnvVarPath: () => import_chunk_PXQVM7NP.getBinaryEnvVarPath,
getBinaryName: () => import_chunk_DNEMWMSW.getBinaryName,
getCacheDir: () => import_chunk_G7EM4XDM.getCacheDir,
getProxyAgent: () => import_chunk_OFSFRIEP.getProxyAgent,
getVersion: () => import_chunk_DNEMWMSW.getVersion,
maybeCopyToTmp: () => import_chunk_DNEMWMSW.maybeCopyToTmp,
overwriteFile: () => import_chunk_G7EM4XDM.overwriteFile,
plusX: () => import_chunk_DNEMWMSW.plusX,
vercelPkgPathRegex: () => import_chunk_DNEMWMSW.vercelPkgPathRegex
});
module.exports = __toCommonJS(dist_exports);
var import_chunk_DNEMWMSW = require("./chunk-DNEMWMSW.js");
var import_chunk_4LX3XBNY = require("./chunk-4LX3XBNY.js");
var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
var import_chunk_FKKOTNO6 = require("./chunk-FKKOTNO6.js");
var import_chunk_BBQM2DBF = require("./chunk-BBQM2DBF.js");
var import_chunk_TIRVZJHP = require("./chunk-TIRVZJHP.js");
var import_chunk_ZAFWMCVK = require("./chunk-ZAFWMCVK.js");
var import_chunk_G7EM4XDM = require("./chunk-G7EM4XDM.js");
var import_chunk_PXQVM7NP = require("./chunk-PXQVM7NP.js");
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
var import_chunk_CWGQAQ3T = require("./chunk-CWGQAQ3T.js");
var import_chunk_OFSFRIEP = require("./chunk-OFSFRIEP.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,2 @@
import Progress from 'progress';
export declare function getBar(text: any): Progress;

View file

@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var log_exports = {};
__export(log_exports, {
getBar: () => import_chunk_4LX3XBNY.getBar
});
module.exports = __toCommonJS(log_exports);
var import_chunk_4LX3XBNY = require("./chunk-4LX3XBNY.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,374 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var multipart_parser_ITART6UP_exports = {};
__export(multipart_parser_ITART6UP_exports, {
toFormData: () => toFormData
});
module.exports = __toCommonJS(multipart_parser_ITART6UP_exports);
var import_chunk_TIRVZJHP = require("./chunk-TIRVZJHP.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
var s = 0;
var S = {
START_BOUNDARY: s++,
HEADER_FIELD_START: s++,
HEADER_FIELD: s++,
HEADER_VALUE_START: s++,
HEADER_VALUE: s++,
HEADER_VALUE_ALMOST_DONE: s++,
HEADERS_ALMOST_DONE: s++,
PART_DATA_START: s++,
PART_DATA: s++,
END: s++
};
var f = 1;
var F = {
PART_BOUNDARY: f,
LAST_BOUNDARY: f *= 2
};
var LF = 10;
var CR = 13;
var SPACE = 32;
var HYPHEN = 45;
var COLON = 58;
var A = 97;
var Z = 122;
var lower = (c) => c | 32;
var noop = () => {
};
var MultipartParser = class {
/**
* @param {string} boundary
*/
constructor(boundary) {
this.index = 0;
this.flags = 0;
this.onHeaderEnd = noop;
this.onHeaderField = noop;
this.onHeadersEnd = noop;
this.onHeaderValue = noop;
this.onPartBegin = noop;
this.onPartData = noop;
this.onPartEnd = noop;
this.boundaryChars = {};
boundary = "\r\n--" + boundary;
const ui8a = new Uint8Array(boundary.length);
for (let i = 0; i < boundary.length; i++) {
ui8a[i] = boundary.charCodeAt(i);
this.boundaryChars[ui8a[i]] = true;
}
this.boundary = ui8a;
this.lookbehind = new Uint8Array(this.boundary.length + 8);
this.state = S.START_BOUNDARY;
}
/**
* @param {Uint8Array} data
*/
write(data) {
let i = 0;
const length_ = data.length;
let previousIndex = this.index;
let { lookbehind, boundary, boundaryChars, index, state, flags } = this;
const boundaryLength = this.boundary.length;
const boundaryEnd = boundaryLength - 1;
const bufferLength = data.length;
let c;
let cl;
const mark = (name) => {
this[name + "Mark"] = i;
};
const clear = (name) => {
delete this[name + "Mark"];
};
const callback = (callbackSymbol, start, end, ui8a) => {
if (start === void 0 || start !== end) {
this[callbackSymbol](ui8a && ui8a.subarray(start, end));
}
};
const dataCallback = (name, clear2) => {
const markSymbol = name + "Mark";
if (!(markSymbol in this)) {
return;
}
if (clear2) {
callback(name, this[markSymbol], i, data);
delete this[markSymbol];
} else {
callback(name, this[markSymbol], data.length, data);
this[markSymbol] = 0;
}
};
for (i = 0; i < length_; i++) {
c = data[i];
switch (state) {
case S.START_BOUNDARY:
if (index === boundary.length - 2) {
if (c === HYPHEN) {
flags |= F.LAST_BOUNDARY;
} else if (c !== CR) {
return;
}
index++;
break;
} else if (index - 1 === boundary.length - 2) {
if (flags & F.LAST_BOUNDARY && c === HYPHEN) {
state = S.END;
flags = 0;
} else if (!(flags & F.LAST_BOUNDARY) && c === LF) {
index = 0;
callback("onPartBegin");
state = S.HEADER_FIELD_START;
} else {
return;
}
break;
}
if (c !== boundary[index + 2]) {
index = -2;
}
if (c === boundary[index + 2]) {
index++;
}
break;
case S.HEADER_FIELD_START:
state = S.HEADER_FIELD;
mark("onHeaderField");
index = 0;
// falls through
case S.HEADER_FIELD:
if (c === CR) {
clear("onHeaderField");
state = S.HEADERS_ALMOST_DONE;
break;
}
index++;
if (c === HYPHEN) {
break;
}
if (c === COLON) {
if (index === 1) {
return;
}
dataCallback("onHeaderField", true);
state = S.HEADER_VALUE_START;
break;
}
cl = lower(c);
if (cl < A || cl > Z) {
return;
}
break;
case S.HEADER_VALUE_START:
if (c === SPACE) {
break;
}
mark("onHeaderValue");
state = S.HEADER_VALUE;
// falls through
case S.HEADER_VALUE:
if (c === CR) {
dataCallback("onHeaderValue", true);
callback("onHeaderEnd");
state = S.HEADER_VALUE_ALMOST_DONE;
}
break;
case S.HEADER_VALUE_ALMOST_DONE:
if (c !== LF) {
return;
}
state = S.HEADER_FIELD_START;
break;
case S.HEADERS_ALMOST_DONE:
if (c !== LF) {
return;
}
callback("onHeadersEnd");
state = S.PART_DATA_START;
break;
case S.PART_DATA_START:
state = S.PART_DATA;
mark("onPartData");
// falls through
case S.PART_DATA:
previousIndex = index;
if (index === 0) {
i += boundaryEnd;
while (i < bufferLength && !(data[i] in boundaryChars)) {
i += boundaryLength;
}
i -= boundaryEnd;
c = data[i];
}
if (index < boundary.length) {
if (boundary[index] === c) {
if (index === 0) {
dataCallback("onPartData", true);
}
index++;
} else {
index = 0;
}
} else if (index === boundary.length) {
index++;
if (c === CR) {
flags |= F.PART_BOUNDARY;
} else if (c === HYPHEN) {
flags |= F.LAST_BOUNDARY;
} else {
index = 0;
}
} else if (index - 1 === boundary.length) {
if (flags & F.PART_BOUNDARY) {
index = 0;
if (c === LF) {
flags &= ~F.PART_BOUNDARY;
callback("onPartEnd");
callback("onPartBegin");
state = S.HEADER_FIELD_START;
break;
}
} else if (flags & F.LAST_BOUNDARY) {
if (c === HYPHEN) {
callback("onPartEnd");
state = S.END;
flags = 0;
} else {
index = 0;
}
} else {
index = 0;
}
}
if (index > 0) {
lookbehind[index - 1] = c;
} else if (previousIndex > 0) {
const _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);
callback("onPartData", 0, previousIndex, _lookbehind);
previousIndex = 0;
mark("onPartData");
i--;
}
break;
case S.END:
break;
default:
throw new Error(`Unexpected state entered: ${state}`);
}
}
dataCallback("onHeaderField");
dataCallback("onHeaderValue");
dataCallback("onPartData");
this.index = index;
this.state = state;
this.flags = flags;
}
end() {
if (this.state === S.HEADER_FIELD_START && this.index === 0 || this.state === S.PART_DATA && this.index === this.boundary.length) {
this.onPartEnd();
} else if (this.state !== S.END) {
throw new Error("MultipartParser.end(): stream ended unexpectedly");
}
}
};
function _fileName(headerValue) {
const m = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
if (!m) {
return;
}
const match = m[2] || m[3] || "";
let filename = match.slice(match.lastIndexOf("\\") + 1);
filename = filename.replace(/%22/g, '"');
filename = filename.replace(/&#(\d{4});/g, (m2, code) => {
return String.fromCharCode(code);
});
return filename;
}
async function toFormData(Body, ct) {
if (!/multipart/i.test(ct)) {
throw new TypeError("Failed to fetch");
}
const m = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
if (!m) {
throw new TypeError("no or bad content-type header, no multipart boundary");
}
const parser = new MultipartParser(m[1] || m[2]);
let headerField;
let headerValue;
let entryValue;
let entryName;
let contentType;
let filename;
const entryChunks = [];
const formData = new import_chunk_TIRVZJHP.FormData();
const onPartData = (ui8a) => {
entryValue += decoder.decode(ui8a, { stream: true });
};
const appendToFile = (ui8a) => {
entryChunks.push(ui8a);
};
const appendFileToFormData = () => {
const file = new import_chunk_TIRVZJHP.file_default(entryChunks, filename, { type: contentType });
formData.append(entryName, file);
};
const appendEntryToFormData = () => {
formData.append(entryName, entryValue);
};
const decoder = new TextDecoder("utf-8");
decoder.decode();
parser.onPartBegin = function() {
parser.onPartData = onPartData;
parser.onPartEnd = appendEntryToFormData;
headerField = "";
headerValue = "";
entryValue = "";
entryName = "";
contentType = "";
filename = null;
entryChunks.length = 0;
};
parser.onHeaderField = function(ui8a) {
headerField += decoder.decode(ui8a, { stream: true });
};
parser.onHeaderValue = function(ui8a) {
headerValue += decoder.decode(ui8a, { stream: true });
};
parser.onHeaderEnd = function() {
headerValue += decoder.decode();
headerField = headerField.toLowerCase();
if (headerField === "content-disposition") {
const m2 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
if (m2) {
entryName = m2[2] || m2[3] || "";
}
filename = _fileName(headerValue);
if (filename) {
parser.onPartData = appendToFile;
parser.onPartEnd = appendFileToFormData;
}
} else if (headerField === "content-type") {
contentType = headerValue;
}
headerValue = "";
headerField = "";
};
for await (const chunk of Body) {
parser.write(chunk);
}
parser.end();
return formData;
}

View file

@ -0,0 +1,11 @@
import { BinaryTarget } from '@prisma/get-platform';
export declare function getRootCacheDir(): Promise<string | null>;
export declare function getCacheDir(channel: string, version: string, binaryTarget: string): Promise<string | null>;
export declare function getDownloadUrl({ channel, version, binaryTarget, binaryName, extension, }: {
channel: string;
version: string;
binaryTarget: BinaryTarget;
binaryName: string;
extension?: string;
}): string;
export declare function overwriteFile(sourcePath: string, targetPath: string): Promise<void>;

View file

@ -0,0 +1,29 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var utils_exports = {};
__export(utils_exports, {
getCacheDir: () => import_chunk_G7EM4XDM.getCacheDir,
getDownloadUrl: () => import_chunk_G7EM4XDM.getDownloadUrl,
getRootCacheDir: () => import_chunk_G7EM4XDM.getRootCacheDir,
overwriteFile: () => import_chunk_G7EM4XDM.overwriteFile
});
module.exports = __toCommonJS(utils_exports);
var import_chunk_G7EM4XDM = require("./chunk-G7EM4XDM.js");
var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");

View file

@ -0,0 +1,59 @@
{
"name": "@prisma/fetch-engine",
"version": "6.1.0",
"description": "This package is intended for Prisma's internal use",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "Apache-2.0",
"author": "Tim Suchanek <suchanek@prisma.io>",
"homepage": "https://www.prisma.io",
"repository": {
"type": "git",
"url": "https://github.com/prisma/prisma.git",
"directory": "packages/fetch-engine"
},
"bugs": "https://github.com/prisma/prisma/issues",
"enginesOverride": {},
"devDependencies": {
"@swc/core": "1.10.1",
"@swc/jest": "0.2.37",
"@types/jest": "29.5.14",
"@types/node": "18.19.31",
"@types/progress": "2.0.7",
"del": "6.1.1",
"execa": "5.1.1",
"find-cache-dir": "5.0.0",
"fs-extra": "11.1.1",
"hasha": "5.2.2",
"http-proxy-agent": "7.0.2",
"https-proxy-agent": "7.0.5",
"jest": "29.7.0",
"kleur": "4.1.5",
"node-fetch": "3.3.2",
"p-filter": "2.1.0",
"p-map": "4.0.0",
"p-retry": "4.6.2",
"progress": "2.0.3",
"rimraf": "3.0.2",
"strip-ansi": "6.0.1",
"temp-dir": "2.0.0",
"tempy": "1.0.1",
"timeout-signal": "2.0.0",
"typescript": "5.4.5"
},
"dependencies": {
"@prisma/engines-version": "6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959",
"@prisma/debug": "6.1.0",
"@prisma/get-platform": "6.1.0"
},
"files": [
"README.md",
"dist"
],
"sideEffects": false,
"scripts": {
"dev": "DEV=true tsx helpers/build.ts",
"build": "tsx helpers/build.ts",
"test": "jest"
}
}