@saucelabs/visual
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -6,3 +6,3 @@ #!/usr/bin/env node | ||
getApi | ||
} from "./chunk-EUF6NEHT.js"; | ||
} from "./chunk-HCXPB4M2.js"; | ||
import "./chunk-3IT7HMR5.js"; | ||
@@ -9,0 +9,0 @@ |
@@ -39,3 +39,3 @@ import { | ||
selectiveRegionsToRegionInSync | ||
} from "./chunk-EUF6NEHT.js"; | ||
} from "./chunk-HCXPB4M2.js"; | ||
import "./chunk-3IT7HMR5.js"; | ||
@@ -47,2 +47,3 @@ | ||
import * as os from "os"; | ||
import { backOff } from "exponential-backoff"; | ||
var getFullPageConfig = async (main, local, getId) => { | ||
@@ -202,2 +203,43 @@ const isNoConfig = !main && !local; | ||
}; | ||
var getVisualResults = async (api, filter) => { | ||
const { buildId, diffIds } = filter; | ||
const initialStatusSummary = { | ||
["APPROVED" /* Approved */]: 0, | ||
["EQUAL" /* Equal */]: 0, | ||
["UNAPPROVED" /* Unapproved */]: 0, | ||
["REJECTED" /* Rejected */]: 0, | ||
["QUEUED" /* Queued */]: 0, | ||
["ERRORED" /* Errored */]: 0 | ||
}; | ||
if (!buildId) { | ||
throw new Error( | ||
"No Sauce Visual build present, cannot determine visual results." | ||
); | ||
} | ||
if (diffIds.length === 0) { | ||
return initialStatusSummary; | ||
} | ||
return await backOff( | ||
async () => { | ||
const summary = { ...initialStatusSummary }; | ||
const diffsForTestResult = await api.diffsForTestResult(buildId); | ||
if (!diffsForTestResult) { | ||
return summary; | ||
} | ||
const filterDiffsById = (diff) => diffIds.includes(diff.id); | ||
const statusSummary = diffsForTestResult.nodes.filter(filterDiffsById).reduce((statusSummary2, diff) => { | ||
statusSummary2[diff.status]++; | ||
return statusSummary2; | ||
}, summary); | ||
if (statusSummary["QUEUED" /* Queued */] > 0) { | ||
throw new Error("Some diffs are still in the queued state."); | ||
} | ||
return statusSummary; | ||
}, | ||
{ | ||
maxDelay: 1e4, | ||
numOfAttempts: 10 | ||
} | ||
); | ||
}; | ||
export { | ||
@@ -242,2 +284,3 @@ BaselinesOrderBy, | ||
getFullPageConfig, | ||
getVisualResults, | ||
isElementIn, | ||
@@ -244,0 +287,0 @@ isIgnoreRegion, |
{ | ||
"name": "@saucelabs/visual", | ||
"description": "JS client bindings for Sauce Labs Visual", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"main": "build/index.cjs", | ||
@@ -46,3 +46,2 @@ "module": "build/index.js", | ||
"@graphql-typed-document-node/core": "3.2.0", | ||
"@jest/globals": "^29.5.0", | ||
"arktype": "^1.0.29-alpha", | ||
@@ -53,2 +52,3 @@ "axios": "^1.7.4", | ||
"commander": "^12.0.0", | ||
"exponential-backoff": "^3.1.1", | ||
"proxy-agent": "^6.3.1" | ||
@@ -74,2 +74,3 @@ }, | ||
"@graphql-codegen/client-preset": "^3.0.1", | ||
"@jest/globals": "^29.5.0", | ||
"@tsconfig/node18": "^2.0.0", | ||
@@ -76,0 +77,0 @@ "@types/argparse": "^2.0.14", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
2185229
53791
24
+ Addedexponential-backoff@^3.1.1
+ Addedexponential-backoff@3.1.1(transitive)
- Removed@jest/globals@^29.5.0
- Removed@ampproject/remapping@2.3.0(transitive)
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/compat-data@7.26.3(transitive)
- Removed@babel/core@7.26.0(transitive)
- Removed@babel/generator@7.26.3(transitive)
- Removed@babel/helper-compilation-targets@7.25.9(transitive)
- Removed@babel/helper-module-imports@7.25.9(transitive)
- Removed@babel/helper-module-transforms@7.26.0(transitive)
- Removed@babel/helper-plugin-utils@7.25.9(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/helper-validator-option@7.25.9(transitive)
- Removed@babel/helpers@7.26.0(transitive)
- Removed@babel/parser@7.26.3(transitive)
- Removed@babel/plugin-syntax-async-generators@7.8.4(transitive)
- Removed@babel/plugin-syntax-bigint@7.8.3(transitive)
- Removed@babel/plugin-syntax-class-properties@7.12.13(transitive)
- Removed@babel/plugin-syntax-class-static-block@7.14.5(transitive)
- Removed@babel/plugin-syntax-import-attributes@7.26.0(transitive)
- Removed@babel/plugin-syntax-import-meta@7.10.4(transitive)
- Removed@babel/plugin-syntax-json-strings@7.8.3(transitive)
- Removed@babel/plugin-syntax-jsx@7.25.9(transitive)
- Removed@babel/plugin-syntax-logical-assignment-operators@7.10.4(transitive)
- Removed@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(transitive)
- Removed@babel/plugin-syntax-numeric-separator@7.10.4(transitive)
- Removed@babel/plugin-syntax-object-rest-spread@7.8.3(transitive)
- Removed@babel/plugin-syntax-optional-catch-binding@7.8.3(transitive)
- Removed@babel/plugin-syntax-optional-chaining@7.8.3(transitive)
- Removed@babel/plugin-syntax-private-property-in-object@7.14.5(transitive)
- Removed@babel/plugin-syntax-top-level-await@7.14.5(transitive)
- Removed@babel/plugin-syntax-typescript@7.25.9(transitive)
- Removed@babel/template@7.25.9(transitive)
- Removed@babel/traverse@7.26.4(transitive)
- Removed@babel/types@7.26.3(transitive)
- Removed@istanbuljs/load-nyc-config@1.1.0(transitive)
- Removed@istanbuljs/schema@0.1.3(transitive)
- Removed@jest/environment@29.7.0(transitive)
- Removed@jest/expect@29.7.0(transitive)
- Removed@jest/expect-utils@29.7.0(transitive)
- Removed@jest/fake-timers@29.7.0(transitive)
- Removed@jest/globals@29.7.0(transitive)
- Removed@jest/schemas@29.6.3(transitive)
- Removed@jest/transform@29.7.0(transitive)
- Removed@jest/types@29.6.3(transitive)
- Removed@jridgewell/gen-mapping@0.3.8(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removed@sinclair/typebox@0.27.8(transitive)
- Removed@sinonjs/commons@3.0.1(transitive)
- Removed@sinonjs/fake-timers@10.3.0(transitive)
- Removed@types/graceful-fs@4.1.9(transitive)
- Removed@types/istanbul-lib-coverage@2.0.6(transitive)
- Removed@types/istanbul-lib-report@3.0.3(transitive)
- Removed@types/istanbul-reports@3.0.4(transitive)
- Removed@types/node@22.10.5(transitive)
- Removed@types/stack-utils@2.0.3(transitive)
- Removed@types/yargs@17.0.33(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-styles@5.2.0(transitive)
- Removedanymatch@3.1.3(transitive)
- Removedargparse@1.0.10(transitive)
- Removedbabel-plugin-istanbul@6.1.1(transitive)
- Removedbabel-preset-current-node-syntax@1.1.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.3(transitive)
- Removedbrowserslist@4.24.3(transitive)
- Removedbser@2.1.1(transitive)
- Removedcamelcase@5.3.1(transitive)
- Removedcaniuse-lite@1.0.30001690(transitive)
- Removedci-info@3.9.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconvert-source-map@2.0.0(transitive)
- Removeddiff-sequences@29.6.3(transitive)
- Removedelectron-to-chromium@1.5.78(transitive)
- Removedescalade@3.2.0(transitive)
- Removedescape-string-regexp@2.0.0(transitive)
- Removedexpect@29.7.0(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfb-watchman@2.0.2(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedgensync@1.0.0-beta.2(transitive)
- Removedget-package-type@0.1.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedglobals@11.12.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-number@7.0.0(transitive)
- Removedistanbul-lib-coverage@3.2.2(transitive)
- Removedistanbul-lib-instrument@5.2.1(transitive)
- Removedjest-diff@29.7.0(transitive)
- Removedjest-get-type@29.6.3(transitive)
- Removedjest-haste-map@29.7.0(transitive)
- Removedjest-matcher-utils@29.7.0(transitive)
- Removedjest-message-util@29.7.0(transitive)
- Removedjest-mock@29.7.0(transitive)
- Removedjest-regex-util@29.6.3(transitive)
- Removedjest-snapshot@29.7.0(transitive)
- Removedjest-util@29.7.0(transitive)
- Removedjest-worker@29.7.0(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjsesc@3.1.0(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedmakeerror@1.0.12(transitive)
- Removedmerge-stream@2.0.0(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedminimatch@3.1.2(transitive)
- Removednatural-compare@1.4.0(transitive)
- Removednode-int64@0.4.0(transitive)
- Removednode-releases@2.0.19(transitive)
- Removednormalize-path@3.0.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpirates@4.0.6(transitive)
- Removedpretty-format@29.7.0(transitive)
- Removedreact-is@18.3.1(transitive)
- Removedresolve-from@5.0.0(transitive)
- Removedsemver@6.3.17.6.3(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedslash@3.0.0(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstack-utils@2.0.6(transitive)
- Removedsupports-color@8.1.1(transitive)
- Removedtest-exclude@6.0.0(transitive)
- Removedtmpl@1.0.5(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedtype-detect@4.0.8(transitive)
- Removedundici-types@6.20.0(transitive)
- Removedupdate-browserslist-db@1.1.1(transitive)
- Removedwalker@1.0.8(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedwrite-file-atomic@4.0.2(transitive)
- Removedyallist@3.1.1(transitive)