@prisma/fetch-engine 6.20.0-integration-feat-prisma-7-config.4 → 6.20.0-integration-oidc-truster-publishers.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");
24
+ var import_chunk_X37PZICB = require("./chunk-X37PZICB.js");
25
25
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
@@ -26,13 +26,13 @@ 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_4CBSYQEY_exports = {};
30
- __export(chunk_4CBSYQEY_exports, {
29
+ var chunk_3VVCXIQ5_exports = {};
30
+ __export(chunk_3VVCXIQ5_exports, {
31
31
  cleanupCache: () => cleanupCache
32
32
  });
33
- module.exports = __toCommonJS(chunk_4CBSYQEY_exports);
33
+ module.exports = __toCommonJS(chunk_3VVCXIQ5_exports);
34
34
  var import_chunk_FSAAZH62 = require("./chunk-FSAAZH62.js");
35
- var import_chunk_VGMB4WXF = require("./chunk-VGMB4WXF.js");
35
+ var import_chunk_LONQL55G = require("./chunk-LONQL55G.js");
36
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"));
@@ -41,7 +41,7 @@ var import_p_map = (0, import_chunk_QGM4M3NI.__toESM)((0, import_chunk_FSAAZH62.
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_VGMB4WXF.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_YSZTCYHQ_exports = {};
30
- __export(chunk_YSZTCYHQ_exports, {
29
+ var chunk_CN4T7AID_exports = {};
30
+ __export(chunk_CN4T7AID_exports, {
31
31
  download: () => download,
32
32
  getBinaryName: () => getBinaryName,
33
33
  getVersion: () => getVersion,
@@ -35,13 +35,13 @@ __export(chunk_YSZTCYHQ_exports, {
35
35
  plusX: () => plusX,
36
36
  vercelPkgPathRegex: () => vercelPkgPathRegex
37
37
  });
38
- module.exports = __toCommonJS(chunk_YSZTCYHQ_exports);
38
+ module.exports = __toCommonJS(chunk_CN4T7AID_exports);
39
39
  var import_chunk_MWVY55RY = require("./chunk-MWVY55RY.js");
40
40
  var import_chunk_7JLQJWOR = require("./chunk-7JLQJWOR.js");
41
- var import_chunk_4CBSYQEY = require("./chunk-4CBSYQEY.js");
42
- var import_chunk_UZIIO3VK = require("./chunk-UZIIO3VK.js");
43
- var import_chunk_VGMB4WXF = require("./chunk-VGMB4WXF.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
46
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
47
47
  var import_node_fs = __toESM(require("node:fs"));
@@ -585,7 +585,7 @@ var require_package = (0, import_chunk_QGM4M3NI.__commonJS)({
585
585
  "package.json"(exports, module2) {
586
586
  module2.exports = {
587
587
  name: "@prisma/fetch-engine",
588
- version: "6.20.0-integration-feat-prisma-7-config.4",
588
+ version: "6.20.0-integration-oidc-truster-publishers.1",
589
589
  description: "This package is intended for Prisma's internal use",
590
590
  main: "dist/index.js",
591
591
  types: "dist/index.d.ts",
@@ -600,7 +600,7 @@ var require_package = (0, import_chunk_QGM4M3NI.__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_QGM4M3NI.__commonJS)({
622
622
  },
623
623
  dependencies: {
624
624
  "@prisma/debug": "workspace:*",
625
- "@prisma/engines-version": "6.19.0-33.next-fca7ed8aa5fe6347594ad793adb59b37f021379a",
625
+ "@prisma/engines-version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
626
626
  "@prisma/get-platform": "workspace:*"
627
627
  },
628
628
  scripts: {
@@ -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_QGM4M3NI.__toESM)((0, import_chunk_VGMB4WXF.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_QGM4M3NI.__toESM)((0, import_chunk_UZIIO3VK.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_4CBSYQEY.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_VGMB4WXF.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_MWVY55RY.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_VGMB4WXF.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_VGMB4WXF.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_VGMB4WXF.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_VGMB4WXF.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_VGMB4WXF.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_UZIIO3VK.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_VGMB4WXF.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_VGMB4WXF.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
  }