@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.mjs CHANGED
@@ -126,7 +126,7 @@ var HttpClient = class {
126
126
  }
127
127
  const headers = {
128
128
  "X-API-Key": this.apiKey,
129
- "User-Agent": "aribot-js/1.0.0"
129
+ "User-Agent": "aribot-js/1.4.0"
130
130
  };
131
131
  let body;
132
132
  if (options.formData) {
@@ -697,6 +697,418 @@ var PipelineAPI = class {
697
697
  }
698
698
  };
699
699
 
700
+ // src/redteam.ts
701
+ var RedTeamAPI = class {
702
+ constructor(http) {
703
+ this.http = http;
704
+ }
705
+ /**
706
+ * Get available red team methodologies (STRIDE, PASTA, MITRE ATT&CK, etc.)
707
+ */
708
+ async getMethodologies() {
709
+ const result = await this.http.get("/v2/threat-modeling/threat-engine/red-team/methodologies/");
710
+ return result.methodologies || [];
711
+ }
712
+ /**
713
+ * Get red team simulations (attack path simulations)
714
+ */
715
+ async getSimulations(options) {
716
+ const params = {};
717
+ if (options?.diagramId) params.diagram_id = options.diagramId;
718
+ if (options?.status) params.status = options.status;
719
+ if (options?.limit) params.limit = options.limit;
720
+ const result = await this.http.get("/v2/threat-modeling/threat-engine/red-team/simulations/", params);
721
+ return result.simulations || [];
722
+ }
723
+ /**
724
+ * Get threat intelligence summary
725
+ */
726
+ async getIntelligence() {
727
+ return await this.http.get("/v2/threat-modeling/threat-engine/threat-intelligence/");
728
+ }
729
+ /**
730
+ * Generate attack paths for a diagram
731
+ */
732
+ async generateAttackPaths(diagramId, options) {
733
+ return await this.http.post(`/v2/threat-modeling/diagrams/${diagramId}/generate-attack-paths/`, {
734
+ depth: options?.depth || "comprehensive",
735
+ include_remediations: options?.includeRemediations ?? true
736
+ });
737
+ }
738
+ /**
739
+ * Get attack paths for a diagram
740
+ */
741
+ async getAttackPaths(diagramId) {
742
+ const result = await this.http.get(`/v2/threat-modeling/diagrams/${diagramId}/attack-paths/`);
743
+ return result.attack_paths || [];
744
+ }
745
+ };
746
+
747
+ // src/digital-twin.ts
748
+ var DigitalTwinAPI = class {
749
+ constructor(http) {
750
+ this.http = http;
751
+ }
752
+ /**
753
+ * Get available cloud providers (AWS, Azure, GCP)
754
+ */
755
+ async getProviders() {
756
+ const result = await this.http.get("/v2/threat-modeling/digital-twin/providers/");
757
+ if (Array.isArray(result)) return result;
758
+ return result.results || [];
759
+ }
760
+ /**
761
+ * Get available cloud resources
762
+ */
763
+ async getResources(options) {
764
+ const params = {};
765
+ if (options?.provider) params.provider = options.provider;
766
+ if (options?.resourceType) params.resource_type = options.resourceType;
767
+ if (options?.limit) params.limit = options.limit;
768
+ const result = await this.http.get("/v2/threat-modeling/digital-twin/available-resources/", params);
769
+ if (Array.isArray(result)) return result;
770
+ return result.results || [];
771
+ }
772
+ /**
773
+ * Get component cloud status for a diagram
774
+ */
775
+ async getDiagramComponentStatus(diagramId) {
776
+ return await this.http.get(
777
+ `/v2/threat-modeling/digital-twin/diagram/${diagramId}/component-status/`
778
+ );
779
+ }
780
+ /**
781
+ * Map a component to a cloud resource
782
+ */
783
+ async mapComponent(diagramId, componentId, resourceId) {
784
+ return await this.http.post(`/v2/threat-modeling/digital-twin/diagram/${diagramId}/map-component/`, {
785
+ component_id: componentId,
786
+ resource_id: resourceId
787
+ });
788
+ }
789
+ /**
790
+ * Unmap a component from cloud resource
791
+ */
792
+ async unmapComponent(diagramId, componentId) {
793
+ await this.http.delete(`/v2/threat-modeling/digital-twin/diagram/${diagramId}/component/${componentId}/`);
794
+ }
795
+ /**
796
+ * Sync diagram cloud status
797
+ */
798
+ async syncDiagramStatus(diagramId) {
799
+ return await this.http.post(
800
+ `/v2/threat-modeling/digital-twin/diagram/${diagramId}/sync/`,
801
+ {}
802
+ );
803
+ }
804
+ /**
805
+ * Get single component cloud status
806
+ */
807
+ async getComponentStatus(componentId) {
808
+ return await this.http.get(
809
+ `/v2/threat-modeling/digital-twin/component-status/${componentId}/`
810
+ );
811
+ }
812
+ /**
813
+ * Get digital twin health status
814
+ */
815
+ async getHealth() {
816
+ return await this.http.get("/v2/threat-modeling/digital-twin/health/");
817
+ }
818
+ /**
819
+ * Get digital twin analytics
820
+ */
821
+ async getAnalytics() {
822
+ return await this.http.get("/v2/threat-modeling/digital-twin/analytics/");
823
+ }
824
+ };
825
+
826
+ // src/economics.ts
827
+ var EconomicsAPI = class {
828
+ constructor(http) {
829
+ this.http = http;
830
+ }
831
+ /**
832
+ * Get economics dashboard with cost metrics
833
+ */
834
+ async getDashboard(options) {
835
+ const params = {};
836
+ if (options?.period) params.period = options.period;
837
+ return await this.http.get("/v2/threat-modeling/economics/dashboard/", params);
838
+ }
839
+ /**
840
+ * Get cost analysis for a diagram
841
+ */
842
+ async getDiagramCostAnalysis(diagramId) {
843
+ return await this.http.get(
844
+ `/v2/threat-modeling/diagrams/${diagramId}/cost-analysis/`
845
+ );
846
+ }
847
+ /**
848
+ * Get component cost intelligence
849
+ */
850
+ async getComponentCost(componentId) {
851
+ return await this.http.get(
852
+ `/v2/threat-modeling/components/${componentId}/cost-intelligence/`
853
+ );
854
+ }
855
+ /**
856
+ * Get economic intelligence dashboard (pricing, market trends)
857
+ */
858
+ async getEconomicIntelligence() {
859
+ return await this.http.get("/v2/threat-modeling/economic-intelligence/pricing/");
860
+ }
861
+ /**
862
+ * Get market intelligence data
863
+ */
864
+ async getMarketIntelligence() {
865
+ return await this.http.get("/v2/threat-modeling/market-intelligence/");
866
+ }
867
+ /**
868
+ * Calculate ROI for security investments
869
+ */
870
+ async calculateROI(options) {
871
+ return await this.http.post("/v2/threat-modeling/economics/calculate-roi/", {
872
+ investment: options.investment,
873
+ risks_addressed: options.risksAddressed,
874
+ timeframe_days: options.timeframeDays || 365
875
+ });
876
+ }
877
+ };
878
+
879
+ // src/ai.ts
880
+ var AIAPI = class {
881
+ constructor(http) {
882
+ this.http = http;
883
+ }
884
+ /**
885
+ * Get AI usage statistics
886
+ */
887
+ async getUsage(period) {
888
+ const params = {};
889
+ if (period) params.period = period;
890
+ return await this.http.get("/v2/ai/usage/", params);
891
+ }
892
+ /**
893
+ * Get AI quota information
894
+ */
895
+ async getQuota() {
896
+ return await this.http.get("/v2/ai/quota/");
897
+ }
898
+ /**
899
+ * List available AI models
900
+ */
901
+ async listModels() {
902
+ const result = await this.http.get("/v2/ai/models/");
903
+ if (Array.isArray(result)) {
904
+ return result;
905
+ }
906
+ const data = result;
907
+ return data.results || data.models || [];
908
+ }
909
+ /**
910
+ * Configure AI settings
911
+ */
912
+ async configure(config) {
913
+ return await this.http.post("/v2/ai/configure/", config);
914
+ }
915
+ /**
916
+ * Run AI analysis
917
+ */
918
+ async analyze(options) {
919
+ return await this.http.post("/v2/ai/analyze/", options);
920
+ }
921
+ /**
922
+ * Get AI processing queue status
923
+ */
924
+ async getQueueStatus() {
925
+ return await this.http.get("/v2/ai/queue-status/");
926
+ }
927
+ };
928
+
929
+ // src/sbom.ts
930
+ var SBOMAPI = class {
931
+ constructor(http) {
932
+ this.http = http;
933
+ }
934
+ /**
935
+ * List SBOM documents
936
+ */
937
+ async list(params) {
938
+ const result = await this.http.get("/v2/sbom/documents/", params);
939
+ if (Array.isArray(result)) {
940
+ return result;
941
+ }
942
+ const data = result;
943
+ return data.results || data.documents || [];
944
+ }
945
+ /**
946
+ * Get SBOM document details
947
+ */
948
+ async get(documentId) {
949
+ return await this.http.get(`/v2/sbom/documents/${documentId}/`);
950
+ }
951
+ /**
952
+ * Upload an SBOM document
953
+ */
954
+ async upload(file, options) {
955
+ const formData = new FormData();
956
+ formData.append("file", file);
957
+ if (options?.name) formData.append("name", options.name);
958
+ if (options?.format) formData.append("format", options.format);
959
+ return await this.http.post("/v2/sbom/documents/", void 0, formData);
960
+ }
961
+ /**
962
+ * Get vulnerabilities for an SBOM document
963
+ */
964
+ async getVulnerabilities(documentId, params) {
965
+ const result = await this.http.get(
966
+ `/v2/sbom/documents/${documentId}/vulnerabilities/`,
967
+ params
968
+ );
969
+ if (Array.isArray(result)) {
970
+ return result;
971
+ }
972
+ const data = result;
973
+ return data.results || data.vulnerabilities || [];
974
+ }
975
+ };
976
+
977
+ // src/dashboard.ts
978
+ var DashboardAPI = class {
979
+ constructor(http) {
980
+ this.http = http;
981
+ }
982
+ /**
983
+ * Get dashboard overview metrics
984
+ */
985
+ async getOverview() {
986
+ return await this.http.get("/v2/dashboard/overview/");
987
+ }
988
+ /**
989
+ * Get recent activity
990
+ */
991
+ async getRecentActivity(params) {
992
+ const result = await this.http.get("/v2/dashboard/recent/", params);
993
+ if (Array.isArray(result)) {
994
+ return result;
995
+ }
996
+ const data = result;
997
+ return data.results || data.activities || [];
998
+ }
999
+ /**
1000
+ * Get risk summary
1001
+ */
1002
+ async getRiskSummary() {
1003
+ return await this.http.get("/v2/dashboard/risk/");
1004
+ }
1005
+ };
1006
+
1007
+ // src/finops.ts
1008
+ var FinOpsAPI = class {
1009
+ constructor(http) {
1010
+ this.http = http;
1011
+ }
1012
+ /**
1013
+ * Get cost optimization recommendations
1014
+ */
1015
+ async getRecommendations(params) {
1016
+ const result = await this.http.get("/v2/finops/recommendations/", params);
1017
+ if (Array.isArray(result)) {
1018
+ return result;
1019
+ }
1020
+ const data = result;
1021
+ return data.results || data.recommendations || [];
1022
+ }
1023
+ /**
1024
+ * Get cost breakdown
1025
+ */
1026
+ async getCosts(params) {
1027
+ return await this.http.get("/v2/finops/costs/", params);
1028
+ }
1029
+ /**
1030
+ * Get optimization details
1031
+ */
1032
+ async getOptimization(params) {
1033
+ const result = await this.http.get("/v2/finops/optimization/", params);
1034
+ if (Array.isArray(result)) {
1035
+ return result;
1036
+ }
1037
+ const data = result;
1038
+ return data.results || data.optimizations || [];
1039
+ }
1040
+ };
1041
+
1042
+ // src/marketplace.ts
1043
+ var MarketplaceAPI = class {
1044
+ constructor(http) {
1045
+ this.http = http;
1046
+ }
1047
+ /**
1048
+ * List marketplace templates
1049
+ */
1050
+ async listTemplates(params) {
1051
+ const result = await this.http.get("/v2/marketplace/templates/", params);
1052
+ if (Array.isArray(result)) {
1053
+ return result;
1054
+ }
1055
+ const data = result;
1056
+ return data.results || data.templates || [];
1057
+ }
1058
+ /**
1059
+ * List marketplace categories
1060
+ */
1061
+ async listCategories() {
1062
+ const result = await this.http.get("/v2/marketplace/categories/");
1063
+ if (Array.isArray(result)) {
1064
+ return result;
1065
+ }
1066
+ const data = result;
1067
+ return data.results || data.categories || [];
1068
+ }
1069
+ /**
1070
+ * Get featured templates
1071
+ */
1072
+ async getFeatured() {
1073
+ const result = await this.http.get("/v2/marketplace/featured/");
1074
+ if (Array.isArray(result)) {
1075
+ return result;
1076
+ }
1077
+ const data = result;
1078
+ return data.results || data.templates || [];
1079
+ }
1080
+ };
1081
+
1082
+ // src/api-keys.ts
1083
+ var APIKeysAPI = class {
1084
+ constructor(http) {
1085
+ this.http = http;
1086
+ }
1087
+ /**
1088
+ * List API keys
1089
+ */
1090
+ async list(params) {
1091
+ const result = await this.http.get("/v2/api-keys/", params);
1092
+ if (Array.isArray(result)) {
1093
+ return result;
1094
+ }
1095
+ const data = result;
1096
+ return data.results || data.keys || [];
1097
+ }
1098
+ /**
1099
+ * Create a new API key
1100
+ */
1101
+ async create(options) {
1102
+ return await this.http.post("/v2/api-keys/", options);
1103
+ }
1104
+ /**
1105
+ * Revoke an API key
1106
+ */
1107
+ async revoke(keyId) {
1108
+ return await this.http.post(`/v2/api-keys/${keyId}/revoke/`);
1109
+ }
1110
+ };
1111
+
700
1112
  // src/client.ts
701
1113
  var Aribot = class {
702
1114
  /**
@@ -715,6 +1127,15 @@ var Aribot = class {
715
1127
  this.compliance = new ComplianceAPI(this.http);
716
1128
  this.cloud = new CloudSecurityAPI(this.http);
717
1129
  this.pipeline = new PipelineAPI(this.http);
1130
+ this.redTeam = new RedTeamAPI(this.http);
1131
+ this.digitalTwin = new DigitalTwinAPI(this.http);
1132
+ this.economics = new EconomicsAPI(this.http);
1133
+ this.ai = new AIAPI(this.http);
1134
+ this.sbom = new SBOMAPI(this.http);
1135
+ this.dashboard = new DashboardAPI(this.http);
1136
+ this.finops = new FinOpsAPI(this.http);
1137
+ this.marketplace = new MarketplaceAPI(this.http);
1138
+ this.apiKeys = new APIKeysAPI(this.http);
718
1139
  }
719
1140
  /**
720
1141
  * Check API health status
@@ -736,14 +1157,23 @@ var Aribot = class {
736
1157
  }
737
1158
  };
738
1159
  export {
1160
+ AIAPI,
1161
+ APIKeysAPI,
739
1162
  Aribot,
740
1163
  AribotError,
741
1164
  AuthenticationError,
742
1165
  CloudSecurityAPI,
743
1166
  ComplianceAPI,
1167
+ DashboardAPI,
1168
+ DigitalTwinAPI,
1169
+ EconomicsAPI,
1170
+ FinOpsAPI,
1171
+ MarketplaceAPI,
744
1172
  NotFoundError,
745
1173
  PipelineAPI,
746
1174
  RateLimitError,
1175
+ RedTeamAPI,
1176
+ SBOMAPI,
747
1177
  ServerError,
748
1178
  ThreatModelingAPI,
749
1179
  ValidationError
package/package.json CHANGED
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "name": "@ayurak/sdk",
3
- "version": "1.0.0",
4
- "publishConfig": {
5
- "access": "public"
6
- },
3
+ "version": "1.4.0",
7
4
  "description": "Aribot Security Platform SDK by Aristiun & Ayurak - Threat modeling, compliance, and cloud security APIs",
8
5
  "main": "dist/index.js",
9
6
  "module": "dist/index.mjs",
@@ -37,13 +34,13 @@
37
34
  "aristiun",
38
35
  "ayurak"
39
36
  ],
40
- "author": "Aristiun & Ayurak <sdk@ayurak.com>",
37
+ "author": "Aristiun & Ayurak <sdk@aristiun.com>",
41
38
  "license": "MIT",
42
39
  "repository": {
43
40
  "type": "git",
44
41
  "url": "https://github.com/Aristiun/aribot-js"
45
42
  },
46
- "homepage": "https://developer.ayurak.com/docs/js-sdk",
43
+ "homepage": "https://developers.aristiun.com/docs/js-sdk",
47
44
  "bugs": {
48
45
  "url": "https://github.com/Aristiun/aribot-js/issues"
49
46
  },