@bussolabs/closeyourit-cli 0.0.3 → 0.0.5
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 +1 -0
- 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/logs/list.d.ts +13 -0
- package/dist/commands/logs/list.js +51 -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 +3388 -559
- package/package.json +52 -14
package/README.md
CHANGED
|
@@ -61,6 +61,7 @@ organization are stored locally.
|
|
|
61
61
|
| `tickets create --project <id\|key> --title <t> [--kind] [--step-*] [--description] [--status-id] [--priority-id]` | Create a ticket. |
|
|
62
62
|
| `metrics list --project <id\|key> [--kind] [--page]` | List metric groups. |
|
|
63
63
|
| `metrics show <id> --project <id\|key>` | Show one metric group. |
|
|
64
|
+
| `logs list [--project <id\|key>] [--level] [--trace-id] [--environment] [--page]` | List structured log entries. Cross-app: omit `--project` for the full visible stream. |
|
|
64
65
|
|
|
65
66
|
Every command accepts `--json` for machine-readable output and `--help` for usage details.
|
|
66
67
|
`--project` accepts either a project UUID or its key (matched case-insensitively).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class AlertsCreate extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
'event-type': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'min-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'threshold-ms': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'throttle-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
enabled: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<unknown>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
const EVENT_TYPES = ['error_new', 'error_regression', 'uptime_down', 'uptime_up', 'metric_threshold'];
|
|
7
|
+
class AlertsCreate extends base_1.BaseCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
name: core_1.Args.string({ description: 'Rule name', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Create an alert rule in your organization';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> alerts create "New errors" --event-type error_new',
|
|
14
|
+
'<%= config.bin %> alerts create "API down" --event-type uptime_down --project acme-api --throttle-minutes 30',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
'event-type': core_1.Flags.string({ description: 'Event that triggers the rule', options: EVENT_TYPES, required: true }),
|
|
18
|
+
'min-level': core_1.Flags.string({ description: 'Minimum error level that triggers the rule' }),
|
|
19
|
+
'threshold-ms': core_1.Flags.integer({ description: 'Duration threshold in milliseconds (metric rules)' }),
|
|
20
|
+
'throttle-minutes': core_1.Flags.integer({ description: 'Minimum minutes between notifications' }),
|
|
21
|
+
enabled: core_1.Flags.boolean({ allowNo: true, description: 'Whether the rule is enabled' }),
|
|
22
|
+
project: core_1.Flags.string({ description: 'Scope the rule to a project id (UUID)' }),
|
|
23
|
+
environment: core_1.Flags.string({ description: 'Scope the rule to an environment id (UUID)' }),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { args, flags } = await this.parse(AlertsCreate);
|
|
27
|
+
const body = { name: args.name, event_type: flags['event-type'] };
|
|
28
|
+
if (flags['min-level'] !== undefined)
|
|
29
|
+
body.min_level = flags['min-level'];
|
|
30
|
+
if (flags['threshold-ms'] !== undefined)
|
|
31
|
+
body.threshold_ms = flags['threshold-ms'];
|
|
32
|
+
if (flags['throttle-minutes'] !== undefined)
|
|
33
|
+
body.throttle_minutes = flags['throttle-minutes'];
|
|
34
|
+
if (flags.enabled !== undefined)
|
|
35
|
+
body.enabled = flags.enabled;
|
|
36
|
+
if (flags.project !== undefined)
|
|
37
|
+
body.project_id = flags.project;
|
|
38
|
+
if (flags.environment !== undefined)
|
|
39
|
+
body.environment_id = flags.environment;
|
|
40
|
+
const res = await this.api.post('/cli/v1/alert_rules', body);
|
|
41
|
+
if (!this.jsonEnabled()) {
|
|
42
|
+
this.log('Alert rule created:');
|
|
43
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
44
|
+
}
|
|
45
|
+
return res;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = AlertsCreate;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class AlertsDelete 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
|
+
confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<unknown>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 AlertsDelete extends base_1.BaseCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
id: core_1.Args.string({ description: 'Alert rule id', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Delete an alert rule';
|
|
10
|
+
static examples = ['<%= config.bin %> alerts delete <rule-id> --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(AlertsDelete);
|
|
16
|
+
if (!flags.confirm) {
|
|
17
|
+
this.error('Refusing to delete without --confirm.', { exit: 2 });
|
|
18
|
+
}
|
|
19
|
+
await this.api.delete(`/cli/v1/alert_rules/${encodeURIComponent(args.id)}`);
|
|
20
|
+
if (!this.jsonEnabled())
|
|
21
|
+
this.log(`Deleted alert rule ${args.id}`);
|
|
22
|
+
return { deleted: args.id };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = AlertsDelete;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class AlertsList 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,24 @@
|
|
|
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 AlertsList extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the alert rules in your organization';
|
|
7
|
+
static examples = ['<%= config.bin %> alerts list', '<%= config.bin %> alerts list --page 2 --json'];
|
|
8
|
+
static flags = { ...base_1.pageFlag };
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags } = await this.parse(AlertsList);
|
|
11
|
+
const res = await this.api.get(`/cli/v1/alert_rules?page=${flags.page}`);
|
|
12
|
+
const rules = res.data ?? [];
|
|
13
|
+
if (!this.jsonEnabled()) {
|
|
14
|
+
this.log((0, output_1.renderTable)(['NAME', 'TYPE', 'ENABLED', 'ID'], rules.map((rule) => [
|
|
15
|
+
String(rule.name ?? ''),
|
|
16
|
+
String(rule.event_type ?? ''),
|
|
17
|
+
String(rule.enabled ?? ''),
|
|
18
|
+
String(rule.id ?? ''),
|
|
19
|
+
])));
|
|
20
|
+
}
|
|
21
|
+
return res;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = AlertsList;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class AlertsShow 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
|
+
run(): Promise<unknown>;
|
|
9
|
+
}
|
|
@@ -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
|
+
const output_1 = require("../../lib/output");
|
|
6
|
+
class AlertsShow extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: core_1.Args.string({ description: 'Alert rule id', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Show a single alert rule';
|
|
11
|
+
static examples = ['<%= config.bin %> alerts show <rule-id>'];
|
|
12
|
+
async run() {
|
|
13
|
+
const { args } = await this.parse(AlertsShow);
|
|
14
|
+
const res = await this.api.get(`/cli/v1/alert_rules/${encodeURIComponent(args.id)}`);
|
|
15
|
+
if (!this.jsonEnabled()) {
|
|
16
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
17
|
+
}
|
|
18
|
+
return res;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = AlertsShow;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class AlertsUpdate 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
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'event-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'min-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'threshold-ms': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'throttle-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
enabled: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<unknown>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
const EVENT_TYPES = ['error_new', 'error_regression', 'uptime_down', 'uptime_up', 'metric_threshold'];
|
|
7
|
+
class AlertsUpdate extends base_1.BaseCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
id: core_1.Args.string({ description: 'Alert rule id', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Update an alert rule (send only the fields you want to change)';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> alerts update <rule-id> --name "Critical errors"',
|
|
14
|
+
'<%= config.bin %> alerts update <rule-id> --no-enabled',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
name: core_1.Flags.string({ description: 'Rule name' }),
|
|
18
|
+
'event-type': core_1.Flags.string({ description: 'Event that triggers the rule', options: EVENT_TYPES }),
|
|
19
|
+
'min-level': core_1.Flags.string({ description: 'Minimum error level that triggers the rule' }),
|
|
20
|
+
'threshold-ms': core_1.Flags.integer({ description: 'Duration threshold in milliseconds (metric rules)' }),
|
|
21
|
+
'throttle-minutes': core_1.Flags.integer({ description: 'Minimum minutes between notifications' }),
|
|
22
|
+
enabled: core_1.Flags.boolean({ allowNo: true, description: 'Whether the rule is enabled' }),
|
|
23
|
+
project: core_1.Flags.string({ description: 'Scope the rule to a project id (UUID)' }),
|
|
24
|
+
environment: core_1.Flags.string({ description: 'Scope the rule to an environment id (UUID)' }),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { args, flags } = await this.parse(AlertsUpdate);
|
|
28
|
+
const body = {};
|
|
29
|
+
if (flags.name !== undefined)
|
|
30
|
+
body.name = flags.name;
|
|
31
|
+
if (flags['event-type'] !== undefined)
|
|
32
|
+
body.event_type = flags['event-type'];
|
|
33
|
+
if (flags['min-level'] !== undefined)
|
|
34
|
+
body.min_level = flags['min-level'];
|
|
35
|
+
if (flags['threshold-ms'] !== undefined)
|
|
36
|
+
body.threshold_ms = flags['threshold-ms'];
|
|
37
|
+
if (flags['throttle-minutes'] !== undefined)
|
|
38
|
+
body.throttle_minutes = flags['throttle-minutes'];
|
|
39
|
+
if (flags.enabled !== undefined)
|
|
40
|
+
body.enabled = flags.enabled;
|
|
41
|
+
if (flags.project !== undefined)
|
|
42
|
+
body.project_id = flags.project;
|
|
43
|
+
if (flags.environment !== undefined)
|
|
44
|
+
body.environment_id = flags.environment;
|
|
45
|
+
const res = await this.api.put(`/cli/v1/alert_rules/${encodeURIComponent(args.id)}`, body);
|
|
46
|
+
if (!this.jsonEnabled()) {
|
|
47
|
+
this.log('Alert rule updated:');
|
|
48
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
49
|
+
}
|
|
50
|
+
return res;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = AlertsUpdate;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class EnvironmentsCreate 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,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
|
+
const output_1 = require("../../lib/output");
|
|
6
|
+
class EnvironmentsCreate extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
code: core_1.Args.string({ description: 'Environment code (lowercase, e.g. production)', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Create an environment (production, staging, …) in your organization';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> environments create production --label Production',
|
|
13
|
+
'<%= config.bin %> environments create staging --label Staging --color amber',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
label: core_1.Flags.string({ description: 'Human-readable label', required: true }),
|
|
17
|
+
// Mirrors the member form default (emerald); omit to keep that default.
|
|
18
|
+
color: core_1.Flags.string({ description: 'Color label', default: 'emerald' }),
|
|
19
|
+
position: core_1.Flags.integer({ description: 'Sort position' }),
|
|
20
|
+
active: core_1.Flags.boolean({ description: 'Whether the environment is active', allowNo: true }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args, flags } = await this.parse(EnvironmentsCreate);
|
|
24
|
+
const body = { code: args.code, label: flags.label, color: flags.color };
|
|
25
|
+
if (flags.position !== undefined)
|
|
26
|
+
body.position = flags.position;
|
|
27
|
+
if (flags.active !== undefined)
|
|
28
|
+
body.active = flags.active;
|
|
29
|
+
const res = await this.api.post('/cli/v1/environments', body);
|
|
30
|
+
if (!this.jsonEnabled()) {
|
|
31
|
+
this.log('Environment created:');
|
|
32
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
33
|
+
}
|
|
34
|
+
return res;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = EnvironmentsCreate;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class EnvironmentsDelete extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
environment: 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 EnvironmentsDelete extends base_1.BaseCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
environment: core_1.Args.string({ description: 'Environment id (UUID) or code', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Delete an environment (blocked while projects, tokens or monitors reference it)';
|
|
10
|
+
static examples = ['<%= config.bin %> environments delete staging --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(EnvironmentsDelete);
|
|
16
|
+
if (!flags.confirm) {
|
|
17
|
+
this.error('Refusing to delete without --confirm.', { exit: 2 });
|
|
18
|
+
}
|
|
19
|
+
// Identifier (id or code) goes straight in the path — the backend resolves id-or-code.
|
|
20
|
+
await this.api.delete(`/cli/v1/environments/${encodeURIComponent(args.environment)}`);
|
|
21
|
+
if (!this.jsonEnabled())
|
|
22
|
+
this.log(`Deleted environment ${args.environment}`);
|
|
23
|
+
return { deleted: args.environment };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = EnvironmentsDelete;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class EnvironmentsList 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 EnvironmentsList extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the environments (production, staging, …) in your organization';
|
|
7
|
+
static examples = ['<%= config.bin %> environments list', '<%= config.bin %> environments list --page 2 --json'];
|
|
8
|
+
static flags = { ...base_1.pageFlag };
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags } = await this.parse(EnvironmentsList);
|
|
11
|
+
const res = await this.api.get(`/cli/v1/environments?page=${flags.page}`);
|
|
12
|
+
const environments = res.data ?? [];
|
|
13
|
+
if (!this.jsonEnabled()) {
|
|
14
|
+
this.log((0, output_1.renderTable)(['CODE', 'LABEL', 'COLOR', 'ACTIVE', 'ID'], environments.map((env) => [
|
|
15
|
+
String(env.code ?? ''),
|
|
16
|
+
String(env.label ?? ''),
|
|
17
|
+
String(env.color ?? ''),
|
|
18
|
+
String(env.active ?? ''),
|
|
19
|
+
String(env.id ?? ''),
|
|
20
|
+
])));
|
|
21
|
+
}
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = EnvironmentsList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class EnvironmentsUpdate extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
environment: 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 EnvironmentsUpdate extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
environment: core_1.Args.string({ description: 'Environment id (UUID) or code', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Update an environment (recode, relabel, recolor, reorder, activate/deactivate)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> environments update staging --label "Staging env"',
|
|
13
|
+
'<%= config.bin %> environments update production --color indigo',
|
|
14
|
+
'<%= config.bin %> environments update staging --no-active',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
code: core_1.Flags.string({ description: 'New code (lowercase)' }),
|
|
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({ description: 'Whether the environment is active', allowNo: true }),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(EnvironmentsUpdate);
|
|
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
|
+
// Identifier (id or code) goes straight in the path — the backend resolves id-or-code.
|
|
37
|
+
const res = await this.api.put(`/cli/v1/environments/${encodeURIComponent(args.environment)}`, body);
|
|
38
|
+
if (!this.jsonEnabled()) {
|
|
39
|
+
this.log('Environment updated:');
|
|
40
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = EnvironmentsUpdate;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class ErrorsPromote 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 ErrorsPromote extends base_1.BaseCommand {
|
|
7
|
+
static description = 'Promote an error group to a ticket';
|
|
8
|
+
static examples = ['<%= config.bin %> errors promote <group-id> --project acme-api'];
|
|
9
|
+
static args = {
|
|
10
|
+
id: core_1.Args.string({ description: 'Error group id', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static flags = { ...base_1.projectFlag };
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(ErrorsPromote);
|
|
15
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
16
|
+
const res = await this.api.put(`/cli/v1/projects/${projectId}/error_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 = ErrorsPromote;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class GroupsDelete extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
group: 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 GroupsDelete extends base_1.BaseCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
group: core_1.Args.string({ description: 'Group id (UUID) or name', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Delete a group (its projects are detached, not deleted)';
|
|
10
|
+
static examples = ['<%= config.bin %> groups delete Backend --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(GroupsDelete);
|
|
16
|
+
if (!flags.confirm) {
|
|
17
|
+
this.error('Refusing to delete without --confirm.', { exit: 2 });
|
|
18
|
+
}
|
|
19
|
+
const id = await this.resolveGroupId(args.group);
|
|
20
|
+
await this.api.delete(`/cli/v1/groups/${id}`);
|
|
21
|
+
if (!this.jsonEnabled())
|
|
22
|
+
this.log(`Deleted group ${args.group}`);
|
|
23
|
+
return { deleted: id };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = GroupsDelete;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class GroupsUpdate extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
group: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
color: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -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 GroupsUpdate extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
group: core_1.Args.string({ description: 'Group id (UUID) or name', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Update a group (rename or recolor)';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> groups update Backend --name "Backend services"',
|
|
13
|
+
'<%= config.bin %> groups update Backend --color indigo',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
name: core_1.Flags.string({ description: 'New name' }),
|
|
17
|
+
color: core_1.Flags.string({ description: 'Color label' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { args, flags } = await this.parse(GroupsUpdate);
|
|
21
|
+
const id = await this.resolveGroupId(args.group);
|
|
22
|
+
const body = {};
|
|
23
|
+
if (flags.name !== undefined)
|
|
24
|
+
body.name = flags.name;
|
|
25
|
+
if (flags.color !== undefined)
|
|
26
|
+
body.color = flags.color;
|
|
27
|
+
const res = await this.api.put(`/cli/v1/groups/${id}`, body);
|
|
28
|
+
if (!this.jsonEnabled()) {
|
|
29
|
+
this.log('Group updated:');
|
|
30
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
31
|
+
}
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = GroupsUpdate;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class InvitationsResend 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
|
+
run(): Promise<unknown>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 InvitationsResend extends base_1.BaseCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
id: core_1.Args.string({ description: 'Invitation id (UUID)', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Resend a pending invitation. Prints the acceptance link (shown only once).';
|
|
10
|
+
static examples = ['<%= config.bin %> invitations resend <invitation-uuid>'];
|
|
11
|
+
async run() {
|
|
12
|
+
const { args } = await this.parse(InvitationsResend);
|
|
13
|
+
const res = await this.api.put(`/cli/v1/invitations/${encodeURIComponent(args.id)}/resend`);
|
|
14
|
+
const invitation = res.data ?? {};
|
|
15
|
+
if (!this.jsonEnabled()) {
|
|
16
|
+
this.log(`Invitation resent to ${invitation.email ?? '-'} (role: ${invitation.role ?? '-'}).`);
|
|
17
|
+
this.log('');
|
|
18
|
+
this.log(` accept link: ${invitation.accept_url ?? '-'}`);
|
|
19
|
+
this.log('');
|
|
20
|
+
this.warn('Email delivery is not wired in production — send this link to the invitee manually.');
|
|
21
|
+
}
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = InvitationsResend;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class LogsList 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 | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
level: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
'trace-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<unknown>;
|
|
13
|
+
}
|