@applitools/visual-grid-cli-utils 1.21.34 → 1.21.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/visual-grid-cli-utils",
3
- "version": "1.21.34",
3
+ "version": "1.21.35",
4
4
  "description": "",
5
5
  "main": "src/visual-grid-cli-utils.js",
6
6
  "engines": {
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  function calculateViewRenderingUrl(renderId, authToken, accountOverride) {
4
- return `https://render-wus.applitools.com/renderid/${renderId}/${encodeURI(authToken)}/${
4
+ return `https://ufg-ssa.applitools.com/renderid/${renderId}/${encodeURI(authToken)}/${
5
5
  accountOverride ? `?rg_namespace-override=${encodeURI(accountOverride)}` : ''
6
6
  }`
7
7
  }
package/src/export.js CHANGED
@@ -82,6 +82,8 @@ async function addCdtAndResourcesToZip(viewRenderingUrl, zip, resourceHash, acco
82
82
  if (zip.file(zipFilename)) return
83
83
 
84
84
  const {resource: cdtBuffer} = await fetchResource(viewRenderingUrl)
85
+ if (!cdtBuffer) return
86
+
85
87
  console.error('fetched cdt resource', resourceHash)
86
88
 
87
89
  zip.file(zipFilename, cdtBuffer, {
@@ -101,6 +103,7 @@ async function addResourcesToZip(resources, zip, baseUrl, accountOverride) {
101
103
  ? await fetchResource(new URL(`sha256-${hash}`, baseUrl).href, accountOverride)
102
104
  : {resource: Buffer.from(''), contentType: 'x-applitools/error-status-code'}
103
105
 
106
+ if (!resource) return
104
107
  const zipFilename = `sha256/${hash}.${
105
108
  contentType === 'x-applitools-html/cdt' ? 'cdt.json' : mime.extension(contentType)
106
109
  }`
@@ -131,6 +134,8 @@ async function fetchResource(resourceUrl, accountOverride) {
131
134
  async () => {
132
135
  const response = await fetch(rawResourceUrl)
133
136
 
137
+ if (!response.ok && response.status === 404) return {resource: undefined, contentType: undefined}
138
+
134
139
  if (!response.ok) await throwErrorFromBadStatus(rawResourceUrl, response)
135
140
 
136
141
  const resource = await response.buffer()