@bussolabs/closeyourit-cli 0.0.19 → 0.0.20
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 +4 -0
- package/dist/commands/projects/github-update.d.ts +15 -0
- package/dist/commands/projects/github-update.js +55 -0
- package/dist/commands/projects/github.d.ts +9 -0
- package/dist/commands/projects/github.js +38 -0
- package/dist/commands/tickets/branch.d.ts +12 -0
- package/dist/commands/tickets/branch.js +27 -0
- package/dist/commands/tickets/pr.d.ts +12 -0
- package/dist/commands/tickets/pr.js +27 -0
- package/oclif.manifest.json +2531 -2310
- package/opencli.json +150 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,8 @@ organization are stored locally.
|
|
|
39
39
|
| `projects unlink-server <link-id> --project <id\|key> --confirm` | Unlink a server host from the project. |
|
|
40
40
|
| `projects settings show --project <id\|key>` | Show a project's settings (log/analytics retention + feature flags). |
|
|
41
41
|
| `projects settings update --project <id\|key> [--logs-retention-days] [--analytics-retention-days] [--roadmap-enabled] [--quick-bug-report-enabled] [--analytics-enabled]` | Update a project's settings (only the passed fields change). |
|
|
42
|
+
| `projects github --project <id\|key>` | Show a project's GitHub integration (repo link + tag→release binding rules). |
|
|
43
|
+
| `projects github-update --project <id\|key> [--default-branch] [--production-environment-id] [--staging-environment-id] [--sync-enabled] [--tag-binding-enabled] [--autoclose-on-merge]` | Update a project's GitHub binding rules (only the passed fields change). |
|
|
42
44
|
| `groups list [--page]` | List groups (macro-projects) in your org. |
|
|
43
45
|
| `groups create <name> [--color] [--roadmap-enabled]` | Create a group (container of related projects, e.g. "DriverOne"). |
|
|
44
46
|
| `groups update <id\|name> [--name] [--color] [--roadmap-enabled]` | Update a group (rename, recolor, toggle roadmap). |
|
|
@@ -78,6 +80,8 @@ organization are stored locally.
|
|
|
78
80
|
| `tickets reviewer <id> --project <id\|key> --reviewer-id <account-id>` | Set the reviewer of a ticket (requires tickets.assign). |
|
|
79
81
|
| `tickets unreviewer <id> --project <id\|key>` | Remove the reviewer of a ticket. |
|
|
80
82
|
| `tickets watch\|unwatch <id> --project <id\|key>` | Watch / stop watching a ticket (its notifications). |
|
|
83
|
+
| `tickets branch <id\|code> --project <id\|key>` | Create a GitHub branch from a ticket (name prefixed with the ticket code). |
|
|
84
|
+
| `tickets pr <id\|code> --project <id\|key>` | Open a GitHub pull request from a ticket (head = the ticket branch). |
|
|
81
85
|
| `ideas delete <id> --project <id\|key> --confirm` | Delete an idea (author always allowed; others need ideas.delete). |
|
|
82
86
|
| `ideas archive\|unarchive <id> --project <id\|key>` | Archive an idea (open → archived) / reopen it. |
|
|
83
87
|
| `ideas case-update <idea-id> <case-id> --project <id\|key> [--title] [--description]` | Update a case (example) of an idea. |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class ProjectsGithubUpdate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
'default-branch': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
'production-environment-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'staging-environment-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'sync-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'tag-binding-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'autoclose-on-merge': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 ProjectsGithubUpdate extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Update a project GitHub binding rules (environment mapping + sync/binding/autoclose flags); only the passed fields change';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> projects github-update -p LBRA --production-environment-id <env-uuid>',
|
|
10
|
+
'<%= config.bin %> projects github-update -p LBRA --no-tag-binding-enabled',
|
|
11
|
+
'<%= config.bin %> projects github-update -p LBRA --default-branch main --autoclose-on-merge',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
...base_1.projectFlag,
|
|
15
|
+
'default-branch': core_1.Flags.string({ description: 'Default base branch used to create branches/PRs' }),
|
|
16
|
+
'production-environment-id': core_1.Flags.string({
|
|
17
|
+
description: 'Environment id mapped to STABLE tags (production target)',
|
|
18
|
+
}),
|
|
19
|
+
'staging-environment-id': core_1.Flags.string({
|
|
20
|
+
description: 'Environment id mapped to PRE-RELEASE tags (staging target)',
|
|
21
|
+
}),
|
|
22
|
+
'sync-enabled': core_1.Flags.boolean({ allowNo: true, description: 'Enable/disable processing of webhook events' }),
|
|
23
|
+
'tag-binding-enabled': core_1.Flags.boolean({ allowNo: true, description: 'Enable/disable tag→release live binding' }),
|
|
24
|
+
'autoclose-on-merge': core_1.Flags.boolean({
|
|
25
|
+
allowNo: true,
|
|
26
|
+
description: 'Enable/disable moving the ticket to done on PR merge',
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
const { flags } = await this.parse(ProjectsGithubUpdate);
|
|
31
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
32
|
+
const body = {};
|
|
33
|
+
if (flags['default-branch'] !== undefined)
|
|
34
|
+
body.default_branch = flags['default-branch'];
|
|
35
|
+
if (flags['production-environment-id'] !== undefined)
|
|
36
|
+
body.production_environment_id = flags['production-environment-id'];
|
|
37
|
+
if (flags['staging-environment-id'] !== undefined)
|
|
38
|
+
body.staging_environment_id = flags['staging-environment-id'];
|
|
39
|
+
if (flags['sync-enabled'] !== undefined)
|
|
40
|
+
body.sync_enabled = flags['sync-enabled'];
|
|
41
|
+
if (flags['tag-binding-enabled'] !== undefined)
|
|
42
|
+
body.tag_binding_enabled = flags['tag-binding-enabled'];
|
|
43
|
+
if (flags['autoclose-on-merge'] !== undefined)
|
|
44
|
+
body.autoclose_on_merge = flags['autoclose-on-merge'];
|
|
45
|
+
// The GitHub action responds to both PATCH and PUT (Rails singleton `resource` update); the CLI
|
|
46
|
+
// transport speaks PUT — the backend applies only the keys present in the body either way.
|
|
47
|
+
const res = await this.api.put(`/cli/v1/projects/${encodeURIComponent(projectId)}/github`, body);
|
|
48
|
+
if (!this.jsonEnabled()) {
|
|
49
|
+
this.log('GitHub integration updated:');
|
|
50
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
51
|
+
}
|
|
52
|
+
return res;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.default = ProjectsGithubUpdate;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class ProjectsGithub extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<unknown>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_1 = require("../../base");
|
|
4
|
+
const output_1 = require("../../lib/output");
|
|
5
|
+
class ProjectsGithub extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Show a project GitHub integration (repo link + tag→release binding rules)';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> projects github --project legalbloom-rails',
|
|
9
|
+
'<%= config.bin %> projects github -p LBRA',
|
|
10
|
+
'<%= config.bin %> projects github -p LBRA --json',
|
|
11
|
+
];
|
|
12
|
+
static flags = { ...base_1.projectFlag };
|
|
13
|
+
async run() {
|
|
14
|
+
const { flags } = await this.parse(ProjectsGithub);
|
|
15
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
16
|
+
const res = await this.api.get(`/cli/v1/projects/${encodeURIComponent(projectId)}/github`);
|
|
17
|
+
if (!this.jsonEnabled()) {
|
|
18
|
+
const data = res.data ?? {};
|
|
19
|
+
// Flatten the repository block into a single record: unset fields render as `-` when not connected.
|
|
20
|
+
const repo = (data.repository ?? {});
|
|
21
|
+
this.log('GitHub integration:');
|
|
22
|
+
this.log((0, output_1.renderRecord)({
|
|
23
|
+
project_id: data.project_id,
|
|
24
|
+
installed: data.installed,
|
|
25
|
+
connected: data.connected,
|
|
26
|
+
full_name: repo.full_name,
|
|
27
|
+
default_branch: repo.default_branch,
|
|
28
|
+
sync_enabled: repo.sync_enabled,
|
|
29
|
+
tag_binding_enabled: repo.tag_binding_enabled,
|
|
30
|
+
autoclose_on_merge: repo.autoclose_on_merge,
|
|
31
|
+
production_environment_id: repo.production_environment_id,
|
|
32
|
+
staging_environment_id: repo.staging_environment_id,
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
return res;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = ProjectsGithub;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class TicketsBranch 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,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 TicketsBranch extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: core_1.Args.string({ description: 'Ticket id or code (e.g. DRFL-3)', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Create a GitHub branch from a ticket (name prefixed with the ticket code)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> tickets branch DRFL-3 --project driverone-flutter',
|
|
13
|
+
'<%= config.bin %> tickets branch DRFL-3 -p driverone-flutter --json',
|
|
14
|
+
];
|
|
15
|
+
static flags = { ...base_1.projectFlag };
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(TicketsBranch);
|
|
18
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
19
|
+
const res = await this.api.post(`/cli/v1/projects/${encodeURIComponent(projectId)}/tickets/${encodeURIComponent(args.id)}/github/branch`);
|
|
20
|
+
if (!this.jsonEnabled()) {
|
|
21
|
+
this.log('Branch created:');
|
|
22
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
23
|
+
}
|
|
24
|
+
return res;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = TicketsBranch;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class TicketsPr 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,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 TicketsPr extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: core_1.Args.string({ description: 'Ticket id or code (e.g. DRFL-3)', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Open a GitHub pull request from a ticket (head = the ticket branch, title prefixed with the code)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> tickets pr DRFL-3 --project driverone-flutter',
|
|
13
|
+
'<%= config.bin %> tickets pr DRFL-3 -p driverone-flutter --json',
|
|
14
|
+
];
|
|
15
|
+
static flags = { ...base_1.projectFlag };
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(TicketsPr);
|
|
18
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
19
|
+
const res = await this.api.post(`/cli/v1/projects/${encodeURIComponent(projectId)}/tickets/${encodeURIComponent(args.id)}/github/pull_request`);
|
|
20
|
+
if (!this.jsonEnabled()) {
|
|
21
|
+
this.log('Pull request opened:');
|
|
22
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
23
|
+
}
|
|
24
|
+
return res;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = TicketsPr;
|