{"name":"saucelabs","version":"9.1.0","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","compressing":"^1.10.5","form-data":"^4.0.6","got":"^11.8.6","hash.js":"^1.1.7","query-string":"^7.1.3","tunnel":"^0.0.6","yargs":"^17.7.3"},"devDependencies":{"@babel/cli":"^7.22.10","@babel/core":"^7.22.15","@babel/node":"^7.22.10","@babel/preset-env":"^7.22.15","@babel/register":"^7.15.3","babel-plugin-source-map-support":"^2.2.0","eslint":"^8.48.0","eslint-config-prettier":"^9.1.2","eslint-plugin-import":"^2.32.0","husky":"^9.1.7","jest":"^29.6.4","lint-staged":"^15.5.2","npm-run-all":"^4.1.5","prettier":"^2.6.2","release-it":"^16.3.0","rimraf":"^5.0.10","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":"9bc3a88592fb207c21d71c513afd926f2a4af16e","_id":"saucelabs@9.1.0","bugs":{"url":"https://github.com/saucelabs/node-saucelabs/issues"},"_nodeVersion":"22.23.1","_npmVersion":"12.0.1","dist":{"integrity":"sha512-jTCCaklEhcC85AnU1cKlaPc8bpM+Qm+NUF4FlGDee3FC8K1LTFUw27IEAH0EDoxLoDiy5Rezhel/YhyuyZMdgQ==","shasum":"db87ae00e4418721c0c4da421a9011137b90b81f","tarball":"http://registry-npm.ywwl.com/saucelabs/download/saucelabs-9.1.0.tgz","fileCount":21,"unpackedSize":266052,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/saucelabs@9.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDwTKUUlc5XkyYZ3atxA1AiFgsgLM9k2LF+QH3d+Eca7AiAJZJY3rzATyDjjLjSlbP0oFqZvbaIP+VpoR/NACTx5sQ=="}],"size":47331,"noattachment":false,"key":"/saucelabs/-/saucelabs-9.1.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b797eaac-e6e5-4489-b853-c7aae34e10b8"}},"directories":{},"maintainers":[{"name":"diego.molina","email":"diego.molina@saucelabs.com"},{"name":"saucebot","email":"devx@saucelabs.com"},{"name":"diemol","email":"diemol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/saucelabs_9.1.0_1784882012988_0.8361832284252693"},"_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/) (v18 or higher) including support for\n[Sauce Connect Proxy](https://docs.saucelabs.com/secure-connections/sauce-connect-5/) 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- `us-east-4` (real mobile devices only)\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 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 5.2.2\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-5/run/).\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-5/run/\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  tunnelName: 'my-tunnel',\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":1784882013135,"_cnpm_publish_time":1784882013135,"dist-tags":{"beta":"2.0.0-beta.10","latest":"9.3.0","orchestrator-experiment":"3.1.1-alpha.7"}}