@ayurak/sdk 1.0.0 → 1.4.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/dist/index.js CHANGED
@@ -20,14 +20,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ AIAPI: () => AIAPI,
24
+ APIKeysAPI: () => APIKeysAPI,
23
25
  Aribot: () => Aribot,
24
26
  AribotError: () => AribotError,
25
27
  AuthenticationError: () => AuthenticationError,
26
28
  CloudSecurityAPI: () => CloudSecurityAPI,
27
29
  ComplianceAPI: () => ComplianceAPI,
30
+ DashboardAPI: () => DashboardAPI,
31
+ DigitalTwinAPI: () => DigitalTwinAPI,
32
+ EconomicsAPI: () => EconomicsAPI,
33
+ FinOpsAPI: () => FinOpsAPI,
34
+ MarketplaceAPI: () => MarketplaceAPI,
28
35
  NotFoundError: () => NotFoundError,
29
36
  PipelineAPI: () => PipelineAPI,
30
37
  RateLimitError: () => RateLimitError,
38
+ RedTeamAPI: () => RedTeamAPI,
39
+ SBOMAPI: () => SBOMAPI,
31
40
  ServerError: () => ServerError,
32
41
  ThreatModelingAPI: () => ThreatModelingAPI,
33
42
  ValidationError: () => ValidationError
@@ -162,7 +171,7 @@ var HttpClient = class {
162
171
  }
163
172
  const headers = {
164
173
  "X-API-Key": this.apiKey,
165
- "User-Agent": "aribot-js/1.0.0"
174
+ "User-Agent": "aribot-js/1.4.0"
166
175
  };
167
176
  let body;
168
177
  if (options.formData) {
@@ -733,6 +742,418 @@ var PipelineAPI = class {
733
742
  }
734
743
  };
735
744
 
745
+ // src/redteam.ts
746
+ var RedTeamAPI = class {
747
+ constructor(http) {
748
+ this.http = http;
749
+ }
750
+ /**
751
+ * Get available red team methodologies (STRIDE, PASTA, MITRE ATT&CK, etc.)
752
+ */
753
+ async getMethodologies() {
754
+ const result = await this.http.get("/v2/threat-modeling/threat-engine/red-team/methodologies/");
755
+ return result.methodologies || [];
756
+ }
757
+ /**
758
+ * Get red team simulations (attack path simulations)
759
+ */
760
+ async getSimulations(options) {
761
+ const params = {};
762
+ if (options?.diagramId) params.diagram_id = options.diagramId;
763
+ if (options?.status) params.status = options.status;
764
+ if (options?.limit) params.limit = options.limit;
765
+ const result = await this.http.get("/v2/threat-modeling/threat-engine/red-team/simulations/", params);
766
+ return result.simulations || [];
767
+ }
768
+ /**
769
+ * Get threat intelligence summary
770
+ */
771
+ async getIntelligence() {
772
+ return await this.http.get("/v2/threat-modeling/threat-engine/threat-intelligence/");
773
+ }
774
+ /**
775
+ * Generate attack paths for a diagram
776
+ */
777
+ async generateAttackPaths(diagramId, options) {
778
+ return await this.http.post(`/v2/threat-modeling/diagrams/${diagramId}/generate-attack-paths/`, {
779
+ depth: options?.depth || "comprehensive",
780
+ include_remediations: options?.includeRemediations ?? true
781
+ });
782
+ }
783
+ /**
784
+ * Get attack paths for a diagram
785
+ */
786
+ async getAttackPaths(diagramId) {
787
+ const result = await this.http.get(`/v2/threat-modeling/diagrams/${diagramId}/attack-paths/`);
788
+ return result.attack_paths || [];
789
+ }
790
+ };
791
+
792
+ // src/digital-twin.ts
793
+ var DigitalTwinAPI = class {
794
+ constructor(http) {
795
+ this.http = http;
796
+ }
797
+ /**
798
+ * Get available cloud providers (AWS, Azure, GCP)
799
+ */
800
+ async getProviders() {
801
+ const result = await this.http.get("/v2/threat-modeling/digital-twin/providers/");
802
+ if (Array.isArray(result)) return result;
803
+ return result.results || [];
804
+ }
805
+ /**
806
+ * Get available cloud resources
807
+ */
808
+ async getResources(options) {
809
+ const params = {};
810
+ if (options?.provider) params.provider = options.provider;
811
+ if (options?.resourceType) params.resource_type = options.resourceType;
812
+ if (options?.limit) params.limit = options.limit;
813
+ const result = await this.http.get("/v2/threat-modeling/digital-twin/available-resources/", params);
814
+ if (Array.isArray(result)) return result;
815
+ return result.results || [];
816
+ }
817
+ /**
818
+ * Get component cloud status for a diagram
819
+ */
820
+ async getDiagramComponentStatus(diagramId) {
821
+ return await this.http.get(
822
+ `/v2/threat-modeling/digital-twin/diagram/${diagramId}/component-status/`
823
+ );
824
+ }
825
+ /**
826
+ * Map a component to a cloud resource
827
+ */
828
+ async mapComponent(diagramId, componentId, resourceId) {
829
+ return await this.http.post(`/v2/threat-modeling/digital-twin/diagram/${diagramId}/map-component/`, {
830
+ component_id: componentId,
831
+ resource_id: resourceId
832
+ });
833
+ }
834
+ /**
835
+ * Unmap a component from cloud resource
836
+ */
837
+ async unmapComponent(diagramId, componentId) {
838
+ await this.http.delete(`/v2/threat-modeling/digital-twin/diagram/${diagramId}/component/${componentId}/`);
839
+ }
840
+ /**
841
+ * Sync diagram cloud status
842
+ */
843
+ async syncDiagramStatus(diagramId) {
844
+ return await this.http.post(
845
+ `/v2/threat-modeling/digital-twin/diagram/${diagramId}/sync/`,
846
+ {}
847
+ );
848
+ }
849
+ /**
850
+ * Get single component cloud status
851
+ */
852
+ async getComponentStatus(componentId) {
853
+ return await this.http.get(
854
+ `/v2/threat-modeling/digital-twin/component-status/${componentId}/`
855
+ );
856
+ }
857
+ /**
858
+ * Get digital twin health status
859
+ */
860
+ async getHealth() {
861
+ return await this.http.get("/v2/threat-modeling/digital-twin/health/");
862
+ }
863
+ /**
864
+ * Get digital twin analytics
865
+ */
866
+ async getAnalytics() {
867
+ return await this.http.get("/v2/threat-modeling/digital-twin/analytics/");
868
+ }
869
+ };
870
+
871
+ // src/economics.ts
872
+ var EconomicsAPI = class {
873
+ constructor(http) {
874
+ this.http = http;
875
+ }
876
+ /**
877
+ * Get economics dashboard with cost metrics
878
+ */
879
+ async getDashboard(options) {
880
+ const params = {};
881
+ if (options?.period) params.period = options.period;
882
+ return await this.http.get("/v2/threat-modeling/economics/dashboard/", params);
883
+ }
884
+ /**
885
+ * Get cost analysis for a diagram
886
+ */
887
+ async getDiagramCostAnalysis(diagramId) {
888
+ return await this.http.get(
889
+ `/v2/threat-modeling/diagrams/${diagramId}/cost-analysis/`
890
+ );
891
+ }
892
+ /**
893
+ * Get component cost intelligence
894
+ */
895
+ async getComponentCost(componentId) {
896
+ return await this.http.get(
897
+ `/v2/threat-modeling/components/${componentId}/cost-intelligence/`
898
+ );
899
+ }
900
+ /**
901
+ * Get economic intelligence dashboard (pricing, market trends)
902
+ */
903
+ async getEconomicIntelligence() {
904
+ return await this.http.get("/v2/threat-modeling/economic-intelligence/pricing/");
905
+ }
906
+ /**
907
+ * Get market intelligence data
908
+ */
909
+ async getMarketIntelligence() {
910
+ return await this.http.get("/v2/threat-modeling/market-intelligence/");
911
+ }
912
+ /**
913
+ * Calculate ROI for security investments
914
+ */
915
+ async calculateROI(options) {
916
+ return await this.http.post("/v2/threat-modeling/economics/calculate-roi/", {
917
+ investment: options.investment,
918
+ risks_addressed: options.risksAddressed,
919
+ timeframe_days: options.timeframeDays || 365
920
+ });
921
+ }
922
+ };
923
+
924
+ // src/ai.ts
925
+ var AIAPI = class {
926
+ constructor(http) {
927
+ this.http = http;
928
+ }
929
+ /**
930
+ * Get AI usage statistics
931
+ */
932
+ async getUsage(period) {
933
+ const params = {};
934
+ if (period) params.period = period;
935
+ return await this.http.get("/v2/ai/usage/", params);
936
+ }
937
+ /**
938
+ * Get AI quota information
939
+ */
940
+ async getQuota() {
941
+ return await this.http.get("/v2/ai/quota/");
942
+ }
943
+ /**
944
+ * List available AI models
945
+ */
946
+ async listModels() {
947
+ const result = await this.http.get("/v2/ai/models/");
948
+ if (Array.isArray(result)) {
949
+ return result;
950
+ }
951
+ const data = result;
952
+ return data.results || data.models || [];
953
+ }
954
+ /**
955
+ * Configure AI settings
956
+ */
957
+ async configure(config) {
958
+ return await this.http.post("/v2/ai/configure/", config);
959
+ }
960
+ /**
961
+ * Run AI analysis
962
+ */
963
+ async analyze(options) {
964
+ return await this.http.post("/v2/ai/analyze/", options);
965
+ }
966
+ /**
967
+ * Get AI processing queue status
968
+ */
969
+ async getQueueStatus() {
970
+ return await this.http.get("/v2/ai/queue-status/");
971
+ }
972
+ };
973
+
974
+ // src/sbom.ts
975
+ var SBOMAPI = class {
976
+ constructor(http) {
977
+ this.http = http;
978
+ }
979
+ /**
980
+ * List SBOM documents
981
+ */
982
+ async list(params) {
983
+ const result = await this.http.get("/v2/sbom/documents/", params);
984
+ if (Array.isArray(result)) {
985
+ return result;
986
+ }
987
+ const data = result;
988
+ return data.results || data.documents || [];
989
+ }
990
+ /**
991
+ * Get SBOM document details
992
+ */
993
+ async get(documentId) {
994
+ return await this.http.get(`/v2/sbom/documents/${documentId}/`);
995
+ }
996
+ /**
997
+ * Upload an SBOM document
998
+ */
999
+ async upload(file, options) {
1000
+ const formData = new FormData();
1001
+ formData.append("file", file);
1002
+ if (options?.name) formData.append("name", options.name);
1003
+ if (options?.format) formData.append("format", options.format);
1004
+ return await this.http.post("/v2/sbom/documents/", void 0, formData);
1005
+ }
1006
+ /**
1007
+ * Get vulnerabilities for an SBOM document
1008
+ */
1009
+ async getVulnerabilities(documentId, params) {
1010
+ const result = await this.http.get(
1011
+ `/v2/sbom/documents/${documentId}/vulnerabilities/`,
1012
+ params
1013
+ );
1014
+ if (Array.isArray(result)) {
1015
+ return result;
1016
+ }
1017
+ const data = result;
1018
+ return data.results || data.vulnerabilities || [];
1019
+ }
1020
+ };
1021
+
1022
+ // src/dashboard.ts
1023
+ var DashboardAPI = class {
1024
+ constructor(http) {
1025
+ this.http = http;
1026
+ }
1027
+ /**
1028
+ * Get dashboard overview metrics
1029
+ */
1030
+ async getOverview() {
1031
+ return await this.http.get("/v2/dashboard/overview/");
1032
+ }
1033
+ /**
1034
+ * Get recent activity
1035
+ */
1036
+ async getRecentActivity(params) {
1037
+ const result = await this.http.get("/v2/dashboard/recent/", params);
1038
+ if (Array.isArray(result)) {
1039
+ return result;
1040
+ }
1041
+ const data = result;
1042
+ return data.results || data.activities || [];
1043
+ }
1044
+ /**
1045
+ * Get risk summary
1046
+ */
1047
+ async getRiskSummary() {
1048
+ return await this.http.get("/v2/dashboard/risk/");
1049
+ }
1050
+ };
1051
+
1052
+ // src/finops.ts
1053
+ var FinOpsAPI = class {
1054
+ constructor(http) {
1055
+ this.http = http;
1056
+ }
1057
+ /**
1058
+ * Get cost optimization recommendations
1059
+ */
1060
+ async getRecommendations(params) {
1061
+ const result = await this.http.get("/v2/finops/recommendations/", params);
1062
+ if (Array.isArray(result)) {
1063
+ return result;
1064
+ }
1065
+ const data = result;
1066
+ return data.results || data.recommendations || [];
1067
+ }
1068
+ /**
1069
+ * Get cost breakdown
1070
+ */
1071
+ async getCosts(params) {
1072
+ return await this.http.get("/v2/finops/costs/", params);
1073
+ }
1074
+ /**
1075
+ * Get optimization details
1076
+ */
1077
+ async getOptimization(params) {
1078
+ const result = await this.http.get("/v2/finops/optimization/", params);
1079
+ if (Array.isArray(result)) {
1080
+ return result;
1081
+ }
1082
+ const data = result;
1083
+ return data.results || data.optimizations || [];
1084
+ }
1085
+ };
1086
+
1087
+ // src/marketplace.ts
1088
+ var MarketplaceAPI = class {
1089
+ constructor(http) {
1090
+ this.http = http;
1091
+ }
1092
+ /**
1093
+ * List marketplace templates
1094
+ */
1095
+ async listTemplates(params) {
1096
+ const result = await this.http.get("/v2/marketplace/templates/", params);
1097
+ if (Array.isArray(result)) {
1098
+ return result;
1099
+ }
1100
+ const data = result;
1101
+ return data.results || data.templates || [];
1102
+ }
1103
+ /**
1104
+ * List marketplace categories
1105
+ */
1106
+ async listCategories() {
1107
+ const result = await this.http.get("/v2/marketplace/categories/");
1108
+ if (Array.isArray(result)) {
1109
+ return result;
1110
+ }
1111
+ const data = result;
1112
+ return data.results || data.categories || [];
1113
+ }
1114
+ /**
1115
+ * Get featured templates
1116
+ */
1117
+ async getFeatured() {
1118
+ const result = await this.http.get("/v2/marketplace/featured/");
1119
+ if (Array.isArray(result)) {
1120
+ return result;
1121
+ }
1122
+ const data = result;
1123
+ return data.results || data.templates || [];
1124
+ }
1125
+ };
1126
+
1127
+ // src/api-keys.ts
1128
+ var APIKeysAPI = class {
1129
+ constructor(http) {
1130
+ this.http = http;
1131
+ }
1132
+ /**
1133
+ * List API keys
1134
+ */
1135
+ async list(params) {
1136
+ const result = await this.http.get("/v2/api-keys/", params);
1137
+ if (Array.isArray(result)) {
1138
+ return result;
1139
+ }
1140
+ const data = result;
1141
+ return data.results || data.keys || [];
1142
+ }
1143
+ /**
1144
+ * Create a new API key
1145
+ */
1146
+ async create(options) {
1147
+ return await this.http.post("/v2/api-keys/", options);
1148
+ }
1149
+ /**
1150
+ * Revoke an API key
1151
+ */
1152
+ async revoke(keyId) {
1153
+ return await this.http.post(`/v2/api-keys/${keyId}/revoke/`);
1154
+ }
1155
+ };
1156
+
736
1157
  // src/client.ts
737
1158
  var Aribot = class {
738
1159
  /**
@@ -751,6 +1172,15 @@ var Aribot = class {
751
1172
  this.compliance = new ComplianceAPI(this.http);
752
1173
  this.cloud = new CloudSecurityAPI(this.http);
753
1174
  this.pipeline = new PipelineAPI(this.http);
1175
+ this.redTeam = new RedTeamAPI(this.http);
1176
+ this.digitalTwin = new DigitalTwinAPI(this.http);
1177
+ this.economics = new EconomicsAPI(this.http);
1178
+ this.ai = new AIAPI(this.http);
1179
+ this.sbom = new SBOMAPI(this.http);
1180
+ this.dashboard = new DashboardAPI(this.http);
1181
+ this.finops = new FinOpsAPI(this.http);
1182
+ this.marketplace = new MarketplaceAPI(this.http);
1183
+ this.apiKeys = new APIKeysAPI(this.http);
754
1184
  }
755
1185
  /**
756
1186
  * Check API health status
@@ -773,14 +1203,23 @@ var Aribot = class {
773
1203
  };
774
1204
  // Annotate the CommonJS export names for ESM import in node:
775
1205
  0 && (module.exports = {
1206
+ AIAPI,
1207
+ APIKeysAPI,
776
1208
  Aribot,
777
1209
  AribotError,
778
1210
  AuthenticationError,
779
1211
  CloudSecurityAPI,
780
1212
  ComplianceAPI,
1213
+ DashboardAPI,
1214
+ DigitalTwinAPI,
1215
+ EconomicsAPI,
1216
+ FinOpsAPI,
1217
+ MarketplaceAPI,
781
1218
  NotFoundError,
782
1219
  PipelineAPI,
783
1220
  RateLimitError,
1221
+ RedTeamAPI,
1222
+ SBOMAPI,
784
1223
  ServerError,
785
1224
  ThreatModelingAPI,
786
1225
  ValidationError