fix(core): update

This commit is contained in:
Philipp Kunz 2020-07-04 14:38:25 +00:00
parent 7fd110d56c
commit 4dd5d12a2e
3 changed files with 23 additions and 4 deletions

View File

@ -8,9 +8,8 @@
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild)",
"format": "(gitzone format)"
"test": "(tstest test/ --web)",
"build": "(tsbuild --web)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",

View File

@ -10,6 +10,16 @@ tap.test('should create a valid Handler', async () => {
let response: any;
return response;
}
public async checkReqirements() {
return {
allOk: true,
reason: ''
}
}
public async start() {}
public async stop() {}
}
const myHandlerInstance = new MyHandler();

View File

@ -1,14 +1,24 @@
import * as plugins from './sdk.plugins';
import { AuthInfo } from './sdk.classes.authinfo';
export interface IRequirementResult {
allOk: boolean;
reason: string;
}
export abstract class AAgHandler<TClaim> {
/**
* a slug that separates the handler from other handlers
*/
public abstract slug: string;
public abstract handleRequest (authInfoArg: AuthInfo<TClaim>, request: plugins.tsclass.network.ISimpleRequest): Promise<plugins.tsclass.network.ISimpleResponse>;
public abstract handleRequest (authInfoArg: AuthInfo<TClaim>, request: plugins.tsclass.network.ISimpleRequest): Promise<plugins.tsclass.network.ISimpleResponse>;
public abstract checkReqirements (): Promise<IRequirementResult>;
/**
* start the ag-handler
*/
public abstract start(): Promise<any>;
public abstract stop(): Promise<any>;
}