@bussolabs/closeyourit-cli 0.0.15 → 0.0.16
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/case.d.ts +14 -0
- package/dist/commands/ideas/case.js +33 -0
- package/dist/commands/ideas/update.d.ts +16 -0
- package/dist/commands/ideas/update.js +45 -0
- package/oclif.manifest.json +1384 -1247
- package/opencli.json +128 -2
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class IdeasCase 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
|
+
title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
description: 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,33 @@
|
|
|
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 IdeasCase extends base_1.BaseCommand {
|
|
7
|
+
// POST /cli/v1/projects/:p/ideas/:id/cases maps to Ideas::AddCase. A case is an example/scenario
|
|
8
|
+
// (title + description) — content of the idea, added one at a time like comments. Only open ideas
|
|
9
|
+
// accept cases; same gate as editing the idea (author, otherwise `ideas.edit`).
|
|
10
|
+
static args = {
|
|
11
|
+
id: core_1.Args.string({ description: 'Idea id', required: true }),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Add a case (example/scenario) to an idea (only open ideas accept cases)';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> ideas case <idea-id> --project acme-api --title "QR check-in" --description "Staff scans the QR at the door"',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
...base_1.projectFlag,
|
|
19
|
+
title: core_1.Flags.string({ description: 'Case title', required: true }),
|
|
20
|
+
description: core_1.Flags.string({ description: 'Case description (optional)' }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args, flags } = await this.parse(IdeasCase);
|
|
24
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
25
|
+
const res = await this.api.post(`/cli/v1/projects/${projectId}/ideas/${args.id}/cases`, { title: flags.title, description: flags.description });
|
|
26
|
+
if (!this.jsonEnabled()) {
|
|
27
|
+
this.log('Case added:');
|
|
28
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
29
|
+
}
|
|
30
|
+
return res;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = IdeasCase;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base';
|
|
2
|
+
export default class IdeasUpdate 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
|
+
title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
problem: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
solution: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
stakeholders: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
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 IdeasUpdate extends base_1.BaseCommand {
|
|
7
|
+
// PUT /cli/v1/projects/:p/ideas/:id maps to Ideas::UpdateIdea, a full replace of
|
|
8
|
+
// title/problem/solution: fields you omit are cleared server-side (omitting problem or title → 422,
|
|
9
|
+
// fail-safe). stakeholders are replaced only when provided (kept if omitted). Only open ideas can be
|
|
10
|
+
// edited; the author edits their own, otherwise `ideas.edit` on the project is required.
|
|
11
|
+
static description = 'Update an idea (full replace of title/problem/solution — omitted fields are cleared)';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> ideas update <idea-id> --project acme-api --title "Referral" --problem "Growth is paid-only" --solution "Tracked invites" --stakeholders "Growth" --stakeholders "Backend"',
|
|
14
|
+
];
|
|
15
|
+
static args = {
|
|
16
|
+
id: core_1.Args.string({ description: 'Idea id', required: true }),
|
|
17
|
+
};
|
|
18
|
+
static flags = {
|
|
19
|
+
...base_1.projectFlag,
|
|
20
|
+
title: core_1.Flags.string({ description: 'Idea title' }),
|
|
21
|
+
problem: core_1.Flags.string({ description: 'Problem or need the idea solves' }),
|
|
22
|
+
solution: core_1.Flags.string({ description: 'Proposed solution (cleared if omitted)' }),
|
|
23
|
+
stakeholders: core_1.Flags.string({ description: 'Who it helps — repeatable (replaced only when provided)', multiple: true }),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { args, flags } = await this.parse(IdeasUpdate);
|
|
27
|
+
const projectId = await this.resolveProjectId(flags.project);
|
|
28
|
+
const body = {};
|
|
29
|
+
if (flags.title !== undefined)
|
|
30
|
+
body.title = flags.title;
|
|
31
|
+
if (flags.problem !== undefined)
|
|
32
|
+
body.problem = flags.problem;
|
|
33
|
+
if (flags.solution !== undefined)
|
|
34
|
+
body.solution = flags.solution;
|
|
35
|
+
if (flags.stakeholders !== undefined)
|
|
36
|
+
body.stakeholders = flags.stakeholders;
|
|
37
|
+
const res = await this.api.put(`/cli/v1/projects/${projectId}/ideas/${args.id}`, body);
|
|
38
|
+
if (!this.jsonEnabled()) {
|
|
39
|
+
this.log('Idea updated:');
|
|
40
|
+
this.log((0, output_1.renderRecord)(res.data ?? {}));
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = IdeasUpdate;
|