@verdaccio/core 8.1.1 → 8.1.4

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/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import * as constants from './constants';
3
3
  import * as cryptoUtils from './crypto-utils';
4
4
  import * as errorUtils from './error-utils';
5
5
  import * as fileUtils from './file-utils';
6
+ import * as ipUtils from './ip-utils';
6
7
  import * as pkgUtils from './pkg-utils';
7
8
  import * as pluginUtils from './plugin-utils';
8
9
  import * as searchUtils from './search-utils';
@@ -13,4 +14,4 @@ import * as validationUtils from './validation-utils';
13
14
  import * as warningUtils from './warning-utils';
14
15
  export { VerdaccioError, API_ERROR, SUPPORT_ERRORS, APP_ERROR } from './error-utils';
15
16
  export { TOKEN_BASIC, TOKEN_BEARER, HTTP_STATUS, API_MESSAGE, HEADERS, DIST_TAGS, CHARACTER_ENCODING, HEADER_TYPE, LATEST, DEFAULT_PASSWORD_VALIDATION, DEFAULT_USER, ANONYMOUS_USER, USERS, MAINTAINERS, PLUGIN_CATEGORY, PLUGIN_PREFIX, PLUGIN_UI_PREFIX, HtpasswdHashAlgorithm, DEFAULT_DOMAIN, DEFAULT_PORT, DEFAULT_PROTOCOL, } from './constants';
16
- export { authUtils, cryptoUtils, fileUtils, pkgUtils, searchUtils, streamUtils, errorUtils, validationUtils, stringUtils, constants, pluginUtils, warningUtils, tarballUtils, };
17
+ export { authUtils, cryptoUtils, fileUtils, ipUtils, pkgUtils, searchUtils, streamUtils, errorUtils, validationUtils, stringUtils, constants, pluginUtils, warningUtils, tarballUtils, };
package/build/index.js CHANGED
@@ -153,7 +153,7 @@ Object.defineProperty(exports, "VerdaccioError", {
153
153
  return errorUtils.VerdaccioError;
154
154
  }
155
155
  });
156
- exports.warningUtils = exports.validationUtils = exports.tarballUtils = exports.stringUtils = exports.streamUtils = exports.searchUtils = exports.pluginUtils = exports.pkgUtils = exports.fileUtils = exports.errorUtils = exports.cryptoUtils = exports.constants = exports.authUtils = void 0;
156
+ exports.warningUtils = exports.validationUtils = exports.tarballUtils = exports.stringUtils = exports.streamUtils = exports.searchUtils = exports.pluginUtils = exports.pkgUtils = exports.ipUtils = exports.fileUtils = exports.errorUtils = exports.cryptoUtils = exports.constants = exports.authUtils = void 0;
157
157
  var authUtils = _interopRequireWildcard(require("./auth-utils"));
158
158
  exports.authUtils = authUtils;
159
159
  var constants = _interopRequireWildcard(require("./constants"));
@@ -164,6 +164,8 @@ var errorUtils = _interopRequireWildcard(require("./error-utils"));
164
164
  exports.errorUtils = errorUtils;
165
165
  var fileUtils = _interopRequireWildcard(require("./file-utils"));
166
166
  exports.fileUtils = fileUtils;
167
+ var ipUtils = _interopRequireWildcard(require("./ip-utils"));
168
+ exports.ipUtils = ipUtils;
167
169
  var pkgUtils = _interopRequireWildcard(require("./pkg-utils"));
168
170
  exports.pkgUtils = pkgUtils;
169
171
  var pluginUtils = _interopRequireWildcard(require("./plugin-utils"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["authUtils","_interopRequireWildcard","require","exports","constants","cryptoUtils","errorUtils","fileUtils","pkgUtils","pluginUtils","searchUtils","streamUtils","stringUtils","tarballUtils","validationUtils","warningUtils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../src/index.ts"],"sourcesContent":["import * as authUtils from './auth-utils';\nimport * as constants from './constants';\nimport * as cryptoUtils from './crypto-utils';\nimport * as errorUtils from './error-utils';\nimport * as fileUtils from './file-utils';\nimport * as pkgUtils from './pkg-utils';\nimport * as pluginUtils from './plugin-utils';\nimport * as searchUtils from './search-utils';\nimport * as streamUtils from './stream-utils';\nimport * as stringUtils from './string-utils';\nimport * as tarballUtils from './tarball-utils';\nimport * as validationUtils from './validation-utils';\nimport * as warningUtils from './warning-utils';\n\nexport { VerdaccioError, API_ERROR, SUPPORT_ERRORS, APP_ERROR } from './error-utils';\nexport {\n TOKEN_BASIC,\n TOKEN_BEARER,\n HTTP_STATUS,\n API_MESSAGE,\n HEADERS,\n DIST_TAGS,\n CHARACTER_ENCODING,\n HEADER_TYPE,\n LATEST,\n DEFAULT_PASSWORD_VALIDATION,\n DEFAULT_USER,\n ANONYMOUS_USER,\n USERS,\n MAINTAINERS,\n PLUGIN_CATEGORY,\n PLUGIN_PREFIX,\n PLUGIN_UI_PREFIX,\n HtpasswdHashAlgorithm,\n DEFAULT_DOMAIN,\n DEFAULT_PORT,\n DEFAULT_PROTOCOL,\n} from './constants';\nexport {\n authUtils,\n cryptoUtils,\n fileUtils,\n pkgUtils,\n searchUtils,\n streamUtils,\n errorUtils,\n validationUtils,\n stringUtils,\n constants,\n pluginUtils,\n warningUtils,\n tarballUtils,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0CC,OAAA,CAAAH,SAAA,GAAAA,SAAA;AAC1C,IAAAI,SAAA,GAAAH,uBAAA,CAAAC,OAAA;AAAyCC,OAAA,CAAAC,SAAA,GAAAA,SAAA;AACzC,IAAAC,WAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA8CC,OAAA,CAAAE,WAAA,GAAAA,WAAA;AAC9C,IAAAC,UAAA,GAAAL,uBAAA,CAAAC,OAAA;AAA4CC,OAAA,CAAAG,UAAA,GAAAA,UAAA;AAC5C,IAAAC,SAAA,GAAAN,uBAAA,CAAAC,OAAA;AAA0CC,OAAA,CAAAI,SAAA,GAAAA,SAAA;AAC1C,IAAAC,QAAA,GAAAP,uBAAA,CAAAC,OAAA;AAAwCC,OAAA,CAAAK,QAAA,GAAAA,QAAA;AACxC,IAAAC,WAAA,GA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AAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["authUtils","_interopRequireWildcard","require","exports","constants","cryptoUtils","errorUtils","fileUtils","ipUtils","pkgUtils","pluginUtils","searchUtils","streamUtils","stringUtils","tarballUtils","validationUtils","warningUtils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../src/index.ts"],"sourcesContent":["import * as authUtils from './auth-utils';\nimport * as constants from './constants';\nimport * as cryptoUtils from './crypto-utils';\nimport * as errorUtils from './error-utils';\nimport * as fileUtils from './file-utils';\nimport * as ipUtils from './ip-utils';\nimport * as pkgUtils from './pkg-utils';\nimport * as pluginUtils from './plugin-utils';\nimport * as searchUtils from './search-utils';\nimport * as streamUtils from './stream-utils';\nimport * as stringUtils from './string-utils';\nimport * as tarballUtils from './tarball-utils';\nimport * as validationUtils from './validation-utils';\nimport * as warningUtils from './warning-utils';\n\nexport { VerdaccioError, API_ERROR, SUPPORT_ERRORS, APP_ERROR } from './error-utils';\nexport {\n TOKEN_BASIC,\n TOKEN_BEARER,\n HTTP_STATUS,\n API_MESSAGE,\n HEADERS,\n DIST_TAGS,\n CHARACTER_ENCODING,\n HEADER_TYPE,\n LATEST,\n DEFAULT_PASSWORD_VALIDATION,\n DEFAULT_USER,\n ANONYMOUS_USER,\n USERS,\n MAINTAINERS,\n PLUGIN_CATEGORY,\n PLUGIN_PREFIX,\n PLUGIN_UI_PREFIX,\n HtpasswdHashAlgorithm,\n DEFAULT_DOMAIN,\n DEFAULT_PORT,\n DEFAULT_PROTOCOL,\n} from './constants';\nexport {\n authUtils,\n cryptoUtils,\n fileUtils,\n ipUtils,\n pkgUtils,\n searchUtils,\n streamUtils,\n errorUtils,\n validationUtils,\n stringUtils,\n constants,\n pluginUtils,\n warningUtils,\n tarballUtils,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0CC,OAAA,CAAAH,SAAA,GAAAA,SAAA;AAC1C,IAAAI,SAAA,GAAAH,uBAAA,CAAAC,OAAA;AAAyCC,OAAA,CAAAC,SAAA,GAAAA,SAAA;AACzC,IAAAC,WAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA8CC,OAAA,CAAAE,WAAA,GAAAA,WAAA;AAC9C,IAAAC,UAAA,GAAAL,uBAAA,CAAAC,OAAA;AAA4CC,OAAA,CAAAG,UAAA,GAAAA,UAAA;AAC5C,IAAAC,SAAA,GAAAN,uBAAA,CAAAC,OAAA;AAA0CC,OAAA,CAAAI,SAAA,GAAAA,SAAA;AAC1C,IAAAC,OAAA,GAAAP,uBAAA,CAAAC,OAAA;AAAsCC,OAAA,CAAAK,OAAA,GAAAA,OAAA;AACtC,IAAAC,QAAA,GAAAR,uBAAA,CAAAC,OAAA;AAAwCC,OAAA,CAAAM,QAAA,GAAAA,QAAA;AACxC,IAAAC,WAAA,GAAAT,uBAAA,CAAAC,OAAA;AAA8CC,OAAA,CAAAO,WAAA,GAAAA,WAAA;AAC9C,IAAAC,WAAA,GAAAV,uBAAA,CAAAC,OAAA;AAA8CC,OAAA,CAAAQ,WAAA,GAAAA,WAAA;A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AAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Trim an address and strip the IPv4-mapped IPv6 prefix (`::ffff:`) so that
3
+ * mapped addresses are compared as plain IPv4.
4
+ */
5
+ export declare function normalizeAddress(address?: string): string | undefined;
6
+ /**
7
+ * Convert a dotted-quad IPv4 address into its unsigned 32-bit integer value.
8
+ */
9
+ export declare function parseIPv4(address: string): number | undefined;
10
+ /**
11
+ * Whether an IPv4 `address` falls inside the `range`/`prefix` CIDR block.
12
+ */
13
+ export declare function isIPv4InCIDR(address: string, range: string, prefix: number): boolean;
14
+ /**
15
+ * Whether `address` is allowed by the provided `cidr` whitelist. An empty or
16
+ * missing whitelist allows every address; an unparseable address is rejected.
17
+ */
18
+ export declare function isAddressAllowed(address: string | undefined, cidr: string[] | undefined): boolean;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAddressAllowed = isAddressAllowed;
7
+ exports.isIPv4InCIDR = isIPv4InCIDR;
8
+ exports.normalizeAddress = normalizeAddress;
9
+ exports.parseIPv4 = parseIPv4;
10
+ var _nodeNet = _interopRequireDefault(require("node:net"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const IPV4_MAPPED_PREFIX = '::ffff:';
13
+
14
+ /**
15
+ * Trim an address and strip the IPv4-mapped IPv6 prefix (`::ffff:`) so that
16
+ * mapped addresses are compared as plain IPv4.
17
+ */
18
+ function normalizeAddress(address) {
19
+ if (!address) {
20
+ return;
21
+ }
22
+ const trimmedAddress = address.trim();
23
+ if (trimmedAddress.startsWith(IPV4_MAPPED_PREFIX)) {
24
+ return trimmedAddress.slice(IPV4_MAPPED_PREFIX.length);
25
+ }
26
+ return trimmedAddress;
27
+ }
28
+
29
+ /**
30
+ * Convert a dotted-quad IPv4 address into its unsigned 32-bit integer value.
31
+ */
32
+ function parseIPv4(address) {
33
+ if (_nodeNet.default.isIP(address) !== 4) {
34
+ return;
35
+ }
36
+ return address.split('.').map(Number).reduce((accumulator, octet) => (accumulator << 8) + octet, 0) >>> 0;
37
+ }
38
+
39
+ /**
40
+ * Whether an IPv4 `address` falls inside the `range`/`prefix` CIDR block.
41
+ */
42
+ function isIPv4InCIDR(address, range, prefix) {
43
+ const addressNumber = parseIPv4(address);
44
+ const rangeNumber = parseIPv4(range);
45
+ if (addressNumber === undefined || rangeNumber === undefined || prefix < 0 || prefix > 32) {
46
+ return false;
47
+ }
48
+ const mask = prefix === 0 ? 0 : 0xffffffff << 32 - prefix >>> 0;
49
+ return (addressNumber & mask) === (rangeNumber & mask);
50
+ }
51
+
52
+ /**
53
+ * Whether `address` is allowed by the provided `cidr` whitelist. An empty or
54
+ * missing whitelist allows every address; an unparseable address is rejected.
55
+ */
56
+ function isAddressAllowed(address, cidr) {
57
+ if (!cidr || cidr.length === 0) {
58
+ return true;
59
+ }
60
+ const normalizedAddress = normalizeAddress(address);
61
+ if (!normalizedAddress) {
62
+ return false;
63
+ }
64
+ return cidr.some(entry => {
65
+ const [range, prefixValue] = entry.split('/');
66
+ const normalizedRange = normalizeAddress(range);
67
+ if (!normalizedRange) {
68
+ return false;
69
+ }
70
+ if (typeof prefixValue === 'undefined') {
71
+ return normalizedAddress === normalizedRange;
72
+ }
73
+ const prefix = Number(prefixValue);
74
+ if (Number.isInteger(prefix) === false) {
75
+ return false;
76
+ }
77
+ if (_nodeNet.default.isIP(normalizedAddress) === 4 && _nodeNet.default.isIP(normalizedRange) === 4) {
78
+ return isIPv4InCIDR(normalizedAddress, normalizedRange, prefix);
79
+ }
80
+ return prefix === 128 && normalizedAddress === normalizedRange;
81
+ });
82
+ }
83
+ //# sourceMappingURL=ip-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip-utils.js","names":["_nodeNet","_interopRequireDefault","require","e","__esModule","default","IPV4_MAPPED_PREFIX","normalizeAddress","address","trimmedAddress","trim","startsWith","slice","length","parseIPv4","net","isIP","split","map","Number","reduce","accumulator","octet","isIPv4InCIDR","range","prefix","addressNumber","rangeNumber","undefined","mask","isAddressAllowed","cidr","normalizedAddress","some","entry","prefixValue","normalizedRange","isInteger"],"sources":["../src/ip-utils.ts"],"sourcesContent":["import net from 'node:net';\n\nconst IPV4_MAPPED_PREFIX = '::ffff:';\n\n/**\n * Trim an address and strip the IPv4-mapped IPv6 prefix (`::ffff:`) so that\n * mapped addresses are compared as plain IPv4.\n */\nexport function normalizeAddress(address?: string): string | undefined {\n if (!address) {\n return;\n }\n\n const trimmedAddress = address.trim();\n\n if (trimmedAddress.startsWith(IPV4_MAPPED_PREFIX)) {\n return trimmedAddress.slice(IPV4_MAPPED_PREFIX.length);\n }\n\n return trimmedAddress;\n}\n\n/**\n * Convert a dotted-quad IPv4 address into its unsigned 32-bit integer value.\n */\nexport function parseIPv4(address: string): number | undefined {\n if (net.isIP(address) !== 4) {\n return;\n }\n\n return (\n address\n .split('.')\n .map(Number)\n .reduce((accumulator, octet) => (accumulator << 8) + octet, 0) >>> 0\n );\n}\n\n/**\n * Whether an IPv4 `address` falls inside the `range`/`prefix` CIDR block.\n */\nexport function isIPv4InCIDR(address: string, range: string, prefix: number): boolean {\n const addressNumber = parseIPv4(address);\n const rangeNumber = parseIPv4(range);\n\n if (addressNumber === undefined || rangeNumber === undefined || prefix < 0 || prefix > 32) {\n return false;\n }\n\n const mask = prefix === 0 ? 0 : (0xffffffff << (32 - prefix)) >>> 0;\n\n return (addressNumber & mask) === (rangeNumber & mask);\n}\n\n/**\n * Whether `address` is allowed by the provided `cidr` whitelist. An empty or\n * missing whitelist allows every address; an unparseable address is rejected.\n */\nexport function isAddressAllowed(address: string | undefined, cidr: string[] | undefined): boolean {\n if (!cidr || cidr.length === 0) {\n return true;\n }\n\n const normalizedAddress = normalizeAddress(address);\n\n if (!normalizedAddress) {\n return false;\n }\n\n return cidr.some((entry) => {\n const [range, prefixValue] = entry.split('/');\n const normalizedRange = normalizeAddress(range);\n\n if (!normalizedRange) {\n return false;\n }\n\n if (typeof prefixValue === 'undefined') {\n return normalizedAddress === normalizedRange;\n }\n\n const prefix = Number(prefixValue);\n\n if (Number.isInteger(prefix) === false) {\n return false;\n }\n\n if (net.isIP(normalizedAddress) === 4 && net.isIP(normalizedRange) === 4) {\n return isIPv4InCIDR(normalizedAddress, normalizedRange, prefix);\n }\n\n return prefix === 128 && normalizedAddress === normalizedRange;\n });\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3B,MAAMG,kBAAkB,GAAG,SAAS;;AAEpC;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAACC,OAAgB,EAAsB;EACrE,IAAI,CAACA,OAAO,EAAE;IACZ;EACF;EAEA,MAAMC,cAAc,GAAGD,OAAO,CAACE,IAAI,CAAC,CAAC;EAErC,IAAID,cAAc,CAACE,UAAU,CAACL,kBAAkB,CAAC,EAAE;IACjD,OAAOG,cAAc,CAACG,KAAK,CAACN,kBAAkB,CAACO,MAAM,CAAC;EACxD;EAEA,OAAOJ,cAAc;AACvB;;AAEA;AACA;AACA;AACO,SAASK,SAASA,CAACN,OAAe,EAAsB;EAC7D,IAAIO,gBAAG,CAACC,IAAI,CAACR,OAAO,CAAC,KAAK,CAAC,EAAE;IAC3B;EACF;EAEA,OACEA,OAAO,CACJS,KAAK,CAAC,GAAG,CAAC,CACVC,GAAG,CAACC,MAAM,CAAC,CACXC,MAAM,CAAC,CAACC,WAAW,EAAEC,KAAK,KAAK,CAACD,WAAW,IAAI,CAAC,IAAIC,K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AIhB,MAAM,CAACkB,SAAS,CAACZ,MAAM,CAAC,KAAK,KAAK,EAAE;MACtC,OAAO,KAAK;IACd;IAEA,IAAIV,gBAAG,CAACC,IAAI,CAACgB,iBAAiB,CAAC,KAAK,CAAC,IAAIjB,gBAAG,CAACC,IAAI,CAACoB,eAAe,CAAC,KAAK,CAAC,EAAE;MACxE,OAAOb,YAAY,CAACS,iBAAiB,EAAEI,eAAe,EAAEX,MAAM,CAAC;IACjE;IAEA,OAAOA,MAAM,KAAK,GAAG,IAAIO,iBAAiB,KAAKI,eAAe;EAChE,CAAC,CAAC;AACJ","ignoreList":[]}
package/package.json CHANGED
@@ -1,34 +1,35 @@
1
1
  {
2
2
  "name": "@verdaccio/core",
3
- "version": "8.1.1",
3
+ "version": "8.1.4",
4
4
  "description": "Verdaccio Core Components",
5
5
  "keywords": [
6
- "private",
7
- "package",
8
- "repository",
9
- "registry",
10
6
  "enterprise",
11
7
  "modules",
8
+ "package",
9
+ "private",
12
10
  "proxy",
11
+ "registry",
12
+ "repository",
13
13
  "server",
14
14
  "verdaccio"
15
15
  ],
16
- "main": "./build/index.js",
17
- "types": "./build/index.d.ts",
18
- "author": "Juan Picado <juanpicado19@gmail.com>",
19
- "license": "MIT",
20
16
  "homepage": "https://verdaccio.org",
21
- "engines": {
22
- "node": ">=18"
17
+ "bugs": {
18
+ "url": "https://github.com/verdaccio/verdaccio/issues"
23
19
  },
20
+ "license": "MIT",
21
+ "author": "Juan Picado <juanpicado19@gmail.com>",
24
22
  "repository": {
25
23
  "type": "https",
26
24
  "url": "https://github.com/verdaccio/verdaccio",
27
25
  "directory": "packages/core/core"
28
26
  },
29
- "bugs": {
30
- "url": "https://github.com/verdaccio/verdaccio/issues"
27
+ "funding": {
28
+ "type": "opencollective",
29
+ "url": "https://opencollective.com/verdaccio"
31
30
  },
31
+ "main": "./build/index.js",
32
+ "types": "./build/index.d.ts",
32
33
  "publishConfig": {
33
34
  "access": "public"
34
35
  },
@@ -36,19 +37,18 @@
36
37
  "ajv": "8.18.0",
37
38
  "http-errors": "2.0.1",
38
39
  "http-status-codes": "2.3.0",
39
- "minimatch": "7.4.9",
40
+ "minimatch": "10.2.5",
40
41
  "process-warning": "1.0.0",
41
42
  "semver": "7.7.4"
42
43
  },
43
44
  "devDependencies": {
44
- "@verdaccio/types": "13.0.1",
45
+ "@verdaccio/types": "13.0.5",
45
46
  "express": "4.22.1",
46
47
  "typedoc": "0.28.14",
47
48
  "vitest": "4.1.2"
48
49
  },
49
- "funding": {
50
- "type": "opencollective",
51
- "url": "https://opencollective.com/verdaccio"
50
+ "engines": {
51
+ "node": ">=18"
52
52
  },
53
53
  "scripts": {
54
54
  "clean": "rimraf ./build",