@acrolinx/sdk
Advanced tools
Comparing version 0.1.3-build.1273 to 0.1.4-build.1363
@@ -35,2 +35,3 @@ import { DocumentId } from './document-descriptor'; | ||
status?: number; | ||
responseHeaders?: Headers; | ||
reference?: string; | ||
@@ -65,2 +66,3 @@ validationDetails?: ValidationDetail[]; | ||
readonly status?: number; | ||
readonly responseHeaders?: Headers; | ||
readonly reference?: string; | ||
@@ -67,0 +69,0 @@ readonly cause?: Error; |
@@ -66,2 +66,3 @@ "use strict"; | ||
_this.status = props.status; | ||
_this.responseHeaders = props.responseHeaders; | ||
// Copy only known props, to avoid accidental leaking of stuff. | ||
@@ -88,2 +89,3 @@ _this.httpRequest = props.httpRequest ? { | ||
status: jsonBody.status || res.status, | ||
responseHeaders: res.headers, | ||
httpRequest: req, | ||
@@ -90,0 +92,0 @@ title: jsonBody.title || res.statusText, |
{ | ||
"name": "@acrolinx/sdk", | ||
"version": "0.1.3-build.1273", | ||
"version": "0.1.4-build.1363", | ||
"description": "Acrolinx JavaScript SDK for the Acrolinx API", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -54,2 +54,3 @@ /* | ||
status?: number; | ||
responseHeaders?: Headers; | ||
reference?: string; | ||
@@ -89,2 +90,3 @@ validationDetails?: ValidationDetail[]; | ||
public readonly status?: number; | ||
public readonly responseHeaders?: Headers; | ||
public readonly reference?: string; | ||
@@ -100,2 +102,3 @@ public readonly cause?: Error; | ||
this.status = props.status; | ||
this.responseHeaders = props.responseHeaders; | ||
@@ -126,2 +129,3 @@ // Copy only known props, to avoid accidental leaking of stuff. | ||
status: jsonBody.status || res.status, | ||
responseHeaders: res.headers, | ||
httpRequest: req, | ||
@@ -128,0 +132,0 @@ title: jsonBody.title || res.statusText, |
@@ -597,2 +597,12 @@ /* | ||
it('should return response headers in case of error', async () => { | ||
const error = await expectFailingPromise<AcrolinxError>( | ||
analyzeAndPollWithSignature('brokenAppSignature'), | ||
ErrorType.AppSignatureRejected | ||
); | ||
expect(error.status).toEqual(403); | ||
expect(error.responseHeaders).toBeDefined(); | ||
}); | ||
it('should only work with signature type "APP"', async () => { | ||
@@ -599,0 +609,0 @@ /* tslint:disable-next-line:max-line-length*/ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
541316
10553