core: use common plugin-api interface

This commit is contained in:
undefined committed 2022-09-30 19:02:40 +08:00
1 parent c61c875bee
commit 70a96aecac
54 files changed
+387 -566

No files matched your search

@@ -1,9 +1,8 @@
import assert from 'assert';
import crypto from 'crypto';
import yaml from 'js-yaml';
import * as bus from 'hydrooj/src/service/bus';
import db from 'hydrooj/src/service/db';
import { Handler, post, Types } from 'hydrooj/src/service/server';
import {
Context, db, Handler, post, Types, yaml,
} from 'hydrooj';
function decrypt(encrypted: string) {
if (!encrypted) throw new Error();
@@ -13,7 +12,7 @@ function decrypt(encrypted: string) {
return decrypted;
}
declare module 'hydrooj/src/interface' {
declare module 'hydrooj' {
interface Collections {
dataReport: any;
}
@@ -61,6 +60,6 @@ class DataReportHandler extends Handler {
}
}
export function apply(ctx) {
export function apply(ctx: Context) {
ctx.Route('data_report', '/center/report', DataReportHandler);
}
-7
View File
@@ -6,13 +6,6 @@
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0-or-later",
"preferUnplugged": true,
"dependencies": {
"js-yaml": "^4.1.0",
"superagent": "^8.0.0"
},
"devDependencies": {
"@types/js-yaml": "^4.0.5"
},
"peerDependencies": {
"hydrooj": "*"
}