@bussolabs/closeyourit-cli 0.11.0 → 0.13.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 +6 -6
- package/dist/commands/groups/create.d.ts +0 -1
- package/dist/commands/groups/create.js +0 -7
- package/dist/commands/groups/update.d.ts +0 -1
- package/dist/commands/groups/update.js +1 -8
- package/dist/commands/ideas/convert.js +1 -1
- package/dist/commands/projects/create.d.ts +0 -1
- package/dist/commands/projects/create.js +1 -7
- package/dist/commands/projects/settings/update.d.ts +0 -1
- package/dist/commands/projects/settings/update.js +1 -4
- package/dist/commands/projects/update.d.ts +0 -1
- package/dist/commands/projects/update.js +1 -7
- package/dist/commands/tickets/create.d.ts +1 -0
- package/dist/commands/tickets/create.js +1 -1
- package/dist/commands/tickets/eligibility.d.ts +16 -0
- package/dist/commands/tickets/eligibility.js +46 -0
- package/dist/commands/tickets/list.d.ts +1 -0
- package/dist/commands/tickets/list.js +27 -4
- package/dist/commands/tickets/show.js +5 -0
- package/dist/commands/tickets/update.d.ts +1 -0
- package/dist/commands/tickets/update.js +1 -1
- package/dist/lib/ticket-body.d.ts +1 -0
- package/dist/lib/ticket-body.js +3 -0
- package/oclif.manifest.json +3026 -2927
- package/opencli.json +275 -79
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -44,19 +44,19 @@ CLOSEYOURIT_TOKEN=cyi_u_… CLOSEYOURIT_API_URL=https://www.closeyour.it \
|
|
|
44
44
|
| `whoami` | Show account, organization, token prefix and permissions. |
|
|
45
45
|
| `projects list [--page]` | List visible projects. |
|
|
46
46
|
| `projects show <id\|key>` | Show one project, plus its declared environments and per-environment capabilities. |
|
|
47
|
-
| `projects create <name> --key <key> [--group <id\|name>] [--color] [--description] [--
|
|
48
|
-
| `projects update --project <id\|key> [--name] [--key] [--color] [--description] [--group] [--
|
|
47
|
+
| `projects create <name> --key <key> [--group <id\|name>] [--color] [--description] [--quick-bug-report-enabled]` | Create a project (optionally inside a group). |
|
|
48
|
+
| `projects update --project <id\|key> [--name] [--key] [--color] [--description] [--group] [--quick-bug-report-enabled]` | Update a project (only the passed fields change). |
|
|
49
49
|
| `projects link-server --project <id\|key> --host-id <id> --environment-id <id>` | Link a server host to a declared project environment (uptime). |
|
|
50
50
|
| `projects unlink-server <link-id> --project <id\|key> --confirm` | Unlink a server host from the project. |
|
|
51
51
|
| `projects settings show --project <id\|key>` | Show a project's settings (log/analytics retention + feature flags). |
|
|
52
|
-
| `projects settings update --project <id\|key> [--logs-retention-days] [--analytics-retention-days] [--
|
|
52
|
+
| `projects settings update --project <id\|key> [--logs-retention-days] [--analytics-retention-days] [--quick-bug-report-enabled] [--analytics-enabled]` | Update a project's settings (only the passed fields change). |
|
|
53
53
|
| `projects github --project <id\|key>` | Show a project's GitHub integration (repo link + secrets-sync state + tag→release binding rules). |
|
|
54
54
|
| `projects github-connect --project <id\|key> --repository <owner/name>` | Connect a project to a repository visible to the organization's GitHub App. |
|
|
55
55
|
| `projects github-map [--connected-only]` | List every visible CloseYourIt project and its connected GitHub repository; automatically fetches all pages. |
|
|
56
56
|
| `projects github-update --project <id\|key> [--default-branch] [--production-environment-id] [--staging-environment-id] [--sync-enabled] [--sync-secrets] [--tag-binding-enabled] [--autoclose-on-merge]` | Update a project's GitHub binding rules (only the passed fields change; `--sync-secrets`/`--no-sync-secrets` toggles pushing vault secrets to GitHub). |
|
|
57
57
|
| `groups list [--page]` | List groups (macro-projects) in your org. |
|
|
58
|
-
| `groups create <name> [--color]
|
|
59
|
-
| `groups update <id\|name> [--name] [--color]
|
|
58
|
+
| `groups create <name> [--color]` | Create a group (container of related projects, e.g. "DriverOne"). |
|
|
59
|
+
| `groups update <id\|name> [--name] [--color]` | Update a group (rename, recolor). |
|
|
60
60
|
| `roles list\|show <id\|name>` | List roles / show a role with its permission keys. |
|
|
61
61
|
| `roles create <name> [--permission <key>…] [--color]` | Create an RBAC role (bundle of permission keys). |
|
|
62
62
|
| `roles update <id\|name> [--name] [--permission <key>…] [--color]` | Update a role (permissions REPLACE the set). |
|
|
@@ -93,7 +93,7 @@ CLOSEYOURIT_TOKEN=cyi_u_… CLOSEYOURIT_API_URL=https://www.closeyour.it \
|
|
|
93
93
|
| `secrets assets shared-list\|shared-upload\|delegate\|undelegate …` | Manage one organization-level ciphertext and delegate it to authorized projects. |
|
|
94
94
|
| `tickets list --project <id\|key> [--page]` | List tickets. |
|
|
95
95
|
| `tickets show <id> --project <id\|key>` | Show one ticket. |
|
|
96
|
-
| `tickets create --project <id\|key> --title <t> [--kind] [--step-*] [--description] [--status-id] [--priority-id]` | Create a ticket. |
|
|
96
|
+
| `tickets create --project <id\|key> --title <t> [--kind bug\|story\|task\|epic] [--parent-id] [--step-*] [--description] [--status-id] [--priority-id]` | Create a ticket. |
|
|
97
97
|
| `tickets statuses` | List the org ticket statuses (id, code, label) — the id feeds `create --status-id`. |
|
|
98
98
|
| `tickets priorities` | List the org ticket priorities (id, code, label) — the id feeds `create --priority-id`. |
|
|
99
99
|
| `tickets reject <id> --project <id\|key> --reason <text>` | Reject the review: back to work, the reason becomes a comment. |
|
|
@@ -7,7 +7,6 @@ export default class GroupsCreate extends BaseCommand {
|
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
9
|
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
-
'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
};
|
|
12
11
|
run(): Promise<unknown>;
|
|
13
12
|
}
|
|
@@ -11,22 +11,15 @@ class GroupsCreate extends base_1.BaseCommand {
|
|
|
11
11
|
static examples = [
|
|
12
12
|
'<%= config.bin %> groups create DriverOne',
|
|
13
13
|
'<%= config.bin %> groups create DriverOne --color indigo',
|
|
14
|
-
'<%= config.bin %> groups create DriverOne --roadmap-enabled',
|
|
15
14
|
];
|
|
16
15
|
static flags = {
|
|
17
16
|
color: core_1.Flags.string({ description: 'Color label' }),
|
|
18
|
-
'roadmap-enabled': core_1.Flags.boolean({
|
|
19
|
-
allowNo: true,
|
|
20
|
-
description: 'Enable the roadmap and cascade it to the projects in this group',
|
|
21
|
-
}),
|
|
22
17
|
};
|
|
23
18
|
async run() {
|
|
24
19
|
const { args, flags } = await this.parse(GroupsCreate);
|
|
25
20
|
const body = { name: args.name };
|
|
26
21
|
if (flags.color !== undefined)
|
|
27
22
|
body.color = flags.color;
|
|
28
|
-
if (flags['roadmap-enabled'] !== undefined)
|
|
29
|
-
body.roadmap_enabled = flags['roadmap-enabled'];
|
|
30
23
|
const res = await this.api.post('/cli/v1/groups', body);
|
|
31
24
|
if (!this.jsonEnabled()) {
|
|
32
25
|
this.log('Group created:');
|
|
@@ -8,7 +8,6 @@ export default class GroupsUpdate extends BaseCommand {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
11
|
};
|
|
13
12
|
run(): Promise<unknown>;
|
|
14
13
|
}
|
|
@@ -7,19 +7,14 @@ class GroupsUpdate extends base_1.BaseCommand {
|
|
|
7
7
|
static args = {
|
|
8
8
|
group: core_1.Args.string({ description: 'Group id (UUID) or name', required: true }),
|
|
9
9
|
};
|
|
10
|
-
static description = 'Update a group (rename, recolor
|
|
10
|
+
static description = 'Update a group (rename, recolor)';
|
|
11
11
|
static examples = [
|
|
12
12
|
'<%= config.bin %> groups update Backend --name "Backend services"',
|
|
13
13
|
'<%= config.bin %> groups update Backend --color indigo',
|
|
14
|
-
'<%= config.bin %> groups update Backend --roadmap-enabled',
|
|
15
14
|
];
|
|
16
15
|
static flags = {
|
|
17
16
|
name: core_1.Flags.string({ description: 'New name' }),
|
|
18
17
|
color: core_1.Flags.string({ description: 'Color label' }),
|
|
19
|
-
'roadmap-enabled': core_1.Flags.boolean({
|
|
20
|
-
allowNo: true,
|
|
21
|
-
description: 'Enable/disable the roadmap and cascade it to the projects in this group',
|
|
22
|
-
}),
|
|
23
18
|
};
|
|
24
19
|
async run() {
|
|
25
20
|
const { args, flags } = await this.parse(GroupsUpdate);
|
|
@@ -29,8 +24,6 @@ class GroupsUpdate extends base_1.BaseCommand {
|
|
|
29
24
|
body.name = flags.name;
|
|
30
25
|
if (flags.color !== undefined)
|
|
31
26
|
body.color = flags.color;
|
|
32
|
-
if (flags['roadmap-enabled'] !== undefined)
|
|
33
|
-
body.roadmap_enabled = flags['roadmap-enabled'];
|
|
34
27
|
const res = await this.api.put(`/cli/v1/groups/${id}`, body);
|
|
35
28
|
if (!this.jsonEnabled()) {
|
|
36
29
|
this.log('Group updated:');
|
|
@@ -16,7 +16,7 @@ class IdeasConvert extends base_1.BaseCommand {
|
|
|
16
16
|
...base_1.projectFlag,
|
|
17
17
|
title: core_1.Flags.string({ description: 'Ticket title (skips AI when set together with --description)' }),
|
|
18
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:
|
|
19
|
+
kind: core_1.Flags.string({ description: 'Ticket kind (default: story)', options: ['bug', 'story', 'task', 'epic'] }),
|
|
20
20
|
'status-id': core_1.Flags.string({ description: 'Status lookup id (default: open)' }),
|
|
21
21
|
'priority-id': core_1.Flags.string({ description: 'Priority lookup id (default: medium)' }),
|
|
22
22
|
};
|
|
@@ -10,7 +10,6 @@ export default class ProjectsCreate extends BaseCommand {
|
|
|
10
10
|
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
11
|
group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
12
|
key: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
13
|
'quick-bug-report-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
14
|
};
|
|
16
15
|
run(): Promise<unknown>;
|
|
@@ -12,7 +12,7 @@ class ProjectsCreate extends base_1.BaseCommand {
|
|
|
12
12
|
'<%= config.bin %> projects create driverone-rails --key DRRA',
|
|
13
13
|
'<%= config.bin %> projects create driverone-rails --group DriverOne --key DRRA',
|
|
14
14
|
'<%= config.bin %> projects create driverone-flutter -g <group-uuid> -k DRFL',
|
|
15
|
-
'<%= config.bin %> projects create acme-api -k ACME --
|
|
15
|
+
'<%= config.bin %> projects create acme-api -k ACME --quick-bug-report-enabled',
|
|
16
16
|
];
|
|
17
17
|
static flags = {
|
|
18
18
|
color: core_1.Flags.string({ description: 'Color label' }),
|
|
@@ -23,10 +23,6 @@ class ProjectsCreate extends base_1.BaseCommand {
|
|
|
23
23
|
required: true,
|
|
24
24
|
description: 'Project key (uppercase A-Z0-9, max 4 chars, unique per org)',
|
|
25
25
|
}),
|
|
26
|
-
'roadmap-enabled': core_1.Flags.boolean({
|
|
27
|
-
allowNo: true,
|
|
28
|
-
description: 'Enable the roadmap (feature/improvement tickets + milestones) for this project',
|
|
29
|
-
}),
|
|
30
26
|
'quick-bug-report-enabled': core_1.Flags.boolean({
|
|
31
27
|
allowNo: true,
|
|
32
28
|
description: 'Enable the AI-assisted quick bug report on this project',
|
|
@@ -46,8 +42,6 @@ class ProjectsCreate extends base_1.BaseCommand {
|
|
|
46
42
|
else
|
|
47
43
|
body.group_name = flags.group;
|
|
48
44
|
}
|
|
49
|
-
if (flags['roadmap-enabled'] !== undefined)
|
|
50
|
-
body.roadmap_enabled = flags['roadmap-enabled'];
|
|
51
45
|
if (flags['quick-bug-report-enabled'] !== undefined)
|
|
52
46
|
body.quick_bug_report_enabled = flags['quick-bug-report-enabled'];
|
|
53
47
|
const res = await this.api.post('/cli/v1/projects', body);
|
|
@@ -5,7 +5,6 @@ export default class ProjectsSettingsUpdate extends BaseCommand {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
'logs-retention-days': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
'analytics-retention-days': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
-
'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
8
|
'quick-bug-report-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
'analytics-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -8,7 +8,7 @@ class ProjectsSettingsUpdate extends base_1.BaseCommand {
|
|
|
8
8
|
static examples = [
|
|
9
9
|
'<%= config.bin %> projects settings update --project LBRA --logs-retention-days 30',
|
|
10
10
|
'<%= config.bin %> projects settings update -p LBRA --analytics-retention-days 365 --analytics-enabled',
|
|
11
|
-
'<%= config.bin %> projects settings update -p LBRA --
|
|
11
|
+
'<%= config.bin %> projects settings update -p LBRA --no-quick-bug-report-enabled',
|
|
12
12
|
];
|
|
13
13
|
static flags = {
|
|
14
14
|
...base_1.projectFlag,
|
|
@@ -16,7 +16,6 @@ class ProjectsSettingsUpdate extends base_1.BaseCommand {
|
|
|
16
16
|
'analytics-retention-days': core_1.Flags.integer({
|
|
17
17
|
description: 'Analytics retention in days (blank inherits the org/global default)',
|
|
18
18
|
}),
|
|
19
|
-
'roadmap-enabled': core_1.Flags.boolean({ allowNo: true, description: 'Enable/disable the project roadmap' }),
|
|
20
19
|
'quick-bug-report-enabled': core_1.Flags.boolean({
|
|
21
20
|
allowNo: true,
|
|
22
21
|
description: 'Enable/disable the AI-assisted quick bug report',
|
|
@@ -31,8 +30,6 @@ class ProjectsSettingsUpdate extends base_1.BaseCommand {
|
|
|
31
30
|
body.logs_retention_days = flags['logs-retention-days'];
|
|
32
31
|
if (flags['analytics-retention-days'] !== undefined)
|
|
33
32
|
body.analytics_retention_days = flags['analytics-retention-days'];
|
|
34
|
-
if (flags['roadmap-enabled'] !== undefined)
|
|
35
|
-
body.roadmap_enabled = flags['roadmap-enabled'];
|
|
36
33
|
if (flags['quick-bug-report-enabled'] !== undefined)
|
|
37
34
|
body.quick_bug_report_enabled = flags['quick-bug-report-enabled'];
|
|
38
35
|
if (flags['analytics-enabled'] !== undefined)
|
|
@@ -8,7 +8,6 @@ export default class ProjectsUpdate extends BaseCommand {
|
|
|
8
8
|
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
9
|
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
'roadmap-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
11
|
'quick-bug-report-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
12
|
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
13
|
};
|
|
@@ -7,7 +7,7 @@ class ProjectsUpdate extends base_1.BaseCommand {
|
|
|
7
7
|
static examples = [
|
|
8
8
|
'<%= config.bin %> projects update --project LBRA --name "New name"',
|
|
9
9
|
'<%= config.bin %> projects update -p LBRA --group Backend',
|
|
10
|
-
'<%= config.bin %> projects update -p LBRA --
|
|
10
|
+
'<%= config.bin %> projects update -p LBRA --no-quick-bug-report-enabled',
|
|
11
11
|
];
|
|
12
12
|
static flags = {
|
|
13
13
|
...base_1.projectFlag,
|
|
@@ -16,10 +16,6 @@ class ProjectsUpdate extends base_1.BaseCommand {
|
|
|
16
16
|
color: core_1.Flags.string({ description: 'Color label' }),
|
|
17
17
|
description: core_1.Flags.string({ description: 'Free-form description' }),
|
|
18
18
|
group: core_1.Flags.string({ description: 'Group id (UUID) or name to move the project into' }),
|
|
19
|
-
'roadmap-enabled': core_1.Flags.boolean({
|
|
20
|
-
allowNo: true,
|
|
21
|
-
description: 'Enable/disable the roadmap (feature/improvement tickets + milestones) for this project',
|
|
22
|
-
}),
|
|
23
19
|
'quick-bug-report-enabled': core_1.Flags.boolean({
|
|
24
20
|
allowNo: true,
|
|
25
21
|
description: 'Enable/disable the AI-assisted quick bug report on this project',
|
|
@@ -35,8 +31,6 @@ class ProjectsUpdate extends base_1.BaseCommand {
|
|
|
35
31
|
}
|
|
36
32
|
if (flags.group !== undefined)
|
|
37
33
|
body.group_id = await this.resolveGroupId(flags.group);
|
|
38
|
-
if (flags['roadmap-enabled'] !== undefined)
|
|
39
|
-
body.roadmap_enabled = flags['roadmap-enabled'];
|
|
40
34
|
if (flags['quick-bug-report-enabled'] !== undefined)
|
|
41
35
|
body.quick_bug_report_enabled = flags['quick-bug-report-enabled'];
|
|
42
36
|
const res = await this.api.put(`/cli/v1/projects/${projectId}`, body);
|
|
@@ -17,6 +17,7 @@ export default class TicketsCreate extends BaseCommand {
|
|
|
17
17
|
'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
18
|
'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
19
|
'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
'parent-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
21
|
'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
22
|
title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
23
|
kind: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -14,7 +14,7 @@ class TicketsCreate extends base_1.BaseCommand {
|
|
|
14
14
|
static flags = {
|
|
15
15
|
...base_1.projectFlag,
|
|
16
16
|
title: core_1.Flags.string({ description: 'Ticket title', required: true }),
|
|
17
|
-
kind: core_1.Flags.string({ description: 'Ticket kind (bug,
|
|
17
|
+
kind: core_1.Flags.string({ description: 'Ticket kind (bug, story, task, epic)', default: 'bug', options: ['bug', 'story', 'task', 'epic'] }),
|
|
18
18
|
...ticket_body_1.ticketBodyFlags,
|
|
19
19
|
};
|
|
20
20
|
async run() {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class TicketsEligibility 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
|
+
allow: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
auto: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
block: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 TicketsEligibility extends base_1.BaseCommand {
|
|
7
|
+
// Human override of the agent-eligibility gate (backend gates `tickets.edit`). A ticket reaches the
|
|
8
|
+
// autonomous agents only when it is `allowed`; the automatic verdict is produced by the backend.
|
|
9
|
+
// A human decision is sticky: re-evaluation never overwrites it, `--auto` is how you release it.
|
|
10
|
+
static description = 'Allow or block a ticket for autonomous agents (requires tickets.edit)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> tickets eligibility DRFL-3 --project acme-api --allow',
|
|
13
|
+
'<%= config.bin %> tickets eligibility DRFL-3 --project acme-api --block --reason "touches production data"',
|
|
14
|
+
'<%= config.bin %> tickets eligibility DRFL-3 --project acme-api --auto',
|
|
15
|
+
];
|
|
16
|
+
static args = {
|
|
17
|
+
id: core_1.Args.string({ description: 'Ticket id or code (e.g. DRFL-3)', required: true }),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
...base_1.projectFlag,
|
|
21
|
+
allow: core_1.Flags.boolean({ description: 'Let autonomous agents work this ticket', exclusive: ['block', 'auto'] }),
|
|
22
|
+
auto: core_1.Flags.boolean({ description: 'Drop the human decision and re-evaluate automatically', exclusive: ['allow', 'block'] }),
|
|
23
|
+
block: core_1.Flags.boolean({ description: 'Keep this ticket for a human', exclusive: ['allow', 'auto'] }),
|
|
24
|
+
reason: core_1.Flags.string({ description: 'Why (shown next to the verdict; ignored with --auto)' }),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { args, flags } = await this.parse(TicketsEligibility);
|
|
28
|
+
// One decision per call, and it must be explicit: defaulting would let a typo silently open the
|
|
29
|
+
// gate on a ticket someone meant to keep.
|
|
30
|
+
const decision = [
|
|
31
|
+
flags.allow ? 'allowed' : null,
|
|
32
|
+
flags.block ? 'blocked' : null,
|
|
33
|
+
flags.auto ? 'auto' : null,
|
|
34
|
+
].find(Boolean);
|
|
35
|
+
if (!decision)
|
|
36
|
+
this.error('Pick one of --allow, --block or --auto.');
|
|
37
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
38
|
+
const res = await this.api.put(`/cli/v1/projects/${projectId}/tickets/${args.id}/eligibility`, { eligibility: decision, ...(flags.reason ? { reason: flags.reason } : {}) });
|
|
39
|
+
if (!this.jsonEnabled()) {
|
|
40
|
+
this.log(`Ticket ${args.id} agent eligibility set to ${decision}:`);
|
|
41
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
42
|
+
}
|
|
43
|
+
return res;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = TicketsEligibility;
|
|
@@ -3,6 +3,7 @@ export default class TicketsList extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
'agent-eligibility': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
7
|
page: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
8
|
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
9
|
};
|
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
3
4
|
const base_1 = require("../../base");
|
|
4
5
|
const output_1 = require("../../lib/output");
|
|
6
|
+
// Agent-eligibility gate: a ticket reaches the autonomous agents only when it is `allowed`.
|
|
7
|
+
// Rendered short so the column stays scannable next to CODE.
|
|
8
|
+
const AGENTS_MARK = {
|
|
9
|
+
allowed: 'yes',
|
|
10
|
+
blocked: 'no',
|
|
11
|
+
pending: '?',
|
|
12
|
+
};
|
|
5
13
|
class TicketsList extends base_1.BaseCommand {
|
|
6
14
|
static description = 'List tickets for a project';
|
|
7
|
-
static examples = [
|
|
8
|
-
|
|
15
|
+
static examples = [
|
|
16
|
+
'<%= config.bin %> tickets list --project acme-api',
|
|
17
|
+
'<%= config.bin %> tickets list -p acme-api --agent-eligibility pending',
|
|
18
|
+
'<%= config.bin %> tickets list -p acme-api --json',
|
|
19
|
+
];
|
|
20
|
+
static flags = {
|
|
21
|
+
...base_1.projectFlag,
|
|
22
|
+
...base_1.pageFlag,
|
|
23
|
+
'agent-eligibility': core_1.Flags.string({
|
|
24
|
+
description: 'Filter by agent eligibility',
|
|
25
|
+
options: ['pending', 'allowed', 'blocked'],
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
9
28
|
async run() {
|
|
10
29
|
const { flags } = await this.parse(TicketsList);
|
|
11
30
|
const projectId = await this.resolveProjectId(flags.project);
|
|
12
|
-
const
|
|
31
|
+
const query = new URLSearchParams({ page: String(flags.page) });
|
|
32
|
+
if (flags['agent-eligibility'])
|
|
33
|
+
query.set('agent_eligibility', flags['agent-eligibility']);
|
|
34
|
+
const res = await this.api.get(`/cli/v1/projects/${projectId}/tickets?${query.toString()}`);
|
|
13
35
|
const tickets = res.data ?? [];
|
|
14
36
|
if (!this.jsonEnabled()) {
|
|
15
|
-
this.log((0, output_1.renderTable)(['CODE', 'TITLE', 'STATUS'], tickets.map((ticket) => [
|
|
37
|
+
this.log((0, output_1.renderTable)(['CODE', 'TITLE', 'STATUS', 'AGENTS'], tickets.map((ticket) => [
|
|
16
38
|
String(ticket.code ?? ''),
|
|
17
39
|
String(ticket.title ?? ''),
|
|
18
40
|
(0, output_1.statusCell)(ticket.status, typeof ticket.status_color === 'string' ? ticket.status_color : undefined),
|
|
41
|
+
AGENTS_MARK[String(ticket.agent_eligibility ?? '')] ?? '',
|
|
19
42
|
])));
|
|
20
43
|
}
|
|
21
44
|
return res;
|
|
@@ -86,6 +86,11 @@ class TicketsShow extends base_1.BaseCommand {
|
|
|
86
86
|
milestone: ticket.milestone,
|
|
87
87
|
platforms: platforms || null,
|
|
88
88
|
project_id: ticket.project_id,
|
|
89
|
+
// Agent-eligibility gate: whether the autonomous agents may work this ticket, and why.
|
|
90
|
+
// The reason is the part you act on — it is what tells you whether to override the verdict.
|
|
91
|
+
agent_eligibility: ticket.agent_eligibility,
|
|
92
|
+
agent_eligibility_source: ticket.agent_eligibility_source,
|
|
93
|
+
agent_eligibility_reason: ticket.agent_eligibility_reason,
|
|
89
94
|
created_at: ticket.created_at,
|
|
90
95
|
updated_at: ticket.updated_at,
|
|
91
96
|
}));
|
|
@@ -20,6 +20,7 @@ export default class TicketsUpdate extends BaseCommand {
|
|
|
20
20
|
'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
21
|
'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
22
|
'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
+
'parent-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
24
|
'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
25
|
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
26
|
kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -18,7 +18,7 @@ class TicketsUpdate extends base_1.BaseCommand {
|
|
|
18
18
|
static flags = {
|
|
19
19
|
...base_1.projectFlag,
|
|
20
20
|
title: core_1.Flags.string({ description: 'Ticket title' }),
|
|
21
|
-
kind: core_1.Flags.string({ description: 'Ticket kind (bug,
|
|
21
|
+
kind: core_1.Flags.string({ description: 'Ticket kind (bug, story, task, epic)', options: ['bug', 'story', 'task', 'epic'] }),
|
|
22
22
|
...ticket_body_1.ticketBodyFlags,
|
|
23
23
|
};
|
|
24
24
|
async run() {
|
|
@@ -13,6 +13,7 @@ export declare const ticketBodyFlags: {
|
|
|
13
13
|
'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
14
|
'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
15
|
'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
'parent-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
17
|
'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
18
|
};
|
|
18
19
|
type BodyFlags = Record<string, unknown>;
|
package/dist/lib/ticket-body.js
CHANGED
|
@@ -26,6 +26,7 @@ exports.ticketBodyFlags = {
|
|
|
26
26
|
'priority-id': core_1.Flags.string({ description: 'Priority lookup id' }),
|
|
27
27
|
'assignee-id': core_1.Flags.string({ description: 'Assignee account id' }),
|
|
28
28
|
'milestone-id': core_1.Flags.string({ description: 'Milestone id (of this project)' }),
|
|
29
|
+
'parent-id': core_1.Flags.string({ description: 'Parent epic id (of this project) — pass an empty string to detach' }),
|
|
29
30
|
'platform-id': core_1.Flags.string({ description: 'Affected platform id (repeatable)', multiple: true }),
|
|
30
31
|
};
|
|
31
32
|
const STEP_KEYS = [
|
|
@@ -80,6 +81,8 @@ function applyTicketBody(body, flags) {
|
|
|
80
81
|
body.assignee_id = flags['assignee-id'];
|
|
81
82
|
if (flags['milestone-id'] !== undefined)
|
|
82
83
|
body.milestone_id = flags['milestone-id'];
|
|
84
|
+
if (flags['parent-id'] !== undefined)
|
|
85
|
+
body.parent_id = flags['parent-id'];
|
|
83
86
|
if (flags['platform-id'] !== undefined)
|
|
84
87
|
body.platform_ids = flags['platform-id'];
|
|
85
88
|
const scenarios = scenariosFromFlags(flags);
|