@verdaccio/proxy 8.0.0-next-8.30 → 8.0.0-next-8.32

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/agent.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Agents } from 'got-cjs';
2
- import { AgentOptionsConf } from '@verdaccio/types';
1
+ import type { Agents } from 'got-cjs';
2
+ import type { AgentOptionsConf } from '@verdaccio/types';
3
3
  declare class CustomAgents {
4
4
  private url;
5
5
  private proxy;
package/build/agent.js CHANGED
@@ -3,48 +3,61 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports["default"] = void 0;
7
7
  var _hpagent = require("hpagent");
8
8
  var _nodeHttp = require("node:http");
9
9
  var _nodeHttps = require("node:https");
10
10
  var _nodeUrl = require("node:url");
11
- class CustomAgents {
12
- constructor(url, proxy, agentOptions) {
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);
13
23
  this.proxy = proxy;
14
24
  this.url = url;
15
25
  this.agentOptions = agentOptions;
16
26
  // Type of agent depends on the protocol of the server URL (no on the proxy)
17
27
  // See https://www.npmjs.com/package/hpagent
18
- const {
19
- protocol
20
- } = new _nodeUrl.URL(this.url);
28
+ var _URL = new _nodeUrl.URL(this.url),
29
+ protocol = _URL.protocol;
21
30
  this.agent = this.getAgent(protocol);
22
31
  }
23
- get() {
24
- return this.agent;
25
- }
26
- getAgent(protocol) {
27
- const isHTTPS = protocol === 'https:';
28
- if (this.proxy) {
29
- const options = {
30
- proxy: this.proxy,
31
- ...this.agentOptions
32
- };
33
- // use hpagent
34
- return isHTTPS ? {
35
- https: new _hpagent.HttpsProxyAgent(options)
36
- } : {
37
- http: new _hpagent.HttpProxyAgent(options)
38
- };
39
- } else {
40
- // use native http/https agent
41
- return isHTTPS ? {
42
- https: new _nodeHttps.Agent(this.agentOptions)
43
- } : {
44
- http: new _nodeHttp.Agent(this.agentOptions)
45
- };
32
+ return _createClass(CustomAgents, [{
33
+ key: "get",
34
+ value: function get() {
35
+ return this.agent;
46
36
  }
47
- }
48
- }
49
- var _default = exports.default = CustomAgents;
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;
50
63
  //# sourceMappingURL=agent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","names":["_hpagent","require","_nodeHttp","_nodeHttps","_nodeUrl","CustomAgents","constructor","url","proxy","agentOptions","protocol","URL","agent","getAgent","get","isHTTPS","options","https","HttpsProxyAgent","http","HttpProxyAgent","HttpsAgent","HttpAgent","_default","exports","default"],"sources":["../src/agent.ts"],"sourcesContent":["import { 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 { 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;AAIA,MAAMI,YAAY,CAAC;EAKVC,WAAWA,CAACC,GAAW,EAAEC,KAAyB,EAAEC,YAA8B,EAAE;IACzF,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACD,GAAG,GAAGA,GAAG;IACd,IAAI,CAACE,YAAY,GAAGA,YAAY;IAChC;IACA;IACA,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAIC,YAAG,CAAC,IAAI,CAACJ,GAAG,CAAC;IACtC,IAAI,CAACK,KAAK,GAAG,IAAI,CAACC,QAAQ,CAACH,QAAQ,CAAC;EACtC;EAEOI,GAAGA,CAAA,EAAG;IACX,OAAO,IAAI,CAACF,KAAK;EACnB;EAEQC,QAAQA,CAACH,QAAgB,EAAU;IACzC,MAAMK,OAAO,GAAGL,QAAQ,KAAK,QAAQ;IACrC,IAAI,IAAI,CAACF,KAAK,EAAE;MACd,MAAMQ,OAAO,GAAG;QACdR,KAAK,EAAE,IAAI,CAACA,KAAK;QACjB,GAAG,IAAI,CAACC;MACV,CAAC;MACD;MACA,OAAOM,OAAO,GACV;QAAEE,KAAK,EAAE,IAAIC,wBAAe,CAACF,OAAO;MAAE,CAAC,GACvC;QAAEG,IAAI,EAAE,IAAIC,uBAAc,CAACJ,OAAO;MAAE,CAAC;IAC3C,CAAC,MAAM;MACL;MACA,OAAOD,OAAO,GACV;QAAEE,KAAK,EAAE,IAAII,gBAAU,CAAC,IAAI,CAACZ,YAAY;MAAE,CAAC,GAC5C;QAAEU,IAAI,EAAE,IAAIG,eAAS,CAAC,IAAI,CAACb,YAAY;MAAE,CAAC;IAChD;EACF;AACF;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcpB,YAAY","ignoreList":[]}
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,CA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GAAGA,CAAA,EAAG;MACX,OAAO,IAAI,CAACF,KAAK;IACnB;EAAC;IAAAf,GAAA;IAAAR,KAAA,EAED,SAAQwB,QAAQA,CAACF,QAAgB,EAAU;MACzC,IAAMI,OAAO,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":[]}
package/build/index.js CHANGED
@@ -9,7 +9,7 @@ Object.keys(_proxy).forEach(function (key) {
9
9
  if (key in exports && exports[key] === _proxy[key]) return;
10
10
  Object.defineProperty(exports, key, {
11
11
  enumerable: true,
12
- get: function () {
12
+ get: function get() {
13
13
  return _proxy[key];
14
14
  }
15
15
  });
@@ -20,7 +20,7 @@ Object.keys(_uplinkUtil).forEach(function (key) {
20
20
  if (key in exports && exports[key] === _uplinkUtil[key]) return;
21
21
  Object.defineProperty(exports, key, {
22
22
  enumerable: true,
23
- get: function () {
23
+ get: function get() {
24
24
  return _uplinkUtil[key];
25
25
  }
26
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_proxy","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_uplinkUtil"],"sources":["../src/index.ts"],"sourcesContent":["export * from './proxy';\nexport * from './uplink-util';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,WAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,WAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,WAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,WAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_proxy","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_uplinkUtil"],"sources":["../src/index.ts"],"sourcesContent":["export * from './proxy';\nexport * from './uplink-util';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,WAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,WAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,WAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,WAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.parseInterval = parseInterval;
7
- const parseIntervalTable = {
7
+ var parseIntervalTable = {
8
8
  '': 1000,
9
9
  ms: 1,
10
10
  s: 1000,
@@ -26,13 +26,13 @@ function parseInterval(interval) {
26
26
  if (typeof interval === 'number') {
27
27
  return interval * 1000;
28
28
  }
29
- let result = 0;
30
- let last_suffix = Infinity;
29
+ var result = 0;
30
+ var last_suffix = Infinity;
31
31
  interval.split(/\s+/).forEach(function (x) {
32
32
  if (!x) {
33
33
  return;
34
34
  }
35
- const m = x.match(/^((0|[1-9][0-9]*)(\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);
35
+ var m = x.match(/^((0|[1-9][0-9]*)(\.[0-9]+)?)(ms|s|m|h|d|w|M|y|)$/);
36
36
  if (!m || parseIntervalTable[m[4]] >= last_suffix || m[4] === '' && last_suffix !== Infinity) {
37
37
  throw Error('invalid interval: ' + interval);
38
38
  }
@@ -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,MAAMA,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,MAAMb,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":["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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CHANGED
@@ -1,10 +1,12 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import { Agents, Delays, Options, RetryOptions, Headers as gotHeaders } from 'got-cjs';
4
- import Stream, { PassThrough } from 'node:stream';
3
+ import type { Agents, Delays, RetryOptions, Headers as gotHeaders } from 'got-cjs';
4
+ import { Options } from 'got-cjs';
5
+ import type Stream from 'node:stream';
6
+ import { PassThrough } from 'node:stream';
5
7
  import { URL } from 'node:url';
6
- import { searchUtils } from '@verdaccio/core';
7
- import { AgentOptionsConf, Config, Logger, Manifest, UpLinkConf } from '@verdaccio/types';
8
+ import type { searchUtils } from '@verdaccio/core';
9
+ import type { AgentOptionsConf, Config, Logger, Manifest, UpLinkConf } from '@verdaccio/types';
8
10
  export type UpLinkConfLocal = UpLinkConf & {
9
11
  no_proxy?: string;
10
12
  };