@prisma/fetch-engine 5.20.0-dev.3 → 5.20.0-dev.5

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.
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_BMRKEOA4_exports = {};
30
- __export(chunk_BMRKEOA4_exports, {
29
+ var chunk_OLXHDJ7F_exports = {};
30
+ __export(chunk_OLXHDJ7F_exports, {
31
31
  download: () => download,
32
32
  getBinaryName: () => getBinaryName,
33
33
  getVersion: () => getVersion,
@@ -35,7 +35,7 @@ __export(chunk_BMRKEOA4_exports, {
35
35
  plusX: () => plusX,
36
36
  vercelPkgPathRegex: () => vercelPkgPathRegex
37
37
  });
38
- module.exports = __toCommonJS(chunk_BMRKEOA4_exports);
38
+ module.exports = __toCommonJS(chunk_OLXHDJ7F_exports);
39
39
  var import_chunk_4LX3XBNY = require("./chunk-4LX3XBNY.js");
40
40
  var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
41
41
  var import_chunk_RIFXCDQ6 = require("./chunk-RIFXCDQ6.js");
@@ -2010,7 +2010,7 @@ var require_package = (0, import_chunk_AH6QHEOA.__commonJS)({
2010
2010
  "package.json"(exports, module2) {
2011
2011
  module2.exports = {
2012
2012
  name: "@prisma/fetch-engine",
2013
- version: "0.0.0",
2013
+ version: "5.20.0-dev.5",
2014
2014
  description: "This package is intended for Prisma's internal use",
2015
2015
  main: "dist/index.js",
2016
2016
  types: "dist/index.d.ts",
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_VQPMQ44G_exports = {};
30
+ __export(chunk_VQPMQ44G_exports, {
31
+ cleanupCache: () => cleanupCache
32
+ });
33
+ module.exports = __toCommonJS(chunk_VQPMQ44G_exports);
34
+ var import_chunk_RGVHWUUH = require("./chunk-RGVHWUUH.js");
35
+ var import_chunk_AZKAIDG4 = require("./chunk-AZKAIDG4.js");
36
+ var import_chunk_AH6QHEOA = require("./chunk-AH6QHEOA.js");
37
+ var import_debug = __toESM(require("@prisma/debug"));
38
+ var import_fs = __toESM(require("fs"));
39
+ var import_path = __toESM(require("path"));
40
+ var import_util = require("util");
41
+ var import_p_map = (0, import_chunk_AH6QHEOA.__toESM)((0, import_chunk_RGVHWUUH.require_p_map)());
42
+ var import_rimraf = (0, import_chunk_AH6QHEOA.__toESM)((0, import_chunk_RGVHWUUH.require_rimraf)());
43
+ var debug = (0, import_debug.default)("cleanupCache");
44
+ var del = (0, import_util.promisify)(import_rimraf.default);
45
+ async function cleanupCache(n = 5) {
46
+ try {
47
+ const rootCacheDir = await (0, import_chunk_AZKAIDG4.getRootCacheDir)();
48
+ if (!rootCacheDir) {
49
+ debug("no rootCacheDir found");
50
+ return;
51
+ }
52
+ const channel = "master";
53
+ const cacheDir = import_path.default.join(rootCacheDir, channel);
54
+ const dirs = await import_fs.default.promises.readdir(cacheDir);
55
+ const dirsWithMeta = await Promise.all(
56
+ dirs.map(async (dirName) => {
57
+ const dir = import_path.default.join(cacheDir, dirName);
58
+ const statResult = await import_fs.default.promises.stat(dir);
59
+ return {
60
+ dir,
61
+ created: statResult.birthtime
62
+ };
63
+ })
64
+ );
65
+ dirsWithMeta.sort((a, b) => a.created < b.created ? 1 : -1);
66
+ const dirsToRemove = dirsWithMeta.slice(n);
67
+ await (0, import_p_map.default)(dirsToRemove, (dir) => del(dir.dir), { concurrency: 20 });
68
+ } catch (e) {
69
+ }
70
+ }
package/dist/download.js CHANGED
@@ -18,15 +18,15 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var download_exports = {};
20
20
  __export(download_exports, {
21
- download: () => import_chunk_L3DO7LBE.download,
22
- getBinaryName: () => import_chunk_L3DO7LBE.getBinaryName,
23
- getVersion: () => import_chunk_L3DO7LBE.getVersion,
24
- maybeCopyToTmp: () => import_chunk_L3DO7LBE.maybeCopyToTmp,
25
- plusX: () => import_chunk_L3DO7LBE.plusX,
26
- vercelPkgPathRegex: () => import_chunk_L3DO7LBE.vercelPkgPathRegex
21
+ download: () => import_chunk_OLXHDJ7F.download,
22
+ getBinaryName: () => import_chunk_OLXHDJ7F.getBinaryName,
23
+ getVersion: () => import_chunk_OLXHDJ7F.getVersion,
24
+ maybeCopyToTmp: () => import_chunk_OLXHDJ7F.maybeCopyToTmp,
25
+ plusX: () => import_chunk_OLXHDJ7F.plusX,
26
+ vercelPkgPathRegex: () => import_chunk_OLXHDJ7F.vercelPkgPathRegex
27
27
  });
28
28
  module.exports = __toCommonJS(download_exports);
29
- var import_chunk_L3DO7LBE = require("./chunk-L3DO7LBE.js");
29
+ var import_chunk_OLXHDJ7F = require("./chunk-OLXHDJ7F.js");
30
30
  var import_chunk_4LX3XBNY = require("./chunk-4LX3XBNY.js");
31
31
  var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
32
32
  var import_chunk_RIFXCDQ6 = require("./chunk-RIFXCDQ6.js");
package/dist/index.js CHANGED
@@ -21,20 +21,20 @@ __export(dist_exports, {
21
21
  BinaryType: () => import_chunk_X37PZICB.BinaryType,
22
22
  allEngineEnvVarsSet: () => import_chunk_PXQVM7NP.allEngineEnvVarsSet,
23
23
  deprecatedEnvVarMap: () => import_chunk_PXQVM7NP.deprecatedEnvVarMap,
24
- download: () => import_chunk_L3DO7LBE.download,
24
+ download: () => import_chunk_OLXHDJ7F.download,
25
25
  engineEnvVarMap: () => import_chunk_PXQVM7NP.engineEnvVarMap,
26
26
  getBinaryEnvVarPath: () => import_chunk_PXQVM7NP.getBinaryEnvVarPath,
27
- getBinaryName: () => import_chunk_L3DO7LBE.getBinaryName,
27
+ getBinaryName: () => import_chunk_OLXHDJ7F.getBinaryName,
28
28
  getCacheDir: () => import_chunk_5T2KHPZI.getCacheDir,
29
29
  getProxyAgent: () => import_chunk_KDPLGCY6.getProxyAgent,
30
- getVersion: () => import_chunk_L3DO7LBE.getVersion,
31
- maybeCopyToTmp: () => import_chunk_L3DO7LBE.maybeCopyToTmp,
30
+ getVersion: () => import_chunk_OLXHDJ7F.getVersion,
31
+ maybeCopyToTmp: () => import_chunk_OLXHDJ7F.maybeCopyToTmp,
32
32
  overwriteFile: () => import_chunk_5T2KHPZI.overwriteFile,
33
- plusX: () => import_chunk_L3DO7LBE.plusX,
34
- vercelPkgPathRegex: () => import_chunk_L3DO7LBE.vercelPkgPathRegex
33
+ plusX: () => import_chunk_OLXHDJ7F.plusX,
34
+ vercelPkgPathRegex: () => import_chunk_OLXHDJ7F.vercelPkgPathRegex
35
35
  });
36
36
  module.exports = __toCommonJS(dist_exports);
37
- var import_chunk_L3DO7LBE = require("./chunk-L3DO7LBE.js");
37
+ var import_chunk_OLXHDJ7F = require("./chunk-OLXHDJ7F.js");
38
38
  var import_chunk_4LX3XBNY = require("./chunk-4LX3XBNY.js");
39
39
  var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
40
40
  var import_chunk_RIFXCDQ6 = require("./chunk-RIFXCDQ6.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/fetch-engine",
3
- "version": "5.20.0-dev.3",
3
+ "version": "5.20.0-dev.5",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@prisma/engines-version": "5.20.0-4.f2561ec470647d6a14db84d3c1dc6fc1c2414386",
46
- "@prisma/debug": "5.20.0-dev.3",
47
- "@prisma/get-platform": "5.20.0-dev.3"
46
+ "@prisma/debug": "5.20.0-dev.5",
47
+ "@prisma/get-platform": "5.20.0-dev.5"
48
48
  },
49
49
  "files": [
50
50
  "README.md",