{"name":"saucelabs","version":"4.7.7","author":{"name":"Christian Bromann","email":"christian@saucelabs.com"},"description":"A wrapper around Sauce Labs REST API","homepage":"https://github.com/saucelabs/node-saucelabs","license":"Apache-2.0","contributors":[{"name":"wswebcreation","email":"wim@wswebcreation","url":"http://www.wswebcreation"},{"name":"christian-bromann","email":"christian@saucelabs.com"}],"repository":{"type":"git","url":"git://github.com/saucelabs/node-saucelabs.git"},"main":"./build/index","bin":{"sl":"bin/sl"},"typings":"./build/index.d.ts","scripts":{"build":"run-s clean compile generate:typings","clean":"rm -rf ./build ./coverage","compile":"babel src -d build","eslint":"eslint -c ./.eslintrc.js ./src/**/*.js ./tests/**/*.js","generate:docs":"babel-node ./scripts/generate-docs","generate:typings":"babel-node ./scripts/generate-typings","prepublishOnly":"NODE_ENV=production run-s build generate:typings","release":"release-it --github.release","release:ci":"npm run release -- --ci --npm.skipChecks --no-git.requireCleanWorkingDir","release:patch":"npm run release -- patch","release:minor":"npm run release -- minor","release:major":"npm run release -- major","test":"run-s build eslint test:typings test:unit","test:unit":"jest --coverage","test:typings":"run-s test:typings:*","test:typings:setup":"mkdir -p ./tests/typings/node_modules/saucelabs && cp ./package.json ./tests/typings/node_modules/saucelabs && cp -r ./build ./tests/typings/node_modules/saucelabs","test:typings:run":"cd ./tests/typings && tsc --incremental","test:typings:cleanup":"rm -r ./tests/typings/node_modules","watch":"npm run compile -- --watch"},"dependencies":{"bin-wrapper":"^4.1.0","change-case":"^4.1.1","form-data":"^3.0.0","got":"^11.7.0","hash.js":"^1.1.7","tunnel":"0.0.6","yargs":"^16.0.3"},"devDependencies":{"@babel/cli":"^7.12.0","@babel/core":"^7.12.0","@babel/node":"^7.10.5","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-export-default-from":"^7.10.4","@babel/plugin-proposal-function-bind":"^7.11.5","@babel/plugin-proposal-optional-catch-binding":"^7.10.4","@babel/plugin-syntax-export-default-from":"^7.10.4","@babel/preset-env":"^7.12.0","@babel/register":"^7.12.0","babel-core":"^6.26.3","babel-eslint":"^10.1.0","babel-jest":"^26.5.2","babel-plugin-source-map-support":"^2.1.3","codecov":"^3.8.0","eslint":"^6.8.0","eslint-plugin-import":"^2.22.1","jest":"^25.5.4","npm-run-all":"^4.1.5","prettier":"2.0.5","release-it":"^14.2.2","rimraf":"^3.0.2","source-map-support":"^0.5.19","swagger-typescript-codegen":"^3.2.1","typescript":"^4.0.3"},"jest":{"testMatch":["<rootDir>/tests/**/*.test.js"],"coverageDirectory":"./coverage/","collectCoverage":true,"coverageThreshold":{"global":{"branches":93,"functions":100,"lines":98,"statements":98}},"testEnvironment":"node"},"gitHead":"c893c0551f48d7b3b0e86778364cdb2e91e4be81","bugs":{"url":"https://github.com/saucelabs/node-saucelabs/issues"},"_id":"saucelabs@4.7.7","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-VzI5pAp1WAZZSfFME9cl0rv71RLTaDRoU8Qj71ghQgNLjEtl9q/JkwrOqrwJZdYCMF/Uw7R8v39jZOmgDZkGYA==","shasum":"a73578714e0e71a52e01311b62f7be80d3a60df5","tarball":"http://registry-npm.ywwl.com/saucelabs/download/saucelabs-4.7.7.tgz","fileCount":22,"unpackedSize":445636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgr2rbCRA9TVsSAnZWagAAT9IP/2A4dXZGQNOE6lAbg/lD\nMwT7X0jfL1o8WbWRwvSV/PSg2wocZyFLaxXnJ2J+U3GBv7z+oWJ3+V/f5BND\nPWkB1Xr2EiZVTEsTh3nF/kPD1irr8W9VwrMXTOaHmthiKtvioX5BL++zIldU\nAY0N5Oe30gY+d3fLnj3iMFi4zbJncRBabRpDlCtCWS2f3hXDrm27qpRUPmKw\nstt+BgwAQwiISntM7zZLONkGZihj9C/k+t1qajZoXaftReDO3LYFcxvvyDqS\n6Mc7UgcErwNQbSKS9l8m6NR5BSw7vEYXsokWriYPWKgebMxywLZ7MsvJ37Li\n3a40+6rqKLbbz9YCTWPYeM+of5gZAAI6Z181fAftWRttfvJE4X99ZabuVHKQ\n4b0BULrF7vO2Fh2ejiB/DqjOcecAclj1IORbaCiFyLI92CQdKtMAt9v1sP/X\nQ1V7fuMyXFNVvSJruDOUZ5HJQTul28MggonQcSOP7rA3M+D/acgkU0f7/jMT\ne7zRaR1z0aC76ytBN4cKP4XIIwN/7OVNOFtbzSp5+I6vL4bodMmnlw0e6sMe\nMph+FxSF1w/vtKgoP9o/rnyz2qokorKDJa7ldj4x0KZartonbxVv7pm/9tab\nbeXyTQ5k58FZFRTqeKAc1WZDm9Cn0AaplicbWnx7mvXLXqv7nQJKAwx74Tg8\nRPdQ\r\n=YjVQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkWRueJuHMbK+bi4d+L6Do/5g9HoUZI2FhlN1iTY3+lAiEAu9nK3lEB6u0s+x1ymBWFX5w4sgoMo5v37JkbEakpiDM="}],"size":69659,"noattachment":false,"key":"/saucelabs/-/saucelabs-4.7.7.tgz"},"_npmUser":{"name":"saucebot","email":"dev@saucelabs.com"},"directories":{},"maintainers":[{"name":"christian-bromann","email":"christian@saucelabs.com"},{"name":"saucebot","email":"dev@saucelabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/saucelabs_4.7.7_1622108890425_0.046502177771029496"},"_hasShrinkwrap":false,"readme":"# Node Sauce Labs [![Test Changes](https://github.com/saucelabs/node-saucelabs/actions/workflows/test.yml/badge.svg)](https://github.com/saucelabs/node-saucelabs/actions/workflows/test.yml)\n\nWrapper around all Sauce Labs REST APIs for [Node.js](http://nodejs.org/) (v14 or higher) including support for\n[Sauce Connect Proxy](https://docs.saucelabs.com/secure-connections/sauce-connect/) and TypeScript definitions.\n\n## Install\n\nTo install the package run:\n\n```sh\nnpm install saucelabs\n```\n\n## Options\n\n### user\n\nYour Sauce Labs username.\n\nType: `string`\nDefault: `process.env.SAUCE_USERNAME`\n\n### key\n\nYour Sauce Labs access key.\n\nType: `string`\nDefault: `process.env.SAUCE_ACCESS_KEY`\n\n### region\n\nYour Sauce Labs datacenter region. The following regions are available:\n\n- `us-west-1` (short `us`)\n- `eu-central-1` (short `eu`)\n\nType: `string`\nDefault: `us`\n\n### proxy\n\nIf you want to tunnel your API request through a proxy please provide your proxy URL.\n\nType: `string`\nDefault: `null`\n\n### headers\n\nIf you want to set request headers, as example {'User-Agent': 'node-saucelabs'}\n\nType: `object`<br>\nDefault: `{'User-Agent': 'saucelabs/<VERSION> (nodejs <PLATFORM>)'}`\n\n## Usage\n\nAll accessible API commands with descriptions can be found [here](docs/interface.md).\n\n### As CLI Tool\n\nThis package if installed globally can be used as CLI tool to access the API from the command line:\n\n```sh\n$ npm install -g saucelabs\n...\n$ sl listJobs $SAUCE_USERNAME --limit 5 --region eu\n{ jobs:\n   [ { id: '19dab74f8fd848518f8d2c2cee3a6fbd' },\n     { id: 'dc08ca0c7fa14eee909a093d11567328' },\n     { id: '5bc6f70c777b4ae3bf7909a40f5ee41b' },\n     { id: 'f40fe7b044754eaaa5f5a130406549b5' },\n     { id: 'd1553f71f910402893f1e82a4dcb6ca6' } ] }\n```\n\nYou can find all available commands and options with description by calling:\n\n```sh\n$ sl --help\n# show description for specific command\n$ sl listJobs --help\n```\n\nor update the job status by calling:\n\n```sh\n$ sl updateJob cb-onboarding 690c5877710c422d8be4c622b40c747f \"{\\\"passed\\\":false}\"\n```\n\nor download a job asset:\n\n```sh\n$ sl downloadJobAsset 690c5877710c422d8be4c622b40c747f video.mp4 --filepath ./video.mp4\n```\n\nor upload a job asset:\n\n```sh\n$ sl uploadJobAssets 690c5877710c422d8be4c622b40c747f --files ./video.mp4 --files ./log.json\n```\n\nor start Sauce Connect Proxy in EU datacenter:\n\n```sh\n# start Sauce Connect tunnel for eu-central-1 region\n$ sl sc --region eu --tunnel-name \"my-tunnel\"\n# run a specific Sauce Connect version\n$ sl sc --scVersion 4.5.4\n# see all available Sauce Connect parameters via:\n$ sl sc --help\n```\n\nYou can see all available Sauce Connect parameters on the [Sauce Labs Docs](https://docs.saucelabs.com/dev/cli/sauce-connect-proxy/).\n\n### As NPM Package\n\nThe 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:\n\n```js\nimport SauceLabs from 'saucelabs';\n// if imports are not supported by your Node.js version, import the package as follows:\n// const SauceLabs = require('saucelabs').default;\n\n(async () => {\n  const myAccount = new SauceLabs();\n  // using constructor options\n  // const myAccount = new SauceLabs({ user: \"YOUR-USER\", key: \"YOUR-ACCESS-KEY\"});\n\n  // get full webdriver url from the client depending on region:\n  console.log(myAccount.webdriverEndpoint); // outputs \"https://ondemand.us-west-1.saucelabs.com/\"\n\n  // get job details of last run job\n  const jobs = await myAccount.listJobs(process.env.SAUCE_USERNAME, {\n    limit: 1,\n    full: true,\n  });\n\n  console.log(jobs);\n  /**\n     * outputs:\n     * { jobs:\n        [ { browser_short_version: '72',\n            video_url:\n             'https://assets.saucelabs.com/jobs/dc08ca0c7fa14eee909a093d11567328/video.flv',\n            creation_time: 1551711453,\n            'custom-data': null,\n            browser_version: '72.0.3626.81',\n            owner: '<username-redacted>',\n            id: 'dc08ca0c7fa14eee909a093d11567328',\n            record_screenshots: true,\n            record_video: true,\n            build: null,\n            passed: null,\n            public: 'team',\n            end_time: 1551711471,\n            status: 'complete',\n            log_url:\n             'https://assets.saucelabs.com/jobs/dc08ca0c7fa14eee909a093d11567328/selenium-server.log',\n            start_time: 1551711454,\n            proxied: false,\n            modification_time: 1551711471,\n            tags: [],\n            name: null,\n            commands_not_successful: 1,\n            consolidated_status: 'complete',\n            manual: false,\n            assigned_tunnel_id: null,\n            error: null,\n            os: 'Windows 2008',\n            breakpointed: null,\n            browser: 'googlechrome' } ] }\n     */\n\n  /**\n   * start Sauce Connect Proxy\n   */\n  const sc = await myAccount.startSauceConnect({\n    /**\n     * you can pass in a `logger` method to print Sauce Connect log messages\n     */\n    logger: (stdout) => console.log(stdout),\n    /**\n     * see all available parameters here: https://docs.saucelabs.com/dev/cli/sauce-connect-proxy/\n     * all parameters have to be applied camel cased instead of with hyphens, e.g.\n     * to apply the `--tunnel-name` parameter, set:\n     */\n    tunnelName: 'my-tunnel',\n  });\n\n  // run a test\n  // ...\n\n  // close Sauce Connect\n  await sc.close();\n\n  // upload additional log files and attach it to your Sauce job\n  await myAccount.uploadJobAssets('76e693dbe6ff4910abb0bc3d752a971e', [\n    // either pass in file names\n    './logs/video.mp4',\n    './logs/log.json',\n    // or file objects\n    {\n      filename: 'myCustomLogFile.json',\n      data: {\n        someLog: 'data',\n      },\n    },\n  ]);\n})();\n```\n\n> 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://docs.saucelabs.com/basics/acct-team-mgmt-hub/)\n\n### `webdriverEndpoint` property\n\nYou can use the `webdriverEndpoint` property of the client to get the full WebDriver endpoint to connect to Sauce Labs, e.g.:\n\n```js\nconst myAccount = new SauceLabs({\n  user: 'YOUR-USER',\n  key: 'YOUR-ACCESS-KEY',\n  region: 'eu', // run in EU datacenter\n});\n\n// get full webdriver url from the client depending on `region` option:\nconsole.log(myAccount.webdriverEndpoint);\n// outputs: \"https://ondemand.eu-central-1.saucelabs.com/\"\n```\n\n## Contributors\n\nThis module was originally created by [Dan Jenkins](https://github.com/danjenkins) with the help of multiple contributors ([Daniel Perez Alvarez](https://github.com/unindented), [Mathieu Sabourin](https://github.com/OniOni), [Michael J Feher](https://github.com/PhearZero), and many more). We would like to thank Dan and all contributors for their support and this beautiful module.\n\n## License\n\nCopyright 2012 Sauce Labs, Inc. Licensed Apache-2.0\n","publish_time":1622108890681,"_cnpm_publish_time":1622108890681,"dist-tags":{"beta":"2.0.0-beta.10","latest":"9.3.0","orchestrator-experiment":"3.1.1-alpha.7"}}