@verdaccio/proxy 9.0.0-next-9.3 → 9.0.0-next-9.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.
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
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 __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
package/build/agent.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { Agents } from 'got-cjs';
2
- import type { AgentOptionsConf } from '@verdaccio/types';
1
+ import { Agents } from 'got-cjs';
2
+ import { AgentOptionsConf } from '@verdaccio/types';
3
3
  declare class CustomAgents {
4
4
  private url;
5
5
  private proxy;
package/build/agent.js CHANGED
@@ -1,63 +1,36 @@
1
- "use strict";
1
+ require("./_virtual/_rolldown/runtime.js");
2
+ let node_url = require("node:url");
3
+ let hpagent = require("hpagent");
4
+ let node_http = require("node:http");
5
+ let node_https = require("node:https");
6
+ //#region src/agent.ts
7
+ var CustomAgents = class {
8
+ url;
9
+ proxy;
10
+ agentOptions;
11
+ agent;
12
+ constructor(url, proxy, agentOptions) {
13
+ this.proxy = proxy;
14
+ this.url = url;
15
+ this.agentOptions = agentOptions;
16
+ const { protocol } = new node_url.URL(this.url);
17
+ this.agent = this.getAgent(protocol);
18
+ }
19
+ get() {
20
+ return this.agent;
21
+ }
22
+ getAgent(protocol) {
23
+ const isHTTPS = protocol === "https:";
24
+ if (this.proxy) {
25
+ const options = {
26
+ proxy: this.proxy,
27
+ ...this.agentOptions
28
+ };
29
+ return isHTTPS ? { https: new hpagent.HttpsProxyAgent(options) } : { http: new hpagent.HttpProxyAgent(options) };
30
+ } else return isHTTPS ? { https: new node_https.Agent(this.agentOptions) } : { http: new node_http.Agent(this.agentOptions) };
31
+ }
32
+ };
33
+ //#endregion
34
+ exports.default = CustomAgents;
2
35
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _hpagent = require("hpagent");
8
- var _nodeHttp = require("node:http");
9
- var _nodeHttps = require("node:https");
10
- var _nodeUrl = require("node:url");
11
- 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); }
12
- 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; }
13
- 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; }
14
- 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; }
15
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
- 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); }
20
- var CustomAgents = /*#__PURE__*/function () {
21
- function CustomAgents(url, proxy, agentOptions) {
22
- _classCallCheck(this, CustomAgents);
23
- this.proxy = proxy;
24
- this.url = url;
25
- this.agentOptions = agentOptions;
26
- // Type of agent depends on the protocol of the server URL (no on the proxy)
27
- // See https://www.npmjs.com/package/hpagent
28
- var _URL = new _nodeUrl.URL(this.url),
29
- protocol = _URL.protocol;
30
- this.agent = this.getAgent(protocol);
31
- }
32
- return _createClass(CustomAgents, [{
33
- key: "get",
34
- value: function get() {
35
- return this.agent;
36
- }
37
- }, {
38
- key: "getAgent",
39
- value: function getAgent(protocol) {
40
- var isHTTPS = protocol === 'https:';
41
- if (this.proxy) {
42
- var options = _objectSpread({
43
- proxy: this.proxy
44
- }, this.agentOptions);
45
- // use hpagent
46
- return isHTTPS ? {
47
- https: new _hpagent.HttpsProxyAgent(options)
48
- } : {
49
- http: new _hpagent.HttpProxyAgent(options)
50
- };
51
- } else {
52
- // use native http/https agent
53
- return isHTTPS ? {
54
- https: new _nodeHttps.Agent(this.agentOptions)
55
- } : {
56
- http: new _nodeHttp.Agent(this.agentOptions)
57
- };
58
- }
59
- }
60
- }]);
61
- }();
62
- var _default = exports["default"] = CustomAgents;
63
36
  //# sourceMappingURL=agent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","names":["_hpagent","require","_nodeHttp","_nodeHttps","_nodeUrl","_typeof","o","Symbol","iterator","constructor","prototype","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","_classCallCheck","a","n","TypeError","_defineProperties","key","_createClass","i","_toPrimitive","toPrimitive","call","String","Number","CustomAgents","url","proxy","agentOptions","_URL","URL","protocol","agent","getAgent","get","isHTTPS","options","https","HttpsProxyAgent","http","HttpProxyAgent","HttpsAgent","HttpAgent","_default","exports"],"sources":["../src/agent.ts"],"sourcesContent":["import type { Agents } from 'got-cjs';\nimport { HttpProxyAgent, HttpsProxyAgent } from 'hpagent';\nimport { Agent as HttpAgent } from 'node:http';\nimport { Agent as HttpsAgent } from 'node:https';\nimport { URL } from 'node:url';\n\nimport type { AgentOptionsConf } from '@verdaccio/types';\n\nclass CustomAgents {\n private url: string;\n private proxy: string | undefined;\n private agentOptions: AgentOptionsConf;\n private agent: Agents;\n public constructor(url: string, proxy: string | undefined, agentOptions: AgentOptionsConf) {\n this.proxy = proxy;\n this.url = url;\n this.agentOptions = agentOptions;\n // Type of agent depends on the protocol of the server URL (no on the proxy)\n // See https://www.npmjs.com/package/hpagent\n const { protocol } = new URL(this.url);\n this.agent = this.getAgent(protocol);\n }\n\n public get() {\n return this.agent;\n }\n\n private getAgent(protocol: string): Agents {\n const isHTTPS = protocol === 'https:';\n if (this.proxy) {\n const options = {\n proxy: this.proxy,\n ...this.agentOptions,\n };\n // use hpagent\n return isHTTPS\n ? { https: new HttpsProxyAgent(options) }\n : { http: new HttpProxyAgent(options) };\n } else {\n // use native http/https agent\n return isHTTPS\n ? { https: new HttpsAgent(this.agentOptions) }\n : { http: new HttpAgent(this.agentOptions) };\n }\n }\n}\n\nexport default CustomAgents;\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAA+B,SAAAI,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAAA,SAAAK,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAX,CAAA,GAAAS,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAP,CAAA,GAAAA,CAAA,CAAAY,MAAA,WAAAL,CAAA,WAAAE,MAAA,CAAAI,wBAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAR,CAAA,YAAAQ,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAAZ,CAAA,UAAAC,CAAA,WAAAU,SAAA,CAAAX,CAAA,IAAAW,SAAA,CAAAX,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAY,OAAA,WAAAb,CAAA,IAAAc,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O,GAAGJ,QAAQ,KAAK,QAAQ;MACrC,IAAI,IAAI,CAACJ,KAAK,EAAE;QACd,IAAMS,OAAO,GAAApC,aAAA;UACX2B,KAAK,EAAE,IAAI,CAACA;QAAK,GACd,IAAI,CAACC,YAAY,CACrB;QACD;QACA,OAAOO,OAAO,GACV;UAAEE,KAAK,EAAE,IAAIC,wBAAe,CAACF,OAAO;QAAE,CAAC,GACvC;UAAEG,IAAI,EAAE,IAAIC,uBAAc,CAACJ,OAAO;QAAE,CAAC;MAC3C,CAAC,MAAM;QACL;QACA,OAAOD,OAAO,GACV;UAAEE,KAAK,EAAE,IAAII,gBAAU,CAAC,IAAI,CAACb,YAAY;QAAE,CAAC,GAC5C;UAAEW,IAAI,EAAE,IAAIG,eAAS,CAAC,IAAI,CAACd,YAAY;QAAE,CAAC;MAChD;IACF;EAAC;AAAA;AAAA,IAAAe,QAAA,GAAAC,OAAA,cAGYnB,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"agent.js","names":[],"sources":["../src/agent.ts"],"sourcesContent":["import type { Agents } from 'got-cjs';\nimport { HttpProxyAgent, HttpsProxyAgent } from 'hpagent';\nimport { Agent as HttpAgent } from 'node:http';\nimport { Agent as HttpsAgent } from 'node:https';\nimport { URL } from 'node:url';\n\nimport type { AgentOptionsConf } from '@verdaccio/types';\n\nclass CustomAgents {\n private url: string;\n private proxy: string | undefined;\n private agentOptions: AgentOptionsConf;\n private agent: Agents;\n public constructor(url: string, proxy: string | undefined, agentOptions: AgentOptionsConf) {\n this.proxy = proxy;\n this.url = url;\n this.agentOptions = agentOptions;\n // Type of agent depends on the protocol of the server URL (no on the proxy)\n // See https://www.npmjs.com/package/hpagent\n const { protocol } = new URL(this.url);\n this.agent = this.getAgent(protocol);\n }\n\n public get() {\n return this.agent;\n }\n\n private getAgent(protocol: string): Agents {\n const isHTTPS = protocol === 'https:';\n if (this.proxy) {\n const options = {\n proxy: this.proxy,\n ...this.agentOptions,\n };\n // use hpagent\n return isHTTPS\n ? { https: new HttpsProxyAgent(options) }\n : { http: new HttpProxyAgent(options) };\n } else {\n // use native http/https agent\n return isHTTPS\n ? { https: new HttpsAgent(this.agentOptions) }\n : { http: new HttpAgent(this.agentOptions) };\n }\n }\n}\n\nexport default CustomAgents;\n"],"mappings":";;;;;;AAQA,IAAM,eAAN,MAAmB;CACjB;CACA;CACA;CACA;CACA,YAAmB,KAAa,OAA2B,cAAgC;AACzF,OAAK,QAAQ;AACb,OAAK,MAAM;AACX,OAAK,eAAe;EAGpB,MAAM,EAAE,aAAa,IAAI,SAAA,IAAI,KAAK,IAAI;AACtC,OAAK,QAAQ,KAAK,SAAS,SAAS;;CAGtC,MAAa;AACX,SAAO,KAAK;;CAGd,SAAiB,UAA0B;EACzC,MAAM,UAAU,aAAa;AAC7B,MAAI,KAAK,OAAO;GACd,MAAM,UAAU;IACd,OAAO,KAAK;IACZ,GAAG,KAAK;IACT;AAED,UAAO,UACH,EAAE,OAAO,IAAI,QAAA,gBAAgB,QAAQ,EAAE,GACvC,EAAE,MAAM,IAAI,QAAA,eAAe,QAAQ,EAAE;QAGzC,QAAO,UACH,EAAE,OAAO,IAAI,WAAA,MAAW,KAAK,aAAa,EAAE,GAC5C,EAAE,MAAM,IAAI,UAAA,MAAU,KAAK,aAAa,EAAE"}
@@ -0,0 +1,35 @@
1
+ import { URL } from "node:url";
2
+ import { HttpProxyAgent, HttpsProxyAgent } from "hpagent";
3
+ import { Agent } from "node:http";
4
+ import { Agent as Agent$1 } from "node:https";
5
+ //#region src/agent.ts
6
+ var CustomAgents = class {
7
+ url;
8
+ proxy;
9
+ agentOptions;
10
+ agent;
11
+ constructor(url, proxy, agentOptions) {
12
+ this.proxy = proxy;
13
+ this.url = url;
14
+ this.agentOptions = agentOptions;
15
+ const { protocol } = new URL(this.url);
16
+ this.agent = this.getAgent(protocol);
17
+ }
18
+ get() {
19
+ return this.agent;
20
+ }
21
+ getAgent(protocol) {
22
+ const isHTTPS = protocol === "https:";
23
+ if (this.proxy) {
24
+ const options = {
25
+ proxy: this.proxy,
26
+ ...this.agentOptions
27
+ };
28
+ return isHTTPS ? { https: new HttpsProxyAgent(options) } : { http: new HttpProxyAgent(options) };
29
+ } else return isHTTPS ? { https: new Agent$1(this.agentOptions) } : { http: new Agent(this.agentOptions) };
30
+ }
31
+ };
32
+ //#endregion
33
+ export { CustomAgents as default };
34
+
35
+ //# sourceMappingURL=agent.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.mjs","names":[],"sources":["../src/agent.ts"],"sourcesContent":["import type { Agents } from 'got-cjs';\nimport { HttpProxyAgent, HttpsProxyAgent } from 'hpagent';\nimport { Agent as HttpAgent } from 'node:http';\nimport { Agent as HttpsAgent } from 'node:https';\nimport { URL } from 'node:url';\n\nimport type { AgentOptionsConf } from '@verdaccio/types';\n\nclass CustomAgents {\n private url: string;\n private proxy: string | undefined;\n private agentOptions: AgentOptionsConf;\n private agent: Agents;\n public constructor(url: string, proxy: string | undefined, agentOptions: AgentOptionsConf) {\n this.proxy = proxy;\n this.url = url;\n this.agentOptions = agentOptions;\n // Type of agent depends on the protocol of the server URL (no on the proxy)\n // See https://www.npmjs.com/package/hpagent\n const { protocol } = new URL(this.url);\n this.agent = this.getAgent(protocol);\n }\n\n public get() {\n return this.agent;\n }\n\n private getAgent(protocol: string): Agents {\n const isHTTPS = protocol === 'https:';\n if (this.proxy) {\n const options = {\n proxy: this.proxy,\n ...this.agentOptions,\n };\n // use hpagent\n return isHTTPS\n ? { https: new HttpsProxyAgent(options) }\n : { http: new HttpProxyAgent(options) };\n } else {\n // use native http/https agent\n return isHTTPS\n ? { https: new HttpsAgent(this.agentOptions) }\n : { http: new HttpAgent(this.agentOptions) };\n }\n }\n}\n\nexport default CustomAgents;\n"],"mappings":";;;;;AAQA,IAAM,eAAN,MAAmB;CACjB;CACA;CACA;CACA;CACA,YAAmB,KAAa,OAA2B,cAAgC;AACzF,OAAK,QAAQ;AACb,OAAK,MAAM;AACX,OAAK,eAAe;EAGpB,MAAM,EAAE,aAAa,IAAI,IAAI,KAAK,IAAI;AACtC,OAAK,QAAQ,KAAK,SAAS,SAAS;;CAGtC,MAAa;AACX,SAAO,KAAK;;CAGd,SAAiB,UAA0B;EACzC,MAAM,UAAU,aAAa;AAC7B,MAAI,KAAK,OAAO;GACd,MAAM,UAAU;IACd,OAAO,KAAK;IACZ,GAAG,KAAK;IACT;AAED,UAAO,UACH,EAAE,OAAO,IAAI,gBAAgB,QAAQ,EAAE,GACvC,EAAE,MAAM,IAAI,eAAe,QAAQ,EAAE;QAGzC,QAAO,UACH,EAAE,OAAO,IAAI,QAAW,KAAK,aAAa,EAAE,GAC5C,EAAE,MAAM,IAAI,MAAU,KAAK,aAAa,EAAE"}
package/build/index.js CHANGED
@@ -1,28 +1,12 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
5
4
  });
6
- var _proxy = require("./proxy");
7
- Object.keys(_proxy).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _proxy[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _proxy[key];
14
- }
15
- });
16
- });
17
- var _uplinkUtil = require("./uplink-util");
18
- Object.keys(_uplinkUtil).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _uplinkUtil[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function get() {
24
- return _uplinkUtil[key];
25
- }
26
- });
27
- });
28
- //# sourceMappingURL=index.js.map
5
+ require("./_virtual/_rolldown/runtime.js");
6
+ const require_proxy = require("./proxy.js");
7
+ const require_uplink_util = require("./uplink-util.js");
8
+ let got_cjs = require("got-cjs");
9
+ exports.FetchOptions = got_cjs.Options;
10
+ exports.ProxyStorage = require_proxy.ProxyStorage;
11
+ exports.setupUpLinks = require_uplink_util.setupUpLinks;
12
+ exports.updateVersionsHiddenUpLinkNext = require_uplink_util.updateVersionsHiddenUpLinkNext;
@@ -0,0 +1,3 @@
1
+ import { Options, ProxyStorage } from "./proxy.mjs";
2
+ import { setupUpLinks, updateVersionsHiddenUpLinkNext } from "./uplink-util.mjs";
3
+ export { Options as FetchOptions, ProxyStorage, setupUpLinks, updateVersionsHiddenUpLinkNext };
@@ -1,44 +1,35 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.parseInterval = parseInterval;
1
+ //#region src/proxy-utils.ts
7
2
  var parseIntervalTable = {
8
- '': 1000,
9
- ms: 1,
10
- s: 1000,
11
- m: 60 * 1000,
12
- h: 60 * 60 * 1000,
13
- d: 86400000,
14
- w: 7 * 86400000,
15
- M: 30 * 86400000,
16
- y: 365 * 86400000
3
+ "": 1e3,
4
+ ms: 1,
5
+ s: 1e3,
6
+ m: 60 * 1e3,
7
+ h: 3600 * 1e3,
8
+ d: 864e5,
9
+ w: 7 * 864e5,
10
+ M: 30 * 864e5,
11
+ y: 365 * 864e5
17
12
  };
18
-
19
13
  /**
20
- * Parse an internal string to number
21
- * @param {*} interval
22
- * @return {Number}
23
- * @deprecated
24
- */
14
+ * Parse an internal string to number
15
+ * @param {*} interval
16
+ * @return {Number}
17
+ * @deprecated
18
+ */
25
19
  function parseInterval(interval) {
26
- if (typeof interval === 'number') {
27
- return interval * 1000;
28
- }
29
- var result = 0;
30
- var last_suffix = Infinity;
31
- interval.split(/\s+/).forEach(function (x) {
32
- if (!x) {
33
- return;
34
- }
35
- var m = x.match(/^((0|[1-9][0-9]*)(\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);
36
- if (!m || parseIntervalTable[m[4]] >= last_suffix || m[4] === '' && last_suffix !== Infinity) {
37
- throw Error('invalid interval: ' + interval);
38
- }
39
- last_suffix = parseIntervalTable[m[4]];
40
- result += Number(m[1]) * parseIntervalTable[m[4]];
41
- });
42
- return result;
20
+ if (typeof interval === "number") return interval * 1e3;
21
+ let result = 0;
22
+ let last_suffix = Infinity;
23
+ interval.split(/\s+/).forEach(function(x) {
24
+ if (!x) return;
25
+ const m = x.match(/^((0|[1-9][0-9]*)(\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);
26
+ if (!m || parseIntervalTable[m[4]] >= last_suffix || m[4] === "" && last_suffix !== Infinity) throw Error("invalid interval: " + interval);
27
+ last_suffix = parseIntervalTable[m[4]];
28
+ result += Number(m[1]) * parseIntervalTable[m[4]];
29
+ });
30
+ return result;
43
31
  }
32
+ //#endregion
33
+ exports.parseInterval = parseInterval;
34
+
44
35
  //# sourceMappingURL=proxy-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-utils.js","names":["parseIntervalTable","ms","s","m","h","d","w","M","y","parseInterval","interval","result","last_suffix","Infinity","split","forEach","x","match","Error","Number"],"sources":["../src/proxy-utils.ts"],"sourcesContent":["const parseIntervalTable = {\n '': 1000,\n ms: 1,\n s: 1000,\n m: 60 * 1000,\n h: 60 * 60 * 1000,\n d: 86400000,\n w: 7 * 86400000,\n M: 30 * 86400000,\n y: 365 * 86400000,\n};\n\n/**\n * Parse an internal string to number\n * @param {*} interval\n * @return {Number}\n * @deprecated\n */\nexport function parseInterval(interval: any): number {\n if (typeof interval === 'number') {\n return interval * 1000;\n }\n let result = 0;\n let last_suffix = Infinity;\n interval.split(/\\s+/).forEach(function (x): void {\n if (!x) {\n return;\n }\n const m = x.match(/^((0|[1-9][0-9]*)(\\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);\n if (\n !m ||\n parseIntervalTable[m[4]] >= last_suffix ||\n (m[4] === '' && last_suffix !== Infinity)\n ) {\n throw Error('invalid interval: ' + interval);\n }\n last_suffix = parseIntervalTable[m[4]];\n result += Number(m[1]) * parseIntervalTable[m[4]];\n });\n return result;\n}\n"],"mappings":";;;;;;AAAA,IAAMA,kBAAkB,GAAG;EACzB,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,CAAC;EACLC,CAAC,EAAE,IAAI;EACPC,CAAC,EAAE,EAAE,GAAG,IAAI;EACZC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;EACjBC,CAAC,EAAE,QAAQ;EACXC,CAAC,EAAE,CAAC,GAAG,QAAQ;EACfC,CAAC,EAAE,EAAE,GAAG,QAAQ;EAChBC,CAAC,EAAE,GAAG,GAAG;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAACC,QAAa,EAAU;EACnD,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;IAChC,OAAOA,QAAQ,GAAG,IAAI;EACxB;EACA,IAAIC,MAAM,GAAG,CAAC;EACd,IAAIC,WAAW,GAAGC,QAAQ;EAC1BH,QAAQ,CAACI,KAAK,CAAC,KAAK,CAAC,CAACC,OAAO,CAAC,UAAUC,CAAC,EAAQ;IAC/C,IAAI,CAACA,CAAC,EAAE;MACN;IACF;IACA,IAAMb,CAAC,GAAGa,CAAC,CAACC,KAAK,CAAC,mDAAmD,CAAC;IACtE,IACE,CAACd,CAAC,IACFH,kBAAkB,CAACG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAIS,WAAW,IACtCT,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,IAAIS,WAAW,KAAKC,QAAS,EACzC;MACA,MAAMK,KAAK,CAAC,oBAAoB,GAAGR,QAAQ,CAAC;IAC9C;IACAE,WAAW,GAAGZ,kBAAkB,CAACG,CAAC,CAAC,CAAC,CAAC,CAAC;IACtCQ,MAAM,IAAIQ,MAAM,CAAChB,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGH,kBAAkB,CAACG,CAAC,CAAC,CAAC,CAAC,CAAC;EACnD,CAAC,CAAC;EACF,OAAOQ,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"proxy-utils.js","names":[],"sources":["../src/proxy-utils.ts"],"sourcesContent":["const parseIntervalTable = {\n '': 1000,\n ms: 1,\n s: 1000,\n m: 60 * 1000,\n h: 60 * 60 * 1000,\n d: 86400000,\n w: 7 * 86400000,\n M: 30 * 86400000,\n y: 365 * 86400000,\n};\n\n/**\n * Parse an internal string to number\n * @param {*} interval\n * @return {Number}\n * @deprecated\n */\nexport function parseInterval(interval: any): number {\n if (typeof interval === 'number') {\n return interval * 1000;\n }\n let result = 0;\n let last_suffix = Infinity;\n interval.split(/\\s+/).forEach(function (x): void {\n if (!x) {\n return;\n }\n const m = x.match(/^((0|[1-9][0-9]*)(\\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);\n if (\n !m ||\n parseIntervalTable[m[4]] >= last_suffix ||\n (m[4] === '' && last_suffix !== Infinity)\n ) {\n throw Error('invalid interval: ' + interval);\n }\n last_suffix = parseIntervalTable[m[4]];\n result += Number(m[1]) * parseIntervalTable[m[4]];\n });\n return result;\n}\n"],"mappings":";AAAA,IAAM,qBAAqB;CACzB,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,GAAG,KAAK;CACR,GAAG,OAAU;CACb,GAAG;CACH,GAAG,IAAI;CACP,GAAG,KAAK;CACR,GAAG,MAAM;CACV;;;;;;;AAQD,SAAgB,cAAc,UAAuB;AACnD,KAAI,OAAO,aAAa,SACtB,QAAO,WAAW;CAEpB,IAAI,SAAS;CACb,IAAI,cAAc;AAClB,UAAS,MAAM,MAAM,CAAC,QAAQ,SAAU,GAAS;AAC/C,MAAI,CAAC,EACH;EAEF,MAAM,IAAI,EAAE,MAAM,oDAAoD;AACtE,MACE,CAAC,KACD,mBAAmB,EAAE,OAAO,eAC3B,EAAE,OAAO,MAAM,gBAAgB,SAEhC,OAAM,MAAM,uBAAuB,SAAS;AAE9C,gBAAc,mBAAmB,EAAE;AACnC,YAAU,OAAO,EAAE,GAAG,GAAG,mBAAmB,EAAE;GAC9C;AACF,QAAO"}
@@ -0,0 +1,35 @@
1
+ //#region src/proxy-utils.ts
2
+ var parseIntervalTable = {
3
+ "": 1e3,
4
+ ms: 1,
5
+ s: 1e3,
6
+ m: 60 * 1e3,
7
+ h: 3600 * 1e3,
8
+ d: 864e5,
9
+ w: 7 * 864e5,
10
+ M: 30 * 864e5,
11
+ y: 365 * 864e5
12
+ };
13
+ /**
14
+ * Parse an internal string to number
15
+ * @param {*} interval
16
+ * @return {Number}
17
+ * @deprecated
18
+ */
19
+ function parseInterval(interval) {
20
+ if (typeof interval === "number") return interval * 1e3;
21
+ let result = 0;
22
+ let last_suffix = Infinity;
23
+ interval.split(/\s+/).forEach(function(x) {
24
+ if (!x) return;
25
+ const m = x.match(/^((0|[1-9][0-9]*)(\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);
26
+ if (!m || parseIntervalTable[m[4]] >= last_suffix || m[4] === "" && last_suffix !== Infinity) throw Error("invalid interval: " + interval);
27
+ last_suffix = parseIntervalTable[m[4]];
28
+ result += Number(m[1]) * parseIntervalTable[m[4]];
29
+ });
30
+ return result;
31
+ }
32
+ //#endregion
33
+ export { parseInterval };
34
+
35
+ //# sourceMappingURL=proxy-utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy-utils.mjs","names":[],"sources":["../src/proxy-utils.ts"],"sourcesContent":["const parseIntervalTable = {\n '': 1000,\n ms: 1,\n s: 1000,\n m: 60 * 1000,\n h: 60 * 60 * 1000,\n d: 86400000,\n w: 7 * 86400000,\n M: 30 * 86400000,\n y: 365 * 86400000,\n};\n\n/**\n * Parse an internal string to number\n * @param {*} interval\n * @return {Number}\n * @deprecated\n */\nexport function parseInterval(interval: any): number {\n if (typeof interval === 'number') {\n return interval * 1000;\n }\n let result = 0;\n let last_suffix = Infinity;\n interval.split(/\\s+/).forEach(function (x): void {\n if (!x) {\n return;\n }\n const m = x.match(/^((0|[1-9][0-9]*)(\\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);\n if (\n !m ||\n parseIntervalTable[m[4]] >= last_suffix ||\n (m[4] === '' && last_suffix !== Infinity)\n ) {\n throw Error('invalid interval: ' + interval);\n }\n last_suffix = parseIntervalTable[m[4]];\n result += Number(m[1]) * parseIntervalTable[m[4]];\n });\n return result;\n}\n"],"mappings":";AAAA,IAAM,qBAAqB;CACzB,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,GAAG,KAAK;CACR,GAAG,OAAU;CACb,GAAG;CACH,GAAG,IAAI;CACP,GAAG,KAAK;CACR,GAAG,MAAM;CACV;;;;;;;AAQD,SAAgB,cAAc,UAAuB;AACnD,KAAI,OAAO,aAAa,SACtB,QAAO,WAAW;CAEpB,IAAI,SAAS;CACb,IAAI,cAAc;AAClB,UAAS,MAAM,MAAM,CAAC,QAAQ,SAAU,GAAS;AAC/C,MAAI,CAAC,EACH;EAEF,MAAM,IAAI,EAAE,MAAM,oDAAoD;AACtE,MACE,CAAC,KACD,mBAAmB,EAAE,OAAO,eAC3B,EAAE,OAAO,MAAM,gBAAgB,SAEhC,OAAM,MAAM,uBAAuB,SAAS;AAE9C,gBAAc,mBAAmB,EAAE;AACnC,YAAU,OAAO,EAAE,GAAG,GAAG,mBAAmB,EAAE;GAC9C;AACF,QAAO"}
package/build/proxy.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import type { Agents, Delays, RetryOptions, Headers as gotHeaders } from 'got-cjs';
2
- import { Options } from 'got-cjs';
3
- import type Stream from 'node:stream';
4
- import { PassThrough } from 'node:stream';
1
+ import { Agents, Delays, RetryOptions, Headers as gotHeaders, Options } from 'got-cjs';
2
+ import { default as Stream, PassThrough } from 'node:stream';
5
3
  import { URL } from 'node:url';
6
- import type { searchUtils } from '@verdaccio/core';
7
- import type { AgentOptionsConf, Config, Logger, Manifest, UpLinkConf } from '@verdaccio/types';
4
+ import { searchUtils } from '@verdaccio/core';
5
+ import { AgentOptionsConf, Config, Logger, Manifest, UpLinkConf } from '@verdaccio/types';
8
6
  export type UpLinkConfLocal = UpLinkConf & {
9
7
  no_proxy?: string;
10
8
  };