@verdaccio/server 8.0.0-next-8.30 → 8.0.0-next-8.31
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.
- package/build/debug/index.d.ts +1 -1
- package/build/debug/index.js +2 -3
- package/build/debug/index.js.map +1 -1
- package/build/index.js +5 -4
- package/build/index.js.map +1 -1
- package/build/server.d.ts +2 -2
- package/build/server.js +169 -120
- package/build/server.js.map +1 -1
- package/package.json +12 -12
package/build/debug/index.d.ts
CHANGED
package/build/debug/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
var _default = (app, configPath)
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _default = exports["default"] = function _default(app, configPath) {
|
|
8
8
|
// Hook for tests only
|
|
9
9
|
app.get('/-/_debug', function (req, res, next) {
|
|
10
10
|
if (global.gc) {
|
|
@@ -20,5 +20,4 @@ var _default = (app, configPath) => {
|
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
exports.default = _default;
|
|
24
23
|
//# sourceMappingURL=index.js.map
|
package/build/debug/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_default","app","configPath","get","req","res","next","global","gc","pid","process","main","conf","mem","memoryUsage"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_default","app","configPath","get","req","res","next","global","gc","pid","process","main","conf","mem","memoryUsage"],"sources":["../../src/debug/index.ts"],"sourcesContent":["import type { Application } from 'express';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../types/custom';\n\nexport default (app: Application, configPath?: string): void => {\n // Hook for tests only\n app.get(\n '/-/_debug',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n if (global.gc) {\n global.gc();\n }\n\n next({\n pid: process.pid,\n // @ts-ignore\n main: process.main,\n conf: configPath,\n mem: process.memoryUsage(),\n gc: global.gc,\n });\n }\n );\n};\n"],"mappings":";;;;;;oCAIe,SAAAA,SAACC,GAAgB,EAAEC,UAAmB,EAAW;EAC9D;EACAD,GAAG,CAACE,GAAG,CACL,WAAW,EACX,UAAUC,GAAmB,EAAEC,GAAoB,EAAEC,IAAsB,EAAQ;IACjF,IAAIC,MAAM,CAACC,EAAE,EAAE;MACbD,MAAM,CAACC,EAAE,CAAC,CAAC;IACb;IAEAF,IAAI,CAAC;MACHG,GAAG,EAAEC,OAAO,CAACD,GAAG;MAChB;MACAE,IAAI,EAAED,OAAO,CAACC,IAAI;MAClBC,IAAI,EAAEV,UAAU;MAChBW,GAAG,EAAEH,OAAO,CAACI,WAAW,CAAC,CAAC;MAC1BN,EAAE,EAAED,MAAM,CAACC;IACb,CAAC,CAAC;EACJ,CACF,CAAC;AACH,CAAC","ignoreList":[]}
|
package/build/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
Object.defineProperty(exports, "default", {
|
|
7
8
|
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _server
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _server["default"];
|
|
10
11
|
}
|
|
11
12
|
});
|
|
12
13
|
Object.defineProperty(exports, "startServer", {
|
|
13
14
|
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
+
get: function get() {
|
|
15
16
|
return _server.startServer;
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
19
|
var _server = _interopRequireWildcard(require("./server"));
|
|
19
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" !=
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_server","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_server","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../src/index.ts"],"sourcesContent":["export { default, startServer } from './server';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,EAAAP,CAAA,IAAAC,CAAA,CAAAM,EAAA,IAAAd,CAAA,CAAAc,EAAA,WAAAN,CAAA,KAAAR,CAAA,EAAAC,CAAA","ignoreList":[]}
|
package/build/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Express } from 'express';
|
|
2
|
-
import { ConfigYaml } from '@verdaccio/types';
|
|
1
|
+
import type { Express } from 'express';
|
|
2
|
+
import type { ConfigYaml } from '@verdaccio/types';
|
|
3
3
|
declare const startServer: (configHash: ConfigYaml) => Promise<Express>;
|
|
4
4
|
export { startServer };
|
|
5
5
|
export default startServer;
|
package/build/server.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.startServer = exports
|
|
7
|
+
exports.startServer = exports["default"] = void 0;
|
|
7
8
|
var _compression = _interopRequireDefault(require("compression"));
|
|
8
9
|
var _cors = _interopRequireDefault(require("cors"));
|
|
9
10
|
var _debug = _interopRequireDefault(require("debug"));
|
|
@@ -20,129 +21,177 @@ var _middleware = require("@verdaccio/middleware");
|
|
|
20
21
|
var _store = require("@verdaccio/store");
|
|
21
22
|
var _web = _interopRequireDefault(require("@verdaccio/web"));
|
|
22
23
|
var _debug2 = _interopRequireDefault(require("./debug"));
|
|
23
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
enabled: true,
|
|
65
|
-
strict_ssl: true
|
|
66
|
-
}, {
|
|
67
|
-
config,
|
|
68
|
-
logger: _logger.logger
|
|
69
|
-
});
|
|
70
|
-
_logger.logger.info({
|
|
71
|
-
name: 'verdaccio-audit',
|
|
72
|
-
pluginCategory: _core.PLUGIN_CATEGORY.MIDDLEWARE
|
|
73
|
-
}, 'plugin @{name} successfully loaded (@{pluginCategory})');
|
|
74
|
-
plugins.push(auditPlugin);
|
|
75
|
-
}
|
|
76
|
-
plugins.forEach(plugin => {
|
|
77
|
-
plugin.register_middlewares(app, auth, storage);
|
|
78
|
-
});
|
|
24
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
25
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
29
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
31
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
32
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
33
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
34
|
+
var debug = (0, _debug["default"])('verdaccio:server');
|
|
35
|
+
var _pkgUtils$getPackageJ = _core.pkgUtils.getPackageJson(__dirname, '..'),
|
|
36
|
+
version = _pkgUtils$getPackageJ.version;
|
|
37
|
+
var defineAPI = /*#__PURE__*/function () {
|
|
38
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(config, storage) {
|
|
39
|
+
var _config$server, _config$server2, _config$server$plugin, _config$server3;
|
|
40
|
+
var auth, app, errorReportingMiddlewareWrap, plugins, auditPlugin, middleware;
|
|
41
|
+
return _regenerator().w(function (_context) {
|
|
42
|
+
while (1) switch (_context.n) {
|
|
43
|
+
case 0:
|
|
44
|
+
auth = new _auth.Auth(config, _logger.logger);
|
|
45
|
+
_context.n = 1;
|
|
46
|
+
return auth.init();
|
|
47
|
+
case 1:
|
|
48
|
+
app = (0, _express["default"])(); // run in production mode by default, just in case
|
|
49
|
+
// it shouldn't make any difference anyway
|
|
50
|
+
app.set('env', process.env.NODE_ENV || 'production');
|
|
51
|
+
if ((_config$server = config.server) !== null && _config$server !== void 0 && _config$server.trustProxy) {
|
|
52
|
+
app.set('trust proxy', config.server.trustProxy);
|
|
53
|
+
}
|
|
54
|
+
app.use((0, _cors["default"])());
|
|
55
|
+
app.use((0, _middleware.rateLimit)((_config$server2 = config.server) === null || _config$server2 === void 0 ? void 0 : _config$server2.rateLimit));
|
|
56
|
+
errorReportingMiddlewareWrap = (0, _middleware.errorReportingMiddleware)(_logger.logger); // Router setup
|
|
57
|
+
app.use((0, _middleware.log)(_logger.logger));
|
|
58
|
+
app.use(errorReportingMiddlewareWrap);
|
|
59
|
+
app.use((0, _middleware.userAgent)(config));
|
|
60
|
+
app.use((0, _compression["default"])());
|
|
61
|
+
app.get('/favicon.ico', function (req, res, next) {
|
|
62
|
+
req.url = '/-/static/favicon.ico';
|
|
63
|
+
next();
|
|
64
|
+
});
|
|
79
65
|
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
// Hook for tests only
|
|
67
|
+
if (config._debug) {
|
|
68
|
+
(0, _debug2["default"])(app, config.configPath);
|
|
69
|
+
}
|
|
70
|
+
_context.n = 2;
|
|
71
|
+
return (0, _loaders.asyncLoadPlugin)(config.middlewares, {
|
|
72
|
+
config: config,
|
|
73
|
+
logger: _logger.logger
|
|
74
|
+
}, function (plugin) {
|
|
75
|
+
return typeof plugin.register_middlewares !== 'undefined';
|
|
76
|
+
}, false, (_config$server$plugin = (_config$server3 = config.server) === null || _config$server3 === void 0 ? void 0 : _config$server3.pluginPrefix) !== null && _config$server$plugin !== void 0 ? _config$server$plugin : _core.PLUGIN_PREFIX, _core.PLUGIN_CATEGORY.MIDDLEWARE);
|
|
77
|
+
case 2:
|
|
78
|
+
plugins = _context.v;
|
|
79
|
+
if (plugins.length === 0) {
|
|
80
|
+
auditPlugin = new _verdaccioAudit["default"]({
|
|
81
|
+
enabled: true,
|
|
82
|
+
strict_ssl: true
|
|
83
|
+
}, {
|
|
84
|
+
config: config,
|
|
85
|
+
logger: _logger.logger
|
|
86
|
+
});
|
|
87
|
+
_logger.logger.info({
|
|
88
|
+
name: 'verdaccio-audit',
|
|
89
|
+
pluginCategory: _core.PLUGIN_CATEGORY.MIDDLEWARE
|
|
90
|
+
}, 'plugin @{name} successfully loaded (@{pluginCategory})');
|
|
91
|
+
plugins.push(auditPlugin);
|
|
92
|
+
}
|
|
93
|
+
plugins.forEach(function (plugin) {
|
|
94
|
+
plugin.register_middlewares(app, auth, storage);
|
|
95
|
+
});
|
|
82
96
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
app.use((_req, res, next) => {
|
|
86
|
-
res.locals.app_version = version ?? '';
|
|
87
|
-
next();
|
|
88
|
-
});
|
|
89
|
-
const middleware = await (0, _web.default)(config, auth, storage, _logger.logger);
|
|
90
|
-
app.use(middleware);
|
|
91
|
-
} else {
|
|
92
|
-
app.get('/', function (req, res, next) {
|
|
93
|
-
next(_core.errorUtils.getNotFound(_core.API_ERROR.WEB_DISABLED));
|
|
94
|
-
});
|
|
95
|
-
}
|
|
97
|
+
// For package manager requests
|
|
98
|
+
app.use((0, _api["default"])(config, auth, storage, _logger.logger));
|
|
96
99
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// For WebUI & WebUI API
|
|
101
|
+
if (!_lodash["default"].get(config, 'web.enabled', _lodash["default"].get(config, 'web.enable', true))) {
|
|
102
|
+
_context.n = 4;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
app.use(function (_req, res, next) {
|
|
106
|
+
res.locals.app_version = version !== null && version !== void 0 ? version : '';
|
|
107
|
+
next();
|
|
108
|
+
});
|
|
109
|
+
_context.n = 3;
|
|
110
|
+
return (0, _web["default"])(config, auth, storage, _logger.logger);
|
|
111
|
+
case 3:
|
|
112
|
+
middleware = _context.v;
|
|
113
|
+
app.use(middleware);
|
|
114
|
+
_context.n = 5;
|
|
115
|
+
break;
|
|
116
|
+
case 4:
|
|
117
|
+
app.get('/', function (req, res, next) {
|
|
118
|
+
next(_core.errorUtils.getNotFound(_core.API_ERROR.WEB_DISABLED));
|
|
119
|
+
});
|
|
120
|
+
case 5:
|
|
121
|
+
// Catch 404
|
|
122
|
+
app.get('/*', function (req, res, next) {
|
|
123
|
+
next(_core.errorUtils.getNotFound('resource not found'));
|
|
124
|
+
});
|
|
125
|
+
app.use((0, _middleware.handleError)(_logger.logger));
|
|
102
126
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
// app.use(function (
|
|
128
|
+
// err: HttpError,
|
|
129
|
+
// req: $RequestExtend,
|
|
130
|
+
// res: $ResponseExtend,
|
|
131
|
+
// next: $NextFunctionVer
|
|
132
|
+
// ) {
|
|
133
|
+
// if (_.isError(err)) {
|
|
134
|
+
// if (err.code === 'ECONNABORT' && res.statusCode === HTTP_STATUS.NOT_MODIFIED) {
|
|
135
|
+
// return next();
|
|
136
|
+
// }
|
|
137
|
+
// if (_.isFunction(res.locals.report_error) === false) {
|
|
138
|
+
// // in case of very early error this middleware may not be loaded before error is generated
|
|
139
|
+
// // fixing that
|
|
140
|
+
// errorReportingMiddlewareWrap(req, res, _.noop);
|
|
141
|
+
// }
|
|
142
|
+
// res.locals.report_error(err);
|
|
143
|
+
// } else {
|
|
144
|
+
// // Fall to Middleware.final
|
|
145
|
+
// return next(err);
|
|
146
|
+
// }
|
|
147
|
+
// });
|
|
124
148
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
149
|
+
app.use(_middleware["final"]);
|
|
150
|
+
return _context.a(2, app);
|
|
151
|
+
}
|
|
152
|
+
}, _callee);
|
|
153
|
+
}));
|
|
154
|
+
return function defineAPI(_x, _x2) {
|
|
155
|
+
return _ref.apply(this, arguments);
|
|
156
|
+
};
|
|
157
|
+
}();
|
|
158
|
+
var startServer = exports.startServer = /*#__PURE__*/function () {
|
|
159
|
+
var _startServer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(configHash) {
|
|
160
|
+
var config, storage, _t;
|
|
161
|
+
return _regenerator().w(function (_context2) {
|
|
162
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
163
|
+
case 0:
|
|
164
|
+
debug('start server');
|
|
165
|
+
config = new _config.Config(_objectSpread({}, configHash));
|
|
166
|
+
storage = new _store.Storage(config, _logger.logger);
|
|
167
|
+
_context2.p = 1;
|
|
168
|
+
// waits until init calls have been completed
|
|
169
|
+
debug('storage init start');
|
|
170
|
+
_context2.n = 2;
|
|
171
|
+
return storage.init(config);
|
|
172
|
+
case 2:
|
|
173
|
+
debug('storage init end');
|
|
174
|
+
_context2.n = 4;
|
|
175
|
+
break;
|
|
176
|
+
case 3:
|
|
177
|
+
_context2.p = 3;
|
|
178
|
+
_t = _context2.v;
|
|
179
|
+
_logger.logger.error({
|
|
180
|
+
error: _t.msg
|
|
181
|
+
}, 'storage has failed: @{error}');
|
|
182
|
+
throw new Error(_t);
|
|
183
|
+
case 4:
|
|
184
|
+
_context2.n = 5;
|
|
185
|
+
return defineAPI(config, storage);
|
|
186
|
+
case 5:
|
|
187
|
+
return _context2.a(2, _context2.v);
|
|
188
|
+
}
|
|
189
|
+
}, _callee2, null, [[1, 3]]);
|
|
190
|
+
}));
|
|
191
|
+
function startServer(_x3) {
|
|
192
|
+
return _startServer.apply(this, arguments);
|
|
144
193
|
}
|
|
145
|
-
return
|
|
146
|
-
};
|
|
147
|
-
var _default = exports
|
|
194
|
+
return startServer;
|
|
195
|
+
}();
|
|
196
|
+
var _default = exports["default"] = startServer;
|
|
148
197
|
//# sourceMappingURL=server.js.map
|
package/build/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":["_compression","_interopRequireDefault","require","_cors","_debug","_express","_lodash","_verdaccioAudit","_api","_auth","_config","_core","_loaders","_logger","_middleware","_store","_web","_debug2","e","__esModule","default","debug","buildDebug","version","pkgUtils","getPackageJson","__dirname","defineAPI","config","storage","auth","Auth","logger","init","app","express","set","process","env","NODE_ENV","server","trustProxy","use","cors","rateLimit","errorReportingMiddlewareWrap","errorReportingMiddleware","log","userAgent","compression","get","req","res","next","url","hookDebug","configPath","plugins","asyncLoadPlugin","middlewares","plugin","register_middlewares","pluginPrefix","PLUGIN_PREFIX","PLUGIN_CATEGORY","MIDDLEWARE","length","auditPlugin","AuditMiddleware","enabled","strict_ssl","info","name","pluginCategory","push","forEach","apiEndpoint","_","_req","locals","app_version","middleware","webMiddleware","errorUtils","getNotFound","API_ERROR","WEB_DISABLED","handleError","final","startServer","exports","configHash","AppConfig","Storage","err","error","msg","Error","_default"],"sources":["../src/server.ts"],"sourcesContent":["import compression from 'compression';\nimport cors from 'cors';\nimport buildDebug from 'debug';\nimport express, { Express } from 'express';\nimport _ from 'lodash';\nimport AuditMiddleware from 'verdaccio-audit';\n\nimport apiEndpoint from '@verdaccio/api';\nimport { Auth } from '@verdaccio/auth';\nimport { Config as AppConfig } from '@verdaccio/config';\nimport {\n API_ERROR,\n PLUGIN_CATEGORY,\n PLUGIN_PREFIX,\n errorUtils,\n pkgUtils,\n pluginUtils,\n} from '@verdaccio/core';\nimport { asyncLoadPlugin } from '@verdaccio/loaders';\nimport { logger } from '@verdaccio/logger';\nimport {\n errorReportingMiddleware,\n final,\n handleError,\n log,\n rateLimit,\n userAgent,\n} from '@verdaccio/middleware';\nimport { Storage } from '@verdaccio/store';\nimport { ConfigYaml } from '@verdaccio/types';\nimport { Config as IConfig } from '@verdaccio/types';\nimport webMiddleware from '@verdaccio/web';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';\nimport hookDebug from './debug';\n\nconst debug = buildDebug('verdaccio:server');\nconst { version } = pkgUtils.getPackageJson(__dirname, '..');\n\nconst defineAPI = async function (config: IConfig, storage: Storage): Promise<Express> {\n const auth = new Auth(config, logger);\n await auth.init();\n const app = express();\n // run in production mode by default, just in case\n // it shouldn't make any difference anyway\n app.set('env', process.env.NODE_ENV || 'production');\n if (config.server?.trustProxy) {\n app.set('trust proxy', config.server.trustProxy);\n }\n app.use(cors());\n app.use(rateLimit(config.server?.rateLimit));\n\n const errorReportingMiddlewareWrap = errorReportingMiddleware(logger);\n\n // Router setup\n app.use(log(logger));\n app.use(errorReportingMiddlewareWrap);\n app.use(userAgent(config));\n app.use(compression());\n\n app.get(\n '/favicon.ico',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n req.url = '/-/static/favicon.ico';\n next();\n }\n );\n\n // Hook for tests only\n if (config._debug) {\n hookDebug(app, config.configPath);\n }\n\n const plugins: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>[] = await asyncLoadPlugin(\n config.middlewares,\n {\n config,\n logger,\n },\n function (plugin) {\n return typeof plugin.register_middlewares !== 'undefined';\n },\n false,\n config.server?.pluginPrefix ?? PLUGIN_PREFIX,\n PLUGIN_CATEGORY.MIDDLEWARE\n );\n\n if (plugins.length === 0) {\n const auditPlugin = new AuditMiddleware(\n { enabled: true, strict_ssl: true },\n { config, logger }\n );\n logger.info(\n { name: 'verdaccio-audit', pluginCategory: PLUGIN_CATEGORY.MIDDLEWARE },\n 'plugin @{name} successfully loaded (@{pluginCategory})'\n );\n plugins.push(auditPlugin);\n }\n\n plugins.forEach((plugin: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>) => {\n plugin.register_middlewares(app, auth, storage);\n });\n\n // For package manager requests\n app.use(apiEndpoint(config, auth, storage, logger));\n\n // For WebUI & WebUI API\n if (_.get(config, 'web.enabled', _.get(config, 'web.enable', true))) {\n app.use((_req, res, next) => {\n res.locals.app_version = version ?? '';\n next();\n });\n const middleware = await webMiddleware(config, auth, storage, logger);\n app.use(middleware);\n } else {\n app.get('/', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound(API_ERROR.WEB_DISABLED));\n });\n }\n\n // Catch 404\n app.get('/*', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound('resource not found'));\n });\n\n app.use(handleError(logger));\n\n // app.use(function (\n // err: HttpError,\n // req: $RequestExtend,\n // res: $ResponseExtend,\n // next: $NextFunctionVer\n // ) {\n // if (_.isError(err)) {\n // if (err.code === 'ECONNABORT' && res.statusCode === HTTP_STATUS.NOT_MODIFIED) {\n // return next();\n // }\n // if (_.isFunction(res.locals.report_error) === false) {\n // // in case of very early error this middleware may not be loaded before error is generated\n // // fixing that\n // errorReportingMiddlewareWrap(req, res, _.noop);\n // }\n // res.locals.report_error(err);\n // } else {\n // // Fall to Middleware.final\n // return next(err);\n // }\n // });\n\n app.use(final);\n\n return app;\n};\n\nconst startServer = async function startServer(configHash: ConfigYaml): Promise<Express> {\n debug('start server');\n const config: IConfig = new AppConfig({ ...configHash } as any);\n const storage = new Storage(config, logger);\n try {\n // waits until init calls have been completed\n debug('storage init start');\n await storage.init(config);\n debug('storage init end');\n } catch (err: any) {\n logger.error({ error: err.msg }, 'storage has failed: @{error}');\n throw new Error(err);\n }\n return await defineAPI(config, storage);\n};\n\nexport { startServer };\nexport default startServer;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,IAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AAQA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAQA,IAAAa,MAAA,GAAAb,OAAA;AAGA,IAAAc,IAAA,GAAAf,sBAAA,CAAAC,OAAA;AAGA,IAAAe,OAAA,GAAAhB,sBAAA,CAAAC,OAAA;AAAgC,SAAAD,uBAAAiB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,kBAAkB,CAAC;AAC5C,MAAM;EAAEC;AAAQ,CAAC,GAAGC,cAAQ,CAACC,cAAc,CAACC,SAAS,EAAE,IAAI,CAAC;AAE5D,MAAMC,SAAS,GAAG,eAAAA,CAAgBC,MAAe,EAAEC,OAAgB,EAAoB;EACrF,MAAMC,IAAI,GAAG,IAAIC,UAAI,CAACH,MAAM,EAAEI,cAAM,CAAC;EACrC,MAAMF,IAAI,CAACG,IAAI,CAAC,CAAC;EACjB,MAAMC,GAA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;IAChE,MAAM,IAAIC,KAAK,CAACH,GAAG,CAAC;EACtB;EACA,OAAO,MAAMnE,SAAS,CAACC,MAAM,EAAEC,OAAO,CAAC;AACzC,CAAC;AAAC,IAAAqE,QAAA,GAAAR,OAAA,CAAAtE,OAAA,GAGaqE,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"server.js","names":["_compression","_interopRequireDefault","require","_cors","_debug","_express","_lodash","_verdaccioAudit","_api","_auth","_config","_core","_loaders","_logger","_middleware","_store","_web","_debug2","e","__esModule","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","_typeof","Symbol","toPrimitive","call","TypeError","String","Number","_regenerator","n","iterator","toStringTag","c","prototype","Generator","u","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","l","done","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","w","m","_regeneratorDefine","_invoke","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","_next","_throw","debug","buildDebug","_pkgUtils$getPackageJ","pkgUtils","getPackageJson","__dirname","version","defineAPI","_ref","_callee","config","storage","_config$server","_config$server2","_config$server$plugin","_config$server3","auth","app","errorReportingMiddlewareWrap","plugins","auditPlugin","middleware","_context","Auth","logger","init","express","set","process","env","NODE_ENV","server","trustProxy","use","cors","rateLimit","errorReportingMiddleware","log","userAgent","compression","get","req","res","next","url","hookDebug","configPath","asyncLoadPlugin","middlewares","plugin","register_middlewares","pluginPrefix","PLUGIN_PREFIX","PLUGIN_CATEGORY","MIDDLEWARE","AuditMiddleware","enabled","strict_ssl","info","name","pluginCategory","apiEndpoint","_","_req","locals","app_version","webMiddleware","errorUtils","getNotFound","API_ERROR","WEB_DISABLED","handleError","final","_x","_x2","startServer","exports","_startServer","_callee2","configHash","_t","_context2","AppConfig","Storage","error","msg","Error","_x3","_default"],"sources":["../src/server.ts"],"sourcesContent":["import compression from 'compression';\nimport cors from 'cors';\nimport buildDebug from 'debug';\nimport type { Express } from 'express';\nimport express from 'express';\nimport _ from 'lodash';\nimport AuditMiddleware from 'verdaccio-audit';\n\nimport apiEndpoint from '@verdaccio/api';\nimport { Auth } from '@verdaccio/auth';\nimport { Config as AppConfig } from '@verdaccio/config';\nimport type { pluginUtils } from '@verdaccio/core';\nimport { API_ERROR, PLUGIN_CATEGORY, PLUGIN_PREFIX, errorUtils, pkgUtils } from '@verdaccio/core';\nimport { asyncLoadPlugin } from '@verdaccio/loaders';\nimport { logger } from '@verdaccio/logger';\nimport {\n errorReportingMiddleware,\n final,\n handleError,\n log,\n rateLimit,\n userAgent,\n} from '@verdaccio/middleware';\nimport { Storage } from '@verdaccio/store';\nimport type { ConfigYaml, Config as IConfig } from '@verdaccio/types';\nimport webMiddleware from '@verdaccio/web';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';\nimport hookDebug from './debug';\n\nconst debug = buildDebug('verdaccio:server');\nconst { version } = pkgUtils.getPackageJson(__dirname, '..');\n\nconst defineAPI = async function (config: IConfig, storage: Storage): Promise<Express> {\n const auth = new Auth(config, logger);\n await auth.init();\n const app = express();\n // run in production mode by default, just in case\n // it shouldn't make any difference anyway\n app.set('env', process.env.NODE_ENV || 'production');\n if (config.server?.trustProxy) {\n app.set('trust proxy', config.server.trustProxy);\n }\n app.use(cors());\n app.use(rateLimit(config.server?.rateLimit));\n\n const errorReportingMiddlewareWrap = errorReportingMiddleware(logger);\n\n // Router setup\n app.use(log(logger));\n app.use(errorReportingMiddlewareWrap);\n app.use(userAgent(config));\n app.use(compression());\n\n app.get(\n '/favicon.ico',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n req.url = '/-/static/favicon.ico';\n next();\n }\n );\n\n // Hook for tests only\n if (config._debug) {\n hookDebug(app, config.configPath);\n }\n\n const plugins: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>[] = await asyncLoadPlugin(\n config.middlewares,\n {\n config,\n logger,\n },\n function (plugin) {\n return typeof plugin.register_middlewares !== 'undefined';\n },\n false,\n config.server?.pluginPrefix ?? PLUGIN_PREFIX,\n PLUGIN_CATEGORY.MIDDLEWARE\n );\n\n if (plugins.length === 0) {\n const auditPlugin = new AuditMiddleware(\n { enabled: true, strict_ssl: true },\n { config, logger }\n );\n logger.info(\n { name: 'verdaccio-audit', pluginCategory: PLUGIN_CATEGORY.MIDDLEWARE },\n 'plugin @{name} successfully loaded (@{pluginCategory})'\n );\n plugins.push(auditPlugin);\n }\n\n plugins.forEach((plugin: pluginUtils.ExpressMiddleware<IConfig, {}, Auth>) => {\n plugin.register_middlewares(app, auth, storage);\n });\n\n // For package manager requests\n app.use(apiEndpoint(config, auth, storage, logger));\n\n // For WebUI & WebUI API\n if (_.get(config, 'web.enabled', _.get(config, 'web.enable', true))) {\n app.use((_req, res, next) => {\n res.locals.app_version = version ?? '';\n next();\n });\n const middleware = await webMiddleware(config, auth, storage, logger);\n app.use(middleware);\n } else {\n app.get('/', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound(API_ERROR.WEB_DISABLED));\n });\n }\n\n // Catch 404\n app.get('/*', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound('resource not found'));\n });\n\n app.use(handleError(logger));\n\n // app.use(function (\n // err: HttpError,\n // req: $RequestExtend,\n // res: $ResponseExtend,\n // next: $NextFunctionVer\n // ) {\n // if (_.isError(err)) {\n // if (err.code === 'ECONNABORT' && res.statusCode === HTTP_STATUS.NOT_MODIFIED) {\n // return next();\n // }\n // if (_.isFunction(res.locals.report_error) === false) {\n // // in case of very early error this middleware may not be loaded before error is generated\n // // fixing that\n // errorReportingMiddlewareWrap(req, res, _.noop);\n // }\n // res.locals.report_error(err);\n // } else {\n // // Fall to Middleware.final\n // return next(err);\n // }\n // });\n\n app.use(final);\n\n return app;\n};\n\nconst startServer = async function startServer(configHash: ConfigYaml): Promise<Express> {\n debug('start server');\n const config: IConfig = new AppConfig({ ...configHash } as any);\n const storage = new Storage(config, logger);\n try {\n // waits until init calls have been completed\n debug('storage init start');\n await storage.init(config);\n debug('storage init end');\n } catch (err: any) {\n logger.error({ error: err.msg }, 'storage has failed: @{error}');\n throw new Error(err);\n }\n return await defineAPI(config, storage);\n};\n\nexport { startServer };\nexport default startServer;\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,IAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAEA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAQA,IAAAa,MAAA,GAAAb,OAAA;AAEA,IAAAc,IAAA,GAAAf,sBAAA,CAAAC,OAAA;AAGA,IAAAe,OAAA,GAAAhB,sBAAA,CAAAC,OAAA;AAAgC,SAAAD,uBAAAiB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,QAAAF,CAAA,EAAAG,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAN,CAAA,OAAAK,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAA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G,CAAA;UAEzC;UACA0B,KAAK,CAAC,oBAAoB,CAAC;UAACiF,SAAA,CAAArH,CAAA;UAAA,OACtB+C,OAAO,CAACc,IAAI,CAACf,MAAM,CAAC;QAAA;UAC1BV,KAAK,CAAC,kBAAkB,CAAC;UAACiF,SAAA,CAAArH,CAAA;UAAA;QAAA;UAAAqH,SAAA,CAAA3G,CAAA;UAAA0G,EAAA,GAAAC,SAAA,CAAAxG,CAAA;UAE1B+C,cAAM,CAAC4D,KAAK,CAAC;YAAEA,KAAK,EAAEJ,EAAA,CAAIK;UAAI,CAAC,EAAE,8BAA8B,CAAC;UAAC,MAC3D,IAAIC,KAAK,CAAAN,EAAI,CAAC;QAAA;UAAAC,SAAA,CAAArH,CAAA;UAAA,OAET2C,SAAS,CAACG,MAAM,EAAEC,OAAO,CAAC;QAAA;UAAA,OAAAsE,SAAA,CAAAvG,CAAA,IAAAuG,SAAA,CAAAxG,CAAA;MAAA;IAAA,GAAAqG,QAAA;EAAA,CACxC;EAAA,SAdkCH,WAAWA,CAAAY,GAAA;IAAA,OAAAV,YAAA,CAAAxI,KAAA,OAAAE,SAAA;EAAA;EAAA,OAAXoI,WAAW;AAAA,GAc7C;AAAC,IAAAa,QAAA,GAAAZ,OAAA,cAGaD,WAAW","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/server",
|
|
3
|
-
"version": "8.0.0-next-8.
|
|
3
|
+
"version": "8.0.0-next-8.31",
|
|
4
4
|
"description": "Verdaccio Express Server",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"node": ">=18"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@verdaccio/api": "8.1.0-next-8.
|
|
37
|
-
"@verdaccio/auth": "8.0.0-next-8.
|
|
38
|
-
"@verdaccio/core": "8.0.0-next-8.
|
|
39
|
-
"@verdaccio/config": "8.0.0-next-8.
|
|
40
|
-
"@verdaccio/loaders": "8.0.0-next-8.
|
|
41
|
-
"@verdaccio/logger": "8.0.0-next-8.
|
|
42
|
-
"@verdaccio/middleware": "8.0.0-next-8.
|
|
43
|
-
"@verdaccio/store": "8.0.0-next-8.
|
|
44
|
-
"@verdaccio/web": "8.1.0-next-8.
|
|
45
|
-
"verdaccio-audit": "13.0.0-next-8.
|
|
36
|
+
"@verdaccio/api": "8.1.0-next-8.31",
|
|
37
|
+
"@verdaccio/auth": "8.0.0-next-8.31",
|
|
38
|
+
"@verdaccio/core": "8.0.0-next-8.31",
|
|
39
|
+
"@verdaccio/config": "8.0.0-next-8.31",
|
|
40
|
+
"@verdaccio/loaders": "8.0.0-next-8.21",
|
|
41
|
+
"@verdaccio/logger": "8.0.0-next-8.31",
|
|
42
|
+
"@verdaccio/middleware": "8.0.0-next-8.31",
|
|
43
|
+
"@verdaccio/store": "8.0.0-next-8.31",
|
|
44
|
+
"@verdaccio/web": "8.1.0-next-8.31",
|
|
45
|
+
"verdaccio-audit": "13.0.0-next-8.31",
|
|
46
46
|
"compression": "1.8.1",
|
|
47
47
|
"cors": "2.8.5",
|
|
48
48
|
"debug": "4.4.3",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"lodash": "4.17.23"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@verdaccio/types": "13.0.0-next-8.
|
|
53
|
+
"@verdaccio/types": "13.0.0-next-8.11",
|
|
54
54
|
"supertest": "7.1.4",
|
|
55
55
|
"vitest": "3.2.4"
|
|
56
56
|
},
|