@bussolabs/closeyourit-cli 0.5.0 → 0.7.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 +2 -0
- package/dist/commands/projects/github-update.d.ts +1 -0
- package/dist/commands/projects/github-update.js +7 -0
- package/dist/commands/tickets/priorities.d.ts +6 -0
- package/dist/commands/tickets/priorities.js +23 -0
- package/dist/commands/tickets/statuses.d.ts +6 -0
- package/dist/commands/tickets/statuses.js +23 -0
- package/oclif.manifest.json +2779 -2706
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -94,6 +94,8 @@ CLOSEYOURIT_TOKEN=cyi_u_… CLOSEYOURIT_API_URL=https://www.closeyour.it \
|
|
|
94
94
|
| `tickets list --project <id\|key> [--page]` | List tickets. |
|
|
95
95
|
| `tickets show <id> --project <id\|key>` | Show one ticket. |
|
|
96
96
|
| `tickets create --project <id\|key> --title <t> [--kind] [--step-*] [--description] [--status-id] [--priority-id]` | Create a ticket. |
|
|
97
|
+
| `tickets statuses` | List the org ticket statuses (id, code, label) — the id feeds `create --status-id`. |
|
|
98
|
+
| `tickets priorities` | List the org ticket priorities (id, code, label) — the id feeds `create --priority-id`. |
|
|
97
99
|
| `tickets reject <id> --project <id\|key> --reason <text>` | Reject the review: back to work, the reason becomes a comment. |
|
|
98
100
|
| `tickets approve <id> --project <id\|key>` | Approve the review: move to the first done status. |
|
|
99
101
|
| `tickets links <id> --project <id\|key>` | List the ticket-to-ticket links (duplicate/related) involving a ticket. |
|
|
@@ -10,6 +10,7 @@ export default class ProjectsGithubUpdate extends BaseCommand {
|
|
|
10
10
|
'sync-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
'tag-binding-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
'autoclose-on-merge': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'sync-secrets': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
15
|
};
|
|
15
16
|
run(): Promise<unknown>;
|
|
@@ -9,6 +9,7 @@ class ProjectsGithubUpdate extends base_1.BaseCommand {
|
|
|
9
9
|
'<%= config.bin %> projects github-update -p LBRA --production-environment-id <env-uuid>',
|
|
10
10
|
'<%= config.bin %> projects github-update -p LBRA --no-tag-binding-enabled',
|
|
11
11
|
'<%= config.bin %> projects github-update -p LBRA --default-branch main --autoclose-on-merge',
|
|
12
|
+
'<%= config.bin %> projects github-update -p LBRA --sync-secrets',
|
|
12
13
|
];
|
|
13
14
|
static flags = {
|
|
14
15
|
...base_1.projectFlag,
|
|
@@ -28,6 +29,10 @@ class ProjectsGithubUpdate extends base_1.BaseCommand {
|
|
|
28
29
|
allowNo: true,
|
|
29
30
|
description: 'Enable/disable moving the ticket to done on PR merge',
|
|
30
31
|
}),
|
|
32
|
+
'sync-secrets': core_1.Flags.boolean({
|
|
33
|
+
allowNo: true,
|
|
34
|
+
description: 'Enable/disable pushing vault secrets to the GitHub Environment secrets (SECRETS_JSON)',
|
|
35
|
+
}),
|
|
31
36
|
};
|
|
32
37
|
async run() {
|
|
33
38
|
const { flags } = await this.parse(ProjectsGithubUpdate);
|
|
@@ -47,6 +52,8 @@ class ProjectsGithubUpdate extends base_1.BaseCommand {
|
|
|
47
52
|
body.tag_binding_enabled = flags['tag-binding-enabled'];
|
|
48
53
|
if (flags['autoclose-on-merge'] !== undefined)
|
|
49
54
|
body.autoclose_on_merge = flags['autoclose-on-merge'];
|
|
55
|
+
if (flags['sync-secrets'] !== undefined)
|
|
56
|
+
body.sync_secrets = flags['sync-secrets'];
|
|
50
57
|
// The GitHub action responds to both PATCH and PUT (Rails singleton `resource` update); the CLI
|
|
51
58
|
// transport speaks PUT — the backend applies only the keys present in the body either way.
|
|
52
59
|
const res = await this.api.put(`/cli/v1/projects/${encodeURIComponent(projectId)}/github`, body);
|
|
@@ -0,0 +1,23 @@
|
|
|
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 TicketsPriorities extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the organization ticket priorities (id, code, label) — the id feeds `tickets create --priority-id`';
|
|
7
|
+
static examples = ['<%= config.bin %> tickets priorities', '<%= config.bin %> tickets priorities --json'];
|
|
8
|
+
async run() {
|
|
9
|
+
await this.parse(TicketsPriorities);
|
|
10
|
+
// Org-level lookup (not project-scoped): the ids are valid for a ticket in any project.
|
|
11
|
+
const res = await this.api.get('/cli/v1/types/ticket_priorities');
|
|
12
|
+
const priorities = res.data;
|
|
13
|
+
if (!this.jsonEnabled()) {
|
|
14
|
+
this.log((0, output_1.renderTable)(['ID', 'CODE', 'LABEL'], priorities.map((priority) => [
|
|
15
|
+
String(priority.id ?? ''),
|
|
16
|
+
String(priority.code ?? ''),
|
|
17
|
+
(0, output_1.statusCell)(priority.label, typeof priority.color === 'string' ? priority.color : undefined),
|
|
18
|
+
])));
|
|
19
|
+
}
|
|
20
|
+
return res;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = TicketsPriorities;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 TicketsStatuses extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the organization ticket statuses (id, code, label) — the id feeds `tickets create --status-id`';
|
|
7
|
+
static examples = ['<%= config.bin %> tickets statuses', '<%= config.bin %> tickets statuses --json'];
|
|
8
|
+
async run() {
|
|
9
|
+
await this.parse(TicketsStatuses);
|
|
10
|
+
// Org-level lookup (not project-scoped): the ids are valid for a ticket in any project.
|
|
11
|
+
const res = await this.api.get('/cli/v1/types/ticket_statuses');
|
|
12
|
+
const statuses = res.data;
|
|
13
|
+
if (!this.jsonEnabled()) {
|
|
14
|
+
this.log((0, output_1.renderTable)(['ID', 'CODE', 'LABEL'], statuses.map((status) => [
|
|
15
|
+
String(status.id ?? ''),
|
|
16
|
+
String(status.code ?? ''),
|
|
17
|
+
(0, output_1.statusCell)(status.label, typeof status.color === 'string' ? status.color : undefined),
|
|
18
|
+
])));
|
|
19
|
+
}
|
|
20
|
+
return res;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = TicketsStatuses;
|