@percy/client
Advanced tools
Comparing version 1.28.8-beta.4 to 1.28.8-beta.6
@@ -6,3 +6,3 @@ import fs from 'fs'; | ||
import Pako from 'pako'; | ||
import { pool, request, formatBytes, sha256hash, base64encode, getPackageJSON, waitForTimeout, validateTiles } from './utils.js'; | ||
import { pool, request, formatBytes, sha256hash, base64encode, getPackageJSON, waitForTimeout, validateTiles, tagsList } from './utils.js'; | ||
@@ -49,2 +49,3 @@ // Default client API URL can be set with an env var for API development | ||
config, | ||
labels, | ||
// versioned api url | ||
@@ -56,3 +57,4 @@ apiUrl = PERCY_CLIENT_API_URL | ||
config: config || {}, | ||
apiUrl | ||
apiUrl, | ||
labels: labels | ||
}); | ||
@@ -135,2 +137,3 @@ this.addClientInfo(clientInfo); | ||
this.log.debug('Creating a new build...'); | ||
let tagsArr = tagsList(this.labels); | ||
return this.post('builds', { | ||
@@ -154,3 +157,4 @@ data: { | ||
'parallel-total-shards': this.env.parallel.total, | ||
partial: this.env.partial | ||
partial: this.env.partial, | ||
tags: tagsArr | ||
}, | ||
@@ -370,2 +374,3 @@ relationships: { | ||
testCase, | ||
labels, | ||
thTestCaseExecutionId, | ||
@@ -380,2 +385,3 @@ resources = [] | ||
} | ||
let tagsArr = tagsList(labels); | ||
this.log.debug(`Creating snapshot: ${name}...`); | ||
@@ -395,2 +401,3 @@ for (let resource of resources) { | ||
'test-case': testCase || null, | ||
tags: tagsArr, | ||
'scope-options': scopeOptions || {}, | ||
@@ -397,0 +404,0 @@ 'minimum-height': minHeight || null, |
@@ -236,2 +236,15 @@ import os from 'os'; | ||
} | ||
// convert tags comma-separated-names to array of objects for POST request | ||
export function tagsList(tags) { | ||
let tagsArr = []; | ||
if (typeof tags !== 'undefined' && tags !== null && typeof tags === 'string') { | ||
let tagNamesArray = tags.split(','); | ||
tagsArr = tagNamesArray.map(name => ({ | ||
id: null, | ||
name: name.trim() | ||
})); | ||
} | ||
return tagsArr; | ||
} | ||
export { hostnameMatches, ProxyHttpAgent, ProxyHttpsAgent, proxyAgentFor } from './proxy.js'; |
{ | ||
"name": "@percy/client", | ||
"version": "1.28.8-beta.4", | ||
"version": "1.28.8-beta.6", | ||
"license": "MIT", | ||
@@ -35,7 +35,7 @@ "repository": { | ||
"dependencies": { | ||
"@percy/env": "1.28.8-beta.4", | ||
"@percy/logger": "1.28.8-beta.4", | ||
"@percy/env": "1.28.8-beta.6", | ||
"@percy/logger": "1.28.8-beta.6", | ||
"pako": "^2.1.0" | ||
}, | ||
"gitHead": "0ea30a56b97b5a5dab6ddc1282f71f1ecf07df2d" | ||
"gitHead": "33ebd1aded619784a02e27cb26dbd344c7131ee9" | ||
} |
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
49237
1165
+ Added@percy/env@1.28.8-beta.6(transitive)
+ Added@percy/logger@1.28.8-beta.6(transitive)
- Removed@percy/env@1.28.8-beta.4(transitive)
- Removed@percy/logger@1.28.8-beta.4(transitive)
Updated@percy/env@1.28.8-beta.6
Updated@percy/logger@1.28.8-beta.6