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", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/ --web)",
"build": "(tsbuild)", "build": "(tsbuild --web)"
"format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.22", "@gitzone/tsbuild": "^2.0.22",

View File

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

View File

@ -1,14 +1,24 @@
import * as plugins from './sdk.plugins'; import * as plugins from './sdk.plugins';
import { AuthInfo } from './sdk.classes.authinfo'; import { AuthInfo } from './sdk.classes.authinfo';
export interface IRequirementResult {
allOk: boolean;
reason: string;
}
export abstract class AAgHandler<TClaim> { export abstract class AAgHandler<TClaim> {
/** /**
* a slug that separates the handler from other handlers * a slug that separates the handler from other handlers
*/ */
public abstract slug: string; 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 start(): Promise<any>;
public abstract stop(): Promise<any>; public abstract stop(): Promise<any>;
} }