Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
9e6b92f864 | |||
b094c07ef2 | |||
33584785df | |||
580f8dd7f7 | |||
c1d2231a94 | |||
d73a144e8f |
3902
package-lock.json
generated
3902
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/sdk",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.9",
|
||||
"private": false,
|
||||
"description": "an sdk package for api.global",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -12,16 +12,16 @@
|
||||
"build": "(tsbuild --web)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.0.22",
|
||||
"@gitzone/tstest": "^1.0.15",
|
||||
"@gitzone/tsbuild": "^2.1.24",
|
||||
"@gitzone/tstest": "^1.0.33",
|
||||
"@pushrocks/tapbundle": "^3.0.7",
|
||||
"@types/node": "^13.9.3",
|
||||
"tslint": "^6.1.0",
|
||||
"@types/node": "^14.0.14",
|
||||
"tslint": "^6.1.2",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^1.0.28",
|
||||
"@tsclass/tsclass": "^3.0.16"
|
||||
"@apiglobal/typedrequest": "^1.0.38",
|
||||
"@tsclass/tsclass": "^3.0.18"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
21
readme.md
21
readme.md
@ -8,13 +8,20 @@ an sdk package for api.global
|
||||
* [docs (typedoc)](https://apiglobal.gitlab.io/sdk/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/apiglobal/sdk/commits/master)
|
||||
[](https://gitlab.com/apiglobal/sdk/commits/master)
|
||||
[](https://www.npmjs.com/package/@apiglobal/sdk)
|
||||
[](https://snyk.io/test/npm/@apiglobal/sdk)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
Status Category | Status Badge
|
||||
-- | --
|
||||
GitLab Pipelines | [](https://lossless.cloud)
|
||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||
npm | [](https://lossless.cloud)
|
||||
Snyk | [](https://lossless.cloud)
|
||||
TypeScript Support | [](https://lossless.cloud)
|
||||
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
Code Style | [](https://lossless.cloud)
|
||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||
|
||||
## Usage
|
||||
|
||||
|
14
test/test.ts
14
test/test.ts
@ -1,20 +1,18 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as sdk from '../ts/index';
|
||||
import { ISimpleRequest } from '@tsclass/tsclass/dist_ts/network';
|
||||
import { TypedRouter } from '@apiglobal/typedrequest';
|
||||
|
||||
|
||||
tap.test('should create a valid Handler', async () => {
|
||||
class MyHandler extends sdk.AAgHandler<any> {
|
||||
slug: 'testapi';
|
||||
public async handleRequest(authInfo: sdk.AuthInfo<any>, request: ISimpleRequest) {
|
||||
// this.authenticationHandler
|
||||
let response: any;
|
||||
return response;
|
||||
}
|
||||
public slug: 'testapi';
|
||||
public typedrouter = new TypedRouter();
|
||||
public async checkReqirements() {
|
||||
return {
|
||||
allOk: true,
|
||||
reason: ''
|
||||
}
|
||||
reason: '',
|
||||
};
|
||||
}
|
||||
|
||||
public async start() {}
|
||||
|
@ -1 +1 @@
|
||||
export {};
|
||||
export {};
|
||||
|
@ -11,14 +11,12 @@ 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 checkReqirements (): Promise<IRequirementResult>;
|
||||
public abstract typedrouter: plugins.typedrequest.TypedRouter;
|
||||
public abstract checkRequirements(): Promise<IRequirementResult>;
|
||||
|
||||
/**
|
||||
* start the ag-handler
|
||||
*/
|
||||
public abstract start(): Promise<any>;
|
||||
public abstract stop(): Promise<any>;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,13 @@
|
||||
// node native scope
|
||||
import * as path from 'path';
|
||||
|
||||
// @apiglobal scope
|
||||
import * as typedrequest from '@apiglobal/typedrequest';
|
||||
|
||||
export {
|
||||
typedrequest
|
||||
};
|
||||
|
||||
// @tsclass scope
|
||||
import * as tsclass from '@tsclass/tsclass';
|
||||
|
||||
|
Reference in New Issue
Block a user