@bussolabs/closeyourit-cli 0.0.11 → 0.0.13

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
@@ -59,6 +59,8 @@ organization are stored locally.
59
59
  | `tickets list --project <id\|key> [--page]` | List tickets. |
60
60
  | `tickets show <id> --project <id\|key>` | Show one ticket. |
61
61
  | `tickets create --project <id\|key> --title <t> [--kind] [--step-*] [--description] [--status-id] [--priority-id]` | Create a ticket. |
62
+ | `tickets reject <id> --project <id\|key> --reason <text>` | Reject the review: back to work, the reason becomes a comment. |
63
+ | `tickets approve <id> --project <id\|key>` | Approve the review: move to the first done status. |
62
64
  | `metrics list --project <id\|key> [--kind] [--page]` | List metric groups. |
63
65
  | `metrics show <id> --project <id\|key>` | Show one metric group. |
64
66
  | `logs list [--project <id\|key>] [--level] [--trace-id] [--environment] [--page]` | List structured log entries. Cross-app: omit `--project` for the full visible stream. |
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasCommentDelete extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ 'comment-id': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<unknown>;
14
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ class IdeasCommentDelete extends base_1.BaseCommand {
6
+ static args = {
7
+ id: core_1.Args.string({ description: 'Idea id', required: true }),
8
+ };
9
+ static description = 'Delete a comment from an open idea (author, or with ideas.comment.delete_any)';
10
+ static examples = [
11
+ '<%= config.bin %> ideas comment-delete <idea-id> --project acme-api --comment-id <id> --confirm',
12
+ ];
13
+ static flags = {
14
+ ...base_1.projectFlag,
15
+ 'comment-id': core_1.Flags.string({ description: 'Comment id to delete', required: true }),
16
+ confirm: core_1.Flags.boolean({ description: 'Required: confirm the irreversible deletion' }),
17
+ };
18
+ async run() {
19
+ const { args, flags } = await this.parse(IdeasCommentDelete);
20
+ if (!flags.confirm) {
21
+ this.error('Refusing to delete without --confirm (the action is irreversible).', { exit: 2 });
22
+ }
23
+ const projectId = await this.resolveProjectId(flags.project);
24
+ await this.api.delete(`/cli/v1/projects/${projectId}/ideas/${args.id}/comments/${flags['comment-id']}`);
25
+ if (!this.jsonEnabled())
26
+ this.log(`Deleted comment ${flags['comment-id']}`);
27
+ return { deleted: flags['comment-id'] };
28
+ }
29
+ }
30
+ exports.default = IdeasCommentDelete;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasComment extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ body: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<unknown>;
13
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class IdeasComment extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Idea id', required: true }),
9
+ };
10
+ static description = 'Add a comment to an idea (only open ideas accept comments)';
11
+ static examples = [
12
+ '<%= config.bin %> ideas comment <idea-id> --project acme-api --body "Also needed on mobile"',
13
+ ];
14
+ static flags = {
15
+ ...base_1.projectFlag,
16
+ body: core_1.Flags.string({ description: 'Comment body', required: true }),
17
+ };
18
+ async run() {
19
+ const { args, flags } = await this.parse(IdeasComment);
20
+ const projectId = await this.resolveProjectId(flags.project);
21
+ const res = await this.api.post(`/cli/v1/projects/${projectId}/ideas/${args.id}/comments`, { body: flags.body });
22
+ if (!this.jsonEnabled()) {
23
+ this.log('Comment added:');
24
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
25
+ }
26
+ return res;
27
+ }
28
+ }
29
+ exports.default = IdeasComment;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasComments extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class IdeasComments extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Idea id', required: true }),
9
+ };
10
+ static description = 'List all comments of an idea (oldest first)';
11
+ static examples = [
12
+ '<%= config.bin %> ideas comments <idea-id> --project acme-api',
13
+ '<%= config.bin %> ideas comments <idea-id> -p acme-api --json',
14
+ ];
15
+ static flags = { ...base_1.projectFlag };
16
+ async run() {
17
+ const { args, flags } = await this.parse(IdeasComments);
18
+ const projectId = await this.resolveProjectId(flags.project);
19
+ const base = `/cli/v1/projects/${encodeURIComponent(projectId)}/ideas/${encodeURIComponent(args.id)}/comments`;
20
+ // Read every page so `comments` returns the full discussion, not just the first page.
21
+ const all = [];
22
+ let page = 1;
23
+ let totalPages = 1;
24
+ do {
25
+ // eslint-disable-next-line no-await-in-loop
26
+ const res = await this.api.get(`${base}?page=${page}&per=100`);
27
+ all.push(...(res.data ?? []));
28
+ totalPages = Number(res.meta?.total_pages ?? 1);
29
+ page += 1;
30
+ } while (page <= totalPages);
31
+ if (!this.jsonEnabled()) {
32
+ if (all.length === 0) {
33
+ this.log('(nessun commento)');
34
+ }
35
+ else {
36
+ for (const comment of all) {
37
+ this.log(`\n── ${(0, output_1.sanitize)(comment.author ?? '?')} · ${(0, output_1.sanitize)(comment.created_at ?? '')} · ${(0, output_1.sanitize)(comment.id ?? '')}`);
38
+ this.log((0, output_1.sanitizeMultiline)(comment.body ?? ''));
39
+ }
40
+ }
41
+ }
42
+ return { data: all };
43
+ }
44
+ }
45
+ exports.default = IdeasComments;
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasConvert extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'status-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ };
16
+ run(): Promise<unknown>;
17
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class IdeasConvert extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Idea id', required: true }),
9
+ };
10
+ static description = 'Convert an idea into a ticket. Without --title/--description the server AI synthesizes the draft from the idea and its comments (may take ~30s). Author always allowed; others need ideas.convert.';
11
+ static examples = [
12
+ '<%= config.bin %> ideas convert <idea-id> --project acme-api',
13
+ '<%= config.bin %> ideas convert <idea-id> -p acme-api --title "Dark mode" --description "Full spec…" --kind feature',
14
+ ];
15
+ static flags = {
16
+ ...base_1.projectFlag,
17
+ title: core_1.Flags.string({ description: 'Ticket title (skips AI when set together with --description)' }),
18
+ description: core_1.Flags.string({ description: 'Ticket description (skips AI when set together with --title)' }),
19
+ kind: core_1.Flags.string({ description: 'Ticket kind (default: feature if the project has a roadmap, else bug)' }),
20
+ 'status-id': core_1.Flags.string({ description: 'Status lookup id (default: open)' }),
21
+ 'priority-id': core_1.Flags.string({ description: 'Priority lookup id (default: medium)' }),
22
+ };
23
+ async run() {
24
+ const { args, flags } = await this.parse(IdeasConvert);
25
+ const projectId = await this.resolveProjectId(flags.project);
26
+ const body = {};
27
+ if (flags.title !== undefined)
28
+ body.title = flags.title;
29
+ if (flags.description !== undefined)
30
+ body.description = flags.description;
31
+ if (flags.kind !== undefined)
32
+ body.kind = flags.kind;
33
+ if (flags['status-id'] !== undefined)
34
+ body.status_id = flags['status-id'];
35
+ if (flags['priority-id'] !== undefined)
36
+ body.priority_id = flags['priority-id'];
37
+ if (!this.jsonEnabled() && (flags.title === undefined || flags.description === undefined)) {
38
+ this.log('Synthesizing the ticket draft with AI (idea + comments), this may take ~30s…');
39
+ }
40
+ const res = await this.api.put(`/cli/v1/projects/${projectId}/ideas/${args.id}/conversion`, body);
41
+ if (!this.jsonEnabled()) {
42
+ this.log('Idea converted — ticket created:');
43
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
44
+ }
45
+ return res;
46
+ }
47
+ }
48
+ exports.default = IdeasConvert;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasCreate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ body: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<unknown>;
11
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class IdeasCreate extends base_1.BaseCommand {
7
+ static description = 'Propose an idea for a project';
8
+ static examples = [
9
+ '<%= config.bin %> ideas create --project acme-api --title "Dark mode" --body "Dark theme for the dashboard"',
10
+ ];
11
+ static flags = {
12
+ ...base_1.projectFlag,
13
+ title: core_1.Flags.string({ description: 'Idea title', required: true }),
14
+ body: core_1.Flags.string({ description: 'Idea proposal body', required: true }),
15
+ };
16
+ async run() {
17
+ const { flags } = await this.parse(IdeasCreate);
18
+ const projectId = await this.resolveProjectId(flags.project);
19
+ const res = await this.api.post(`/cli/v1/projects/${projectId}/ideas`, { title: flags.title, body: flags.body });
20
+ if (!this.jsonEnabled()) {
21
+ this.log('Idea created:');
22
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
23
+ }
24
+ return res;
25
+ }
26
+ }
27
+ exports.default = IdeasCreate;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasList extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ page: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class IdeasList extends base_1.BaseCommand {
7
+ static description = 'List ideas for a project (sorted by votes)';
8
+ static examples = [
9
+ '<%= config.bin %> ideas list --project acme-api',
10
+ '<%= config.bin %> ideas list -p acme-api --status open --sort recent --json',
11
+ ];
12
+ static flags = {
13
+ ...base_1.projectFlag,
14
+ ...base_1.pageFlag,
15
+ status: core_1.Flags.string({ description: 'Filter by status (open|converted|archived)' }),
16
+ sort: core_1.Flags.string({ description: 'Sort order (votes|recent, default votes)' }),
17
+ };
18
+ async run() {
19
+ const { flags } = await this.parse(IdeasList);
20
+ const projectId = await this.resolveProjectId(flags.project);
21
+ const params = new URLSearchParams({ page: String(flags.page) });
22
+ if (flags.status)
23
+ params.set('status', flags.status);
24
+ if (flags.sort)
25
+ params.set('sort', flags.sort);
26
+ const res = await this.api.get(`/cli/v1/projects/${projectId}/ideas?${params.toString()}`);
27
+ const ideas = res.data ?? [];
28
+ if (!this.jsonEnabled()) {
29
+ this.log((0, output_1.renderTable)(['ID', 'TITLE', 'STATUS', 'VOTES', 'COMMENTS'], ideas.map((idea) => [
30
+ String(idea.id ?? ''),
31
+ String(idea.title ?? ''),
32
+ String(idea.status ?? ''),
33
+ String(idea.votes_count ?? 0),
34
+ String(idea.comments_count ?? 0),
35
+ ])));
36
+ }
37
+ return res;
38
+ }
39
+ }
40
+ exports.default = IdeasList;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasShow extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class IdeasShow extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Idea id', required: true }),
9
+ };
10
+ static description = 'Show an idea (fields + full proposal body)';
11
+ static examples = ['<%= config.bin %> ideas show <idea-id> --project acme-api'];
12
+ static flags = { ...base_1.projectFlag };
13
+ async run() {
14
+ const { args, flags } = await this.parse(IdeasShow);
15
+ const projectId = await this.resolveProjectId(flags.project);
16
+ const res = await this.api.get(`/cli/v1/projects/${projectId}/ideas/${args.id}`);
17
+ if (!this.jsonEnabled()) {
18
+ const { body, ...fields } = res.data ?? {};
19
+ this.log((0, output_1.renderRecord)(fields));
20
+ if (body) {
21
+ this.log('\nProposal:');
22
+ this.log((0, output_1.sanitizeMultiline)(body));
23
+ }
24
+ }
25
+ return res;
26
+ }
27
+ }
28
+ exports.default = IdeasShow;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasUnvote extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ class IdeasUnvote extends base_1.BaseCommand {
6
+ static args = {
7
+ id: core_1.Args.string({ description: 'Idea id', required: true }),
8
+ };
9
+ static description = 'Remove your upvote from an idea (idempotent)';
10
+ static examples = ['<%= config.bin %> ideas unvote <idea-id> --project acme-api'];
11
+ static flags = { ...base_1.projectFlag };
12
+ async run() {
13
+ const { args, flags } = await this.parse(IdeasUnvote);
14
+ const projectId = await this.resolveProjectId(flags.project);
15
+ const res = await this.api.delete(`/cli/v1/projects/${projectId}/ideas/${args.id}/vote`);
16
+ if (!this.jsonEnabled()) {
17
+ const p = res.data ?? {};
18
+ const count = p.votes_count;
19
+ this.log(`Removed vote from idea ${args.id}${count === undefined ? '' : ` (${count} votes)`}`);
20
+ }
21
+ return res;
22
+ }
23
+ }
24
+ exports.default = IdeasUnvote;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class IdeasVote extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ class IdeasVote extends base_1.BaseCommand {
6
+ static args = {
7
+ id: core_1.Args.string({ description: 'Idea id', required: true }),
8
+ };
9
+ static description = 'Upvote an idea (idempotent; only open ideas accept votes)';
10
+ static examples = ['<%= config.bin %> ideas vote <idea-id> --project acme-api'];
11
+ static flags = { ...base_1.projectFlag };
12
+ async run() {
13
+ const { args, flags } = await this.parse(IdeasVote);
14
+ const projectId = await this.resolveProjectId(flags.project);
15
+ const res = await this.api.put(`/cli/v1/projects/${projectId}/ideas/${args.id}/vote`);
16
+ if (!this.jsonEnabled()) {
17
+ const p = res.data ?? {};
18
+ const count = p.votes_count;
19
+ this.log(`Voted idea ${args.id}${count === undefined ? '' : ` (${count} votes)`}`);
20
+ }
21
+ return res;
22
+ }
23
+ }
24
+ exports.default = IdeasVote;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class TicketsApprove extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class TicketsApprove extends base_1.BaseCommand {
7
+ static description = 'Approve a ticket review: move it to the first done status';
8
+ static examples = ['<%= config.bin %> tickets approve <ticket-id> --project acme-api'];
9
+ static args = {
10
+ id: core_1.Args.string({ description: 'Ticket id or code (e.g. DRFL-3)', required: true }),
11
+ };
12
+ static flags = { ...base_1.projectFlag };
13
+ async run() {
14
+ const { args, flags } = await this.parse(TicketsApprove);
15
+ const projectId = await this.resolveProjectId(flags.project);
16
+ const res = await this.api.post(`/cli/v1/projects/${projectId}/tickets/${args.id}/review/approval`);
17
+ if (!this.jsonEnabled()) {
18
+ this.log(`Ticket ${args.id} review approved:`);
19
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
20
+ }
21
+ return res;
22
+ }
23
+ }
24
+ exports.default = TicketsApprove;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class TicketsReject extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ reason: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<unknown>;
13
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class TicketsReject extends base_1.BaseCommand {
7
+ static description = 'Reject a ticket review: send it back to work with a reason';
8
+ static examples = [
9
+ '<%= config.bin %> tickets reject <ticket-id> --project acme-api --reason "Edge case not covered"',
10
+ ];
11
+ static args = {
12
+ id: core_1.Args.string({ description: 'Ticket id or code (e.g. DRFL-3)', required: true }),
13
+ };
14
+ static flags = {
15
+ ...base_1.projectFlag,
16
+ reason: core_1.Flags.string({ description: 'Why the review is rejected (posted as a comment)', required: true }),
17
+ };
18
+ async run() {
19
+ const { args, flags } = await this.parse(TicketsReject);
20
+ const projectId = await this.resolveProjectId(flags.project);
21
+ const res = await this.api.post(`/cli/v1/projects/${projectId}/tickets/${args.id}/review/rejection`, { reason: flags.reason });
22
+ if (!this.jsonEnabled()) {
23
+ this.log(`Ticket ${args.id} review rejected, sent back to work:`);
24
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
25
+ }
26
+ return res;
27
+ }
28
+ }
29
+ exports.default = TicketsReject;