@ayurak/aribot-cli 1.1.0 → 1.1.1
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/cli.js +19 -10
- package/package.json +1 -1
- package/src/cli.ts +18 -10
package/dist/cli.js
CHANGED
|
@@ -1291,9 +1291,16 @@ program
|
|
|
1291
1291
|
const data = await apiRequest('/v2/sbom/documents/');
|
|
1292
1292
|
spinner.stop();
|
|
1293
1293
|
console.log(chalk_1.default.bold('\nSBOM Documents:\n'));
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1294
|
+
// Backend returns {sbom_documents: [...]}
|
|
1295
|
+
const docs = data.sbom_documents || data.results || (Array.isArray(data) ? data : []);
|
|
1296
|
+
if (docs.length === 0) {
|
|
1297
|
+
console.log(chalk_1.default.dim(' No SBOM documents found'));
|
|
1298
|
+
}
|
|
1299
|
+
else {
|
|
1300
|
+
docs.forEach((s) => {
|
|
1301
|
+
console.log(` ${chalk_1.default.cyan(String(s.id || s.sbom_id).slice(0, 8))} ${s.name || 'Unnamed'} ${chalk_1.default.dim((s.component_count || 0) + ' components')}`);
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1297
1304
|
}
|
|
1298
1305
|
else {
|
|
1299
1306
|
spinner.stop();
|
|
@@ -1454,8 +1461,9 @@ program
|
|
|
1454
1461
|
spinner.stop();
|
|
1455
1462
|
console.log(chalk_1.default.bold('\nAPI Keys:\n'));
|
|
1456
1463
|
(data.results || data || []).forEach((k) => {
|
|
1457
|
-
const status = k.is_active ? chalk_1.default.green('active') : chalk_1.default.red('inactive');
|
|
1458
|
-
|
|
1464
|
+
const status = (k.is_active || k.status === 'active') ? chalk_1.default.green('active') : chalk_1.default.red('inactive');
|
|
1465
|
+
const keyPrefix = k.key_prefix || (k.key ? k.key.slice(0, 8) : 'xxxxxxxx');
|
|
1466
|
+
console.log(` ${chalk_1.default.cyan(k.name)} ${chalk_1.default.dim(keyPrefix + '...')} ${status}`);
|
|
1459
1467
|
});
|
|
1460
1468
|
}
|
|
1461
1469
|
else if (options.create) {
|
|
@@ -1510,7 +1518,7 @@ program
|
|
|
1510
1518
|
spinner.stop();
|
|
1511
1519
|
console.log(chalk_1.default.bold(`\nSearch Results for "${options.search}":\n`));
|
|
1512
1520
|
(data.results || data || []).slice(0, 10).forEach((t) => {
|
|
1513
|
-
console.log(` ${chalk_1.default.cyan(t.name)} ${chalk_1.default.dim('$' + (t.price || 0))}`);
|
|
1521
|
+
console.log(` ${chalk_1.default.cyan(t.title || t.name)} ${chalk_1.default.dim('$' + (t.price || 0))}`);
|
|
1514
1522
|
console.log(chalk_1.default.dim(` ${t.description?.slice(0, 60) || ''}...`));
|
|
1515
1523
|
});
|
|
1516
1524
|
}
|
|
@@ -1519,15 +1527,16 @@ program
|
|
|
1519
1527
|
spinner.stop();
|
|
1520
1528
|
console.log(chalk_1.default.bold('\nFeatured Templates:\n'));
|
|
1521
1529
|
(data.results || data || []).forEach((t) => {
|
|
1522
|
-
console.log(` ${chalk_1.default.green('★')} ${chalk_1.default.cyan(t.name)} ${chalk_1.default.dim('$' + (t.price || 0))}`);
|
|
1530
|
+
console.log(` ${chalk_1.default.green('★')} ${chalk_1.default.cyan(t.title || t.name)} ${chalk_1.default.dim('$' + (t.price || 0))}`);
|
|
1523
1531
|
});
|
|
1524
1532
|
}
|
|
1525
1533
|
else if (options.categories) {
|
|
1526
1534
|
const data = await apiRequest('/v2/marketplace/categories/');
|
|
1527
1535
|
spinner.stop();
|
|
1528
1536
|
console.log(chalk_1.default.bold('\nTemplate Categories:\n'));
|
|
1537
|
+
// Backend returns {value, label} format
|
|
1529
1538
|
(data.results || data || []).forEach((c) => {
|
|
1530
|
-
console.log(` ${chalk_1.default.cyan(c.name)} ${chalk_1.default.dim(c.template_count + ' templates')}`);
|
|
1539
|
+
console.log(` ${chalk_1.default.cyan(c.label || c.name || c.value)} ${chalk_1.default.dim((c.template_count || c.count || '') + ' templates')}`);
|
|
1531
1540
|
});
|
|
1532
1541
|
}
|
|
1533
1542
|
else if (options.myTemplates) {
|
|
@@ -1535,13 +1544,13 @@ program
|
|
|
1535
1544
|
spinner.stop();
|
|
1536
1545
|
console.log(chalk_1.default.bold('\nYour Templates:\n'));
|
|
1537
1546
|
(data.results || data || []).forEach((t) => {
|
|
1538
|
-
console.log(` ${chalk_1.default.cyan(t.name)} ${chalk_1.default.dim(t.status)}`);
|
|
1547
|
+
console.log(` ${chalk_1.default.cyan(t.title || t.name)} ${chalk_1.default.dim(t.status)}`);
|
|
1539
1548
|
});
|
|
1540
1549
|
}
|
|
1541
1550
|
else if (options.get) {
|
|
1542
1551
|
const data = await apiRequest(`/v2/marketplace/v2/templates/${options.get}/`);
|
|
1543
1552
|
spinner.stop();
|
|
1544
|
-
console.log(chalk_1.default.bold(`\n${data.name}\n`));
|
|
1553
|
+
console.log(chalk_1.default.bold(`\n${data.title || data.name}\n`));
|
|
1545
1554
|
console.log(` Category: ${chalk_1.default.cyan(data.category)}`);
|
|
1546
1555
|
console.log(` Price: ${chalk_1.default.yellow('$' + (data.price || 0))}`);
|
|
1547
1556
|
console.log(` Downloads: ${chalk_1.default.dim(data.download_count || 0)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ayurak/aribot-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Aribot - Economic, Regulatory & Security APIs for Modern Applications. Advanced multi-framework threat modeling (STRIDE, PASTA, NIST, Aristiun), 100+ compliance standards, Cloud Security, FinOps, and Red Team automation.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/cli.ts
CHANGED
|
@@ -1424,9 +1424,15 @@ program
|
|
|
1424
1424
|
const data = await apiRequest('/v2/sbom/documents/');
|
|
1425
1425
|
spinner.stop();
|
|
1426
1426
|
console.log(chalk.bold('\nSBOM Documents:\n'));
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1427
|
+
// Backend returns {sbom_documents: [...]}
|
|
1428
|
+
const docs = data.sbom_documents || data.results || (Array.isArray(data) ? data : []);
|
|
1429
|
+
if (docs.length === 0) {
|
|
1430
|
+
console.log(chalk.dim(' No SBOM documents found'));
|
|
1431
|
+
} else {
|
|
1432
|
+
docs.forEach((s: any) => {
|
|
1433
|
+
console.log(` ${chalk.cyan(String(s.id || s.sbom_id).slice(0, 8))} ${s.name || 'Unnamed'} ${chalk.dim((s.component_count || 0) + ' components')}`);
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1430
1436
|
|
|
1431
1437
|
} else {
|
|
1432
1438
|
spinner.stop();
|
|
@@ -1590,8 +1596,9 @@ program
|
|
|
1590
1596
|
spinner.stop();
|
|
1591
1597
|
console.log(chalk.bold('\nAPI Keys:\n'));
|
|
1592
1598
|
(data.results || data || []).forEach((k: any) => {
|
|
1593
|
-
const status = k.is_active ? chalk.green('active') : chalk.red('inactive');
|
|
1594
|
-
|
|
1599
|
+
const status = (k.is_active || k.status === 'active') ? chalk.green('active') : chalk.red('inactive');
|
|
1600
|
+
const keyPrefix = k.key_prefix || (k.key ? k.key.slice(0, 8) : 'xxxxxxxx');
|
|
1601
|
+
console.log(` ${chalk.cyan(k.name)} ${chalk.dim(keyPrefix + '...')} ${status}`);
|
|
1595
1602
|
});
|
|
1596
1603
|
|
|
1597
1604
|
} else if (options.create) {
|
|
@@ -1647,7 +1654,7 @@ program
|
|
|
1647
1654
|
spinner.stop();
|
|
1648
1655
|
console.log(chalk.bold(`\nSearch Results for "${options.search}":\n`));
|
|
1649
1656
|
(data.results || data || []).slice(0, 10).forEach((t: any) => {
|
|
1650
|
-
console.log(` ${chalk.cyan(t.name)} ${chalk.dim('$' + (t.price || 0))}`);
|
|
1657
|
+
console.log(` ${chalk.cyan(t.title || t.name)} ${chalk.dim('$' + (t.price || 0))}`);
|
|
1651
1658
|
console.log(chalk.dim(` ${t.description?.slice(0, 60) || ''}...`));
|
|
1652
1659
|
});
|
|
1653
1660
|
|
|
@@ -1656,15 +1663,16 @@ program
|
|
|
1656
1663
|
spinner.stop();
|
|
1657
1664
|
console.log(chalk.bold('\nFeatured Templates:\n'));
|
|
1658
1665
|
(data.results || data || []).forEach((t: any) => {
|
|
1659
|
-
console.log(` ${chalk.green('★')} ${chalk.cyan(t.name)} ${chalk.dim('$' + (t.price || 0))}`);
|
|
1666
|
+
console.log(` ${chalk.green('★')} ${chalk.cyan(t.title || t.name)} ${chalk.dim('$' + (t.price || 0))}`);
|
|
1660
1667
|
});
|
|
1661
1668
|
|
|
1662
1669
|
} else if (options.categories) {
|
|
1663
1670
|
const data = await apiRequest('/v2/marketplace/categories/');
|
|
1664
1671
|
spinner.stop();
|
|
1665
1672
|
console.log(chalk.bold('\nTemplate Categories:\n'));
|
|
1673
|
+
// Backend returns {value, label} format
|
|
1666
1674
|
(data.results || data || []).forEach((c: any) => {
|
|
1667
|
-
console.log(` ${chalk.cyan(c.name)} ${chalk.dim(c.template_count + ' templates')}`);
|
|
1675
|
+
console.log(` ${chalk.cyan(c.label || c.name || c.value)} ${chalk.dim((c.template_count || c.count || '') + ' templates')}`);
|
|
1668
1676
|
});
|
|
1669
1677
|
|
|
1670
1678
|
} else if (options.myTemplates) {
|
|
@@ -1672,13 +1680,13 @@ program
|
|
|
1672
1680
|
spinner.stop();
|
|
1673
1681
|
console.log(chalk.bold('\nYour Templates:\n'));
|
|
1674
1682
|
(data.results || data || []).forEach((t: any) => {
|
|
1675
|
-
console.log(` ${chalk.cyan(t.name)} ${chalk.dim(t.status)}`);
|
|
1683
|
+
console.log(` ${chalk.cyan(t.title || t.name)} ${chalk.dim(t.status)}`);
|
|
1676
1684
|
});
|
|
1677
1685
|
|
|
1678
1686
|
} else if (options.get) {
|
|
1679
1687
|
const data = await apiRequest(`/v2/marketplace/v2/templates/${options.get}/`);
|
|
1680
1688
|
spinner.stop();
|
|
1681
|
-
console.log(chalk.bold(`\n${data.name}\n`));
|
|
1689
|
+
console.log(chalk.bold(`\n${data.title || data.name}\n`));
|
|
1682
1690
|
console.log(` Category: ${chalk.cyan(data.category)}`);
|
|
1683
1691
|
console.log(` Price: ${chalk.yellow('$' + (data.price || 0))}`);
|
|
1684
1692
|
console.log(` Downloads: ${chalk.dim(data.download_count || 0)}`);
|