@prisma/fetch-engine 7.2.0 → 7.3.0-integration-prisma6-fix-cloudflare-engine.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
1
  export declare enum BinaryType {
2
+ QueryEngineBinary = "query-engine",
3
+ QueryEngineLibrary = "libquery-engine",
2
4
  SchemaEngineBinary = "schema-engine"
3
5
  }
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var BinaryType_exports = {};
20
20
  __export(BinaryType_exports, {
21
- BinaryType: () => import_chunk_66KG5WKV.BinaryType
21
+ BinaryType: () => import_chunk_X37PZICB.BinaryType
22
22
  });
23
23
  module.exports = __toCommonJS(BinaryType_exports);
24
- var import_chunk_66KG5WKV = require("./chunk-66KG5WKV.js");
25
- var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
24
+ var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
25
+ var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
@@ -22,4 +22,4 @@ __export(chmodPlusX_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(chmodPlusX_exports);
24
24
  var import_chunk_7JLQJWOR = require("./chunk-7JLQJWOR.js");
25
- var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
25
+ var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
@@ -26,22 +26,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_4GGGRRIN_exports = {};
30
- __export(chunk_4GGGRRIN_exports, {
29
+ var chunk_3VVCXIQ5_exports = {};
30
+ __export(chunk_3VVCXIQ5_exports, {
31
31
  cleanupCache: () => cleanupCache
32
32
  });
33
- module.exports = __toCommonJS(chunk_4GGGRRIN_exports);
34
- var import_chunk_7AOUSONO = require("./chunk-7AOUSONO.js");
35
- var import_chunk_4MDZEOKU = require("./chunk-4MDZEOKU.js");
36
- var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
33
+ module.exports = __toCommonJS(chunk_3VVCXIQ5_exports);
34
+ var import_chunk_FSAAZH62 = require("./chunk-FSAAZH62.js");
35
+ var import_chunk_LONQL55G = require("./chunk-LONQL55G.js");
36
+ var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
37
37
  var import_node_fs = __toESM(require("node:fs"));
38
38
  var import_node_path = __toESM(require("node:path"));
39
39
  var import_debug = __toESM(require("@prisma/debug"));
40
- var import_p_map = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_7AOUSONO.require_p_map)());
40
+ var import_p_map = (0, import_chunk_QGM4M3NI.__toESM)((0, import_chunk_FSAAZH62.require_p_map)());
41
41
  var debug = (0, import_debug.default)("cleanupCache");
42
42
  async function cleanupCache(n = 5) {
43
43
  try {
44
- const rootCacheDir = await (0, import_chunk_4MDZEOKU.getRootCacheDir)();
44
+ const rootCacheDir = await (0, import_chunk_LONQL55G.getRootCacheDir)();
45
45
  if (!rootCacheDir) {
46
46
  debug("no rootCacheDir found");
47
47
  return;
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_2JV57QBZ_exports = {};
30
- __export(chunk_2JV57QBZ_exports, {
29
+ var chunk_4C3J5AMP_exports = {};
30
+ __export(chunk_4C3J5AMP_exports, {
31
31
  download: () => download,
32
32
  getBinaryName: () => getBinaryName,
33
33
  getVersion: () => getVersion,
@@ -35,15 +35,15 @@ __export(chunk_2JV57QBZ_exports, {
35
35
  plusX: () => plusX,
36
36
  vercelPkgPathRegex: () => vercelPkgPathRegex
37
37
  });
38
- module.exports = __toCommonJS(chunk_2JV57QBZ_exports);
39
- var import_chunk_5564WBCW = require("./chunk-5564WBCW.js");
38
+ module.exports = __toCommonJS(chunk_4C3J5AMP_exports);
39
+ var import_chunk_MWVY55RY = require("./chunk-MWVY55RY.js");
40
40
  var import_chunk_7JLQJWOR = require("./chunk-7JLQJWOR.js");
41
- var import_chunk_4GGGRRIN = require("./chunk-4GGGRRIN.js");
42
- var import_chunk_FNYZ6ABB = require("./chunk-FNYZ6ABB.js");
43
- var import_chunk_4MDZEOKU = require("./chunk-4MDZEOKU.js");
44
- var import_chunk_XNR2KDTK = require("./chunk-XNR2KDTK.js");
41
+ var import_chunk_3VVCXIQ5 = require("./chunk-3VVCXIQ5.js");
42
+ var import_chunk_CY52DY2B = require("./chunk-CY52DY2B.js");
43
+ var import_chunk_LONQL55G = require("./chunk-LONQL55G.js");
44
+ var import_chunk_QFA3XBMW = require("./chunk-QFA3XBMW.js");
45
45
  var import_chunk_FKGWOTGU = require("./chunk-FKGWOTGU.js");
46
- var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
46
+ var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
47
47
  var import_node_fs = __toESM(require("node:fs"));
48
48
  var import_node_path = __toESM(require("node:path"));
49
49
  var import_node_util = require("node:util");
@@ -68,12 +68,12 @@ var import_node_buffer2 = require("node:buffer");
68
68
  var import_node_child_process3 = require("node:child_process");
69
69
  var import_node_util2 = require("node:util");
70
70
  var import_node_process4 = __toESM(require("node:process"));
71
- var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
71
+ var require_windows = (0, import_chunk_QGM4M3NI.__commonJS)({
72
72
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
73
73
  "use strict";
74
74
  module2.exports = isexe;
75
75
  isexe.sync = sync;
76
- var fs2 = (0, import_chunk_2ESYSVXG.__require)("fs");
76
+ var fs2 = (0, import_chunk_QGM4M3NI.__require)("fs");
77
77
  function checkPathExt(path4, options) {
78
78
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
79
79
  if (!pathext) {
@@ -107,12 +107,12 @@ var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
107
107
  }
108
108
  }
109
109
  });
110
- var require_mode = (0, import_chunk_2ESYSVXG.__commonJS)({
110
+ var require_mode = (0, import_chunk_QGM4M3NI.__commonJS)({
111
111
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module2) {
112
112
  "use strict";
113
113
  module2.exports = isexe;
114
114
  isexe.sync = sync;
115
- var fs2 = (0, import_chunk_2ESYSVXG.__require)("fs");
115
+ var fs2 = (0, import_chunk_QGM4M3NI.__require)("fs");
116
116
  function isexe(path4, options, cb) {
117
117
  fs2.stat(path4, function(er, stat) {
118
118
  cb(er, er ? false : checkStat(stat, options));
@@ -139,10 +139,10 @@ var require_mode = (0, import_chunk_2ESYSVXG.__commonJS)({
139
139
  }
140
140
  }
141
141
  });
142
- var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
142
+ var require_isexe = (0, import_chunk_QGM4M3NI.__commonJS)({
143
143
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module2) {
144
144
  "use strict";
145
- var fs2 = (0, import_chunk_2ESYSVXG.__require)("fs");
145
+ var fs2 = (0, import_chunk_QGM4M3NI.__require)("fs");
146
146
  var core;
147
147
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
148
148
  core = require_windows();
@@ -193,11 +193,11 @@ var require_isexe = (0, import_chunk_2ESYSVXG.__commonJS)({
193
193
  }
194
194
  }
195
195
  });
196
- var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
196
+ var require_which = (0, import_chunk_QGM4M3NI.__commonJS)({
197
197
  "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module2) {
198
198
  "use strict";
199
199
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
200
- var path4 = (0, import_chunk_2ESYSVXG.__require)("path");
200
+ var path4 = (0, import_chunk_QGM4M3NI.__require)("path");
201
201
  var COLON = isWindows ? ";" : ":";
202
202
  var isexe = require_isexe();
203
203
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -288,7 +288,7 @@ var require_which = (0, import_chunk_2ESYSVXG.__commonJS)({
288
288
  which.sync = whichSync;
289
289
  }
290
290
  });
291
- var require_path_key = (0, import_chunk_2ESYSVXG.__commonJS)({
291
+ var require_path_key = (0, import_chunk_QGM4M3NI.__commonJS)({
292
292
  "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module2) {
293
293
  "use strict";
294
294
  var pathKey2 = (options = {}) => {
@@ -303,10 +303,10 @@ var require_path_key = (0, import_chunk_2ESYSVXG.__commonJS)({
303
303
  module2.exports.default = pathKey2;
304
304
  }
305
305
  });
306
- var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
306
+ var require_resolveCommand = (0, import_chunk_QGM4M3NI.__commonJS)({
307
307
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
308
308
  "use strict";
309
- var path4 = (0, import_chunk_2ESYSVXG.__require)("path");
309
+ var path4 = (0, import_chunk_QGM4M3NI.__require)("path");
310
310
  var which = require_which();
311
311
  var getPathKey = require_path_key();
312
312
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -343,7 +343,7 @@ var require_resolveCommand = (0, import_chunk_2ESYSVXG.__commonJS)({
343
343
  module2.exports = resolveCommand;
344
344
  }
345
345
  });
346
- var require_escape = (0, import_chunk_2ESYSVXG.__commonJS)({
346
+ var require_escape = (0, import_chunk_QGM4M3NI.__commonJS)({
347
347
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module2) {
348
348
  "use strict";
349
349
  var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
@@ -366,13 +366,13 @@ var require_escape = (0, import_chunk_2ESYSVXG.__commonJS)({
366
366
  module2.exports.argument = escapeArgument;
367
367
  }
368
368
  });
369
- var require_shebang_regex = (0, import_chunk_2ESYSVXG.__commonJS)({
369
+ var require_shebang_regex = (0, import_chunk_QGM4M3NI.__commonJS)({
370
370
  "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module2) {
371
371
  "use strict";
372
372
  module2.exports = /^#!(.*)/;
373
373
  }
374
374
  });
375
- var require_shebang_command = (0, import_chunk_2ESYSVXG.__commonJS)({
375
+ var require_shebang_command = (0, import_chunk_QGM4M3NI.__commonJS)({
376
376
  "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module2) {
377
377
  "use strict";
378
378
  var shebangRegex = require_shebang_regex();
@@ -390,10 +390,10 @@ var require_shebang_command = (0, import_chunk_2ESYSVXG.__commonJS)({
390
390
  };
391
391
  }
392
392
  });
393
- var require_readShebang = (0, import_chunk_2ESYSVXG.__commonJS)({
393
+ var require_readShebang = (0, import_chunk_QGM4M3NI.__commonJS)({
394
394
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) {
395
395
  "use strict";
396
- var fs2 = (0, import_chunk_2ESYSVXG.__require)("fs");
396
+ var fs2 = (0, import_chunk_QGM4M3NI.__require)("fs");
397
397
  var shebangCommand = require_shebang_command();
398
398
  function readShebang(command) {
399
399
  const size = 150;
@@ -410,10 +410,10 @@ var require_readShebang = (0, import_chunk_2ESYSVXG.__commonJS)({
410
410
  module2.exports = readShebang;
411
411
  }
412
412
  });
413
- var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
413
+ var require_parse = (0, import_chunk_QGM4M3NI.__commonJS)({
414
414
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
415
415
  "use strict";
416
- var path4 = (0, import_chunk_2ESYSVXG.__require)("path");
416
+ var path4 = (0, import_chunk_QGM4M3NI.__require)("path");
417
417
  var resolveCommand = require_resolveCommand();
418
418
  var escape = require_escape();
419
419
  var readShebang = require_readShebang();
@@ -470,7 +470,7 @@ var require_parse = (0, import_chunk_2ESYSVXG.__commonJS)({
470
470
  module2.exports = parse;
471
471
  }
472
472
  });
473
- var require_enoent = (0, import_chunk_2ESYSVXG.__commonJS)({
473
+ var require_enoent = (0, import_chunk_QGM4M3NI.__commonJS)({
474
474
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module2) {
475
475
  "use strict";
476
476
  var isWin = process.platform === "win32";
@@ -518,10 +518,10 @@ var require_enoent = (0, import_chunk_2ESYSVXG.__commonJS)({
518
518
  };
519
519
  }
520
520
  });
521
- var require_cross_spawn = (0, import_chunk_2ESYSVXG.__commonJS)({
521
+ var require_cross_spawn = (0, import_chunk_QGM4M3NI.__commonJS)({
522
522
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module2) {
523
523
  "use strict";
524
- var cp = (0, import_chunk_2ESYSVXG.__require)("child_process");
524
+ var cp = (0, import_chunk_QGM4M3NI.__require)("child_process");
525
525
  var parse = require_parse();
526
526
  var enoent = require_enoent();
527
527
  function spawn(command, args, options) {
@@ -543,10 +543,10 @@ var require_cross_spawn = (0, import_chunk_2ESYSVXG.__commonJS)({
543
543
  module2.exports._enoent = enoent;
544
544
  }
545
545
  });
546
- var require_merge_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
546
+ var require_merge_stream = (0, import_chunk_QGM4M3NI.__commonJS)({
547
547
  "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module2) {
548
548
  "use strict";
549
- var { PassThrough } = (0, import_chunk_2ESYSVXG.__require)("stream");
549
+ var { PassThrough } = (0, import_chunk_QGM4M3NI.__require)("stream");
550
550
  module2.exports = function() {
551
551
  var sources = [];
552
552
  var output = new PassThrough({ objectMode: true });
@@ -581,7 +581,7 @@ var require_merge_stream = (0, import_chunk_2ESYSVXG.__commonJS)({
581
581
  };
582
582
  }
583
583
  });
584
- var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
584
+ var require_package = (0, import_chunk_QGM4M3NI.__commonJS)({
585
585
  "package.json"(exports, module2) {
586
586
  module2.exports = {
587
587
  name: "@prisma/fetch-engine",
@@ -600,7 +600,7 @@ var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
600
600
  bugs: "https://github.com/prisma/prisma/issues",
601
601
  enginesOverride: {},
602
602
  devDependencies: {
603
- "@types/node": "~20.19.24",
603
+ "@types/node": "18.19.76",
604
604
  "@types/progress": "2.0.7",
605
605
  del: "6.1.1",
606
606
  execa: "8.0.1",
@@ -622,7 +622,7 @@ var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
622
622
  },
623
623
  dependencies: {
624
624
  "@prisma/debug": "workspace:*",
625
- "@prisma/engines-version": "7.2.0-4.0c8ef2ce45c83248ab3df073180d5eda9e8be7a3",
625
+ "@prisma/engines-version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
626
626
  "@prisma/get-platform": "workspace:*"
627
627
  },
628
628
  scripts: {
@@ -639,7 +639,7 @@ var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
639
639
  };
640
640
  }
641
641
  });
642
- var import_cross_spawn = (0, import_chunk_2ESYSVXG.__toESM)(require_cross_spawn(), 1);
642
+ var import_cross_spawn = (0, import_chunk_QGM4M3NI.__toESM)(require_cross_spawn(), 1);
643
643
  function stripFinalNewline(input) {
644
644
  const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
645
645
  const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
@@ -1739,7 +1739,7 @@ var stringMethods = {
1739
1739
  getFinalChunk: getFinalStringChunk,
1740
1740
  finalize: getContentsProp
1741
1741
  };
1742
- var import_merge_stream = (0, import_chunk_2ESYSVXG.__toESM)(require_merge_stream(), 1);
1742
+ var import_merge_stream = (0, import_chunk_QGM4M3NI.__toESM)(require_merge_stream(), 1);
1743
1743
  var validateInputOptions = (input) => {
1744
1744
  if (input !== void 0) {
1745
1745
  throw new TypeError("The `input` and `inputFile` options cannot be both set.");
@@ -2140,7 +2140,7 @@ function create$(options) {
2140
2140
  return $2;
2141
2141
  }
2142
2142
  var $ = create$();
2143
- var import_fs_extra = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_4MDZEOKU.require_lib)());
2143
+ var import_fs_extra = (0, import_chunk_QGM4M3NI.__toESM)((0, import_chunk_LONQL55G.require_lib)());
2144
2144
  async function pMap(iterable, mapper, {
2145
2145
  concurrency = Number.POSITIVE_INFINITY,
2146
2146
  stopOnError = true,
@@ -2270,7 +2270,7 @@ async function pFilter(iterable, filterer, options) {
2270
2270
  );
2271
2271
  return values.filter((value) => Boolean(value[0])).map((value) => value[1]);
2272
2272
  }
2273
- var import_temp_dir = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_FNYZ6ABB.require_temp_dir)());
2273
+ var import_temp_dir = (0, import_chunk_QGM4M3NI.__toESM)((0, import_chunk_CY52DY2B.require_temp_dir)());
2274
2274
  var { enginesOverride } = require_package();
2275
2275
  var debug = (0, import_debug.default)("prisma:fetch-engine:download");
2276
2276
  var exists = (0, import_node_util.promisify)(import_node_fs.default.exists);
@@ -2285,16 +2285,18 @@ async function download(options) {
2285
2285
  options.skipCacheIntegrityCheck = true;
2286
2286
  }
2287
2287
  const { binaryTarget, ...os2 } = await (0, import_get_platform.getPlatformInfo)();
2288
- if (os2.targetDistro && ["nixos"].includes(os2.targetDistro) && !(0, import_chunk_XNR2KDTK.allEngineEnvVarsSet)(Object.keys(options.binaries))) {
2288
+ if (os2.targetDistro && ["nixos"].includes(os2.targetDistro) && !(0, import_chunk_QFA3XBMW.allEngineEnvVarsSet)(Object.keys(options.binaries))) {
2289
2289
  console.error(
2290
- `${(0, import_chunk_XNR2KDTK.yellow)("Warning")} Precompiled engine files are not available for ${os2.targetDistro}, please provide the paths via environment variables, see https://pris.ly/d/custom-engines`
2290
+ `${(0, import_chunk_QFA3XBMW.yellow)("Warning")} Precompiled engine files are not available for ${os2.targetDistro}, please provide the paths via environment variables, see https://pris.ly/d/custom-engines`
2291
2291
  );
2292
2292
  } else if (["freebsd11", "freebsd12", "freebsd13", "freebsd14", "freebsd15", "openbsd", "netbsd"].includes(binaryTarget)) {
2293
2293
  console.error(
2294
- `${(0, import_chunk_XNR2KDTK.yellow)(
2294
+ `${(0, import_chunk_QFA3XBMW.yellow)(
2295
2295
  "Warning"
2296
2296
  )} Precompiled engine files are not available for ${binaryTarget}. Read more about building your own engines at https://pris.ly/d/build-engines`
2297
2297
  );
2298
+ } else if ("libquery-engine" in options.binaries) {
2299
+ (0, import_get_platform.assertNodeAPISupported)();
2298
2300
  }
2299
2301
  const opts = {
2300
2302
  ...options,
@@ -2312,7 +2314,7 @@ async function download(options) {
2312
2314
  binaryTarget: binaryTarget2,
2313
2315
  fileName,
2314
2316
  targetFilePath,
2315
- envVarPath: (0, import_chunk_XNR2KDTK.getBinaryEnvVarPath)(binaryName)?.path,
2317
+ envVarPath: (0, import_chunk_QFA3XBMW.getBinaryEnvVarPath)(binaryName)?.path,
2316
2318
  skipCacheIntegrityCheck: !!opts.skipCacheIntegrityCheck
2317
2319
  };
2318
2320
  })
@@ -2335,7 +2337,7 @@ async function download(options) {
2335
2337
  return shouldDownload;
2336
2338
  });
2337
2339
  if (binariesToDownload.length > 0) {
2338
- const cleanupPromise = (0, import_chunk_4GGGRRIN.cleanupCache)();
2340
+ const cleanupPromise = (0, import_chunk_3VVCXIQ5.cleanupCache)();
2339
2341
  let finishBar;
2340
2342
  let setProgress;
2341
2343
  if (opts.showProgress) {
@@ -2344,7 +2346,7 @@ async function download(options) {
2344
2346
  setProgress = collectiveBar.setProgress;
2345
2347
  }
2346
2348
  const promises = binariesToDownload.map((job) => {
2347
- const downloadUrl = (0, import_chunk_4MDZEOKU.getDownloadUrl)({
2349
+ const downloadUrl = (0, import_chunk_LONQL55G.getDownloadUrl)({
2348
2350
  channel: "all_commits",
2349
2351
  version: opts.version,
2350
2352
  binaryTarget: job.binaryTarget,
@@ -2378,7 +2380,10 @@ async function download(options) {
2378
2380
  return binaryPaths;
2379
2381
  }
2380
2382
  function getCollectiveBar(options) {
2381
- const bar = (0, import_chunk_5564WBCW.getBar)(`Downloading Prisma engines for ${options.binaryTargets?.map((p) => (0, import_chunk_XNR2KDTK.bold)(p)).join(" and ")}`);
2383
+ const hasNodeAPI = "libquery-engine" in options.binaries;
2384
+ const bar = (0, import_chunk_MWVY55RY.getBar)(
2385
+ `Downloading Prisma engines${hasNodeAPI ? " for Node-API" : ""} for ${options.binaryTargets?.map((p) => (0, import_chunk_QFA3XBMW.bold)(p)).join(" and ")}`
2386
+ );
2382
2387
  const progressMap = {};
2383
2388
  const numDownloads = Object.values(options.binaries).length * Object.values(options?.binaryTargets ?? []).length;
2384
2389
  const setProgress = (sourcePath) => (progress) => {
@@ -2422,7 +2427,7 @@ async function binaryNeedsToBeDownloaded(job, nativePlatform, version) {
2422
2427
  });
2423
2428
  if (cachedFile) {
2424
2429
  if (job.skipCacheIntegrityCheck === true) {
2425
- await (0, import_chunk_4MDZEOKU.overwriteFile)(cachedFile, job.targetFilePath);
2430
+ await (0, import_chunk_LONQL55G.overwriteFile)(cachedFile, job.targetFilePath);
2426
2431
  return false;
2427
2432
  }
2428
2433
  const sha256FilePath = cachedFile + ".sha256";
@@ -2433,12 +2438,12 @@ async function binaryNeedsToBeDownloaded(job, nativePlatform, version) {
2433
2438
  if (!targetExists) {
2434
2439
  debug(`copying ${cachedFile} to ${job.targetFilePath}`);
2435
2440
  await import_node_fs.default.promises.utimes(cachedFile, /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date());
2436
- await (0, import_chunk_4MDZEOKU.overwriteFile)(cachedFile, job.targetFilePath);
2441
+ await (0, import_chunk_LONQL55G.overwriteFile)(cachedFile, job.targetFilePath);
2437
2442
  }
2438
2443
  const targetSha256 = await (0, import_chunk_FKGWOTGU.getHash)(job.targetFilePath);
2439
2444
  if (sha256File !== targetSha256) {
2440
2445
  debug(`overwriting ${job.targetFilePath} with ${cachedFile} as hashes do not match`);
2441
- await (0, import_chunk_4MDZEOKU.overwriteFile)(cachedFile, job.targetFilePath);
2446
+ await (0, import_chunk_LONQL55G.overwriteFile)(cachedFile, job.targetFilePath);
2442
2447
  }
2443
2448
  return false;
2444
2449
  } else {
@@ -2453,7 +2458,7 @@ async function binaryNeedsToBeDownloaded(job, nativePlatform, version) {
2453
2458
  }
2454
2459
  if (cachedFile) {
2455
2460
  debug(`copying ${cachedFile} to ${job.targetFilePath}`);
2456
- await (0, import_chunk_4MDZEOKU.overwriteFile)(cachedFile, job.targetFilePath);
2461
+ await (0, import_chunk_LONQL55G.overwriteFile)(cachedFile, job.targetFilePath);
2457
2462
  return false;
2458
2463
  }
2459
2464
  return true;
@@ -2474,15 +2479,24 @@ async function binaryNeedsToBeDownloaded(job, nativePlatform, version) {
2474
2479
  }
2475
2480
  return false;
2476
2481
  }
2477
- async function getVersion(enginePath, _binaryName) {
2482
+ async function getVersion(enginePath, binaryName) {
2478
2483
  try {
2479
- const result = await execa(enginePath, ["--version"]);
2480
- return result.stdout;
2484
+ if (binaryName === "libquery-engine") {
2485
+ (0, import_get_platform.assertNodeAPISupported)();
2486
+ const commitHash = (0, import_chunk_QGM4M3NI.__require)(enginePath).version().commit;
2487
+ return `${"libquery-engine"} ${commitHash}`;
2488
+ } else {
2489
+ const result = await execa(enginePath, ["--version"]);
2490
+ return result.stdout;
2491
+ }
2481
2492
  } catch {
2482
2493
  }
2483
2494
  return void 0;
2484
2495
  }
2485
2496
  function getBinaryName(binaryName, binaryTarget) {
2497
+ if (binaryName === "libquery-engine") {
2498
+ return `${(0, import_get_platform.getNodeAPIName)(binaryTarget, "fs")}`;
2499
+ }
2486
2500
  const extension = binaryTarget === "windows" ? ".exe" : "";
2487
2501
  return `${binaryName}-${binaryTarget}${extension}`;
2488
2502
  }
@@ -2491,7 +2505,7 @@ async function getCachedBinaryPath({
2491
2505
  binaryTarget,
2492
2506
  binaryName
2493
2507
  }) {
2494
- const cacheDir = await (0, import_chunk_4MDZEOKU.getCacheDir)(channel, version, binaryTarget);
2508
+ const cacheDir = await (0, import_chunk_LONQL55G.getCacheDir)(channel, version, binaryTarget);
2495
2509
  if (!cacheDir) {
2496
2510
  return null;
2497
2511
  }
@@ -2524,7 +2538,7 @@ async function downloadBinary(options) {
2524
2538
  if (progressCb) {
2525
2539
  progressCb(0);
2526
2540
  }
2527
- const { sha256, zippedSha256 } = await (0, import_chunk_FNYZ6ABB.downloadZip)(downloadUrl, targetFilePath, progressCb);
2541
+ const { sha256, zippedSha256 } = await (0, import_chunk_CY52DY2B.downloadZip)(downloadUrl, targetFilePath, progressCb);
2528
2542
  if (progressCb) {
2529
2543
  progressCb(1);
2530
2544
  }
@@ -2532,7 +2546,7 @@ async function downloadBinary(options) {
2532
2546
  await saveFileToCache(options, version, sha256, zippedSha256);
2533
2547
  }
2534
2548
  async function saveFileToCache(job, version, sha256, zippedSha256) {
2535
- const cacheDir = await (0, import_chunk_4MDZEOKU.getCacheDir)(channel, version, job.binaryTarget);
2549
+ const cacheDir = await (0, import_chunk_LONQL55G.getCacheDir)(channel, version, job.binaryTarget);
2536
2550
  if (!cacheDir) {
2537
2551
  return;
2538
2552
  }
@@ -2540,7 +2554,7 @@ async function saveFileToCache(job, version, sha256, zippedSha256) {
2540
2554
  const cachedSha256Path = import_node_path.default.join(cacheDir, job.binaryName + ".sha256");
2541
2555
  const cachedSha256ZippedPath = import_node_path.default.join(cacheDir, job.binaryName + ".gz.sha256");
2542
2556
  try {
2543
- await (0, import_chunk_4MDZEOKU.overwriteFile)(job.targetFilePath, cachedTargetPath);
2557
+ await (0, import_chunk_LONQL55G.overwriteFile)(job.targetFilePath, cachedTargetPath);
2544
2558
  if (sha256 != null) {
2545
2559
  await import_node_fs.default.promises.writeFile(cachedSha256Path, sha256);
2546
2560
  }