mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 17:38:19 +08:00
bump beta.10
This commit is contained in:
27 files changed
+143
-112
No files matched your search
@@ -130,6 +130,17 @@ export class ApiService extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
serialize() {
|
||||
const result = {};
|
||||
for (const key in APIS) {
|
||||
result[key] = {
|
||||
type: APIS[key].type,
|
||||
input: APIS[key].input.toJSON(),
|
||||
};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async execute(
|
||||
context: ApiExecutionContext, callOrName: ApiCall<ApiType, any, any> | string,
|
||||
rawArgs: any, emitHook?: any, project?: any, sendPayload?: (payload: any) => void,
|
||||
@@ -255,9 +266,9 @@ export class ApiConnectionHandler<C extends Context> extends ConnectionHandler<C
|
||||
}
|
||||
}
|
||||
|
||||
export function applyApiHandler(ctx: Context, name: string, path: string) {
|
||||
export async function applyApiHandler(ctx: Context, name: string, path: string) {
|
||||
ctx.plugin(ApiService);
|
||||
ctx.inject(['server', 'api'], ({ Route, Connection }) => {
|
||||
await ctx.inject(['server', 'api'], ({ Route, Connection }) => {
|
||||
Route(name, path, ApiHandler);
|
||||
Connection(`${name}_conn`, `${path}/conn`, ApiConnectionHandler);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/framework",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.4",
|
||||
"main": "index.ts",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/hydro-dev/Hydro",
|
||||
@@ -10,15 +10,15 @@
|
||||
"dependencies": {
|
||||
"@hydrooj/utils": "workspace:^",
|
||||
"@koa/router": "^14.0.0",
|
||||
"emoji-regex": "^10.5.0",
|
||||
"fs-extra": "^11.3.1",
|
||||
"koa": "^3.0.1",
|
||||
"emoji-regex": "^10.6.0",
|
||||
"fs-extra": "^11.3.2",
|
||||
"koa": "^3.0.3",
|
||||
"koa-body": "^6.0.1",
|
||||
"koa-compress": "^5.1.1",
|
||||
"path-to-regexp": "^8.3.0",
|
||||
"sanitize-filename": "^1.6.3",
|
||||
"saslprep": "^1.0.3",
|
||||
"schemastery": "^3.17.0",
|
||||
"schemastery": "^3.17.1",
|
||||
"shorty.js": "^1.0.1",
|
||||
"ws": "^8.18.3"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user