4 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
7fd110d56c 1.0.5 2020-03-26 21:45:03 +00:00
bb7e9e75ba fix(fix(AAgHandler): now has mandatory async start and async stop methods): update 2020-03-26 21:45:03 +00:00
4 changed files with 27 additions and 5 deletions

2
package-lock.json generated
View File

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

View File

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