@sentry/cli 2.58.4 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,6 +18,27 @@ Sentry CLI can be used for many tasks, including uploading debug symbols and sou
18
18
 
19
19
  Please refer to [Sentry CLI's documentation page](https://docs.sentry.io/cli/).
20
20
 
21
+ ## Compatibility
22
+
23
+ Sentry CLI officially supports [Sentry SaaS](https://sentry.io/) and [Sentry Self-Hosted](https://github.com/getsentry/self-hosted) versions 25.11.1 and above.
24
+
25
+ ### Self-Hosted Sentry
26
+
27
+ Although some Sentry CLI features may work with versions of Sentry Self-Hosted prior to 25.11.1, we recommend users upgrade their self-hosted installations to a compatible version.
28
+
29
+ For users who cannot upgrade their self-hosted installation, we recommend using the latest compatible Sentry CLI version, per the table below:
30
+
31
+ | **Sentry Self-Hosted Version** | **Newest Compatible Sentry CLI Version** |
32
+ | ------------------------------ | --------------------------------------------------------------------- |
33
+ | ≥ 25.11.1 | [latest](https://github.com/getsentry/sentry-cli/releases/latest) |
34
+ | < 25.11.1 | [2.58.4](https://github.com/getsentry/sentry-cli/releases/tag/2.58.4) |
35
+
36
+ Note that we can only provide support for officially-supported Sentry Self-Hosted versions. We will not backport fixes for older Sentry CLI versions, even if they should be compatible with your self-hosted version.
37
+
38
+ ## Versioning
39
+
40
+ Sentry CLI follows semantic versioning, according to [this versioning policy](VERSIONING.md).
41
+
21
42
  ## Compiling
22
43
 
23
44
  In case you want to compile this yourself, you need to install at minimum the
package/bin/sentry-cli CHANGED
@@ -3,7 +3,7 @@
3
3
  'use strict';
4
4
 
5
5
  const childProcess = require('child_process');
6
- const SentryCli = require('../js');
6
+ const { SentryCli } = require('../js');
7
7
 
8
8
  const child = childProcess
9
9
  .spawn(SentryCli.getPath(), process.argv.slice(2), {
package/checksums.txt CHANGED
@@ -1,10 +1,10 @@
1
- sentry-cli-Darwin-arm64=3f5065e7177188f9c193c66ca788eb956ef95a864845876552c51f5aa577ed30
2
- sentry-cli-Darwin-universal=5a1c1121b45c48504d2ae58af11c743c5663ea8979db3258961838a16cf90c08
3
- sentry-cli-Darwin-x86_64=87149438e1c4becdb54a8302832cacc9429638eadefd09d370b4806bec20a078
4
- sentry-cli-Linux-aarch64=672cb986b0c5d84ef724f39b3aa189be802bceb8bc7dc8c5776a0ca90fcf41bd
5
- sentry-cli-Linux-armv7=e8df469ae35f6d8cd788fe2967c5420633bb09348ad09953d5176615cf1bead0
6
- sentry-cli-Linux-i686=1b05efec7bc2ebf4dca8f3e6ededa8ffedf8ee2dd49e23d434a20885bc9a50cf
7
- sentry-cli-Linux-x86_64=a4932b4315b192b3d037678a16eb2a5a8731609f671fc4008e643b85c3c74cb6
8
- sentry-cli-Windows-aarch64.exe=4e18e8d293366096d26573e31d03544ea16d9310f12450db1618ba55acfef8c4
9
- sentry-cli-Windows-i686.exe=e7314b4b95b969378a46be45b087dfe8cc5c017aceb43a5bbcab3d5e7d6730ea
10
- sentry-cli-Windows-x86_64.exe=6183f8ef1d4823290ba95656654714a3c5c216914229b3914acd99a8b4be812d
1
+ sentry-cli-Darwin-arm64=bf6f18200b98f0a79bfbcff8b6b9a01b6960f52befb024616cb211f326f8ce23
2
+ sentry-cli-Darwin-universal=720af732451032b5be7df75baacc313ea21ee645f9ad4872d0a39524db274981
3
+ sentry-cli-Darwin-x86_64=b641eb37c84993fbc4ef21b4bed499967c711035ecb85421f3ce9abe635b2499
4
+ sentry-cli-Linux-aarch64=5eaa180ae11e63af80cab6303a8d223dddb7dcea7c0a7c933b26fa91b54c9cf6
5
+ sentry-cli-Linux-armv7=3dc9cb18e302db1bd1c7c6edb2cdbe0fe250ab4b815787f551a07553b692e42b
6
+ sentry-cli-Linux-i686=c6214a8f34b39e572d5e9dbebe118d26e4707ceced807439bfb845b6b8373c29
7
+ sentry-cli-Linux-x86_64=7cf53a2089fd5a6a9a0c2eb972d62c9c8eefea19dcdd5dd58604aa8bc4212538
8
+ sentry-cli-Windows-aarch64.exe=d57556d2e1cb4f52af367c1f23101dc30963e080c99cf670aec87001533265ed
9
+ sentry-cli-Windows-i686.exe=e691b753e7477bc7ec72cd7b8149e34ef52754cbbcb774823c885576215f4683
10
+ sentry-cli-Windows-x86_64.exe=a85b00f651ae73c345a75788378f31b210226193d54e421fe2d3974392af591b
package/js/helper.d.ts CHANGED
@@ -1,30 +1,60 @@
1
+ import { SentryCliOptions } from './types';
1
2
  /**
2
- * The javascript type of a command line option.
3
+ * This convoluted function resolves the path to the manually downloaded fallback
4
+ * `sentry-cli` binary in a way that can't be analysed by @vercel/nft.
5
+ *
6
+ * Without this, the binary can be detected as an asset and included by bundlers
7
+ * that use @vercel/nft.
8
+ *
9
+ * @returns The path to the sentry-cli binary
10
+ */
11
+ declare function getFallbackBinaryPath(): string;
12
+ declare function getDistributionForThisPlatform(): {
13
+ packageName: any;
14
+ subpath: any;
15
+ };
16
+ /**
17
+ * Throws an error with a message stating that Sentry CLI doesn't support the current platform.
18
+ *
19
+ * @returns nothing. It throws.
3
20
  */
4
- export type OptionType = "array" | "string" | "boolean" | "inverted-boolean";
21
+ declare function throwUnsupportedPlatformError(): void;
5
22
  /**
6
- * Schema definition of a command line option.
23
+ * Overrides the default binary path with a mock value, useful for testing.
24
+ *
25
+ * @param mockPath The new path to the mock sentry-cli binary
26
+ * @deprecated This was used in tests internally and will be removed in the next major version.
7
27
  */
8
- export type OptionSchema = {
9
- /**
10
- * The flag of the command line option including dashes.
11
- */
28
+ declare function mockBinaryPath(mockPath: string): void;
29
+ export type OptionsSchema = Record<string, {
12
30
  param: string;
13
- /**
14
- * The value type of the command line option.
15
- */
16
- type: OptionType;
17
- /**
18
- * The flag of the command line option including dashes (optional).
19
- */
31
+ type: 'array' | 'string' | 'number' | 'boolean' | 'inverted-boolean';
20
32
  invertedParam?: string;
21
- };
33
+ } | {
34
+ param?: never;
35
+ type: 'array' | 'string' | 'number' | 'boolean' | 'inverted-boolean';
36
+ invertedParam: string;
37
+ }>;
22
38
  /**
23
- * Schema definition for a command.
39
+ * Serializes command line options into an arguments array.
40
+ *
41
+ * @param schema An options schema required by the command.
42
+ * @param options An options object according to the schema.
24
43
  */
25
- export type OptionsSchema = {
26
- [x: string]: OptionSchema;
27
- };
44
+ declare function serializeOptions(schema: OptionsSchema, options: Record<string, unknown>): string[];
45
+ /**
46
+ * Serializes the command and its options into an arguments array.
47
+ *
48
+ * @param command The literal name of the command.
49
+ * @param schema An options schema required by the command.
50
+ * @param options An options object according to the schema.
51
+ * @returns An arguments array that can be passed via command line.
52
+ */
53
+ declare function prepareCommand(command: string[], schema: OptionsSchema, options: Record<string, unknown>): string[];
54
+ /**
55
+ * Returns the absolute path to the `sentry-cli` binary.
56
+ */
57
+ declare function getPath(): string;
28
58
  /**
29
59
  * Runs `sentry-cli` with the given command line arguments.
30
60
  *
@@ -42,82 +72,18 @@ export type OptionsSchema = {
42
72
  * const output = await execute(['--version']);
43
73
  * expect(output.trim()).toBe('sentry-cli x.y.z');
44
74
  *
45
- * @param {string[]} args Command line arguments passed to `sentry-cli`.
46
- * @param {boolean | 'rejectOnError'} live can be set to:
47
- * - `true` to inherit stdio to display `sentry-cli` output directly.
48
- * - `false` to not inherit stdio and return the output as a string.
49
- * - `'rejectOnError'` to inherit stdio and reject the promise if the command
75
+ * @param args Command line arguments passed to `sentry-cli`.
76
+ * @param live can be set to:
77
+ * - `true` to inherit stdio and reject the promise if the command
50
78
  * exits with a non-zero exit code.
51
- * @param {boolean} silent Disable stdout for silents build (CI/Webpack Stats, ...)
52
- * @param {string} [configFile] Relative or absolute path to the configuration file.
53
- * @param {import('./index').SentryCliOptions} [config] More configuration to pass to the CLI
54
- * @returns {Promise<string>} A promise that resolves to the standard output.
55
- */
56
- export function execute(args: string[], live: boolean | "rejectOnError", silent: boolean, configFile?: string, config?: import("./index").SentryCliOptions): Promise<string>;
57
- /**
58
- * Returns the absolute path to the `sentry-cli` binary.
59
- * @returns {string}
79
+ * - `false` to not inherit stdio and return the output as a string.
80
+ * @param silent Disable stdout for silents build (CI/Webpack Stats, ...)
81
+ * @param configFile Relative or absolute path to the configuration file.
82
+ * @param config More configuration to pass to the CLI
83
+ * @returns A promise that resolves to the standard output.
60
84
  */
61
- export function getPath(): string;
62
- export function getProjectFlagsFromOptions({ projects }?: {
85
+ declare function execute(args: string[], live: boolean, silent: boolean, configFile: string | undefined, config?: SentryCliOptions): Promise<string>;
86
+ declare function getProjectFlagsFromOptions({ projects }?: {
63
87
  projects?: any[];
64
88
  }): any;
65
- /**
66
- * Overrides the default binary path with a mock value, useful for testing.
67
- *
68
- * @param {string} mockPath The new path to the mock sentry-cli binary
69
- * @deprecated This was used in tests internally and will be removed in the next major version.
70
- */
71
- export function mockBinaryPath(mockPath: string): void;
72
- /**
73
- * Serializes the command and its options into an arguments array.
74
- *
75
- * @param {string[]} command The literal name of the command.
76
- * @param {OptionsSchema} [schema] An options schema required by the command.
77
- * @param {object} [options] An options object according to the schema.
78
- * @returns {string[]} An arguments array that can be passed via command line.
79
- */
80
- export function prepareCommand(command: string[], schema?: OptionsSchema, options?: object): string[];
81
- /**
82
- * The javascript type of a command line option.
83
- * @typedef {'array'|'string'|'boolean'|'inverted-boolean'} OptionType
84
- */
85
- /**
86
- * Schema definition of a command line option.
87
- * @typedef {object} OptionSchema
88
- * @prop {string} param The flag of the command line option including dashes.
89
- * @prop {OptionType} type The value type of the command line option.
90
- * @prop {string} [invertedParam] The flag of the command line option including dashes (optional).
91
- */
92
- /**
93
- * Schema definition for a command.
94
- * @typedef {Object.<string, OptionSchema>} OptionsSchema
95
- */
96
- /**
97
- * Serializes command line options into an arguments array.
98
- *
99
- * @param {OptionsSchema} schema An options schema required by the command.
100
- * @param {object} options An options object according to the schema.
101
- * @returns {string[]} An arguments array that can be passed via command line.
102
- */
103
- export function serializeOptions(schema: OptionsSchema, options: object): string[];
104
- export function getDistributionForThisPlatform(): {
105
- packageName: string;
106
- subpath: string;
107
- };
108
- /**
109
- * Throws an error with a message stating that Sentry CLI doesn't support the current platform.
110
- *
111
- * @returns {never} nothing. It throws.
112
- */
113
- export function throwUnsupportedPlatformError(): never;
114
- /**
115
- * This convoluted function resolves the path to the manually downloaded fallback
116
- * `sentry-cli` binary in a way that can't be analysed by @vercel/nft.
117
- *
118
- * Without this, the binary can be detected as an asset and included by bundlers
119
- * that use @vercel/nft.
120
- *
121
- * @returns {string} The path to the sentry-cli binary
122
- */
123
- export function getFallbackBinaryPath(): string;
89
+ export { execute, getPath, getProjectFlagsFromOptions, mockBinaryPath, prepareCommand, serializeOptions, getDistributionForThisPlatform, throwUnsupportedPlatformError, getFallbackBinaryPath, };
package/js/helper.js CHANGED
@@ -8,10 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- const os = require('os');
12
- const path = require('path');
13
- const fs = require('fs');
14
- const childProcess = require('child_process');
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.execute = execute;
13
+ exports.getPath = getPath;
14
+ exports.getProjectFlagsFromOptions = getProjectFlagsFromOptions;
15
+ exports.mockBinaryPath = mockBinaryPath;
16
+ exports.prepareCommand = prepareCommand;
17
+ exports.serializeOptions = serializeOptions;
18
+ exports.getDistributionForThisPlatform = getDistributionForThisPlatform;
19
+ exports.throwUnsupportedPlatformError = throwUnsupportedPlatformError;
20
+ exports.getFallbackBinaryPath = getFallbackBinaryPath;
21
+ const os = require("node:os");
22
+ const path = require("node:path");
23
+ const fs = require("node:fs");
24
+ const childProcess = require("node:child_process");
15
25
  const BINARY_DISTRIBUTIONS = [
16
26
  { packageName: '@sentry/cli-darwin', subpath: 'bin/sentry-cli' },
17
27
  { packageName: '@sentry/cli-linux-x64', subpath: 'bin/sentry-cli' },
@@ -29,7 +39,7 @@ const BINARY_DISTRIBUTIONS = [
29
39
  * Without this, the binary can be detected as an asset and included by bundlers
30
40
  * that use @vercel/nft.
31
41
  *
32
- * @returns {string} The path to the sentry-cli binary
42
+ * @returns The path to the sentry-cli binary
33
43
  */
34
44
  function getFallbackBinaryPath() {
35
45
  const parts = [];
@@ -96,7 +106,7 @@ function getDistributionForThisPlatform() {
96
106
  /**
97
107
  * Throws an error with a message stating that Sentry CLI doesn't support the current platform.
98
108
  *
99
- * @returns {never} nothing. It throws.
109
+ * @returns nothing. It throws.
100
110
  */
101
111
  function throwUnsupportedPlatformError() {
102
112
  throw new Error(`Unsupported operating system or architecture! Sentry CLI does not work on this architecture.
@@ -110,7 +120,7 @@ Sentry CLI supports:
110
120
  * Tries to find the installed Sentry CLI binary - either by looking into the relevant
111
121
  * optional dependencies or by trying to resolve the fallback binary.
112
122
  *
113
- * @returns {string} The path to the sentry-cli binary
123
+ * @returns The path to the sentry-cli binary
114
124
  */
115
125
  function getBinaryPath() {
116
126
  if (process.env.SENTRY_BINARY_PATH) {
@@ -157,40 +167,23 @@ It seems like none of the "@sentry/cli" package's optional dependencies got inst
157
167
  }
158
168
  /**
159
169
  * Will be used as the binary path when defined with `mockBinaryPath`.
160
- * @type {string | undefined}
161
170
  */
162
171
  let mockedBinaryPath;
163
172
  /**
164
173
  * Overrides the default binary path with a mock value, useful for testing.
165
174
  *
166
- * @param {string} mockPath The new path to the mock sentry-cli binary
175
+ * @param mockPath The new path to the mock sentry-cli binary
167
176
  * @deprecated This was used in tests internally and will be removed in the next major version.
168
177
  */
169
178
  // TODO(v3): Remove this function
170
179
  function mockBinaryPath(mockPath) {
171
180
  mockedBinaryPath = mockPath;
172
181
  }
173
- /**
174
- * The javascript type of a command line option.
175
- * @typedef {'array'|'string'|'boolean'|'inverted-boolean'} OptionType
176
- */
177
- /**
178
- * Schema definition of a command line option.
179
- * @typedef {object} OptionSchema
180
- * @prop {string} param The flag of the command line option including dashes.
181
- * @prop {OptionType} type The value type of the command line option.
182
- * @prop {string} [invertedParam] The flag of the command line option including dashes (optional).
183
- */
184
- /**
185
- * Schema definition for a command.
186
- * @typedef {Object.<string, OptionSchema>} OptionsSchema
187
- */
188
182
  /**
189
183
  * Serializes command line options into an arguments array.
190
184
  *
191
- * @param {OptionsSchema} schema An options schema required by the command.
192
- * @param {object} options An options object according to the schema.
193
- * @returns {string[]} An arguments array that can be passed via command line.
185
+ * @param schema An options schema required by the command.
186
+ * @param options An options object according to the schema.
194
187
  */
195
188
  function serializeOptions(schema, options) {
196
189
  return Object.keys(schema).reduce((newOptions, option) => {
@@ -225,17 +218,16 @@ function serializeOptions(schema, options) {
225
218
  /**
226
219
  * Serializes the command and its options into an arguments array.
227
220
  *
228
- * @param {string[]} command The literal name of the command.
229
- * @param {OptionsSchema} [schema] An options schema required by the command.
230
- * @param {object} [options] An options object according to the schema.
231
- * @returns {string[]} An arguments array that can be passed via command line.
221
+ * @param command The literal name of the command.
222
+ * @param schema An options schema required by the command.
223
+ * @param options An options object according to the schema.
224
+ * @returns An arguments array that can be passed via command line.
232
225
  */
233
226
  function prepareCommand(command, schema, options) {
234
227
  return command.concat(serializeOptions(schema || {}, options || {}));
235
228
  }
236
229
  /**
237
230
  * Returns the absolute path to the `sentry-cli` binary.
238
- * @returns {string}
239
231
  */
240
232
  function getPath() {
241
233
  return mockedBinaryPath !== undefined ? mockedBinaryPath : getBinaryPath();
@@ -257,16 +249,15 @@ function getPath() {
257
249
  * const output = await execute(['--version']);
258
250
  * expect(output.trim()).toBe('sentry-cli x.y.z');
259
251
  *
260
- * @param {string[]} args Command line arguments passed to `sentry-cli`.
261
- * @param {boolean | 'rejectOnError'} live can be set to:
262
- * - `true` to inherit stdio to display `sentry-cli` output directly.
263
- * - `false` to not inherit stdio and return the output as a string.
264
- * - `'rejectOnError'` to inherit stdio and reject the promise if the command
252
+ * @param args Command line arguments passed to `sentry-cli`.
253
+ * @param live can be set to:
254
+ * - `true` to inherit stdio and reject the promise if the command
265
255
  * exits with a non-zero exit code.
266
- * @param {boolean} silent Disable stdout for silents build (CI/Webpack Stats, ...)
267
- * @param {string} [configFile] Relative or absolute path to the configuration file.
268
- * @param {import('./index').SentryCliOptions} [config] More configuration to pass to the CLI
269
- * @returns {Promise<string>} A promise that resolves to the standard output.
256
+ * - `false` to not inherit stdio and return the output as a string.
257
+ * @param silent Disable stdout for silents build (CI/Webpack Stats, ...)
258
+ * @param configFile Relative or absolute path to the configuration file.
259
+ * @param config More configuration to pass to the CLI
260
+ * @returns A promise that resolves to the standard output.
270
261
  */
271
262
  function execute(args_1, live_1, silent_1, configFile_1) {
272
263
  return __awaiter(this, arguments, void 0, function* (args, live, silent, configFile, config = {}) {
@@ -280,9 +271,6 @@ function execute(args_1, live_1, silent_1, configFile_1) {
280
271
  if (config.authToken) {
281
272
  env.SENTRY_AUTH_TOKEN = config.authToken;
282
273
  }
283
- if (config.apiKey) {
284
- env.SENTRY_API_KEY = config.apiKey;
285
- }
286
274
  if (config.dsn) {
287
275
  env.SENTRY_DSN = config.dsn;
288
276
  }
@@ -306,7 +294,7 @@ function execute(args_1, live_1, silent_1, configFile_1) {
306
294
  args = [...headers, ...args];
307
295
  }
308
296
  return new Promise((resolve, reject) => {
309
- if (live === true || live === 'rejectOnError') {
297
+ if (live) {
310
298
  const output = silent ? 'ignore' : 'inherit';
311
299
  const pid = childProcess.spawn(getPath(), args, {
312
300
  env,
@@ -314,18 +302,10 @@ function execute(args_1, live_1, silent_1, configFile_1) {
314
302
  stdio: ['ignore', output, output],
315
303
  });
316
304
  pid.on('exit', (exitCode) => {
317
- if (live === 'rejectOnError') {
318
- if (exitCode === 0) {
319
- resolve('success (live mode)');
320
- }
321
- reject(new Error(`Command ${args.join(' ')} failed with exit code ${exitCode}`));
305
+ if (exitCode === 0) {
306
+ resolve('success (live mode)');
322
307
  }
323
- // According to the type definition, resolving with void is not allowed.
324
- // However, for backwards compatibility, we resolve void here to
325
- // avoid a behaviour-breaking change.
326
- // TODO (v3): Clean this up and always resolve a string (or change the type definition)
327
- // @ts-expect-error - see comment above
328
- resolve();
308
+ reject(new Error(`Command ${args.join(' ')} failed with exit code ${exitCode}`));
329
309
  });
330
310
  }
331
311
  else {
@@ -344,14 +324,3 @@ function execute(args_1, live_1, silent_1, configFile_1) {
344
324
  function getProjectFlagsFromOptions({ projects = [] } = {}) {
345
325
  return projects.reduce((flags, project) => flags.concat('-p', project), []);
346
326
  }
347
- module.exports = {
348
- execute,
349
- getPath,
350
- getProjectFlagsFromOptions,
351
- mockBinaryPath,
352
- prepareCommand,
353
- serializeOptions,
354
- getDistributionForThisPlatform,
355
- throwUnsupportedPlatformError,
356
- getFallbackBinaryPath,
357
- };
package/js/index.d.ts CHANGED
@@ -1,12 +1,6 @@
1
- export = SentryCli;
2
- /**
3
- * @typedef {import('./types').SentryCliOptions} SentryCliOptions
4
- * @typedef {import('./types').SentryCliUploadSourceMapsOptions} SentryCliUploadSourceMapsOptions
5
- * @typedef {import('./types').SourceMapsPathDescriptor} SourceMapsPathDescriptor
6
- * @typedef {import('./types').SentryCliNewDeployOptions} SentryCliNewDeployOptions
7
- * @typedef {import('./types').SentryCliCommitsOptions} SentryCliCommitsOptions
8
- * @typedef {import('./types').SentryCliReleases} SentryCliReleases
9
- */
1
+ import { Releases } from './releases';
2
+ import type { SentryCliOptions } from './types';
3
+ export type { SentryCliOptions, SentryCliUploadSourceMapsOptions, SourceMapsPathDescriptor, SentryCliNewDeployOptions, SentryCliCommitsOptions, } from './types';
10
4
  /**
11
5
  * Interface to and wrapper around the `sentry-cli` executable.
12
6
  *
@@ -22,17 +16,10 @@ export = SentryCli;
22
16
  * const release = await cli.releases.proposeVersion());
23
17
  * console.log(release);
24
18
  */
25
- declare class SentryCli {
26
- /**
27
- * Returns the version of the installed `sentry-cli` binary.
28
- * @returns {string}
29
- */
30
- static getVersion(): string;
31
- /**
32
- * Returns an absolute path to the `sentry-cli` binary.
33
- * @returns {string}
34
- */
35
- static getPath(): string;
19
+ export declare class SentryCli {
20
+ configFile: string | null;
21
+ options: SentryCliOptions;
22
+ releases: Releases;
36
23
  /**
37
24
  * Creates a new `SentryCli` instance.
38
25
  *
@@ -40,34 +27,28 @@ declare class SentryCli {
40
27
  * location and the value specified in the `SENTRY_PROPERTIES` environment variable is
41
28
  * overridden.
42
29
  *
43
- * @param {string | null} [configFile] - Path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files.
30
+ * @param configFile Path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files.
44
31
  * By default, the config file is looked for upwards from the current path and defaults from ~/.sentryclirc are always loaded.
45
32
  * This value will update `SENTRY_PROPERTIES` env variable.
46
- * @param {SentryCliOptions} [options] - More options to pass to the CLI
33
+ * @param options More options to pass to the CLI
47
34
  */
48
- constructor(configFile?: string | null, options?: SentryCliOptions);
49
- configFile: string;
50
- options: import("./types").SentryCliOptions;
51
- releases: Releases;
35
+ constructor(configFile: string | null, options: SentryCliOptions);
36
+ /**
37
+ * Returns the version of the installed `sentry-cli` binary.
38
+ */
39
+ static getVersion(): string;
40
+ /**
41
+ * Returns an absolute path to the `sentry-cli` binary.
42
+ */
43
+ static getPath(): string;
52
44
  /**
53
45
  * See {helper.execute} docs.
54
- * @param {string[]} args Command line arguments passed to `sentry-cli`.
55
- * @param {boolean | 'rejectOnError'} live can be set to:
56
- * - `true` to inherit stdio to display `sentry-cli` output directly.
57
- * - `false` to not inherit stdio and return the output as a string.
58
- * - `'rejectOnError'` to inherit stdio and reject the promise if the command
46
+ * @param args Command line arguments passed to `sentry-cli`.
47
+ * @param live can be set to:
48
+ * - `true` to inherit stdio and reject the promise if the command
59
49
  * exits with a non-zero exit code.
60
- * @returns {Promise<string>} A promise that resolves to the standard output.
50
+ * - `false` to not inherit stdio and return the output as a string.
51
+ * @returns A promise that resolves to the standard output.
61
52
  */
62
- execute(args: string[], live: boolean | "rejectOnError"): Promise<string>;
63
- }
64
- declare namespace SentryCli {
65
- export { SentryCliOptions, SentryCliUploadSourceMapsOptions, SourceMapsPathDescriptor, SentryCliNewDeployOptions, SentryCliCommitsOptions, SentryCliReleases };
53
+ execute(args: string[], live: boolean): Promise<string>;
66
54
  }
67
- import Releases = require("./releases");
68
- type SentryCliOptions = import("./types").SentryCliOptions;
69
- type SentryCliUploadSourceMapsOptions = import("./types").SentryCliUploadSourceMapsOptions;
70
- type SourceMapsPathDescriptor = import("./types").SourceMapsPathDescriptor;
71
- type SentryCliNewDeployOptions = import("./types").SentryCliNewDeployOptions;
72
- type SentryCliCommitsOptions = import("./types").SentryCliCommitsOptions;
73
- type SentryCliReleases = import("./types").SentryCliReleases;
package/js/index.js CHANGED
@@ -1,15 +1,9 @@
1
1
  'use strict';
2
- const pkgInfo = require('../package.json');
3
- const helper = require('./helper');
4
- const Releases = require('./releases');
5
- /**
6
- * @typedef {import('./types').SentryCliOptions} SentryCliOptions
7
- * @typedef {import('./types').SentryCliUploadSourceMapsOptions} SentryCliUploadSourceMapsOptions
8
- * @typedef {import('./types').SourceMapsPathDescriptor} SourceMapsPathDescriptor
9
- * @typedef {import('./types').SentryCliNewDeployOptions} SentryCliNewDeployOptions
10
- * @typedef {import('./types').SentryCliCommitsOptions} SentryCliCommitsOptions
11
- * @typedef {import('./types').SentryCliReleases} SentryCliReleases
12
- */
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SentryCli = void 0;
4
+ const pkgInfo = require("../package.json");
5
+ const helper = require("./helper");
6
+ const releases_1 = require("./releases");
13
7
  /**
14
8
  * Interface to and wrapper around the `sentry-cli` executable.
15
9
  *
@@ -33,44 +27,43 @@ class SentryCli {
33
27
  * location and the value specified in the `SENTRY_PROPERTIES` environment variable is
34
28
  * overridden.
35
29
  *
36
- * @param {string | null} [configFile] - Path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files.
30
+ * @param configFile Path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files.
37
31
  * By default, the config file is looked for upwards from the current path and defaults from ~/.sentryclirc are always loaded.
38
32
  * This value will update `SENTRY_PROPERTIES` env variable.
39
- * @param {SentryCliOptions} [options] - More options to pass to the CLI
33
+ * @param options More options to pass to the CLI
40
34
  */
41
35
  constructor(configFile, options) {
36
+ this.configFile = configFile;
37
+ this.options = options;
42
38
  if (typeof configFile === 'string') {
43
39
  this.configFile = configFile;
44
40
  }
45
41
  this.options = options || { silent: false };
46
- this.releases = new Releases(Object.assign(Object.assign({}, this.options), { configFile }));
42
+ this.releases = new releases_1.Releases(this.options, configFile);
47
43
  }
48
44
  /**
49
45
  * Returns the version of the installed `sentry-cli` binary.
50
- * @returns {string}
51
46
  */
52
47
  static getVersion() {
53
48
  return pkgInfo.version;
54
49
  }
55
50
  /**
56
51
  * Returns an absolute path to the `sentry-cli` binary.
57
- * @returns {string}
58
52
  */
59
53
  static getPath() {
60
54
  return helper.getPath();
61
55
  }
62
56
  /**
63
57
  * See {helper.execute} docs.
64
- * @param {string[]} args Command line arguments passed to `sentry-cli`.
65
- * @param {boolean | 'rejectOnError'} live can be set to:
66
- * - `true` to inherit stdio to display `sentry-cli` output directly.
67
- * - `false` to not inherit stdio and return the output as a string.
68
- * - `'rejectOnError'` to inherit stdio and reject the promise if the command
58
+ * @param args Command line arguments passed to `sentry-cli`.
59
+ * @param live can be set to:
60
+ * - `true` to inherit stdio and reject the promise if the command
69
61
  * exits with a non-zero exit code.
70
- * @returns {Promise<string>} A promise that resolves to the standard output.
62
+ * - `false` to not inherit stdio and return the output as a string.
63
+ * @returns A promise that resolves to the standard output.
71
64
  */
72
65
  execute(args, live) {
73
66
  return helper.execute(args, live, this.options.silent, this.configFile, this.options);
74
67
  }
75
68
  }
76
- module.exports = SentryCli;
69
+ exports.SentryCli = SentryCli;
package/js/logger.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- export = Logger;
2
- declare class Logger {
3
- constructor(stream: any);
4
- stream: any;
5
- log(...args: any[]): void;
1
+ export declare class Logger {
2
+ stream: NodeJS.WriteStream;
3
+ constructor(stream: NodeJS.WriteStream);
4
+ log(): void;
6
5
  }
package/js/logger.js CHANGED
@@ -1,11 +1,15 @@
1
1
  'use strict';
2
- const format = require('util').format;
3
- module.exports = class Logger {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Logger = void 0;
4
+ const node_util_1 = require("node:util");
5
+ class Logger {
4
6
  constructor(stream) {
5
7
  this.stream = stream;
6
8
  }
7
9
  log() {
8
- const message = format(...arguments);
10
+ const message = (0, node_util_1.format)(...arguments);
9
11
  this.stream.write(`[sentry-cli] ${message}\n`);
10
12
  }
11
- };
13
+ }
14
+ exports.Logger = Logger;
15
+ ;