2 Commits

Author SHA1 Message Date
e91131b7ae 1.0.6 2020-07-04 14:38:26 +00:00
4dd5d12a2e fix(core): update 2020-07-04 14:38:25 +00:00
4 changed files with 25 additions and 6 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@apiglobal/sdk",
"version": "1.0.5",
"version": "1.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@apiglobal/sdk",
"version": "1.0.5",
"version": "1.0.6",
"private": false,
"description": "an sdk package for api.global",
"main": "dist_ts/index.js",
@ -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>;
}