{"name":"saucelabs","version":"7.2.2","author":{"name":"Sauce Labs, Inc."},"description":"A wrapper around Sauce Labs REST API","homepage":"https://github.com/saucelabs/node-saucelabs","license":"Apache-2.0","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","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 test:*","test:lint":"eslint -c ./.eslintrc.js ./src/**/*.js ./tests/**/*.js","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","test:unit":"jest --config ./jest.config.js","test:e2e":"jest e2e --collectCoverage=false --testMatch \"<rootDir>/e2e/**/*.test.js\" --testPathIgnorePatterns \"<rootDir>/tests\"","watch":"npm run compile -- --watch","prepare":"husky install","lint-staged":"lint-staged"},"dependencies":{"change-case":"^4.1.2","download":"^8.0.0","form-data":"^4.0.0","got":"^11.8.2","hash.js":"^1.1.7","query-string":"^7.0.1","tunnel":"^0.0.6","yargs":"^17.2.1"},"devDependencies":{"@babel/cli":"^7.15.7","@babel/core":"^7.15.8","@babel/node":"^7.15.8","@babel/preset-env":"^7.15.8","@babel/register":"^7.15.3","babel-plugin-source-map-support":"^2.1.3","eslint":"^8.15.0","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.26.0","husky":"^7.0.4","jest":"^27.3.0","lint-staged":"^12.4.1","npm-run-all":"^4.1.5","prettier":"^2.6.2","release-it":"^14.11.6","rimraf":"^3.0.2","source-map-support":"^0.5.20","swagger-typescript-codegen":"^3.2.4","typescript":"^4.4.4"},"lint-staged":{"*.js":["eslint --fix","prettier --write"],"*.{json,md,yml,ts}":["prettier --write"]},"prettier":{"bracketSpacing":false,"singleQuote":true},"gitHead":"f840d5909f9c12454718c635e2a562831df59bbe","bugs":{"url":"https://github.com/saucelabs/node-saucelabs/issues"},"_id":"saucelabs@7.2.2","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-rxbazYeKw0RDoXnGCfTeY6or9QM42Nn/LcZyO4Wi11h1d5k7EkoXU58g6FrYZgC7+UtI1t4CZu5Z1a2F/YQzvg==","shasum":"8c5765e8fffaf5b607788598adc7fe2e7d005fed","tarball":"http://registry-npm.ywwl.com/saucelabs/download/saucelabs-7.2.2.tgz","fileCount":38,"unpackedSize":34748708,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfpDBgEeMZxis0CT7D1c3ZL/SWGIPM9KdJl4eKypEDhAiEAlMpk7FA/WuoKhqmDkYEeY4y7clup34/oPP2e/+JJIuA="}],"size":16773134,"noattachment":false,"key":"/saucelabs/-/saucelabs-7.2.2.tgz"},"_npmUser":{"name":"saucebot","email":"devx@saucelabs.com"},"directories":{},"maintainers":[{"name":"boneskull","email":"boneskull@boneskull.com"},{"name":"saucebot","email":"devx@saucelabs.com"},{"name":"diemol","email":"diemol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/saucelabs_7.2.2_1686775955776_0.4517021591408792"},"_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":1686775956141,"_cnpm_publish_time":1686775956141,"dist-tags":{"beta":"2.0.0-beta.10","latest":"9.3.0","orchestrator-experiment":"3.1.1-alpha.7"}}