@verdaccio/web 6.0.0-6-next.38 → 6.0.0-6-next.40

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.
@@ -8,50 +8,36 @@ exports.deleteProperties = deleteProperties;
8
8
  exports.hasLogin = hasLogin;
9
9
  exports.sortByName = sortByName;
10
10
  exports.validatePrimaryColor = validatePrimaryColor;
11
-
12
11
  var _debug = _interopRequireDefault(require("debug"));
13
-
14
12
  var _lodash = _interopRequireDefault(require("lodash"));
15
-
16
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
14
  const debug = (0, _debug.default)('verdaccio:web:utils');
19
-
20
15
  function validatePrimaryColor(primaryColor) {
21
16
  const isHex = /^#([0-9A-F]{3}){1,2}$/i.test(primaryColor);
22
-
23
17
  if (!isHex) {
24
18
  debug('invalid primary color %o', primaryColor);
25
19
  return;
26
20
  }
27
-
28
21
  return primaryColor;
29
22
  }
30
-
31
23
  function deleteProperties(propertiesToDelete, objectItem) {
32
24
  debug('deleted unused version properties');
33
-
34
25
  _lodash.default.forEach(propertiesToDelete, property => {
35
26
  delete objectItem[property];
36
27
  });
37
-
38
28
  return objectItem;
39
29
  }
40
-
41
30
  function addScope(scope, packageName) {
42
31
  return `@${scope}/${packageName}`;
43
32
  }
44
-
45
33
  function sortByName(packages, orderAscending = true) {
46
34
  return packages.slice().sort(function (a, b) {
47
35
  const comparatorNames = a.name.toLowerCase() < b.name.toLowerCase();
48
36
  return orderAscending ? comparatorNames ? -1 : 1 : comparatorNames ? 1 : -1;
49
37
  });
50
38
  }
51
-
52
39
  function hasLogin(config) {
53
40
  var _config$web, _config$web2;
54
-
55
41
  return _lodash.default.isNil(config === null || config === void 0 ? void 0 : (_config$web = config.web) === null || _config$web === void 0 ? void 0 : _config$web.login) || (config === null || config === void 0 ? void 0 : (_config$web2 = config.web) === null || _config$web2 === void 0 ? void 0 : _config$web2.login) === true;
56
42
  }
57
43
  //# sourceMappingURL=web-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-utils.js","names":["debug","buildDebug","validatePrimaryColor","primaryColor","isHex","test","deleteProperties","propertiesToDelete","objectItem","_","forEach","property","addScope","scope","packageName","sortByName","packages","orderAscending","slice","sort","a","b","comparatorNames","name","toLowerCase","hasLogin","config","isNil","web","login"],"sources":["../../src/utils/web-utils.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport _ from 'lodash';\n\n// import { normalizeContributors } from '@verdaccio/store';\nimport { Author, ConfigYaml } from '@verdaccio/types';\n\nexport type AuthorAvatar = Author & { avatar?: string };\n\nconst debug = buildDebug('verdaccio:web:utils');\n\nexport function validatePrimaryColor(primaryColor) {\n const isHex = /^#([0-9A-F]{3}){1,2}$/i.test(primaryColor);\n if (!isHex) {\n debug('invalid primary color %o', primaryColor);\n return;\n }\n\n return primaryColor;\n}\n\nexport function deleteProperties(propertiesToDelete: string[], objectItem: any): any {\n debug('deleted unused version properties');\n _.forEach(propertiesToDelete, (property): any => {\n delete objectItem[property];\n });\n\n return objectItem;\n}\n\nexport function addScope(scope: string, packageName: string): string {\n return `@${scope}/${packageName}`;\n}\n\nexport function sortByName(packages: any[], orderAscending: boolean | void = true): string[] {\n return packages.slice().sort(function (a, b): number {\n const comparatorNames = a.name.toLowerCase() < b.name.toLowerCase();\n return orderAscending ? (comparatorNames ? -1 : 1) : comparatorNames ? 1 : -1;\n });\n}\n\nexport function hasLogin(config: ConfigYaml) {\n return _.isNil(config?.web?.login) || config?.web?.login === true;\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;;;AAOA,MAAMA,KAAK,GAAG,IAAAC,cAAA,EAAW,qBAAX,CAAd;;AAEO,SAASC,oBAAT,CAA8BC,YAA9B,EAA4C;EACjD,MAAMC,KAAK,GAAG,yBAAyBC,IAAzB,CAA8BF,YAA9B,CAAd;;EACA,IAAI,CAACC,KAAL,EAAY;IACVJ,KAAK,CAAC,0BAAD,EAA6BG,YAA7B,CAAL;IACA;EACD;;EAED,OAAOA,YAAP;AACD;;AAEM,SAASG,gBAAT,CAA0BC,kBAA1B,EAAwDC,UAAxD,EAA8E;EACnFR,KAAK,CAAC,mCAAD,CAAL;;EACAS,eAAA,CAAEC,OAAF,CAAUH,kBAAV,EAA+BI,QAAD,IAAmB;IAC/C,OAAOH,UAAU,CAACG,QAAD,CAAjB;EACD,CAFD;;EAIA,OAAOH,UAAP;AACD;;AAEM,SAASI,QAAT,CAAkBC,KAAlB,EAAiCC,WAAjC,EAA8D;EACnE,OAAQ,IAAGD,KAAM,IAAGC,WAAY,EAAhC;AACD;;AAEM,SAASC,UAAT,CAAoBC,QAApB,EAAqCC,cAA8B,GAAG,IAAtE,EAAsF;EAC3F,OAAOD,QAAQ,CAACE,KAAT,GAAiBC,IAAjB,CAAsB,UAAUC,CAAV,EAAaC,CAAb,EAAwB;IACnD,MAAMC,eAAe,GAAGF,CAAC,CAACG,IAAF,CAAOC,WAAP,KAAuBH,CAAC,CAACE,IAAF,CAAOC,WAAP,EAA/C;IACA,OAAOP,cAAc,GAAIK,eAAe,GAAG,CAAC,CAAJ,GAAQ,CAA3B,GAAgCA,eAAe,GAAG,CAAH,GAAO,CAAC,CAA5E;EACD,CAHM,CAAP;AAID;;AAEM,SAASG,QAAT,CAAkBC,MAAlB,EAAsC;EAAA;;EAC3C,OAAOjB,eAAA,CAAEkB,KAAF,CAAQD,MAAR,aAAQA,MAAR,sCAAQA,MAAM,CAAEE,GAAhB,gDAAQ,YAAaC,KAArB,KAA+B,CAAAH,MAAM,SAAN,IAAAA,MAAM,WAAN,4BAAAA,MAAM,CAAEE,GAAR,8DAAaC,KAAb,MAAuB,IAA7D;AACD"}
1
+ {"version":3,"file":"web-utils.js","names":["debug","buildDebug","validatePrimaryColor","primaryColor","isHex","test","deleteProperties","propertiesToDelete","objectItem","_","forEach","property","addScope","scope","packageName","sortByName","packages","orderAscending","slice","sort","a","b","comparatorNames","name","toLowerCase","hasLogin","config","isNil","web","login"],"sources":["../../src/utils/web-utils.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport _ from 'lodash';\n\n// import { normalizeContributors } from '@verdaccio/store';\nimport { Author, ConfigYaml } from '@verdaccio/types';\n\nexport type AuthorAvatar = Author & { avatar?: string };\n\nconst debug = buildDebug('verdaccio:web:utils');\n\nexport function validatePrimaryColor(primaryColor) {\n const isHex = /^#([0-9A-F]{3}){1,2}$/i.test(primaryColor);\n if (!isHex) {\n debug('invalid primary color %o', primaryColor);\n return;\n }\n\n return primaryColor;\n}\n\nexport function deleteProperties(propertiesToDelete: string[], objectItem: any): any {\n debug('deleted unused version properties');\n _.forEach(propertiesToDelete, (property): any => {\n delete objectItem[property];\n });\n\n return objectItem;\n}\n\nexport function addScope(scope: string, packageName: string): string {\n return `@${scope}/${packageName}`;\n}\n\nexport function sortByName(packages: any[], orderAscending: boolean | void = true): string[] {\n return packages.slice().sort(function (a, b): number {\n const comparatorNames = a.name.toLowerCase() < b.name.toLowerCase();\n return orderAscending ? (comparatorNames ? -1 : 1) : comparatorNames ? 1 : -1;\n });\n}\n\nexport function hasLogin(config: ConfigYaml) {\n return _.isNil(config?.web?.login) || config?.web?.login === true;\n}\n"],"mappings":";;;;;;;;;;AAAA;AACA;AAAuB;AAOvB,MAAMA,KAAK,GAAG,IAAAC,cAAU,EAAC,qBAAqB,CAAC;AAExC,SAASC,oBAAoB,CAACC,YAAY,EAAE;EACjD,MAAMC,KAAK,GAAG,wBAAwB,CAACC,IAAI,CAACF,YAAY,CAAC;EACzD,IAAI,CAACC,KAAK,EAAE;IACVJ,KAAK,CAAC,0BAA0B,EAAEG,YAAY,CAAC;IAC/C;EACF;EAEA,OAAOA,YAAY;AACrB;AAEO,SAASG,gBAAgB,CAACC,kBAA4B,EAAEC,UAAe,EAAO;EACnFR,KAAK,CAAC,mCAAmC,CAAC;EAC1CS,eAAC,CAACC,OAAO,CAACH,kBAAkB,EAAGI,QAAQ,IAAU;IAC/C,OAAOH,UAAU,CAACG,QAAQ,CAAC;EAC7B,CAAC,CAAC;EAEF,OAAOH,UAAU;AACnB;AAEO,SAASI,QAAQ,CAACC,KAAa,EAAEC,WAAmB,EAAU;EACnE,OAAQ,IAAGD,KAAM,IAAGC,WAAY,EAAC;AACnC;AAEO,SAASC,UAAU,CAACC,QAAe,EAAEC,cAA8B,GAAG,IAAI,EAAY;EAC3F,OAAOD,QAAQ,CAACE,KAAK,EAAE,CAACC,IAAI,CAAC,UAAUC,CAAC,EAAEC,CAAC,EAAU;IACnD,MAAMC,eAAe,GAAGF,CAAC,CAACG,IAAI,CAACC,WAAW,EAAE,GAAGH,CAAC,CAACE,IAAI,CAACC,WAAW,EAAE;IACnE,OAAOP,cAAc,GAAIK,eAAe,GAAG,CAAC,CAAC,GAAG,CAAC,GAAIA,eAAe,GAAG,CAAC,GAAG,CAAC,CAAC;EAC/E,CAAC,CAAC;AACJ;AAEO,SAASG,QAAQ,CAACC,MAAkB,EAAE;EAAA;EAC3C,OAAOjB,eAAC,CAACkB,KAAK,CAACD,MAAM,aAANA,MAAM,sCAANA,MAAM,CAAEE,GAAG,gDAAX,YAAaC,KAAK,CAAC,IAAI,CAAAH,MAAM,aAANA,MAAM,uCAANA,MAAM,CAAEE,GAAG,iDAAX,aAAaC,KAAK,MAAK,IAAI;AACnE"}
@@ -4,25 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _express = _interopRequireDefault(require("express"));
9
-
10
8
  var _renderWeb = require("./middleware/render-web");
11
-
12
9
  var _webApi = require("./middleware/web-api");
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  var _default = async (config, auth, storage) => {
17
12
  // eslint-disable-next-line new-cap
18
- const app = _express.default.Router(); // load application
19
-
20
-
21
- app.use('/', await (0, _renderWeb.renderWebMiddleware)(config, auth)); // web endpoints, search, packages, etc
22
-
13
+ const app = _express.default.Router();
14
+ // load application
15
+ app.use('/', await (0, _renderWeb.renderWebMiddleware)(config, auth));
16
+ // web endpoints, search, packages, etc
23
17
  app.use('/-/verdaccio/', (0, _webApi.webAPI)(config, auth, storage));
24
18
  return app;
25
19
  };
26
-
27
20
  exports.default = _default;
28
21
  //# sourceMappingURL=web-middleware.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-middleware.js","names":["config","auth","storage","app","express","Router","use","renderWebMiddleware","webAPI"],"sources":["../src/web-middleware.ts"],"sourcesContent":["import express from 'express';\n\nimport { renderWebMiddleware } from './middleware/render-web';\nimport { webAPI } from './middleware/web-api';\n\nexport default async (config, auth, storage) => {\n // eslint-disable-next-line new-cap\n const app = express.Router();\n // load application\n app.use('/', await renderWebMiddleware(config, auth));\n // web endpoints, search, packages, etc\n app.use('/-/verdaccio/', webAPI(config, auth, storage));\n return app;\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;eAEe,OAAOA,MAAP,EAAeC,IAAf,EAAqBC,OAArB,KAAiC;EAC9C;EACA,MAAMC,GAAG,GAAGC,gBAAA,CAAQC,MAAR,EAAZ,CAF8C,CAG9C;;;EACAF,GAAG,CAACG,GAAJ,CAAQ,GAAR,EAAa,MAAM,IAAAC,8BAAA,EAAoBP,MAApB,EAA4BC,IAA5B,CAAnB,EAJ8C,CAK9C;;EACAE,GAAG,CAACG,GAAJ,CAAQ,eAAR,EAAyB,IAAAE,cAAA,EAAOR,MAAP,EAAeC,IAAf,EAAqBC,OAArB,CAAzB;EACA,OAAOC,GAAP;AACD,C"}
1
+ {"version":3,"file":"web-middleware.js","names":["config","auth","storage","app","express","Router","use","renderWebMiddleware","webAPI"],"sources":["../src/web-middleware.ts"],"sourcesContent":["import express from 'express';\n\nimport { renderWebMiddleware } from './middleware/render-web';\nimport { webAPI } from './middleware/web-api';\n\nexport default async (config, auth, storage) => {\n // eslint-disable-next-line new-cap\n const app = express.Router();\n // load application\n app.use('/', await renderWebMiddleware(config, auth));\n // web endpoints, search, packages, etc\n app.use('/-/verdaccio/', webAPI(config, auth, storage));\n return app;\n};\n"],"mappings":";;;;;;AAAA;AAEA;AACA;AAA8C;AAAA,eAE/B,OAAOA,MAAM,EAAEC,IAAI,EAAEC,OAAO,KAAK;EAC9C;EACA,MAAMC,GAAG,GAAGC,gBAAO,CAACC,MAAM,EAAE;EAC5B;EACAF,GAAG,CAACG,GAAG,CAAC,GAAG,EAAE,MAAM,IAAAC,8BAAmB,EAACP,MAAM,EAAEC,IAAI,CAAC,CAAC;EACrD;EACAE,GAAG,CAACG,GAAG,CAAC,eAAe,EAAE,IAAAE,cAAM,EAACR,MAAM,EAAEC,IAAI,EAAEC,OAAO,CAAC,CAAC;EACvD,OAAOC,GAAG;AACZ,CAAC;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/web",
3
- "version": "6.0.0-6-next.38",
3
+ "version": "6.0.0-6-next.40",
4
4
  "description": "web ui middleware",
5
5
  "main": "./build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -25,34 +25,34 @@
25
25
  },
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
- "@verdaccio/auth": "6.0.0-6-next.30",
29
- "@verdaccio/core": "6.0.0-6-next.51",
30
- "@verdaccio/config": "6.0.0-6-next.51",
31
- "@verdaccio/loaders": "6.0.0-6-next.20",
32
- "@verdaccio/logger": "6.0.0-6-next.19",
33
- "@verdaccio/middleware": "6.0.0-6-next.30",
34
- "@verdaccio/store": "6.0.0-6-next.31",
35
- "@verdaccio/tarball": "11.0.0-6-next.20",
36
- "@verdaccio/url": "11.0.0-6-next.17",
37
- "@verdaccio/utils": "6.0.0-6-next.19",
28
+ "@verdaccio/auth": "6.0.0-6-next.32",
29
+ "@verdaccio/core": "6.0.0-6-next.53",
30
+ "@verdaccio/config": "6.0.0-6-next.53",
31
+ "@verdaccio/loaders": "6.0.0-6-next.22",
32
+ "@verdaccio/logger": "6.0.0-6-next.21",
33
+ "@verdaccio/middleware": "6.0.0-6-next.32",
34
+ "@verdaccio/store": "6.0.0-6-next.33",
35
+ "@verdaccio/tarball": "11.0.0-6-next.22",
36
+ "@verdaccio/url": "11.0.0-6-next.19",
37
+ "@verdaccio/utils": "6.0.0-6-next.21",
38
38
  "body-parser": "1.20.1",
39
39
  "debug": "4.3.4",
40
40
  "express": "4.18.2",
41
41
  "lodash": "4.17.21",
42
- "lru-cache": "7.14.0"
42
+ "lru-cache": "7.14.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "16.11.65",
46
- "@verdaccio/types": "11.0.0-6-next.17",
45
+ "@types/node": "16.18.10",
46
+ "@verdaccio/types": "11.0.0-6-next.18",
47
47
  "@verdaccio/test-helper": "2.0.0-6-next.6",
48
- "@verdaccio/api": "6.0.0-6-next.34",
48
+ "@verdaccio/api": "6.0.0-6-next.36",
49
49
  "node-html-parser": "4.1.5",
50
- "supertest": "6.3.0",
50
+ "supertest": "6.3.3",
51
51
  "nock": "13.2.9",
52
- "jsdom": "20.0.1",
52
+ "jsdom": "20.0.3",
53
53
  "undici": "4.16.0",
54
- "verdaccio-auth-memory": "11.0.0-6-next.16",
55
- "verdaccio-memory": "11.0.0-6-next.18"
54
+ "verdaccio-auth-memory": "11.0.0-6-next.18",
55
+ "verdaccio-memory": "11.0.0-6-next.20"
56
56
  },
57
57
  "funding": {
58
58
  "type": "opencollective",