@indiciaosint/sdk 1.1.0 → 1.2.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/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.js +3 -3
- 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.js +3 -3
- 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 +98 -0
- package/esm/models/operations/search-face.js.map +1 -1
- package/esm/models/operations/search-username.d.ts +6 -6
- package/esm/models/operations/search-username.d.ts.map +1 -1
- package/esm/models/operations/search-username.js +13 -7
- 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/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 +3 -3
- 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 +3 -3
- 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 +259 -0
- package/src/models/operations/search-username.ts +23 -15
- 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/types/discriminated-union.ts +101 -0
- package/src/types/smart-union.ts +2 -1
|
@@ -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
|
|