@newpeak/barista-cli 0.1.45 → 0.1.46
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/liberica/positions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/liberica/positions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,sBAAsB,IAAI,OAAO,CAoDhD"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Table from 'cli-table3';
|
|
2
4
|
import { configManager } from '../../../core/config/manager.js';
|
|
3
5
|
import { apiClient } from '../../../core/api/client.js';
|
|
4
6
|
export function createPositionsCommand() {
|
|
@@ -7,17 +9,41 @@ export function createPositionsCommand() {
|
|
|
7
9
|
positionsCommand
|
|
8
10
|
.command('list')
|
|
9
11
|
.description('List all positions')
|
|
12
|
+
.option('--json', 'Output as JSON')
|
|
10
13
|
.action(async (options) => {
|
|
11
14
|
const context = configManager.getCurrentContext();
|
|
12
15
|
const environment = options.env || context.environment;
|
|
13
16
|
const tenant = options.tenant || context.tenant;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
try {
|
|
18
|
+
const response = await apiClient.listPositions(environment, tenant);
|
|
19
|
+
if (!response.success) {
|
|
20
|
+
console.error(chalk.red(`\n✗ Failed: ${response.error?.message}\n`));
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const positions = response.data || [];
|
|
24
|
+
if (options.json) {
|
|
25
|
+
console.log(JSON.stringify({ success: true, data: positions }, null, 2));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (positions.length === 0) {
|
|
29
|
+
console.log(chalk.yellow('\n No positions found.\n'));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const table = new Table({
|
|
33
|
+
head: [chalk.bold('ID'), chalk.bold('Name')],
|
|
34
|
+
colWidths: [24, 30],
|
|
35
|
+
});
|
|
36
|
+
for (const pos of positions) {
|
|
37
|
+
table.push([pos.id || '-', pos.name || '-']);
|
|
38
|
+
}
|
|
39
|
+
console.log(chalk.bold('\n📋 Position List\n'));
|
|
40
|
+
console.log(table.toString());
|
|
41
|
+
console.log(chalk.gray(`\nTotal: ${positions.length} positions\n`));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error(chalk.red(`\n✗ Error: ${error.message}\n`));
|
|
17
45
|
process.exit(1);
|
|
18
46
|
}
|
|
19
|
-
const positions = response.data || [];
|
|
20
|
-
console.log(JSON.stringify({ success: true, data: positions }, null, 2));
|
|
21
47
|
});
|
|
22
48
|
return positionsCommand;
|
|
23
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/liberica/positions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGxD,MAAM,UAAU,sBAAsB;IACpC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAClD,gBAAgB,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAE/C,gBAAgB;SACb,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,oBAAoB,CAAC;SACjC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,OAAO,GAAG,aAAa,CAAC,iBAAiB,EAAE,CAAC;QA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