🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@percy/client

Package Overview
Dependencies
Maintainers
1
Versions
373
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/client - npm Package Compare versions

Comparing version
1.32.2
to
1.32.3-beta.0
+1
-53
dist/client.js

@@ -367,7 +367,4 @@ import fs from 'fs';

// Retrieves snapshot/comparison data by id. Requires a read access token.
// For `smartsnap_graph`, the API blocks (sync=true) until the graph job
// finishes and returns the graph payload directly in the response — there
// is no separate "data" endpoint to fetch after polling.
async getStatus(type, ids) {
if (!['snapshot', 'comparison', 'smartsnap_graph'].includes(type)) throw new Error('Invalid type passed');
if (!['snapshot', 'comparison'].includes(type)) throw new Error('Invalid type passed');
this.log.debug(`Getting ${type} status for ids ${ids}`);

@@ -377,51 +374,2 @@ return this.get(`job_status?sync=true&type=${type}&id=${ids.join()}`);

// SmartSnap endpoints authenticate against the project attached to the
// current Percy token (via the Authorization header). `generate-graph`
// takes a `build_id` (sourced from the bundler-emitted stats file) so
// multiple concurrent storybook builds for the same project don't share
// Redis state. `snapshot-name-to-commit` is project-scoped only.
// Graph status is polled through the shared `getStatus()` helper with
// type `smartsnap_graph` — the sync response returns the graph payload
// directly on completion.
async getSmartsnapSnapshotNameToCommit() {
var _this$env$git, _this$env$target, _this$env$git2, _this$env$target2;
this.log.debug('Smartsnap: looking up baselines...');
const qs = new URLSearchParams();
// Same git/PR context `createBuild` sends — the API uses these to predict
// the base build that *would* be selected if we called createBuild now,
// without actually creating one. Any missing field means the API falls
// back through the same strategy chain it would on real build creation.
if ((_this$env$git = this.env.git) !== null && _this$env$git !== void 0 && _this$env$git.branch) qs.append('branch', this.env.git.branch);
if ((_this$env$target = this.env.target) !== null && _this$env$target !== void 0 && _this$env$target.branch) qs.append('target_branch', this.env.target.branch);
if ((_this$env$git2 = this.env.git) !== null && _this$env$git2 !== void 0 && _this$env$git2.sha) qs.append('commit_sha', this.env.git.sha);
if ((_this$env$target2 = this.env.target) !== null && _this$env$target2 !== void 0 && _this$env$target2.commit) qs.append('target_commit_sha', this.env.target.commit);
if (this.env.pullRequest != null) qs.append('pull_request_number', String(this.env.pullRequest));
if (this.env.partial) qs.append('partial', 'true');
const query = qs.toString();
return this.get(query ? `smartsnap/snapshot-name-to-commit?${query}` : 'smartsnap/snapshot-name-to-commit', {
identifier: 'smartsnap.snapshot_name_to_commit'
});
}
async generateSmartsnapGraph(buildId, {
files,
modules,
storybookPaths,
affectedNodes,
affectedFileLocations
} = {}) {
this.log.debug(`Smartsnap: enqueueing graph build for build ${buildId}...`);
return this.post('smartsnap/generate-graph', {
build_id: buildId,
files,
modules,
storybook_paths: storybookPaths,
affected_nodes: affectedNodes,
affected_file_locations: affectedFileLocations
}, {
identifier: 'smartsnap.generate_graph'
});
}
// Returns device details enabled on project associated with given token

@@ -428,0 +376,0 @@ async getDeviceDetails(buildId) {

+6
-6
{
"name": "@percy/client",
"version": "1.32.2",
"version": "1.32.3-beta.0",
"license": "MIT",

@@ -12,3 +12,3 @@ "repository": {

"access": "public",
"tag": "latest"
"tag": "beta"
},

@@ -37,9 +37,9 @@ "engines": {

"dependencies": {
"@percy/config": "1.32.2",
"@percy/env": "1.32.2",
"@percy/logger": "1.32.2",
"@percy/config": "1.32.3-beta.0",
"@percy/env": "1.32.3-beta.0",
"@percy/logger": "1.32.3-beta.0",
"pac-proxy-agent": "^7.0.2",
"pako": "^2.1.0"
},
"gitHead": "20719d038ffbe471e8364c5a44a8e779fb066f6a"
"gitHead": "e8af175695b4afdb78cdd48b67037710f5c8b1c9"
}