@bussolabs/closeyourit-cli 0.0.3 → 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 +3220 -462
- package/package.json +49 -14
|
@@ -0,0 +1,44 @@
|
|
|
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 MembersSetAccess extends base_1.BaseCommand {
|
|
7
|
+
// Full replace: the groups/projects you pass become the member's complete access set.
|
|
8
|
+
// Omit --group / --project to clear that dimension (an empty array is sent).
|
|
9
|
+
static description = "Set a member's group and project access (replaces the current set; omit a flag to clear it)";
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> members set-access <membership-id> --project acme-api --project acme-web',
|
|
12
|
+
'<%= config.bin %> members set-access <membership-id> --group DriverOne',
|
|
13
|
+
'<%= config.bin %> members set-access <membership-id>',
|
|
14
|
+
];
|
|
15
|
+
static args = {
|
|
16
|
+
id: core_1.Args.string({ description: 'Membership id', required: true }),
|
|
17
|
+
};
|
|
18
|
+
static flags = {
|
|
19
|
+
group: core_1.Flags.string({
|
|
20
|
+
description: 'Group id or name to grant access to (repeatable; omit to clear group access)',
|
|
21
|
+
multiple: true,
|
|
22
|
+
default: [],
|
|
23
|
+
}),
|
|
24
|
+
project: core_1.Flags.string({
|
|
25
|
+
description: 'Project id or key to grant access to (repeatable; omit to clear project access)',
|
|
26
|
+
multiple: true,
|
|
27
|
+
default: [],
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
const { args, flags } = await this.parse(MembersSetAccess);
|
|
32
|
+
const body = {
|
|
33
|
+
group_ids: await this.resolveAll(flags.group, (v) => this.resolveGroupId(v)),
|
|
34
|
+
project_ids: await this.resolveAll(flags.project, (v) => this.resolveProjectId(v)),
|
|
35
|
+
};
|
|
36
|
+
const res = await this.api.put(`/cli/v1/members/${encodeURIComponent(args.id)}/access`, body);
|
|
37
|
+
if (!this.jsonEnabled()) {
|
|
38
|
+
this.log('Member access updated:');
|
|
39
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
40
|
+
}
|
|
41
|
+
return res;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = MembersSetAccess;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MembersSetRole 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
|
+
role: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<unknown>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 MembersSetRole extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: core_1.Args.string({ description: 'Membership id', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = "Change a member's organization role";
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> members set-role <membership-id> --role admin',
|
|
13
|
+
'<%= config.bin %> members set-role <membership-id> --role customer',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
role: core_1.Flags.string({
|
|
17
|
+
description: 'Organization role',
|
|
18
|
+
options: ['member', 'admin', 'owner', 'customer'],
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args, flags } = await this.parse(MembersSetRole);
|
|
24
|
+
const res = await this.api.put(`/cli/v1/members/${encodeURIComponent(args.id)}/role`, { role: flags.role });
|
|
25
|
+
if (!this.jsonEnabled()) {
|
|
26
|
+
this.log('Member role updated:');
|
|
27
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
28
|
+
}
|
|
29
|
+
return res;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = MembersSetRole;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MetricsPromote 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 MetricsPromote extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Promote a metric group (slow query/method) to a ticket';
|
|
8
|
+
static examples = ['<%= config.bin %> metrics promote <group-id> --project acme-api'];
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ description: 'Metric group id', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static flags = { ...base_1.projectFlag };
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(MetricsPromote);
|
|
15
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
16
|
+
const res = await this.api.put(`/cli/v1/projects/${projectId}/metric_groups/${args.id}/promotion`);
|
|
17
|
+
if (!this.jsonEnabled()) {
|
|
18
|
+
this.log('Ticket created:');
|
|
19
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
20
|
+
}
|
|
21
|
+
return res;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = MetricsPromote;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MilestonesCreate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
code: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
label: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'due-on': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
active: 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 MilestonesCreate extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Create a milestone for a project';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> milestones create --project acme-api --code v1 --label "Version 1.0"',
|
|
10
|
+
'<%= config.bin %> milestones create -p acme-api --code v1 --label "Version 1.0" --due-on 2026-12-31',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
...base_1.projectFlag,
|
|
14
|
+
code: core_1.Flags.string({ description: 'Milestone code (short identifier)', required: true }),
|
|
15
|
+
label: core_1.Flags.string({ description: 'Human-readable label', required: true }),
|
|
16
|
+
color: core_1.Flags.string({ description: 'Color label' }),
|
|
17
|
+
'due-on': core_1.Flags.string({ description: 'Due date (YYYY-MM-DD)' }),
|
|
18
|
+
active: core_1.Flags.boolean({ allowNo: true, description: 'Whether the milestone is active' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = await this.parse(MilestonesCreate);
|
|
22
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
23
|
+
const body = { code: flags.code, label: flags.label };
|
|
24
|
+
if (flags.color !== undefined)
|
|
25
|
+
body.color = flags.color;
|
|
26
|
+
if (flags['due-on'] !== undefined)
|
|
27
|
+
body.due_on = flags['due-on'];
|
|
28
|
+
if (flags.active !== undefined)
|
|
29
|
+
body.active = flags.active;
|
|
30
|
+
const res = await this.api.post(`/cli/v1/projects/${encodeURIComponent(projectId)}/milestones`, body);
|
|
31
|
+
if (!this.jsonEnabled()) {
|
|
32
|
+
this.log('Milestone created:');
|
|
33
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
34
|
+
}
|
|
35
|
+
return res;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = MilestonesCreate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MilestonesDelete 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
|
+
confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -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
|
+
class MilestonesDelete extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Delete a milestone (irreversible)';
|
|
7
|
+
static examples = ['<%= config.bin %> milestones delete <milestone-id> --project acme-api --confirm'];
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ description: 'Milestone id', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = {
|
|
12
|
+
...base_1.projectFlag,
|
|
13
|
+
confirm: core_1.Flags.boolean({ description: 'Required: confirm the deletion' }),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
const { args, flags } = await this.parse(MilestonesDelete);
|
|
17
|
+
if (!flags.confirm) {
|
|
18
|
+
this.error('Refusing to delete without --confirm.', { exit: 2 });
|
|
19
|
+
}
|
|
20
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
21
|
+
await this.api.delete(`/cli/v1/projects/${encodeURIComponent(projectId)}/milestones/${encodeURIComponent(args.id)}`);
|
|
22
|
+
if (!this.jsonEnabled())
|
|
23
|
+
this.log(`Deleted milestone ${args.id}`);
|
|
24
|
+
return { deleted: args.id };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = MilestonesDelete;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MilestonesList 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
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<unknown>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 MilestonesList extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the milestones for a project';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> milestones list --project acme-api',
|
|
9
|
+
'<%= config.bin %> milestones list -p acme-api --json',
|
|
10
|
+
];
|
|
11
|
+
static flags = { ...base_1.projectFlag, ...base_1.pageFlag };
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags } = await this.parse(MilestonesList);
|
|
14
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
15
|
+
const res = await this.api.get(`/cli/v1/projects/${encodeURIComponent(projectId)}/milestones?page=${flags.page}`);
|
|
16
|
+
const milestones = res.data ?? [];
|
|
17
|
+
if (!this.jsonEnabled()) {
|
|
18
|
+
this.log((0, output_1.renderTable)(['CODE', 'LABEL', 'DUE_ON', 'ACTIVE', 'ID'], milestones.map((milestone) => [
|
|
19
|
+
String(milestone.code ?? ''),
|
|
20
|
+
String(milestone.label ?? ''),
|
|
21
|
+
String(milestone.due_on ?? ''),
|
|
22
|
+
String(milestone.active ?? ''),
|
|
23
|
+
String(milestone.id ?? ''),
|
|
24
|
+
])));
|
|
25
|
+
}
|
|
26
|
+
return res;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = MilestonesList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MilestonesShow 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,23 @@
|
|
|
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 MilestonesShow extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Show a single milestone';
|
|
8
|
+
static examples = ['<%= config.bin %> milestones show <milestone-id> --project acme-api'];
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ description: 'Milestone id', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static flags = { ...base_1.projectFlag };
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(MilestonesShow);
|
|
15
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
16
|
+
const res = await this.api.get(`/cli/v1/projects/${encodeURIComponent(projectId)}/milestones/${encodeURIComponent(args.id)}`);
|
|
17
|
+
if (!this.jsonEnabled()) {
|
|
18
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
19
|
+
}
|
|
20
|
+
return res;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = MilestonesShow;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MilestonesUpdate 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
|
+
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
|
+
'due-on': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
active: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
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 MilestonesUpdate extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Update a milestone (send only the fields you want to change)';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> milestones update <milestone-id> --project acme-api --label "Version 1.1"',
|
|
10
|
+
'<%= config.bin %> milestones update <milestone-id> -p acme-api --due-on 2027-01-15 --no-active',
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
id: core_1.Args.string({ description: 'Milestone id', required: true }),
|
|
14
|
+
};
|
|
15
|
+
static flags = {
|
|
16
|
+
...base_1.projectFlag,
|
|
17
|
+
code: core_1.Flags.string({ description: 'Milestone code (short identifier)' }),
|
|
18
|
+
label: core_1.Flags.string({ description: 'Human-readable label' }),
|
|
19
|
+
color: core_1.Flags.string({ description: 'Color label' }),
|
|
20
|
+
'due-on': core_1.Flags.string({ description: 'Due date (YYYY-MM-DD)' }),
|
|
21
|
+
active: core_1.Flags.boolean({ allowNo: true, description: 'Whether the milestone is active' }),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(MilestonesUpdate);
|
|
25
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
26
|
+
const body = {};
|
|
27
|
+
if (flags.code !== undefined)
|
|
28
|
+
body.code = flags.code;
|
|
29
|
+
if (flags.label !== undefined)
|
|
30
|
+
body.label = flags.label;
|
|
31
|
+
if (flags.color !== undefined)
|
|
32
|
+
body.color = flags.color;
|
|
33
|
+
if (flags['due-on'] !== undefined)
|
|
34
|
+
body.due_on = flags['due-on'];
|
|
35
|
+
if (flags.active !== undefined)
|
|
36
|
+
body.active = flags.active;
|
|
37
|
+
const res = await this.api.put(`/cli/v1/projects/${encodeURIComponent(projectId)}/milestones/${encodeURIComponent(args.id)}`, body);
|
|
38
|
+
if (!this.jsonEnabled()) {
|
|
39
|
+
this.log('Milestone updated:');
|
|
40
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = MilestonesUpdate;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MonitorsCreate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
url: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'http-method': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'interval-seconds': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'expected-status': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'timeout-seconds': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 MonitorsCreate extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Create an uptime monitor for a project (one per environment)';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> monitors create --project acme-api --url https://acme.example.com/up',
|
|
10
|
+
'<%= config.bin %> monitors create -p acme-api --url https://acme.example.com/up --environment <env-id> --interval-seconds 60 --expected-status 200',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
...base_1.projectFlag,
|
|
14
|
+
url: core_1.Flags.string({ description: 'URL to probe', required: true }),
|
|
15
|
+
environment: core_1.Flags.string({ description: 'Environment id (must be declared by the project)' }),
|
|
16
|
+
'http-method': core_1.Flags.string({ description: 'HTTP method (default GET)' }),
|
|
17
|
+
'interval-seconds': core_1.Flags.integer({ description: 'Seconds between checks' }),
|
|
18
|
+
'expected-status': core_1.Flags.integer({ description: 'Expected HTTP status code' }),
|
|
19
|
+
'timeout-seconds': core_1.Flags.integer({ description: 'Request timeout in seconds' }),
|
|
20
|
+
};
|
|
21
|
+
async run() {
|
|
22
|
+
const { flags } = await this.parse(MonitorsCreate);
|
|
23
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
24
|
+
const body = { url: flags.url };
|
|
25
|
+
if (flags.environment !== undefined)
|
|
26
|
+
body.environment_id = flags.environment;
|
|
27
|
+
if (flags['http-method'] !== undefined)
|
|
28
|
+
body.http_method = flags['http-method'];
|
|
29
|
+
if (flags['interval-seconds'] !== undefined)
|
|
30
|
+
body.interval_seconds = flags['interval-seconds'];
|
|
31
|
+
if (flags['expected-status'] !== undefined)
|
|
32
|
+
body.expected_status = flags['expected-status'];
|
|
33
|
+
if (flags['timeout-seconds'] !== undefined)
|
|
34
|
+
body.timeout_seconds = flags['timeout-seconds'];
|
|
35
|
+
const res = await this.api.post(`/cli/v1/projects/${encodeURIComponent(projectId)}/monitors`, body);
|
|
36
|
+
if (!this.jsonEnabled()) {
|
|
37
|
+
this.log('Monitor created:');
|
|
38
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
39
|
+
}
|
|
40
|
+
return res;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = MonitorsCreate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MonitorsDelete 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
|
+
confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -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
|
+
class MonitorsDelete extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Delete an uptime monitor (irreversible)';
|
|
7
|
+
static examples = ['<%= config.bin %> monitors delete <monitor-id> --project acme-api --confirm'];
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ description: 'Monitor id', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = {
|
|
12
|
+
...base_1.projectFlag,
|
|
13
|
+
confirm: core_1.Flags.boolean({ description: 'Required: confirm the deletion' }),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
const { args, flags } = await this.parse(MonitorsDelete);
|
|
17
|
+
if (!flags.confirm) {
|
|
18
|
+
this.error('Refusing to delete without --confirm.', { exit: 2 });
|
|
19
|
+
}
|
|
20
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
21
|
+
await this.api.delete(`/cli/v1/projects/${encodeURIComponent(projectId)}/monitors/${encodeURIComponent(args.id)}`);
|
|
22
|
+
if (!this.jsonEnabled())
|
|
23
|
+
this.log(`Deleted monitor ${args.id}`);
|
|
24
|
+
return { deleted: args.id };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = MonitorsDelete;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MonitorsList 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
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<unknown>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 MonitorsList extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the uptime monitors for a project';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> monitors list --project acme-api',
|
|
9
|
+
'<%= config.bin %> monitors list -p acme-api --json',
|
|
10
|
+
];
|
|
11
|
+
static flags = { ...base_1.projectFlag, ...base_1.pageFlag };
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags } = await this.parse(MonitorsList);
|
|
14
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
15
|
+
const res = await this.api.get(`/cli/v1/projects/${encodeURIComponent(projectId)}/monitors?page=${flags.page}`);
|
|
16
|
+
const monitors = res.data ?? [];
|
|
17
|
+
if (!this.jsonEnabled()) {
|
|
18
|
+
this.log((0, output_1.renderTable)(['NAME', 'URL', 'STATUS', 'ACTIVE', 'ID'], monitors.map((monitor) => [
|
|
19
|
+
String(monitor.name ?? ''),
|
|
20
|
+
String(monitor.url ?? ''),
|
|
21
|
+
String(monitor.current_status ?? ''),
|
|
22
|
+
String(monitor.active ?? ''),
|
|
23
|
+
String(monitor.id ?? ''),
|
|
24
|
+
])));
|
|
25
|
+
}
|
|
26
|
+
return res;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = MonitorsList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MonitorsPause 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,21 @@
|
|
|
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 MonitorsPause extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Pause an uptime monitor (stops scheduling checks)';
|
|
7
|
+
static examples = ['<%= config.bin %> monitors pause <monitor-id> --project acme-api'];
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ description: 'Monitor id', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = { ...base_1.projectFlag };
|
|
12
|
+
async run() {
|
|
13
|
+
const { args, flags } = await this.parse(MonitorsPause);
|
|
14
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
15
|
+
const res = await this.api.put(`/cli/v1/projects/${encodeURIComponent(projectId)}/monitors/${encodeURIComponent(args.id)}/pause`);
|
|
16
|
+
if (!this.jsonEnabled())
|
|
17
|
+
this.log(`Paused monitor ${args.id}`);
|
|
18
|
+
return res;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = MonitorsPause;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MonitorsResume 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,21 @@
|
|
|
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 MonitorsResume extends base_1.BaseCommand {
|
|
6
|
+
static description = 'Resume a paused uptime monitor (re-enables scheduling)';
|
|
7
|
+
static examples = ['<%= config.bin %> monitors resume <monitor-id> --project acme-api'];
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ description: 'Monitor id', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static flags = { ...base_1.projectFlag };
|
|
12
|
+
async run() {
|
|
13
|
+
const { args, flags } = await this.parse(MonitorsResume);
|
|
14
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
15
|
+
const res = await this.api.delete(`/cli/v1/projects/${encodeURIComponent(projectId)}/monitors/${encodeURIComponent(args.id)}/pause`);
|
|
16
|
+
if (!this.jsonEnabled())
|
|
17
|
+
this.log(`Resumed monitor ${args.id}`);
|
|
18
|
+
return res;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = MonitorsResume;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class MonitorsShow 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,23 @@
|
|
|
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 MonitorsShow extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Show a single uptime monitor';
|
|
8
|
+
static examples = ['<%= config.bin %> monitors show <monitor-id> --project acme-api'];
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ description: 'Monitor id', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static flags = { ...base_1.projectFlag };
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(MonitorsShow);
|
|
15
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
16
|
+
const res = await this.api.get(`/cli/v1/projects/${encodeURIComponent(projectId)}/monitors/${encodeURIComponent(args.id)}`);
|
|
17
|
+
if (!this.jsonEnabled()) {
|
|
18
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
19
|
+
}
|
|
20
|
+
return res;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = MonitorsShow;
|