@bussolabs/closeyourit-cli 0.14.0 → 0.15.0
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 +14 -0
- package/dist/commands/matrix/categories/create.d.ts +13 -0
- package/dist/commands/matrix/categories/create.js +33 -0
- package/dist/commands/matrix/categories/delete.d.ts +13 -0
- package/dist/commands/matrix/categories/delete.js +27 -0
- package/dist/commands/matrix/categories/list.d.ts +12 -0
- package/dist/commands/matrix/categories/list.js +27 -0
- package/dist/commands/matrix/categories/update.d.ts +14 -0
- package/dist/commands/matrix/categories/update.js +37 -0
- package/dist/commands/matrix/cells/clear.d.ts +18 -0
- package/dist/commands/matrix/cells/clear.js +34 -0
- package/dist/commands/matrix/cells/set.d.ts +15 -0
- package/dist/commands/matrix/cells/set.js +42 -0
- package/dist/commands/matrix/features/create.d.ts +16 -0
- package/dist/commands/matrix/features/create.js +40 -0
- package/dist/commands/matrix/features/delete.d.ts +13 -0
- package/dist/commands/matrix/features/delete.js +27 -0
- package/dist/commands/matrix/features/list.d.ts +13 -0
- package/dist/commands/matrix/features/list.js +35 -0
- package/dist/commands/matrix/features/show.d.ts +10 -0
- package/dist/commands/matrix/features/show.js +33 -0
- package/dist/commands/matrix/features/update.d.ts +17 -0
- package/dist/commands/matrix/features/update.js +45 -0
- package/dist/commands/matrix/list.d.ts +9 -0
- package/dist/commands/matrix/list.js +18 -0
- package/dist/commands/matrix/show.d.ts +16 -0
- package/dist/commands/matrix/show.js +63 -0
- package/dist/commands/matrix/statuses.d.ts +6 -0
- package/dist/commands/matrix/statuses.js +22 -0
- package/oclif.manifest.json +4525 -3775
- package/package.json +5 -2
|
@@ -0,0 +1,63 @@
|
|
|
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 MatrixShow extends base_1.BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
product: core_1.Args.string({ description: 'Product id (UUID) or group name', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Show a product feature matrix: features in rows, platforms in columns';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> matrix show CloseYourIt',
|
|
13
|
+
'<%= config.bin %> matrix show CloseYourIt --json',
|
|
14
|
+
];
|
|
15
|
+
async run() {
|
|
16
|
+
const { args } = await this.parse(MatrixShow);
|
|
17
|
+
const productId = await this.resolveGroupId(args.product);
|
|
18
|
+
const res = await this.api.get(`/cli/v1/product/matrix/${encodeURIComponent(productId)}`);
|
|
19
|
+
if (!this.jsonEnabled())
|
|
20
|
+
this.renderMatrix(res.data ?? {});
|
|
21
|
+
return res;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The first column holds `Category/Feature` — the very reference `matrix cells set` and
|
|
25
|
+
* `matrix features` take, so a row can be acted on without a second lookup.
|
|
26
|
+
*/
|
|
27
|
+
renderMatrix(matrix) {
|
|
28
|
+
const platforms = matrix.platforms ?? [];
|
|
29
|
+
if (platforms.length === 0) {
|
|
30
|
+
this.log('No platforms yet: declare them on the products projects, or write a cell to open a column.');
|
|
31
|
+
}
|
|
32
|
+
const byCell = new Map();
|
|
33
|
+
for (const cell of matrix.cells ?? [])
|
|
34
|
+
byCell.set(`${cell.feature_id}|${cell.platform_id}`, cell);
|
|
35
|
+
const rows = [];
|
|
36
|
+
for (const category of matrix.categories ?? []) {
|
|
37
|
+
for (const feature of category.features ?? []) {
|
|
38
|
+
rows.push([
|
|
39
|
+
`${category.name ?? ''}/${feature.name ?? ''}`,
|
|
40
|
+
...platforms.map((platform) => this.renderCell(byCell.get(`${feature.id}|${platform.id}`))),
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (rows.length === 0) {
|
|
45
|
+
this.log('No features yet. Add one with: matrix features create <product> --category <name> --name <name>');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.log((0, output_1.renderTable)(['FEATURE', ...platforms.map((platform) => String(platform.code ?? '').toUpperCase())], rows));
|
|
49
|
+
const missing = Number(matrix.missing_release_count ?? 0);
|
|
50
|
+
if (missing > 0) {
|
|
51
|
+
this.log(`\n${missing} released cell(s) without a version (marked "?"). Set one with matrix cells set --release.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** `-` = not set (different from an explicit "not applicable" status, which has its own code). */
|
|
55
|
+
renderCell(cell) {
|
|
56
|
+
if (!cell?.status?.code)
|
|
57
|
+
return '-';
|
|
58
|
+
if (cell.release?.version)
|
|
59
|
+
return `${cell.status.code} ${cell.release.version}`;
|
|
60
|
+
return cell.release_missing ? `${cell.status.code} ?` : String(cell.status.code);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = MatrixShow;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 MatrixStatuses extends base_1.BaseCommand {
|
|
6
|
+
static description = 'List the cell statuses of your organization (the codes accepted by matrix cells set)';
|
|
7
|
+
static examples = ['<%= config.bin %> matrix statuses', '<%= config.bin %> matrix statuses --json'];
|
|
8
|
+
async run() {
|
|
9
|
+
await this.parse(MatrixStatuses);
|
|
10
|
+
const res = await this.api.get('/cli/v1/types/feature_statuses');
|
|
11
|
+
if (!this.jsonEnabled()) {
|
|
12
|
+
this.log((0, output_1.renderTable)(['CODE', 'LABEL', 'LIFECYCLE', 'ID'], (res.data ?? []).map((status) => [
|
|
13
|
+
String(status.code ?? ''),
|
|
14
|
+
String(status.label ?? ''),
|
|
15
|
+
String(status.category ?? ''),
|
|
16
|
+
String(status.id ?? ''),
|
|
17
|
+
])));
|
|
18
|
+
}
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = MatrixStatuses;
|