@verdaccio/api 9.0.0-next-9.17 → 9.0.0-next-9.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"whoami.mjs","names":[],"sources":["../src/whoami.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Response, Router } from 'express';\n\nimport { errorUtils } from '@verdaccio/core';\nimport { USER_API_ENDPOINTS } from '@verdaccio/middleware';\n\nimport type { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nconst debug = buildDebug('verdaccio:api:user');\n\nexport default function (route: Router): void {\n route.get(\n USER_API_ENDPOINTS.whoami,\n (req: $RequestExtend, _res: Response, next: $NextFunctionVer): any => {\n // remote_user is set by the auth middleware\n const username = req?.remote_user?.name;\n if (!username) {\n debug('whoami: user not found');\n return next(errorUtils.getUnauthorized('Unauthorized'));\n }\n\n debug('whoami: response %o', username);\n return next({ username: username });\n }\n );\n}\n"],"mappings":";;;;AAQA,IAAM,QAAQ,WAAW,qBAAqB;AAE9C,SAAA,eAAyB,OAAqB;AAC5C,OAAM,IACJ,mBAAmB,SAClB,KAAqB,MAAgB,SAAgC;EAEpE,MAAM,WAAW,KAAK,aAAa;AACnC,MAAI,CAAC,UAAU;AACb,SAAM,yBAAyB;AAC/B,UAAO,KAAK,WAAW,gBAAgB,eAAe,CAAC;;AAGzD,QAAM,uBAAuB,SAAS;AACtC,SAAO,KAAK,EAAY,UAAU,CAAC;GAEtC"}
1
+ {"version":3,"file":"whoami.mjs","names":[],"sources":["../src/whoami.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport type { Response, Router } from 'express';\n\nimport { errorUtils } from '@verdaccio/core';\nimport { USER_API_ENDPOINTS } from '@verdaccio/middleware';\n\nimport type { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nconst debug = buildDebug('verdaccio:api:user');\n\nexport default function (route: Router): void {\n route.get(\n USER_API_ENDPOINTS.whoami,\n (req: $RequestExtend, _res: Response, next: $NextFunctionVer): any => {\n // remote_user is set by the auth middleware\n const username = req?.remote_user?.name;\n if (!username) {\n debug('whoami: user not found');\n return next(errorUtils.getUnauthorized('Unauthorized'));\n }\n\n debug('whoami: response %o', username);\n return next({ username: username });\n }\n );\n}\n"],"mappings":";;;;AAQA,IAAM,QAAQ,WAAW,oBAAoB;AAE7C,SAAA,eAAyB,OAAqB;CAC5C,MAAM,IACJ,mBAAmB,SAClB,KAAqB,MAAgB,SAAgC;EAEpE,MAAM,WAAW,KAAK,aAAa;EACnC,IAAI,CAAC,UAAU;GACb,MAAM,wBAAwB;GAC9B,OAAO,KAAK,WAAW,gBAAgB,cAAc,CAAC;EACxD;EAEA,MAAM,uBAAuB,QAAQ;EACrC,OAAO,KAAK,EAAY,SAAS,CAAC;CACpC,CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/api",
3
- "version": "9.0.0-next-9.17",
3
+ "version": "9.0.0-next-9.19",
4
4
  "description": "Verdaccio Registry API",
5
5
  "main": "./build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -33,24 +33,27 @@
33
33
  },
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
- "@verdaccio/auth": "9.0.0-next-9.17",
37
- "@verdaccio/config": "9.0.0-next-9.17",
38
- "@verdaccio/core": "9.0.0-next-9.17",
39
- "@verdaccio/logger": "9.0.0-next-9.17",
40
- "@verdaccio/middleware": "9.0.0-next-9.17",
41
- "@verdaccio/store": "9.0.0-next-9.17",
36
+ "@verdaccio/auth": "9.0.0-next-9.19",
37
+ "@verdaccio/config": "9.0.0-next-9.19",
38
+ "@verdaccio/core": "9.0.0-next-9.19",
39
+ "@verdaccio/hooks": "9.0.0-next-9.19",
40
+ "@verdaccio/logger": "9.0.0-next-9.19",
41
+ "@verdaccio/middleware": "9.0.0-next-9.19",
42
+ "@verdaccio/store": "9.0.0-next-9.19",
42
43
  "debug": "4.4.3",
43
44
  "express": "5.2.1",
44
45
  "lodash-es": "4.18.1"
45
46
  },
46
47
  "devDependencies": {
47
- "@verdaccio/test-helper": "5.0.0-next-9.18",
48
- "@verdaccio/types": "14.0.0-next-9.8",
49
48
  "@types/lodash-es": "4.17.12",
49
+ "@verdaccio/test-helper": "5.0.0-next-9.20",
50
+ "@verdaccio/types": "14.0.0-next-9.10",
50
51
  "mockdate": "3.0.5",
51
52
  "nock": "13.5.6",
53
+ "rimraf": "6.1.3",
52
54
  "supertest": "7.1.4",
53
- "vitest": "4.1.0"
55
+ "vite": "8.0.14",
56
+ "vitest": "4.1.7"
54
57
  },
55
58
  "funding": {
56
59
  "type": "opencollective",
package/build/stars.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { Router } from 'express';
2
- import { Storage } from '@verdaccio/store';
3
- export default function (route: Router, storage: Storage): void;
package/build/stars.js DELETED
@@ -1,22 +0,0 @@
1
- require("./_virtual/_rolldown/runtime.js");
2
- let _verdaccio_middleware = require("@verdaccio/middleware");
3
- let _verdaccio_core = require("@verdaccio/core");
4
- let lodash_es = require("lodash-es");
5
- //#region src/stars.ts
6
- function stars_default(route, storage) {
7
- route.get(_verdaccio_middleware.STARS_API_ENDPOINTS.get_user_starred_packages, async (req, res, next) => {
8
- const query = req.query;
9
- if (typeof query?.key !== "string") return next(_verdaccio_core.errorUtils.getBadRequest("missing query key username"));
10
- try {
11
- const filteredPackages = (await storage.getLocalDatabase()).filter((localPackage) => (0, lodash_es.keys)(localPackage[_verdaccio_core.USERS]).includes(query?.key.toString().replace(/['"]+/g, "")));
12
- res.status(_verdaccio_core.HTTP_STATUS.OK);
13
- next({ rows: filteredPackages.map((filteredPackage) => ({ value: filteredPackage.name })) });
14
- } catch (err) {
15
- return next(err);
16
- }
17
- });
18
- }
19
- //#endregion
20
- exports.default = stars_default;
21
-
22
- //# sourceMappingURL=stars.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stars.js","names":[],"sources":["../src/stars.ts"],"sourcesContent":["import type { Response, Router } from 'express';\nimport { keys } from 'lodash-es';\n\nimport { HTTP_STATUS, USERS, errorUtils } from '@verdaccio/core';\nimport { STARS_API_ENDPOINTS } from '@verdaccio/middleware';\nimport type { Storage } from '@verdaccio/store';\nimport type { Version } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nexport default function (route: Router, storage: Storage): void {\n route.get(\n STARS_API_ENDPOINTS.get_user_starred_packages,\n async (req: $RequestExtend, res: Response, next: $NextFunctionVer): Promise<void> => {\n const query: { key: string } = req.query;\n if (typeof query?.key !== 'string') {\n return next(errorUtils.getBadRequest('missing query key username'));\n }\n\n try {\n const localPackages: Version[] = await storage.getLocalDatabase();\n const filteredPackages: Version[] = localPackages.filter((localPackage: Version) =>\n keys(localPackage[USERS]).includes(query?.key.toString().replace(/['\"]+/g, ''))\n );\n\n res.status(HTTP_STATUS.OK);\n next({\n rows: filteredPackages.map((filteredPackage: Version) => ({\n value: filteredPackage.name,\n })),\n });\n } catch (err: any) {\n return next(err);\n }\n }\n );\n}\n"],"mappings":";;;;;AAUA,SAAA,cAAyB,OAAe,SAAwB;AAC9D,OAAM,IACJ,sBAAA,oBAAoB,2BACpB,OAAO,KAAqB,KAAe,SAA0C;EACnF,MAAM,QAAyB,IAAI;AACnC,MAAI,OAAO,OAAO,QAAQ,SACxB,QAAO,KAAK,gBAAA,WAAW,cAAc,6BAA6B,CAAC;AAGrE,MAAI;GAEF,MAAM,oBAD2B,MAAM,QAAQ,kBAAkB,EACf,QAAQ,kBAAA,GAAA,UAAA,MACnD,aAAa,gBAAA,OAAO,CAAC,SAAS,OAAO,IAAI,UAAU,CAAC,QAAQ,UAAU,GAAG,CAAC,CAChF;AAED,OAAI,OAAO,gBAAA,YAAY,GAAG;AAC1B,QAAK,EACH,MAAM,iBAAiB,KAAK,qBAA8B,EACxD,OAAO,gBAAgB,MACxB,EAAE,EACJ,CAAC;WACK,KAAU;AACjB,UAAO,KAAK,IAAI;;GAGrB"}
package/build/stars.mjs DELETED
@@ -1,21 +0,0 @@
1
- import { STARS_API_ENDPOINTS } from "@verdaccio/middleware";
2
- import { HTTP_STATUS, USERS, errorUtils } from "@verdaccio/core";
3
- import { keys } from "lodash-es";
4
- //#region src/stars.ts
5
- function stars_default(route, storage) {
6
- route.get(STARS_API_ENDPOINTS.get_user_starred_packages, async (req, res, next) => {
7
- const query = req.query;
8
- if (typeof query?.key !== "string") return next(errorUtils.getBadRequest("missing query key username"));
9
- try {
10
- const filteredPackages = (await storage.getLocalDatabase()).filter((localPackage) => keys(localPackage[USERS]).includes(query?.key.toString().replace(/['"]+/g, "")));
11
- res.status(HTTP_STATUS.OK);
12
- next({ rows: filteredPackages.map((filteredPackage) => ({ value: filteredPackage.name })) });
13
- } catch (err) {
14
- return next(err);
15
- }
16
- });
17
- }
18
- //#endregion
19
- export { stars_default as default };
20
-
21
- //# sourceMappingURL=stars.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stars.mjs","names":[],"sources":["../src/stars.ts"],"sourcesContent":["import type { Response, Router } from 'express';\nimport { keys } from 'lodash-es';\n\nimport { HTTP_STATUS, USERS, errorUtils } from '@verdaccio/core';\nimport { STARS_API_ENDPOINTS } from '@verdaccio/middleware';\nimport type { Storage } from '@verdaccio/store';\nimport type { Version } from '@verdaccio/types';\n\nimport type { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nexport default function (route: Router, storage: Storage): void {\n route.get(\n STARS_API_ENDPOINTS.get_user_starred_packages,\n async (req: $RequestExtend, res: Response, next: $NextFunctionVer): Promise<void> => {\n const query: { key: string } = req.query;\n if (typeof query?.key !== 'string') {\n return next(errorUtils.getBadRequest('missing query key username'));\n }\n\n try {\n const localPackages: Version[] = await storage.getLocalDatabase();\n const filteredPackages: Version[] = localPackages.filter((localPackage: Version) =>\n keys(localPackage[USERS]).includes(query?.key.toString().replace(/['\"]+/g, ''))\n );\n\n res.status(HTTP_STATUS.OK);\n next({\n rows: filteredPackages.map((filteredPackage: Version) => ({\n value: filteredPackage.name,\n })),\n });\n } catch (err: any) {\n return next(err);\n }\n }\n );\n}\n"],"mappings":";;;;AAUA,SAAA,cAAyB,OAAe,SAAwB;AAC9D,OAAM,IACJ,oBAAoB,2BACpB,OAAO,KAAqB,KAAe,SAA0C;EACnF,MAAM,QAAyB,IAAI;AACnC,MAAI,OAAO,OAAO,QAAQ,SACxB,QAAO,KAAK,WAAW,cAAc,6BAA6B,CAAC;AAGrE,MAAI;GAEF,MAAM,oBAD2B,MAAM,QAAQ,kBAAkB,EACf,QAAQ,iBACxD,KAAK,aAAa,OAAO,CAAC,SAAS,OAAO,IAAI,UAAU,CAAC,QAAQ,UAAU,GAAG,CAAC,CAChF;AAED,OAAI,OAAO,YAAY,GAAG;AAC1B,QAAK,EACH,MAAM,iBAAiB,KAAK,qBAA8B,EACxD,OAAO,gBAAgB,MACxB,EAAE,EACJ,CAAC;WACK,KAAU;AACjB,UAAO,KAAK,IAAI;;GAGrB"}