@indiciaosint/sdk 1.2.1 → 1.2.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.
Files changed (75) hide show
  1. package/README.md +7 -1
  2. package/esm/funcs/infrastructure-virus-total-content.d.ts +18 -0
  3. package/esm/funcs/infrastructure-virus-total-content.d.ts.map +1 -0
  4. package/esm/funcs/infrastructure-virus-total-content.js +84 -0
  5. package/esm/funcs/infrastructure-virus-total-content.js.map +1 -0
  6. package/esm/funcs/intelligence-virus-total-intelligence.d.ts +18 -0
  7. package/esm/funcs/intelligence-virus-total-intelligence.d.ts.map +1 -0
  8. package/esm/funcs/intelligence-virus-total-intelligence.js +84 -0
  9. package/esm/funcs/intelligence-virus-total-intelligence.js.map +1 -0
  10. package/esm/funcs/tools-download-virus-total-file.d.ts +18 -0
  11. package/esm/funcs/tools-download-virus-total-file.d.ts.map +1 -0
  12. package/esm/funcs/tools-download-virus-total-file.js +84 -0
  13. package/esm/funcs/tools-download-virus-total-file.js.map +1 -0
  14. package/esm/lib/config.d.ts +2 -2
  15. package/esm/lib/config.js +2 -2
  16. package/esm/models/operations/download-virus-total-file.d.ts +34 -0
  17. package/esm/models/operations/download-virus-total-file.d.ts.map +1 -0
  18. package/esm/models/operations/download-virus-total-file.js +33 -0
  19. package/esm/models/operations/download-virus-total-file.js.map +1 -0
  20. package/esm/models/operations/get-activity.d.ts +3 -0
  21. package/esm/models/operations/get-activity.d.ts.map +1 -1
  22. package/esm/models/operations/get-activity.js +3 -0
  23. package/esm/models/operations/get-activity.js.map +1 -1
  24. package/esm/models/operations/get-info.d.ts +3 -0
  25. package/esm/models/operations/get-info.d.ts.map +1 -1
  26. package/esm/models/operations/get-info.js +3 -0
  27. package/esm/models/operations/get-info.js.map +1 -1
  28. package/esm/models/operations/index.d.ts +3 -0
  29. package/esm/models/operations/index.d.ts.map +1 -1
  30. package/esm/models/operations/index.js +3 -0
  31. package/esm/models/operations/index.js.map +1 -1
  32. package/esm/models/operations/list-activities.d.ts +3 -0
  33. package/esm/models/operations/list-activities.d.ts.map +1 -1
  34. package/esm/models/operations/list-activities.js +3 -0
  35. package/esm/models/operations/list-activities.js.map +1 -1
  36. package/esm/models/operations/search-web-databases.d.ts +2 -2
  37. package/esm/models/operations/search-web-databases.js +2 -2
  38. package/esm/models/operations/search-web-databases.js.map +1 -1
  39. package/esm/models/operations/virus-total-content.d.ts +62 -0
  40. package/esm/models/operations/virus-total-content.d.ts.map +1 -0
  41. package/esm/models/operations/virus-total-content.js +89 -0
  42. package/esm/models/operations/virus-total-content.js.map +1 -0
  43. package/esm/models/operations/virus-total-intelligence.d.ts +75 -0
  44. package/esm/models/operations/virus-total-intelligence.d.ts.map +1 -0
  45. package/esm/models/operations/virus-total-intelligence.js +92 -0
  46. package/esm/models/operations/virus-total-intelligence.js.map +1 -0
  47. package/esm/sdk/infrastructure.d.ts +7 -0
  48. package/esm/sdk/infrastructure.d.ts.map +1 -1
  49. package/esm/sdk/infrastructure.js +10 -0
  50. package/esm/sdk/infrastructure.js.map +1 -1
  51. package/esm/sdk/intelligence.d.ts +7 -0
  52. package/esm/sdk/intelligence.d.ts.map +1 -1
  53. package/esm/sdk/intelligence.js +10 -0
  54. package/esm/sdk/intelligence.js.map +1 -1
  55. package/esm/sdk/tools.d.ts +7 -0
  56. package/esm/sdk/tools.d.ts.map +1 -1
  57. package/esm/sdk/tools.js +10 -0
  58. package/esm/sdk/tools.js.map +1 -1
  59. package/jsr.json +1 -1
  60. package/package.json +1 -1
  61. package/src/funcs/infrastructure-virus-total-content.ts +174 -0
  62. package/src/funcs/intelligence-virus-total-intelligence.ts +174 -0
  63. package/src/funcs/tools-download-virus-total-file.ts +174 -0
  64. package/src/lib/config.ts +2 -2
  65. package/src/models/operations/download-virus-total-file.ts +93 -0
  66. package/src/models/operations/get-activity.ts +3 -0
  67. package/src/models/operations/get-info.ts +3 -0
  68. package/src/models/operations/index.ts +3 -0
  69. package/src/models/operations/list-activities.ts +3 -0
  70. package/src/models/operations/search-web-databases.ts +2 -2
  71. package/src/models/operations/virus-total-content.ts +190 -0
  72. package/src/models/operations/virus-total-intelligence.ts +210 -0
  73. package/src/sdk/infrastructure.ts +18 -0
  74. package/src/sdk/intelligence.ts +18 -0
  75. package/src/sdk/tools.ts +18 -0
@@ -0,0 +1,210 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as types from "../../types/primitives.js";
11
+ import { SDKValidationError } from "../errors/sdk-validation-error.js";
12
+
13
+ export const Entity = {
14
+ Domains: "domains",
15
+ Files: "files",
16
+ Ips: "ips",
17
+ Urls: "urls",
18
+ } as const;
19
+ export type Entity = ClosedEnum<typeof Entity>;
20
+
21
+ export type VirusTotalIntelligenceRequest = {
22
+ entity: Entity;
23
+ query: string;
24
+ };
25
+
26
+ export type VirusTotalIntelligenceFile = {
27
+ id: string;
28
+ cleanCount?: number | undefined;
29
+ detectionRatio?: string | undefined;
30
+ fileName?: string | undefined;
31
+ firstSubmissionDate?: string | undefined;
32
+ lastAnalysisDate?: string | undefined;
33
+ maliciousCount?: number | undefined;
34
+ permalink?: string | undefined;
35
+ reputation?: string | undefined;
36
+ sha256?: string | undefined;
37
+ suspiciousCount?: number | undefined;
38
+ totalEngines?: number | undefined;
39
+ undetectedCount?: number | undefined;
40
+ url?: string | undefined;
41
+ };
42
+
43
+ export type SearchStats = {
44
+ clean?: number | undefined;
45
+ malicious?: number | undefined;
46
+ suspicious?: number | undefined;
47
+ total?: number | undefined;
48
+ };
49
+
50
+ export type VirusTotalIntelligenceData = {
51
+ entity: string;
52
+ files: Array<VirusTotalIntelligenceFile>;
53
+ query: string;
54
+ totalResults: number;
55
+ searchStats?: SearchStats | undefined;
56
+ };
57
+
58
+ /**
59
+ * Search successful
60
+ */
61
+ export type VirusTotalIntelligenceResponse = {
62
+ data: VirusTotalIntelligenceData;
63
+ success: boolean;
64
+ error?: string | undefined;
65
+ };
66
+
67
+ /** @internal */
68
+ export const Entity$outboundSchema: z.ZodMiniEnum<typeof Entity> = z.enum(
69
+ Entity,
70
+ );
71
+
72
+ /** @internal */
73
+ export type VirusTotalIntelligenceRequest$Outbound = {
74
+ entity: string;
75
+ query: string;
76
+ };
77
+
78
+ /** @internal */
79
+ export const VirusTotalIntelligenceRequest$outboundSchema: z.ZodMiniType<
80
+ VirusTotalIntelligenceRequest$Outbound,
81
+ VirusTotalIntelligenceRequest
82
+ > = z.object({
83
+ entity: Entity$outboundSchema,
84
+ query: z.string(),
85
+ });
86
+
87
+ export function virusTotalIntelligenceRequestToJSON(
88
+ virusTotalIntelligenceRequest: VirusTotalIntelligenceRequest,
89
+ ): string {
90
+ return JSON.stringify(
91
+ VirusTotalIntelligenceRequest$outboundSchema.parse(
92
+ virusTotalIntelligenceRequest,
93
+ ),
94
+ );
95
+ }
96
+
97
+ /** @internal */
98
+ export const VirusTotalIntelligenceFile$inboundSchema: z.ZodMiniType<
99
+ VirusTotalIntelligenceFile,
100
+ unknown
101
+ > = z.pipe(
102
+ z.object({
103
+ id: types.string(),
104
+ clean_count: types.optional(types.number()),
105
+ detection_ratio: types.optional(types.string()),
106
+ file_name: types.optional(types.string()),
107
+ first_submission_date: types.optional(types.string()),
108
+ last_analysis_date: types.optional(types.string()),
109
+ malicious_count: types.optional(types.number()),
110
+ permalink: types.optional(types.string()),
111
+ reputation: types.optional(types.string()),
112
+ sha256: types.optional(types.string()),
113
+ suspicious_count: types.optional(types.number()),
114
+ total_engines: types.optional(types.number()),
115
+ undetected_count: types.optional(types.number()),
116
+ url: types.optional(types.string()),
117
+ }),
118
+ z.transform((v) => {
119
+ return remap$(v, {
120
+ "clean_count": "cleanCount",
121
+ "detection_ratio": "detectionRatio",
122
+ "file_name": "fileName",
123
+ "first_submission_date": "firstSubmissionDate",
124
+ "last_analysis_date": "lastAnalysisDate",
125
+ "malicious_count": "maliciousCount",
126
+ "suspicious_count": "suspiciousCount",
127
+ "total_engines": "totalEngines",
128
+ "undetected_count": "undetectedCount",
129
+ });
130
+ }),
131
+ );
132
+
133
+ export function virusTotalIntelligenceFileFromJSON(
134
+ jsonString: string,
135
+ ): SafeParseResult<VirusTotalIntelligenceFile, SDKValidationError> {
136
+ return safeParse(
137
+ jsonString,
138
+ (x) => VirusTotalIntelligenceFile$inboundSchema.parse(JSON.parse(x)),
139
+ `Failed to parse 'VirusTotalIntelligenceFile' from JSON`,
140
+ );
141
+ }
142
+
143
+ /** @internal */
144
+ export const SearchStats$inboundSchema: z.ZodMiniType<SearchStats, unknown> = z
145
+ .object({
146
+ clean: types.optional(types.number()),
147
+ malicious: types.optional(types.number()),
148
+ suspicious: types.optional(types.number()),
149
+ total: types.optional(types.number()),
150
+ });
151
+
152
+ export function searchStatsFromJSON(
153
+ jsonString: string,
154
+ ): SafeParseResult<SearchStats, SDKValidationError> {
155
+ return safeParse(
156
+ jsonString,
157
+ (x) => SearchStats$inboundSchema.parse(JSON.parse(x)),
158
+ `Failed to parse 'SearchStats' from JSON`,
159
+ );
160
+ }
161
+
162
+ /** @internal */
163
+ export const VirusTotalIntelligenceData$inboundSchema: z.ZodMiniType<
164
+ VirusTotalIntelligenceData,
165
+ unknown
166
+ > = z.pipe(
167
+ z.object({
168
+ entity: types.string(),
169
+ files: z.array(z.lazy(() => VirusTotalIntelligenceFile$inboundSchema)),
170
+ query: types.string(),
171
+ total_results: types.number(),
172
+ search_stats: types.optional(z.lazy(() => SearchStats$inboundSchema)),
173
+ }),
174
+ z.transform((v) => {
175
+ return remap$(v, {
176
+ "total_results": "totalResults",
177
+ "search_stats": "searchStats",
178
+ });
179
+ }),
180
+ );
181
+
182
+ export function virusTotalIntelligenceDataFromJSON(
183
+ jsonString: string,
184
+ ): SafeParseResult<VirusTotalIntelligenceData, SDKValidationError> {
185
+ return safeParse(
186
+ jsonString,
187
+ (x) => VirusTotalIntelligenceData$inboundSchema.parse(JSON.parse(x)),
188
+ `Failed to parse 'VirusTotalIntelligenceData' from JSON`,
189
+ );
190
+ }
191
+
192
+ /** @internal */
193
+ export const VirusTotalIntelligenceResponse$inboundSchema: z.ZodMiniType<
194
+ VirusTotalIntelligenceResponse,
195
+ unknown
196
+ > = z.object({
197
+ data: z.lazy(() => VirusTotalIntelligenceData$inboundSchema),
198
+ success: types.boolean(),
199
+ error: types.optional(types.string()),
200
+ });
201
+
202
+ export function virusTotalIntelligenceResponseFromJSON(
203
+ jsonString: string,
204
+ ): SafeParseResult<VirusTotalIntelligenceResponse, SDKValidationError> {
205
+ return safeParse(
206
+ jsonString,
207
+ (x) => VirusTotalIntelligenceResponse$inboundSchema.parse(JSON.parse(x)),
208
+ `Failed to parse 'VirusTotalIntelligenceResponse' from JSON`,
209
+ );
210
+ }
@@ -8,6 +8,7 @@ import { infrastructureSearchDns } from "../funcs/infrastructure-search-dns.js";
8
8
  import { infrastructureSearchIpInfo } from "../funcs/infrastructure-search-ip-info.js";
9
9
  import { infrastructureSearchShodan } from "../funcs/infrastructure-search-shodan.js";
10
10
  import { infrastructureSearchWhois } from "../funcs/infrastructure-search-whois.js";
11
+ import { infrastructureVirusTotalContent } from "../funcs/infrastructure-virus-total-content.js";
11
12
  import { EventStream } from "../lib/event-streams.js";
12
13
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
13
14
  import * as operations from "../models/operations/index.js";
@@ -65,6 +66,23 @@ export class Infrastructure extends ClientSDK {
65
66
  ));
66
67
  }
67
68
 
69
+ /**
70
+ * VirusTotal Content Search
71
+ *
72
+ * @remarks
73
+ * Search VirusTotal for files whose content matches a given string.
74
+ */
75
+ async virusTotalContent(
76
+ request: operations.VirusTotalContentRequest,
77
+ options?: RequestOptions,
78
+ ): Promise<operations.VirusTotalContentResponse> {
79
+ return unwrapAsync(infrastructureVirusTotalContent(
80
+ this,
81
+ request,
82
+ options,
83
+ ));
84
+ }
85
+
68
86
  /**
69
87
  * Whois
70
88
  *
@@ -12,6 +12,7 @@ import { intelligenceSearchPerson } from "../funcs/intelligence-search-person.js
12
12
  import { intelligenceSearchPhone } from "../funcs/intelligence-search-phone.js";
13
13
  import { intelligenceSearchSeon } from "../funcs/intelligence-search-seon.js";
14
14
  import { intelligenceSearchWebDatabases } from "../funcs/intelligence-search-web-databases.js";
15
+ import { intelligenceVirusTotalIntelligence } from "../funcs/intelligence-virus-total-intelligence.js";
15
16
  import { EventStream } from "../lib/event-streams.js";
16
17
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
17
18
  import * as operations from "../models/operations/index.js";
@@ -134,6 +135,23 @@ export class Intelligence extends ClientSDK {
134
135
  ));
135
136
  }
136
137
 
138
+ /**
139
+ * VirusTotal File Intelligence
140
+ *
141
+ * @remarks
142
+ * Look up VirusTotal reputation and antivirus detection data for a URL, domain, IP address, or file hash.
143
+ */
144
+ async virusTotalIntelligence(
145
+ request: operations.VirusTotalIntelligenceRequest,
146
+ options?: RequestOptions,
147
+ ): Promise<operations.VirusTotalIntelligenceResponse> {
148
+ return unwrapAsync(intelligenceVirusTotalIntelligence(
149
+ this,
150
+ request,
151
+ options,
152
+ ));
153
+ }
154
+
137
155
  /**
138
156
  * Web Databases
139
157
  *
package/src/sdk/tools.ts CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { toolsBypassDoubleCounter } from "../funcs/tools-bypass-double-counter.js";
6
6
  import { toolsDownloadIntelxFile } from "../funcs/tools-download-intelx-file.js";
7
+ import { toolsDownloadVirusTotalFile } from "../funcs/tools-download-virus-total-file.js";
7
8
  import { toolsLookupDiscordAlt } from "../funcs/tools-lookup-discord-alt.js";
8
9
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
9
10
  import * as operations from "../models/operations/index.js";
@@ -60,4 +61,21 @@ export class Tools extends ClientSDK {
60
61
  options,
61
62
  ));
62
63
  }
64
+
65
+ /**
66
+ * Download VirusTotal file
67
+ *
68
+ * @remarks
69
+ * Download a file from VirusTotal by its id. The file is returned base64-encoded.
70
+ */
71
+ async downloadVirusTotalFile(
72
+ request: operations.DownloadVirusTotalFileRequest,
73
+ options?: RequestOptions,
74
+ ): Promise<operations.DownloadVirusTotalFileResponse> {
75
+ return unwrapAsync(toolsDownloadVirusTotalFile(
76
+ this,
77
+ request,
78
+ options,
79
+ ));
80
+ }
63
81
  }