@verdaccio/api 6.0.0-6-next.56 → 6.0.0-6-next.57
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 +17 -0
- package/build/index.js +1 -4
- package/build/index.js.map +1 -1
- package/package.json +9 -9
- package/src/index.ts +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @verdaccio/api
|
|
2
2
|
|
|
3
|
+
## 6.0.0-6-next.57
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ae93e039d: fix: expose middleware methods
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [ae93e039d]
|
|
12
|
+
- @verdaccio/middleware@6.0.0-6-next.53
|
|
13
|
+
- @verdaccio/core@6.0.0-6-next.74
|
|
14
|
+
- @verdaccio/config@6.0.0-6-next.74
|
|
15
|
+
- @verdaccio/auth@6.0.0-6-next.53
|
|
16
|
+
- @verdaccio/store@6.0.0-6-next.54
|
|
17
|
+
- @verdaccio/utils@6.0.0-6-next.42
|
|
18
|
+
- @verdaccio/logger@6.0.0-6-next.42
|
|
19
|
+
|
|
3
20
|
## 6.0.0-6-next.56
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/build/index.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
var _bodyParser = _interopRequireDefault(require("body-parser"));
|
|
8
7
|
var _express = _interopRequireDefault(require("express"));
|
|
9
8
|
var _middleware = require("@verdaccio/middleware");
|
|
10
9
|
var _distTags = _interopRequireDefault(require("./dist-tags"));
|
|
@@ -38,7 +37,7 @@ function _default(config, auth, storage) {
|
|
|
38
37
|
app.param('_rev', (0, _middleware.match)(/^-rev$/));
|
|
39
38
|
app.param('org_couchdb_user', (0, _middleware.match)(/^org\.couchdb\.user:/));
|
|
40
39
|
app.use(auth.apiJWTmiddleware());
|
|
41
|
-
app.use(
|
|
40
|
+
app.use(_express.default.json({
|
|
42
41
|
strict: false,
|
|
43
42
|
limit: config.max_body_size || '10mb'
|
|
44
43
|
}));
|
|
@@ -49,14 +48,12 @@ function _default(config, auth, storage) {
|
|
|
49
48
|
// for "npm whoami"
|
|
50
49
|
(0, _whoami.default)(app);
|
|
51
50
|
(0, _profile.default)(app, auth, config);
|
|
52
|
-
// @deprecated endpoint, 404 by default
|
|
53
51
|
(0, _search.default)(app);
|
|
54
52
|
(0, _user.default)(app, auth, config);
|
|
55
53
|
(0, _distTags.default)(app, auth, storage);
|
|
56
54
|
(0, _publish.default)(app, auth, storage);
|
|
57
55
|
(0, _ping.default)(app);
|
|
58
56
|
(0, _stars.default)(app, storage);
|
|
59
|
-
// @ts-ignore
|
|
60
57
|
(0, _search2.default)(app, auth, storage);
|
|
61
58
|
(0, _token.default)(app, auth, storage, config);
|
|
62
59
|
(0, _package.default)(app, auth, storage);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_express","_interopRequireDefault","require","_middleware","_distTags","_package","_ping","_publish","_search","_stars","_user","_profile","_search2","_token","_whoami","obj","__esModule","default","_default","config","auth","storage","app","express","Router","param","validatePackage","validateName","match","use","apiJWTmiddleware","json","strict","limit","max_body_size","antiLoop","encodeScopePackage","whoami","profile","search","user","distTags","publish","ping","stars","v1Search","token","pkg"],"sources":["../src/index.ts"],"sourcesContent":["import express, { Router } from 'express';\n\nimport { Auth } from '@verdaccio/auth';\nimport {\n antiLoop,\n encodeScopePackage,\n match,\n validateName,\n validatePackage,\n} from '@verdaccio/middleware';\nimport { Storage } from '@verdaccio/store';\nimport { Config } from '@verdaccio/types';\n\nimport distTags from './dist-tags';\nimport pkg from './package';\nimport ping from './ping';\nimport publish from './publish';\nimport search from './search';\nimport stars from './stars';\nimport user from './user';\nimport profile from './v1/profile';\nimport v1Search from './v1/search';\nimport token from './v1/token';\nimport whoami from './whoami';\n\nexport default function (config: Config, auth: Auth, storage: Storage): Router {\n /* eslint new-cap:off */\n const app = express.Router();\n /* eslint new-cap:off */\n\n // validate all of these params as a package name\n // this might be too harsh, so ask if it causes trouble\n app.param('package', validatePackage);\n app.param('filename', validateName);\n app.param('tag', validateName);\n app.param('version', validateName);\n app.param('revision', validateName);\n app.param('token', validateName);\n\n // these can't be safely put into express url for some reason\n // TODO: For some reason? what reason?\n app.param('_rev', match(/^-rev$/));\n app.param('org_couchdb_user', match(/^org\\.couchdb\\.user:/));\n app.use(auth.apiJWTmiddleware());\n app.use(express.json({ strict: false, limit: config.max_body_size || '10mb' }));\n // @ts-ignore\n app.use(antiLoop(config));\n // encode / in a scoped package name to be matched as a single parameter in routes\n app.use(encodeScopePackage);\n // for \"npm whoami\"\n whoami(app);\n profile(app, auth, config);\n search(app);\n user(app, auth, config);\n distTags(app, auth, storage);\n publish(app, auth, storage);\n ping(app);\n stars(app, storage);\n v1Search(app, auth, storage);\n token(app, auth, storage, config);\n pkg(app, auth, storage);\n return app;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAUA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,KAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,QAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,QAAA,GA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AACO,8BAAkB,CAAC;EAC3B;EACA,IAAAC,eAAM,EAACf,GAAG,CAAC;EACX,IAAAgB,gBAAO,EAAChB,GAAG,EAAEF,IAAI,EAAED,MAAM,CAAC;EAC1B,IAAAoB,eAAM,EAACjB,GAAG,CAAC;EACX,IAAAkB,aAAI,EAAClB,GAAG,EAAEF,IAAI,EAAED,MAAM,CAAC;EACvB,IAAAsB,iBAAQ,EAACnB,GAAG,EAAEF,IAAI,EAAEC,OAAO,CAAC;EAC5B,IAAAqB,gBAAO,EAACpB,GAAG,EAAEF,IAAI,EAAEC,OAAO,CAAC;EAC3B,IAAAsB,aAAI,EAACrB,GAAG,CAAC;EACT,IAAAsB,cAAK,EAACtB,GAAG,EAAED,OAAO,CAAC;EACnB,IAAAwB,gBAAQ,EAACvB,GAAG,EAAEF,IAAI,EAAEC,OAAO,CAAC;EAC5B,IAAAyB,cAAK,EAACxB,GAAG,EAAEF,IAAI,EAAEC,OAAO,EAAEF,MAAM,CAAC;EACjC,IAAA4B,gBAAG,EAACzB,GAAG,EAAEF,IAAI,EAAEC,OAAO,CAAC;EACvB,OAAOC,GAAG;AACZ"}
|
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.57",
|
|
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.53",
|
|
34
|
+
"@verdaccio/config": "6.0.0-6-next.74",
|
|
35
|
+
"@verdaccio/core": "6.0.0-6-next.74",
|
|
36
|
+
"@verdaccio/logger": "6.0.0-6-next.42",
|
|
37
|
+
"@verdaccio/middleware": "6.0.0-6-next.53",
|
|
38
|
+
"@verdaccio/store": "6.0.0-6-next.54",
|
|
39
|
+
"@verdaccio/utils": "6.0.0-6-next.42",
|
|
40
40
|
"abortcontroller-polyfill": "1.7.5",
|
|
41
41
|
"cookies": "0.8.0",
|
|
42
42
|
"debug": "4.3.4",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"semver": "7.5.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@verdaccio/server": "6.0.0-6-next.
|
|
50
|
+
"@verdaccio/server": "6.0.0-6-next.63",
|
|
51
51
|
"@verdaccio/types": "11.0.0-6-next.25",
|
|
52
52
|
"@verdaccio/test-helper": "2.0.0-6-next.8",
|
|
53
53
|
"supertest": "6.3.3",
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import bodyParser from 'body-parser';
|
|
2
1
|
import express, { Router } from 'express';
|
|
3
2
|
|
|
4
3
|
import { Auth } from '@verdaccio/auth';
|
|
@@ -43,7 +42,7 @@ export default function (config: Config, auth: Auth, storage: Storage): Router {
|
|
|
43
42
|
app.param('_rev', match(/^-rev$/));
|
|
44
43
|
app.param('org_couchdb_user', match(/^org\.couchdb\.user:/));
|
|
45
44
|
app.use(auth.apiJWTmiddleware());
|
|
46
|
-
app.use(
|
|
45
|
+
app.use(express.json({ strict: false, limit: config.max_body_size || '10mb' }));
|
|
47
46
|
// @ts-ignore
|
|
48
47
|
app.use(antiLoop(config));
|
|
49
48
|
// encode / in a scoped package name to be matched as a single parameter in routes
|
|
@@ -51,14 +50,12 @@ export default function (config: Config, auth: Auth, storage: Storage): Router {
|
|
|
51
50
|
// for "npm whoami"
|
|
52
51
|
whoami(app);
|
|
53
52
|
profile(app, auth, config);
|
|
54
|
-
// @deprecated endpoint, 404 by default
|
|
55
53
|
search(app);
|
|
56
54
|
user(app, auth, config);
|
|
57
55
|
distTags(app, auth, storage);
|
|
58
56
|
publish(app, auth, storage);
|
|
59
57
|
ping(app);
|
|
60
58
|
stars(app, storage);
|
|
61
|
-
// @ts-ignore
|
|
62
59
|
v1Search(app, auth, storage);
|
|
63
60
|
token(app, auth, storage, config);
|
|
64
61
|
pkg(app, auth, storage);
|