saucelabs
Advanced tools
Comparing version 2.1.9 to 2.2.0
@@ -38,3 +38,3 @@ "use strict"; | ||
/** | ||
* ensure we don't double registet commands | ||
* ensure we don't double register commands | ||
*/ | ||
@@ -41,0 +41,0 @@ |
@@ -191,3 +191,3 @@ "use strict"; | ||
if (response.statusCode !== 200) { | ||
if (response.statusCode !== 200 && response.statusCode !== 204) { | ||
const reason = (0, _utils.getErrorReason)(body); | ||
@@ -194,0 +194,0 @@ return reject(new Error(`Failed calling ${propName}, status code: ${response.statusCode}, reason: ${reason}`)); |
@@ -0,1 +1,5 @@ | ||
import SauceLabs from 'saucelabs'; | ||
console.log('hello'); | ||
// , | ||
@@ -2,0 +6,0 @@ // "post": { |
{ | ||
"name": "saucelabs", | ||
"version": "2.1.9", | ||
"version": "2.2.0", | ||
"author": "Christian Bromann <christian@saucelabs.com>", | ||
@@ -20,2 +20,3 @@ "description": "A wrapper around Sauce Labs REST API", | ||
}, | ||
"typings": "./build/index.d.ts", | ||
"scripts": { | ||
@@ -27,3 +28,4 @@ "build": "run-s clean compile", | ||
"generate:docs": "babel-node ./scripts/generate-docs", | ||
"prepublishOnly": "NODE_ENV=production run-s build", | ||
"generate:typings": "babel-node ./scripts/generate-typings", | ||
"prepublishOnly": "NODE_ENV=production run-s build generate:typings", | ||
"release": "npm run release:patch", | ||
@@ -65,3 +67,4 @@ "release:patch": "np patch", | ||
"rimraf": "^2.6.2", | ||
"source-map-support": "^0.5.9" | ||
"source-map-support": "^0.5.9", | ||
"swagger-typescript-codegen": "^1.10.0" | ||
}, | ||
@@ -68,0 +71,0 @@ "jest": { |
@@ -86,3 +86,3 @@ <p align="center"> | ||
The following example shows how to access details of the last job you were running with your account that is being exposed as environment variables as `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY`. | ||
The following example shows how to access details of the last job you were running with your account that is being exposed as environment variables as `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY`. Alternatively you can pass the credentials via `options` to the constructor: | ||
@@ -96,5 +96,7 @@ ```js | ||
const myAccount = new SauceLabs(); | ||
// using constructor options | ||
// const myAccount = new SauceLabs({ user: "YOUR-USER", key: "YOUR-ACCESS-KEY"}); | ||
// get job details of last run job | ||
const job = await user.listJobs( | ||
const job = await myAccount.listJobs( | ||
process.env.SAUCE_USERNAME, | ||
@@ -142,2 +144,39 @@ { limit: 1, full: true } | ||
> You may wonder why `listJobs` requires a `username` as first parameter since you've already defined the process.env. The reason for this is that Sauce Labs supports a concept of Team Accounts, so-called sub-accounts, grouped together. As such functions like the mentioned could list jobs not only for the requesting account, but also for the individual team account. Learn more about it [here](https://wiki.saucelabs.com/display/DOCS/Managing+Team+Members+and+Accounts) | ||
## Breaking changes from v1 to v2 | ||
Public APIs have changed from v1 to v2. Methods in v1 accepted a `callback` trailing parameter which is no more available with v2, instead all methods now return a Promise which can be `awaited` or `then`'d. | ||
Below, you can find the list of the mapped method names: | ||
| v1 | v2 | | ||
|----|----| | ||
| getAccountDetails(callback) | async getUser(username) | | ||
| getAccountLimits(callback) | ? | | ||
| getUserActivity(callback) | async getUserActivity(username) | | ||
| getUserConcurrency(callback) | async getUserConcurrency(username) | | ||
| getAccountUsage(start, end, callback) | ? | | ||
| getJobs(callback) | async listJobs(username, { ...options }) // with option: full: true | | ||
| showJob(id, callback) | async getJob(username, id) | | ||
| showJobAssets(id, callback) | ? | | ||
| updateJob(id, data, callback) | async updateJob(username, id, body) | | ||
| stopJob(id, data, callback) | async stopJob(username, id) | | ||
| deleteJob(id, callback) | ? | | ||
| getActiveTunnels(callback) | async listAvailableTunnels(username) | | ||
| getTunnel(id, callback) | async getTunnel(username, id) | | ||
| deleteTunnel(id, callback) | async deleteTunnel(username, id) | | ||
| getServiceStatus(callback) |async getStatus() | | ||
| getBrowsers(callback) | ? | | ||
| getAllBrowsers(callback) | ? | | ||
| getSeleniumBrowsers(callback) | ? | | ||
| getWebDriverBrowsers(callback) | ? | | ||
| getTestCounter(callback) | ? | | ||
| updateSubAccount(data, callback) | ? | | ||
| deleteSubAccount(callback) | ? | | ||
| createSubAccount(data, callback) | ? | | ||
| createPublicLink(id, date, useHour, callback) | ? | | ||
| getSubAccountList(callback) | ? | | ||
| getSubAccounts(callback) | ? | | ||
## Test | ||
@@ -144,0 +183,0 @@ |
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
278733
23
8225
194
23