@ayurak/aribot-cli 1.1.2 → 1.1.4
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 +428 -404
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -15
- package/dist/sdk.js +13 -58
- package/dist/theme.d.ts +15 -15
- package/dist/theme.js +123 -147
- package/package.json +2 -1
- package/src/cli.ts +44 -10
- package/src/index.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @packageDocumentation
|
|
16
16
|
*/
|
|
17
|
-
export { AribotClient, AribotConfig, Diagram, Threat, ComplianceAssessment, SecurityFinding, PaginatedResponse, AribotError, AuthenticationError, RateLimitError, APIError, analyzeDiagram, runComplianceCheck, RequestSigner, SecureCredentialManager, } from './sdk';
|
|
18
|
-
import { AribotClient } from './sdk';
|
|
17
|
+
export { AribotClient, AribotConfig, Diagram, Threat, ComplianceAssessment, SecurityFinding, PaginatedResponse, AribotError, AuthenticationError, RateLimitError, APIError, analyzeDiagram, runComplianceCheck, RequestSigner, SecureCredentialManager, } from './sdk.js';
|
|
18
|
+
import { AribotClient } from './sdk.js';
|
|
19
19
|
export default AribotClient;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Aribot - Economic, Regulatory & Security APIs for Modern Applications
|
|
4
3
|
*
|
|
@@ -15,21 +14,14 @@
|
|
|
15
14
|
*
|
|
16
15
|
* @packageDocumentation
|
|
17
16
|
*/
|
|
18
|
-
|
|
19
|
-
exports.SecureCredentialManager = exports.RequestSigner = exports.runComplianceCheck = exports.analyzeDiagram = exports.APIError = exports.RateLimitError = exports.AuthenticationError = exports.AribotError = exports.AribotClient = void 0;
|
|
20
|
-
var sdk_1 = require("./sdk");
|
|
17
|
+
export {
|
|
21
18
|
// Main client
|
|
22
|
-
|
|
19
|
+
AribotClient,
|
|
23
20
|
// Errors
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return sdk_1.AuthenticationError; } });
|
|
26
|
-
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return sdk_1.RateLimitError; } });
|
|
27
|
-
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return sdk_1.APIError; } });
|
|
21
|
+
AribotError, AuthenticationError, RateLimitError, APIError,
|
|
28
22
|
// Convenience functions
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports, "runComplianceCheck", { enumerable: true, get: function () { return sdk_1.runComplianceCheck; } });
|
|
23
|
+
analyzeDiagram, runComplianceCheck,
|
|
31
24
|
// Security utilities
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
exports.default = sdk_2.AribotClient;
|
|
25
|
+
RequestSigner, SecureCredentialManager, } from './sdk.js';
|
|
26
|
+
import { AribotClient } from './sdk.js';
|
|
27
|
+
export default AribotClient;
|
package/dist/sdk.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Aribot Node.js SDK - Economic, Regulatory & Security APIs for Modern Applications
|
|
4
3
|
*
|
|
@@ -29,66 +28,27 @@
|
|
|
29
28
|
* // Red Team
|
|
30
29
|
* const simulation = await client.redteam.runSimulation(targetId, 'lateral_movement');
|
|
31
30
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
36
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
37
|
-
}
|
|
38
|
-
Object.defineProperty(o, k2, desc);
|
|
39
|
-
}) : (function(o, m, k, k2) {
|
|
40
|
-
if (k2 === undefined) k2 = k;
|
|
41
|
-
o[k2] = m[k];
|
|
42
|
-
}));
|
|
43
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
44
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
45
|
-
}) : function(o, v) {
|
|
46
|
-
o["default"] = v;
|
|
47
|
-
});
|
|
48
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
49
|
-
var ownKeys = function(o) {
|
|
50
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
51
|
-
var ar = [];
|
|
52
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
53
|
-
return ar;
|
|
54
|
-
};
|
|
55
|
-
return ownKeys(o);
|
|
56
|
-
};
|
|
57
|
-
return function (mod) {
|
|
58
|
-
if (mod && mod.__esModule) return mod;
|
|
59
|
-
var result = {};
|
|
60
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
61
|
-
__setModuleDefault(result, mod);
|
|
62
|
-
return result;
|
|
63
|
-
};
|
|
64
|
-
})();
|
|
65
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
-
exports.SecureCredentialManager = exports.RequestSigner = exports.AribotClient = exports.APIError = exports.RateLimitError = exports.AuthenticationError = exports.AribotError = void 0;
|
|
67
|
-
exports.analyzeDiagram = analyzeDiagram;
|
|
68
|
-
exports.runComplianceCheck = runComplianceCheck;
|
|
69
|
-
const fs = __importStar(require("fs"));
|
|
70
|
-
const path = __importStar(require("path"));
|
|
71
|
-
const crypto = __importStar(require("crypto"));
|
|
31
|
+
import * as fs from 'fs';
|
|
32
|
+
import * as path from 'path';
|
|
33
|
+
import * as crypto from 'crypto';
|
|
72
34
|
const VERSION = '1.1.0';
|
|
73
35
|
const DEFAULT_BASE_URL = 'https://api.aribot.ayurak.com/aribot-api';
|
|
74
36
|
// =============================================================================
|
|
75
37
|
// ERRORS
|
|
76
38
|
// =============================================================================
|
|
77
|
-
class AribotError extends Error {
|
|
39
|
+
export class AribotError extends Error {
|
|
78
40
|
constructor(message) {
|
|
79
41
|
super(message);
|
|
80
42
|
this.name = 'AribotError';
|
|
81
43
|
}
|
|
82
44
|
}
|
|
83
|
-
|
|
84
|
-
class AuthenticationError extends AribotError {
|
|
45
|
+
export class AuthenticationError extends AribotError {
|
|
85
46
|
constructor(message = 'Invalid or expired API key') {
|
|
86
47
|
super(message);
|
|
87
48
|
this.name = 'AuthenticationError';
|
|
88
49
|
}
|
|
89
50
|
}
|
|
90
|
-
|
|
91
|
-
class RateLimitError extends AribotError {
|
|
51
|
+
export class RateLimitError extends AribotError {
|
|
92
52
|
retryAfter;
|
|
93
53
|
constructor(message = 'Rate limit exceeded', retryAfter) {
|
|
94
54
|
super(message);
|
|
@@ -96,8 +56,7 @@ class RateLimitError extends AribotError {
|
|
|
96
56
|
this.retryAfter = retryAfter;
|
|
97
57
|
}
|
|
98
58
|
}
|
|
99
|
-
|
|
100
|
-
class APIError extends AribotError {
|
|
59
|
+
export class APIError extends AribotError {
|
|
101
60
|
statusCode;
|
|
102
61
|
response;
|
|
103
62
|
constructor(message, statusCode, response) {
|
|
@@ -107,11 +66,10 @@ class APIError extends AribotError {
|
|
|
107
66
|
this.response = response;
|
|
108
67
|
}
|
|
109
68
|
}
|
|
110
|
-
exports.APIError = APIError;
|
|
111
69
|
// =============================================================================
|
|
112
70
|
// API CLIENT
|
|
113
71
|
// =============================================================================
|
|
114
|
-
class AribotClient {
|
|
72
|
+
export class AribotClient {
|
|
115
73
|
apiKey;
|
|
116
74
|
baseUrl;
|
|
117
75
|
timeout;
|
|
@@ -243,7 +201,6 @@ class AribotClient {
|
|
|
243
201
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
244
202
|
}
|
|
245
203
|
}
|
|
246
|
-
exports.AribotClient = AribotClient;
|
|
247
204
|
// =============================================================================
|
|
248
205
|
// THREAT MODELING RESOURCE
|
|
249
206
|
// =============================================================================
|
|
@@ -702,7 +659,7 @@ class AIResource {
|
|
|
702
659
|
/**
|
|
703
660
|
* HMAC-SHA256 request signing for API request integrity.
|
|
704
661
|
*/
|
|
705
|
-
class RequestSigner {
|
|
662
|
+
export class RequestSigner {
|
|
706
663
|
/**
|
|
707
664
|
* Generate HMAC-SHA256 signature for request.
|
|
708
665
|
*/
|
|
@@ -738,11 +695,10 @@ class RequestSigner {
|
|
|
738
695
|
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
|
|
739
696
|
}
|
|
740
697
|
}
|
|
741
|
-
exports.RequestSigner = RequestSigner;
|
|
742
698
|
/**
|
|
743
699
|
* Secure credential storage utilities.
|
|
744
700
|
*/
|
|
745
|
-
class SecureCredentialManager {
|
|
701
|
+
export class SecureCredentialManager {
|
|
746
702
|
static SERVICE_NAME = 'aribot-api';
|
|
747
703
|
/**
|
|
748
704
|
* Store API key securely using environment variable.
|
|
@@ -770,14 +726,13 @@ class SecureCredentialManager {
|
|
|
770
726
|
return /^ak_[a-zA-Z0-9]{32,}$/.test(apiKey);
|
|
771
727
|
}
|
|
772
728
|
}
|
|
773
|
-
exports.SecureCredentialManager = SecureCredentialManager;
|
|
774
729
|
// =============================================================================
|
|
775
730
|
// CONVENIENCE FUNCTIONS
|
|
776
731
|
// =============================================================================
|
|
777
732
|
/**
|
|
778
733
|
* Quick function to analyze a diagram and get threats.
|
|
779
734
|
*/
|
|
780
|
-
async function analyzeDiagram(filePath, options = {}) {
|
|
735
|
+
export async function analyzeDiagram(filePath, options = {}) {
|
|
781
736
|
const client = new AribotClient({ apiKey: options.apiKey });
|
|
782
737
|
const diagram = await client.threatModeling.upload(filePath, {
|
|
783
738
|
name: options.name,
|
|
@@ -800,9 +755,9 @@ async function analyzeDiagram(filePath, options = {}) {
|
|
|
800
755
|
/**
|
|
801
756
|
* Quick compliance check against multiple standards.
|
|
802
757
|
*/
|
|
803
|
-
async function runComplianceCheck(diagramId, standards = ['SOC2', 'ISO27001'], apiKey) {
|
|
758
|
+
export async function runComplianceCheck(diagramId, standards = ['SOC2', 'ISO27001'], apiKey) {
|
|
804
759
|
const client = new AribotClient({ apiKey });
|
|
805
760
|
return client.compliance.runScan(diagramId, standards);
|
|
806
761
|
}
|
|
807
762
|
// Export default client
|
|
808
|
-
|
|
763
|
+
export default AribotClient;
|
package/dist/theme.d.ts
CHANGED
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
* Apple Glass-inspired design with orange, gold, black, and white.
|
|
5
5
|
*/
|
|
6
6
|
export declare const colors: {
|
|
7
|
-
orange: import("chalk"
|
|
8
|
-
gold: import("chalk"
|
|
9
|
-
white: import("chalk"
|
|
10
|
-
black: import("chalk"
|
|
11
|
-
gray: import("chalk"
|
|
12
|
-
darkGray: import("chalk"
|
|
13
|
-
success: import("chalk"
|
|
14
|
-
error: import("chalk"
|
|
15
|
-
warning: import("chalk"
|
|
7
|
+
orange: import("chalk").ChalkInstance;
|
|
8
|
+
gold: import("chalk").ChalkInstance;
|
|
9
|
+
white: import("chalk").ChalkInstance;
|
|
10
|
+
black: import("chalk").ChalkInstance;
|
|
11
|
+
gray: import("chalk").ChalkInstance;
|
|
12
|
+
darkGray: import("chalk").ChalkInstance;
|
|
13
|
+
success: import("chalk").ChalkInstance;
|
|
14
|
+
error: import("chalk").ChalkInstance;
|
|
15
|
+
warning: import("chalk").ChalkInstance;
|
|
16
16
|
};
|
|
17
17
|
export declare const bold: {
|
|
18
|
-
orange: import("chalk"
|
|
19
|
-
gold: import("chalk"
|
|
20
|
-
white: import("chalk"
|
|
21
|
-
success: import("chalk"
|
|
22
|
-
error: import("chalk"
|
|
23
|
-
warning: import("chalk"
|
|
18
|
+
orange: import("chalk").ChalkInstance;
|
|
19
|
+
gold: import("chalk").ChalkInstance;
|
|
20
|
+
white: import("chalk").ChalkInstance;
|
|
21
|
+
success: import("chalk").ChalkInstance;
|
|
22
|
+
error: import("chalk").ChalkInstance;
|
|
23
|
+
warning: import("chalk").ChalkInstance;
|
|
24
24
|
};
|
|
25
25
|
export declare const LOGO_FULL: string;
|
|
26
26
|
export declare const LOGO_SMALL: string;
|