2020-03-25 15:16:03 +00:00
|
|
|
import * as plugins from './sdk.plugins';
|
2020-03-25 20:15:46 +00:00
|
|
|
import { AuthInfo } from './sdk.classes.authinfo';
|
2020-03-25 15:16:03 +00:00
|
|
|
|
2020-07-04 14:38:25 +00:00
|
|
|
export interface IRequirementResult {
|
|
|
|
allOk: boolean;
|
|
|
|
reason: string;
|
|
|
|
}
|
|
|
|
|
2020-03-25 20:15:46 +00:00
|
|
|
export abstract class AAgHandler<TClaim> {
|
2020-03-25 15:16:03 +00:00
|
|
|
/**
|
|
|
|
* a slug that separates the handler from other handlers
|
|
|
|
*/
|
|
|
|
public abstract slug: string;
|
|
|
|
|
2020-07-04 14:50:24 +00:00
|
|
|
public abstract handleRequest(
|
|
|
|
authInfoArg: AuthInfo<TClaim>,
|
|
|
|
request: plugins.tsclass.network.ISimpleRequest
|
|
|
|
): Promise<plugins.tsclass.network.ISimpleResponse>;
|
|
|
|
public abstract checkReqirements(): Promise<IRequirementResult>;
|
2020-03-26 21:45:03 +00:00
|
|
|
|
2020-07-04 14:38:25 +00:00
|
|
|
/**
|
|
|
|
* start the ag-handler
|
|
|
|
*/
|
2020-03-26 21:45:03 +00:00
|
|
|
public abstract start(): Promise<any>;
|
|
|
|
public abstract stop(): Promise<any>;
|
2020-07-04 14:50:24 +00:00
|
|
|
}
|