fix(core): update
This commit is contained in:
parent
280e67b86b
commit
9787adf3f0
29
ts/index.ts
29
ts/index.ts
@ -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';
|
||||
|
1
ts/typedrequest.classes.typedhandler.ts
Normal file
1
ts/typedrequest.classes.typedhandler.ts
Normal file
@ -0,0 +1 @@
|
||||
export class TypedHandler {}
|
27
ts/typedrequest.classes.typedrequest.ts
Normal file
27
ts/typedrequest.classes.typedrequest.ts
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user