Compare commits

...

15 Commits

Author SHA1 Message Date
9db92be274 1.0.14 2019-08-25 10:42:47 +02:00
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
ad7c2e97b8 1.0.10 2019-08-23 16:37:40 +02:00
0ff28152f3 fix(core): update 2019-08-23 16:37:40 +02:00
4718a03d7d 1.0.9 2019-08-23 14:53:39 +02:00
f99f79efb1 fix(core): update 2019-08-23 14:53:39 +02:00
ac653ac082 1.0.8 2019-08-23 14:50:12 +02:00
a8ee6b733f fix(core): update 2019-08-23 14:50:11 +02:00
f0117a0921 1.0.7 2019-08-23 14:47:39 +02:00
4af2d3f712 fix(core): update 2019-08-23 14:47:38 +02:00
6 changed files with 38 additions and 33 deletions

View File

@ -29,6 +29,8 @@ snyk:
stage: security
script:
- npmci npm prepare
- npmci node install stable
- npmci command npm cache clean --force
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test

8
package-lock.json generated
View File

@ -1,13 +1,13 @@
{
"name": "@apiglobal/typedrequest",
"version": "1.0.6",
"version": "1.0.14",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@apiglobal/typedrequest-interfaces": {
"version": "1.0.4",
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest-interfaces/-/typedrequest-interfaces-1.0.4.tgz",
"integrity": "sha512-ZlpTVg0KPZchPmJS2Ke11MWbvWBi2lS5ewBrCip+X/fGawDPDwXpIZvOqP5ATzr7JlZQyiLFhE3h59yZTHVHcA=="
"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.6",
"version": "1.0.14",
"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.4",
"@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;
}
}