verdaccio 6.7.4 → 6.9.0
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/README.md +2 -2
- package/bin/verdaccio +5 -1
- package/build/_virtual/_rolldown/runtime.js +23 -0
- package/build/api/debug/index.js +23 -26
- package/build/api/debug/index.js.map +1 -0
- package/build/api/debug/index.mjs +19 -0
- package/build/api/debug/index.mjs.map +1 -0
- package/build/api/endpoint/api/dist-tags.js +62 -75
- package/build/api/endpoint/api/dist-tags.js.map +1 -0
- package/build/api/endpoint/api/dist-tags.mjs +56 -0
- package/build/api/endpoint/api/dist-tags.mjs.map +1 -0
- package/build/api/endpoint/api/package.js +91 -99
- package/build/api/endpoint/api/package.js.map +1 -0
- package/build/api/endpoint/api/package.mjs +89 -0
- package/build/api/endpoint/api/package.mjs.map +1 -0
- package/build/api/endpoint/api/ping.js +13 -11
- package/build/api/endpoint/api/ping.js.map +1 -0
- package/build/api/endpoint/api/ping.mjs +11 -0
- package/build/api/endpoint/api/ping.mjs.map +1 -0
- package/build/api/endpoint/api/publish.d.ts +2 -2
- package/build/api/endpoint/api/publish.js +278 -343
- package/build/api/endpoint/api/publish.js.map +1 -0
- package/build/api/endpoint/api/publish.mjs +280 -0
- package/build/api/endpoint/api/publish.mjs.map +1 -0
- package/build/api/endpoint/api/search.js +57 -105
- package/build/api/endpoint/api/search.js.map +1 -0
- package/build/api/endpoint/api/search.mjs +54 -0
- package/build/api/endpoint/api/search.mjs.map +1 -0
- package/build/api/endpoint/api/star.js +60 -71
- package/build/api/endpoint/api/star.js.map +1 -0
- package/build/api/endpoint/api/star.mjs +54 -0
- package/build/api/endpoint/api/star.mjs.map +1 -0
- package/build/api/endpoint/api/stars.js +40 -40
- package/build/api/endpoint/api/stars.js.map +1 -0
- package/build/api/endpoint/api/stars.mjs +35 -0
- package/build/api/endpoint/api/stars.mjs.map +1 -0
- package/build/api/endpoint/api/user.js +69 -82
- package/build/api/endpoint/api/user.js.map +1 -0
- package/build/api/endpoint/api/user.mjs +64 -0
- package/build/api/endpoint/api/user.mjs.map +1 -0
- package/build/api/endpoint/api/v1/profile.js +50 -67
- package/build/api/endpoint/api/v1/profile.js.map +1 -0
- package/build/api/endpoint/api/v1/profile.mjs +46 -0
- package/build/api/endpoint/api/v1/profile.mjs.map +1 -0
- package/build/api/endpoint/api/v1/search.d.ts +2 -1
- package/build/api/endpoint/api/v1/search.js +149 -168
- package/build/api/endpoint/api/v1/search.js.map +1 -0
- package/build/api/endpoint/api/v1/search.mjs +154 -0
- package/build/api/endpoint/api/v1/search.mjs.map +1 -0
- package/build/api/endpoint/api/v1/token.js +122 -155
- package/build/api/endpoint/api/v1/token.js.map +1 -0
- package/build/api/endpoint/api/v1/token.mjs +119 -0
- package/build/api/endpoint/api/v1/token.mjs.map +1 -0
- package/build/api/endpoint/api/whoami.js +13 -13
- package/build/api/endpoint/api/whoami.js.map +1 -0
- package/build/api/endpoint/api/whoami.mjs +11 -0
- package/build/api/endpoint/api/whoami.mjs.map +1 -0
- package/build/api/endpoint/index.js +58 -67
- package/build/api/endpoint/index.js.map +1 -0
- package/build/api/endpoint/index.mjs +54 -0
- package/build/api/endpoint/index.mjs.map +1 -0
- package/build/api/index.js +85 -106
- package/build/api/index.js.map +1 -0
- package/build/api/index.mjs +78 -0
- package/build/api/index.mjs.map +1 -0
- package/build/api/middleware.js +60 -54
- package/build/api/middleware.js.map +1 -0
- package/build/api/middleware.mjs +55 -0
- package/build/api/middleware.mjs.map +1 -0
- package/build/api/web/api/index.js +25 -29
- package/build/api/web/api/index.js.map +1 -0
- package/build/api/web/api/index.mjs +23 -0
- package/build/api/web/api/index.mjs.map +1 -0
- package/build/api/web/api/package.js +142 -161
- package/build/api/web/api/package.js.map +1 -0
- package/build/api/web/api/package.mjs +139 -0
- package/build/api/web/api/package.mjs.map +1 -0
- package/build/api/web/api/search.js +37 -50
- package/build/api/web/api/search.js.map +1 -0
- package/build/api/web/api/search.mjs +36 -0
- package/build/api/web/api/search.mjs.map +1 -0
- package/build/api/web/api/user.js +52 -73
- package/build/api/web/api/user.js.map +1 -0
- package/build/api/web/api/user.mjs +49 -0
- package/build/api/web/api/user.mjs.map +1 -0
- package/build/api/web/api/utils.js +9 -10
- package/build/api/web/api/utils.js.map +1 -0
- package/build/api/web/api/utils.mjs +11 -0
- package/build/api/web/api/utils.mjs.map +1 -0
- package/build/api/web/index.js +76 -88
- package/build/api/web/index.js.map +1 -0
- package/build/api/web/index.mjs +70 -0
- package/build/api/web/index.mjs.map +1 -0
- package/build/index.js +43 -60
- package/build/index.mjs +5 -0
- package/build/lib/auth-utils.js +12 -14
- package/build/lib/auth-utils.js.map +1 -0
- package/build/lib/auth-utils.mjs +11 -0
- package/build/lib/auth-utils.mjs.map +1 -0
- package/build/lib/bootstrap.js +125 -157
- package/build/lib/bootstrap.js.map +1 -0
- package/build/lib/bootstrap.mjs +125 -0
- package/build/lib/bootstrap.mjs.map +1 -0
- package/build/lib/cli/cli.js +22 -24
- package/build/lib/cli/cli.js.map +1 -0
- package/build/lib/cli/cli.mjs +23 -0
- package/build/lib/cli/cli.mjs.map +1 -0
- package/build/lib/cli/commands/info.js +34 -25
- package/build/lib/cli/commands/info.js.map +1 -0
- package/build/lib/cli/commands/info.mjs +32 -0
- package/build/lib/cli/commands/info.mjs.map +1 -0
- package/build/lib/cli/commands/init.js +61 -79
- package/build/lib/cli/commands/init.js.map +1 -0
- package/build/lib/cli/commands/init.mjs +70 -0
- package/build/lib/cli/commands/init.mjs.map +1 -0
- package/build/lib/cli/commands/version.js +14 -16
- package/build/lib/cli/commands/version.js.map +1 -0
- package/build/lib/cli/commands/version.mjs +14 -0
- package/build/lib/cli/commands/version.mjs.map +1 -0
- package/build/lib/cli/utils.d.ts +2 -2
- package/build/lib/cli/utils.js +16 -15
- package/build/lib/cli/utils.js.map +1 -0
- package/build/lib/cli/utils.mjs +14 -0
- package/build/lib/cli/utils.mjs.map +1 -0
- package/build/lib/cli.js +11 -14
- package/build/lib/cli.js.map +1 -0
- package/build/lib/cli.mjs +12 -0
- package/build/lib/cli.mjs.map +1 -0
- package/build/lib/config.js +19 -21
- package/build/lib/config.js.map +1 -0
- package/build/lib/config.mjs +16 -0
- package/build/lib/config.mjs.map +1 -0
- package/build/lib/constants.js +100 -93
- package/build/lib/constants.js.map +1 -0
- package/build/lib/constants.mjs +28 -0
- package/build/lib/constants.mjs.map +1 -0
- package/build/lib/experiments.js +19 -27
- package/build/lib/experiments.js.map +1 -0
- package/build/lib/experiments.mjs +20 -0
- package/build/lib/experiments.mjs.map +1 -0
- package/build/lib/local-storage.d.ts +5 -2
- package/build/lib/local-storage.js +606 -757
- package/build/lib/local-storage.js.map +1 -0
- package/build/lib/local-storage.mjs +600 -0
- package/build/lib/local-storage.mjs.map +1 -0
- package/build/lib/logger/index.js +24 -19
- package/build/lib/logger/index.js.map +1 -0
- package/build/lib/logger/index.mjs +17 -0
- package/build/lib/logger/index.mjs.map +1 -0
- package/build/lib/metadata-utils.js +24 -36
- package/build/lib/metadata-utils.js.map +1 -0
- package/build/lib/metadata-utils.mjs +23 -0
- package/build/lib/metadata-utils.mjs.map +1 -0
- package/build/lib/run-server.js +83 -114
- package/build/lib/run-server.js.map +1 -0
- package/build/lib/run-server.mjs +82 -0
- package/build/lib/run-server.mjs.map +1 -0
- package/build/lib/storage-utils.d.ts +120 -8
- package/build/lib/storage-utils.js +390 -251
- package/build/lib/storage-utils.js.map +1 -0
- package/build/lib/storage-utils.mjs +400 -0
- package/build/lib/storage-utils.mjs.map +1 -0
- package/build/lib/storage.d.ts +127 -57
- package/build/lib/storage.js +674 -681
- package/build/lib/storage.js.map +1 -0
- package/build/lib/storage.mjs +665 -0
- package/build/lib/storage.mjs.map +1 -0
- package/build/lib/up-storage.js +490 -599
- package/build/lib/up-storage.js.map +1 -0
- package/build/lib/up-storage.mjs +484 -0
- package/build/lib/up-storage.mjs.map +1 -0
- package/build/lib/uplink-util.js +21 -31
- package/build/lib/uplink-util.js.map +1 -0
- package/build/lib/uplink-util.mjs +24 -0
- package/build/lib/uplink-util.mjs.map +1 -0
- package/build/lib/utils.js +172 -231
- package/build/lib/utils.js.map +1 -0
- package/build/lib/utils.mjs +188 -0
- package/build/lib/utils.mjs.map +1 -0
- package/package.json +105 -100
|
@@ -1,53 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const require_lib_constants = require("../../../lib/constants.js");
|
|
6
|
+
const require_api_web_api_utils = require("./utils.js");
|
|
7
|
+
let _verdaccio_middleware = require("@verdaccio/middleware");
|
|
8
|
+
let _verdaccio_search_indexer = require("@verdaccio/search-indexer");
|
|
9
|
+
let express = require("express");
|
|
10
|
+
//#region src/api/web/api/search.ts
|
|
12
11
|
function addSearchWebApi(storage, auth) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
next(packages);
|
|
38
|
-
} else {
|
|
39
|
-
getPackageInfo(i + 1);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
if (results.length) {
|
|
45
|
-
getPackageInfo(0);
|
|
46
|
-
} else {
|
|
47
|
-
next([]);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return route;
|
|
12
|
+
const route = (0, express.Router)();
|
|
13
|
+
route.get(require_api_web_api_utils.wrapPath(_verdaccio_middleware.WebUrls.search), async function(req, _res, next) {
|
|
14
|
+
const term = req.params.anything;
|
|
15
|
+
const indexer = await _verdaccio_search_indexer.SearchMemoryIndexer.query(term);
|
|
16
|
+
const packages = [];
|
|
17
|
+
const results = indexer.hits;
|
|
18
|
+
const getPackageInfo = function(i) {
|
|
19
|
+
storage.getPackage({
|
|
20
|
+
name: results[i].id,
|
|
21
|
+
uplinksLook: false,
|
|
22
|
+
callback: (err, entry) => {
|
|
23
|
+
if (!err && entry) auth.allow_access({ packageName: entry.name }, req.remote_user, function(err, allowed) {
|
|
24
|
+
if (err || !allowed) return;
|
|
25
|
+
packages.push(entry.versions[entry[require_lib_constants.DIST_TAGS].latest]);
|
|
26
|
+
});
|
|
27
|
+
if (i >= results.length - 1) next(packages);
|
|
28
|
+
else getPackageInfo(i + 1);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
if (results.length) getPackageInfo(0);
|
|
33
|
+
else next([]);
|
|
34
|
+
});
|
|
35
|
+
return route;
|
|
51
36
|
}
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
exports.default = addSearchWebApi;
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","names":[],"sources":["../../../../src/api/web/api/search.ts"],"sourcesContent":["import { Router } from 'express';\n\nimport type { Auth } from '@verdaccio/auth';\nimport { WebUrls } from '@verdaccio/middleware';\nimport { SearchMemoryIndexer } from '@verdaccio/search-indexer';\nimport type { Manifest } from '@verdaccio/types';\n\nimport { DIST_TAGS } from '../../../lib/constants';\nimport type Storage from '../../../lib/storage';\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../../types';\nimport { wrapPath } from './utils';\n\nfunction addSearchWebApi(storage: Storage, auth: Auth): Router {\n const route = Router();\n // Search package\n route.get(\n wrapPath(WebUrls.search),\n async function (\n req: $RequestExtend,\n _res: $ResponseExtend,\n next: $NextFunctionVer\n ): Promise<void> {\n const term = req.params.anything;\n const indexer = (await SearchMemoryIndexer.query(term)) as any;\n const packages: any[] = [];\n const results = indexer.hits;\n\n const getPackageInfo = function (i): void {\n storage.getPackage({\n name: results[i].id,\n uplinksLook: false,\n callback: (err, entry: Manifest): void => {\n if (!err && entry) {\n auth.allow_access(\n { packageName: entry.name },\n req.remote_user,\n function (err, allowed): void {\n if (err || !allowed) {\n return;\n }\n\n packages.push(entry.versions[entry[DIST_TAGS].latest]);\n }\n );\n }\n\n if (i >= results.length - 1) {\n next(packages);\n } else {\n getPackageInfo(i + 1);\n }\n },\n });\n };\n\n if (results.length) {\n getPackageInfo(0);\n } else {\n next([]);\n }\n }\n );\n\n return route;\n}\n\nexport default addSearchWebApi;\n"],"mappings":";;;;;;;;;;AAYA,SAAS,gBAAgB,SAAkB,MAAoB;CAC7D,MAAM,SAAA,GAAA,QAAA,OAAA,CAAe;CAErB,MAAM,IACJ,0BAAA,SAAS,sBAAA,QAAQ,MAAM,GACvB,eACE,KACA,MACA,MACe;EACf,MAAM,OAAO,IAAI,OAAO;EACxB,MAAM,UAAW,MAAM,0BAAA,oBAAoB,MAAM,IAAI;EACrD,MAAM,WAAkB,CAAC;EACzB,MAAM,UAAU,QAAQ;EAExB,MAAM,iBAAiB,SAAU,GAAS;GACxC,QAAQ,WAAW;IACjB,MAAM,QAAQ,EAAE,CAAC;IACjB,aAAa;IACb,WAAW,KAAK,UAA0B;KACxC,IAAI,CAAC,OAAO,OACV,KAAK,aACH,EAAE,aAAa,MAAM,KAAK,GAC1B,IAAI,aACJ,SAAU,KAAK,SAAe;MAC5B,IAAI,OAAO,CAAC,SACV;MAGF,SAAS,KAAK,MAAM,SAAS,MAAM,sBAAA,UAAU,CAAC,OAAO;KACvD,CACF;KAGF,IAAI,KAAK,QAAQ,SAAS,GACxB,KAAK,QAAQ;UAEb,eAAe,IAAI,CAAC;IAExB;GACF,CAAC;EACH;EAEA,IAAI,QAAQ,QACV,eAAe,CAAC;OAEhB,KAAK,CAAC,CAAC;CAEX,CACF;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DIST_TAGS } from "../../../lib/constants.mjs";
|
|
2
|
+
import { wrapPath } from "./utils.mjs";
|
|
3
|
+
import { WebUrls } from "@verdaccio/middleware";
|
|
4
|
+
import { SearchMemoryIndexer } from "@verdaccio/search-indexer";
|
|
5
|
+
import { Router } from "express";
|
|
6
|
+
//#region src/api/web/api/search.ts
|
|
7
|
+
function addSearchWebApi(storage, auth) {
|
|
8
|
+
const route = Router();
|
|
9
|
+
route.get(wrapPath(WebUrls.search), async function(req, _res, next) {
|
|
10
|
+
const term = req.params.anything;
|
|
11
|
+
const indexer = await SearchMemoryIndexer.query(term);
|
|
12
|
+
const packages = [];
|
|
13
|
+
const results = indexer.hits;
|
|
14
|
+
const getPackageInfo = function(i) {
|
|
15
|
+
storage.getPackage({
|
|
16
|
+
name: results[i].id,
|
|
17
|
+
uplinksLook: false,
|
|
18
|
+
callback: (err, entry) => {
|
|
19
|
+
if (!err && entry) auth.allow_access({ packageName: entry.name }, req.remote_user, function(err, allowed) {
|
|
20
|
+
if (err || !allowed) return;
|
|
21
|
+
packages.push(entry.versions[entry[DIST_TAGS].latest]);
|
|
22
|
+
});
|
|
23
|
+
if (i >= results.length - 1) next(packages);
|
|
24
|
+
else getPackageInfo(i + 1);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
if (results.length) getPackageInfo(0);
|
|
29
|
+
else next([]);
|
|
30
|
+
});
|
|
31
|
+
return route;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { addSearchWebApi as default };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=search.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.mjs","names":[],"sources":["../../../../src/api/web/api/search.ts"],"sourcesContent":["import { Router } from 'express';\n\nimport type { Auth } from '@verdaccio/auth';\nimport { WebUrls } from '@verdaccio/middleware';\nimport { SearchMemoryIndexer } from '@verdaccio/search-indexer';\nimport type { Manifest } from '@verdaccio/types';\n\nimport { DIST_TAGS } from '../../../lib/constants';\nimport type Storage from '../../../lib/storage';\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../../types';\nimport { wrapPath } from './utils';\n\nfunction addSearchWebApi(storage: Storage, auth: Auth): Router {\n const route = Router();\n // Search package\n route.get(\n wrapPath(WebUrls.search),\n async function (\n req: $RequestExtend,\n _res: $ResponseExtend,\n next: $NextFunctionVer\n ): Promise<void> {\n const term = req.params.anything;\n const indexer = (await SearchMemoryIndexer.query(term)) as any;\n const packages: any[] = [];\n const results = indexer.hits;\n\n const getPackageInfo = function (i): void {\n storage.getPackage({\n name: results[i].id,\n uplinksLook: false,\n callback: (err, entry: Manifest): void => {\n if (!err && entry) {\n auth.allow_access(\n { packageName: entry.name },\n req.remote_user,\n function (err, allowed): void {\n if (err || !allowed) {\n return;\n }\n\n packages.push(entry.versions[entry[DIST_TAGS].latest]);\n }\n );\n }\n\n if (i >= results.length - 1) {\n next(packages);\n } else {\n getPackageInfo(i + 1);\n }\n },\n });\n };\n\n if (results.length) {\n getPackageInfo(0);\n } else {\n next([]);\n }\n }\n );\n\n return route;\n}\n\nexport default addSearchWebApi;\n"],"mappings":";;;;;;AAYA,SAAS,gBAAgB,SAAkB,MAAoB;CAC7D,MAAM,QAAQ,OAAO;CAErB,MAAM,IACJ,SAAS,QAAQ,MAAM,GACvB,eACE,KACA,MACA,MACe;EACf,MAAM,OAAO,IAAI,OAAO;EACxB,MAAM,UAAW,MAAM,oBAAoB,MAAM,IAAI;EACrD,MAAM,WAAkB,CAAC;EACzB,MAAM,UAAU,QAAQ;EAExB,MAAM,iBAAiB,SAAU,GAAS;GACxC,QAAQ,WAAW;IACjB,MAAM,QAAQ,EAAE,CAAC;IACjB,aAAa;IACb,WAAW,KAAK,UAA0B;KACxC,IAAI,CAAC,OAAO,OACV,KAAK,aACH,EAAE,aAAa,MAAM,KAAK,GAC1B,IAAI,aACJ,SAAU,KAAK,SAAe;MAC5B,IAAI,OAAO,CAAC,SACV;MAGF,SAAS,KAAK,MAAM,SAAS,MAAM,UAAU,CAAC,OAAO;KACvD,CACF;KAGF,IAAI,KAAK,QAAQ,SAAS,GACxB,KAAK,QAAQ;UAEb,eAAe,IAAI,CAAC;IAExB;GACF,CAAC;EACH;EAEA,IAAI,QAAQ,QACV,eAAe,CAAC;OAEhB,KAAK,CAAC,CAAC;CAEX,CACF;CAEA,OAAO;AACT"}
|
|
@@ -1,76 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
4
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
6
|
+
require("../../../lib/constants.js");
|
|
7
|
+
const require_lib_utils = require("../../../lib/utils.js");
|
|
8
|
+
const require_api_web_api_utils = require("./utils.js");
|
|
9
|
+
const require_lib_auth_utils = require("../../../lib/auth-utils.js");
|
|
10
|
+
let lodash = require("lodash");
|
|
11
|
+
lodash = require_runtime.__toESM(lodash);
|
|
12
|
+
let _verdaccio_middleware = require("@verdaccio/middleware");
|
|
13
|
+
let _verdaccio_core = require("@verdaccio/core");
|
|
14
|
+
let express = require("express");
|
|
15
|
+
//#region src/api/web/api/user.ts
|
|
16
16
|
function addUserAuthApi(auth, config) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const {
|
|
52
|
-
password
|
|
53
|
-
} = req.body;
|
|
54
|
-
const {
|
|
55
|
-
name
|
|
56
|
-
} = req.remote_user;
|
|
57
|
-
if (_core.validationUtils.validatePassword(password.new) === false) {
|
|
58
|
-
return next(_utils.ErrorCode.getCode(_constants.HTTP_STATUS.BAD_REQUEST, _constants.APP_ERROR.PASSWORD_VALIDATION));
|
|
59
|
-
}
|
|
60
|
-
auth.changePassword(name, password.old, password.new, (err, isUpdated) => {
|
|
61
|
-
if (_lodash.default.isNil(err) && isUpdated) {
|
|
62
|
-
next({
|
|
63
|
-
ok: true
|
|
64
|
-
});
|
|
65
|
-
} else if (!_lodash.default.isNil(err)) {
|
|
66
|
-
return next(_utils.ErrorCode.getCode(_lodash.default.isNil(err.status) ? _constants.HTTP_STATUS.CONFLICT : err.status, err.message));
|
|
67
|
-
} else {
|
|
68
|
-
return next(_utils.ErrorCode.getInternalError(_constants.API_ERROR.INTERNAL_SERVER_ERROR));
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return route;
|
|
17
|
+
const route = (0, express.Router)();
|
|
18
|
+
route.post(require_api_web_api_utils.wrapSecPath(_verdaccio_middleware.WebUrls.user_login), (0, _verdaccio_middleware.rateLimit)(config?.userRateLimit), function(req, res, next) {
|
|
19
|
+
const { username, password } = req.body;
|
|
20
|
+
auth.authenticate(username, password, async (err, user) => {
|
|
21
|
+
if (err) {
|
|
22
|
+
const errorCode = err.message ? _verdaccio_core.HTTP_STATUS.UNAUTHORIZED : _verdaccio_core.HTTP_STATUS.INTERNAL_ERROR;
|
|
23
|
+
if (errorCode === _verdaccio_core.HTTP_STATUS.UNAUTHORIZED) res.set(_verdaccio_core.HEADERS.WWW_AUTH, _verdaccio_core.TOKEN_BEARER);
|
|
24
|
+
return next(require_lib_utils.ErrorCode.getCode(errorCode, err.message));
|
|
25
|
+
} else {
|
|
26
|
+
req.remote_user = user;
|
|
27
|
+
const jWTSignOptions = require_lib_auth_utils.getSecurity(config).web.sign;
|
|
28
|
+
res.set(_verdaccio_core.HEADERS.CACHE_CONTROL, "no-cache, no-store");
|
|
29
|
+
return next({
|
|
30
|
+
token: await auth.jwtEncrypt(user, jWTSignOptions),
|
|
31
|
+
username: req.remote_user.name
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
if (config?.flags?.changePassword === true) route.put(require_api_web_api_utils.wrapSecPath(_verdaccio_middleware.WebUrls.reset_password), function(req, res, next) {
|
|
37
|
+
if (lodash.default.isNil(req.remote_user.name)) {
|
|
38
|
+
res.status(_verdaccio_core.HTTP_STATUS.UNAUTHORIZED);
|
|
39
|
+
return next({ message: _verdaccio_core.API_ERROR.MUST_BE_LOGGED });
|
|
40
|
+
}
|
|
41
|
+
const { password } = req.body;
|
|
42
|
+
const { name } = req.remote_user;
|
|
43
|
+
if (_verdaccio_core.validationUtils.validatePassword(password.new) === false) return next(require_lib_utils.ErrorCode.getCode(_verdaccio_core.HTTP_STATUS.BAD_REQUEST, _verdaccio_core.APP_ERROR.PASSWORD_VALIDATION));
|
|
44
|
+
auth.changePassword(name, password.old, password.new, (err, isUpdated) => {
|
|
45
|
+
if (lodash.default.isNil(err) && isUpdated) next({ ok: true });
|
|
46
|
+
else if (!lodash.default.isNil(err)) return next(require_lib_utils.ErrorCode.getCode(lodash.default.isNil(err.status) ? _verdaccio_core.HTTP_STATUS.CONFLICT : err.status, err.message));
|
|
47
|
+
else return next(require_lib_utils.ErrorCode.getInternalError(_verdaccio_core.API_ERROR.INTERNAL_SERVER_ERROR));
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
return route;
|
|
74
51
|
}
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.default = addUserAuthApi;
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","names":[],"sources":["../../../../src/api/web/api/user.ts"],"sourcesContent":["import type { Request, Response } from 'express';\nimport { Router } from 'express';\nimport _ from 'lodash';\n\nimport type { Auth } from '@verdaccio/auth';\nimport { validationUtils } from '@verdaccio/core';\nimport { WebUrls, rateLimit } from '@verdaccio/middleware';\nimport type { Config, JWTSignOptions, RemoteUser } from '@verdaccio/types';\n\nimport { getSecurity } from '../../../lib/auth-utils';\nimport { API_ERROR, APP_ERROR, HEADERS, HTTP_STATUS, TOKEN_BEARER } from '../../../lib/constants';\nimport { ErrorCode } from '../../../lib/utils';\nimport type { $NextFunctionVer } from '../../../types';\nimport { wrapSecPath } from './utils';\n\nfunction addUserAuthApi(auth: Auth, config: Config): Router {\n const route = Router();\n route.post(\n wrapSecPath(WebUrls.user_login),\n rateLimit(config?.userRateLimit),\n function (req: Request, res: Response, next: $NextFunctionVer): void {\n const { username, password } = req.body;\n\n auth.authenticate(username, password, async (err, user?: RemoteUser): Promise<void> => {\n if (err) {\n const errorCode = err.message ? HTTP_STATUS.UNAUTHORIZED : HTTP_STATUS.INTERNAL_ERROR;\n if (errorCode === HTTP_STATUS.UNAUTHORIZED) {\n res.set(HEADERS.WWW_AUTH, TOKEN_BEARER);\n }\n return next(ErrorCode.getCode(errorCode, err.message));\n } else {\n req.remote_user = user as RemoteUser;\n const jWTSignOptions: JWTSignOptions = getSecurity(config).web.sign;\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n return next({\n token: await auth.jwtEncrypt(user as RemoteUser, jWTSignOptions),\n username: req.remote_user.name,\n });\n }\n });\n }\n );\n\n if (config?.flags?.changePassword === true) {\n route.put(\n wrapSecPath(WebUrls.reset_password),\n function (req: Request, res: Response, next: $NextFunctionVer): void {\n if (_.isNil(req.remote_user.name)) {\n res.status(HTTP_STATUS.UNAUTHORIZED);\n return next({\n // FUTURE: update to a more meaningful message\n message: API_ERROR.MUST_BE_LOGGED,\n });\n }\n\n const { password } = req.body;\n const { name } = req.remote_user;\n\n if (validationUtils.validatePassword(password.new) === false) {\n return next(ErrorCode.getCode(HTTP_STATUS.BAD_REQUEST, APP_ERROR.PASSWORD_VALIDATION));\n }\n\n auth.changePassword(name as string, password.old, password.new, (err, isUpdated): void => {\n if (_.isNil(err) && isUpdated) {\n next({\n ok: true,\n });\n } else if (!_.isNil(err)) {\n return next(\n ErrorCode.getCode(\n _.isNil(err.status) ? HTTP_STATUS.CONFLICT : err.status,\n err.message\n )\n );\n } else {\n return next(ErrorCode.getInternalError(API_ERROR.INTERNAL_SERVER_ERROR));\n }\n });\n }\n );\n }\n\n return route;\n}\n\nexport default addUserAuthApi;\n"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,eAAe,MAAY,QAAwB;CAC1D,MAAM,SAAA,GAAA,QAAA,OAAA,CAAe;CACrB,MAAM,KACJ,0BAAA,YAAY,sBAAA,QAAQ,UAAU,IAAA,GAAA,sBAAA,UAAA,CACpB,QAAQ,aAAa,GAC/B,SAAU,KAAc,KAAe,MAA8B;EACnE,MAAM,EAAE,UAAU,aAAa,IAAI;EAEnC,KAAK,aAAa,UAAU,UAAU,OAAO,KAAK,SAAqC;GACrF,IAAI,KAAK;IACP,MAAM,YAAY,IAAI,UAAU,gBAAA,YAAY,eAAe,gBAAA,YAAY;IACvE,IAAI,cAAc,gBAAA,YAAY,cAC5B,IAAI,IAAI,gBAAA,QAAQ,UAAU,gBAAA,YAAY;IAExC,OAAO,KAAK,kBAAA,UAAU,QAAQ,WAAW,IAAI,OAAO,CAAC;GACvD,OAAO;IACL,IAAI,cAAc;IAClB,MAAM,iBAAiC,uBAAA,YAAY,MAAM,CAAC,CAAC,IAAI;IAC/D,IAAI,IAAI,gBAAA,QAAQ,eAAe,oBAAoB;IACnD,OAAO,KAAK;KACV,OAAO,MAAM,KAAK,WAAW,MAAoB,cAAc;KAC/D,UAAU,IAAI,YAAY;IAC5B,CAAC;GACH;EACF,CAAC;CACH,CACF;CAEA,IAAI,QAAQ,OAAO,mBAAmB,MACpC,MAAM,IACJ,0BAAA,YAAY,sBAAA,QAAQ,cAAc,GAClC,SAAU,KAAc,KAAe,MAA8B;EACnE,IAAI,OAAA,QAAE,MAAM,IAAI,YAAY,IAAI,GAAG;GACjC,IAAI,OAAO,gBAAA,YAAY,YAAY;GACnC,OAAO,KAAK,EAEV,SAAS,gBAAA,UAAU,eACrB,CAAC;EACH;EAEA,MAAM,EAAE,aAAa,IAAI;EACzB,MAAM,EAAE,SAAS,IAAI;EAErB,IAAI,gBAAA,gBAAgB,iBAAiB,SAAS,GAAG,MAAM,OACrD,OAAO,KAAK,kBAAA,UAAU,QAAQ,gBAAA,YAAY,aAAa,gBAAA,UAAU,mBAAmB,CAAC;EAGvF,KAAK,eAAe,MAAgB,SAAS,KAAK,SAAS,MAAM,KAAK,cAAoB;GACxF,IAAI,OAAA,QAAE,MAAM,GAAG,KAAK,WAClB,KAAK,EACH,IAAI,KACN,CAAC;QACI,IAAI,CAAC,OAAA,QAAE,MAAM,GAAG,GACrB,OAAO,KACL,kBAAA,UAAU,QACR,OAAA,QAAE,MAAM,IAAI,MAAM,IAAI,gBAAA,YAAY,WAAW,IAAI,QACjD,IAAI,OACN,CACF;QAEA,OAAO,KAAK,kBAAA,UAAU,iBAAiB,gBAAA,UAAU,qBAAqB,CAAC;EAE3E,CAAC;CACH,CACF;CAGF,OAAO;AACT"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { API_ERROR, APP_ERROR, HEADERS, HTTP_STATUS, TOKEN_BEARER } from "../../../lib/constants.mjs";
|
|
2
|
+
import { ErrorCode } from "../../../lib/utils.mjs";
|
|
3
|
+
import { wrapSecPath } from "./utils.mjs";
|
|
4
|
+
import { getSecurity } from "../../../lib/auth-utils.mjs";
|
|
5
|
+
import _ from "lodash";
|
|
6
|
+
import { WebUrls, rateLimit } from "@verdaccio/middleware";
|
|
7
|
+
import { validationUtils } from "@verdaccio/core";
|
|
8
|
+
import { Router } from "express";
|
|
9
|
+
//#region src/api/web/api/user.ts
|
|
10
|
+
function addUserAuthApi(auth, config) {
|
|
11
|
+
const route = Router();
|
|
12
|
+
route.post(wrapSecPath(WebUrls.user_login), rateLimit(config?.userRateLimit), function(req, res, next) {
|
|
13
|
+
const { username, password } = req.body;
|
|
14
|
+
auth.authenticate(username, password, async (err, user) => {
|
|
15
|
+
if (err) {
|
|
16
|
+
const errorCode = err.message ? HTTP_STATUS.UNAUTHORIZED : HTTP_STATUS.INTERNAL_ERROR;
|
|
17
|
+
if (errorCode === HTTP_STATUS.UNAUTHORIZED) res.set(HEADERS.WWW_AUTH, TOKEN_BEARER);
|
|
18
|
+
return next(ErrorCode.getCode(errorCode, err.message));
|
|
19
|
+
} else {
|
|
20
|
+
req.remote_user = user;
|
|
21
|
+
const jWTSignOptions = getSecurity(config).web.sign;
|
|
22
|
+
res.set(HEADERS.CACHE_CONTROL, "no-cache, no-store");
|
|
23
|
+
return next({
|
|
24
|
+
token: await auth.jwtEncrypt(user, jWTSignOptions),
|
|
25
|
+
username: req.remote_user.name
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
if (config?.flags?.changePassword === true) route.put(wrapSecPath(WebUrls.reset_password), function(req, res, next) {
|
|
31
|
+
if (_.isNil(req.remote_user.name)) {
|
|
32
|
+
res.status(HTTP_STATUS.UNAUTHORIZED);
|
|
33
|
+
return next({ message: API_ERROR.MUST_BE_LOGGED });
|
|
34
|
+
}
|
|
35
|
+
const { password } = req.body;
|
|
36
|
+
const { name } = req.remote_user;
|
|
37
|
+
if (validationUtils.validatePassword(password.new) === false) return next(ErrorCode.getCode(HTTP_STATUS.BAD_REQUEST, APP_ERROR.PASSWORD_VALIDATION));
|
|
38
|
+
auth.changePassword(name, password.old, password.new, (err, isUpdated) => {
|
|
39
|
+
if (_.isNil(err) && isUpdated) next({ ok: true });
|
|
40
|
+
else if (!_.isNil(err)) return next(ErrorCode.getCode(_.isNil(err.status) ? HTTP_STATUS.CONFLICT : err.status, err.message));
|
|
41
|
+
else return next(ErrorCode.getInternalError(API_ERROR.INTERNAL_SERVER_ERROR));
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
return route;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { addUserAuthApi as default };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=user.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.mjs","names":[],"sources":["../../../../src/api/web/api/user.ts"],"sourcesContent":["import type { Request, Response } from 'express';\nimport { Router } from 'express';\nimport _ from 'lodash';\n\nimport type { Auth } from '@verdaccio/auth';\nimport { validationUtils } from '@verdaccio/core';\nimport { WebUrls, rateLimit } from '@verdaccio/middleware';\nimport type { Config, JWTSignOptions, RemoteUser } from '@verdaccio/types';\n\nimport { getSecurity } from '../../../lib/auth-utils';\nimport { API_ERROR, APP_ERROR, HEADERS, HTTP_STATUS, TOKEN_BEARER } from '../../../lib/constants';\nimport { ErrorCode } from '../../../lib/utils';\nimport type { $NextFunctionVer } from '../../../types';\nimport { wrapSecPath } from './utils';\n\nfunction addUserAuthApi(auth: Auth, config: Config): Router {\n const route = Router();\n route.post(\n wrapSecPath(WebUrls.user_login),\n rateLimit(config?.userRateLimit),\n function (req: Request, res: Response, next: $NextFunctionVer): void {\n const { username, password } = req.body;\n\n auth.authenticate(username, password, async (err, user?: RemoteUser): Promise<void> => {\n if (err) {\n const errorCode = err.message ? HTTP_STATUS.UNAUTHORIZED : HTTP_STATUS.INTERNAL_ERROR;\n if (errorCode === HTTP_STATUS.UNAUTHORIZED) {\n res.set(HEADERS.WWW_AUTH, TOKEN_BEARER);\n }\n return next(ErrorCode.getCode(errorCode, err.message));\n } else {\n req.remote_user = user as RemoteUser;\n const jWTSignOptions: JWTSignOptions = getSecurity(config).web.sign;\n res.set(HEADERS.CACHE_CONTROL, 'no-cache, no-store');\n return next({\n token: await auth.jwtEncrypt(user as RemoteUser, jWTSignOptions),\n username: req.remote_user.name,\n });\n }\n });\n }\n );\n\n if (config?.flags?.changePassword === true) {\n route.put(\n wrapSecPath(WebUrls.reset_password),\n function (req: Request, res: Response, next: $NextFunctionVer): void {\n if (_.isNil(req.remote_user.name)) {\n res.status(HTTP_STATUS.UNAUTHORIZED);\n return next({\n // FUTURE: update to a more meaningful message\n message: API_ERROR.MUST_BE_LOGGED,\n });\n }\n\n const { password } = req.body;\n const { name } = req.remote_user;\n\n if (validationUtils.validatePassword(password.new) === false) {\n return next(ErrorCode.getCode(HTTP_STATUS.BAD_REQUEST, APP_ERROR.PASSWORD_VALIDATION));\n }\n\n auth.changePassword(name as string, password.old, password.new, (err, isUpdated): void => {\n if (_.isNil(err) && isUpdated) {\n next({\n ok: true,\n });\n } else if (!_.isNil(err)) {\n return next(\n ErrorCode.getCode(\n _.isNil(err.status) ? HTTP_STATUS.CONFLICT : err.status,\n err.message\n )\n );\n } else {\n return next(ErrorCode.getInternalError(API_ERROR.INTERNAL_SERVER_ERROR));\n }\n });\n }\n );\n }\n\n return route;\n}\n\nexport default addUserAuthApi;\n"],"mappings":";;;;;;;;;AAeA,SAAS,eAAe,MAAY,QAAwB;CAC1D,MAAM,QAAQ,OAAO;CACrB,MAAM,KACJ,YAAY,QAAQ,UAAU,GAC9B,UAAU,QAAQ,aAAa,GAC/B,SAAU,KAAc,KAAe,MAA8B;EACnE,MAAM,EAAE,UAAU,aAAa,IAAI;EAEnC,KAAK,aAAa,UAAU,UAAU,OAAO,KAAK,SAAqC;GACrF,IAAI,KAAK;IACP,MAAM,YAAY,IAAI,UAAU,YAAY,eAAe,YAAY;IACvE,IAAI,cAAc,YAAY,cAC5B,IAAI,IAAI,QAAQ,UAAU,YAAY;IAExC,OAAO,KAAK,UAAU,QAAQ,WAAW,IAAI,OAAO,CAAC;GACvD,OAAO;IACL,IAAI,cAAc;IAClB,MAAM,iBAAiC,YAAY,MAAM,CAAC,CAAC,IAAI;IAC/D,IAAI,IAAI,QAAQ,eAAe,oBAAoB;IACnD,OAAO,KAAK;KACV,OAAO,MAAM,KAAK,WAAW,MAAoB,cAAc;KAC/D,UAAU,IAAI,YAAY;IAC5B,CAAC;GACH;EACF,CAAC;CACH,CACF;CAEA,IAAI,QAAQ,OAAO,mBAAmB,MACpC,MAAM,IACJ,YAAY,QAAQ,cAAc,GAClC,SAAU,KAAc,KAAe,MAA8B;EACnE,IAAI,EAAE,MAAM,IAAI,YAAY,IAAI,GAAG;GACjC,IAAI,OAAO,YAAY,YAAY;GACnC,OAAO,KAAK,EAEV,SAAS,UAAU,eACrB,CAAC;EACH;EAEA,MAAM,EAAE,aAAa,IAAI;EACzB,MAAM,EAAE,SAAS,IAAI;EAErB,IAAI,gBAAgB,iBAAiB,SAAS,GAAG,MAAM,OACrD,OAAO,KAAK,UAAU,QAAQ,YAAY,aAAa,UAAU,mBAAmB,CAAC;EAGvF,KAAK,eAAe,MAAgB,SAAS,KAAK,SAAS,MAAM,KAAK,cAAoB;GACxF,IAAI,EAAE,MAAM,GAAG,KAAK,WAClB,KAAK,EACH,IAAI,KACN,CAAC;QACI,IAAI,CAAC,EAAE,MAAM,GAAG,GACrB,OAAO,KACL,UAAU,QACR,EAAE,MAAM,IAAI,MAAM,IAAI,YAAY,WAAW,IAAI,QACjD,IAAI,OACN,CACF;QAEA,OAAO,KAAK,UAAU,iBAAiB,UAAU,qBAAqB,CAAC;EAE3E,CAAC;CACH,CACF;CAGF,OAAO;AACT"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.wrapPath = wrapPath;
|
|
7
|
-
exports.wrapSecPath = wrapSecPath;
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/api/web/api/utils.ts
|
|
8
3
|
function wrapPath(urlPath) {
|
|
9
|
-
|
|
4
|
+
return `/-/verdaccio/data${urlPath}`;
|
|
10
5
|
}
|
|
11
6
|
function wrapSecPath(urlPath) {
|
|
12
|
-
|
|
7
|
+
return `/-/verdaccio/sec${urlPath}`;
|
|
13
8
|
}
|
|
14
|
-
//#
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.wrapPath = wrapPath;
|
|
11
|
+
exports.wrapSecPath = wrapSecPath;
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../../src/api/web/api/utils.ts"],"sourcesContent":["export function wrapPath(urlPath: string) {\n return `/-/verdaccio/data${urlPath}`;\n}\n\nexport function wrapSecPath(urlPath: string) {\n return `/-/verdaccio/sec${urlPath}`;\n}\n"],"mappings":";;AAAA,SAAgB,SAAS,SAAiB;CACxC,OAAO,oBAAoB;AAC7B;AAEA,SAAgB,YAAY,SAAiB;CAC3C,OAAO,mBAAmB;AAC5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/api/web/api/utils.ts
|
|
2
|
+
function wrapPath(urlPath) {
|
|
3
|
+
return `/-/verdaccio/data${urlPath}`;
|
|
4
|
+
}
|
|
5
|
+
function wrapSecPath(urlPath) {
|
|
6
|
+
return `/-/verdaccio/sec${urlPath}`;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { wrapPath, wrapSecPath };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../../src/api/web/api/utils.ts"],"sourcesContent":["export function wrapPath(urlPath: string) {\n return `/-/verdaccio/data${urlPath}`;\n}\n\nexport function wrapSecPath(urlPath: string) {\n return `/-/verdaccio/sec${urlPath}`;\n}\n"],"mappings":";AAAA,SAAgB,SAAS,SAAiB;CACxC,OAAO,oBAAoB;AAC7B;AAEA,SAAgB,YAAY,SAAiB;CAC3C,OAAO,mBAAmB;AAC5B"}
|