@pnpm/server
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -24,6 +24,7 @@ "use strict"; | ||
}), | ||
getCacheByEngine: (storePath, id) => __awaiter(this, void 0, void 0, function* () { | ||
return limitedFetch(`${remotePrefix}/getCacheByEngine`, { | ||
id, | ||
storePath, | ||
getPackageLocation: (packageId, packageName, opts) => __awaiter(this, void 0, void 0, function* () { | ||
return limitedFetch(`${remotePrefix}/getPackageLocation`, { | ||
opts, | ||
packageId, | ||
packageName, | ||
}); | ||
@@ -30,0 +31,0 @@ }), |
@@ -20,4 +20,6 @@ "use strict"; | ||
if (req.method !== 'POST') { | ||
res.statusCode = 503; | ||
res.end(JSON.stringify(`Only POST is allowed, received ${req.method}`)); | ||
res.statusCode = 405; // Method Not Allowed | ||
const responseError = { error: `Only POST is allowed, received ${req.method}` }; | ||
res.setHeader('Allow', 'POST'); | ||
res.end(JSON.stringify(responseError)); | ||
return; | ||
@@ -126,6 +128,8 @@ } | ||
break; | ||
case '/getCacheByEngine': | ||
body = yield bodyPromise; | ||
res.end(JSON.stringify(yield store.getCacheByEngine(body.storePath, body.id))); | ||
case '/getPackageLocation': { | ||
const { packageId, packageName, opts } = (yield bodyPromise); // tslint:disable-line:no-any | ||
const pkgLocation = yield store.getPackageLocation(packageId, packageName, opts); | ||
res.end(JSON.stringify(pkgLocation)); | ||
break; | ||
} | ||
case '/findPackageUsages': | ||
@@ -132,0 +136,0 @@ body = yield bodyPromise; |
{ | ||
"name": "@pnpm/server", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "A pnpm installer server", | ||
@@ -37,4 +37,4 @@ "main": "lib/index.js", | ||
"@pnpm/npm-resolver": "2.2.7", | ||
"@pnpm/package-requester": "4.1.11", | ||
"@pnpm/package-store": "1.3.0", | ||
"@pnpm/package-requester": "5.0.0", | ||
"@pnpm/package-store": "2.0.0", | ||
"@pnpm/server": "link:", | ||
@@ -53,3 +53,3 @@ "@pnpm/tarball-fetcher": "2.0.8", | ||
"ts-node": "7.0.1", | ||
"tslint": "5.11.0", | ||
"tslint": "5.12.0", | ||
"typescript": "3.2.2" | ||
@@ -66,6 +66,6 @@ }, | ||
"dependencies": { | ||
"@pnpm/store-controller-types": "1.2.0", | ||
"@pnpm/store-controller-types": "2.0.0", | ||
"@pnpm/types": "2.0.0", | ||
"@types/got": "8.3.4", | ||
"@types/node": "10.12.12", | ||
"@types/node": "10.12.15", | ||
"@types/p-limit": "2.0.0", | ||
@@ -72,0 +72,0 @@ "@types/uuid": "3.4.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
28215
348
+ Added@pnpm/store-controller-types@2.0.0(transitive)
+ Added@types/node@10.12.15(transitive)
- Removed@pnpm/store-controller-types@1.2.0(transitive)
- Removed@types/node@10.12.12(transitive)
Updated@types/node@10.12.15