fix(core): update

This commit is contained in:
2019-08-22 16:44:44 +02:00
parent 760243e079
commit 27488b00f1
5 changed files with 56 additions and 23 deletions

View File

@ -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;
}
}

View File

@ -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
};