@ayurak/aribot-cli 1.1.0 → 1.1.2
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/aribot-report-fdb15555.json +29892 -0
- package/dist/cli.js +25 -16
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/src/cli.ts +24 -16
- package/src/theme.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -112,7 +112,7 @@ program
|
|
|
112
112
|
// Open developer portal if requested
|
|
113
113
|
if (options.openPortal) {
|
|
114
114
|
const open = (await import('open')).default;
|
|
115
|
-
const portalUrl = 'https://
|
|
115
|
+
const portalUrl = 'https://developer.ayurak.com';
|
|
116
116
|
console.log(chalk_1.default.cyan('Opening developer portal...'));
|
|
117
117
|
console.log(chalk_1.default.dim(portalUrl));
|
|
118
118
|
await open(portalUrl);
|
|
@@ -125,7 +125,7 @@ program
|
|
|
125
125
|
console.log(chalk_1.default.bold('To authenticate, you need an API key.'));
|
|
126
126
|
console.log();
|
|
127
127
|
console.log(chalk_1.default.dim('Get your API key from the developer portal:'));
|
|
128
|
-
console.log(' ' + chalk_1.default.cyan('https://
|
|
128
|
+
console.log(' ' + chalk_1.default.cyan('https://developer.ayurak.com'));
|
|
129
129
|
console.log();
|
|
130
130
|
console.log(chalk_1.default.dim('Or run: ' + chalk_1.default.green('aribot login --open-portal') + ' to open it'));
|
|
131
131
|
console.log();
|
|
@@ -151,7 +151,7 @@ program
|
|
|
151
151
|
console.log();
|
|
152
152
|
console.log(chalk_1.default.red('Invalid API key format'));
|
|
153
153
|
console.log(chalk_1.default.dim('API keys should be at least 20 characters long.'));
|
|
154
|
-
console.log(chalk_1.default.dim('Get a valid key from: https://
|
|
154
|
+
console.log(chalk_1.default.dim('Get a valid key from: https://developer.ayurak.com'));
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
console.log();
|
|
@@ -208,7 +208,7 @@ program
|
|
|
208
208
|
}
|
|
209
209
|
console.log();
|
|
210
210
|
console.log(chalk_1.default.dim('Need a new API key? Visit:'));
|
|
211
|
-
console.log(' ' + chalk_1.default.cyan('https://
|
|
211
|
+
console.log(' ' + chalk_1.default.cyan('https://developer.ayurak.com'));
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
catch (error) {
|
|
@@ -243,7 +243,7 @@ program
|
|
|
243
243
|
spinner.stop();
|
|
244
244
|
console.log(chalk_1.default.bold('\nYour Diagrams:\n'));
|
|
245
245
|
if (!data.results?.length) {
|
|
246
|
-
console.log(chalk_1.default.dim('No diagrams found. Create one at https://
|
|
246
|
+
console.log(chalk_1.default.dim('No diagrams found. Create one at https://developer.ayurak.com'));
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
249
|
data.results.forEach((d) => {
|
|
@@ -305,7 +305,7 @@ program
|
|
|
305
305
|
attempts++;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
console.log(chalk_1.default.dim(`\nView at: https://
|
|
308
|
+
console.log(chalk_1.default.dim(`\nView at: https://developer.ayurak.com/diagrams/${data.id}`));
|
|
309
309
|
}
|
|
310
310
|
catch (error) {
|
|
311
311
|
spinner.fail('Analysis failed');
|
|
@@ -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/dist/theme.js
CHANGED
|
@@ -138,7 +138,7 @@ function printWelcome() {
|
|
|
138
138
|
console.log();
|
|
139
139
|
console.log(exports.colors.gold('━'.repeat(58)));
|
|
140
140
|
console.log();
|
|
141
|
-
console.log(` ${exports.colors.gray('Get your API key at:')} ${exports.bold.white('https://
|
|
141
|
+
console.log(` ${exports.colors.gray('Get your API key at:')} ${exports.bold.white('https://developer.ayurak.com')}`);
|
|
142
142
|
console.log();
|
|
143
143
|
}
|
|
144
144
|
function printAuthSuccess(email, company, plan) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ayurak/aribot-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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
|
@@ -121,7 +121,7 @@ program
|
|
|
121
121
|
// Open developer portal if requested
|
|
122
122
|
if (options.openPortal) {
|
|
123
123
|
const open = (await import('open')).default;
|
|
124
|
-
const portalUrl = 'https://
|
|
124
|
+
const portalUrl = 'https://developer.ayurak.com';
|
|
125
125
|
console.log(chalk.cyan('Opening developer portal...'));
|
|
126
126
|
console.log(chalk.dim(portalUrl));
|
|
127
127
|
await open(portalUrl);
|
|
@@ -135,7 +135,7 @@ program
|
|
|
135
135
|
console.log(chalk.bold('To authenticate, you need an API key.'));
|
|
136
136
|
console.log();
|
|
137
137
|
console.log(chalk.dim('Get your API key from the developer portal:'));
|
|
138
|
-
console.log(' ' + chalk.cyan('https://
|
|
138
|
+
console.log(' ' + chalk.cyan('https://developer.ayurak.com'));
|
|
139
139
|
console.log();
|
|
140
140
|
console.log(chalk.dim('Or run: ' + chalk.green('aribot login --open-portal') + ' to open it'));
|
|
141
141
|
console.log();
|
|
@@ -162,7 +162,7 @@ program
|
|
|
162
162
|
console.log();
|
|
163
163
|
console.log(chalk.red('Invalid API key format'));
|
|
164
164
|
console.log(chalk.dim('API keys should be at least 20 characters long.'));
|
|
165
|
-
console.log(chalk.dim('Get a valid key from: https://
|
|
165
|
+
console.log(chalk.dim('Get a valid key from: https://developer.ayurak.com'));
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -221,7 +221,7 @@ program
|
|
|
221
221
|
}
|
|
222
222
|
console.log();
|
|
223
223
|
console.log(chalk.dim('Need a new API key? Visit:'));
|
|
224
|
-
console.log(' ' + chalk.cyan('https://
|
|
224
|
+
console.log(' ' + chalk.cyan('https://developer.ayurak.com'));
|
|
225
225
|
}
|
|
226
226
|
} catch (error: any) {
|
|
227
227
|
spinner.fail(chalk.red('Authentication failed'));
|
|
@@ -259,7 +259,7 @@ program
|
|
|
259
259
|
console.log(chalk.bold('\nYour Diagrams:\n'));
|
|
260
260
|
|
|
261
261
|
if (!data.results?.length) {
|
|
262
|
-
console.log(chalk.dim('No diagrams found. Create one at https://
|
|
262
|
+
console.log(chalk.dim('No diagrams found. Create one at https://developer.ayurak.com'));
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
|
|
@@ -333,7 +333,7 @@ program
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
console.log(chalk.dim(`\nView at: https://
|
|
336
|
+
console.log(chalk.dim(`\nView at: https://developer.ayurak.com/diagrams/${data.id}`));
|
|
337
337
|
} catch (error) {
|
|
338
338
|
spinner.fail('Analysis failed');
|
|
339
339
|
console.error(error);
|
|
@@ -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)}`);
|
package/src/theme.ts
CHANGED
|
@@ -131,7 +131,7 @@ export function printWelcome(): void {
|
|
|
131
131
|
console.log();
|
|
132
132
|
console.log(colors.gold('━'.repeat(58)));
|
|
133
133
|
console.log();
|
|
134
|
-
console.log(` ${colors.gray('Get your API key at:')} ${bold.white('https://
|
|
134
|
+
console.log(` ${colors.gray('Get your API key at:')} ${bold.white('https://developer.ayurak.com')}`);
|
|
135
135
|
console.log();
|
|
136
136
|
}
|
|
137
137
|
|