{"bin":{"replay":"bin/replay.js"},"bugs":{"url":"https://github.com/replayio/replay-cli/issues"},"dist":{"shasum":"07b7622dd1b07b9bb5ae7ee84c89c9c3e9216187","tarball":"https://registry.npmjs.org/@replayio/replay/-/replay-0.12.13-alpha.0.tgz","fileCount":66,"integrity":"sha512-FQSg6vFLM1XLLzhMfwpXrLc8a4B7mzvJQXmERX68XKqu7LC/FiIx9DrIbFQgaHSkx+5VZwTEqqDWM8CduJqlbw==","signatures":[{"sig":"MEUCIQCtvf6uTT9j59l3PTlTpv9xRjdgtusSRoua78c9TcY7IAIgcfJd8+o2rKsPkc9UhElnER+i1KWqW0H/VQ6T/wdGIWw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":427334},"main":"src/main.js","name":"@replayio/replay","author":"","readme":"# @replayio/replay\n\nCLI tool and Node module for managing and uploading [Replay](https://replay.io) recordings and installing Replay Browsers.\n\n## Overview\n\nWhen using the Replay plugins to record automated tests or the Replay version of Node, recordings which are created are saved to disk, by default in `$HOME/.replay`. This package is used to manage these recordings and upload them to the record/replay web service so that they can be viewed.\n\n**Check out the [\"Recording Automated Tests Guide\"](https://docs.replay.io/docs/recording-automated-tests-5bf7d91b65cd46deab1867b07bd12bdf) to get started with recording Cypress or Playwright tests.**\n\n## Installation\n\n`npm i @replayio/replay --global`\n\n## Usage\n\n```bash\nnpx @replayio/replay <command>\n```\n\nPossible commands are given below. These may be used with the `--directory <dir>` option to override the default recording directory, or `--server <address>` to override the default server address. When uploading, an API key is required, which can be passed via `--api-key <key>` or by setting the `RECORD_REPLAY_API_KEY` environment variable.\n\n### ls\n\nView information about all known recordings.\n\nOptions:\n\n- `--all`: Include `uploaded`, `crashUploaded` and `unusable` recordings in the output.\n- `--filter`: Filter the recordings to upload using a [JSONata-compatible filter function](https://docs.jsonata.org/higher-order-functions#filter). If used with `--all`, the filter is applied after including all status values.\n- `--json`: Prints a JSON array with one descriptor element for each recording.\n\nRecording descriptors have the following required properties:\n\n- `id`: ID used to refer to this recording in other commands.\n- `createTime`: Time when the recording was created.\n- `runtime`: Runtime used to create the recording: either `gecko`, `chromium`, or `node`.\n- `metadata`: Any information the runtime associated with this recording. For gecko/chromium recordings this is the URI of the first page loaded, and for node recordings this is the original command line arguments.\n- `status`: Status of the recording, see below for possible values.\n\nThe possible status values for a recording are as follows:\n\n- `onDisk`: The recording was fully written out to disk.\n- `uploaded`: The recording was fully uploaded to the record/replay web service.\n- `startedWrite`: The recording started being written to disk but wasn't finished. Either the recording process is still running, or the recording process was killed and didn't shut down normally.\n- `startedUpload`: The recording started being uploaded but didn't finish.\n- `unusable`: The recording was marked as unusable for some reason, such as a stack overflow occurring.\n- `crashed`: The recording process crashed before finishing.\n- `crashUploaded`: The recording process crashed and the crash data was uploaded to the record/replay web service for analysis.\n\nDepending on the status the recording descriptor can have some of the following additional properties:\n\n- `path`: If the recording started being written to disk (including before being uploaded), the path to the recording file.\n- `server`: If the recording started being uploaded, the address of the server it was uploaded to.\n- `recordingId`: If the recording started being uploaded, the server-assigned ID for this recording which can be used to view it.\n- `unusableReason`: If the recording is unusable, the reason it was marked unusable.\n\n### upload `<id>`\n\nUpload the recording with the given ID to the web service.\n\n### process `<id>`\n\nUpload a recording, and then process it to ensure it can be replayed successfully.\n\n### upload-all\n\nUpload all recordings to the web service which can be uploaded.\n\nOptions:\n\n- `--filter`: Filter the recordings to upload using a [JSONata-compatible filter function](https://docs.jsonata.org/higher-order-functions#filter)\n\n### view `<id>`\n\nView the the given recording in the system's default browser, uploading it first if necessary.\n\n### view-latest\n\nView the most recently created recording in the system's default browser, uploading it first if necessary.\n\n### rm `<id>`\n\nRemove the recording with the given ID and any on disk file for it.\n\n### rm-all\n\nRemove all recordings and on disk recording files.\n\n### update-browsers\n\nUpdates any installed browsers used for recording in automation: [playwright](https://www.npmjs.com/package/@replayio/playwright), [puppeteer](https://www.npmjs.com/package/@replayio/puppeteer), and [cypress](https://www.npmjs.com/package/@replayio/cypress).\n\n### upload-sourcemaps\n\nAllows uploading production sourcemaps to Replay's servers so that they can be used when viewing recordings.\n\nThe CLI command `replay upload-sourcemaps [opts] <paths...>` has the following options:\n\n- `<paths>`: (Required) A set of files or directories to search for generated files and sourcemap files.\n- `--group`: (Required) To allow for tracking and browsing of maps that have been uploaded, we\n  require uploaded names to have an overall group name associated with them.\n  This could for instance be a version number, or commit hash.\n- `--api-key`: The API key to use when connecting to Replay's servers.\n  Defaults to `process.env.RECORD_REPLAY_API_KEY`.\n- `--root`: Set the directory that relative paths should be computed with respect to. The relative path\n  of sourcemaps is included in the uploaded entry, and will be visible in the uploaded-asset UI, so this\n  can be used to strip off unimportant directories in the build path. Defaults to `process.cwd()`.\n- `--ignore`: Provide an ignore pattern for files to ignore when searching for sourcemap-related data.\n  This may be passed multiple times to ignore multiple things.\n- `--quiet`: Tell the CLI to output nothing to stdout. Errors will still log to stderr.\n- `--verbose`: Output additional information about the sourcemap map search.\n- `--dry-run`: Run all of the local processing and searching for maps, but skip uploading them.\n- `--extensions`: The comma-separated set of file extensions to search for sourcemap-related data.\n  Defaults to `\".js,.map\"`.\n\nTo programmatically upload from a node script, use [`@replayio/sourcemap-upload`](https://www.npmjs.com/package/@replayio/sourcemap-upload).\n\n### metadata\n\nSets metadata on local recordings. With no options, this command will add the provided `metadata` to each local recording.\n\n```\n# Sets the provided x-build metadata and attempts to generate the source\n# metadata from relevant environment variables\nreplay metadata --init '{\"x-build\": {\"id\": 1234}}' --keys source --warn\n```\n\nThe CLI command `replay metadata [opts]` has the following options:\n\n- `--init <metadata>`: Initializes the metadata object from the provided JSON-formatted `metadata` string\n- `--keys <space separated metadata key names>`: Initializes known metadata keys by retrieving values from environment variables.\n- `--warn`: Warn instead of exit with an error when metadata cannot be initialized\n- `--filter`: Filter the recordings to which the metadata is applied using a [JSONata-compatible filter function](https://docs.jsonata.org/higher-order-functions#filter)\n\n## Node Module Usage\n\nThis package can be used as a node module to directly access its functionality rather than going through the CLI tool.\n\nInstallation:\n\n```bash\nnpm i @replayio/replay\n```\n\nUsage:\n\n```js\nconst interface = require(\"@replayio/replay\");\n```\n\nThe interface includes the following members. Options objects can include `directory`, `server`, and `apiKey` properties which behave the same as `--directory`, `--server`, and `--api-key` arguments to the CLI tool, and a `verbose` property which can be set to log the same output as the CLI tool. Any of these properties or the options object themselves can be omitted to use default values.\n\n### listAllRecordings(opts)\n\nEquivalent to `replay ls`, returns the JSON object for the recordings.\n\n### uploadRecording(id, opts)\n\nEquivalent to `replay upload <id>`, returns a promise that resolves with a recording ID if the upload succeeded, or null if uploading failed.\n\n### processRecording(id, opts)\n\nEquivalent to `replay process <id>`, returns a promise that resolves with a recording ID if the upload and processing succeeded, or null if either failed.\n\n### uploadAllRecordings(opts)\n\nEquivalent to `replay upload-all`, returns a promise that resolves with whether all uploads succeeded.\n\n### viewRecording(id, opts)\n\nEquivalent to `replay view <id>`, returns a promise that resolves with whether the recording is being viewed.\n\n### viewLatestRecording(opts)\n\nEquivalent to `replay view-latest`, returns a promise that resolves with whether the latest recording is being viewed.\n\n### removeRecording(id, opts)\n\nEquivalent to `replay rm <id>`, returns whether the recording was removed.\n\n### removeAllRecordings(opts)\n\nEquivalent to `replay rm-all`.\n\n### updateBrowsers(opts)\n\nEquivalent to `replay update-browsers`.\n\n## Contributing\n\nContributing guide can be found [here](contributing.md).\n","gitHead":"235217a779283cb4b6482b3894814add0fdc6c28","license":"BSD-3-Clause","scripts":{"test":"jest --ci","build":"rm -rf dist/ && tsc && chmod 755 dist/bin/* && cp package.json README.md dist/","prepare":"npm run if:source -- npm run build","if:exists":"node -e \"require('fs').existsSync(process.argv[1]) ? require('child_process').spawnSync(process.argv[2], process.argv.slice(3), {shell: true, stdio: 'inherit'}) : 0\"","if:source":"npm run if:exists -- src/main.ts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ryanjduffy","email":"ryan@tiqtech.com"},"homepage":"https://github.com/replayio/replay-cli/blob/main/packages/replay/README.md","deprecated":"This package is deprecated. Please use replayio instead.","repository":{"url":"git+https://github.com/replayio/replay-cli.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v18.15.0+arm64 (darwin)","description":"CLI tool for uploading and managing recordings","directories":{},"maintainers":[{"name":"jaril","email":"jarilvalenciano@gmail.com"},{"name":"souporserious","email":"ftntravis@gmail.com"},{"name":"loganfsmyth","email":"loganfsmyth@gmail.com"},{"name":"bhackett1024","email":"bhackett@replay.io"},{"name":"dmiller_replay","email":"dan@replay.io"},{"name":"holger_replay","email":"holger@replay.io"},{"name":"ryanjduffy","email":"ryan@tiqtech.com"},{"name":"jcmorrow","email":"josh@jcmorrow.com"},{"name":"jasonlaster11","email":"jason.laster.11@gmail.com"}],"_nodeVersion":"18.15.0","dependencies":{"ws":"^7.5.0","debug":"^4.3.4","p-map":"^4.0.0","is-uuid":"^1.0.2","jsonata":"^1.8.6","commander":"^7.2.0","node-fetch":"^2.6.8","text-table":"^0.2.0","superstruct":"^0.15.4","@replayio/sourcemap-upload":"^1.0.7"},"publishConfig":{"directory":"dist"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^28.1.3","ts-jest":"^28.0.6","@types/ws":"^8.5.3","typescript":"^4.6.4","@types/jest":"^28.1.5","@types/debug":"^4.1.7","@types/node-fetch":"^2.6.3","@types/text-table":"^0.2.2"},"_npmOperationalInternal":{"tmp":"tmp/replay_0.12.13-alpha.0_1687455180162_0.5154953286075827","host":"s3://npm-registry-packages"},"_id":"@replayio/replay@0.12.13-alpha.0","version":"0.12.13-alpha.0"}