@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.
- package/FUNCTIONS.md +1 -1
- package/README.md +53 -13
- package/esm/funcs/activity-delete-activity.js +3 -3
- package/esm/funcs/activity-delete-activity.js.map +1 -1
- package/esm/funcs/activity-get-activity.js +3 -3
- package/esm/funcs/activity-get-activity.js.map +1 -1
- package/esm/funcs/activity-list-activities.js +3 -3
- package/esm/funcs/activity-list-activities.js.map +1 -1
- package/esm/funcs/infrastructure-scan-ports.d.ts +2 -127
- package/esm/funcs/infrastructure-scan-ports.d.ts.map +1 -1
- package/esm/funcs/infrastructure-scan-ports.js +12 -131
- package/esm/funcs/infrastructure-scan-ports.js.map +1 -1
- package/esm/funcs/infrastructure-search-certificates.js +3 -3
- package/esm/funcs/infrastructure-search-certificates.js.map +1 -1
- package/esm/funcs/infrastructure-search-dns.js +3 -3
- package/esm/funcs/infrastructure-search-dns.js.map +1 -1
- package/esm/funcs/infrastructure-search-ip-info.js +3 -3
- package/esm/funcs/infrastructure-search-ip-info.js.map +1 -1
- package/esm/funcs/infrastructure-search-shodan.js +3 -3
- package/esm/funcs/infrastructure-search-shodan.js.map +1 -1
- package/esm/funcs/infrastructure-search-whois.js +3 -3
- package/esm/funcs/infrastructure-search-whois.js.map +1 -1
- package/esm/funcs/intelligence-geolocate-media.d.ts +2 -13
- package/esm/funcs/intelligence-geolocate-media.d.ts.map +1 -1
- package/esm/funcs/intelligence-geolocate-media.js +12 -17
- package/esm/funcs/intelligence-geolocate-media.js.map +1 -1
- package/esm/funcs/intelligence-search-address.js +3 -3
- package/esm/funcs/intelligence-search-address.js.map +1 -1
- package/esm/funcs/intelligence-search-email.js +3 -3
- package/esm/funcs/intelligence-search-email.js.map +1 -1
- package/esm/funcs/intelligence-search-face.d.ts +2 -1
- package/esm/funcs/intelligence-search-face.d.ts.map +1 -1
- package/esm/funcs/intelligence-search-face.js +12 -5
- package/esm/funcs/intelligence-search-face.js.map +1 -1
- package/esm/funcs/intelligence-search-gmail.js +3 -3
- package/esm/funcs/intelligence-search-gmail.js.map +1 -1
- package/esm/funcs/intelligence-search-hudson-rock.js +3 -3
- package/esm/funcs/intelligence-search-hudson-rock.js.map +1 -1
- package/esm/funcs/intelligence-search-person.js +3 -3
- package/esm/funcs/intelligence-search-person.js.map +1 -1
- package/esm/funcs/intelligence-search-phone.js +3 -3
- package/esm/funcs/intelligence-search-phone.js.map +1 -1
- package/esm/funcs/intelligence-search-seon.js +3 -3
- package/esm/funcs/intelligence-search-seon.js.map +1 -1
- package/esm/funcs/intelligence-search-web-databases.js +3 -3
- package/esm/funcs/intelligence-search-web-databases.js.map +1 -1
- package/esm/funcs/organizations-get-organization-audit-log.js +3 -3
- package/esm/funcs/organizations-get-organization-audit-log.js.map +1 -1
- package/esm/funcs/organizations-get-organization.js +3 -3
- package/esm/funcs/organizations-get-organization.js.map +1 -1
- package/esm/funcs/organizations-list-organization-cases.js +3 -3
- package/esm/funcs/organizations-list-organization-cases.js.map +1 -1
- package/esm/funcs/organizations-list-organization-members.js +3 -3
- package/esm/funcs/organizations-list-organization-members.js.map +1 -1
- package/esm/funcs/organizations-list-organizations.js +3 -3
- package/esm/funcs/organizations-list-organizations.js.map +1 -1
- package/esm/funcs/organizations-send-organization-credits.js +3 -3
- package/esm/funcs/organizations-send-organization-credits.js.map +1 -1
- package/esm/funcs/pricing-get-pricing.js +3 -3
- package/esm/funcs/pricing-get-pricing.js.map +1 -1
- package/esm/funcs/socials-search-discord.js +3 -3
- package/esm/funcs/socials-search-discord.js.map +1 -1
- package/esm/funcs/socials-search-github.d.ts +3 -2
- package/esm/funcs/socials-search-github.d.ts.map +1 -1
- package/esm/funcs/socials-search-github.js +14 -6
- package/esm/funcs/socials-search-github.js.map +1 -1
- package/esm/funcs/socials-search-roblox.js +3 -3
- package/esm/funcs/socials-search-roblox.js.map +1 -1
- package/esm/funcs/socials-search-tiktok.js +3 -3
- package/esm/funcs/socials-search-tiktok.js.map +1 -1
- package/esm/funcs/socials-search-username.d.ts +3 -2
- package/esm/funcs/socials-search-username.d.ts.map +1 -1
- package/esm/funcs/socials-search-username.js +14 -6
- package/esm/funcs/socials-search-username.js.map +1 -1
- package/esm/funcs/tools-bypass-double-counter.js +3 -3
- package/esm/funcs/tools-bypass-double-counter.js.map +1 -1
- package/esm/funcs/tools-download-intelx-file.js +3 -3
- package/esm/funcs/tools-download-intelx-file.js.map +1 -1
- package/esm/funcs/tools-lookup-discord-alt.js +3 -3
- package/esm/funcs/tools-lookup-discord-alt.js.map +1 -1
- package/esm/funcs/users-get-info.js +3 -3
- package/esm/funcs/users-get-info.js.map +1 -1
- package/esm/hooks/hooks.d.ts.map +1 -1
- package/esm/hooks/hooks.js +2 -0
- package/esm/hooks/hooks.js.map +1 -1
- package/esm/hooks/registration.d.ts +3 -0
- package/esm/hooks/registration.d.ts.map +1 -0
- package/esm/hooks/registration.js +12 -0
- package/esm/hooks/registration.js.map +1 -0
- package/esm/lib/config.d.ts +4 -4
- package/esm/lib/config.d.ts.map +1 -1
- package/esm/lib/config.js +3 -3
- package/esm/lib/env.d.ts +1 -1
- package/esm/lib/env.d.ts.map +1 -1
- package/esm/lib/env.js +1 -1
- package/esm/lib/env.js.map +1 -1
- package/esm/lib/event-streams.d.ts +23 -0
- package/esm/lib/event-streams.d.ts.map +1 -0
- package/esm/lib/event-streams.js +163 -0
- package/esm/lib/event-streams.js.map +1 -0
- package/esm/lib/security.js +1 -1
- package/esm/lib/security.js.map +1 -1
- package/esm/models/operations/geolocate-media.d.ts +91 -0
- package/esm/models/operations/geolocate-media.d.ts.map +1 -1
- package/esm/models/operations/geolocate-media.js +74 -0
- package/esm/models/operations/geolocate-media.js.map +1 -1
- package/esm/models/operations/scan-ports.d.ts +355 -0
- package/esm/models/operations/scan-ports.d.ts.map +1 -1
- package/esm/models/operations/scan-ports.js +473 -0
- package/esm/models/operations/scan-ports.js.map +1 -1
- package/esm/models/operations/search-face.d.ts +95 -0
- package/esm/models/operations/search-face.d.ts.map +1 -1
- package/esm/models/operations/search-face.js +97 -0
- package/esm/models/operations/search-face.js.map +1 -1
- package/esm/models/operations/search-github.d.ts +69 -7
- package/esm/models/operations/search-github.d.ts.map +1 -1
- package/esm/models/operations/search-github.js +83 -9
- package/esm/models/operations/search-github.js.map +1 -1
- package/esm/models/operations/search-username.d.ts +435 -19
- package/esm/models/operations/search-username.d.ts.map +1 -1
- package/esm/models/operations/search-username.js +738 -20
- package/esm/models/operations/search-username.js.map +1 -1
- package/esm/models/operations/search-web-databases.d.ts +4 -5
- package/esm/models/operations/search-web-databases.d.ts.map +1 -1
- package/esm/models/operations/search-web-databases.js +3 -4
- package/esm/models/operations/search-web-databases.js.map +1 -1
- package/esm/models/security.d.ts +2 -2
- package/esm/models/security.d.ts.map +1 -1
- package/esm/models/security.js +2 -2
- package/esm/models/security.js.map +1 -1
- package/esm/sdk/infrastructure.d.ts +2 -127
- package/esm/sdk/infrastructure.d.ts.map +1 -1
- package/esm/sdk/infrastructure.js +0 -126
- package/esm/sdk/infrastructure.js.map +1 -1
- package/esm/sdk/intelligence.d.ts +3 -14
- package/esm/sdk/intelligence.d.ts.map +1 -1
- package/esm/sdk/intelligence.js +0 -12
- package/esm/sdk/intelligence.js.map +1 -1
- package/esm/sdk/socials.d.ts +5 -4
- package/esm/sdk/socials.d.ts.map +1 -1
- package/esm/sdk/socials.js +2 -2
- package/esm/sdk/socials.js.map +1 -1
- package/esm/types/discriminated-union.d.ts +25 -0
- package/esm/types/discriminated-union.d.ts.map +1 -0
- package/esm/types/discriminated-union.js +61 -0
- package/esm/types/discriminated-union.js.map +1 -0
- package/esm/types/smart-union.d.ts.map +1 -1
- package/esm/types/smart-union.js +2 -1
- package/esm/types/smart-union.js.map +1 -1
- package/examples/usersGetInfo.example.ts +1 -1
- package/jsr.json +2 -1
- package/package.json +1 -1
- package/src/funcs/activity-delete-activity.ts +3 -3
- package/src/funcs/activity-get-activity.ts +3 -3
- package/src/funcs/activity-list-activities.ts +3 -3
- package/src/funcs/infrastructure-scan-ports.ts +21 -134
- package/src/funcs/infrastructure-search-certificates.ts +3 -3
- package/src/funcs/infrastructure-search-dns.ts +3 -3
- package/src/funcs/infrastructure-search-ip-info.ts +3 -3
- package/src/funcs/infrastructure-search-shodan.ts +3 -3
- package/src/funcs/infrastructure-search-whois.ts +3 -3
- package/src/funcs/intelligence-geolocate-media.ts +21 -20
- package/src/funcs/intelligence-search-address.ts +3 -3
- package/src/funcs/intelligence-search-email.ts +3 -3
- package/src/funcs/intelligence-search-face.ts +21 -8
- package/src/funcs/intelligence-search-gmail.ts +3 -3
- package/src/funcs/intelligence-search-hudson-rock.ts +3 -3
- package/src/funcs/intelligence-search-person.ts +3 -3
- package/src/funcs/intelligence-search-phone.ts +3 -3
- package/src/funcs/intelligence-search-seon.ts +3 -3
- package/src/funcs/intelligence-search-web-databases.ts +3 -3
- package/src/funcs/organizations-get-organization-audit-log.ts +3 -3
- package/src/funcs/organizations-get-organization.ts +3 -3
- package/src/funcs/organizations-list-organization-cases.ts +3 -3
- package/src/funcs/organizations-list-organization-members.ts +3 -3
- package/src/funcs/organizations-list-organizations.ts +3 -3
- package/src/funcs/organizations-send-organization-credits.ts +3 -3
- package/src/funcs/pricing-get-pricing.ts +3 -3
- package/src/funcs/socials-search-discord.ts +3 -3
- package/src/funcs/socials-search-github.ts +24 -9
- package/src/funcs/socials-search-roblox.ts +3 -3
- package/src/funcs/socials-search-tiktok.ts +3 -3
- package/src/funcs/socials-search-username.ts +26 -9
- package/src/funcs/tools-bypass-double-counter.ts +3 -3
- package/src/funcs/tools-download-intelx-file.ts +3 -3
- package/src/funcs/tools-lookup-discord-alt.ts +3 -3
- package/src/funcs/users-get-info.ts +3 -3
- package/src/hooks/hooks.ts +3 -0
- package/src/hooks/registration.ts +14 -0
- package/src/lib/config.ts +4 -4
- package/src/lib/env.ts +2 -2
- package/src/lib/event-streams.ts +191 -0
- package/src/lib/security.ts +1 -1
- package/src/models/operations/geolocate-media.ts +231 -0
- package/src/models/operations/scan-ports.ts +1223 -0
- package/src/models/operations/search-face.ts +261 -0
- package/src/models/operations/search-github.ts +225 -41
- package/src/models/operations/search-username.ts +1690 -92
- package/src/models/operations/search-web-databases.ts +9 -8
- package/src/models/security.ts +4 -4
- package/src/sdk/infrastructure.ts +2 -127
- package/src/sdk/intelligence.ts +3 -14
- package/src/sdk/socials.ts +5 -4
- package/src/types/discriminated-union.ts +101 -0
- 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
|
|
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
|
|
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<
|
|
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
|
|
322
|
-
|
|
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(
|
|
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),
|
package/src/models/security.ts
CHANGED
|
@@ -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
|
-
|
|
9
|
+
apiKey?: string | undefined;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
/** @internal */
|
|
13
13
|
export type Security$Outbound = {
|
|
14
|
-
|
|
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
|
-
|
|
23
|
+
apiKey: z.optional(z.string()),
|
|
24
24
|
}),
|
|
25
25
|
z.transform((v) => {
|
|
26
26
|
return remap$(v, {
|
|
27
|
-
|
|
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<
|
|
94
|
+
): Promise<EventStream<operations.PortscanEvent>> {
|
|
220
95
|
return unwrapAsync(infrastructureScanPorts(
|
|
221
96
|
this,
|
|
222
97
|
request,
|
package/src/sdk/intelligence.ts
CHANGED
|
@@ -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<
|
|
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<
|
|
163
|
+
): Promise<EventStream<operations.FacialSearchEvent>> {
|
|
175
164
|
return unwrapAsync(intelligenceSearchFace(
|
|
176
165
|
this,
|
|
177
166
|
request,
|
package/src/sdk/socials.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
+
}
|
package/src/types/smart-union.ts
CHANGED
|
@@ -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
|
|