@indiciaosint/sdk 1.1.0 → 1.2.1

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 (205) hide show
  1. package/FUNCTIONS.md +1 -1
  2. package/README.md +53 -13
  3. package/esm/funcs/activity-delete-activity.js +3 -3
  4. package/esm/funcs/activity-delete-activity.js.map +1 -1
  5. package/esm/funcs/activity-get-activity.js +3 -3
  6. package/esm/funcs/activity-get-activity.js.map +1 -1
  7. package/esm/funcs/activity-list-activities.js +3 -3
  8. package/esm/funcs/activity-list-activities.js.map +1 -1
  9. package/esm/funcs/infrastructure-scan-ports.d.ts +2 -127
  10. package/esm/funcs/infrastructure-scan-ports.d.ts.map +1 -1
  11. package/esm/funcs/infrastructure-scan-ports.js +12 -131
  12. package/esm/funcs/infrastructure-scan-ports.js.map +1 -1
  13. package/esm/funcs/infrastructure-search-certificates.js +3 -3
  14. package/esm/funcs/infrastructure-search-certificates.js.map +1 -1
  15. package/esm/funcs/infrastructure-search-dns.js +3 -3
  16. package/esm/funcs/infrastructure-search-dns.js.map +1 -1
  17. package/esm/funcs/infrastructure-search-ip-info.js +3 -3
  18. package/esm/funcs/infrastructure-search-ip-info.js.map +1 -1
  19. package/esm/funcs/infrastructure-search-shodan.js +3 -3
  20. package/esm/funcs/infrastructure-search-shodan.js.map +1 -1
  21. package/esm/funcs/infrastructure-search-whois.js +3 -3
  22. package/esm/funcs/infrastructure-search-whois.js.map +1 -1
  23. package/esm/funcs/intelligence-geolocate-media.d.ts +2 -13
  24. package/esm/funcs/intelligence-geolocate-media.d.ts.map +1 -1
  25. package/esm/funcs/intelligence-geolocate-media.js +12 -17
  26. package/esm/funcs/intelligence-geolocate-media.js.map +1 -1
  27. package/esm/funcs/intelligence-search-address.js +3 -3
  28. package/esm/funcs/intelligence-search-address.js.map +1 -1
  29. package/esm/funcs/intelligence-search-email.js +3 -3
  30. package/esm/funcs/intelligence-search-email.js.map +1 -1
  31. package/esm/funcs/intelligence-search-face.d.ts +2 -1
  32. package/esm/funcs/intelligence-search-face.d.ts.map +1 -1
  33. package/esm/funcs/intelligence-search-face.js +12 -5
  34. package/esm/funcs/intelligence-search-face.js.map +1 -1
  35. package/esm/funcs/intelligence-search-gmail.js +3 -3
  36. package/esm/funcs/intelligence-search-gmail.js.map +1 -1
  37. package/esm/funcs/intelligence-search-hudson-rock.js +3 -3
  38. package/esm/funcs/intelligence-search-hudson-rock.js.map +1 -1
  39. package/esm/funcs/intelligence-search-person.js +3 -3
  40. package/esm/funcs/intelligence-search-person.js.map +1 -1
  41. package/esm/funcs/intelligence-search-phone.js +3 -3
  42. package/esm/funcs/intelligence-search-phone.js.map +1 -1
  43. package/esm/funcs/intelligence-search-seon.js +3 -3
  44. package/esm/funcs/intelligence-search-seon.js.map +1 -1
  45. package/esm/funcs/intelligence-search-web-databases.js +3 -3
  46. package/esm/funcs/intelligence-search-web-databases.js.map +1 -1
  47. package/esm/funcs/organizations-get-organization-audit-log.js +3 -3
  48. package/esm/funcs/organizations-get-organization-audit-log.js.map +1 -1
  49. package/esm/funcs/organizations-get-organization.js +3 -3
  50. package/esm/funcs/organizations-get-organization.js.map +1 -1
  51. package/esm/funcs/organizations-list-organization-cases.js +3 -3
  52. package/esm/funcs/organizations-list-organization-cases.js.map +1 -1
  53. package/esm/funcs/organizations-list-organization-members.js +3 -3
  54. package/esm/funcs/organizations-list-organization-members.js.map +1 -1
  55. package/esm/funcs/organizations-list-organizations.js +3 -3
  56. package/esm/funcs/organizations-list-organizations.js.map +1 -1
  57. package/esm/funcs/organizations-send-organization-credits.js +3 -3
  58. package/esm/funcs/organizations-send-organization-credits.js.map +1 -1
  59. package/esm/funcs/pricing-get-pricing.js +3 -3
  60. package/esm/funcs/pricing-get-pricing.js.map +1 -1
  61. package/esm/funcs/socials-search-discord.js +3 -3
  62. package/esm/funcs/socials-search-discord.js.map +1 -1
  63. package/esm/funcs/socials-search-github.d.ts +3 -2
  64. package/esm/funcs/socials-search-github.d.ts.map +1 -1
  65. package/esm/funcs/socials-search-github.js +14 -6
  66. package/esm/funcs/socials-search-github.js.map +1 -1
  67. package/esm/funcs/socials-search-roblox.js +3 -3
  68. package/esm/funcs/socials-search-roblox.js.map +1 -1
  69. package/esm/funcs/socials-search-tiktok.js +3 -3
  70. package/esm/funcs/socials-search-tiktok.js.map +1 -1
  71. package/esm/funcs/socials-search-username.d.ts +3 -2
  72. package/esm/funcs/socials-search-username.d.ts.map +1 -1
  73. package/esm/funcs/socials-search-username.js +14 -6
  74. package/esm/funcs/socials-search-username.js.map +1 -1
  75. package/esm/funcs/tools-bypass-double-counter.js +3 -3
  76. package/esm/funcs/tools-bypass-double-counter.js.map +1 -1
  77. package/esm/funcs/tools-download-intelx-file.js +3 -3
  78. package/esm/funcs/tools-download-intelx-file.js.map +1 -1
  79. package/esm/funcs/tools-lookup-discord-alt.js +3 -3
  80. package/esm/funcs/tools-lookup-discord-alt.js.map +1 -1
  81. package/esm/funcs/users-get-info.js +3 -3
  82. package/esm/funcs/users-get-info.js.map +1 -1
  83. package/esm/hooks/hooks.d.ts.map +1 -1
  84. package/esm/hooks/hooks.js +2 -0
  85. package/esm/hooks/hooks.js.map +1 -1
  86. package/esm/hooks/registration.d.ts +3 -0
  87. package/esm/hooks/registration.d.ts.map +1 -0
  88. package/esm/hooks/registration.js +12 -0
  89. package/esm/hooks/registration.js.map +1 -0
  90. package/esm/lib/config.d.ts +4 -4
  91. package/esm/lib/config.d.ts.map +1 -1
  92. package/esm/lib/config.js +3 -3
  93. package/esm/lib/env.d.ts +1 -1
  94. package/esm/lib/env.d.ts.map +1 -1
  95. package/esm/lib/env.js +1 -1
  96. package/esm/lib/env.js.map +1 -1
  97. package/esm/lib/event-streams.d.ts +23 -0
  98. package/esm/lib/event-streams.d.ts.map +1 -0
  99. package/esm/lib/event-streams.js +163 -0
  100. package/esm/lib/event-streams.js.map +1 -0
  101. package/esm/lib/security.js +1 -1
  102. package/esm/lib/security.js.map +1 -1
  103. package/esm/models/operations/geolocate-media.d.ts +91 -0
  104. package/esm/models/operations/geolocate-media.d.ts.map +1 -1
  105. package/esm/models/operations/geolocate-media.js +74 -0
  106. package/esm/models/operations/geolocate-media.js.map +1 -1
  107. package/esm/models/operations/scan-ports.d.ts +355 -0
  108. package/esm/models/operations/scan-ports.d.ts.map +1 -1
  109. package/esm/models/operations/scan-ports.js +473 -0
  110. package/esm/models/operations/scan-ports.js.map +1 -1
  111. package/esm/models/operations/search-face.d.ts +95 -0
  112. package/esm/models/operations/search-face.d.ts.map +1 -1
  113. package/esm/models/operations/search-face.js +97 -0
  114. package/esm/models/operations/search-face.js.map +1 -1
  115. package/esm/models/operations/search-github.d.ts +69 -7
  116. package/esm/models/operations/search-github.d.ts.map +1 -1
  117. package/esm/models/operations/search-github.js +83 -9
  118. package/esm/models/operations/search-github.js.map +1 -1
  119. package/esm/models/operations/search-username.d.ts +435 -19
  120. package/esm/models/operations/search-username.d.ts.map +1 -1
  121. package/esm/models/operations/search-username.js +738 -20
  122. package/esm/models/operations/search-username.js.map +1 -1
  123. package/esm/models/operations/search-web-databases.d.ts +4 -5
  124. package/esm/models/operations/search-web-databases.d.ts.map +1 -1
  125. package/esm/models/operations/search-web-databases.js +3 -4
  126. package/esm/models/operations/search-web-databases.js.map +1 -1
  127. package/esm/models/security.d.ts +2 -2
  128. package/esm/models/security.d.ts.map +1 -1
  129. package/esm/models/security.js +2 -2
  130. package/esm/models/security.js.map +1 -1
  131. package/esm/sdk/infrastructure.d.ts +2 -127
  132. package/esm/sdk/infrastructure.d.ts.map +1 -1
  133. package/esm/sdk/infrastructure.js +0 -126
  134. package/esm/sdk/infrastructure.js.map +1 -1
  135. package/esm/sdk/intelligence.d.ts +3 -14
  136. package/esm/sdk/intelligence.d.ts.map +1 -1
  137. package/esm/sdk/intelligence.js +0 -12
  138. package/esm/sdk/intelligence.js.map +1 -1
  139. package/esm/sdk/socials.d.ts +5 -4
  140. package/esm/sdk/socials.d.ts.map +1 -1
  141. package/esm/sdk/socials.js +2 -2
  142. package/esm/sdk/socials.js.map +1 -1
  143. package/esm/types/discriminated-union.d.ts +25 -0
  144. package/esm/types/discriminated-union.d.ts.map +1 -0
  145. package/esm/types/discriminated-union.js +61 -0
  146. package/esm/types/discriminated-union.js.map +1 -0
  147. package/esm/types/smart-union.d.ts.map +1 -1
  148. package/esm/types/smart-union.js +2 -1
  149. package/esm/types/smart-union.js.map +1 -1
  150. package/examples/usersGetInfo.example.ts +1 -1
  151. package/jsr.json +2 -1
  152. package/package.json +1 -1
  153. package/src/funcs/activity-delete-activity.ts +3 -3
  154. package/src/funcs/activity-get-activity.ts +3 -3
  155. package/src/funcs/activity-list-activities.ts +3 -3
  156. package/src/funcs/infrastructure-scan-ports.ts +21 -134
  157. package/src/funcs/infrastructure-search-certificates.ts +3 -3
  158. package/src/funcs/infrastructure-search-dns.ts +3 -3
  159. package/src/funcs/infrastructure-search-ip-info.ts +3 -3
  160. package/src/funcs/infrastructure-search-shodan.ts +3 -3
  161. package/src/funcs/infrastructure-search-whois.ts +3 -3
  162. package/src/funcs/intelligence-geolocate-media.ts +21 -20
  163. package/src/funcs/intelligence-search-address.ts +3 -3
  164. package/src/funcs/intelligence-search-email.ts +3 -3
  165. package/src/funcs/intelligence-search-face.ts +21 -8
  166. package/src/funcs/intelligence-search-gmail.ts +3 -3
  167. package/src/funcs/intelligence-search-hudson-rock.ts +3 -3
  168. package/src/funcs/intelligence-search-person.ts +3 -3
  169. package/src/funcs/intelligence-search-phone.ts +3 -3
  170. package/src/funcs/intelligence-search-seon.ts +3 -3
  171. package/src/funcs/intelligence-search-web-databases.ts +3 -3
  172. package/src/funcs/organizations-get-organization-audit-log.ts +3 -3
  173. package/src/funcs/organizations-get-organization.ts +3 -3
  174. package/src/funcs/organizations-list-organization-cases.ts +3 -3
  175. package/src/funcs/organizations-list-organization-members.ts +3 -3
  176. package/src/funcs/organizations-list-organizations.ts +3 -3
  177. package/src/funcs/organizations-send-organization-credits.ts +3 -3
  178. package/src/funcs/pricing-get-pricing.ts +3 -3
  179. package/src/funcs/socials-search-discord.ts +3 -3
  180. package/src/funcs/socials-search-github.ts +24 -9
  181. package/src/funcs/socials-search-roblox.ts +3 -3
  182. package/src/funcs/socials-search-tiktok.ts +3 -3
  183. package/src/funcs/socials-search-username.ts +26 -9
  184. package/src/funcs/tools-bypass-double-counter.ts +3 -3
  185. package/src/funcs/tools-download-intelx-file.ts +3 -3
  186. package/src/funcs/tools-lookup-discord-alt.ts +3 -3
  187. package/src/funcs/users-get-info.ts +3 -3
  188. package/src/hooks/hooks.ts +3 -0
  189. package/src/hooks/registration.ts +14 -0
  190. package/src/lib/config.ts +4 -4
  191. package/src/lib/env.ts +2 -2
  192. package/src/lib/event-streams.ts +191 -0
  193. package/src/lib/security.ts +1 -1
  194. package/src/models/operations/geolocate-media.ts +231 -0
  195. package/src/models/operations/scan-ports.ts +1223 -0
  196. package/src/models/operations/search-face.ts +261 -0
  197. package/src/models/operations/search-github.ts +225 -41
  198. package/src/models/operations/search-username.ts +1690 -92
  199. package/src/models/operations/search-web-databases.ts +9 -8
  200. package/src/models/security.ts +4 -4
  201. package/src/sdk/infrastructure.ts +2 -127
  202. package/src/sdk/intelligence.ts +3 -14
  203. package/src/sdk/socials.ts +5 -4
  204. package/src/types/discriminated-union.ts +101 -0
  205. package/src/types/smart-union.ts +2 -1
@@ -15,16 +15,17 @@ import * as types from "../../types/primitives.js";
15
15
  import { smartUnion } from "../../types/smart-union.js";
16
16
  import { SDKValidationError } from "../errors/sdk-validation-error.js";
17
17
 
18
- export const Service = {
18
+ export const SearchWebDatabasesService = {
19
19
  Cloudsint: "cloudsint",
20
20
  IntelligencexIdentityportal: "intelligencex.identityportal",
21
21
  Leakcheck: "leakcheck",
22
22
  Snusbase: "snusbase",
23
23
  } as const;
24
- export type Service = ClosedEnum<typeof Service>;
24
+ export type SearchWebDatabasesService = ClosedEnum<
25
+ typeof SearchWebDatabasesService
26
+ >;
25
27
 
26
28
  export const CloudsintType = {
27
- Discordid: "discordid",
28
29
  Email: "email",
29
30
  Ip: "ip",
30
31
  Name: "name",
@@ -74,7 +75,7 @@ export type SnusbaseType = ClosedEnum<typeof SnusbaseType>;
74
75
 
75
76
  export type SearchWebDatabasesRequest = {
76
77
  query: string;
77
- services: Array<Service>;
78
+ services: Array<SearchWebDatabasesService>;
78
79
  cloudsintType?: CloudsintType | undefined;
79
80
  intelxType?: IntelxType | undefined;
80
81
  leakCheckType?: LeakCheckType | undefined;
@@ -318,9 +319,9 @@ export type SearchWebDatabasesResponse = {
318
319
  };
319
320
 
320
321
  /** @internal */
321
- export const Service$outboundSchema: z.ZodMiniEnum<typeof Service> = z.enum(
322
- Service,
323
- );
322
+ export const SearchWebDatabasesService$outboundSchema: z.ZodMiniEnum<
323
+ typeof SearchWebDatabasesService
324
+ > = z.enum(SearchWebDatabasesService);
324
325
 
325
326
  /** @internal */
326
327
  export const CloudsintType$outboundSchema: z.ZodMiniEnum<typeof CloudsintType> =
@@ -354,7 +355,7 @@ export const SearchWebDatabasesRequest$outboundSchema: z.ZodMiniType<
354
355
  SearchWebDatabasesRequest
355
356
  > = z.object({
356
357
  query: z.string(),
357
- services: z.array(Service$outboundSchema),
358
+ services: z.array(SearchWebDatabasesService$outboundSchema),
358
359
  cloudsintType: z.optional(CloudsintType$outboundSchema),
359
360
  intelxType: z.optional(IntelxType$outboundSchema),
360
361
  leakCheckType: z.optional(LeakCheckType$outboundSchema),
@@ -6,12 +6,12 @@ import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
 
8
8
  export type Security = {
9
- apiKeyAuth?: string | undefined;
9
+ apiKey?: string | undefined;
10
10
  };
11
11
 
12
12
  /** @internal */
13
13
  export type Security$Outbound = {
14
- ApiKeyAuth?: string | undefined;
14
+ ApiKey?: string | undefined;
15
15
  };
16
16
 
17
17
  /** @internal */
@@ -20,11 +20,11 @@ export const Security$outboundSchema: z.ZodMiniType<
20
20
  Security
21
21
  > = z.pipe(
22
22
  z.object({
23
- apiKeyAuth: z.optional(z.string()),
23
+ apiKey: z.optional(z.string()),
24
24
  }),
25
25
  z.transform((v) => {
26
26
  return remap$(v, {
27
- apiKeyAuth: "ApiKeyAuth",
27
+ apiKey: "ApiKey",
28
28
  });
29
29
  }),
30
30
  );
@@ -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 { EventStream } from "../lib/event-streams.js";
11
12
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
12
13
  import * as operations from "../models/operations/index.js";
13
14
  import { unwrapAsync } from "../types/fp.js";
@@ -86,137 +87,11 @@ export class Infrastructure extends ClientSDK {
86
87
  *
87
88
  * @remarks
88
89
  * Perform a port scan on a given IP address or domain.
89
- *
90
- * Response type:
91
- * ```ts
92
- * interface NmapScanResult {
93
- * $: {
94
- * scanner: string;
95
- * args: string;
96
- * start: string;
97
- * startstr: string;
98
- * version: string;
99
- * xmloutputversion: string;
100
- * };
101
- * scaninfo: Array<{
102
- * $: {
103
- * type: string;
104
- * protocol: string;
105
- * numservices: string;
106
- * services: string;
107
- * };
108
- * }>;
109
- * verbose: Array<{ $: { level: string } }>;
110
- * debugging: Array<{ $: { level: string } }>;
111
- * taskprogress?: Array<{
112
- * $: {
113
- * task: string;
114
- * time: string;
115
- * percent: string;
116
- * remaining: string;
117
- * etc: string;
118
- * };
119
- * }>;
120
- * host?: Array<{
121
- * $: {
122
- * starttime: string;
123
- * endtime: string;
124
- * };
125
- * status: Array<{
126
- * $: {
127
- * state: string;
128
- * reason: string;
129
- * reason_ttl: string;
130
- * };
131
- * }>;
132
- * address: Array<{
133
- * $: {
134
- * addr: string;
135
- * addrtype: string;
136
- * };
137
- * }>;
138
- * hostnames?: Array<{
139
- * hostname: Array<{
140
- * $: {
141
- * name: string;
142
- * type: string;
143
- * };
144
- * }>;
145
- * }>;
146
- * ports?: Array<{
147
- * extraports?: Array<{
148
- * $: {
149
- * state: string;
150
- * count: string;
151
- * };
152
- * extrareasons: Array<{
153
- * $: {
154
- * reason: string;
155
- * count: string;
156
- * proto: string;
157
- * ports: string;
158
- * };
159
- * }>;
160
- * }>;
161
- * port?: Array<{
162
- * $: {
163
- * protocol: string;
164
- * portid: string;
165
- * };
166
- * state: Array<{
167
- * $: {
168
- * state: string;
169
- * reason: string;
170
- * reason_ttl: string;
171
- * };
172
- * }>;
173
- * service?: Array<{
174
- * $: {
175
- * name: string;
176
- * product?: string;
177
- * version?: string;
178
- * extrainfo?: string;
179
- * ostype?: string;
180
- * method: string;
181
- * conf: string;
182
- * };
183
- * cpe?: string[];
184
- * }>;
185
- * }>;
186
- * }>;
187
- * times?: Array<{
188
- * $: {
189
- * srtt: string;
190
- * rttvar: string;
191
- * to: string;
192
- * };
193
- * }>;
194
- * }>;
195
- * runstats: Array<{
196
- * finished: Array<{
197
- * $: {
198
- * time: string;
199
- * timestr: string;
200
- * summary: string;
201
- * elapsed: string;
202
- * exit: string;
203
- * };
204
- * }>;
205
- * hosts: Array<{
206
- * $: {
207
- * up: string;
208
- * down: string;
209
- * total: string;
210
- * };
211
- * }>;
212
- * }>;
213
- * }
214
- * ```
215
90
  */
216
91
  async scanPorts(
217
92
  request: operations.ScanPortsRequest,
218
93
  options?: RequestOptions,
219
- ): Promise<string> {
94
+ ): Promise<EventStream<operations.PortscanEvent>> {
220
95
  return unwrapAsync(infrastructureScanPorts(
221
96
  this,
222
97
  request,
@@ -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 { EventStream } from "../lib/event-streams.js";
15
16
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
16
17
  import * as operations from "../models/operations/index.js";
17
18
  import { unwrapAsync } from "../types/fp.js";
@@ -53,23 +54,11 @@ export class Intelligence extends ClientSDK {
53
54
  *
54
55
  * @remarks
55
56
  * Geolocate an image using AI-powered analysis. Streams progress updates via Server-Sent Events.
56
- *
57
- * Response type:
58
- *
59
- * ```ts
60
- * interface GeolocationResponse {
61
- * location: string | null;
62
- * coordinates: string | null;
63
- * certainty: string;
64
- * reasoning: string;
65
- * mapsUrl?: `https://www.google.com/maps/search/?api=1&query=${string}`;
66
- * }
67
- * ```
68
57
  */
69
58
  async geolocateMedia(
70
59
  request: operations.GeolocateMediaRequest,
71
60
  options?: RequestOptions,
72
- ): Promise<string> {
61
+ ): Promise<EventStream<operations.GeolocationEvent>> {
73
62
  return unwrapAsync(intelligenceGeolocateMedia(
74
63
  this,
75
64
  request,
@@ -171,7 +160,7 @@ export class Intelligence extends ClientSDK {
171
160
  async searchFace(
172
161
  request: operations.SearchFaceRequest,
173
162
  options?: RequestOptions,
174
- ): Promise<string> {
163
+ ): Promise<EventStream<operations.FacialSearchEvent>> {
175
164
  return unwrapAsync(intelligenceSearchFace(
176
165
  this,
177
166
  request,
@@ -7,6 +7,7 @@ import { socialsSearchGithub } from "../funcs/socials-search-github.js";
7
7
  import { socialsSearchRoblox } from "../funcs/socials-search-roblox.js";
8
8
  import { socialsSearchTiktok } from "../funcs/socials-search-tiktok.js";
9
9
  import { socialsSearchUsername } from "../funcs/socials-search-username.js";
10
+ import { EventStream } from "../lib/event-streams.js";
10
11
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
12
  import * as operations from "../models/operations/index.js";
12
13
  import { unwrapAsync } from "../types/fp.js";
@@ -33,12 +34,12 @@ export class Socials extends ClientSDK {
33
34
  * GitHub Search
34
35
  *
35
36
  * @remarks
36
- * Search GitHub profiles, info, and commit emails
37
+ * Search GitHub profiles, info, and commit emails. Streams progress updates via Server-Sent Events.
37
38
  */
38
39
  async searchGithub(
39
40
  request: operations.SearchGithubRequest,
40
41
  options?: RequestOptions,
41
- ): Promise<operations.SearchGithubResponse> {
42
+ ): Promise<EventStream<operations.GithubSearchEvent>> {
42
43
  return unwrapAsync(socialsSearchGithub(
43
44
  this,
44
45
  request,
@@ -84,12 +85,12 @@ export class Socials extends ClientSDK {
84
85
  * Username Search V2
85
86
  *
86
87
  * @remarks
87
- * Search various sites for a specific username
88
+ * Search various sites for a specific username. Streams progress updates via Server-Sent Events.
88
89
  */
89
90
  async searchUsername(
90
91
  request: operations.SearchUsernameRequest,
91
92
  options?: RequestOptions,
92
- ): Promise<operations.SearchUsernameResponse> {
93
+ ): Promise<EventStream<operations.UsernameSearchEvent>> {
93
94
  return unwrapAsync(socialsSearchUsername(
94
95
  this,
95
96
  request,
@@ -0,0 +1,101 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { startCountingDefaultToZeroValue } from "./default-to-zero-value.js";
7
+ import { startCountingUnrecognized } from "./unrecognized.js";
8
+
9
+ const UNKNOWN = Symbol("UNKNOWN");
10
+
11
+ export type Unknown<Discriminator extends string, UnknownValue = "UNKNOWN"> =
12
+ & {
13
+ [K in Discriminator]: UnknownValue;
14
+ }
15
+ & {
16
+ raw: unknown;
17
+ isUnknown: true;
18
+ };
19
+
20
+ export function isUnknown<Discriminator extends string>(
21
+ value: unknown,
22
+ ): value is Unknown<Discriminator> {
23
+ return typeof value === "object" && value !== null && UNKNOWN in value;
24
+ }
25
+
26
+ /**
27
+ * Forward-compatible discriminated union parser.
28
+ *
29
+ * If the input does not match one of the predefined options, it will be
30
+ * captured and available as `{ raw: <original input>, [discriminator]: "UNKNOWN", isUnknown: true }`.
31
+ *
32
+ * @param inputPropertyName - The discriminator property name in the input payload
33
+ * @param options - Map of discriminator values to their corresponding schemas
34
+ * @param opts - Optional configuration object
35
+ * @param opts.unknownValue - The value to use for the discriminator when the input is unknown (default: "UNKNOWN")
36
+ * @param opts.outputPropertyName - Output property name if the sanitized (camelCase) property name differs from inputPropertyName
37
+ */
38
+ export function discriminatedUnion<
39
+ InputDiscriminator extends string,
40
+ TOptions extends Readonly<Record<string, z.ZodMiniType>>,
41
+ UnknownValue extends string = "UNKNOWN",
42
+ OutputDiscriminator extends string = InputDiscriminator,
43
+ >(
44
+ inputPropertyName: InputDiscriminator,
45
+ options: TOptions,
46
+ opts: {
47
+ unknownValue?: UnknownValue;
48
+ outputPropertyName?: OutputDiscriminator;
49
+ } = {},
50
+ ): z.ZodMiniType<
51
+ | z.output<TOptions[keyof TOptions]>
52
+ | Unknown<OutputDiscriminator, UnknownValue>,
53
+ unknown
54
+ > {
55
+ const { unknownValue = "UNKNOWN" as UnknownValue, outputPropertyName } = opts;
56
+ return z.pipe(
57
+ z.unknown(),
58
+ z.transform((input) => {
59
+ const fallback = Object.defineProperties(
60
+ {
61
+ raw: input,
62
+ [outputPropertyName ?? inputPropertyName]: unknownValue,
63
+ isUnknown: true as const,
64
+ },
65
+ { [UNKNOWN]: { value: true, enumerable: false, configurable: false } },
66
+ );
67
+
68
+ const isObject = typeof input === "object" && input !== null;
69
+ if (!isObject) return fallback;
70
+
71
+ const discriminator = input[inputPropertyName as keyof typeof input];
72
+ if (typeof discriminator !== "string") return fallback;
73
+ if (!(discriminator in options)) return fallback;
74
+
75
+ const schema = options[discriminator];
76
+ if (!schema) return fallback;
77
+
78
+ // Start counters before parsing to track nested unrecognized/zeroDefault values
79
+ const unrecognizedCtr = startCountingUnrecognized();
80
+ const zeroDefaultCtr = startCountingDefaultToZeroValue();
81
+
82
+ const result = z.safeParse(schema, input);
83
+ if (!result.success) {
84
+ // Parse failed - don't propagate any counts from the failed attempt
85
+ unrecognizedCtr.end(0);
86
+ zeroDefaultCtr.end(0);
87
+ return fallback;
88
+ }
89
+
90
+ // Parse succeeded - propagate the actual counts
91
+ unrecognizedCtr.end();
92
+ zeroDefaultCtr.end();
93
+
94
+ if (outputPropertyName) {
95
+ (result.data as any)[outputPropertyName] = discriminator;
96
+ }
97
+
98
+ return result.data;
99
+ }),
100
+ ) as any;
101
+ }
@@ -5,6 +5,7 @@
5
5
  // Not needed if lax mode
6
6
  import * as z from "zod/v4-mini";
7
7
  import { startCountingDefaultToZeroValue } from "./default-to-zero-value.js";
8
+ import { isUnknown as isDiscriminatedUnionUnknown } from "./discriminated-union.js";
8
9
  import { RFCDate } from "./rfcdate.js";
9
10
  import { startCountingUnrecognized } from "./unrecognized.js";
10
11
 
@@ -118,7 +119,7 @@ function countFieldsRecursive(parsed: unknown): number {
118
119
 
119
120
  while (index < queue.length) {
120
121
  const value = queue[index++];
121
- if (value === undefined) {
122
+ if (value === undefined || isDiscriminatedUnionUnknown(value)) {
122
123
  continue;
123
124
  }
124
125