From 9787adf3f0f726f64cce1daa6b6d96baffe94b0d Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 23 Aug 2019 18:01:37 +0200 Subject: [PATCH] fix(core): update --- ts/index.ts | 29 ++----------------------- ts/typedrequest.classes.typedhandler.ts | 1 + ts/typedrequest.classes.typedrequest.ts | 27 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 ts/typedrequest.classes.typedhandler.ts create mode 100644 ts/typedrequest.classes.typedrequest.ts diff --git a/ts/index.ts b/ts/index.ts index bf92d0c..b65b845 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,27 +1,2 @@ -import * as plugins from './typedrequest.plugins'; - -export class TypedRequest { - public urlEndPoint: string; - public method: string; - - // STATIC - constructor(urlEndPointArg: string, methodArg: T['method']) { - this.urlEndPoint = urlEndPointArg; - this.method = methodArg; - } - - /** - * firest the request - */ - public async fire(fireArg: T['request']): Promise { - const response = await plugins.smartrequest.request(this.urlEndPoint, { - method: 'POST', - requestBody: { - method: this.method, - request: fireArg, - response: null - } - }); - return response.body.response; - } -} +export * from './typedrequest.classes.typedrequest'; +export * from './typedrequest.classes.typedhandler'; diff --git a/ts/typedrequest.classes.typedhandler.ts b/ts/typedrequest.classes.typedhandler.ts new file mode 100644 index 0000000..effab8e --- /dev/null +++ b/ts/typedrequest.classes.typedhandler.ts @@ -0,0 +1 @@ +export class TypedHandler {} diff --git a/ts/typedrequest.classes.typedrequest.ts b/ts/typedrequest.classes.typedrequest.ts new file mode 100644 index 0000000..bf92d0c --- /dev/null +++ b/ts/typedrequest.classes.typedrequest.ts @@ -0,0 +1,27 @@ +import * as plugins from './typedrequest.plugins'; + +export class TypedRequest { + public urlEndPoint: string; + public method: string; + + // STATIC + constructor(urlEndPointArg: string, methodArg: T['method']) { + this.urlEndPoint = urlEndPointArg; + this.method = methodArg; + } + + /** + * firest the request + */ + public async fire(fireArg: T['request']): Promise { + const response = await plugins.smartrequest.request(this.urlEndPoint, { + method: 'POST', + requestBody: { + method: this.method, + request: fireArg, + response: null + } + }); + return response.body.response; + } +}