Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

saucelabs

Package Overview
Dependencies
Maintainers
4
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saucelabs - npm Package Compare versions

Comparing version 2.0.0-beta.5 to 2.0.0-beta.6

2

a.js

@@ -15,3 +15,3 @@ const SauceLabs = require('./build').default

api.downloadJobAsset('59088c444518488b8a6bbb1ee2d015ba', 'automator.log', 'foobar.json')
api.downloadJobAsset('59088c444518488b8a6bbb1ee2d015ba', 'automator.log', 'lala.json')
.then(

@@ -18,0 +18,0 @@ (a) => console.log('fertig', a),

@@ -66,3 +66,3 @@ "use strict";

const params = description.parameters.map(urlParameter => urlParameter.$ref ? _constants.PARAMETERS_MAP.get(urlParameter.$ref.split('/').slice(-1)[0]) : urlParameter);
const params = (description.parameters || []).map(urlParameter => urlParameter.$ref ? _constants.PARAMETERS_MAP.get(urlParameter.$ref.split('/').slice(-1)[0]) : urlParameter);
/**

@@ -82,3 +82,3 @@ * validate required url params

url = endpoint.replace(`{${urlParam.name}}`, param);
url = url.replace(`{${urlParam.name}}`, param);
}

@@ -157,26 +157,35 @@ /**

const fd = _fs.default.createWriteStream(_path.default.resolve(process.cwd(), downloadPath));
const hmac = await (0, _utils.createHMAC)(this.username, this.accessKey, jobId);
return new Promise((resolve, reject) => {
const req = (0, _request.default)({
method: 'GET',
uri: `https://assets.${this.host}/jobs/${jobId}/${assetName}?ts=${Date.now()}&auth=${hmac}`
}, (err, res, body) => {
/**
* check if request was successful
*/
if (err) {
return reject(err);
}
/**
* check if we received the asset
*/
const hmac = await (0, _utils.createHMAC)(this.username, this.accessKey, jobId);
return new Promise((resolve, reject) => (0, _request.default)({
method: 'GET',
uri: `https://assets.${this.host}/jobs/${jobId}/${assetName}?ts=${Date.now()}&auth=${hmac}`
}, (err, res, body) => {
if (res.statusCode !== 200) {
return reject(new Error(`There was an error downloading asset ${assetName}, status code: ${res.statusCode}`));
}
return resolve(body);
});
/**
* check if request was successful
* only pipe asset to file if path is given
*/
if (err) {
return reject(err);
}
/**
* check if we received the asset
*/
if (downloadPath) {
const fd = _fs.default.createWriteStream(_path.default.resolve(process.cwd(), downloadPath));
if (res.statusCode !== 200) {
return reject(new Error(`There was an error downloading asset ${assetName}, status code: ${res.statusCode}`));
req.pipe(fd);
}
return resolve(body);
}).pipe(fd));
});
}

@@ -187,2 +196,2 @@

exports.default = SauceLabs;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJTYXVjZUxhYnMiLCJjb25zdHJ1Y3RvciIsInVzZXJuYW1lIiwiYWNjZXNzS2V5IiwiaG9zdCIsImF1dGgiLCJ1c2VyIiwicGFzcyIsIlByb3h5IiwiZ2V0Iiwib2JqIiwicHJvcE5hbWUiLCJQUk9UT0NPTF9NQVAiLCJoYXMiLCJFcnJvciIsImRvd25sb2FkSm9iQXNzZXQiLCJhcmdzIiwiZGVzY3JpcHRpb24iLCJtZXRob2QiLCJlbmRwb2ludCIsInBhcmFtcyIsInBhcmFtZXRlcnMiLCJtYXAiLCJ1cmxQYXJhbWV0ZXIiLCIkcmVmIiwiUEFSQU1FVEVSU19NQVAiLCJzcGxpdCIsInNsaWNlIiwidXJsIiwiaSIsInVybFBhcmFtIiwiT2JqZWN0IiwiZW50cmllcyIsImZpbHRlciIsInAiLCJpbiIsInBhcmFtIiwidHlwZSIsInJlcGxhY2UiLCJuYW1lIiwiYm9keU1hcCIsIk1hcCIsIm9wdGlvbnMiLCJyZXF1aXJlZCIsImxlbmd0aCIsIm9wdGlvblBhcmFtIiwiZXhwZWN0ZWRUeXBlIiwib3B0aW9uIiwiY2hhbmdlQ2FzZSIsImNhbWVsQ2FzZSIsImlzUmVxdWlyZWQiLCJCb29sZWFuIiwiZGVmYXVsdCIsInNldCIsImJvZHkiLCJyZWR1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m9yKGBDb3VsZG4ndCBmaW5kIEFQSSBlbmRwb2ludCBmb3IgY29tbWFuZCBcIiR7cHJvcE5hbWV9XCJgKVxuICAgICAgICB9XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIGhhbmRsZSBzcGVjaWFsIGNvbW1hbmRzIG5vdCBkZWZpbmVkIGluIHRoZSBwcm90b2NvbFxuICAgICAgICAgKi9cbiAgICAgICAgaWYgKHByb3BOYW1lID09PSAnZG93bmxvYWRKb2JBc3NldCcpIHtcbiAgICAgICAgICAgIHJldHVybiA6OnRoaXMuZG93bmxvYWRKb2JBc3NldFxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuICguLi5hcmdzKSA9PiB7XG4gICAgICAgICAgICBjb25zdCB7IGRlc2NyaXB0aW9uLCBtZXRob2QsIGVuZHBvaW50LCBob3N0IH0gPSBQUk9UT0NPTF9NQVAuZ2V0KHByb3BOYW1lKVxuICAgICAgICAgICAgY29uc3QgcGFyYW1zID0gZGVzY3JpcHRpb24ucGFyYW1ldGVycy5tYXAoXG4gICAgICAgICAgICAgICAgKHVybFBhcmFtZXRlcikgPT4gdXJsUGFyYW1ldGVyLiRyZWZcbiAgICAgICAgICAgICAgICAgICAgPyBQQVJBTUVURVJTX01BUC5nZXQodXJsUGFyYW1ldGVyLiRyZWYuc3BsaXQoJy8nKS5zbGljZSgtMSlbMF0pXG4gICAgICAgICAgICAgICAgICAgIDogdXJsUGFyYW1ldGVyKVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIHZhbGlkYXRlIHJlcXVpcmVkIHVybCBwYXJhbXNcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgbGV0IHVybCA9IGVuZHBvaW50XG4gICAgICAgICAgICBmb3IgKGNvbnN0IFtpLCB1cmxQYXJhbV0gb2YgT2JqZWN0LmVudHJpZXMocGFyYW1zLmZpbHRlcihwID0+IHAuaW4gPT09ICdwYXRoJykpKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgcGFyYW0gPSBhcmdzW2ldXG4gICAgICAgICAgICAgICAgY29uc3QgdHlwZSA9IHVybFBhcmFtLnR5cGUucmVwbGFjZSgnaW50ZWdlcicsICdudW1iZXInKVxuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYXJhbSAhPT0gdHlwZSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEV4cGVjdGVkIHBhcmFtZXRlciBmb3IgdXJsIHBhcmFtICcke3VybFBhcmFtLm5hbWV9JyBmcm9tIHR5cGUgJyR7dHlwZX0nLCBmb3VuZCAnJHt0eXBlb2YgcGFyYW19J2ApXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdXJsID0gZW5kcG9pbnQucmVwbGFjZShgeyR7dXJsUGFyYW0ubmFtZX19YCwgcGFyYW0pXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogdmFsaWRhdGUgcmVxdWlyZWQgb3B0aW9uc1xuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBjb25zdCBib2R5TWFwID0gbmV3IE1hcCgpXG4gICAgICAgICAgICBjb25zdCBvcHRpb25zID0gYXJncy5zbGljZShwYXJhbXMuZmlsdGVyKHAgPT4gcC5yZXF1aXJlZCkubGVuZ3RoKVswXSB8fCB7fVxuICAgICAgICAgICAgZm9yIChjb25zdCBvcHRpb25QYXJhbSBvZiBwYXJhbXMuZmlsdGVyKHAgPT4gcC5pbiA9PT0gJ3F1ZXJ5JykpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBleHBlY3RlZFR5cGUgPSBvcHRpb25QYXJhbS50eXBlLnJlcGxhY2UoJ2ludGVnZXInLCAnbnVtYmVyJylcbiAgICAgICAgICAgICAgICBjb25zdCBvcHRpb24gPSBvcHRpb25zW2NoYW5nZUNhc2UuY2FtZWxDYXNlKG9wdGlvblBhcmFtLm5hbWUpXVxuICAgICAgICAgICAgICAgIGNvbnN0IGlzUmVxdWlyZWQgPSBCb29sZWFuKG9wdGlvblBhcmFtLnJlcXVpcmVkKSB8fCAodHlwZW9mIG9wdGlvblBhcmFtLnJlcXVpcmVkID09PSAndW5kZWZpbmVkJyAmJiB0eXBlb2Ygb3B0aW9uUGFyYW0uZGVmYXVsdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgaWYgKGlzUmVxdWlyZWQgJiYgKCFvcHRpb24gfHwgdHlwZW9mIG9wdGlvbiAhPT0gZXhwZWN0ZWRUeXBlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEV4cGVjdGVkIHBhcmFtZXRlciBmb3Igb3B0aW9uICcke29wdGlvblBhcmFtLm5hbWV9JyBmcm9tIHR5cGUgJyR7ZXhwZWN0ZWRUeXBlfScsIGZvdW5kICcke3R5cGVvZiBvcHRpb259J2ApXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbikge1xuICAgICAgICAgICAgICAgICAgICBib2R5TWFwLnNldChvcHRpb25QYXJhbS5uYW1lLCBvcHRpb24pXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIGNvbnZlcnQgbWFwIGludG8ganNvbiBvYmplY3RcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgY29uc3QgYm9keSA9IFsuLi5ib2R5TWFwLmVudHJpZXMoKV0ucmVkdWNlKChlLCBbaywgdl0pID0+IHtcbiAgICAgICAgICAgICAgICBlW2tdID0gdlxuICAgICAgICAgICAgICAgIHJldHVybiBlXG4gICAgICAgICAgICB9LCB7fSlcblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBtYWtlIHJlcXVlc3RcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHJlcXVlc3Qoe1xuICAgICAgICAgICAgICAgIHVyaTogYGh0dHBzOi8vJHtob3N0fSR7dXJsfWAsXG4gICAgICAgICAgICAgICAgbWV0aG9kOiBtZXRob2QudG9VcHBlckNhc2UoKSxcbiAgICAgICAgICAgICAgICBbbWV0aG9kID09PSAncG9zdCcgPyAnanNvbicgOiAncXMnXTogYm9keSxcbiAgICAgICAgICAgICAgICBqc29uOiB0cnVlLFxuICAgICAgICAgICAgICAgIGF1dGg6IHRoaXMuYXV0aFxuICAgICAgICAgICAgfSwgKGVyciwgcmVzcG9uc2UsIGJvZHkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5zdGF0dXNDb2RlICE9PSAyMDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChuZXcgRXJyb3IoYm9keS5tZXNzYWdlIHx8ICd1bmtub3duIGVycm9yJykpXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoYm9keSlcbiAgICAgICAgICAgIH0pKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgZG93bmxvYWRKb2JBc3NldCAoam9iSWQsIGFzc2V0TmFtZSwgZG93bmxvYWRQYXRoKSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBjaGVjayBqb2IgaWRcbiAgICAgICAgICovXG4gICAgICAgIGlmICh0eXBlb2Ygam9iSWQgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1lvdSBuZWVkIHRvIGRlZmluZSBhIGpvYiBpZCcpXG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogdGhyb3cgaWYgYXNzZXQgaXMgbm90IGtub3dcbiAgICAgICAgICovXG4gICAgICAgIGlmICghSk9CX0FTU0VUX05BTUVTLmluY2x1ZGVzKGFzc2V0TmFtZSkpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgVW5rbm93biBhc3NldCAnJHthc3NldE5hbWV9JywgdGhlIGZvbGxvd2luZyBhc3NldHMgYXJlIGF2YWlsYWJsZTogJHtKT0JfQVNTRVRfTkFNRVMuam9pbignLCAnKX1gKVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgZmQgPSBmcy5jcmVhdGVXcml0ZVN0cmVhbShwYXRoLnJlc29sdmUocHJvY2Vzcy5jd2QoKSwgZG93bmxvYWRQYXRoKSlcbiAgICAgICAgY29uc3QgaG1hYyA9IGF3YWl0IGNyZWF0ZUhNQUModGhpcy51c2VybmFtZSwgdGhpcy5hY2Nlc3NLZXksIGpvYklkKVxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gcmVxdWVzdCh7XG4gICAgICAgICAgICBtZXRob2Q6ICdHRVQnLFxuICAgICAgICAgICAgdXJpOiBgaHR0cHM6Ly9hc3NldHMuJHt0aGlzLmhvc3R9L2pvYnMvJHtqb2JJZH0vJHthc3NldE5hbWV9P3RzPSR7RGF0ZS5ub3coKX0mYXV0aD0ke2htYWN9YCxcbiAgICAgICAgfSwgKGVyciwgcmVzLCBib2R5KSA9PiB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIGNoZWNrIGlmIHJlcXVlc3Qgd2FzIHN1Y2Nlc3NmdWxcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIGNoZWNrIGlmIHdlIHJlY2VpdmVkIHRoZSBhc3NldFxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZiAocmVzLnN0YXR1c0NvZGUgIT09IDIwM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5hbWVdXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIVBST1RPQ09MX01BUC5oYXMocHJvcE5hbWUpKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYENvdWxkbid0IGZpbmQgQVBJIGVuZHBvaW50IGZvciBjb21tYW5kIFwiJHtwcm9wTmFtZX1cImApXG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogaGFuZGxlIHNwZWNpYWwgY29tbWFuZHMgbm90IGRlZmluZWQgaW4gdGhlIHByb3RvY29sXG4gICAgICAgICAqL1xuICAgICAgICBpZiAocHJvcE5hbWUgPT09ICdkb3dubG9hZEpvYkFzc2V0Jykge1xuICAgICAgICAgICAgcmV0dXJuIDo6dGhpcy5kb3dubG9hZEpvYkFzc2V0XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gKC4uLmFyZ3MpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHsgZGVzY3JpcHRpb24sIG1ldGhvZCwgZW5kcG9pbnQsIGhvc3QgfSA9IFBST1RPQ09MX01BUC5nZXQocHJvcE5hbWUpXG4gICAgICAgICAgICBjb25zdCBwYXJhbXMgPSAoZGVzY3JpcHRpb24ucGFyYW1ldGVycyB8fCBbXSkubWFwKFxuICAgICAgICAgICAgICAgICh1cmxQYXJhbWV0ZXIpID0+IHVybFBhcmFtZXRlci4kcmVmXG4gICAgICAgICAgICAgICAgICAgID8gUEFSQU1FVEVSU19NQVAuZ2V0KHVybFBhcmFtZXRlci4kcmVmLnNwbGl0KCcvJykuc2xpY2UoLTEpWzBdKVxuICAgICAgICAgICAgICAgICAgICA6IHVybFBhcmFtZXRlcilcblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiB2YWxpZGF0ZSByZXF1aXJlZCB1cmwgcGFyYW1zXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGxldCB1cmwgPSBlbmRwb2ludFxuICAgICAgICAgICAgZm9yIChjb25zdCBbaSwgdXJsUGFyYW1dIG9mIE9iamVjdC5lbnRyaWVzKHBhcmFtcy5maWx0ZXIocCA9PiBwLmluID09PSAncGF0aCcpKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhcmFtID0gYXJnc1tpXVxuICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSB1cmxQYXJhbS50eXBlLnJlcGxhY2UoJ2ludGVnZXInLCAnbnVtYmVyJylcblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcGFyYW0gIT09IHR5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBFeHBlY3RlZCBwYXJhbWV0ZXIgZm9yIHVybCBwYXJhbSAnJHt1cmxQYXJhbS5uYW1lfScgZnJvbSB0eXBlICcke3R5cGV9JywgZm91bmQgJyR7dHlwZW9mIHBhcmFtfSdgKVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHVybCA9IHVybC5yZXBsYWNlKGB7JHt1cmxQYXJhbS5uYW1lfX1gLCBwYXJhbSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiB2YWxpZGF0ZSByZXF1aXJlZCBvcHRpb25zXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGNvbnN0IGJvZHlNYXAgPSBuZXcgTWFwKClcbiAgICAgICAgICAgIGNvbnN0IG9wdGlvbnMgPSBhcmdzLnNsaWNlKHBhcmFtcy5maWx0ZXIocCA9PiBwLnJlcXVpcmVkKS5sZW5ndGgpWzBdIHx8IHt9XG4gICAgICAgICAgICBmb3IgKGNvbnN0IG9wdGlvblBhcmFtIG9mIHBhcmFtcy5maWx0ZXIocCA9PiBwLmluID09PSAncXVlcnknKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGV4cGVjdGVkVHlwZSA9IG9wdGlvblBhcmFtLnR5cGUucmVwbGFjZSgnaW50ZWdlcicsICdudW1iZXInKVxuICAgICAgICAgICAgICAgIGNvbnN0IG9wdGlvbiA9IG9wdGlvbnNbY2hhbmdlQ2FzZS5jYW1lbENhc2Uob3B0aW9uUGFyYW0ubmFtZSldXG4gICAgICAgICAgICAgICAgY29uc3QgaXNSZXF1aXJlZCA9IEJvb2xlYW4ob3B0aW9uUGFyYW0ucmVxdWlyZWQpIHx8ICh0eXBlb2Ygb3B0aW9uUGFyYW0ucmVxdWlyZWQgPT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiBvcHRpb25QYXJhbS5kZWZhdWx0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAoaXNSZXF1aXJlZCAmJiAoIW9wdGlvbiB8fCB0eXBlb2Ygb3B0aW9uICE9PSBleHBlY3RlZFR5cGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgRXhwZWN0ZWQgcGFyYW1ldGVyIGZvciBvcHRpb24gJyR7b3B0aW9uUGFyYW0ubmFtZX0nIGZyb20gdHlwZSAnJHtleHBlY3RlZFR5cGV9JywgZm91bmQgJyR7dHlwZW9mIG9wdGlvbn0nYClcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAob3B0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHlNYXAuc2V0KG9wdGlvblBhcmFtLm5hbWUsIG9wdGlvbilcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogY29udmVydCBtYXAgaW50byBqc29uIG9iamVjdFxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBjb25zdCBib2R5ID0gWy4uLmJvZHlNYXAuZW50cmllcygpXS5yZWR1Y2UoKGUsIFtrLCB2XSkgPT4ge1xuICAgICAgICAgICAgICAgIGVba10gPSB2XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVcbiAgICAgICAgICAgIH0sIHt9KVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIG1ha2UgcmVxdWVzdFxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gcmVxdWVzdCh7XG4gICAgICAgICAgICAgICAgdXJpOiBgaHR0cHM6Ly8ke2hvc3R9JHt1cmx9YCxcbiAgICAgICAgICAgICAgICBtZXRob2Q6IG1ldGhvZC50b1VwcGVyQ2FzZSgpLFxuICAgICAgICAgICAgICAgIFttZXRob2QgPT09ICdwb3N0JyA/ICdqc29uJyA6ICdxcyddOiBib2R5LFxuICAgICAgICAgICAgICAgIGpzb246IHRydWUsXG4gICAgICAgICAgICAgICAgYXV0aDogdGhpcy5hdXRoXG4gICAgICAgICAgICB9LCAoZXJyLCByZXNwb25zZSwgYm9keSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChlcnIpXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnN0YXR1c0NvZGUgIT09IDIwMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KG5ldyBFcnJvcihib2R5Lm1lc3NhZ2UgfHwgJ3Vua25vd24gZXJyb3InKSlcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzb2x2ZShib2R5KVxuICAgICAgICAgICAgfSkpXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyBkb3dubG9hZEpvYkFzc2V0IChqb2JJZCwgYXNzZXROYW1lLCBkb3dubG9hZFBhdGgpIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIGNoZWNrIGpvYiBpZFxuICAgICAgICAgKi9cbiAgICAgICAgaWYgKHR5cGVvZiBqb2JJZCAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignWW91IG5lZWQgdG8gZGVmaW5lIGEgam9iIGlkJylcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiB0aHJvdyBpZiBhc3NldCBpcyBub3Qga25vd1xuICAgICAgICAgKi9cbiAgICAgICAgaWYgKCFKT0JfQVNTRVRfTkFNRVMuaW5jbHVkZXMoYXNzZXROYW1lKSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmtub3duIGFzc2V0ICcke2Fzc2V0TmFtZX0nLCB0aGUgZm9sbG93aW5nIGFzc2V0cyBhcmUgYXZhaWxhYmxlOiAke0pPQl9BU1NFVF9OQU1FUy5qb2luKCcsICcpfWApXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBobWFjID0gYXdhaXQgY3JlYXRlSE1BQyh0aGlzLnVzZXJuYW1lLCB0aGlzLmFjY2Vzc0tleSwgam9iSWQpXG4gICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICBjb25zdCByZXEgPSByZXF1ZXN0KHtcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdHRVQnLFxuICAgICAgICAgICAgICAgIHVyaTogYGh0dHBzOi8vYXNzZXRzLiR7dGhpcy5ob3N0fS9qb2JzLyR7am9iSWR9LyR7YXNzZXROYW1lfT90cz0ke0RhdGUubm93KCl9JmF1dGg9JHtobWFjfWAsXG4gICAgICAgICAgICB9LCAoZXJyLCByZXMsIGJvZHkpID0+IHtcbiAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgKiBjaGVjayBpZiByZXF1ZXN0IHdhcyBzdWNjZXNzZnVsXG4gICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KGVycilcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgKiBjaGVjayBpZiB3ZSByZWNlaXZlZCB0aGUgYXNzZXRcbiAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICBpZiAocmVzLnN0YXR1c0NvZGUgIT09IDIwMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KG5ldyBFcnJvcihgVGhlcmUgd2FzIGFuIGVycm9yIGRvd25sb2FkaW5nIGFzc2V0ICR7YXNzZXROYW1lfSwgc3RhdHVzIGNvZGU6ICR7cmVzLnN0YXR1c0NvZGV9YCkpXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoYm9keSlcbiAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogb25seSBwaXBlIGFzc2V0IHRvIGZpbGUgaWYgcGF0aCBpcyBnaXZlblxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZiAoZG93bmxvYWRQYXRoKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgZmQgPSBmcy5jcmVhdGVXcml0ZVN0cmVhbShwYXRoLnJlc29sdmUocHJvY2Vzcy5jd2QoKSwgZG93bmxvYWRQYXRoKSlcbiAgICAgICAgICAgICAgICByZXEucGlwZShmZClcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICB9XG59XG4iXX0=
{
"name": "saucelabs",
"version": "2.0.0-beta.5",
"version": "2.0.0-beta.6",
"author": "Dan Jenkins <dan.jenkins@holidayextras.com> (www.dan-jenkins.co.uk)",

@@ -5,0 +5,0 @@ "description": "A wrapper around Sauce Labs REST API",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc