@prisma/fetch-engine 6.17.0-dev.1 → 6.17.0-dev.11

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.
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var chmodPlusX_exports = {};
20
20
  __export(chmodPlusX_exports, {
21
- chmodPlusX: () => import_chunk_MX3HXAU2.chmodPlusX
21
+ chmodPlusX: () => import_chunk_7JLQJWOR.chmodPlusX
22
22
  });
23
23
  module.exports = __toCommonJS(chmodPlusX_exports);
24
- var import_chunk_MX3HXAU2 = require("./chunk-MX3HXAU2.js");
24
+ var import_chunk_7JLQJWOR = require("./chunk-7JLQJWOR.js");
25
25
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
@@ -26,33 +26,33 @@ 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_4GLRZ2GS_exports = {};
30
- __export(chunk_4GLRZ2GS_exports, {
29
+ var chunk_2DPMENYP_exports = {};
30
+ __export(chunk_2DPMENYP_exports, {
31
31
  cleanupCache: () => cleanupCache
32
32
  });
33
- module.exports = __toCommonJS(chunk_4GLRZ2GS_exports);
34
- var import_chunk_SVP4SRAT = require("./chunk-SVP4SRAT.js");
35
- var import_chunk_YJOPKU47 = require("./chunk-YJOPKU47.js");
33
+ module.exports = __toCommonJS(chunk_2DPMENYP_exports);
34
+ var import_chunk_FSAAZH62 = require("./chunk-FSAAZH62.js");
35
+ var import_chunk_7KB2WQ67 = require("./chunk-7KB2WQ67.js");
36
36
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
37
+ var import_node_fs = __toESM(require("node:fs"));
38
+ var import_node_path = __toESM(require("node:path"));
37
39
  var import_debug = __toESM(require("@prisma/debug"));
38
- var import_fs = __toESM(require("fs"));
39
- var import_path = __toESM(require("path"));
40
- var import_p_map = (0, import_chunk_QGM4M3NI.__toESM)((0, import_chunk_SVP4SRAT.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_YJOPKU47.getRootCacheDir)();
44
+ const rootCacheDir = await (0, import_chunk_7KB2WQ67.getRootCacheDir)();
45
45
  if (!rootCacheDir) {
46
46
  debug("no rootCacheDir found");
47
47
  return;
48
48
  }
49
49
  const channel = "master";
50
- const cacheDir = import_path.default.join(rootCacheDir, channel);
51
- const dirs = await import_fs.default.promises.readdir(cacheDir);
50
+ const cacheDir = import_node_path.default.join(rootCacheDir, channel);
51
+ const dirs = await import_node_fs.default.promises.readdir(cacheDir);
52
52
  const dirsWithMeta = await Promise.all(
53
53
  dirs.map(async (dirName) => {
54
- const dir = import_path.default.join(cacheDir, dirName);
55
- const statResult = await import_fs.default.promises.stat(dir);
54
+ const dir = import_node_path.default.join(cacheDir, dirName);
55
+ const statResult = await import_node_fs.default.promises.stat(dir);
56
56
  return {
57
57
  dir,
58
58
  created: statResult.birthtime
@@ -61,7 +61,7 @@ async function cleanupCache(n = 5) {
61
61
  );
62
62
  dirsWithMeta.sort((a, b) => a.created < b.created ? 1 : -1);
63
63
  const dirsToRemove = dirsWithMeta.slice(n);
64
- await (0, import_p_map.default)(dirsToRemove, (dir) => (0, import_chunk_SVP4SRAT.rimraf)(dir.dir), { concurrency: 20 });
64
+ await (0, import_p_map.default)(dirsToRemove, (dir) => import_node_fs.default.promises.rm(dir.dir, { force: true, recursive: true }), { concurrency: 20 });
65
65
  } catch (e) {
66
66
  }
67
67
  }
@@ -26,19 +26,19 @@ 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_MX3HXAU2_exports = {};
30
- __export(chunk_MX3HXAU2_exports, {
29
+ var chunk_7JLQJWOR_exports = {};
30
+ __export(chunk_7JLQJWOR_exports, {
31
31
  chmodPlusX: () => chmodPlusX
32
32
  });
33
- module.exports = __toCommonJS(chunk_MX3HXAU2_exports);
34
- var import_fs = __toESM(require("fs"));
33
+ module.exports = __toCommonJS(chunk_7JLQJWOR_exports);
34
+ var import_node_fs = __toESM(require("node:fs"));
35
35
  function chmodPlusX(file) {
36
36
  if (process.platform === "win32") return;
37
- const s = import_fs.default.statSync(file);
37
+ const s = import_node_fs.default.statSync(file);
38
38
  const newMode = s.mode | 64 | 8 | 1;
39
39
  if (s.mode === newMode) {
40
40
  return;
41
41
  }
42
42
  const base8 = newMode.toString(8).slice(-3);
43
- import_fs.default.chmodSync(file, base8);
43
+ import_node_fs.default.chmodSync(file, base8);
44
44
  }
@@ -26,31 +26,31 @@ 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_YJOPKU47_exports = {};
30
- __export(chunk_YJOPKU47_exports, {
29
+ var chunk_7KB2WQ67_exports = {};
30
+ __export(chunk_7KB2WQ67_exports, {
31
31
  getCacheDir: () => getCacheDir,
32
32
  getDownloadUrl: () => getDownloadUrl,
33
33
  getRootCacheDir: () => getRootCacheDir,
34
34
  overwriteFile: () => overwriteFile,
35
35
  require_lib: () => require_lib
36
36
  });
37
- module.exports = __toCommonJS(chunk_YJOPKU47_exports);
37
+ module.exports = __toCommonJS(chunk_7KB2WQ67_exports);
38
38
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
39
+ var import_node_fs = __toESM(require("node:fs"));
40
+ var import_node_os = __toESM(require("node:os"));
41
+ var import_node_path = __toESM(require("node:path"));
39
42
  var import_debug = __toESM(require("@prisma/debug"));
40
43
  var import_get_platform = require("@prisma/get-platform");
41
44
  var import_node_process = __toESM(require("node:process"));
42
- var import_node_path = __toESM(require("node:path"));
43
- var import_node_fs = __toESM(require("node:fs"));
44
45
  var import_node_path2 = __toESM(require("node:path"));
46
+ var import_node_fs2 = __toESM(require("node:fs"));
45
47
  var import_node_path3 = __toESM(require("node:path"));
48
+ var import_node_path4 = __toESM(require("node:path"));
46
49
  var import_node_url = require("node:url");
47
50
  var import_node_process2 = __toESM(require("node:process"));
48
- var import_node_path4 = __toESM(require("node:path"));
49
- var import_node_fs2 = __toESM(require("node:fs"));
51
+ var import_node_path5 = __toESM(require("node:path"));
52
+ var import_node_fs3 = __toESM(require("node:fs"));
50
53
  var import_node_url2 = require("node:url");
51
- var import_fs = __toESM(require("fs"));
52
- var import_os = __toESM(require("os"));
53
- var import_path = __toESM(require("path"));
54
54
  var require_common_path_prefix = (0, import_chunk_QGM4M3NI.__commonJS)({
55
55
  "../../node_modules/.pnpm/common-path-prefix@3.0.0/node_modules/common-path-prefix/index.js"(exports, module2) {
56
56
  "use strict";
@@ -2169,10 +2169,10 @@ function locatePathSync(paths, {
2169
2169
  } = {}) {
2170
2170
  checkType(type);
2171
2171
  cwd2 = toPath(cwd2);
2172
- const statFunction = allowSymlinks ? import_node_fs2.default.statSync : import_node_fs2.default.lstatSync;
2172
+ const statFunction = allowSymlinks ? import_node_fs3.default.statSync : import_node_fs3.default.lstatSync;
2173
2173
  for (const path_ of paths) {
2174
2174
  try {
2175
- const stat = statFunction(import_node_path4.default.resolve(cwd2, path_), {
2175
+ const stat = statFunction(import_node_path5.default.resolve(cwd2, path_), {
2176
2176
  throwIfNoEntry: false
2177
2177
  });
2178
2178
  if (!stat) {
@@ -2188,8 +2188,8 @@ function locatePathSync(paths, {
2188
2188
  var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
2189
2189
  var findUpStop = Symbol("findUpStop");
2190
2190
  function findUpMultipleSync(name, options = {}) {
2191
- let directory = import_node_path3.default.resolve(toPath2(options.cwd) || "");
2192
- const { root } = import_node_path3.default.parse(directory);
2191
+ let directory = import_node_path4.default.resolve(toPath2(options.cwd) || "");
2192
+ const { root } = import_node_path4.default.parse(directory);
2193
2193
  const stopAt = options.stopAt || root;
2194
2194
  const limit = options.limit || Number.POSITIVE_INFINITY;
2195
2195
  const paths = [name].flat();
@@ -2210,12 +2210,12 @@ function findUpMultipleSync(name, options = {}) {
2210
2210
  break;
2211
2211
  }
2212
2212
  if (foundPath) {
2213
- matches.push(import_node_path3.default.resolve(directory, foundPath));
2213
+ matches.push(import_node_path4.default.resolve(directory, foundPath));
2214
2214
  }
2215
2215
  if (directory === stopAt || matches.length >= limit) {
2216
2216
  break;
2217
2217
  }
2218
- directory = import_node_path3.default.dirname(directory);
2218
+ directory = import_node_path4.default.dirname(directory);
2219
2219
  }
2220
2220
  return matches;
2221
2221
  }
@@ -2225,12 +2225,12 @@ function findUpSync(name, options = {}) {
2225
2225
  }
2226
2226
  function packageDirectorySync({ cwd: cwd2 } = {}) {
2227
2227
  const filePath = findUpSync("package.json", { cwd: cwd2 });
2228
- return filePath && import_node_path2.default.dirname(filePath);
2228
+ return filePath && import_node_path3.default.dirname(filePath);
2229
2229
  }
2230
2230
  var { env, cwd } = import_node_process.default;
2231
2231
  var isWritable = (path6) => {
2232
2232
  try {
2233
- import_node_fs.default.accessSync(path6, import_node_fs.default.constants.W_OK);
2233
+ import_node_fs2.default.accessSync(path6, import_node_fs2.default.constants.W_OK);
2234
2234
  return true;
2235
2235
  } catch {
2236
2236
  return false;
@@ -2238,27 +2238,27 @@ var isWritable = (path6) => {
2238
2238
  };
2239
2239
  function useDirectory(directory, options) {
2240
2240
  if (options.create) {
2241
- import_node_fs.default.mkdirSync(directory, { recursive: true });
2241
+ import_node_fs2.default.mkdirSync(directory, { recursive: true });
2242
2242
  }
2243
2243
  return directory;
2244
2244
  }
2245
2245
  function getNodeModuleDirectory(directory) {
2246
- const nodeModules = import_node_path.default.join(directory, "node_modules");
2247
- if (!isWritable(nodeModules) && (import_node_fs.default.existsSync(nodeModules) || !isWritable(import_node_path.default.join(directory)))) {
2246
+ const nodeModules = import_node_path2.default.join(directory, "node_modules");
2247
+ if (!isWritable(nodeModules) && (import_node_fs2.default.existsSync(nodeModules) || !isWritable(import_node_path2.default.join(directory)))) {
2248
2248
  return;
2249
2249
  }
2250
2250
  return nodeModules;
2251
2251
  }
2252
2252
  function findCacheDirectory(options = {}) {
2253
2253
  if (env.CACHE_DIR && !["true", "false", "1", "0"].includes(env.CACHE_DIR)) {
2254
- return useDirectory(import_node_path.default.join(env.CACHE_DIR, options.name), options);
2254
+ return useDirectory(import_node_path2.default.join(env.CACHE_DIR, options.name), options);
2255
2255
  }
2256
2256
  let { cwd: directory = cwd(), files } = options;
2257
2257
  if (files) {
2258
2258
  if (!Array.isArray(files)) {
2259
2259
  throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof files}\`.`);
2260
2260
  }
2261
- directory = (0, import_common_path_prefix.default)(files.map((file) => import_node_path.default.resolve(directory, file)));
2261
+ directory = (0, import_common_path_prefix.default)(files.map((file) => import_node_path2.default.resolve(directory, file)));
2262
2262
  }
2263
2263
  directory = packageDirectorySync({ cwd: directory });
2264
2264
  if (!directory) {
@@ -2268,18 +2268,18 @@ function findCacheDirectory(options = {}) {
2268
2268
  if (!nodeModules) {
2269
2269
  return;
2270
2270
  }
2271
- return useDirectory(import_node_path.default.join(directory, "node_modules", ".cache", options.name), options);
2271
+ return useDirectory(import_node_path2.default.join(directory, "node_modules", ".cache", options.name), options);
2272
2272
  }
2273
2273
  var import_fs_extra = (0, import_chunk_QGM4M3NI.__toESM)(require_lib());
2274
2274
  var debug = (0, import_debug.default)("prisma:fetch-engine:cache-dir");
2275
2275
  async function getRootCacheDir() {
2276
- if (import_os.default.platform() === "win32") {
2276
+ if (import_node_os.default.platform() === "win32") {
2277
2277
  const cacheDir = findCacheDirectory({ name: "prisma", create: true });
2278
2278
  if (cacheDir) {
2279
2279
  return cacheDir;
2280
2280
  }
2281
2281
  if (process.env.APPDATA) {
2282
- return import_path.default.join(process.env.APPDATA, "Prisma");
2282
+ return import_node_path.default.join(process.env.APPDATA, "Prisma");
2283
2283
  }
2284
2284
  }
2285
2285
  if (process.env.AWS_LAMBDA_FUNCTION_VERSION) {
@@ -2290,16 +2290,16 @@ async function getRootCacheDir() {
2290
2290
  return null;
2291
2291
  }
2292
2292
  }
2293
- return import_path.default.join(import_os.default.homedir(), ".cache/prisma");
2293
+ return import_node_path.default.join(import_node_os.default.homedir(), ".cache/prisma");
2294
2294
  }
2295
2295
  async function getCacheDir(channel, version, binaryTarget) {
2296
2296
  const rootCacheDir = await getRootCacheDir();
2297
2297
  if (!rootCacheDir) {
2298
2298
  return null;
2299
2299
  }
2300
- const cacheDir = import_path.default.join(rootCacheDir, channel, version, binaryTarget);
2300
+ const cacheDir = import_node_path.default.join(rootCacheDir, channel, version, binaryTarget);
2301
2301
  try {
2302
- if (!import_fs.default.existsSync(cacheDir)) {
2302
+ if (!import_node_fs.default.existsSync(cacheDir)) {
2303
2303
  await (0, import_fs_extra.ensureDir)(cacheDir);
2304
2304
  }
2305
2305
  } catch (e) {
@@ -2328,18 +2328,18 @@ function getDownloadUrl({
2328
2328
  return `${baseUrl}/${channel}/${version}/${binaryTarget}/${binaryName}${finalExtension}`;
2329
2329
  }
2330
2330
  async function overwriteFile(sourcePath, targetPath) {
2331
- if (import_os.default.platform() === "darwin") {
2331
+ if (import_node_os.default.platform() === "darwin") {
2332
2332
  await removeFileIfExists(targetPath);
2333
- await import_fs.default.promises.copyFile(sourcePath, targetPath);
2333
+ await import_node_fs.default.promises.copyFile(sourcePath, targetPath);
2334
2334
  } else {
2335
2335
  const tempPath = `${targetPath}.tmp${process.pid}`;
2336
- await import_fs.default.promises.copyFile(sourcePath, tempPath);
2337
- await import_fs.default.promises.rename(tempPath, targetPath);
2336
+ await import_node_fs.default.promises.copyFile(sourcePath, tempPath);
2337
+ await import_node_fs.default.promises.rename(tempPath, targetPath);
2338
2338
  }
2339
2339
  }
2340
2340
  async function removeFileIfExists(filePath) {
2341
2341
  try {
2342
- await import_fs.default.promises.unlink(filePath);
2342
+ await import_node_fs.default.promises.unlink(filePath);
2343
2343
  } catch (e) {
2344
2344
  if (e.code !== "ENOENT") {
2345
2345
  throw e;
@@ -26,16 +26,16 @@ 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_CWGQAQ3T_exports = {};
30
- __export(chunk_CWGQAQ3T_exports, {
29
+ var chunk_FKGWOTGU_exports = {};
30
+ __export(chunk_FKGWOTGU_exports, {
31
31
  getHash: () => getHash
32
32
  });
33
- module.exports = __toCommonJS(chunk_CWGQAQ3T_exports);
34
- var import_crypto = __toESM(require("crypto"));
35
- var import_fs = __toESM(require("fs"));
33
+ module.exports = __toCommonJS(chunk_FKGWOTGU_exports);
34
+ var import_node_crypto = __toESM(require("node:crypto"));
35
+ var import_node_fs = __toESM(require("node:fs"));
36
36
  function getHash(filePath) {
37
- const hash = import_crypto.default.createHash("sha256");
38
- const input = import_fs.default.createReadStream(filePath);
37
+ const hash = import_node_crypto.default.createHash("sha256");
38
+ const input = import_node_fs.default.createReadStream(filePath);
39
39
  return new Promise((resolve) => {
40
40
  input.on("readable", () => {
41
41
  const data = input.read();
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_FSAAZH62_exports = {};
20
+ __export(chunk_FSAAZH62_exports, {
21
+ require_p_map: () => require_p_map
22
+ });
23
+ module.exports = __toCommonJS(chunk_FSAAZH62_exports);
24
+ var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
25
+ var require_indent_string = (0, import_chunk_QGM4M3NI.__commonJS)({
26
+ "../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports, module2) {
27
+ "use strict";
28
+ module2.exports = (string, count = 1, options) => {
29
+ options = {
30
+ indent: " ",
31
+ includeEmptyLines: false,
32
+ ...options
33
+ };
34
+ if (typeof string !== "string") {
35
+ throw new TypeError(
36
+ `Expected \`input\` to be a \`string\`, got \`${typeof string}\``
37
+ );
38
+ }
39
+ if (typeof count !== "number") {
40
+ throw new TypeError(
41
+ `Expected \`count\` to be a \`number\`, got \`${typeof count}\``
42
+ );
43
+ }
44
+ if (typeof options.indent !== "string") {
45
+ throw new TypeError(
46
+ `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
47
+ );
48
+ }
49
+ if (count === 0) {
50
+ return string;
51
+ }
52
+ const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
53
+ return string.replace(regex, options.indent.repeat(count));
54
+ };
55
+ }
56
+ });
57
+ var require_clean_stack = (0, import_chunk_QGM4M3NI.__commonJS)({
58
+ "../../node_modules/.pnpm/clean-stack@2.2.0/node_modules/clean-stack/index.js"(exports, module2) {
59
+ "use strict";
60
+ var os = (0, import_chunk_QGM4M3NI.__require)("os");
61
+ var extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/;
62
+ var pathRegex = /^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/;
63
+ var homeDir = typeof os.homedir === "undefined" ? "" : os.homedir();
64
+ module2.exports = (stack, options) => {
65
+ options = Object.assign({ pretty: false }, options);
66
+ return stack.replace(/\\/g, "/").split("\n").filter((line) => {
67
+ const pathMatches = line.match(extractPathRegex);
68
+ if (pathMatches === null || !pathMatches[1]) {
69
+ return true;
70
+ }
71
+ const match = pathMatches[1];
72
+ if (match.includes(".app/Contents/Resources/electron.asar") || match.includes(".app/Contents/Resources/default_app.asar")) {
73
+ return false;
74
+ }
75
+ return !pathRegex.test(match);
76
+ }).filter((line) => line.trim() !== "").map((line) => {
77
+ if (options.pretty) {
78
+ return line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, "~")));
79
+ }
80
+ return line;
81
+ }).join("\n");
82
+ };
83
+ }
84
+ });
85
+ var require_aggregate_error = (0, import_chunk_QGM4M3NI.__commonJS)({
86
+ "../../node_modules/.pnpm/aggregate-error@3.1.0/node_modules/aggregate-error/index.js"(exports, module2) {
87
+ "use strict";
88
+ var indentString = require_indent_string();
89
+ var cleanStack = require_clean_stack();
90
+ var cleanInternalStack = (stack) => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, "");
91
+ var AggregateError = class extends Error {
92
+ constructor(errors) {
93
+ if (!Array.isArray(errors)) {
94
+ throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);
95
+ }
96
+ errors = [...errors].map((error) => {
97
+ if (error instanceof Error) {
98
+ return error;
99
+ }
100
+ if (error !== null && typeof error === "object") {
101
+ return Object.assign(new Error(error.message), error);
102
+ }
103
+ return new Error(error);
104
+ });
105
+ let message = errors.map((error) => {
106
+ return typeof error.stack === "string" ? cleanInternalStack(cleanStack(error.stack)) : String(error);
107
+ }).join("\n");
108
+ message = "\n" + indentString(message, 4);
109
+ super(message);
110
+ this.name = "AggregateError";
111
+ Object.defineProperty(this, "_errors", { value: errors });
112
+ }
113
+ *[Symbol.iterator]() {
114
+ for (const error of this._errors) {
115
+ yield error;
116
+ }
117
+ }
118
+ };
119
+ module2.exports = AggregateError;
120
+ }
121
+ });
122
+ var require_p_map = (0, import_chunk_QGM4M3NI.__commonJS)({
123
+ "../../node_modules/.pnpm/p-map@4.0.0/node_modules/p-map/index.js"(exports, module2) {
124
+ "use strict";
125
+ var AggregateError = require_aggregate_error();
126
+ module2.exports = async (iterable, mapper, {
127
+ concurrency = Infinity,
128
+ stopOnError = true
129
+ } = {}) => {
130
+ return new Promise((resolve, reject) => {
131
+ if (typeof mapper !== "function") {
132
+ throw new TypeError("Mapper function is required");
133
+ }
134
+ if (!((Number.isSafeInteger(concurrency) || concurrency === Infinity) && concurrency >= 1)) {
135
+ throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
136
+ }
137
+ const result = [];
138
+ const errors = [];
139
+ const iterator = iterable[Symbol.iterator]();
140
+ let isRejected = false;
141
+ let isIterableDone = false;
142
+ let resolvingCount = 0;
143
+ let currentIndex = 0;
144
+ const next = () => {
145
+ if (isRejected) {
146
+ return;
147
+ }
148
+ const nextItem = iterator.next();
149
+ const index = currentIndex;
150
+ currentIndex++;
151
+ if (nextItem.done) {
152
+ isIterableDone = true;
153
+ if (resolvingCount === 0) {
154
+ if (!stopOnError && errors.length !== 0) {
155
+ reject(new AggregateError(errors));
156
+ } else {
157
+ resolve(result);
158
+ }
159
+ }
160
+ return;
161
+ }
162
+ resolvingCount++;
163
+ (async () => {
164
+ try {
165
+ const element = await nextItem.value;
166
+ result[index] = await mapper(element, index);
167
+ resolvingCount--;
168
+ next();
169
+ } catch (error) {
170
+ if (stopOnError) {
171
+ isRejected = true;
172
+ reject(error);
173
+ } else {
174
+ errors.push(error);
175
+ resolvingCount--;
176
+ next();
177
+ }
178
+ }
179
+ })();
180
+ };
181
+ for (let i = 0; i < concurrency; i++) {
182
+ next();
183
+ if (isIterableDone) {
184
+ break;
185
+ }
186
+ }
187
+ });
188
+ };
189
+ }
190
+ });