@hesed/sentry 0.1.0
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 +453 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +5 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/commands/sentry/auth/add.d.ts +14 -0
- package/dist/commands/sentry/auth/add.js +56 -0
- package/dist/commands/sentry/auth/test.d.ts +10 -0
- package/dist/commands/sentry/auth/test.js +32 -0
- package/dist/commands/sentry/auth/update.d.ts +14 -0
- package/dist/commands/sentry/auth/update.js +68 -0
- package/dist/commands/sentry/event/get.d.ts +13 -0
- package/dist/commands/sentry/event/get.js +31 -0
- package/dist/commands/sentry/event/source-maps.d.ts +15 -0
- package/dist/commands/sentry/event/source-maps.js +40 -0
- package/dist/commands/sentry/issue/event.d.ts +13 -0
- package/dist/commands/sentry/issue/event.js +34 -0
- package/dist/commands/sentry/issue/events.d.ts +18 -0
- package/dist/commands/sentry/issue/events.js +47 -0
- package/dist/commands/sentry/issue/get.d.ts +12 -0
- package/dist/commands/sentry/issue/get.js +28 -0
- package/dist/commands/sentry/issue/hashes.d.ts +13 -0
- package/dist/commands/sentry/issue/hashes.js +32 -0
- package/dist/commands/sentry/issue/tag-values.d.ts +15 -0
- package/dist/commands/sentry/issue/tag-values.js +36 -0
- package/dist/commands/sentry/issue/tag.d.ts +14 -0
- package/dist/commands/sentry/issue/tag.js +33 -0
- package/dist/commands/sentry/issue/update.d.ts +18 -0
- package/dist/commands/sentry/issue/update.js +54 -0
- package/dist/commands/sentry/org/issues.d.ts +19 -0
- package/dist/commands/sentry/org/issues.js +57 -0
- package/dist/commands/sentry/project/events.d.ts +17 -0
- package/dist/commands/sentry/project/events.js +44 -0
- package/dist/commands/sentry/project/issues.d.ts +16 -0
- package/dist/commands/sentry/project/issues.js +44 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +18 -0
- package/dist/format.d.ts +4 -0
- package/dist/format.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/sentry/sentry-api.d.ts +127 -0
- package/dist/sentry/sentry-api.js +176 -0
- package/dist/sentry/sentry-client.d.ts +61 -0
- package/dist/sentry/sentry-client.js +66 -0
- package/oclif.manifest.json +937 -0
- package/package.json +105 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, getEvent } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class EventGet extends Command {
|
|
6
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
7
|
+
static args = {
|
|
8
|
+
projectSlug: Args.string({ description: 'Project slug', required: true }),
|
|
9
|
+
eventId: Args.string({ description: 'Event ID', required: true }),
|
|
10
|
+
};
|
|
11
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
12
|
+
static description = 'Retrieve a Sentry event for a project';
|
|
13
|
+
static examples = ['<%= config.bin %> <%= command.id %> my-project abc123def456'];
|
|
14
|
+
static flags = {
|
|
15
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(EventGet);
|
|
19
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
20
|
+
if (!config)
|
|
21
|
+
return;
|
|
22
|
+
const result = await getEvent(config.auth, args.projectSlug, args.eventId);
|
|
23
|
+
clearClients();
|
|
24
|
+
if (flags.toon) {
|
|
25
|
+
this.log(formatAsToon(result));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.logJson(result);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class EventSourceMaps extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
projectSlug: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
eventId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
'exception-idx': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'frame-idx': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, debugSourceMaps } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class EventSourceMaps extends Command {
|
|
6
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
7
|
+
static args = {
|
|
8
|
+
projectSlug: Args.string({ description: 'Project slug', required: true }),
|
|
9
|
+
eventId: Args.string({ description: 'Event ID', required: true }),
|
|
10
|
+
};
|
|
11
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
12
|
+
static description = 'Debug source maps for a Sentry event';
|
|
13
|
+
static examples = ['<%= config.bin %> <%= command.id %> my-project abc123def456'];
|
|
14
|
+
static flags = {
|
|
15
|
+
'exception-idx': Flags.string({ description: 'Exception index', required: false }),
|
|
16
|
+
'frame-idx': Flags.string({ description: 'Frame index', required: false }),
|
|
17
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { args, flags } = await this.parse(EventSourceMaps);
|
|
21
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
22
|
+
if (!config)
|
|
23
|
+
return;
|
|
24
|
+
const params = {};
|
|
25
|
+
// eslint-disable-next-line camelcase
|
|
26
|
+
if (flags['exception-idx'])
|
|
27
|
+
params.exception_idx = flags['exception-idx'];
|
|
28
|
+
// eslint-disable-next-line camelcase
|
|
29
|
+
if (flags['frame-idx'])
|
|
30
|
+
params.frame_idx = flags['frame-idx'];
|
|
31
|
+
const result = await debugSourceMaps(config.auth, args.projectSlug, args.eventId, params);
|
|
32
|
+
clearClients();
|
|
33
|
+
if (flags.toon) {
|
|
34
|
+
this.log(formatAsToon(result));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.logJson(result);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class IssueEvent extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
issueId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
eventId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, getIssueEvent } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class IssueEvent extends Command {
|
|
6
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
7
|
+
static args = {
|
|
8
|
+
issueId: Args.string({ description: 'Issue ID', required: true }),
|
|
9
|
+
eventId: Args.string({ description: 'Event ID (latest, oldest, recommended, or event ID)', required: true }),
|
|
10
|
+
};
|
|
11
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
12
|
+
static description = 'Retrieve a specific event from a Sentry issue';
|
|
13
|
+
static examples = [
|
|
14
|
+
'<%= config.bin %> <%= command.id %> 123456789 latest',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> 123456789 abc123def456',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { args, flags } = await this.parse(IssueEvent);
|
|
22
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
23
|
+
if (!config)
|
|
24
|
+
return;
|
|
25
|
+
const result = await getIssueEvent(config.auth, args.issueId, args.eventId);
|
|
26
|
+
clearClients();
|
|
27
|
+
if (flags.toon) {
|
|
28
|
+
this.log(formatAsToon(result));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.logJson(result);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class IssueEvents extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
issueId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
end: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
full: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
start: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'stats-period': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, listIssueEvents } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class IssueEvents extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
issueId: Args.string({ description: 'Issue ID', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = "List a Sentry issue's events";
|
|
10
|
+
static examples = ['<%= config.bin %> <%= command.id %> 123456789'];
|
|
11
|
+
static flags = {
|
|
12
|
+
cursor: Flags.string({ description: 'Pagination cursor', required: false }),
|
|
13
|
+
end: Flags.string({ description: 'End date (ISO-8601)', required: false }),
|
|
14
|
+
environment: Flags.string({ description: 'Filter by environment', multiple: true, required: false }),
|
|
15
|
+
full: Flags.boolean({ description: 'Include full event body', required: false }),
|
|
16
|
+
start: Flags.string({ description: 'Start date (ISO-8601)', required: false }),
|
|
17
|
+
'stats-period': Flags.string({ description: 'Time period (e.g. 24h, 7d)', required: false }),
|
|
18
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { args, flags } = await this.parse(IssueEvents);
|
|
22
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
23
|
+
if (!config)
|
|
24
|
+
return;
|
|
25
|
+
const params = {};
|
|
26
|
+
if (flags.cursor)
|
|
27
|
+
params.cursor = flags.cursor;
|
|
28
|
+
if (flags.end)
|
|
29
|
+
params.end = flags.end;
|
|
30
|
+
if (flags.environment)
|
|
31
|
+
params.environment = flags.environment;
|
|
32
|
+
if (flags.full)
|
|
33
|
+
params.full = flags.full;
|
|
34
|
+
if (flags.start)
|
|
35
|
+
params.start = flags.start;
|
|
36
|
+
if (flags['stats-period'])
|
|
37
|
+
params.statsPeriod = flags['stats-period'];
|
|
38
|
+
const result = await listIssueEvents(config.auth, args.issueId, params);
|
|
39
|
+
clearClients();
|
|
40
|
+
if (flags.toon) {
|
|
41
|
+
this.log(formatAsToon(result));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.logJson(result);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class IssueGet extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
issueId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, getIssue } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class IssueGet extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
issueId: Args.string({ description: 'Issue ID', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Retrieve a Sentry issue';
|
|
10
|
+
static examples = ['<%= config.bin %> <%= command.id %> 123456789'];
|
|
11
|
+
static flags = {
|
|
12
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { args, flags } = await this.parse(IssueGet);
|
|
16
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
17
|
+
if (!config)
|
|
18
|
+
return;
|
|
19
|
+
const result = await getIssue(config.auth, args.issueId);
|
|
20
|
+
clearClients();
|
|
21
|
+
if (flags.toon) {
|
|
22
|
+
this.log(formatAsToon(result));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.logJson(result);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class IssueHashes extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
issueId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, listIssueHashes } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class IssueHashes extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
issueId: Args.string({ description: 'Issue ID', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = "List a Sentry issue's hashes";
|
|
10
|
+
static examples = ['<%= config.bin %> <%= command.id %> 123456789'];
|
|
11
|
+
static flags = {
|
|
12
|
+
cursor: Flags.string({ description: 'Pagination cursor', required: false }),
|
|
13
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
const { args, flags } = await this.parse(IssueHashes);
|
|
17
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
18
|
+
if (!config)
|
|
19
|
+
return;
|
|
20
|
+
const params = {};
|
|
21
|
+
if (flags.cursor)
|
|
22
|
+
params.cursor = flags.cursor;
|
|
23
|
+
const result = await listIssueHashes(config.auth, args.issueId, params);
|
|
24
|
+
clearClients();
|
|
25
|
+
if (flags.toon) {
|
|
26
|
+
this.log(formatAsToon(result));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.logJson(result);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class IssueTagValues extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
issueId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
tagKey: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, listTagValues } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class IssueTagValues extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
issueId: Args.string({ description: 'Issue ID', required: true }),
|
|
8
|
+
tagKey: Args.string({ description: 'Tag key (e.g. browser, url, user)', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = "List a tag's values for a Sentry issue";
|
|
11
|
+
static examples = ['<%= config.bin %> <%= command.id %> 123456789 browser'];
|
|
12
|
+
static flags = {
|
|
13
|
+
cursor: Flags.string({ description: 'Pagination cursor', required: false }),
|
|
14
|
+
environment: Flags.string({ description: 'Filter by environment', multiple: true, required: false }),
|
|
15
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(IssueTagValues);
|
|
19
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
20
|
+
if (!config)
|
|
21
|
+
return;
|
|
22
|
+
const params = {};
|
|
23
|
+
if (flags.cursor)
|
|
24
|
+
params.cursor = flags.cursor;
|
|
25
|
+
if (flags.environment)
|
|
26
|
+
params.environment = flags.environment;
|
|
27
|
+
const result = await listTagValues(config.auth, args.issueId, args.tagKey, params);
|
|
28
|
+
clearClients();
|
|
29
|
+
if (flags.toon) {
|
|
30
|
+
this.log(formatAsToon(result));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.logJson(result);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class IssueTag extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
issueId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
tagKey: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, getTagDetails } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class IssueTag extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
issueId: Args.string({ description: 'Issue ID', required: true }),
|
|
8
|
+
tagKey: Args.string({ description: 'Tag key (e.g. browser, url, user)', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Retrieve tag details for a Sentry issue';
|
|
11
|
+
static examples = ['<%= config.bin %> <%= command.id %> 123456789 browser'];
|
|
12
|
+
static flags = {
|
|
13
|
+
environment: Flags.string({ description: 'Filter by environment', multiple: true, required: false }),
|
|
14
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(IssueTag);
|
|
18
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
19
|
+
if (!config)
|
|
20
|
+
return;
|
|
21
|
+
const params = {};
|
|
22
|
+
if (flags.environment)
|
|
23
|
+
params.environment = flags.environment;
|
|
24
|
+
const result = await getTagDetails(config.auth, args.issueId, args.tagKey, params);
|
|
25
|
+
clearClients();
|
|
26
|
+
if (flags.toon) {
|
|
27
|
+
this.log(formatAsToon(result));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.logJson(result);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class IssueUpdate extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
issueId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
'assigned-to': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'has-seen': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'is-bookmarked': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'is-public': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'is-subscribed': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, updateIssue } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class IssueUpdate extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
issueId: Args.string({ description: 'Issue ID', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Update a Sentry issue';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 123456789 --status resolved',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 123456789 --assigned-to user@example.com',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
'assigned-to': Flags.string({ description: 'Assign to user (actor ID or username)', required: false }),
|
|
16
|
+
'has-seen': Flags.boolean({ allowNo: true, description: 'Mark issue as seen/unseen', required: false }),
|
|
17
|
+
'is-bookmarked': Flags.boolean({ allowNo: true, description: 'Bookmark or unbookmark issue', required: false }),
|
|
18
|
+
'is-public': Flags.boolean({ allowNo: true, description: 'Make issue public or private', required: false }),
|
|
19
|
+
'is-subscribed': Flags.boolean({ allowNo: true, description: 'Subscribe or unsubscribe from issue', required: false }),
|
|
20
|
+
status: Flags.string({
|
|
21
|
+
description: 'Issue status (resolved, resolvedInNextRelease, unresolved, ignored)',
|
|
22
|
+
options: ['resolved', 'resolvedInNextRelease', 'unresolved', 'ignored'],
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
const { args, flags } = await this.parse(IssueUpdate);
|
|
29
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
30
|
+
if (!config)
|
|
31
|
+
return;
|
|
32
|
+
const data = {};
|
|
33
|
+
if (flags.status !== undefined)
|
|
34
|
+
data.status = flags.status;
|
|
35
|
+
if (flags['assigned-to'] !== undefined)
|
|
36
|
+
data.assignedTo = flags['assigned-to'];
|
|
37
|
+
if (flags['has-seen'] !== undefined)
|
|
38
|
+
data.hasSeen = flags['has-seen'];
|
|
39
|
+
if (flags['is-bookmarked'] !== undefined)
|
|
40
|
+
data.isBookmarked = flags['is-bookmarked'];
|
|
41
|
+
if (flags['is-subscribed'] !== undefined)
|
|
42
|
+
data.isSubscribed = flags['is-subscribed'];
|
|
43
|
+
if (flags['is-public'] !== undefined)
|
|
44
|
+
data.isPublic = flags['is-public'];
|
|
45
|
+
const result = await updateIssue(config.auth, args.issueId, data);
|
|
46
|
+
clearClients();
|
|
47
|
+
if (flags.toon) {
|
|
48
|
+
this.log(formatAsToon(result));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.logJson(result);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class OrgIssues extends Command {
|
|
3
|
+
static args: {};
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
end: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
environment: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
project: import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
sort: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
start: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'stats-period': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, listOrgIssues } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class OrgIssues extends Command {
|
|
6
|
+
static args = {};
|
|
7
|
+
static description = "List a Sentry organization's issues";
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --query "is:unresolved" --limit 50',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
cursor: Flags.string({ description: 'Pagination cursor', required: false }),
|
|
14
|
+
end: Flags.string({ description: 'End date (ISO-8601)', required: false }),
|
|
15
|
+
environment: Flags.string({ description: 'Filter by environment', multiple: true, required: false }),
|
|
16
|
+
limit: Flags.integer({ description: 'Maximum number of results', required: false }),
|
|
17
|
+
project: Flags.integer({ description: 'Filter by project ID', multiple: true, required: false }),
|
|
18
|
+
query: Flags.string({ description: 'Search query (e.g. "is:unresolved")', required: false }),
|
|
19
|
+
sort: Flags.string({ description: 'Sort order', required: false }),
|
|
20
|
+
start: Flags.string({ description: 'Start date (ISO-8601)', required: false }),
|
|
21
|
+
'stats-period': Flags.string({ description: 'Time period (e.g. 24h, 7d)', required: false }),
|
|
22
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(OrgIssues);
|
|
26
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
27
|
+
if (!config)
|
|
28
|
+
return;
|
|
29
|
+
const params = {};
|
|
30
|
+
if (flags.cursor)
|
|
31
|
+
params.cursor = flags.cursor;
|
|
32
|
+
if (flags.end)
|
|
33
|
+
params.end = flags.end;
|
|
34
|
+
if (flags.environment)
|
|
35
|
+
params.environment = flags.environment;
|
|
36
|
+
if (flags.limit !== undefined)
|
|
37
|
+
params.limit = flags.limit;
|
|
38
|
+
if (flags.project)
|
|
39
|
+
params.project = flags.project;
|
|
40
|
+
if (flags.query)
|
|
41
|
+
params.query = flags.query;
|
|
42
|
+
if (flags.sort)
|
|
43
|
+
params.sort = flags.sort;
|
|
44
|
+
if (flags.start)
|
|
45
|
+
params.start = flags.start;
|
|
46
|
+
if (flags['stats-period'])
|
|
47
|
+
params.statsPeriod = flags['stats-period'];
|
|
48
|
+
const result = await listOrgIssues(config.auth, params);
|
|
49
|
+
clearClients();
|
|
50
|
+
if (flags.toon) {
|
|
51
|
+
this.log(formatAsToon(result));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.logJson(result);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class ProjectEvents extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
projectSlug: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
end: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
full: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
start: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'stats-period': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { readConfig } from '../../../config.js';
|
|
3
|
+
import { formatAsToon } from '../../../format.js';
|
|
4
|
+
import { clearClients, listProjectEvents } from '../../../sentry/sentry-client.js';
|
|
5
|
+
export default class ProjectEvents extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
projectSlug: Args.string({ description: 'Project slug', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = "List a Sentry project's error events";
|
|
10
|
+
static examples = ['<%= config.bin %> <%= command.id %> my-project'];
|
|
11
|
+
static flags = {
|
|
12
|
+
cursor: Flags.string({ description: 'Pagination cursor', required: false }),
|
|
13
|
+
end: Flags.string({ description: 'End date (ISO-8601)', required: false }),
|
|
14
|
+
full: Flags.boolean({ description: 'Include full event body', required: false }),
|
|
15
|
+
start: Flags.string({ description: 'Start date (ISO-8601)', required: false }),
|
|
16
|
+
'stats-period': Flags.string({ description: 'Time period (e.g. 24h, 7d)', required: false }),
|
|
17
|
+
toon: Flags.boolean({ description: 'Format output as toon', required: false }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { args, flags } = await this.parse(ProjectEvents);
|
|
21
|
+
const config = await readConfig(this.config.configDir, this.log.bind(this));
|
|
22
|
+
if (!config)
|
|
23
|
+
return;
|
|
24
|
+
const params = {};
|
|
25
|
+
if (flags.cursor)
|
|
26
|
+
params.cursor = flags.cursor;
|
|
27
|
+
if (flags.end)
|
|
28
|
+
params.end = flags.end;
|
|
29
|
+
if (flags.full)
|
|
30
|
+
params.full = flags.full;
|
|
31
|
+
if (flags.start)
|
|
32
|
+
params.start = flags.start;
|
|
33
|
+
if (flags['stats-period'])
|
|
34
|
+
params.statsPeriod = flags['stats-period'];
|
|
35
|
+
const result = await listProjectEvents(config.auth, args.projectSlug, params);
|
|
36
|
+
clearClients();
|
|
37
|
+
if (flags.toon) {
|
|
38
|
+
this.log(formatAsToon(result));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.logJson(result);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class ProjectIssues extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
projectSlug: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'short-id-lookup': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'stats-period': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
toon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|