@applitools/eyes.sdk.core
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@applitools/eyes.sdk.core", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Applitools Eyes SDK For JavaScript", | ||
@@ -5,0 +5,0 @@ "author": "Applitools Team <team@applitools.com> (http://www.applitools.com/)", |
@@ -1,4 +0,6 @@ | ||
Eyes.Sdk.JavaScript | ||
@applitools/eyes.sdk.core | ||
=================== | ||
The core components of Eyes JavaScript SDK. | ||
The core components of Eyes JavaScript SDK. | ||
[![npm](https://img.shields.io/npm/v/@applitools/eyes.sdk.core.svg?style=for-the-badge)](https://www.npmjs.com/package/@applitools/eyes.sdk.core) |
@@ -28,8 +28,9 @@ 'use strict'; | ||
for (let suffix of suffixes) { | ||
if (!suffix.startsWith('/')) { | ||
for (let i = 0, l = suffixes.length; i < l; ++i) { | ||
const isLast = i === l - 1; | ||
if (!suffixes[i].startsWith('/') && !(isLast && suffixes[i].startsWith('?'))) { | ||
concatUrl += '/'; | ||
} | ||
concatUrl += GeneralUtils.stripTrailingSlash(suffix); | ||
concatUrl += GeneralUtils.stripTrailingSlash(suffixes[i]); | ||
} | ||
@@ -36,0 +37,0 @@ |
@@ -51,3 +51,7 @@ 'use strict'; | ||
const that = this; | ||
return that._serverConnector.renderStatus(runningRender).then(renderStatusResults => { | ||
return that._serverConnector.renderStatus(runningRender).catch(err => { | ||
return GeneralUtils.sleep(GET_STATUS_INTERVAL, that._promiseFactory).then(() => { | ||
return that._getRenderStatus(runningRender); | ||
}); | ||
}).then(renderStatusResults => { | ||
@@ -59,10 +63,6 @@ if (renderStatusResults.getStatus() === RenderStatus.RENDERING) { | ||
} else if (renderStatusResults.getStatus() === RenderStatus.ERROR) { | ||
that._promiseFactory.reject(renderStatusResults.getError()); | ||
return that._promiseFactory.reject(renderStatusResults.getError()); | ||
} | ||
return renderStatusResults; | ||
}).catch(err => { | ||
return GeneralUtils.sleep(GET_STATUS_INTERVAL, that._promiseFactory).then(() => { | ||
return that._getRenderStatus(runningRender); | ||
}); | ||
}); | ||
@@ -69,0 +69,0 @@ } |
@@ -408,13 +408,10 @@ 'use strict'; | ||
const that = this; | ||
const uri = GeneralUtils.urlConcat(this._renderingServerUrl, `/resources/sha256/${resource.getSha256Hash()}`); | ||
const uri = GeneralUtils.urlConcat(this._renderingServerUrl, `/resources/sha256/${resource.getSha256Hash()}`, '?render-id=' + runningRender.getRenderId()); | ||
const options = { | ||
headers: { | ||
'X-Auth-Token': that._renderingAuthToken, | ||
}, | ||
params: { | ||
'render-id': runningRender.getRenderId(), | ||
}, | ||
} | ||
}; | ||
return sendRequest(that, 'checkResourceExists', uri, 'HEAD', options).then(response => { | ||
return sendRequest(that, 'renderCheckResource', uri, 'HEAD', options).then(response => { | ||
const validStatusCodes = [HTTP_STATUS_CODES.OK, HTTP_STATUS_CODES.NOT_FOUND]; | ||
@@ -443,3 +440,3 @@ if (validStatusCodes.includes(response.status)) { | ||
const that = this; | ||
const uri = GeneralUtils.urlConcat(this._renderingServerUrl, `/resources/sha256/${resource.getSha256Hash()}`); | ||
const uri = GeneralUtils.urlConcat(this._renderingServerUrl, `/resources/sha256/${resource.getSha256Hash()}`, '?render-id=' + runningRender.getRenderId()); | ||
const options = { | ||
@@ -450,9 +447,6 @@ contentType: resource.getContentType(), | ||
}, | ||
params: { | ||
'render-id': runningRender.getRenderId(), | ||
}, | ||
data: resource.getContent() | ||
}; | ||
return sendRequest(that, 'putResource', uri, 'PUT', options).then(response => { | ||
return sendRequest(that, 'renderPutResource', uri, 'PUT', options).then(response => { | ||
const validStatusCodes = [HTTP_STATUS_CODES.OK]; | ||
@@ -479,13 +473,10 @@ if (validStatusCodes.includes(response.status)) { | ||
const that = this; | ||
const uri = GeneralUtils.urlConcat(this._renderingServerUrl, '/render-status'); | ||
const uri = GeneralUtils.urlConcat(this._renderingServerUrl, '/render-status', '?render-id=' + runningRender.getRenderId()); | ||
const options = { | ||
headers: { | ||
'X-Auth-Token': that._renderingAuthToken, | ||
}, | ||
params: { | ||
'render-id': runningRender.getRenderId(), | ||
} | ||
}; | ||
return sendRequest(that, 'render-status', uri, 'get', options).then(response => { | ||
return sendRequest(that, 'renderStatus', uri, 'get', options).then(response => { | ||
const validStatusCodes = [HTTP_STATUS_CODES.OK]; | ||
@@ -492,0 +483,0 @@ if (validStatusCodes.includes(response.status)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
366104
7
9534