fix(core): update
This commit is contained in:
26
ts/index.ts
26
ts/index.ts
@ -1,3 +1,27 @@
|
||||
import * as plugins from './typedrequest.plugins';
|
||||
|
||||
export let standardExport = 'Hi there! :) This is an exported string';
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,2 +1,13 @@
|
||||
const removeme = {};
|
||||
export { removeme };
|
||||
// apiglobal scope
|
||||
import * as typedRequestInterfaces from '@apiglobal/typedrequest-interfaces';
|
||||
|
||||
export {
|
||||
typedRequestInterfaces
|
||||
};
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
|
||||
export {
|
||||
smartrequest
|
||||
};
|
||||
|
Reference in New Issue
Block a user