@bussolabs/closeyourit-cli 0.0.14 → 0.0.15
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/ideas/create.d.ts +3 -1
- package/dist/commands/ideas/create.js +10 -3
- package/dist/commands/ideas/show.js +12 -5
- package/oclif.manifest.json +1130 -1116
- package/package.json +1 -1
|
@@ -4,7 +4,9 @@ export default class IdeasCreate extends BaseCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
-
|
|
7
|
+
problem: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
solution: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
stakeholders: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
10
|
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
11
|
};
|
|
10
12
|
run(): Promise<unknown>;
|
|
@@ -6,17 +6,24 @@ const output_1 = require("../../lib/output");
|
|
|
6
6
|
class IdeasCreate extends base_1.BaseCommand {
|
|
7
7
|
static description = 'Propose an idea for a project';
|
|
8
8
|
static examples = [
|
|
9
|
-
'<%= config.bin %> ideas create --project acme-api --title "Dark mode" --
|
|
9
|
+
'<%= config.bin %> ideas create --project acme-api --title "Dark mode" --problem "The dashboard blinds users at night" --solution "System dark theme" --stakeholders "Mobile team" --stakeholders "Enterprise customers"',
|
|
10
10
|
];
|
|
11
11
|
static flags = {
|
|
12
12
|
...base_1.projectFlag,
|
|
13
13
|
title: core_1.Flags.string({ description: 'Idea title', required: true }),
|
|
14
|
-
|
|
14
|
+
problem: core_1.Flags.string({ description: 'Problem or need the idea solves', required: true }),
|
|
15
|
+
solution: core_1.Flags.string({ description: 'Proposed solution (optional)' }),
|
|
16
|
+
stakeholders: core_1.Flags.string({ description: 'Who it helps — repeatable (optional)', multiple: true }),
|
|
15
17
|
};
|
|
16
18
|
async run() {
|
|
17
19
|
const { flags } = await this.parse(IdeasCreate);
|
|
18
20
|
const projectId = await this.resolveProjectId(flags.project);
|
|
19
|
-
const res = await this.api.post(`/cli/v1/projects/${projectId}/ideas`, {
|
|
21
|
+
const res = await this.api.post(`/cli/v1/projects/${projectId}/ideas`, {
|
|
22
|
+
title: flags.title,
|
|
23
|
+
problem: flags.problem,
|
|
24
|
+
solution: flags.solution,
|
|
25
|
+
stakeholders: flags.stakeholders ?? [],
|
|
26
|
+
});
|
|
20
27
|
if (!this.jsonEnabled()) {
|
|
21
28
|
this.log('Idea created:');
|
|
22
29
|
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
@@ -7,7 +7,7 @@ class IdeasShow extends base_1.BaseCommand {
|
|
|
7
7
|
static args = {
|
|
8
8
|
id: core_1.Args.string({ description: 'Idea id', required: true }),
|
|
9
9
|
};
|
|
10
|
-
static description = 'Show an idea (fields +
|
|
10
|
+
static description = 'Show an idea (fields + problem, solution, stakeholders)';
|
|
11
11
|
static examples = ['<%= config.bin %> ideas show <idea-id> --project acme-api'];
|
|
12
12
|
static flags = { ...base_1.projectFlag };
|
|
13
13
|
async run() {
|
|
@@ -15,11 +15,18 @@ class IdeasShow extends base_1.BaseCommand {
|
|
|
15
15
|
const projectId = await this.resolveProjectId(flags.project);
|
|
16
16
|
const res = await this.api.get(`/cli/v1/projects/${projectId}/ideas/${args.id}`);
|
|
17
17
|
if (!this.jsonEnabled()) {
|
|
18
|
-
const {
|
|
18
|
+
const { problem, solution, stakeholders, ...fields } = res.data ?? {};
|
|
19
19
|
this.log((0, output_1.renderRecord)(fields));
|
|
20
|
-
if (
|
|
21
|
-
this.log(
|
|
22
|
-
|
|
20
|
+
if (Array.isArray(stakeholders) && stakeholders.length > 0) {
|
|
21
|
+
this.log(`\nStakeholders: ${stakeholders.join(', ')}`);
|
|
22
|
+
}
|
|
23
|
+
if (problem) {
|
|
24
|
+
this.log('\nProblem:');
|
|
25
|
+
this.log((0, output_1.sanitizeMultiline)(String(problem)));
|
|
26
|
+
}
|
|
27
|
+
if (solution) {
|
|
28
|
+
this.log('\nSolution:');
|
|
29
|
+
this.log((0, output_1.sanitizeMultiline)(String(solution)));
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
return res;
|