centy 0.2.7 → 0.2.8
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/bin/dev.js +0 -0
- package/dist/commands/show.d.ts +16 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +109 -0
- package/dist/commands/show.js.map +1 -0
- package/oclif.manifest.json +679 -642
- package/package.json +27 -19
package/bin/dev.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Show an entity by UUID, auto-detecting type across all tracked projects
|
|
4
|
+
*/
|
|
5
|
+
export default class Show extends Command {
|
|
6
|
+
static args: {
|
|
7
|
+
uuid: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static flags: {
|
|
12
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=show.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../src/commands/show.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAMlD;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IAEvC,OAAgB,IAAI;;MAKnB;IAGD,OAAgB,WAAW,SACsC;IAGjE,OAAgB,QAAQ,WAGvB;IAGD,OAAgB,KAAK;;MAKpB;IAGY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmGlC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
// eslint-disable-next-line import/order
|
|
3
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
4
|
+
import { daemonGetIssuesByUuid } from '../daemon/daemon-get-issues-by-uuid.js';
|
|
5
|
+
import { daemonGetPrsByUuid } from '../daemon/daemon-get-prs-by-uuid.js';
|
|
6
|
+
import { isValidUuid } from '../utils/is-valid-uuid.js';
|
|
7
|
+
/**
|
|
8
|
+
* Show an entity by UUID, auto-detecting type across all tracked projects
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line custom/no-default-class-export, class-export/class-export
|
|
11
|
+
export default class Show extends Command {
|
|
12
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
13
|
+
static args = {
|
|
14
|
+
uuid: Args.string({
|
|
15
|
+
description: 'Entity UUID to look up',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
20
|
+
static description = 'Show an entity by UUID, searching across all tracked projects';
|
|
21
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
22
|
+
static examples = [
|
|
23
|
+
'<%= config.bin %> show 9f38fb44-55df-424d-a61f-a3432cfa83d2',
|
|
24
|
+
'<%= config.bin %> show 9f38fb44-55df-424d-a61f-a3432cfa83d2 --json',
|
|
25
|
+
];
|
|
26
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
27
|
+
static flags = {
|
|
28
|
+
json: Flags.boolean({
|
|
29
|
+
description: 'Output as JSON',
|
|
30
|
+
default: false,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
// eslint-disable-next-line max-lines-per-function
|
|
34
|
+
async run() {
|
|
35
|
+
const { args, flags } = await this.parse(Show);
|
|
36
|
+
if (!isValidUuid(args.uuid)) {
|
|
37
|
+
this.error('A valid UUID is required. Use `centy get issue <id>` or `centy get pr <id>` for display numbers.');
|
|
38
|
+
}
|
|
39
|
+
const [issuesResult, prsResult] = await Promise.all([
|
|
40
|
+
daemonGetIssuesByUuid({ uuid: args.uuid }),
|
|
41
|
+
daemonGetPrsByUuid({ uuid: args.uuid }),
|
|
42
|
+
]);
|
|
43
|
+
const hasIssues = issuesResult.issues.length > 0;
|
|
44
|
+
const hasPrs = prsResult.prs.length > 0;
|
|
45
|
+
const allErrors = [...issuesResult.errors, ...prsResult.errors];
|
|
46
|
+
if (!hasIssues && !hasPrs) {
|
|
47
|
+
if (flags.json) {
|
|
48
|
+
this.log(JSON.stringify({ issues: [], prs: [], errors: allErrors }, null, 2));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.log(`No entities found with UUID: ${args.uuid}`);
|
|
52
|
+
if (allErrors.length > 0) {
|
|
53
|
+
this.warn('Some projects could not be searched:');
|
|
54
|
+
for (const err of allErrors) {
|
|
55
|
+
this.warn(` - ${err}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (flags.json) {
|
|
61
|
+
this.log(JSON.stringify({
|
|
62
|
+
issues: issuesResult.issues,
|
|
63
|
+
prs: prsResult.prs,
|
|
64
|
+
errors: allErrors,
|
|
65
|
+
}, null, 2));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
for (const iwp of issuesResult.issues) {
|
|
69
|
+
const issue = iwp.issue;
|
|
70
|
+
const meta = issue.metadata;
|
|
71
|
+
this.log(`--- Project: ${iwp.projectName} (${iwp.projectPath}) ---`);
|
|
72
|
+
this.log(`Issue #${issue.displayNumber}`);
|
|
73
|
+
this.log(`ID: ${issue.id}`);
|
|
74
|
+
this.log(`Title: ${issue.title}`);
|
|
75
|
+
this.log(`Status: ${meta !== undefined ? meta.status : 'unknown'}`);
|
|
76
|
+
this.log(`Priority: ${meta !== undefined ? (meta.priorityLabel !== '' ? meta.priorityLabel : `P${meta.priority}`) : 'P?'}`);
|
|
77
|
+
this.log(`Created: ${meta !== undefined ? meta.createdAt : 'unknown'}`);
|
|
78
|
+
this.log(`Updated: ${meta !== undefined ? meta.updatedAt : 'unknown'}`);
|
|
79
|
+
if (issue.description) {
|
|
80
|
+
this.log(`\nDescription:\n${issue.description}`);
|
|
81
|
+
}
|
|
82
|
+
this.log('');
|
|
83
|
+
}
|
|
84
|
+
for (const pwp of prsResult.prs) {
|
|
85
|
+
const pr = pwp.pr;
|
|
86
|
+
const meta = pr.metadata;
|
|
87
|
+
this.log(`--- Project: ${pwp.projectName} (${pwp.projectPath}) ---`);
|
|
88
|
+
this.log(`PR #${pr.displayNumber}`);
|
|
89
|
+
this.log(`ID: ${pr.id}`);
|
|
90
|
+
this.log(`Title: ${pr.title}`);
|
|
91
|
+
this.log(`Status: ${meta !== undefined ? meta.status : 'unknown'}`);
|
|
92
|
+
this.log(`Priority: ${meta !== undefined ? (meta.priorityLabel !== '' ? meta.priorityLabel : `P${meta.priority}`) : 'P?'}`);
|
|
93
|
+
this.log(`Branch: ${meta !== undefined ? `${meta.sourceBranch} -> ${meta.targetBranch}` : '? -> ?'}`);
|
|
94
|
+
this.log(`Created: ${meta !== undefined ? meta.createdAt : 'unknown'}`);
|
|
95
|
+
this.log(`Updated: ${meta !== undefined ? meta.updatedAt : 'unknown'}`);
|
|
96
|
+
if (pr.description) {
|
|
97
|
+
this.log(`\nDescription:\n${pr.description}`);
|
|
98
|
+
}
|
|
99
|
+
this.log('');
|
|
100
|
+
}
|
|
101
|
+
if (allErrors.length > 0) {
|
|
102
|
+
this.warn('Some projects could not be searched:');
|
|
103
|
+
for (const err of allErrors) {
|
|
104
|
+
this.warn(` - ${err}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=show.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../src/commands/show.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,wCAAwC;AACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OA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