@verdaccio/api 6.0.0-6-next.34 → 6.0.0-6-next.36
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/CHANGELOG.md +24 -0
- package/build/dist-tags.js +2 -13
- package/build/dist-tags.js.map +1 -1
- package/build/index.js +14 -30
- package/build/index.js.map +1 -1
- package/build/package.js +3 -15
- package/build/package.js.map +1 -1
- package/build/ping.js +0 -1
- package/build/ping.js.map +1 -1
- package/build/publish.js +4 -19
- package/build/publish.js.map +1 -1
- package/build/search.js +0 -4
- package/build/search.js.map +1 -1
- package/build/stars.js +0 -6
- package/build/stars.js.map +1 -1
- package/build/user.js +5 -27
- package/build/user.js.map +1 -1
- package/build/v1/profile.js +0 -11
- package/build/v1/profile.js.map +1 -1
- package/build/v1/search.js +1 -13
- package/build/v1/search.js.map +1 -1
- package/build/v1/token.d.ts +1 -1
- package/build/v1/token.js +7 -35
- package/build/v1/token.js.map +1 -1
- package/build/whoami.js +0 -8
- package/build/whoami.js.map +1 -1
- package/package.json +12 -12
package/build/whoami.js
CHANGED
|
@@ -4,27 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
|
|
8
7
|
var _debug = _interopRequireDefault(require("debug"));
|
|
9
|
-
|
|
10
8
|
var _core = require("@verdaccio/core");
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
const debug = (0, _debug.default)('verdaccio:api:user');
|
|
15
|
-
|
|
16
11
|
function _default(route) {
|
|
17
12
|
route.get('/-/whoami', (req, _res, next) => {
|
|
18
13
|
var _req$remote_user;
|
|
19
|
-
|
|
20
14
|
// remote_user is set by the auth middleware
|
|
21
15
|
const username = req === null || req === void 0 ? void 0 : (_req$remote_user = req.remote_user) === null || _req$remote_user === void 0 ? void 0 : _req$remote_user.name;
|
|
22
|
-
|
|
23
16
|
if (!username) {
|
|
24
17
|
debug('whoami: user not found');
|
|
25
18
|
return next(_core.errorUtils.getUnauthorized('Unauthorized'));
|
|
26
19
|
}
|
|
27
|
-
|
|
28
20
|
debug('whoami: response %o', username);
|
|
29
21
|
return next({
|
|
30
22
|
username: username
|
package/build/whoami.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whoami.js","names":["debug","buildDebug","route","get","req","_res","next","username","remote_user","name","errorUtils","getUnauthorized"],"sources":["../src/whoami.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { Response, Router } from 'express';\n\nimport { errorUtils } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nconst debug = buildDebug('verdaccio:api:user');\n\nexport default function (route: Router): void {\n route.get('/-/whoami', (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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"whoami.js","names":["debug","buildDebug","route","get","req","_res","next","username","remote_user","name","errorUtils","getUnauthorized"],"sources":["../src/whoami.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { Response, Router } from 'express';\n\nimport { errorUtils } from '@verdaccio/core';\n\nimport { $NextFunctionVer, $RequestExtend } from '../types/custom';\n\nconst debug = buildDebug('verdaccio:api:user');\n\nexport default function (route: Router): void {\n route.get('/-/whoami', (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"],"mappings":";;;;;;AAAA;AAGA;AAA6C;AAI7C,MAAMA,KAAK,GAAG,IAAAC,cAAU,EAAC,oBAAoB,CAAC;AAE/B,kBAAUC,KAAa,EAAQ;EAC5CA,KAAK,CAACC,GAAG,CAAC,WAAW,EAAE,CAACC,GAAmB,EAAEC,IAAc,EAAEC,IAAsB,KAAU;IAAA;IAC3F;IACA,MAAMC,QAAQ,GAAGH,GAAG,aAAHA,GAAG,2CAAHA,GAAG,CAAEI,WAAW,qDAAhB,iBAAkBC,IAAI;IACvC,IAAI,CAACF,QAAQ,EAAE;MACbP,KAAK,CAAC,wBAAwB,CAAC;MAC/B,OAAOM,IAAI,CAACI,gBAAU,CAACC,eAAe,CAAC,cAAc,CAAC,CAAC;IACzD;IAEAX,KAAK,CAAC,qBAAqB,EAAEO,QAAQ,CAAC;IACtC,OAAOD,IAAI,CAAC;MAAEC,QAAQ,EAAEA;IAAS,CAAC,CAAC;EACrC,CAAC,CAAC;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/api",
|
|
3
|
-
"version": "6.0.0-6-next.
|
|
3
|
+
"version": "6.0.0-6-next.36",
|
|
4
4
|
"description": "loaders logic",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@verdaccio/auth": "6.0.0-6-next.
|
|
34
|
-
"@verdaccio/config": "6.0.0-6-next.
|
|
35
|
-
"@verdaccio/core": "6.0.0-6-next.
|
|
36
|
-
"@verdaccio/logger": "6.0.0-6-next.
|
|
37
|
-
"@verdaccio/middleware": "6.0.0-6-next.
|
|
38
|
-
"@verdaccio/store": "6.0.0-6-next.
|
|
39
|
-
"@verdaccio/utils": "6.0.0-6-next.
|
|
33
|
+
"@verdaccio/auth": "6.0.0-6-next.32",
|
|
34
|
+
"@verdaccio/config": "6.0.0-6-next.53",
|
|
35
|
+
"@verdaccio/core": "6.0.0-6-next.53",
|
|
36
|
+
"@verdaccio/logger": "6.0.0-6-next.21",
|
|
37
|
+
"@verdaccio/middleware": "6.0.0-6-next.32",
|
|
38
|
+
"@verdaccio/store": "6.0.0-6-next.33",
|
|
39
|
+
"@verdaccio/utils": "6.0.0-6-next.21",
|
|
40
40
|
"abortcontroller-polyfill": "1.7.5",
|
|
41
41
|
"cookies": "0.8.0",
|
|
42
42
|
"debug": "4.3.4",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"semver": "7.3.8"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@types/node": "16.
|
|
51
|
-
"@verdaccio/server": "6.0.0-6-next.
|
|
52
|
-
"@verdaccio/types": "11.0.0-6-next.
|
|
50
|
+
"@types/node": "16.18.10",
|
|
51
|
+
"@verdaccio/server": "6.0.0-6-next.42",
|
|
52
|
+
"@verdaccio/types": "11.0.0-6-next.18",
|
|
53
53
|
"@verdaccio/test-helper": "2.0.0-6-next.6",
|
|
54
|
-
"supertest": "6.3.
|
|
54
|
+
"supertest": "6.3.3",
|
|
55
55
|
"nock": "13.2.9",
|
|
56
56
|
"mockdate": "3.0.5"
|
|
57
57
|
},
|