@redocly/openapi-core 0.0.0-snapshot.1737554067 → 0.0.0-snapshot.1737556585

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,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RegistryApi = void 0;
4
- const node_fetch_1 = require("node-fetch");
5
4
  const utils_1 = require("../utils");
6
5
  const domains_1 = require("./domains");
7
6
  const version = require('../../package.json').version;
@@ -30,7 +29,12 @@ class RegistryApi {
30
29
  if (!headers.hasOwnProperty('authorization')) {
31
30
  throw new Error('Unauthorized');
32
31
  }
33
- const response = await (0, node_fetch_1.default)(`${this.getBaseUrl()}${path}`, Object.assign({}, options, { headers, agent: (0, utils_1.getProxyAgent)() }));
32
+ const requestOptions = {
33
+ ...options,
34
+ headers,
35
+ agent: (0, utils_1.getProxyAgent)(),
36
+ };
37
+ const response = await fetch(`${this.getBaseUrl()}${path}`, requestOptions);
34
38
  if (response.status === 401) {
35
39
  throw new Error('Unauthorized');
36
40
  }
package/lib/utils.js CHANGED
@@ -40,7 +40,6 @@ exports.dequal = dequal;
40
40
  const fs = require("fs");
41
41
  const path_1 = require("path");
42
42
  const minimatch = require("minimatch");
43
- const node_fetch_1 = require("node-fetch");
44
43
  const js_yaml_1 = require("./js-yaml");
45
44
  const env_1 = require("./env");
46
45
  const logger_1 = require("./logger");
@@ -91,7 +90,7 @@ async function readFileFromUrl(url, config) {
91
90
  header.envVariable !== undefined ? env_1.env[header.envVariable] || '' : header.value;
92
91
  }
93
92
  }
94
- const req = await (config.customFetch || node_fetch_1.default)(url, {
93
+ const req = await (config.customFetch || fetch)(url, {
95
94
  headers: headers,
96
95
  });
97
96
  if (!req.ok) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@redocly/openapi-core",
3
- "version": "0.0.0-snapshot.1737554067",
3
+ "version": "0.0.0-snapshot.1737556585",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "engines": {
7
- "node": ">=14.19.0",
8
- "npm": ">=7.0.0"
7
+ "node": ">=18.17.0",
8
+ "npm": ">=10.8.2"
9
9
  },
10
10
  "engineStrict": true,
11
11
  "license": "MIT",
@@ -17,7 +17,6 @@
17
17
  "fs": false,
18
18
  "path": "path-browserify",
19
19
  "os": false,
20
- "node-fetch": false,
21
20
  "colorette": false,
22
21
  "https-proxy-agent": false
23
22
  },
@@ -38,11 +37,10 @@
38
37
  "@redocly/ajv": "^8.11.2",
39
38
  "@redocly/config": "^0.20.1",
40
39
  "colorette": "^1.2.0",
41
- "https-proxy-agent": "^7.0.4",
40
+ "https-proxy-agent": "^7.0.5",
42
41
  "js-levenshtein": "^1.1.6",
43
42
  "js-yaml": "^4.1.0",
44
43
  "minimatch": "^5.0.1",
45
- "node-fetch": "^2.6.1",
46
44
  "pluralize": "^8.0.0",
47
45
  "yaml-ast-parser": "0.0.43"
48
46
  },
@@ -50,8 +48,6 @@
50
48
  "@types/js-levenshtein": "^1.1.0",
51
49
  "@types/js-yaml": "^4.0.3",
52
50
  "@types/minimatch": "^3.0.5",
53
- "@types/node": "^20.11.5",
54
- "@types/node-fetch": "^2.5.7",
55
51
  "@types/pluralize": "^0.0.29",
56
52
  "json-schema-to-ts": "^3.1.0",
57
53
  "typescript": "5.5.3"