fix(core): update

This commit is contained in:
Philipp Kunz 2019-08-23 18:01:37 +02:00
parent 280e67b86b
commit 9787adf3f0
3 changed files with 30 additions and 27 deletions

View File

@ -1,27 +1,2 @@
import * as plugins from './typedrequest.plugins';
export class TypedRequest<T extends plugins.typedRequestInterfaces.ITypedRequest> {
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<T['response']> {
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';

View File

@ -0,0 +1 @@
export class TypedHandler {}

View File

@ -0,0 +1,27 @@
import * as plugins from './typedrequest.plugins';
export class TypedRequest<T extends plugins.typedRequestInterfaces.ITypedRequest> {
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<T['response']> {
const response = await plugins.smartrequest.request(this.urlEndPoint, {
method: 'POST',
requestBody: {
method: this.method,
request: fireArg,
response: null
}
});
return response.body.response;
}
}