rest-api-handler
Advanced tools
Comparing version 2.0.0 to 2.1.0
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## [2.1.0] 2018-12-01 | ||
### Added | ||
- Request info to Default response | ||
@@ -5,0 +8,0 @@ ## [2.0.0] 2018-11-16 |
@@ -18,14 +18,9 @@ import { ApiResponseType } from './DefaultResponseProcessor'; | ||
/** | ||
* Request that failed. | ||
*/ | ||
private request; | ||
/** | ||
* Constructor. | ||
* | ||
* @param response - Processed response from server. | ||
* @param request - Fetch Request. | ||
*/ | ||
constructor(response: ApiResponseType<ResponseType>, request: Request); | ||
constructor(response: ApiResponseType<ResponseType>); | ||
getResponse(): ApiResponseType<ResponseType>; | ||
getRequest(): Request; | ||
} |
@@ -27,12 +27,7 @@ function _defineProperty(obj, key, value) { | ||
/** | ||
* Request that failed. | ||
*/ | ||
/** | ||
* Constructor. | ||
* | ||
* @param response - Processed response from server. | ||
* @param request - Fetch Request. | ||
*/ | ||
constructor(response, request) { | ||
constructor(response) { | ||
super(`Api exception: ${JSON.stringify(response.data)}`); | ||
@@ -42,6 +37,3 @@ | ||
_defineProperty(this, "request", void 0); | ||
this.response = response; | ||
this.request = request; // babel bug - https://github.com/babel/babel/issues/4485 | ||
this.response = response; // babel bug - https://github.com/babel/babel/issues/4485 | ||
// @ts-ignore | ||
@@ -57,3 +49,3 @@ | ||
getRequest() { | ||
return this.request; | ||
return this.response.request; | ||
} | ||
@@ -60,0 +52,0 @@ |
@@ -29,12 +29,7 @@ 'use strict'; | ||
/** | ||
* Request that failed. | ||
*/ | ||
/** | ||
* Constructor. | ||
* | ||
* @param response - Processed response from server. | ||
* @param request - Fetch Request. | ||
*/ | ||
constructor(response, request) { | ||
constructor(response) { | ||
super(`Api exception: ${JSON.stringify(response.data)}`); | ||
@@ -44,6 +39,3 @@ | ||
_defineProperty(this, "request", void 0); | ||
this.response = response; | ||
this.request = request; // babel bug - https://github.com/babel/babel/issues/4485 | ||
this.response = response; // babel bug - https://github.com/babel/babel/issues/4485 | ||
// @ts-ignore | ||
@@ -59,3 +51,3 @@ | ||
getRequest() { | ||
return this.request; | ||
return this.response.request; | ||
} | ||
@@ -62,0 +54,0 @@ |
@@ -7,2 +7,3 @@ import { ApiExceptionConstructor } from './DefaultApiException'; | ||
source: Response; | ||
request: Request; | ||
}; | ||
@@ -9,0 +10,0 @@ /** |
@@ -40,3 +40,4 @@ function _defineProperty(obj, key, value) { | ||
status: response.status, | ||
source: response | ||
source: response, | ||
request | ||
}; | ||
@@ -43,0 +44,0 @@ |
@@ -42,3 +42,4 @@ 'use strict'; | ||
status: response.status, | ||
source: response | ||
source: response, | ||
request | ||
}; | ||
@@ -45,0 +46,0 @@ |
@@ -444,3 +444,4 @@ function _defineProperty(obj, key, value) { | ||
status: response.status, | ||
source: response | ||
source: response, | ||
request | ||
}; | ||
@@ -486,12 +487,7 @@ | ||
/** | ||
* Request that failed. | ||
*/ | ||
/** | ||
* Constructor. | ||
* | ||
* @param response - Processed response from server. | ||
* @param request - Fetch Request. | ||
*/ | ||
constructor(response, request) { | ||
constructor(response) { | ||
super(`Api exception: ${JSON.stringify(response.data)}`); | ||
@@ -501,6 +497,3 @@ | ||
_defineProperty(this, "request", void 0); | ||
this.response = response; | ||
this.request = request; // babel bug - https://github.com/babel/babel/issues/4485 | ||
this.response = response; // babel bug - https://github.com/babel/babel/issues/4485 | ||
// @ts-ignore | ||
@@ -516,3 +509,3 @@ | ||
getRequest() { | ||
return this.request; | ||
return this.response.request; | ||
} | ||
@@ -519,0 +512,0 @@ |
@@ -448,3 +448,4 @@ 'use strict'; | ||
status: response.status, | ||
source: response | ||
source: response, | ||
request | ||
}; | ||
@@ -490,12 +491,7 @@ | ||
/** | ||
* Request that failed. | ||
*/ | ||
/** | ||
* Constructor. | ||
* | ||
* @param response - Processed response from server. | ||
* @param request - Fetch Request. | ||
*/ | ||
constructor(response, request) { | ||
constructor(response) { | ||
super(`Api exception: ${JSON.stringify(response.data)}`); | ||
@@ -505,6 +501,3 @@ | ||
_defineProperty(this, "request", void 0); | ||
this.response = response; | ||
this.request = request; // babel bug - https://github.com/babel/babel/issues/4485 | ||
this.response = response; // babel bug - https://github.com/babel/babel/issues/4485 | ||
// @ts-ignore | ||
@@ -520,3 +513,3 @@ | ||
getRequest() { | ||
return this.request; | ||
return this.response.request; | ||
} | ||
@@ -523,0 +516,0 @@ |
{ | ||
"name": "rest-api-handler", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Handler for REST APIs", | ||
@@ -26,4 +26,4 @@ "main": "dist/index.js", | ||
"@socifi/babel-config": "^0.6.0", | ||
"@socifi/eslint-config": "^2.0.1", | ||
"@socifi/jest-config": "^2.0.1", | ||
"@socifi/eslint-config": "^2.4.0", | ||
"@socifi/jest-config": "^2.1.0", | ||
"@socifi/rollup-config": "^2.0.1", | ||
@@ -30,0 +30,0 @@ "cross-fetch": "^2.2.0" |
@@ -23,16 +23,9 @@ /* eslint-disable no-proto */ | ||
/** | ||
* Request that failed. | ||
*/ | ||
private request: Request; | ||
/** | ||
* Constructor. | ||
* | ||
* @param response - Processed response from server. | ||
* @param request - Fetch Request. | ||
*/ | ||
public constructor(response: ApiResponseType<ResponseType>, request: Request) { | ||
public constructor(response: ApiResponseType<ResponseType>) { | ||
super(`Api exception: ${JSON.stringify(response.data)}`); | ||
this.response = response; | ||
this.request = request; | ||
@@ -49,4 +42,4 @@ // babel bug - https://github.com/babel/babel/issues/4485 | ||
public getRequest() { | ||
return this.request; | ||
return this.response.request; | ||
} | ||
} |
@@ -9,2 +9,3 @@ import { ApiExceptionConstructor } from './DefaultApiException'; | ||
source: Response, | ||
request: Request, | ||
}; | ||
@@ -38,2 +39,3 @@ | ||
source: response, | ||
request, | ||
}; | ||
@@ -40,0 +42,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4
91347
2478