@bussolabs/closeyourit-cli 0.0.2 → 0.0.4
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/dist/commands/alerts/create.d.ts +18 -0
- package/dist/commands/alerts/create.js +48 -0
- package/dist/commands/alerts/delete.d.ts +12 -0
- package/dist/commands/alerts/delete.js +25 -0
- package/dist/commands/alerts/list.d.ts +9 -0
- package/dist/commands/alerts/list.js +24 -0
- package/dist/commands/alerts/show.d.ts +9 -0
- package/dist/commands/alerts/show.js +21 -0
- package/dist/commands/alerts/update.d.ts +19 -0
- package/dist/commands/alerts/update.js +53 -0
- package/dist/commands/environments/create.d.ts +15 -0
- package/dist/commands/environments/create.js +37 -0
- package/dist/commands/environments/delete.d.ts +12 -0
- package/dist/commands/environments/delete.js +26 -0
- package/dist/commands/environments/list.d.ts +9 -0
- package/dist/commands/environments/list.js +25 -0
- package/dist/commands/environments/update.d.ts +16 -0
- package/dist/commands/environments/update.js +45 -0
- package/dist/commands/errors/promote.d.ts +12 -0
- package/dist/commands/errors/promote.js +24 -0
- package/dist/commands/groups/delete.d.ts +12 -0
- package/dist/commands/groups/delete.js +26 -0
- package/dist/commands/groups/update.d.ts +13 -0
- package/dist/commands/groups/update.js +35 -0
- package/dist/commands/invitations/resend.d.ts +9 -0
- package/dist/commands/invitations/resend.js +25 -0
- package/dist/commands/members/set-access.d.ts +13 -0
- package/dist/commands/members/set-access.js +44 -0
- package/dist/commands/members/set-role.d.ts +12 -0
- package/dist/commands/members/set-role.js +32 -0
- package/dist/commands/metrics/promote.d.ts +12 -0
- package/dist/commands/metrics/promote.js +24 -0
- package/dist/commands/milestones/create.d.ts +14 -0
- package/dist/commands/milestones/create.js +38 -0
- package/dist/commands/milestones/delete.d.ts +13 -0
- package/dist/commands/milestones/delete.js +27 -0
- package/dist/commands/milestones/list.d.ts +10 -0
- package/dist/commands/milestones/list.js +29 -0
- package/dist/commands/milestones/show.d.ts +12 -0
- package/dist/commands/milestones/show.js +23 -0
- package/dist/commands/milestones/update.d.ts +17 -0
- package/dist/commands/milestones/update.js +45 -0
- package/dist/commands/monitors/create.d.ts +15 -0
- package/dist/commands/monitors/create.js +43 -0
- package/dist/commands/monitors/delete.d.ts +13 -0
- package/dist/commands/monitors/delete.js +27 -0
- package/dist/commands/monitors/list.d.ts +10 -0
- package/dist/commands/monitors/list.js +29 -0
- package/dist/commands/monitors/pause.d.ts +12 -0
- package/dist/commands/monitors/pause.js +21 -0
- package/dist/commands/monitors/resume.d.ts +12 -0
- package/dist/commands/monitors/resume.js +21 -0
- package/dist/commands/monitors/show.d.ts +12 -0
- package/dist/commands/monitors/show.js +23 -0
- package/dist/commands/monitors/update.d.ts +17 -0
- package/dist/commands/monitors/update.js +45 -0
- package/dist/commands/org/show.d.ts +6 -0
- package/dist/commands/org/show.js +16 -0
- package/dist/commands/org/update.d.ts +11 -0
- package/dist/commands/org/update.js +35 -0
- package/dist/commands/platforms/create.d.ts +15 -0
- package/dist/commands/platforms/create.js +36 -0
- package/dist/commands/platforms/delete.d.ts +12 -0
- package/dist/commands/platforms/delete.js +26 -0
- package/dist/commands/platforms/list.d.ts +9 -0
- package/dist/commands/platforms/list.js +25 -0
- package/dist/commands/platforms/update.d.ts +16 -0
- package/dist/commands/platforms/update.js +45 -0
- package/dist/commands/projects/create.d.ts +1 -1
- package/dist/commands/projects/create.js +3 -4
- package/dist/commands/projects/delete.d.ts +10 -0
- package/dist/commands/projects/delete.js +24 -0
- package/dist/commands/projects/update.d.ts +14 -0
- package/dist/commands/projects/update.js +37 -0
- package/dist/commands/tickets/assign.d.ts +14 -0
- package/dist/commands/tickets/assign.js +38 -0
- package/dist/commands/tickets/attach.d.ts +13 -0
- package/dist/commands/tickets/attach.js +48 -0
- package/dist/commands/tickets/comment-delete.d.ts +14 -0
- package/dist/commands/tickets/comment-delete.js +30 -0
- package/dist/commands/tickets/comment.d.ts +13 -0
- package/dist/commands/tickets/comment.js +29 -0
- package/dist/commands/tickets/delete.d.ts +13 -0
- package/dist/commands/tickets/delete.js +27 -0
- package/dist/commands/tickets/detach.d.ts +14 -0
- package/dist/commands/tickets/detach.js +30 -0
- package/dist/commands/tickets/milestone.d.ts +14 -0
- package/dist/commands/tickets/milestone.js +38 -0
- package/dist/commands/tickets/status.d.ts +13 -0
- package/dist/commands/tickets/status.js +27 -0
- package/dist/commands/tickets/unvote.d.ts +12 -0
- package/dist/commands/tickets/unvote.js +24 -0
- package/dist/commands/tickets/update.d.ts +25 -0
- package/dist/commands/tickets/update.js +71 -0
- package/dist/commands/tickets/vote.d.ts +12 -0
- package/dist/commands/tickets/vote.js +24 -0
- package/dist/lib/api.d.ts +17 -0
- package/dist/lib/api.js +40 -12
- package/oclif.manifest.json +3362 -604
- package/package.json +49 -14
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MonitorsUpdate 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
|
+
url: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'http-method': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'interval-seconds': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'expected-status': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'timeout-seconds': import("@oclif/core/lib/interfaces").OptionFlag<number | 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,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 MonitorsUpdate extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Update an uptime monitor (URL, method, interval, expected status, timeout)';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> monitors update <monitor-id> --project acme-api --interval-seconds 120',
|
|
10
|
+
'<%= config.bin %> monitors update <monitor-id> -p acme-api --url https://acme.example.com/health --expected-status 204',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
id: core_1.Args.string({ description: 'Monitor id', required: true }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
...base_1.projectFlag,
|
|
17
|
+
url: core_1.Flags.string({ description: 'URL to probe' }),
|
|
18
|
+
'http-method': core_1.Flags.string({ description: 'HTTP method' }),
|
|
19
|
+
'interval-seconds': core_1.Flags.integer({ description: 'Seconds between checks' }),
|
|
20
|
+
'expected-status': core_1.Flags.integer({ description: 'Expected HTTP status code' }),
|
|
21
|
+
'timeout-seconds': core_1.Flags.integer({ description: 'Request timeout in seconds' }),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(MonitorsUpdate);
|
|
25
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
26
|
+
const body = {};
|
|
27
|
+
if (flags.url !== undefined)
|
|
28
|
+
body.url = flags.url;
|
|
29
|
+
if (flags['http-method'] !== undefined)
|
|
30
|
+
body.http_method = flags['http-method'];
|
|
31
|
+
if (flags['interval-seconds'] !== undefined)
|
|
32
|
+
body.interval_seconds = flags['interval-seconds'];
|
|
33
|
+
if (flags['expected-status'] !== undefined)
|
|
34
|
+
body.expected_status = flags['expected-status'];
|
|
35
|
+
if (flags['timeout-seconds'] !== undefined)
|
|
36
|
+
body.timeout_seconds = flags['timeout-seconds'];
|
|
37
|
+
const res = await this.api.put(`/cli/v1/projects/${encodeURIComponent(projectId)}/monitors/${encodeURIComponent(args.id)}`, body);
|
|
38
|
+
if (!this.jsonEnabled()) {
|
|
39
|
+
this.log('Monitor updated:');
|
|
40
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = MonitorsUpdate;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 OrgShow extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Show your organization settings';
|
|
7
|
+
static examples = ['<%= config.bin %> org show', '<%= config.bin %> org show --json'];
|
|
8
|
+
async run() {
|
|
9
|
+
const res = await this.api.get('/cli/v1/organization');
|
|
10
|
+
if (!this.jsonEnabled()) {
|
|
11
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
12
|
+
}
|
|
13
|
+
return res;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = OrgShow;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class OrgUpdate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
slug: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'projects-view': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 OrgUpdate extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Update your organization settings (requires organization.manage)';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> org update --name "Acme Inc"',
|
|
10
|
+
'<%= config.bin %> org update --slug acme-inc',
|
|
11
|
+
'<%= config.bin %> org update --projects-view table',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
name: core_1.Flags.string({ description: 'New organization name' }),
|
|
15
|
+
slug: core_1.Flags.string({ description: 'New organization slug (lowercase, a-z 0-9 and hyphens)' }),
|
|
16
|
+
'projects-view': core_1.Flags.string({ description: 'Default projects list view', options: ['cards', 'table'] }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const { flags } = await this.parse(OrgUpdate);
|
|
20
|
+
const body = {};
|
|
21
|
+
if (flags.name !== undefined)
|
|
22
|
+
body.name = flags.name;
|
|
23
|
+
if (flags.slug !== undefined)
|
|
24
|
+
body.slug = flags.slug;
|
|
25
|
+
if (flags['projects-view'] !== undefined)
|
|
26
|
+
body.default_projects_view = flags['projects-view'];
|
|
27
|
+
const res = await this.api.put('/cli/v1/organization', body);
|
|
28
|
+
if (!this.jsonEnabled()) {
|
|
29
|
+
this.log('Organization updated:');
|
|
30
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
31
|
+
}
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = OrgUpdate;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class PlatformsCreate extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
code: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
label: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
color: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
position: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
active: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 PlatformsCreate extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
code: core_1.Args.string({ description: 'Platform code (e.g. "ios", "android", "web")', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Create a platform (a device/system your projects run on)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> platforms create ios --label iOS',
|
|
13
|
+
'<%= config.bin %> platforms create android --label Android --color emerald --position 2',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
label: core_1.Flags.string({ description: 'Human-readable label', required: true }),
|
|
17
|
+
color: core_1.Flags.string({ description: 'Color label', default: 'sky' }),
|
|
18
|
+
position: core_1.Flags.integer({ description: 'Sort position' }),
|
|
19
|
+
active: core_1.Flags.boolean({ allowNo: true, description: 'Whether the platform is active' }),
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(PlatformsCreate);
|
|
23
|
+
const body = { code: args.code, label: flags.label, color: flags.color };
|
|
24
|
+
if (flags.position !== undefined)
|
|
25
|
+
body.position = flags.position;
|
|
26
|
+
if (flags.active !== undefined)
|
|
27
|
+
body.active = flags.active;
|
|
28
|
+
const res = await this.api.post('/cli/v1/platforms', body);
|
|
29
|
+
if (!this.jsonEnabled()) {
|
|
30
|
+
this.log('Platform created:');
|
|
31
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
32
|
+
}
|
|
33
|
+
return res;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = PlatformsCreate;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class PlatformsDelete extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
platform: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<unknown>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 PlatformsDelete extends base_1.BaseCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
platform: core_1.Args.string({ description: 'Platform id (UUID) or code', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Delete a platform (blocked if any project or ticket still references it)';
|
|
10
|
+
static examples = ['<%= config.bin %> platforms delete legacy --confirm'];
|
|
11
|
+
static flags = {
|
|
12
|
+
confirm: core_1.Flags.boolean({ description: 'Required: confirm the deletion' }),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { args, flags } = await this.parse(PlatformsDelete);
|
|
16
|
+
if (!flags.confirm) {
|
|
17
|
+
this.error('Refusing to delete without --confirm.', { exit: 2 });
|
|
18
|
+
}
|
|
19
|
+
// The backend resolves the path identifier by id-or-code, so pass it through directly.
|
|
20
|
+
await this.api.delete(`/cli/v1/platforms/${encodeURIComponent(args.platform)}`);
|
|
21
|
+
if (!this.jsonEnabled())
|
|
22
|
+
this.log(`Deleted platform ${args.platform}`);
|
|
23
|
+
return { deleted: args.platform };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = PlatformsDelete;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class PlatformsList extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
page: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<unknown>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 PlatformsList extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the platforms (devices/systems) in your organization';
|
|
7
|
+
static examples = ['<%= config.bin %> platforms list', '<%= config.bin %> platforms list --page 2 --json'];
|
|
8
|
+
static flags = { ...base_1.pageFlag };
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags } = await this.parse(PlatformsList);
|
|
11
|
+
const res = await this.api.get(`/cli/v1/platforms?page=${flags.page}`);
|
|
12
|
+
const platforms = res.data ?? [];
|
|
13
|
+
if (!this.jsonEnabled()) {
|
|
14
|
+
this.log((0, output_1.renderTable)(['CODE', 'LABEL', 'COLOR', 'ACTIVE', 'ID'], platforms.map((platform) => [
|
|
15
|
+
String(platform.code ?? ''),
|
|
16
|
+
String(platform.label ?? ''),
|
|
17
|
+
String(platform.color ?? ''),
|
|
18
|
+
String(platform.active ?? ''),
|
|
19
|
+
String(platform.id ?? ''),
|
|
20
|
+
])));
|
|
21
|
+
}
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = PlatformsList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class PlatformsUpdate extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
platform: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
code: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
label: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
position: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
active: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<unknown>;
|
|
16
|
+
}
|
|
@@ -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 PlatformsUpdate extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
platform: core_1.Args.string({ description: 'Platform id (UUID) or code', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Update a platform (relabel, recolor, reorder, activate/deactivate)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> platforms update ios --label "iOS / iPadOS"',
|
|
13
|
+
'<%= config.bin %> platforms update web --color indigo --position 1',
|
|
14
|
+
'<%= config.bin %> platforms update legacy --no-active',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
code: core_1.Flags.string({ description: 'New code' }),
|
|
18
|
+
label: core_1.Flags.string({ description: 'New label' }),
|
|
19
|
+
color: core_1.Flags.string({ description: 'Color label' }),
|
|
20
|
+
position: core_1.Flags.integer({ description: 'Sort position' }),
|
|
21
|
+
active: core_1.Flags.boolean({ allowNo: true, description: 'Whether the platform is active' }),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(PlatformsUpdate);
|
|
25
|
+
const body = {};
|
|
26
|
+
if (flags.code !== undefined)
|
|
27
|
+
body.code = flags.code;
|
|
28
|
+
if (flags.label !== undefined)
|
|
29
|
+
body.label = flags.label;
|
|
30
|
+
if (flags.color !== undefined)
|
|
31
|
+
body.color = flags.color;
|
|
32
|
+
if (flags.position !== undefined)
|
|
33
|
+
body.position = flags.position;
|
|
34
|
+
if (flags.active !== undefined)
|
|
35
|
+
body.active = flags.active;
|
|
36
|
+
// The backend resolves the path identifier by id-or-code, so pass it through directly.
|
|
37
|
+
const res = await this.api.put(`/cli/v1/platforms/${encodeURIComponent(args.platform)}`, body);
|
|
38
|
+
if (!this.jsonEnabled()) {
|
|
39
|
+
this.log('Platform updated:');
|
|
40
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = PlatformsUpdate;
|
|
@@ -9,7 +9,7 @@ export default class ProjectsCreate extends BaseCommand {
|
|
|
9
9
|
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
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
|
-
key: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
12
|
+
key: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<unknown>;
|
|
15
15
|
}
|
|
@@ -19,14 +19,13 @@ class ProjectsCreate extends base_1.BaseCommand {
|
|
|
19
19
|
group: core_1.Flags.string({ char: 'g', description: 'Group id (UUID) or name to place the project in' }),
|
|
20
20
|
key: core_1.Flags.string({
|
|
21
21
|
char: 'k',
|
|
22
|
-
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'Project key (uppercase A-Z0-9, max 4 chars, unique per org)',
|
|
23
24
|
}),
|
|
24
25
|
};
|
|
25
26
|
async run() {
|
|
26
27
|
const { args, flags } = await this.parse(ProjectsCreate);
|
|
27
|
-
const body = { name: args.name };
|
|
28
|
-
if (flags.key !== undefined)
|
|
29
|
-
body.key = flags.key;
|
|
28
|
+
const body = { name: args.name, key: flags.key };
|
|
30
29
|
if (flags.color !== undefined)
|
|
31
30
|
body.color = flags.color;
|
|
32
31
|
if (flags.description !== undefined)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class ProjectsDelete extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<unknown>;
|
|
10
|
+
}
|
|
@@ -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 ProjectsDelete extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Delete a project (irreversible)';
|
|
7
|
+
static examples = ['<%= config.bin %> projects delete --project LBRA --confirm'];
|
|
8
|
+
static flags = {
|
|
9
|
+
...base_1.projectFlag,
|
|
10
|
+
confirm: core_1.Flags.boolean({ description: 'Required: confirm the irreversible deletion' }),
|
|
11
|
+
};
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags } = await this.parse(ProjectsDelete);
|
|
14
|
+
if (!flags.confirm) {
|
|
15
|
+
this.error('Refusing to delete without --confirm (the action is irreversible).', { exit: 2 });
|
|
16
|
+
}
|
|
17
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
18
|
+
await this.api.delete(`/cli/v1/projects/${projectId}`);
|
|
19
|
+
if (!this.jsonEnabled())
|
|
20
|
+
this.log(`Deleted project ${flags.project}`);
|
|
21
|
+
return { deleted: projectId };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = ProjectsDelete;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class ProjectsUpdate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
key: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 ProjectsUpdate extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Update a project (name, key, color, description, group)';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> projects update --project LBRA --name "New name"',
|
|
9
|
+
'<%= config.bin %> projects update -p LBRA --group Backend',
|
|
10
|
+
];
|
|
11
|
+
static flags = {
|
|
12
|
+
...base_1.projectFlag,
|
|
13
|
+
name: core_1.Flags.string({ description: 'New project name' }),
|
|
14
|
+
key: core_1.Flags.string({ description: 'New project key (uppercase A-Z0-9)' }),
|
|
15
|
+
color: core_1.Flags.string({ description: 'Color label' }),
|
|
16
|
+
description: core_1.Flags.string({ description: 'Free-form description' }),
|
|
17
|
+
group: core_1.Flags.string({ description: 'Group id (UUID) or name to move the project into' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(ProjectsUpdate);
|
|
21
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
22
|
+
const body = {};
|
|
23
|
+
for (const k of ['name', 'key', 'color', 'description']) {
|
|
24
|
+
if (flags[k] !== undefined)
|
|
25
|
+
body[k] = flags[k];
|
|
26
|
+
}
|
|
27
|
+
if (flags.group !== undefined)
|
|
28
|
+
body.group_id = await this.resolveGroupId(flags.group);
|
|
29
|
+
const res = await this.api.put(`/cli/v1/projects/${projectId}`, body);
|
|
30
|
+
if (!this.jsonEnabled()) {
|
|
31
|
+
const p = res.data ?? {};
|
|
32
|
+
this.log(`Updated project ${p.key ?? projectId}${p.name ? ` — ${p.name}` : ''}`);
|
|
33
|
+
}
|
|
34
|
+
return res;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = ProjectsUpdate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class TicketsAssign 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
|
+
'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
unassign: 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,38 @@
|
|
|
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 TicketsAssign extends base_1.BaseCommand {
|
|
7
|
+
// PUT .../assignee assigns; DELETE .../assignee unassigns. --unassign picks the DELETE verb.
|
|
8
|
+
static description = 'Assign a ticket to an account, or unassign it (--unassign)';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> tickets assign <ticket-id> --project acme-api --assignee-id <account-id>',
|
|
11
|
+
'<%= config.bin %> tickets assign <ticket-id> --project acme-api --unassign',
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Ticket id', required: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
...base_1.projectFlag,
|
|
18
|
+
'assignee-id': core_1.Flags.string({ description: 'Account id to assign', exclusive: ['unassign'] }),
|
|
19
|
+
unassign: core_1.Flags.boolean({ description: 'Remove the current assignee (DELETE)', exclusive: ['assignee-id'] }),
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(TicketsAssign);
|
|
23
|
+
if (!flags.unassign && flags['assignee-id'] === undefined) {
|
|
24
|
+
this.error('Provide --assignee-id <id> or --unassign.', { exit: 2 });
|
|
25
|
+
}
|
|
26
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
27
|
+
const path = `/cli/v1/projects/${projectId}/tickets/${args.id}/assignee`;
|
|
28
|
+
const res = flags.unassign
|
|
29
|
+
? await this.api.delete(path)
|
|
30
|
+
: await this.api.put(path, { assignee_id: flags['assignee-id'] });
|
|
31
|
+
if (!this.jsonEnabled()) {
|
|
32
|
+
this.log(flags.unassign ? `Ticket ${args.id} unassigned:` : `Ticket ${args.id} assigned:`);
|
|
33
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
34
|
+
}
|
|
35
|
+
return res;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = TicketsAssign;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class TicketsAttach 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
|
+
file: 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,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const promises_1 = require("node:fs/promises");
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const base_1 = require("../../base");
|
|
7
|
+
const output_1 = require("../../lib/output");
|
|
8
|
+
class TicketsAttach extends base_1.BaseCommand {
|
|
9
|
+
static description = 'Attach one or more local files to a ticket';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> tickets attach <ticket-id> --project acme-api --file ./screenshot.png',
|
|
12
|
+
'<%= config.bin %> tickets attach <ticket-id> -p acme-api --file ./log.txt --file ./trace.json',
|
|
13
|
+
];
|
|
14
|
+
static args = {
|
|
15
|
+
id: core_1.Args.string({ description: 'Ticket id', required: true }),
|
|
16
|
+
};
|
|
17
|
+
static flags = {
|
|
18
|
+
...base_1.projectFlag,
|
|
19
|
+
file: core_1.Flags.string({ description: 'Path to a local file to upload (repeatable)', multiple: true, required: true }),
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(TicketsAttach);
|
|
23
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
24
|
+
const files = [];
|
|
25
|
+
for (const path of flags.file) {
|
|
26
|
+
try {
|
|
27
|
+
const buf = await (0, promises_1.readFile)(path);
|
|
28
|
+
files.push({ field: 'files[]', filename: (0, node_path_1.basename)(path), data: new Blob([buf]) });
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
this.error(`File not found or unreadable: ${path}`, { exit: 2 });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const res = await this.api.upload('POST', `/cli/v1/projects/${encodeURIComponent(projectId)}/tickets/${encodeURIComponent(args.id)}/attachments`, files);
|
|
35
|
+
const attachments = res.data ?? [];
|
|
36
|
+
if (!this.jsonEnabled()) {
|
|
37
|
+
this.log(`Attached ${files.length} file${files.length === 1 ? '' : 's'} to ticket ${args.id}:`);
|
|
38
|
+
this.log((0, output_1.renderTable)(['ID', 'FILENAME', 'CONTENT_TYPE', 'BYTE_SIZE'], attachments.map((attachment) => [
|
|
39
|
+
String(attachment.id ?? ''),
|
|
40
|
+
String(attachment.filename ?? ''),
|
|
41
|
+
String(attachment.content_type ?? ''),
|
|
42
|
+
String(attachment.byte_size ?? ''),
|
|
43
|
+
])));
|
|
44
|
+
}
|
|
45
|
+
return res;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = TicketsAttach;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class TicketsCommentDelete 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 TicketsCommentDelete extends base_1.BaseCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
id: core_1.Args.string({ description: 'Ticket id', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Delete a comment from a ticket (author, or with tickets.comment.delete_any)';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> tickets comment-delete <ticket-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(TicketsCommentDelete);
|
|
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}/tickets/${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 = TicketsCommentDelete;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class TicketsComment 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
|
+
}
|