Compare commits

...

6 Commits

Author SHA1 Message Date
4a06bedf3b 1.0.13 2019-08-23 18:01:38 +02:00
9787adf3f0 fix(core): update 2019-08-23 18:01:37 +02:00
280e67b86b 1.0.12 2019-08-23 17:07:34 +02:00
592e941211 fix(core): update 2019-08-23 17:07:34 +02:00
68ec93459b 1.0.11 2019-08-23 17:01:26 +02:00
8a4b3fa47e fix(core): update 2019-08-23 17:01:26 +02:00
5 changed files with 36 additions and 33 deletions

8
package-lock.json generated
View File

@ -1,13 +1,13 @@
{
"name": "@apiglobal/typedrequest",
"version": "1.0.10",
"version": "1.0.13",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@apiglobal/typedrequest-interfaces": {
"version": "1.0.5",
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest-interfaces/-/typedrequest-interfaces-1.0.5.tgz",
"integrity": "sha512-j0RN3smGRjcbVw/L1JYEH9Gewy0fTIh3z7KLRNPCSNaNfIziw/93PyC6KcuXI9dgzlg0x/KCqOKdH9Z0rUykWw=="
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@apiglobal/typedrequest-interfaces/-/typedrequest-interfaces-1.0.7.tgz",
"integrity": "sha512-yPl0UcLFMwSQL7bK52wVjkgvadC+x2YS3+7T15V1A1dXNxa96yd4WX1fqcKqwnBrvYexq/8FaxWGi98tZ0oNwg=="
},
"@babel/code-frame": {
"version": "7.5.5",

View File

@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedrequest",
"version": "1.0.10",
"version": "1.0.13",
"private": false,
"description": "make typed requests towards apis",
"main": "dist/index.js",
@ -21,7 +21,7 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@apiglobal/typedrequest-interfaces": "^1.0.5",
"@apiglobal/typedrequest-interfaces": "^1.0.7",
"@pushrocks/smartrequest": "^1.1.23"
},
"files": [

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