@sentry/cli
Advanced tools
+123
| /** | ||
| * The javascript type of a command line option. | ||
| */ | ||
| export type OptionType = "array" | "string" | "boolean" | "inverted-boolean"; | ||
| /** | ||
| * Schema definition of a command line option. | ||
| */ | ||
| export type OptionSchema = { | ||
| /** | ||
| * The flag of the command line option including dashes. | ||
| */ | ||
| param: string; | ||
| /** | ||
| * The value type of the command line option. | ||
| */ | ||
| type: OptionType; | ||
| /** | ||
| * The flag of the command line option including dashes (optional). | ||
| */ | ||
| invertedParam?: string; | ||
| }; | ||
| /** | ||
| * Schema definition for a command. | ||
| */ | ||
| export type OptionsSchema = { | ||
| [x: string]: OptionSchema; | ||
| }; | ||
| /** | ||
| * Runs `sentry-cli` with the given command line arguments. | ||
| * | ||
| * Use {@link prepareCommand} to specify the command and add arguments for command- | ||
| * specific options. For top-level options, use {@link serializeOptions} directly. | ||
| * | ||
| * The returned promise resolves with the standard output of the command invocation | ||
| * including all newlines. In order to parse this output, be sure to trim the output | ||
| * first. | ||
| * | ||
| * If the command failed to execute, the Promise rejects with the error returned by the | ||
| * CLI. This error includes a `code` property with the process exit status. | ||
| * | ||
| * @example | ||
| * const output = await execute(['--version']); | ||
| * expect(output.trim()).toBe('sentry-cli x.y.z'); | ||
| * | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * @param {boolean} silent Disable stdout for silents build (CI/Webpack Stats, ...) | ||
| * @param {string} [configFile] Relative or absolute path to the configuration file. | ||
| * @param {import('./index').SentryCliOptions} [config] More configuration to pass to the CLI | ||
| * @returns {Promise<string>} A promise that resolves to the standard output. | ||
| */ | ||
| export function execute(args: string[], live: boolean | "rejectOnError", silent: boolean, configFile?: string, config?: import("./index").SentryCliOptions): Promise<string>; | ||
| /** | ||
| * Returns the absolute path to the `sentry-cli` binary. | ||
| * @returns {string} | ||
| */ | ||
| export function getPath(): string; | ||
| export function getProjectFlagsFromOptions({ projects }?: { | ||
| projects?: any[]; | ||
| }): any; | ||
| /** | ||
| * Overrides the default binary path with a mock value, useful for testing. | ||
| * | ||
| * @param {string} mockPath The new path to the mock sentry-cli binary | ||
| * @deprecated This was used in tests internally and will be removed in the next major version. | ||
| */ | ||
| export function mockBinaryPath(mockPath: string): void; | ||
| /** | ||
| * Serializes the command and its options into an arguments array. | ||
| * | ||
| * @param {string[]} command The literal name of the command. | ||
| * @param {OptionsSchema} [schema] An options schema required by the command. | ||
| * @param {object} [options] An options object according to the schema. | ||
| * @returns {string[]} An arguments array that can be passed via command line. | ||
| */ | ||
| export function prepareCommand(command: string[], schema?: OptionsSchema, options?: object): string[]; | ||
| /** | ||
| * The javascript type of a command line option. | ||
| * @typedef {'array'|'string'|'boolean'|'inverted-boolean'} OptionType | ||
| */ | ||
| /** | ||
| * Schema definition of a command line option. | ||
| * @typedef {object} OptionSchema | ||
| * @prop {string} param The flag of the command line option including dashes. | ||
| * @prop {OptionType} type The value type of the command line option. | ||
| * @prop {string} [invertedParam] The flag of the command line option including dashes (optional). | ||
| */ | ||
| /** | ||
| * Schema definition for a command. | ||
| * @typedef {Object.<string, OptionSchema>} OptionsSchema | ||
| */ | ||
| /** | ||
| * Serializes command line options into an arguments array. | ||
| * | ||
| * @param {OptionsSchema} schema An options schema required by the command. | ||
| * @param {object} options An options object according to the schema. | ||
| * @returns {string[]} An arguments array that can be passed via command line. | ||
| */ | ||
| export function serializeOptions(schema: OptionsSchema, options: object): string[]; | ||
| export function getDistributionForThisPlatform(): { | ||
| packageName: string; | ||
| subpath: string; | ||
| }; | ||
| /** | ||
| * Throws an error with a message stating that Sentry CLI doesn't support the current platform. | ||
| * | ||
| * @returns {never} nothing. It throws. | ||
| */ | ||
| export function throwUnsupportedPlatformError(): never; | ||
| /** | ||
| * This convoluted function resolves the path to the manually downloaded fallback | ||
| * `sentry-cli` binary in a way that can't be analysed by @vercel/nft. | ||
| * | ||
| * Without this, the binary can be detected as an asset and included by bundlers | ||
| * that use @vercel/nft. | ||
| * | ||
| * @returns {string} The path to the sentry-cli binary | ||
| */ | ||
| export function getFallbackBinaryPath(): string; |
| export = Logger; | ||
| declare class Logger { | ||
| constructor(stream: any); | ||
| stream: any; | ||
| log(...args: any[]): void; | ||
| } |
| export = Releases; | ||
| /** | ||
| * @typedef {import('../types').SentryCliUploadSourceMapsOptions} SentryCliUploadSourceMapsOptions | ||
| * @typedef {import('../types').SourceMapsPathDescriptor} SourceMapsPathDescriptor | ||
| * @typedef {import('../types').SentryCliNewDeployOptions} SentryCliNewDeployOptions | ||
| * @typedef {import('../types').SentryCliCommitsOptions} SentryCliCommitsOptions | ||
| */ | ||
| /** | ||
| * Manages releases and release artifacts on Sentry. | ||
| * @namespace SentryReleases | ||
| */ | ||
| declare class Releases { | ||
| /** | ||
| * Creates a new `Releases` instance. | ||
| * | ||
| * @param {Object} [options] More options to pass to the CLI | ||
| */ | ||
| constructor(options?: any); | ||
| options: any; | ||
| configFile: any; | ||
| /** | ||
| * Registers a new release with sentry. | ||
| * | ||
| * The given release name should be unique and deterministic. It can later be used to | ||
| * upload artifacts, such as source maps. | ||
| * | ||
| * @param {string} release Unique name of the new release. | ||
| * @param {{projects?: string[]}} [options] The list of project slugs for a release. | ||
| * @returns {Promise<string>} A promise that resolves when the release has been created. | ||
| * @memberof SentryReleases | ||
| */ | ||
| "new"(release: string, options?: { | ||
| projects?: string[]; | ||
| }): Promise<string>; | ||
| /** | ||
| * Specifies the set of commits covered in this release. | ||
| * | ||
| * @param {string} release Unique name of the release | ||
| * @param {SentryCliCommitsOptions} options A set of options to configure the commits to include | ||
| * @returns {Promise<string>} A promise that resolves when the commits have been associated | ||
| * @memberof SentryReleases | ||
| */ | ||
| setCommits(release: string, options: SentryCliCommitsOptions): Promise<string>; | ||
| /** | ||
| * Marks this release as complete. This should be called once all artifacts has been | ||
| * uploaded. | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @returns {Promise<string>} A promise that resolves when the release has been finalized. | ||
| * @memberof SentryReleases | ||
| */ | ||
| finalize(release: string): Promise<string>; | ||
| /** | ||
| * Creates a unique, deterministic version identifier based on the project type and | ||
| * source files. This identifier can be used as release name. | ||
| * | ||
| * @returns {Promise<string>} A promise that resolves to the version string. | ||
| * @memberof SentryReleases | ||
| */ | ||
| proposeVersion(): Promise<string>; | ||
| /** | ||
| * Scans the given include folders for JavaScript source maps and uploads them to the | ||
| * specified release for processing. | ||
| * | ||
| * The options require an `include` array, which is a list of directories to scan. | ||
| * Additionally, it supports to ignore certain files, validate and preprocess source | ||
| * maps and define a URL prefix. | ||
| * | ||
| * @example | ||
| * await cli.releases.uploadSourceMaps(cli.releases.proposeVersion(), { | ||
| * // required options: | ||
| * include: ['build'], | ||
| * | ||
| * // default options: | ||
| * ignore: ['node_modules'], // globs for files to ignore | ||
| * ignoreFile: null, // path to a file with ignore rules | ||
| * rewrite: false, // preprocess sourcemaps before uploading | ||
| * sourceMapReference: true, // add a source map reference to source files | ||
| * dedupe: true, // deduplicate already uploaded files | ||
| * stripPrefix: [], // remove certain prefixes from filenames | ||
| * stripCommonPrefix: false, // guess common prefixes to remove from filenames | ||
| * validate: false, // validate source maps and cancel the upload on error | ||
| * urlPrefix: '', // add a prefix source map urls after stripping them | ||
| * urlSuffix: '', // add a suffix source map urls after stripping them | ||
| * ext: ['js', 'map', 'jsbundle', 'bundle'], // override file extensions to scan for | ||
| * projects: ['node'], // provide a list of projects | ||
| * decompress: false // decompress gzip files before uploading | ||
| * live: true // whether to inherit stdio to display `sentry-cli` output directly. | ||
| * }); | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {SentryCliUploadSourceMapsOptions & {live?: boolean | 'rejectOnError'}} options Options to configure the source map upload. | ||
| * @returns {Promise<string[]>} A promise that resolves when the upload has completed successfully. | ||
| * @memberof SentryReleases | ||
| */ | ||
| uploadSourceMaps(release: string, options: SentryCliUploadSourceMapsOptions & { | ||
| live?: boolean | "rejectOnError"; | ||
| }): Promise<string[]>; | ||
| /** | ||
| * List all deploys for a given release. | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @returns {Promise<string>} A promise that resolves when the list comes back from the server. | ||
| * @memberof SentryReleases | ||
| */ | ||
| listDeploys(release: string): Promise<string>; | ||
| /** | ||
| * Creates a new release deployment. This should be called after the release has been | ||
| * finalized, while deploying on a given environment. | ||
| * | ||
| * @example | ||
| * await cli.releases.newDeploy(cli.releases.proposeVersion(), { | ||
| * // required options: | ||
| * env: 'production', // environment for this release. Values that make sense here would be 'production' or 'staging' | ||
| * | ||
| * // optional options: | ||
| * started: 42, // unix timestamp when the deployment started | ||
| * finished: 1337, // unix timestamp when the deployment finished | ||
| * time: 1295, // deployment duration in seconds. This can be specified alternatively to `started` and `finished` | ||
| * name: 'PickleRick', // human readable name for this deployment | ||
| * url: 'https://example.com', // URL that points to the deployment | ||
| * }); | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {SentryCliNewDeployOptions} options Options to configure the new release deploy. | ||
| * @returns {Promise<string>} A promise that resolves when the deploy has been created. | ||
| * @memberof SentryReleases | ||
| */ | ||
| newDeploy(release: string, options: SentryCliNewDeployOptions): Promise<string>; | ||
| /** | ||
| * See {helper.execute} docs. | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * @returns {Promise<string>} A promise that resolves to the standard output. | ||
| */ | ||
| execute(args: string[], live: boolean | "rejectOnError"): Promise<string>; | ||
| } | ||
| declare namespace Releases { | ||
| export { SentryCliUploadSourceMapsOptions, SourceMapsPathDescriptor, SentryCliNewDeployOptions, SentryCliCommitsOptions }; | ||
| } | ||
| type SentryCliUploadSourceMapsOptions = import("../types").SentryCliUploadSourceMapsOptions; | ||
| type SourceMapsPathDescriptor = import("../types").SourceMapsPathDescriptor; | ||
| type SentryCliNewDeployOptions = import("../types").SentryCliNewDeployOptions; | ||
| type SentryCliCommitsOptions = import("../types").SentryCliCommitsOptions; |
| declare const _exports: import("../../helper").OptionsSchema; | ||
| export = _exports; |
| declare const _exports: import("../../helper").OptionsSchema; | ||
| export = _exports; |
+230
| /** | ||
| * TypeScript type definitions for @sentry/cli | ||
| */ | ||
| /** | ||
| * Options for configuring the Sentry CLI | ||
| */ | ||
| export interface SentryCliOptions { | ||
| /** | ||
| * The URL of the Sentry instance you are connecting to. Defaults to https://sentry.io/. | ||
| * This value will update `SENTRY_URL` env variable. | ||
| */ | ||
| url?: string; | ||
| /** | ||
| * Authentication token for HTTP requests to Sentry. | ||
| * This value will update `SENTRY_AUTH_TOKEN` env variable. | ||
| */ | ||
| authToken?: string; | ||
| /** | ||
| * API key to authenticate any HTTP requests to Sentry (legacy authentication method). | ||
| * This value will update `SENTRY_API_KEY` env variable. | ||
| * @deprecated Use auth-token-based authentication via `authToken` instead. | ||
| * This option is scheduled for removal in the next major release. | ||
| */ | ||
| apiKey?: string; | ||
| /** | ||
| * Sentry DSN. | ||
| * This value will update `SENTRY_DSN` env variable. | ||
| */ | ||
| dsn?: string; | ||
| /** | ||
| * Organization slug. | ||
| * This value will update `SENTRY_ORG` env variable. | ||
| */ | ||
| org?: string; | ||
| /** | ||
| * Project slug. | ||
| * This value will update `SENTRY_PROJECT` env variable. | ||
| */ | ||
| project?: string; | ||
| /** | ||
| * Version control system remote name. | ||
| * This value will update `SENTRY_VCS_REMOTE` env variable. | ||
| */ | ||
| vcsRemote?: string; | ||
| /** | ||
| * If true, all logs are suppressed. | ||
| */ | ||
| silent?: boolean; | ||
| /** | ||
| * A header added to every outgoing network request. | ||
| * This value will update `CUSTOM_HEADER` env variable. | ||
| */ | ||
| customHeader?: string; | ||
| /** | ||
| * Headers added to every outgoing network request. | ||
| * This value does not set any env variable, and is overridden by `customHeader`. | ||
| */ | ||
| headers?: Record<string, string>; | ||
| } | ||
| /** | ||
| * Custom upload-sourcemaps options for a particular `include` path. In this | ||
| * case `paths` takes the place of `include` in the options so as to make it | ||
| * clear that this is not recursive. | ||
| */ | ||
| export type SourceMapsPathDescriptor = Omit<SentryCliUploadSourceMapsOptions, 'include'> & { | ||
| paths: string[]; | ||
| }; | ||
| /** | ||
| * Options for uploading source maps | ||
| */ | ||
| export interface SentryCliUploadSourceMapsOptions { | ||
| /** | ||
| * One or more paths that Sentry CLI should scan recursively for sources. | ||
| * It will upload all .map files and match associated .js files. | ||
| */ | ||
| include: Array<string | SourceMapsPathDescriptor>; | ||
| /** | ||
| * One or more paths to ignore during upload. Overrides entries in ignoreFile file. | ||
| */ | ||
| ignore?: string[]; | ||
| /** | ||
| * Path to a file containing list of files/directories to ignore. | ||
| * Can point to .gitignore or anything with same format. | ||
| */ | ||
| ignoreFile?: string | null; | ||
| /** | ||
| * Enables rewriting of matching sourcemaps so that indexed maps are flattened | ||
| * and missing sources are inlined if possible. Defaults to `true`. | ||
| */ | ||
| rewrite?: boolean; | ||
| /** | ||
| * This prevents the automatic detection of sourcemap references. | ||
| */ | ||
| sourceMapReference?: boolean; | ||
| /** | ||
| * Enables files gzip decompression prior to uploading. Defaults to `false`. | ||
| */ | ||
| decompress?: boolean; | ||
| /** | ||
| * Enable artifacts deduplication prior to uploading. This will skip uploading | ||
| * any artifacts that are already present on the server. Defaults to `true`. | ||
| */ | ||
| dedupe?: boolean; | ||
| /** | ||
| * When paired with the rewrite option this will remove a prefix from uploaded files. | ||
| * For instance you can use this to remove a path that is build machine specific. | ||
| */ | ||
| stripPrefix?: string[]; | ||
| /** | ||
| * When paired with the rewrite option this will add ~ to the stripPrefix array. | ||
| */ | ||
| stripCommonPrefix?: boolean; | ||
| /** | ||
| * The projects to upload the sourcemaps to. If not provided, the sourcemaps will be uploaded to the default project. | ||
| */ | ||
| projects?: string[]; | ||
| /** | ||
| * This attempts sourcemap validation before upload when rewriting is not enabled. | ||
| * It will spot a variety of issues with source maps and cancel the upload if any are found. | ||
| * This is not enabled by default as this can cause false positives. | ||
| */ | ||
| validate?: boolean; | ||
| /** | ||
| * This sets an URL prefix at the beginning of all files. | ||
| * This defaults to `~/` but you might want to set this to the full URL. | ||
| * This is also useful if your files are stored in a sub folder. eg: url-prefix `~/static/js`. | ||
| */ | ||
| urlPrefix?: string; | ||
| /** | ||
| * This sets an URL suffix at the end of all files. | ||
| * Useful for appending query parameters. | ||
| */ | ||
| urlSuffix?: string; | ||
| /** | ||
| * This sets the file extensions to be considered. | ||
| * By default the following file extensions are processed: js, map, jsbundle and bundle. | ||
| */ | ||
| ext?: string[]; | ||
| /** | ||
| * Unique identifier for the distribution, used to further segment your release. | ||
| * Usually your build number. | ||
| */ | ||
| dist?: string; | ||
| /** | ||
| * Force use of new Artifact Bundles upload, that enables use of Debug ID for Source Maps discovery, | ||
| * even when the Sentry server does not declare support for it. | ||
| * | ||
| * @deprecated This option is deprecated and will be removed in the next major version. Sentry CLI | ||
| * should always respect what the server says it supports. | ||
| */ | ||
| useArtifactBundle?: boolean; | ||
| } | ||
| /** | ||
| * Options for creating a new deployment | ||
| */ | ||
| export interface SentryCliNewDeployOptions { | ||
| /** | ||
| * Environment for this release. Values that make sense here would be `production` or `staging`. | ||
| */ | ||
| env: string; | ||
| /** | ||
| * Deployment start time in Unix timestamp (in seconds) or ISO 8601 format. | ||
| */ | ||
| started?: number | string; | ||
| /** | ||
| * Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format. | ||
| */ | ||
| finished?: number | string; | ||
| /** | ||
| * Deployment duration (in seconds). Can be used instead of started and finished. | ||
| */ | ||
| time?: number; | ||
| /** | ||
| * Human readable name for the deployment. | ||
| */ | ||
| name?: string; | ||
| /** | ||
| * URL that points to the deployment. | ||
| */ | ||
| url?: string; | ||
| } | ||
| /** | ||
| * Options for setting commits on a release | ||
| */ | ||
| export interface SentryCliCommitsOptions { | ||
| /** | ||
| * Automatically choose the associated commit (uses the current commit). Overrides other setCommit options. | ||
| */ | ||
| auto?: boolean; | ||
| /** | ||
| * The full repo name as defined in Sentry. Required if auto option is not true. | ||
| */ | ||
| repo?: string; | ||
| /** | ||
| * The current (last) commit in the release. Required if auto option is not true. | ||
| */ | ||
| commit?: string; | ||
| /** | ||
| * The commit before the beginning of this release (in other words, the last commit of the previous release). | ||
| * If omitted, this will default to the last commit of the previous release in Sentry. | ||
| * If there was no previous release, the last 10 commits will be used. | ||
| */ | ||
| previousCommit?: string; | ||
| /** | ||
| * When the flag is set and the previous release commit was not found in the repository, will create a release | ||
| * with the default commits count(or the one specified with `--initial-depth`) instead of failing the command. | ||
| */ | ||
| ignoreMissing?: boolean; | ||
| /** | ||
| * When the flag is set, command will not fail and just exit silently if no new commits for a given release have been found. | ||
| */ | ||
| ignoreEmpty?: boolean; | ||
| } | ||
| /** | ||
| * Release management interface | ||
| */ | ||
| export interface SentryCliReleases { | ||
| new (release: string, options?: { | ||
| projects: string[]; | ||
| } | string[]): Promise<string>; | ||
| setCommits(release: string, options: SentryCliCommitsOptions): Promise<string>; | ||
| finalize(release: string): Promise<string>; | ||
| proposeVersion(): Promise<string>; | ||
| uploadSourceMaps(release: string, options: SentryCliUploadSourceMapsOptions & { | ||
| live?: boolean | 'rejectOnError'; | ||
| }): Promise<string[]>; | ||
| listDeploys(release: string): Promise<string>; | ||
| newDeploy(release: string, options: SentryCliNewDeployOptions): Promise<string>; | ||
| execute(args: string[], live: boolean | 'rejectOnError'): Promise<string>; | ||
| } |
| /** | ||
| * TypeScript type definitions for @sentry/cli | ||
| */ | ||
| export {}; |
+7
-10
@@ -1,10 +0,7 @@ | ||
| sentry-cli-Darwin-arm64=f84d5716d74ea4b1355c64ef6cb6a14f2097ab2541c9747b7aee4bad39a647e4 | ||
| sentry-cli-Darwin-universal=5c893f7bc57dbcb87ec941c08420ef07cf485e931238c83cc8fbbe2ba69fec9f | ||
| sentry-cli-Darwin-x86_64=e95fa80e6f06797c56eb4f18f65f82a4c859599c572d940e7a156885cbd8dd21 | ||
| sentry-cli-Linux-aarch64=3853e2071623941d96c7b69a99929f1d3222a4b696f4b74c875be340aa75926a | ||
| sentry-cli-Linux-armv7=31fab9396e879ae49cd27aca025caa453ffbd965c2d018bd873f09d8d71a06d9 | ||
| sentry-cli-Linux-i686=a995decaad61160bfac84634b280f005003931726e14fd964f8c3cf6ce00aa20 | ||
| sentry-cli-Linux-x86_64=61b1c19345694ce31ac663e9875194d45f4f317f2b9134269605f810132df88b | ||
| sentry-cli-Windows-aarch64.exe=a4a4dff5e176392510674b1afd73324bedf0ea66bdd8234654389429cda9b576 | ||
| sentry-cli-Windows-i686.exe=29290444fd2b796fe14c5d058eafe883293257f9f650fe20080bd37214b2ffe5 | ||
| sentry-cli-Windows-x86_64.exe=e89a23566d5e17a5fb2fe40e182e6e0a6cf07134330c7588d5b6025071bcae3f | ||
| sentry-cli-Linux-aarch64=dc847900b90b04eb9ae12a342bb68626d6a617f0dd3e806038f8db34a02e438c | ||
| sentry-cli-Linux-armv7=6293a4e62f0cf12d2882864f71f9d243675b7092cce32eabdbbb404c80dd7809 | ||
| sentry-cli-Linux-i686=306384389c5685cf7174e903a1bacf804080437b89bb9335656b06eeed313e3a | ||
| sentry-cli-Linux-x86_64=d49103860d24e6ba630bc78bdc9da6afab34464c645a7418ff378d23d55628b6 | ||
| sentry-cli-Windows-aarch64.exe=c054d584647fc5e4c6cb401be2c2b4ab63a3efd5cef4663a37b077857191496e | ||
| sentry-cli-Windows-i686.exe=43e44eb88462d0bc8c3eb9f1bceb1e94ada25b6d4dddc06b66dcb81860a78af7 | ||
| sentry-cli-Windows-x86_64.exe=3e468f56865bfa4dea45b5a113f7399f2514fc954e358aa12ca88da97407e511 |
+222
-243
| 'use strict'; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| const os = require('os'); | ||
@@ -7,14 +15,12 @@ const path = require('path'); | ||
| const childProcess = require('child_process'); | ||
| const BINARY_DISTRIBUTIONS = [ | ||
| { packageName: '@sentry/cli-darwin', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-x64', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-i686', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-arm64', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-arm', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-win32-x64', subpath: 'bin/sentry-cli.exe' }, | ||
| { packageName: '@sentry/cli-win32-i686', subpath: 'bin/sentry-cli.exe' }, | ||
| { packageName: '@sentry/cli-win32-arm64', subpath: 'bin/sentry-cli.exe' }, | ||
| { packageName: '@sentry/cli-darwin', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-x64', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-i686', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-arm64', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-linux-arm', subpath: 'bin/sentry-cli' }, | ||
| { packageName: '@sentry/cli-win32-x64', subpath: 'bin/sentry-cli.exe' }, | ||
| { packageName: '@sentry/cli-win32-i686', subpath: 'bin/sentry-cli.exe' }, | ||
| { packageName: '@sentry/cli-win32-arm64', subpath: 'bin/sentry-cli.exe' }, | ||
| ]; | ||
| /** | ||
@@ -30,66 +36,63 @@ * This convoluted function resolves the path to the manually downloaded fallback | ||
| function getFallbackBinaryPath() { | ||
| const parts = []; | ||
| parts.push(__dirname); | ||
| parts.push('..'); | ||
| parts.push(`sentry-cli${process.platform === 'win32' ? '.exe' : ''}`); | ||
| return path.resolve(...parts); | ||
| const parts = []; | ||
| parts.push(__dirname); | ||
| parts.push('..'); | ||
| parts.push(`sentry-cli${process.platform === 'win32' ? '.exe' : ''}`); | ||
| return path.resolve(...parts); | ||
| } | ||
| function getDistributionForThisPlatform() { | ||
| const arch = os.arch(); | ||
| const platform = os.platform(); | ||
| let packageName = undefined; | ||
| if (platform === 'darwin') { | ||
| packageName = '@sentry/cli-darwin'; | ||
| } else if (platform === 'linux' || platform === 'freebsd' || platform === 'android') { | ||
| switch (arch) { | ||
| case 'x64': | ||
| packageName = '@sentry/cli-linux-x64'; | ||
| break; | ||
| case 'x86': | ||
| case 'ia32': | ||
| packageName = '@sentry/cli-linux-i686'; | ||
| break; | ||
| case 'arm64': | ||
| packageName = '@sentry/cli-linux-arm64'; | ||
| break; | ||
| case 'arm': | ||
| packageName = '@sentry/cli-linux-arm'; | ||
| break; | ||
| const arch = os.arch(); | ||
| const platform = os.platform(); | ||
| let packageName = undefined; | ||
| if (platform === 'darwin') { | ||
| packageName = '@sentry/cli-darwin'; | ||
| } | ||
| } else if (platform === 'win32') { | ||
| switch (arch) { | ||
| case 'x64': | ||
| packageName = '@sentry/cli-win32-x64'; | ||
| break; | ||
| case 'x86': | ||
| case 'ia32': | ||
| packageName = '@sentry/cli-win32-i686'; | ||
| break; | ||
| case 'arm64': | ||
| packageName = '@sentry/cli-win32-arm64'; | ||
| break; | ||
| else if (platform === 'linux' || platform === 'freebsd' || platform === 'android') { | ||
| switch (arch) { | ||
| case 'x64': | ||
| packageName = '@sentry/cli-linux-x64'; | ||
| break; | ||
| case 'x86': | ||
| case 'ia32': | ||
| packageName = '@sentry/cli-linux-i686'; | ||
| break; | ||
| case 'arm64': | ||
| packageName = '@sentry/cli-linux-arm64'; | ||
| break; | ||
| case 'arm': | ||
| packageName = '@sentry/cli-linux-arm'; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| let subpath = undefined; | ||
| switch (platform) { | ||
| case 'win32': | ||
| subpath = 'bin/sentry-cli.exe'; | ||
| break; | ||
| case 'darwin': | ||
| case 'linux': | ||
| case 'freebsd': | ||
| case 'android': | ||
| subpath = 'bin/sentry-cli'; | ||
| break; | ||
| default: | ||
| subpath = 'bin/sentry-cli'; | ||
| break; | ||
| } | ||
| return { packageName, subpath }; | ||
| else if (platform === 'win32') { | ||
| switch (arch) { | ||
| case 'x64': | ||
| packageName = '@sentry/cli-win32-x64'; | ||
| break; | ||
| case 'x86': | ||
| case 'ia32': | ||
| packageName = '@sentry/cli-win32-i686'; | ||
| break; | ||
| case 'arm64': | ||
| packageName = '@sentry/cli-win32-arm64'; | ||
| break; | ||
| } | ||
| } | ||
| let subpath = undefined; | ||
| switch (platform) { | ||
| case 'win32': | ||
| subpath = 'bin/sentry-cli.exe'; | ||
| break; | ||
| case 'darwin': | ||
| case 'linux': | ||
| case 'freebsd': | ||
| case 'android': | ||
| subpath = 'bin/sentry-cli'; | ||
| break; | ||
| default: | ||
| subpath = 'bin/sentry-cli'; | ||
| break; | ||
| } | ||
| return { packageName, subpath }; | ||
| } | ||
| /** | ||
@@ -101,4 +104,3 @@ * Throws an error with a message stating that Sentry CLI doesn't support the current platform. | ||
| function throwUnsupportedPlatformError() { | ||
| throw new Error( | ||
| `Unsupported operating system or architecture! Sentry CLI does not work on this architecture. | ||
| throw new Error(`Unsupported operating system or architecture! Sentry CLI does not work on this architecture. | ||
@@ -108,6 +110,4 @@ Sentry CLI supports: | ||
| - Linux and FreeBSD on x64, x86, ia32, arm64, and arm architectures | ||
| - Windows x64, x86, and ia32 architectures` | ||
| ); | ||
| - Windows x64, x86, and ia32 architectures`); | ||
| } | ||
| /** | ||
@@ -120,48 +120,44 @@ * Tries to find the installed Sentry CLI binary - either by looking into the relevant | ||
| function getBinaryPath() { | ||
| if (process.env.SENTRY_BINARY_PATH) { | ||
| return process.env.SENTRY_BINARY_PATH; | ||
| } | ||
| if (process.env.SENTRY_BINARY_PATH) { | ||
| return process.env.SENTRY_BINARY_PATH; | ||
| } | ||
| const { packageName, subpath } = getDistributionForThisPlatform(); | ||
| if (packageName === undefined) { | ||
| throwUnsupportedPlatformError(); | ||
| } | ||
| let fallbackBinaryPath = getFallbackBinaryPath(); | ||
| if (fs.existsSync(fallbackBinaryPath)) { | ||
| // Since the fallback got installed, the optional dependencies likely didn't get installed, so we just default to the fallback. | ||
| return fallbackBinaryPath; | ||
| } | ||
| let compatibleBinaryPath; | ||
| try { | ||
| compatibleBinaryPath = require.resolve(`${packageName}/${subpath}`); | ||
| } | ||
| catch (e) { | ||
| const otherInstalledDistribution = BINARY_DISTRIBUTIONS.find(({ packageName, subpath }) => { | ||
| try { | ||
| require.resolve(`${packageName}/${subpath}`); | ||
| return true; | ||
| } | ||
| catch (e) { | ||
| return false; | ||
| } | ||
| }); | ||
| // These error messages are heavily inspired by esbuild's error messages: https://github.com/evanw/esbuild/blob/f3d535262e3998d845d0f102b944ecd5a9efda57/lib/npm/node-platform.ts#L150 | ||
| if (otherInstalledDistribution) { | ||
| throw new Error(`Sentry CLI binary for this platform/architecture not found! | ||
| const { packageName, subpath } = getDistributionForThisPlatform(); | ||
| if (packageName === undefined) { | ||
| throwUnsupportedPlatformError(); | ||
| } | ||
| let fallbackBinaryPath = getFallbackBinaryPath(); | ||
| if (fs.existsSync(fallbackBinaryPath)) { | ||
| // Since the fallback got installed, the optional dependencies likely didn't get installed, so we just default to the fallback. | ||
| return fallbackBinaryPath; | ||
| } | ||
| let compatibleBinaryPath; | ||
| try { | ||
| compatibleBinaryPath = require.resolve(`${packageName}/${subpath}`); | ||
| } catch (e) { | ||
| const otherInstalledDistribution = BINARY_DISTRIBUTIONS.find(({ packageName, subpath }) => { | ||
| try { | ||
| require.resolve(`${packageName}/${subpath}`); | ||
| return true; | ||
| } catch (e) { | ||
| return false; | ||
| } | ||
| }); | ||
| // These error messages are heavily inspired by esbuild's error messages: https://github.com/evanw/esbuild/blob/f3d535262e3998d845d0f102b944ecd5a9efda57/lib/npm/node-platform.ts#L150 | ||
| if (otherInstalledDistribution) { | ||
| throw new Error(`Sentry CLI binary for this platform/architecture not found! | ||
| The "${otherInstalledDistribution.packageName}" package is installed, but for the current platform, you should have the "${packageName}" package installed instead. This usually happens if the "@sentry/cli" package is installed on one platform (for example Windows or MacOS) and then the "node_modules" folder is reused on another operating system (for example Linux in Docker). | ||
| To fix this, avoid copying the "node_modules" folder, and instead freshly install your dependencies on the target system. You can also configure your package manager to install the right package. For example, yarn has the "supportedArchitectures" feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitecture.`); | ||
| } else { | ||
| throw new Error(`Sentry CLI binary for this platform/architecture not found! | ||
| } | ||
| else { | ||
| throw new Error(`Sentry CLI binary for this platform/architecture not found! | ||
| It seems like none of the "@sentry/cli" package's optional dependencies got installed. Please make sure your package manager is configured to install optional dependencies. If you are using npm to install your dependencies, please don't set the "--no-optional", "--ignore-optional", or "--omit=optional" flags. Sentry CLI needs the "optionalDependencies" feature in order to install its binary.`); | ||
| } | ||
| } | ||
| } | ||
| return compatibleBinaryPath; | ||
| return compatibleBinaryPath; | ||
| } | ||
| /** | ||
@@ -172,3 +168,2 @@ * Will be used as the binary path when defined with `mockBinaryPath`. | ||
| let mockedBinaryPath; | ||
| /** | ||
@@ -182,5 +177,4 @@ * Overrides the default binary path with a mock value, useful for testing. | ||
| function mockBinaryPath(mockPath) { | ||
| mockedBinaryPath = mockPath; | ||
| mockedBinaryPath = mockPath; | ||
| } | ||
| /** | ||
@@ -190,3 +184,2 @@ * The javascript type of a command line option. | ||
| */ | ||
| /** | ||
@@ -199,3 +192,2 @@ * Schema definition of a command line option. | ||
| */ | ||
| /** | ||
@@ -205,3 +197,2 @@ * Schema definition for a command. | ||
| */ | ||
| /** | ||
@@ -215,43 +206,31 @@ * Serializes command line options into an arguments array. | ||
| function serializeOptions(schema, options) { | ||
| return Object.keys(schema).reduce((newOptions, option) => { | ||
| const paramValue = options[option]; | ||
| if (paramValue === undefined || paramValue === null) { | ||
| return newOptions; | ||
| } | ||
| const paramType = schema[option].type; | ||
| const paramName = schema[option].param; | ||
| if (paramType === 'array') { | ||
| if (!Array.isArray(paramValue)) { | ||
| throw new Error(`${option} should be an array`); | ||
| } | ||
| return newOptions.concat( | ||
| paramValue.reduce((acc, value) => acc.concat([paramName, String(value)]), []) | ||
| ); | ||
| } | ||
| if (paramType === 'boolean') { | ||
| if (typeof paramValue !== 'boolean') { | ||
| throw new Error(`${option} should be a bool`); | ||
| } | ||
| const invertedParamName = schema[option].invertedParam; | ||
| if (paramValue && paramName !== undefined) { | ||
| return newOptions.concat([paramName]); | ||
| } | ||
| if (!paramValue && invertedParamName !== undefined) { | ||
| return newOptions.concat([invertedParamName]); | ||
| } | ||
| return newOptions; | ||
| } | ||
| return newOptions.concat(paramName, paramValue); | ||
| }, []); | ||
| return Object.keys(schema).reduce((newOptions, option) => { | ||
| const paramValue = options[option]; | ||
| if (paramValue === undefined || paramValue === null) { | ||
| return newOptions; | ||
| } | ||
| const paramType = schema[option].type; | ||
| const paramName = schema[option].param; | ||
| if (paramType === 'array') { | ||
| if (!Array.isArray(paramValue)) { | ||
| throw new Error(`${option} should be an array`); | ||
| } | ||
| return newOptions.concat(paramValue.reduce((acc, value) => acc.concat([paramName, String(value)]), [])); | ||
| } | ||
| if (paramType === 'boolean') { | ||
| if (typeof paramValue !== 'boolean') { | ||
| throw new Error(`${option} should be a bool`); | ||
| } | ||
| const invertedParamName = schema[option].invertedParam; | ||
| if (paramValue && paramName !== undefined) { | ||
| return newOptions.concat([paramName]); | ||
| } | ||
| if (!paramValue && invertedParamName !== undefined) { | ||
| return newOptions.concat([invertedParamName]); | ||
| } | ||
| return newOptions; | ||
| } | ||
| return newOptions.concat(paramName, paramValue); | ||
| }, []); | ||
| } | ||
| /** | ||
@@ -266,5 +245,4 @@ * Serializes the command and its options into an arguments array. | ||
| function prepareCommand(command, schema, options) { | ||
| return command.concat(serializeOptions(schema || {}, options || {})); | ||
| return command.concat(serializeOptions(schema || {}, options || {})); | ||
| } | ||
| /** | ||
@@ -275,5 +253,4 @@ * Returns the absolute path to the `sentry-cli` binary. | ||
| function getPath() { | ||
| return mockedBinaryPath !== undefined ? mockedBinaryPath : getBinaryPath(); | ||
| return mockedBinaryPath !== undefined ? mockedBinaryPath : getBinaryPath(); | ||
| } | ||
| /** | ||
@@ -304,89 +281,91 @@ * Runs `sentry-cli` with the given command line arguments. | ||
| * @param {string} [configFile] Relative or absolute path to the configuration file. | ||
| * @param {Object} [config] More configuration to pass to the CLI | ||
| * @returns {Promise.<string>} A promise that resolves to the standard output. | ||
| * @param {import('./index').SentryCliOptions} [config] More configuration to pass to the CLI | ||
| * @returns {Promise<string>} A promise that resolves to the standard output. | ||
| */ | ||
| async function execute(args, live, silent, configFile, config = {}) { | ||
| const env = { ...process.env }; | ||
| if (configFile) { | ||
| env.SENTRY_PROPERTIES = configFile; | ||
| } | ||
| if (config.url) { | ||
| env.SENTRY_URL = config.url; | ||
| } | ||
| if (config.authToken) { | ||
| env.SENTRY_AUTH_TOKEN = config.authToken; | ||
| } | ||
| if (config.apiKey) { | ||
| env.SENTRY_API_KEY = config.apiKey; | ||
| } | ||
| if (config.dsn) { | ||
| env.SENTRY_DSN = config.dsn; | ||
| } | ||
| if (config.org) { | ||
| env.SENTRY_ORG = config.org; | ||
| } | ||
| if (config.project) { | ||
| env.SENTRY_PROJECT = config.project; | ||
| } | ||
| if (config.vcsRemote) { | ||
| env.SENTRY_VCS_REMOTE = config.vcsRemote; | ||
| } | ||
| if (config.customHeader) { | ||
| env.CUSTOM_HEADER = config.customHeader; | ||
| } else if (config.headers) { | ||
| const headers = Object.entries(config.headers).flatMap(([key, value]) => [ | ||
| '--header', | ||
| `${key}:${value}`, | ||
| ]); | ||
| args = [...headers, ...args]; | ||
| } | ||
| return new Promise((resolve, reject) => { | ||
| if (live === true || live === 'rejectOnError') { | ||
| const output = silent ? 'ignore' : 'inherit'; | ||
| const pid = childProcess.spawn(getPath(), args, { | ||
| env, | ||
| // stdin, stdout, stderr | ||
| stdio: ['ignore', output, output], | ||
| }); | ||
| pid.on('exit', (exitCode) => { | ||
| if (live === 'rejectOnError') { | ||
| if (exitCode === 0) { | ||
| resolve('success (live mode)'); | ||
| } | ||
| reject(new Error(`Command ${args.join(' ')} failed with exit code ${exitCode}`)); | ||
| function execute(args_1, live_1, silent_1, configFile_1) { | ||
| return __awaiter(this, arguments, void 0, function* (args, live, silent, configFile, config = {}) { | ||
| const env = Object.assign({}, process.env); | ||
| if (configFile) { | ||
| env.SENTRY_PROPERTIES = configFile; | ||
| } | ||
| // According to the type definition, resolving with void is not allowed. | ||
| // However, for backwards compatibility, we resolve void here to | ||
| // avoid a behaviour-breaking change. | ||
| // TODO (v3): Clean this up and always resolve a string (or change the type definition) | ||
| // @ts-expect-error - see comment above | ||
| resolve(); | ||
| }); | ||
| } else { | ||
| childProcess.execFile(getPath(), args, { env }, (err, stdout) => { | ||
| if (err) { | ||
| reject(err); | ||
| } else { | ||
| resolve(stdout); | ||
| if (config.url) { | ||
| env.SENTRY_URL = config.url; | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| if (config.authToken) { | ||
| env.SENTRY_AUTH_TOKEN = config.authToken; | ||
| } | ||
| if (config.apiKey) { | ||
| env.SENTRY_API_KEY = config.apiKey; | ||
| } | ||
| if (config.dsn) { | ||
| env.SENTRY_DSN = config.dsn; | ||
| } | ||
| if (config.org) { | ||
| env.SENTRY_ORG = config.org; | ||
| } | ||
| if (config.project) { | ||
| env.SENTRY_PROJECT = config.project; | ||
| } | ||
| if (config.vcsRemote) { | ||
| env.SENTRY_VCS_REMOTE = config.vcsRemote; | ||
| } | ||
| if (config.customHeader) { | ||
| env.CUSTOM_HEADER = config.customHeader; | ||
| } | ||
| else if (config.headers) { | ||
| const headers = Object.entries(config.headers).flatMap(([key, value]) => [ | ||
| '--header', | ||
| `${key}:${value}`, | ||
| ]); | ||
| args = [...headers, ...args]; | ||
| } | ||
| return new Promise((resolve, reject) => { | ||
| if (live === true || live === 'rejectOnError') { | ||
| const output = silent ? 'ignore' : 'inherit'; | ||
| const pid = childProcess.spawn(getPath(), args, { | ||
| env, | ||
| // stdin, stdout, stderr | ||
| stdio: ['ignore', output, output], | ||
| }); | ||
| pid.on('exit', (exitCode) => { | ||
| if (live === 'rejectOnError') { | ||
| if (exitCode === 0) { | ||
| resolve('success (live mode)'); | ||
| } | ||
| reject(new Error(`Command ${args.join(' ')} failed with exit code ${exitCode}`)); | ||
| } | ||
| // According to the type definition, resolving with void is not allowed. | ||
| // However, for backwards compatibility, we resolve void here to | ||
| // avoid a behaviour-breaking change. | ||
| // TODO (v3): Clean this up and always resolve a string (or change the type definition) | ||
| // @ts-expect-error - see comment above | ||
| resolve(); | ||
| }); | ||
| } | ||
| else { | ||
| childProcess.execFile(getPath(), args, { env }, (err, stdout) => { | ||
| if (err) { | ||
| reject(err); | ||
| } | ||
| else { | ||
| resolve(stdout); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| }); | ||
| } | ||
| function getProjectFlagsFromOptions({ projects = [] } = {}) { | ||
| return projects.reduce((flags, project) => flags.concat('-p', project), []); | ||
| return projects.reduce((flags, project) => flags.concat('-p', project), []); | ||
| } | ||
| module.exports = { | ||
| execute, | ||
| getPath, | ||
| getProjectFlagsFromOptions, | ||
| mockBinaryPath, | ||
| prepareCommand, | ||
| serializeOptions, | ||
| getDistributionForThisPlatform, | ||
| throwUnsupportedPlatformError, | ||
| getFallbackBinaryPath, | ||
| execute, | ||
| getPath, | ||
| getProjectFlagsFromOptions, | ||
| mockBinaryPath, | ||
| prepareCommand, | ||
| serializeOptions, | ||
| getDistributionForThisPlatform, | ||
| throwUnsupportedPlatformError, | ||
| getFallbackBinaryPath, | ||
| }; |
+59
-234
@@ -0,248 +1,73 @@ | ||
| export = SentryCli; | ||
| /** | ||
| * Typings for @sentry/cli | ||
| * @typedef {import('./types').SentryCliOptions} SentryCliOptions | ||
| * @typedef {import('./types').SentryCliUploadSourceMapsOptions} SentryCliUploadSourceMapsOptions | ||
| * @typedef {import('./types').SourceMapsPathDescriptor} SourceMapsPathDescriptor | ||
| * @typedef {import('./types').SentryCliNewDeployOptions} SentryCliNewDeployOptions | ||
| * @typedef {import('./types').SentryCliCommitsOptions} SentryCliCommitsOptions | ||
| * @typedef {import('./types').SentryCliReleases} SentryCliReleases | ||
| */ | ||
| declare module '@sentry/cli' { | ||
| export interface SentryCliOptions { | ||
| /** | ||
| * Interface to and wrapper around the `sentry-cli` executable. | ||
| * | ||
| * Commands are grouped into namespaces. See the respective namespaces for more | ||
| * documentation. To use this wrapper, simply create an instance and call methods: | ||
| * | ||
| * @example | ||
| * const cli = new SentryCli(); | ||
| * console.log(SentryCli.getVersion()); | ||
| * | ||
| * @example | ||
| * const cli = new SentryCli('path/to/custom/sentry.properties'); | ||
| * const release = await cli.releases.proposeVersion()); | ||
| * console.log(release); | ||
| */ | ||
| declare class SentryCli { | ||
| /** | ||
| * The URL of the Sentry instance you are connecting to. Defaults to https://sentry.io/. | ||
| * This value will update `SENTRY_URL env variable. | ||
| * Returns the version of the installed `sentry-cli` binary. | ||
| * @returns {string} | ||
| */ | ||
| url?: string; | ||
| static getVersion(): string; | ||
| /** | ||
| * Authentication token for HTTP requests to Sentry. | ||
| * This value will update `SENTRY_AUTH_TOKEN` env variable. | ||
| * Returns an absolute path to the `sentry-cli` binary. | ||
| * @returns {string} | ||
| */ | ||
| authToken?: string; | ||
| static getPath(): string; | ||
| /** | ||
| * API key to authenticate any HTTP requests to Sentry (legacy authentication method). | ||
| * This value will update `SENTRY_API_KEY` env variable. | ||
| * @deprecated Use auth-token-based authentication via `authToken` instead. | ||
| * This option is scheduled for removal in the next major release. | ||
| */ | ||
| apiKey?: string; | ||
| /** | ||
| * Sentry DSN. | ||
| * This value will update `SENTRY_DSN` env variable. | ||
| */ | ||
| dsn?: string; | ||
| /** | ||
| * Organization slug. | ||
| * This value will update `SENTRY_ORG` env variable. | ||
| */ | ||
| org?: string; | ||
| /** | ||
| * Project Project slug. | ||
| * This value will update `SENTRY_PROJECT` env variable. | ||
| */ | ||
| project?: string; | ||
| /** | ||
| * Version control system remote name. | ||
| * This value will update `SENTRY_VCS_REMOTE` env variable. | ||
| */ | ||
| vcsRemote?: string; | ||
| /** | ||
| * If true, all logs are suppressed. | ||
| */ | ||
| silent?: boolean; | ||
| /** | ||
| * A header added to every outgoing network request. | ||
| * This value will update `CUSTOM_HEADER` env variable. | ||
| */ | ||
| customHeader?: string; | ||
| /** | ||
| * Headers added to every outgoing network request. | ||
| * This value does not set any env variable, and is overridden by `customHeader`. | ||
| */ | ||
| headers?: Record<string, string>; | ||
| } | ||
| /** | ||
| * Custom upload-sourcemaps options for a particular `include` path. In this | ||
| * case `paths` takes the place of `include` in the options so as to make it | ||
| * clear that this is not recursive. | ||
| */ | ||
| export type SourceMapsPathDescriptor = Omit<SentryCliUploadSourceMapsOptions, 'include'> & { | ||
| paths: string[]; | ||
| }; | ||
| export interface SentryCliUploadSourceMapsOptions { | ||
| /** | ||
| * One or more paths that Sentry CLI should scan recursively for sources. | ||
| * It will upload all .map files and match associated .js files. | ||
| */ | ||
| include: Array<string | SourceMapsPathDescriptor>; | ||
| /** | ||
| * One or more paths to ignore during upload. Overrides entries in ignoreFile file. | ||
| */ | ||
| ignore?: string[]; | ||
| /** | ||
| * Path to a file containing list of files/directories to ignore. | ||
| * Can point to .gitignore or anything with same format. | ||
| */ | ||
| ignoreFile?: string | null; | ||
| /** | ||
| * Enables rewriting of matching sourcemaps so that indexed maps are flattened | ||
| * and missing sources are inlined if possible. Defaults to `true`. | ||
| */ | ||
| rewrite?: boolean; | ||
| /** | ||
| * This prevents the automatic detection of sourcemap references. | ||
| */ | ||
| sourceMapReference?: boolean; | ||
| /** | ||
| * Enables files gzip decompression prior to uploading. Defaults to `false`. | ||
| */ | ||
| decompress?: boolean; | ||
| /** | ||
| * Enable artifacts deduplication prior to uploading. This will skip uploading | ||
| * any artifacts that are already present on the server. Defaults to `true`. | ||
| */ | ||
| dedupe?: boolean; | ||
| /** | ||
| * When paired with the rewrite option this will remove a prefix from uploaded files. | ||
| * For instance you can use this to remove a path that is build machine specific. | ||
| */ | ||
| stripPrefix?: string[]; | ||
| /** | ||
| * When paired with the rewrite option this will add ~ to the stripPrefix array. | ||
| */ | ||
| stripCommonPrefix?: boolean; | ||
| /** | ||
| * The projects to upload the sourcemaps to. If not provided, the sourcemaps will be uploaded to the default project. | ||
| */ | ||
| projects?: string[]; | ||
| /** | ||
| * This attempts sourcemap validation before upload when rewriting is not enabled. | ||
| * It will spot a variety of issues with source maps and cancel the upload if any are found. | ||
| * This is not enabled by default as this can cause false positives. | ||
| */ | ||
| validate?: boolean; | ||
| /** | ||
| * This sets an URL prefix at the beginning of all files. | ||
| * This defaults to `~/` but you might want to set this to the full URL. | ||
| * This is also useful if your files are stored in a sub folder. eg: url-prefix `~/static/js`. | ||
| */ | ||
| urlPrefix?: string; | ||
| /** | ||
| * This sets an URL suffix at the end of all files. | ||
| * Useful for appending query parameters. | ||
| */ | ||
| urlSuffix?: string; | ||
| /** | ||
| * This sets the file extensions to be considered. | ||
| * By default the following file extensions are processed: js, map, jsbundle and bundle. | ||
| */ | ||
| ext?: string[]; | ||
| /** | ||
| * Unique identifier for the distribution, used to further segment your release. | ||
| * Usually your build number. | ||
| */ | ||
| dist?: string; | ||
| /** | ||
| * Force use of new Artifact Bundles upload, that enables use of Debug ID for Source Maps discovery, | ||
| * even when the Sentry server does not declare support for it. | ||
| * Creates a new `SentryCli` instance. | ||
| * | ||
| * @deprecated This option is deprecated and will be removed in the next major version. Sentry CLI | ||
| * should always respect what the server says it supports. | ||
| */ | ||
| useArtifactBundle?: boolean; | ||
| } | ||
| export interface SentryCliNewDeployOptions { | ||
| /** | ||
| * Environment for this release. Values that make sense here would be `production` or `staging`. | ||
| */ | ||
| env: string; | ||
| /** | ||
| * Deployment start time in Unix timestamp (in seconds) or ISO 8601 format. | ||
| */ | ||
| started?: number | string; | ||
| /** | ||
| * Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format. | ||
| */ | ||
| finished?: number | string; | ||
| /** | ||
| * Deployment duration (in seconds). Can be used instead of started and finished. | ||
| */ | ||
| time?: number; | ||
| /** | ||
| * Human readable name for the deployment. | ||
| */ | ||
| name?: string; | ||
| /** | ||
| * URL that points to the deployment. | ||
| */ | ||
| url?: string; | ||
| } | ||
| export interface SentryCliCommitsOptions { | ||
| /** | ||
| * Automatically choose the associated commit (uses the current commit). Overrides other setCommit options. | ||
| */ | ||
| auto?: boolean; | ||
| /** | ||
| * The full repo name as defined in Sentry. Required if auto option is not true. | ||
| */ | ||
| repo?: string; | ||
| /** | ||
| * The current (last) commit in the release. Required if auto option is not true. | ||
| */ | ||
| commit?: string; | ||
| /** | ||
| * The commit before the beginning of this release (in other words, the last commit of the previous release). | ||
| * If omitted, this will default to the last commit of the previous release in Sentry. | ||
| * If there was no previous release, the last 10 commits will be used. | ||
| */ | ||
| previousCommit?: string; | ||
| /** | ||
| * When the flag is set and the previous release commit was not found in the repository, will create a release | ||
| * with the default commits count(or the one specified with `--initial-depth`) instead of failing the command. | ||
| */ | ||
| ignoreMissing?: boolean; | ||
| /** | ||
| * When the flag is set, command will not fail and just exit silently if no new commits for a given release have been found. | ||
| */ | ||
| ignoreEmpty?: boolean; | ||
| } | ||
| export interface SentryCliReleases { | ||
| ['new'](release: string, options?: { projects: string[] } | string[]): Promise<string>; | ||
| setCommits(release: string, options: SentryCliCommitsOptions): Promise<string>; | ||
| finalize(release: string): Promise<string>; | ||
| proposeVersion(): Promise<string>; | ||
| uploadSourceMaps( | ||
| release: string, | ||
| options: SentryCliUploadSourceMapsOptions & { live?: boolean | 'rejectOnError' } | ||
| ): Promise<string>; | ||
| listDeploys(release: string): Promise<string>; | ||
| newDeploy(release: string, options: SentryCliNewDeployOptions): Promise<string>; | ||
| execute(args: string[], live: boolean | 'rejectOnError'): Promise<string>; | ||
| } | ||
| export default class SentryCli { | ||
| /** | ||
| * Creates a new instance of SentryCli class | ||
| * If the `configFile` parameter is specified, configuration located in the default | ||
| * location and the value specified in the `SENTRY_PROPERTIES` environment variable is | ||
| * overridden. | ||
| * | ||
| * @param configFile Path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files. | ||
| * @param {string | null} [configFile] - Path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files. | ||
| * By default, the config file is looked for upwards from the current path and defaults from ~/.sentryclirc are always loaded. | ||
| * This value will update `SENTRY_PROPERTIES` env variable. | ||
| * @param options {@link SentryCliOptions} | ||
| * @param {SentryCliOptions} [options] - More options to pass to the CLI | ||
| */ | ||
| constructor(configFile?: string | null, options?: SentryCliOptions); | ||
| public configFile?: string; | ||
| public options?: SentryCliOptions; | ||
| public releases: SentryCliReleases; | ||
| public static getVersion(): string; | ||
| public static getPath(): string; | ||
| public execute(args: string[], live: boolean | 'rejectOnError'): Promise<string>; | ||
| } | ||
| configFile: string; | ||
| options: import("./types").SentryCliOptions; | ||
| releases: Releases; | ||
| /** | ||
| * See {helper.execute} docs. | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * @returns {Promise<string>} A promise that resolves to the standard output. | ||
| */ | ||
| execute(args: string[], live: boolean | "rejectOnError"): Promise<string>; | ||
| } | ||
| declare namespace SentryCli { | ||
| export { SentryCliOptions, SentryCliUploadSourceMapsOptions, SourceMapsPathDescriptor, SentryCliNewDeployOptions, SentryCliCommitsOptions, SentryCliReleases }; | ||
| } | ||
| import Releases = require("./releases"); | ||
| type SentryCliOptions = import("./types").SentryCliOptions; | ||
| type SentryCliUploadSourceMapsOptions = import("./types").SentryCliUploadSourceMapsOptions; | ||
| type SourceMapsPathDescriptor = import("./types").SourceMapsPathDescriptor; | ||
| type SentryCliNewDeployOptions = import("./types").SentryCliNewDeployOptions; | ||
| type SentryCliCommitsOptions = import("./types").SentryCliCommitsOptions; | ||
| type SentryCliReleases = import("./types").SentryCliReleases; |
+53
-49
| 'use strict'; | ||
| const pkgInfo = require('../package.json'); | ||
| const helper = require('./helper'); | ||
| const Releases = require('./releases'); | ||
| /** | ||
| * @typedef {import('./types').SentryCliOptions} SentryCliOptions | ||
| * @typedef {import('./types').SentryCliUploadSourceMapsOptions} SentryCliUploadSourceMapsOptions | ||
| * @typedef {import('./types').SourceMapsPathDescriptor} SourceMapsPathDescriptor | ||
| * @typedef {import('./types').SentryCliNewDeployOptions} SentryCliNewDeployOptions | ||
| * @typedef {import('./types').SentryCliCommitsOptions} SentryCliCommitsOptions | ||
| * @typedef {import('./types').SentryCliReleases} SentryCliReleases | ||
| */ | ||
| /** | ||
| * Interface to and wrapper around the `sentry-cli` executable. | ||
@@ -23,51 +29,49 @@ * | ||
| class SentryCli { | ||
| /** | ||
| * Creates a new `SentryCli` instance. | ||
| * | ||
| * If the `configFile` parameter is specified, configuration located in the default | ||
| * location and the value specified in the `SENTRY_PROPERTIES` environment variable is | ||
| * overridden. | ||
| * | ||
| * @param {string} [configFile] Relative or absolute path to the configuration file. | ||
| * @param {Object} [options] More options to pass to the CLI | ||
| */ | ||
| constructor(configFile, options) { | ||
| if (typeof configFile === 'string') { | ||
| this.configFile = configFile; | ||
| /** | ||
| * Creates a new `SentryCli` instance. | ||
| * | ||
| * If the `configFile` parameter is specified, configuration located in the default | ||
| * location and the value specified in the `SENTRY_PROPERTIES` environment variable is | ||
| * overridden. | ||
| * | ||
| * @param {string | null} [configFile] - Path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files. | ||
| * By default, the config file is looked for upwards from the current path and defaults from ~/.sentryclirc are always loaded. | ||
| * This value will update `SENTRY_PROPERTIES` env variable. | ||
| * @param {SentryCliOptions} [options] - More options to pass to the CLI | ||
| */ | ||
| constructor(configFile, options) { | ||
| if (typeof configFile === 'string') { | ||
| this.configFile = configFile; | ||
| } | ||
| this.options = options || { silent: false }; | ||
| this.releases = new Releases(Object.assign(Object.assign({}, this.options), { configFile })); | ||
| } | ||
| this.options = options || { silent: false }; | ||
| this.releases = new Releases({ ...this.options, configFile }); | ||
| } | ||
| /** | ||
| * Returns the version of the installed `sentry-cli` binary. | ||
| * @returns {string} | ||
| */ | ||
| static getVersion() { | ||
| return pkgInfo.version; | ||
| } | ||
| /** | ||
| * Returns an absolute path to the `sentry-cli` binary. | ||
| * @returns {string} | ||
| */ | ||
| static getPath() { | ||
| return helper.getPath(); | ||
| } | ||
| /** | ||
| * See {helper.execute} docs. | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * @returns {Promise.<string>} A promise that resolves to the standard output. | ||
| */ | ||
| execute(args, live) { | ||
| return helper.execute(args, live, this.options.silent, this.configFile, this.options); | ||
| } | ||
| /** | ||
| * Returns the version of the installed `sentry-cli` binary. | ||
| * @returns {string} | ||
| */ | ||
| static getVersion() { | ||
| return pkgInfo.version; | ||
| } | ||
| /** | ||
| * Returns an absolute path to the `sentry-cli` binary. | ||
| * @returns {string} | ||
| */ | ||
| static getPath() { | ||
| return helper.getPath(); | ||
| } | ||
| /** | ||
| * See {helper.execute} docs. | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * @returns {Promise<string>} A promise that resolves to the standard output. | ||
| */ | ||
| execute(args, live) { | ||
| return helper.execute(args, live, this.options.silent, this.configFile, this.options); | ||
| } | ||
| } | ||
| module.exports = SentryCli; |
+7
-10
| 'use strict'; | ||
| const format = require('util').format; | ||
| module.exports = class Logger { | ||
| constructor(stream) { | ||
| this.stream = stream; | ||
| } | ||
| log() { | ||
| const message = format(...arguments); | ||
| this.stream.write(`[sentry-cli] ${message}\n`); | ||
| } | ||
| constructor(stream) { | ||
| this.stream = stream; | ||
| } | ||
| log() { | ||
| const message = format(...arguments); | ||
| this.stream.write(`[sentry-cli] ${message}\n`); | ||
| } | ||
| }; |
+230
-244
| 'use strict'; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| const helper = require('../helper'); | ||
| /** | ||
@@ -10,3 +17,2 @@ * Default arguments for the `--ignore` option. | ||
| const DEFAULT_IGNORE = ['node_modules']; | ||
| /** | ||
@@ -17,3 +23,2 @@ * Schema for the `upload-sourcemaps` command. | ||
| const SOURCEMAPS_SCHEMA = require('./options/uploadSourcemaps'); | ||
| /** | ||
@@ -24,4 +29,9 @@ * Schema for the `deploys new` command. | ||
| const DEPLOYS_SCHEMA = require('./options/deploys'); | ||
| /** | ||
| * @typedef {import('../types').SentryCliUploadSourceMapsOptions} SentryCliUploadSourceMapsOptions | ||
| * @typedef {import('../types').SourceMapsPathDescriptor} SourceMapsPathDescriptor | ||
| * @typedef {import('../types').SentryCliNewDeployOptions} SentryCliNewDeployOptions | ||
| * @typedef {import('../types').SentryCliCommitsOptions} SentryCliCommitsOptions | ||
| */ | ||
| /** | ||
| * Manages releases and release artifacts on Sentry. | ||
@@ -31,248 +41,224 @@ * @namespace SentryReleases | ||
| class Releases { | ||
| /** | ||
| * Creates a new `Releases` instance. | ||
| * | ||
| * @param {Object} [options] More options to pass to the CLI | ||
| */ | ||
| constructor(options) { | ||
| this.options = options || {}; | ||
| if (typeof this.options.configFile === 'string') { | ||
| this.configFile = this.options.configFile; | ||
| /** | ||
| * Creates a new `Releases` instance. | ||
| * | ||
| * @param {Object} [options] More options to pass to the CLI | ||
| */ | ||
| constructor(options) { | ||
| this.options = options || {}; | ||
| if (typeof this.options.configFile === 'string') { | ||
| this.configFile = this.options.configFile; | ||
| } | ||
| delete this.options.configFile; | ||
| } | ||
| delete this.options.configFile; | ||
| } | ||
| /** | ||
| * Registers a new release with sentry. | ||
| * | ||
| * The given release name should be unique and deterministic. It can later be used to | ||
| * upload artifacts, such as source maps. | ||
| * | ||
| * @param {string} release Unique name of the new release. | ||
| * @param {object} options A set of options when creating a release. | ||
| * @param {array} options.projects The list of project slugs for a release. | ||
| * @returns {Promise} A promise that resolves when the release has been created. | ||
| * @memberof SentryReleases | ||
| */ | ||
| async new(release, options) { | ||
| const args = ['releases', 'new', release].concat(helper.getProjectFlagsFromOptions(options)); | ||
| return this.execute(args, null); | ||
| } | ||
| /** | ||
| * Specifies the set of commits covered in this release. | ||
| * | ||
| * @param {string} release Unique name of the release | ||
| * @param {object} options A set of options to configure the commits to include | ||
| * @param {string} options.repo The full repo name as defined in Sentry | ||
| * @param {boolean} options.auto Automatically choose the associated commit (uses | ||
| * the current commit). Overrides other options. | ||
| * @param {string} options.commit The current (last) commit in the release. | ||
| * @param {string} options.previousCommit The commit before the beginning of this | ||
| * release (in other words, the last commit of the previous release). If omitted, | ||
| * this will default to the last commit of the previous release in Sentry. If there | ||
| * was no previous release, the last 10 commits will be used. | ||
| * @param {boolean} options.ignoreMissing When the flag is set and the previous release | ||
| * commit was not found in the repository, will create a release with the default commits | ||
| * count (or the one specified with `--initial-depth`) instead of failing the command. | ||
| * @param {boolean} options.ignoreEmpty When the flag is set, command will not fail | ||
| * and just exit silently if no new commits for a given release have been found. | ||
| * @returns {Promise} A promise that resolves when the commits have been associated | ||
| * @memberof SentryReleases | ||
| */ | ||
| async setCommits(release, options) { | ||
| if (!options || (!options.auto && (!options.repo || !options.commit))) { | ||
| throw new Error('options.auto, or options.repo and options.commit must be specified'); | ||
| /** | ||
| * Registers a new release with sentry. | ||
| * | ||
| * The given release name should be unique and deterministic. It can later be used to | ||
| * upload artifacts, such as source maps. | ||
| * | ||
| * @param {string} release Unique name of the new release. | ||
| * @param {{projects?: string[]}} [options] The list of project slugs for a release. | ||
| * @returns {Promise<string>} A promise that resolves when the release has been created. | ||
| * @memberof SentryReleases | ||
| */ | ||
| new(release, options) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| const args = ['releases', 'new', release].concat(helper.getProjectFlagsFromOptions(options)); | ||
| return this.execute(args, null); | ||
| }); | ||
| } | ||
| let commitFlags = []; | ||
| if (options.auto) { | ||
| commitFlags = ['--auto']; | ||
| } else if (options.previousCommit) { | ||
| commitFlags = ['--commit', `${options.repo}@${options.previousCommit}..${options.commit}`]; | ||
| } else { | ||
| commitFlags = ['--commit', `${options.repo}@${options.commit}`]; | ||
| /** | ||
| * Specifies the set of commits covered in this release. | ||
| * | ||
| * @param {string} release Unique name of the release | ||
| * @param {SentryCliCommitsOptions} options A set of options to configure the commits to include | ||
| * @returns {Promise<string>} A promise that resolves when the commits have been associated | ||
| * @memberof SentryReleases | ||
| */ | ||
| setCommits(release, options) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (!options || (!options.auto && (!options.repo || !options.commit))) { | ||
| throw new Error('options.auto, or options.repo and options.commit must be specified'); | ||
| } | ||
| let commitFlags = []; | ||
| if (options.auto) { | ||
| commitFlags = ['--auto']; | ||
| } | ||
| else if (options.previousCommit) { | ||
| commitFlags = ['--commit', `${options.repo}@${options.previousCommit}..${options.commit}`]; | ||
| } | ||
| else { | ||
| commitFlags = ['--commit', `${options.repo}@${options.commit}`]; | ||
| } | ||
| if (options.ignoreMissing) { | ||
| commitFlags.push('--ignore-missing'); | ||
| } | ||
| return this.execute(['releases', 'set-commits', release].concat(commitFlags), false); | ||
| }); | ||
| } | ||
| if (options.ignoreMissing) { | ||
| commitFlags.push('--ignore-missing'); | ||
| /** | ||
| * Marks this release as complete. This should be called once all artifacts has been | ||
| * uploaded. | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @returns {Promise<string>} A promise that resolves when the release has been finalized. | ||
| * @memberof SentryReleases | ||
| */ | ||
| finalize(release) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| return this.execute(['releases', 'finalize', release], null); | ||
| }); | ||
| } | ||
| return this.execute(['releases', 'set-commits', release].concat(commitFlags), false); | ||
| } | ||
| /** | ||
| * Marks this release as complete. This should be called once all artifacts has been | ||
| * uploaded. | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @returns {Promise} A promise that resolves when the release has been finalized. | ||
| * @memberof SentryReleases | ||
| */ | ||
| async finalize(release) { | ||
| return this.execute(['releases', 'finalize', release], null); | ||
| } | ||
| /** | ||
| * Creates a unique, deterministic version identifier based on the project type and | ||
| * source files. This identifier can be used as release name. | ||
| * | ||
| * @returns {Promise.<string>} A promise that resolves to the version string. | ||
| * @memberof SentryReleases | ||
| */ | ||
| async proposeVersion() { | ||
| const version = await this.execute(['releases', 'propose-version'], null); | ||
| return version.trim(); | ||
| } | ||
| /** | ||
| * Scans the given include folders for JavaScript source maps and uploads them to the | ||
| * specified release for processing. | ||
| * | ||
| * The options require an `include` array, which is a list of directories to scan. | ||
| * Additionally, it supports to ignore certain files, validate and preprocess source | ||
| * maps and define a URL prefix. | ||
| * | ||
| * @example | ||
| * await cli.releases.uploadSourceMaps(cli.releases.proposeVersion(), { | ||
| * // required options: | ||
| * include: ['build'], | ||
| * | ||
| * // default options: | ||
| * ignore: ['node_modules'], // globs for files to ignore | ||
| * ignoreFile: null, // path to a file with ignore rules | ||
| * rewrite: false, // preprocess sourcemaps before uploading | ||
| * sourceMapReference: true, // add a source map reference to source files | ||
| * dedupe: true, // deduplicate already uploaded files | ||
| * stripPrefix: [], // remove certain prefixes from filenames | ||
| * stripCommonPrefix: false, // guess common prefixes to remove from filenames | ||
| * validate: false, // validate source maps and cancel the upload on error | ||
| * urlPrefix: '', // add a prefix source map urls after stripping them | ||
| * urlSuffix: '', // add a suffix source map urls after stripping them | ||
| * ext: ['js', 'map', 'jsbundle', 'bundle'], // override file extensions to scan for | ||
| * projects: ['node'], // provide a list of projects | ||
| * decompress: false // decompress gzip files before uploading | ||
| * live: true // whether to inherit stdio to display `sentry-cli` output directly. | ||
| * }); | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {object} options Options to configure the source map upload. | ||
| * @returns {Promise} A promise that resolves when the upload has completed successfully. | ||
| * @memberof SentryReleases | ||
| */ | ||
| async uploadSourceMaps(release, options) { | ||
| if (!options || !options.include || !Array.isArray(options.include)) { | ||
| throw new Error( | ||
| '`options.include` must be a valid array of paths and/or path descriptor objects.' | ||
| ); | ||
| /** | ||
| * Creates a unique, deterministic version identifier based on the project type and | ||
| * source files. This identifier can be used as release name. | ||
| * | ||
| * @returns {Promise<string>} A promise that resolves to the version string. | ||
| * @memberof SentryReleases | ||
| */ | ||
| proposeVersion() { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| const version = yield this.execute(['releases', 'propose-version'], null); | ||
| return version.trim(); | ||
| }); | ||
| } | ||
| // Each entry in the `include` array will map to an array of promises, which | ||
| // will in turn contain one promise per literal path value. Thus `uploads` | ||
| // will be an array of Promise arrays, which we'll flatten later. | ||
| const uploads = options.include.map((includeEntry) => { | ||
| let pathOptions; | ||
| let uploadPaths; | ||
| if (typeof includeEntry === 'object') { | ||
| pathOptions = includeEntry; | ||
| uploadPaths = includeEntry.paths; | ||
| if (!Array.isArray(uploadPaths)) { | ||
| throw new Error( | ||
| `Path descriptor objects in \`options.include\` must contain a \`paths\` array. Got ${includeEntry}.` | ||
| ); | ||
| } | ||
| } | ||
| // `includeEntry` should be a string, which we can wrap in an array to | ||
| // match the `paths` property in the descriptor object type | ||
| else { | ||
| pathOptions = {}; | ||
| uploadPaths = [includeEntry]; | ||
| } | ||
| const newOptions = { ...options, ...pathOptions }; | ||
| if (!newOptions.ignoreFile && !newOptions.ignore) { | ||
| newOptions.ignore = DEFAULT_IGNORE; | ||
| } | ||
| // args which apply to the entire `include` entry (everything besides the path) | ||
| const args = ['sourcemaps', 'upload'] | ||
| .concat(helper.getProjectFlagsFromOptions(options)) | ||
| .concat(['--release', release]); | ||
| return uploadPaths.map((path) => | ||
| // `execute()` is async and thus we're returning a promise here | ||
| this.execute( | ||
| helper.prepareCommand([...args, path], SOURCEMAPS_SCHEMA, newOptions), | ||
| options.live != null ? options.live : true | ||
| ) | ||
| ); | ||
| }); | ||
| // `uploads` is an array of Promise arrays, which needs to be flattened | ||
| // before being passed to `Promise.all()`. (`Array.flat()` doesn't exist in | ||
| // Node < 11; this polyfill takes advantage of the fact that `concat()` is | ||
| // willing to accept an arbitrary number of items to add to and/or iterables | ||
| // to unpack into the given array.) | ||
| return Promise.all([].concat(...uploads)); | ||
| } | ||
| /** | ||
| * List all deploys for a given release. | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @returns {Promise} A promise that resolves when the list comes back from the server. | ||
| * @memberof SentryReleases | ||
| */ | ||
| async listDeploys(release) { | ||
| return this.execute(['releases', 'deploys', release, 'list'], null); | ||
| } | ||
| /** | ||
| * Creates a new release deployment. This should be called after the release has been | ||
| * finalized, while deploying on a given environment. | ||
| * | ||
| * @example | ||
| * await cli.releases.newDeploy(cli.releases.proposeVersion(), { | ||
| * // required options: | ||
| * env: 'production', // environment for this release. Values that make sense here would be 'production' or 'staging' | ||
| * | ||
| * // optional options: | ||
| * started: 42, // unix timestamp when the deployment started | ||
| * finished: 1337, // unix timestamp when the deployment finished | ||
| * time: 1295, // deployment duration in seconds. This can be specified alternatively to `started` and `finished` | ||
| * name: 'PickleRick', // human readable name for this deployment | ||
| * url: 'https://example.com', // URL that points to the deployment | ||
| * }); | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {object} options Options to configure the new release deploy. | ||
| * @returns {Promise} A promise that resolves when the deploy has been created. | ||
| * @memberof SentryReleases | ||
| */ | ||
| async newDeploy(release, options) { | ||
| if (!options || !options.env) { | ||
| throw new Error('options.env must be a valid name'); | ||
| /** | ||
| * Scans the given include folders for JavaScript source maps and uploads them to the | ||
| * specified release for processing. | ||
| * | ||
| * The options require an `include` array, which is a list of directories to scan. | ||
| * Additionally, it supports to ignore certain files, validate and preprocess source | ||
| * maps and define a URL prefix. | ||
| * | ||
| * @example | ||
| * await cli.releases.uploadSourceMaps(cli.releases.proposeVersion(), { | ||
| * // required options: | ||
| * include: ['build'], | ||
| * | ||
| * // default options: | ||
| * ignore: ['node_modules'], // globs for files to ignore | ||
| * ignoreFile: null, // path to a file with ignore rules | ||
| * rewrite: false, // preprocess sourcemaps before uploading | ||
| * sourceMapReference: true, // add a source map reference to source files | ||
| * dedupe: true, // deduplicate already uploaded files | ||
| * stripPrefix: [], // remove certain prefixes from filenames | ||
| * stripCommonPrefix: false, // guess common prefixes to remove from filenames | ||
| * validate: false, // validate source maps and cancel the upload on error | ||
| * urlPrefix: '', // add a prefix source map urls after stripping them | ||
| * urlSuffix: '', // add a suffix source map urls after stripping them | ||
| * ext: ['js', 'map', 'jsbundle', 'bundle'], // override file extensions to scan for | ||
| * projects: ['node'], // provide a list of projects | ||
| * decompress: false // decompress gzip files before uploading | ||
| * live: true // whether to inherit stdio to display `sentry-cli` output directly. | ||
| * }); | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {SentryCliUploadSourceMapsOptions & {live?: boolean | 'rejectOnError'}} options Options to configure the source map upload. | ||
| * @returns {Promise<string[]>} A promise that resolves when the upload has completed successfully. | ||
| * @memberof SentryReleases | ||
| */ | ||
| uploadSourceMaps(release, options) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (!options || !options.include || !Array.isArray(options.include)) { | ||
| throw new Error('`options.include` must be a valid array of paths and/or path descriptor objects.'); | ||
| } | ||
| // Each entry in the `include` array will map to an array of promises, which | ||
| // will in turn contain one promise per literal path value. Thus `uploads` | ||
| // will be an array of Promise arrays, which we'll flatten later. | ||
| const uploads = options.include.map((includeEntry) => { | ||
| let pathOptions; | ||
| let uploadPaths; | ||
| if (typeof includeEntry === 'object') { | ||
| pathOptions = includeEntry; | ||
| uploadPaths = includeEntry.paths; | ||
| if (!Array.isArray(uploadPaths)) { | ||
| throw new Error(`Path descriptor objects in \`options.include\` must contain a \`paths\` array. Got ${includeEntry}.`); | ||
| } | ||
| } | ||
| // `includeEntry` should be a string, which we can wrap in an array to | ||
| // match the `paths` property in the descriptor object type | ||
| else { | ||
| pathOptions = {}; | ||
| uploadPaths = [includeEntry]; | ||
| } | ||
| const newOptions = Object.assign(Object.assign({}, options), pathOptions); | ||
| if (!newOptions.ignoreFile && !newOptions.ignore) { | ||
| newOptions.ignore = DEFAULT_IGNORE; | ||
| } | ||
| // args which apply to the entire `include` entry (everything besides the path) | ||
| const args = ['sourcemaps', 'upload'] | ||
| .concat(helper.getProjectFlagsFromOptions(options)) | ||
| .concat(['--release', release]); | ||
| return uploadPaths.map((path) => | ||
| // `execute()` is async and thus we're returning a promise here | ||
| this.execute(helper.prepareCommand([...args, path], SOURCEMAPS_SCHEMA, newOptions), options.live != null ? options.live : true)); | ||
| }); | ||
| // `uploads` is an array of Promise arrays, which needs to be flattened | ||
| // before being passed to `Promise.all()`. (`Array.flat()` doesn't exist in | ||
| // Node < 11; this polyfill takes advantage of the fact that `concat()` is | ||
| // willing to accept an arbitrary number of items to add to and/or iterables | ||
| // to unpack into the given array.) | ||
| return Promise.all([].concat(...uploads)); | ||
| }); | ||
| } | ||
| const args = ['releases', 'deploys', release, 'new']; | ||
| return this.execute(helper.prepareCommand(args, DEPLOYS_SCHEMA, options), null); | ||
| } | ||
| /** | ||
| * See {helper.execute} docs. | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * @returns {Promise.<string>} A promise that resolves to the standard output. | ||
| */ | ||
| async execute(args, live) { | ||
| return helper.execute(args, live, this.options.silent, this.configFile, this.options); | ||
| } | ||
| /** | ||
| * List all deploys for a given release. | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @returns {Promise<string>} A promise that resolves when the list comes back from the server. | ||
| * @memberof SentryReleases | ||
| */ | ||
| listDeploys(release) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| return this.execute(['releases', 'deploys', release, 'list'], null); | ||
| }); | ||
| } | ||
| /** | ||
| * Creates a new release deployment. This should be called after the release has been | ||
| * finalized, while deploying on a given environment. | ||
| * | ||
| * @example | ||
| * await cli.releases.newDeploy(cli.releases.proposeVersion(), { | ||
| * // required options: | ||
| * env: 'production', // environment for this release. Values that make sense here would be 'production' or 'staging' | ||
| * | ||
| * // optional options: | ||
| * started: 42, // unix timestamp when the deployment started | ||
| * finished: 1337, // unix timestamp when the deployment finished | ||
| * time: 1295, // deployment duration in seconds. This can be specified alternatively to `started` and `finished` | ||
| * name: 'PickleRick', // human readable name for this deployment | ||
| * url: 'https://example.com', // URL that points to the deployment | ||
| * }); | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {SentryCliNewDeployOptions} options Options to configure the new release deploy. | ||
| * @returns {Promise<string>} A promise that resolves when the deploy has been created. | ||
| * @memberof SentryReleases | ||
| */ | ||
| newDeploy(release, options) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (!options || !options.env) { | ||
| throw new Error('options.env must be a valid name'); | ||
| } | ||
| const args = ['releases', 'deploys', release, 'new']; | ||
| return this.execute(helper.prepareCommand(args, DEPLOYS_SCHEMA, options), null); | ||
| }); | ||
| } | ||
| /** | ||
| * See {helper.execute} docs. | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * @returns {Promise<string>} A promise that resolves to the standard output. | ||
| */ | ||
| execute(args, live) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| return helper.execute(args, live, this.options.silent, this.configFile, this.options); | ||
| }); | ||
| } | ||
| } | ||
| module.exports = Releases; |
@@ -5,26 +5,26 @@ /** | ||
| module.exports = { | ||
| env: { | ||
| param: '--env', | ||
| type: 'string', | ||
| }, | ||
| started: { | ||
| param: '--started', | ||
| type: 'number', | ||
| }, | ||
| finished: { | ||
| param: '--finished', | ||
| type: 'number', | ||
| }, | ||
| time: { | ||
| param: '--time', | ||
| type: 'number', | ||
| }, | ||
| name: { | ||
| param: '--name', | ||
| type: 'string', | ||
| }, | ||
| url: { | ||
| param: '--url', | ||
| type: 'string', | ||
| }, | ||
| env: { | ||
| param: '--env', | ||
| type: 'string', | ||
| }, | ||
| started: { | ||
| param: '--started', | ||
| type: 'number', | ||
| }, | ||
| finished: { | ||
| param: '--finished', | ||
| type: 'number', | ||
| }, | ||
| time: { | ||
| param: '--time', | ||
| type: 'number', | ||
| }, | ||
| name: { | ||
| param: '--name', | ||
| type: 'string', | ||
| }, | ||
| url: { | ||
| param: '--url', | ||
| type: 'string', | ||
| }, | ||
| }; |
@@ -5,59 +5,59 @@ /** | ||
| module.exports = { | ||
| ignore: { | ||
| param: '--ignore', | ||
| type: 'array', | ||
| }, | ||
| ignoreFile: { | ||
| param: '--ignore-file', | ||
| type: 'string', | ||
| }, | ||
| dist: { | ||
| param: '--dist', | ||
| type: 'string', | ||
| }, | ||
| decompress: { | ||
| param: '--decompress', | ||
| type: 'boolean', | ||
| }, | ||
| rewrite: { | ||
| param: '--rewrite', | ||
| invertedParam: '--no-rewrite', | ||
| type: 'boolean', | ||
| }, | ||
| sourceMapReference: { | ||
| invertedParam: '--no-sourcemap-reference', | ||
| type: 'boolean', | ||
| }, | ||
| dedupe: { | ||
| invertedParam: '--no-dedupe', | ||
| type: 'boolean', | ||
| }, | ||
| stripPrefix: { | ||
| param: '--strip-prefix', | ||
| type: 'array', | ||
| }, | ||
| stripCommonPrefix: { | ||
| param: '--strip-common-prefix', | ||
| type: 'boolean', | ||
| }, | ||
| validate: { | ||
| param: '--validate', | ||
| type: 'boolean', | ||
| }, | ||
| urlPrefix: { | ||
| param: '--url-prefix', | ||
| type: 'string', | ||
| }, | ||
| urlSuffix: { | ||
| param: '--url-suffix', | ||
| type: 'string', | ||
| }, | ||
| ext: { | ||
| param: '--ext', | ||
| type: 'array', | ||
| }, | ||
| useArtifactBundle: { | ||
| param: '--use-artifact-bundle', | ||
| type: 'boolean', | ||
| }, | ||
| ignore: { | ||
| param: '--ignore', | ||
| type: 'array', | ||
| }, | ||
| ignoreFile: { | ||
| param: '--ignore-file', | ||
| type: 'string', | ||
| }, | ||
| dist: { | ||
| param: '--dist', | ||
| type: 'string', | ||
| }, | ||
| decompress: { | ||
| param: '--decompress', | ||
| type: 'boolean', | ||
| }, | ||
| rewrite: { | ||
| param: '--rewrite', | ||
| invertedParam: '--no-rewrite', | ||
| type: 'boolean', | ||
| }, | ||
| sourceMapReference: { | ||
| invertedParam: '--no-sourcemap-reference', | ||
| type: 'boolean', | ||
| }, | ||
| dedupe: { | ||
| invertedParam: '--no-dedupe', | ||
| type: 'boolean', | ||
| }, | ||
| stripPrefix: { | ||
| param: '--strip-prefix', | ||
| type: 'array', | ||
| }, | ||
| stripCommonPrefix: { | ||
| param: '--strip-common-prefix', | ||
| type: 'boolean', | ||
| }, | ||
| validate: { | ||
| param: '--validate', | ||
| type: 'boolean', | ||
| }, | ||
| urlPrefix: { | ||
| param: '--url-prefix', | ||
| type: 'string', | ||
| }, | ||
| urlSuffix: { | ||
| param: '--url-suffix', | ||
| type: 'string', | ||
| }, | ||
| ext: { | ||
| param: '--ext', | ||
| type: 'array', | ||
| }, | ||
| useArtifactBundle: { | ||
| param: '--use-artifact-bundle', | ||
| type: 'boolean', | ||
| }, | ||
| }; |
+105
-22
@@ -1,27 +0,110 @@ | ||
| Copyright (c) 2016-2025 Sentry (https://sentry.io/) and individual contributors. | ||
| All rights reserved. | ||
| # Functional Source License, Version 1.1, MIT Future License | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
| ## Abbreviation | ||
| 1. Redistributions of source code must retain the above copyright notice, | ||
| this list of conditions and the following disclaimer. | ||
| FSL-1.1-MIT | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
| ## Notice | ||
| 3. Neither the name of the Sentry nor the names of its contributors may be | ||
| used to endorse or promote products derived from this software without specific | ||
| prior written permission. | ||
| Copyright 2008-2025 Functional Software, Inc. dba Sentry | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| ## Terms and Conditions | ||
| ### Licensor ("We") | ||
| The party offering the Software under these Terms and Conditions. | ||
| ### The Software | ||
| The "Software" is each version of the software that we make available under | ||
| these Terms and Conditions, as indicated by our inclusion of these Terms and | ||
| Conditions with the Software. | ||
| ### License Grant | ||
| Subject to your compliance with this License Grant and the Patents, | ||
| Redistribution and Trademark clauses below, we hereby grant you the right to | ||
| use, copy, modify, create derivative works, publicly perform, publicly display | ||
| and redistribute the Software for any Permitted Purpose identified below. | ||
| ### Permitted Purpose | ||
| A Permitted Purpose is any purpose other than a Competing Use. A Competing Use | ||
| means making the Software available to others in a commercial product or | ||
| service that: | ||
| 1. substitutes for the Software; | ||
| 2. substitutes for any other product or service we offer using the Software | ||
| that exists as of the date we make the Software available; or | ||
| 3. offers the same or substantially similar functionality as the Software. | ||
| Permitted Purposes specifically include using the Software: | ||
| 1. for your internal use and access; | ||
| 2. for non-commercial education; | ||
| 3. for non-commercial research; and | ||
| 4. in connection with professional services that you provide to a licensee | ||
| using the Software in accordance with these Terms and Conditions. | ||
| ### Patents | ||
| To the extent your use for a Permitted Purpose would necessarily infringe our | ||
| patents, the license grant above includes a license under our patents. If you | ||
| make a claim against any party that the Software infringes or contributes to | ||
| the infringement of any patent, then your patent license to the Software ends | ||
| immediately. | ||
| ### Redistribution | ||
| The Terms and Conditions apply to all copies, modifications and derivatives of | ||
| the Software. | ||
| If you redistribute any copies, modifications or derivatives of the Software, | ||
| you must include a copy of or a link to these Terms and Conditions and not | ||
| remove any copyright notices provided in or with the Software. | ||
| ### Disclaimer | ||
| THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR | ||
| PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT. | ||
| IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE | ||
| SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, | ||
| EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE. | ||
| ### Trademarks | ||
| Except for displaying the License Details and identifying us as the origin of | ||
| the Software, you have no right under these Terms and Conditions to use our | ||
| trademarks, trade names, service marks or product names. | ||
| ## Grant of Future License | ||
| We hereby irrevocably grant you an additional license to use the Software under | ||
| the MIT license that is effective on the second anniversary of the date we make | ||
| the Software available. On or after that date, you may use the Software under | ||
| the MIT license, in which case the following will apply: | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| this software and associated documentation files (the "Software"), to deal in | ||
| the Software without restriction, including without limitation the rights to | ||
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
| of the Software, and to permit persons to whom the Software is furnished to do | ||
| so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
+19
-16
| { | ||
| "name": "@sentry/cli", | ||
| "version": "2.58.2", | ||
| "version": "2.58.3-alpha0", | ||
| "description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/", | ||
@@ -8,3 +8,3 @@ "repository": "git://github.com/getsentry/sentry-cli.git", | ||
| "author": "Sentry", | ||
| "license": "BSD-3-Clause", | ||
| "license": "FSL-1.1-MIT", | ||
| "engines": { | ||
@@ -33,24 +33,27 @@ "node": ">= 10" | ||
| "prettier": "2.8.8", | ||
| "typescript": "~5.8.3" | ||
| "typescript": "5.8.3" | ||
| }, | ||
| "optionalDependencies": { | ||
| "@sentry/cli-darwin": "2.58.2", | ||
| "@sentry/cli-linux-arm": "2.58.2", | ||
| "@sentry/cli-linux-arm64": "2.58.2", | ||
| "@sentry/cli-linux-i686": "2.58.2", | ||
| "@sentry/cli-linux-x64": "2.58.2", | ||
| "@sentry/cli-win32-i686": "2.58.2", | ||
| "@sentry/cli-win32-x64": "2.58.2", | ||
| "@sentry/cli-win32-arm64": "2.58.2" | ||
| "@sentry/cli-darwin": "2.58.3-alpha0", | ||
| "@sentry/cli-linux-arm": "2.58.3-alpha0", | ||
| "@sentry/cli-linux-arm64": "2.58.3-alpha0", | ||
| "@sentry/cli-linux-i686": "2.58.3-alpha0", | ||
| "@sentry/cli-linux-x64": "2.58.3-alpha0", | ||
| "@sentry/cli-win32-i686": "2.58.3-alpha0", | ||
| "@sentry/cli-win32-x64": "2.58.3-alpha0", | ||
| "@sentry/cli-win32-arm64": "2.58.3-alpha0" | ||
| }, | ||
| "scripts": { | ||
| "postinstall": "node ./scripts/install.js", | ||
| "postinstall": "npm run install-cli", | ||
| "build": "tsc", | ||
| "install-cli": "node ./scripts/install.js", | ||
| "prepack": "npm run build", | ||
| "fix": "npm-run-all fix:eslint fix:prettier", | ||
| "fix:eslint": "eslint --fix bin/* scripts/**/*.js js/**/*.js", | ||
| "fix:prettier": "prettier --write bin/* scripts/**/*.js js/**/*.js", | ||
| "fix:eslint": "eslint --fix bin/* scripts/**/*.js lib/**/*.js", | ||
| "fix:prettier": "prettier --write bin/* scripts/**/*.js lib/**/*.js", | ||
| "test": "npm-run-all test:jest test:eslint test:prettier test:vercel-nft", | ||
| "test:jest": "jest", | ||
| "test:watch": "jest --watch --notify", | ||
| "test:eslint": "eslint bin/* scripts/**/*.js js/**/*.js", | ||
| "test:prettier": "prettier --check bin/* scripts/**/*.js js/**/*.js", | ||
| "test:eslint": "eslint bin/* scripts/**/*.js lib/**/*.js", | ||
| "test:prettier": "prettier --check bin/* scripts/**/*.js lib/**/*.js", | ||
| "check:types": "tsc --noEmit", | ||
@@ -57,0 +60,0 @@ "test:vercel-nft": "node scripts/test-vercel-nft.js" |
Install scripts
Supply chain riskInstall scripts are run when the package is installed or built. Malicious packages often use scripts that run automatically to execute payloads or fetch additional code.
Found 1 instance in 1 package
Misc. License Issues
LicenseA package's licensing information has fine-grained problems.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 13 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Non-permissive License
LicenseA license not known to be considered permissive was found.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed or built. Malicious packages often use scripts that run automatically to execute payloads or fetch additional code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 13 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
89616
33.73%25
38.89%1694
30.01%23
-11.54%2
Infinity%1
Infinity%90
-10%1
Infinity%