@hydrooj/center
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -0,0 +0,0 @@ declare module 'hydrooj/dist/interface' { |
@@ -36,5 +36,5 @@ "use strict"; | ||
} | ||
async post(domainId, instanceId, _payload) { | ||
async post(domainId, installId, _payload) { | ||
const payload = js_yaml_1.default.load(decrypt(_payload)); | ||
await coll.updateOne({ _id: instanceId }, { | ||
await coll.updateOne({ _id: installId }, { | ||
$set: { | ||
@@ -74,3 +74,3 @@ version: payload.version, | ||
if (res instanceof Error) | ||
throw new error_1.RemoteOnlineJudgeError(res.message); | ||
throw new error_1.RemoteOnlineJudgeError(`[Post Target/Send/Info] ${res.message}`); | ||
res = await superagent_1.default.post(`${endpoint}/problem/receive`).send({ | ||
@@ -80,3 +80,3 @@ operation: 'request', url: `${url}d/${domainId}/problem/send`, tokenId, expire, | ||
if (res instanceof Error) | ||
throw new error_1.RemoteOnlineJudgeError(res.message); | ||
throw new error_1.RemoteOnlineJudgeError(`[Post Target/Receive/Request] ${res.message}`); | ||
this.response.body = { code: 0 }; | ||
@@ -83,0 +83,0 @@ } |
@@ -66,7 +66,7 @@ import db from 'hydrooj/dist/service/db'; | ||
.catch((e) => e); | ||
if (res instanceof Error) throw new RemoteOnlineJudgeError(res.message); | ||
if (res instanceof Error) throw new RemoteOnlineJudgeError(`[Post Target/Send/Info] ${res.message}`); | ||
res = await superagent.post(`${endpoint}/problem/receive`).send({ | ||
operation: 'request', url: `${url}d/${domainId}/problem/send`, tokenId, expire, | ||
}).catch((e) => e); | ||
if (res instanceof Error) throw new RemoteOnlineJudgeError(res.message); | ||
if (res instanceof Error) throw new RemoteOnlineJudgeError(`[Post Target/Receive/Request] ${res.message}`); | ||
this.response.body = { code: 0 }; | ||
@@ -73,0 +73,0 @@ } |
{ | ||
"name": "@hydrooj/center", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "package.json", | ||
"repository": "https://github.com/hydro-dev/Hydro.git", | ||
"author": "undefined <i@undefined.moe>", | ||
"license": "MIT", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"dependencies": { | ||
@@ -9,0 +9,0 @@ "js-yaml": "^4.1.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
223026
1