@censys/platform-sdk 0.4.3 → 0.5.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 +0 -1
- package/README.md +17 -2
- package/docs/sdks/collections/README.md +12 -6
- package/docs/sdks/globaldata/README.md +260 -6
- package/docs/sdks/threathunting/README.md +335 -0
- package/examples/globalDataSearch.example.ts +0 -1
- package/examples/package-lock.json +5 -6
- package/funcs/globalDataCreateTrackedScan.d.ts +18 -0
- package/funcs/globalDataCreateTrackedScan.d.ts.map +1 -0
- package/funcs/globalDataCreateTrackedScan.js +132 -0
- package/funcs/globalDataCreateTrackedScan.js.map +1 -0
- package/funcs/globalDataGetTrackedScan.d.ts +19 -0
- package/funcs/globalDataGetTrackedScan.d.ts.map +1 -0
- package/funcs/globalDataGetTrackedScan.js +137 -0
- package/funcs/globalDataGetTrackedScan.js.map +1 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.d.ts +19 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.d.ts.map +1 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.js +137 -0
- package/funcs/globalDataGetTrackedScanThreatHunting.js.map +1 -0
- package/funcs/threatHuntingCreateTrackedScan.d.ts +18 -0
- package/funcs/threatHuntingCreateTrackedScan.d.ts.map +1 -0
- package/funcs/threatHuntingCreateTrackedScan.js +129 -0
- package/funcs/threatHuntingCreateTrackedScan.js.map +1 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts +18 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts.map +1 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js +141 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/elasticsearch.d.ts +3 -0
- package/models/components/elasticsearch.d.ts.map +1 -1
- package/models/components/elasticsearch.js +5 -0
- package/models/components/elasticsearch.js.map +1 -1
- package/models/components/elasticsearcherrormessage.d.ts +33 -0
- package/models/components/elasticsearcherrormessage.d.ts.map +1 -0
- package/models/components/elasticsearcherrormessage.js +73 -0
- package/models/components/elasticsearcherrormessage.js.map +1 -0
- package/models/components/hostobservationrange.d.ts +39 -0
- package/models/components/hostobservationrange.d.ts.map +1 -0
- package/models/components/hostobservationrange.js +92 -0
- package/models/components/hostobservationrange.js.map +1 -0
- package/models/components/hostobservationresponse.d.ts +34 -0
- package/models/components/hostobservationresponse.d.ts.map +1 -0
- package/models/components/hostobservationresponse.js +85 -0
- package/models/components/hostobservationresponse.js.map +1 -0
- package/models/components/httpfavicon.d.ts +5 -0
- package/models/components/httpfavicon.d.ts.map +1 -1
- package/models/components/httpfavicon.js +4 -0
- package/models/components/httpfavicon.js.map +1 -1
- package/models/components/index.d.ts +14 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +14 -0
- package/models/components/index.js.map +1 -1
- package/models/components/responseenvelopehostobservationresponse.d.ts +30 -0
- package/models/components/responseenvelopehostobservationresponse.d.ts.map +1 -0
- package/models/components/responseenvelopehostobservationresponse.js +70 -0
- package/models/components/responseenvelopehostobservationresponse.js.map +1 -0
- package/models/components/responseenvelopetrackedscan.d.ts +30 -0
- package/models/components/responseenvelopetrackedscan.d.ts.map +1 -0
- package/models/components/responseenvelopetrackedscan.js +70 -0
- package/models/components/responseenvelopetrackedscan.js.map +1 -0
- package/models/components/scansdiscoveryinputbody.d.ts +172 -0
- package/models/components/scansdiscoveryinputbody.d.ts.map +1 -0
- package/models/components/scansdiscoveryinputbody.js +233 -0
- package/models/components/scansdiscoveryinputbody.js.map +1 -0
- package/models/components/scansrescaninputbody.d.ts +214 -0
- package/models/components/scansrescaninputbody.d.ts.map +1 -0
- package/models/components/scansrescaninputbody.js +268 -0
- package/models/components/scansrescaninputbody.js.map +1 -0
- package/models/components/screenshot.d.ts +2 -0
- package/models/components/screenshot.d.ts.map +1 -1
- package/models/components/screenshot.js +11 -0
- package/models/components/screenshot.js.map +1 -1
- package/models/components/searchaggregateinputbody.d.ts +5 -0
- package/models/components/searchaggregateinputbody.d.ts.map +1 -1
- package/models/components/searchaggregateinputbody.js +4 -0
- package/models/components/searchaggregateinputbody.js.map +1 -1
- package/models/components/searchvaluecountsinputbody.d.ts +5 -0
- package/models/components/searchvaluecountsinputbody.d.ts.map +1 -1
- package/models/components/searchvaluecountsinputbody.js +2 -0
- package/models/components/searchvaluecountsinputbody.js.map +1 -1
- package/models/components/serviceid.d.ts +70 -0
- package/models/components/serviceid.d.ts.map +1 -0
- package/models/components/serviceid.js +106 -0
- package/models/components/serviceid.js.map +1 -0
- package/models/components/trackedscan.d.ts +39 -0
- package/models/components/trackedscan.d.ts.map +1 -0
- package/models/components/trackedscan.js +90 -0
- package/models/components/trackedscan.js.map +1 -0
- package/models/components/trackedscanscantarget.d.ts +39 -0
- package/models/components/trackedscanscantarget.d.ts.map +1 -0
- package/models/components/trackedscanscantarget.js +94 -0
- package/models/components/trackedscanscantarget.js.map +1 -0
- package/models/components/trackedscanscantargethostnameport.d.ts +31 -0
- package/models/components/trackedscanscantargethostnameport.d.ts.map +1 -0
- package/models/components/trackedscanscantargethostnameport.js +71 -0
- package/models/components/trackedscanscantargethostnameport.js.map +1 -0
- package/models/components/trackedscanscantargethostport.d.ts +31 -0
- package/models/components/trackedscanscantargethostport.d.ts.map +1 -0
- package/models/components/trackedscanscantargethostport.js +71 -0
- package/models/components/trackedscanscantargethostport.js.map +1 -0
- package/models/components/trackedscantask.d.ts +74 -0
- package/models/components/trackedscantask.d.ts.map +1 -0
- package/models/components/trackedscantask.js +106 -0
- package/models/components/trackedscantask.js.map +1 -0
- package/models/components/weborigin.d.ts +31 -0
- package/models/components/weborigin.d.ts.map +1 -0
- package/models/components/weborigin.js +71 -0
- package/models/components/weborigin.js.map +1 -0
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/v3globaldatascansget.d.ts +94 -0
- package/models/operations/v3globaldatascansget.d.ts.map +1 -0
- package/models/operations/v3globaldatascansget.js +157 -0
- package/models/operations/v3globaldatascansget.js.map +1 -0
- package/models/operations/v3globaldatascansrescan.d.ts +91 -0
- package/models/operations/v3globaldatascansrescan.d.ts.map +1 -0
- package/models/operations/v3globaldatascansrescan.js +157 -0
- package/models/operations/v3globaldatascansrescan.js.map +1 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts +124 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts.map +1 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.js +183 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.js.map +1 -0
- package/models/operations/v3threathuntingscansdiscovery.d.ts +91 -0
- package/models/operations/v3threathuntingscansdiscovery.d.ts.map +1 -0
- package/models/operations/v3threathuntingscansdiscovery.js +157 -0
- package/models/operations/v3threathuntingscansdiscovery.js.map +1 -0
- package/models/operations/v3threathuntingscansget.d.ts +94 -0
- package/models/operations/v3threathuntingscansget.d.ts.map +1 -0
- package/models/operations/v3threathuntingscansget.js +157 -0
- package/models/operations/v3threathuntingscansget.js.map +1 -0
- package/package.json +4 -5
- package/sdk/globaldata.d.ts +23 -0
- package/sdk/globaldata.d.ts.map +1 -1
- package/sdk/globaldata.js +32 -0
- package/sdk/globaldata.js.map +1 -1
- package/sdk/threathunting.d.ts +30 -0
- package/sdk/threathunting.d.ts.map +1 -1
- package/sdk/threathunting.js +42 -0
- package/sdk/threathunting.js.map +1 -1
- package/src/funcs/globalDataCreateTrackedScan.ts +185 -0
- package/src/funcs/globalDataGetTrackedScan.ts +191 -0
- package/src/funcs/globalDataGetTrackedScanThreatHunting.ts +191 -0
- package/src/funcs/threatHuntingCreateTrackedScan.ts +188 -0
- package/src/funcs/threatHuntingGetHostObservationsWithCertificate.ts +201 -0
- package/src/lib/config.ts +4 -4
- package/src/models/components/elasticsearch.ts +12 -0
- package/src/models/components/elasticsearcherrormessage.ts +74 -0
- package/src/models/components/hostobservationrange.ts +99 -0
- package/src/models/components/hostobservationresponse.ts +91 -0
- package/src/models/components/httpfavicon.ts +9 -0
- package/src/models/components/index.ts +14 -0
- package/src/models/components/responseenvelopehostobservationresponse.ts +83 -0
- package/src/models/components/responseenvelopetrackedscan.ts +74 -0
- package/src/models/components/scansdiscoveryinputbody.ts +385 -0
- package/src/models/components/scansrescaninputbody.ts +428 -0
- package/src/models/components/screenshot.ts +13 -0
- package/src/models/components/searchaggregateinputbody.ts +9 -0
- package/src/models/components/searchvaluecountsinputbody.ts +7 -0
- package/src/models/components/serviceid.ts +116 -0
- package/src/models/components/trackedscan.ts +101 -0
- package/src/models/components/trackedscanscantarget.ts +117 -0
- package/src/models/components/trackedscanscantargethostnameport.ts +73 -0
- package/src/models/components/trackedscanscantargethostport.ts +72 -0
- package/src/models/components/trackedscantask.ts +114 -0
- package/src/models/components/weborigin.ts +66 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/v3globaldatascansget.ts +232 -0
- package/src/models/operations/v3globaldatascansrescan.ts +229 -0
- package/src/models/operations/v3threathuntinggethostobservationswithcertificate.ts +315 -0
- package/src/models/operations/v3threathuntingscansdiscovery.ts +238 -0
- package/src/models/operations/v3threathuntingscansget.ts +232 -0
- package/src/sdk/globaldata.ts +56 -0
- package/src/sdk/threathunting.ts +77 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type TargetWebOrigin = {
|
|
13
|
+
/**
|
|
14
|
+
* Hostname of the web origin
|
|
15
|
+
*/
|
|
16
|
+
hostname: string;
|
|
17
|
+
/**
|
|
18
|
+
* Port number of the web origin
|
|
19
|
+
*/
|
|
20
|
+
port: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Rescan of known web property
|
|
25
|
+
*/
|
|
26
|
+
export type Two = {
|
|
27
|
+
webOrigin: TargetWebOrigin;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const TargetTransportProtocol = {
|
|
31
|
+
Unknown: "unknown",
|
|
32
|
+
Tcp: "tcp",
|
|
33
|
+
Udp: "udp",
|
|
34
|
+
Icmp: "icmp",
|
|
35
|
+
Quic: "quic",
|
|
36
|
+
} as const;
|
|
37
|
+
export type TargetTransportProtocol = ClosedEnum<
|
|
38
|
+
typeof TargetTransportProtocol
|
|
39
|
+
>;
|
|
40
|
+
|
|
41
|
+
export type TargetServiceId = {
|
|
42
|
+
/**
|
|
43
|
+
* IP address of service
|
|
44
|
+
*/
|
|
45
|
+
ip: string;
|
|
46
|
+
/**
|
|
47
|
+
* Port number of service
|
|
48
|
+
*/
|
|
49
|
+
port: number;
|
|
50
|
+
/**
|
|
51
|
+
* Name of service protocol
|
|
52
|
+
*/
|
|
53
|
+
protocol: string;
|
|
54
|
+
transportProtocol: TargetTransportProtocol;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Rescan of known service
|
|
59
|
+
*/
|
|
60
|
+
export type One = {
|
|
61
|
+
serviceId: TargetServiceId;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type ScansRescanInputBodyTarget = One | Two;
|
|
65
|
+
|
|
66
|
+
export type ScansRescanInputBody = {
|
|
67
|
+
target: One | Two;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const TargetWebOrigin$inboundSchema: z.ZodType<
|
|
72
|
+
TargetWebOrigin,
|
|
73
|
+
z.ZodTypeDef,
|
|
74
|
+
unknown
|
|
75
|
+
> = z.object({
|
|
76
|
+
hostname: z.string(),
|
|
77
|
+
port: z.number().int(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export type TargetWebOrigin$Outbound = {
|
|
82
|
+
hostname: string;
|
|
83
|
+
port: number;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const TargetWebOrigin$outboundSchema: z.ZodType<
|
|
88
|
+
TargetWebOrigin$Outbound,
|
|
89
|
+
z.ZodTypeDef,
|
|
90
|
+
TargetWebOrigin
|
|
91
|
+
> = z.object({
|
|
92
|
+
hostname: z.string(),
|
|
93
|
+
port: z.number().int(),
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
99
|
+
*/
|
|
100
|
+
export namespace TargetWebOrigin$ {
|
|
101
|
+
/** @deprecated use `TargetWebOrigin$inboundSchema` instead. */
|
|
102
|
+
export const inboundSchema = TargetWebOrigin$inboundSchema;
|
|
103
|
+
/** @deprecated use `TargetWebOrigin$outboundSchema` instead. */
|
|
104
|
+
export const outboundSchema = TargetWebOrigin$outboundSchema;
|
|
105
|
+
/** @deprecated use `TargetWebOrigin$Outbound` instead. */
|
|
106
|
+
export type Outbound = TargetWebOrigin$Outbound;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function targetWebOriginToJSON(
|
|
110
|
+
targetWebOrigin: TargetWebOrigin,
|
|
111
|
+
): string {
|
|
112
|
+
return JSON.stringify(TargetWebOrigin$outboundSchema.parse(targetWebOrigin));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function targetWebOriginFromJSON(
|
|
116
|
+
jsonString: string,
|
|
117
|
+
): SafeParseResult<TargetWebOrigin, SDKValidationError> {
|
|
118
|
+
return safeParse(
|
|
119
|
+
jsonString,
|
|
120
|
+
(x) => TargetWebOrigin$inboundSchema.parse(JSON.parse(x)),
|
|
121
|
+
`Failed to parse 'TargetWebOrigin' from JSON`,
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** @internal */
|
|
126
|
+
export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z
|
|
127
|
+
.object({
|
|
128
|
+
web_origin: z.lazy(() => TargetWebOrigin$inboundSchema),
|
|
129
|
+
}).transform((v) => {
|
|
130
|
+
return remap$(v, {
|
|
131
|
+
"web_origin": "webOrigin",
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
/** @internal */
|
|
136
|
+
export type Two$Outbound = {
|
|
137
|
+
web_origin: TargetWebOrigin$Outbound;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
|
|
142
|
+
.object({
|
|
143
|
+
webOrigin: z.lazy(() => TargetWebOrigin$outboundSchema),
|
|
144
|
+
}).transform((v) => {
|
|
145
|
+
return remap$(v, {
|
|
146
|
+
webOrigin: "web_origin",
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @internal
|
|
152
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
153
|
+
*/
|
|
154
|
+
export namespace Two$ {
|
|
155
|
+
/** @deprecated use `Two$inboundSchema` instead. */
|
|
156
|
+
export const inboundSchema = Two$inboundSchema;
|
|
157
|
+
/** @deprecated use `Two$outboundSchema` instead. */
|
|
158
|
+
export const outboundSchema = Two$outboundSchema;
|
|
159
|
+
/** @deprecated use `Two$Outbound` instead. */
|
|
160
|
+
export type Outbound = Two$Outbound;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function twoToJSON(two: Two): string {
|
|
164
|
+
return JSON.stringify(Two$outboundSchema.parse(two));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function twoFromJSON(
|
|
168
|
+
jsonString: string,
|
|
169
|
+
): SafeParseResult<Two, SDKValidationError> {
|
|
170
|
+
return safeParse(
|
|
171
|
+
jsonString,
|
|
172
|
+
(x) => Two$inboundSchema.parse(JSON.parse(x)),
|
|
173
|
+
`Failed to parse 'Two' from JSON`,
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** @internal */
|
|
178
|
+
export const TargetTransportProtocol$inboundSchema: z.ZodNativeEnum<
|
|
179
|
+
typeof TargetTransportProtocol
|
|
180
|
+
> = z.nativeEnum(TargetTransportProtocol);
|
|
181
|
+
|
|
182
|
+
/** @internal */
|
|
183
|
+
export const TargetTransportProtocol$outboundSchema: z.ZodNativeEnum<
|
|
184
|
+
typeof TargetTransportProtocol
|
|
185
|
+
> = TargetTransportProtocol$inboundSchema;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
190
|
+
*/
|
|
191
|
+
export namespace TargetTransportProtocol$ {
|
|
192
|
+
/** @deprecated use `TargetTransportProtocol$inboundSchema` instead. */
|
|
193
|
+
export const inboundSchema = TargetTransportProtocol$inboundSchema;
|
|
194
|
+
/** @deprecated use `TargetTransportProtocol$outboundSchema` instead. */
|
|
195
|
+
export const outboundSchema = TargetTransportProtocol$outboundSchema;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** @internal */
|
|
199
|
+
export const TargetServiceId$inboundSchema: z.ZodType<
|
|
200
|
+
TargetServiceId,
|
|
201
|
+
z.ZodTypeDef,
|
|
202
|
+
unknown
|
|
203
|
+
> = z.object({
|
|
204
|
+
ip: z.string(),
|
|
205
|
+
port: z.number().int(),
|
|
206
|
+
protocol: z.string(),
|
|
207
|
+
transport_protocol: TargetTransportProtocol$inboundSchema,
|
|
208
|
+
}).transform((v) => {
|
|
209
|
+
return remap$(v, {
|
|
210
|
+
"transport_protocol": "transportProtocol",
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
/** @internal */
|
|
215
|
+
export type TargetServiceId$Outbound = {
|
|
216
|
+
ip: string;
|
|
217
|
+
port: number;
|
|
218
|
+
protocol: string;
|
|
219
|
+
transport_protocol: string;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/** @internal */
|
|
223
|
+
export const TargetServiceId$outboundSchema: z.ZodType<
|
|
224
|
+
TargetServiceId$Outbound,
|
|
225
|
+
z.ZodTypeDef,
|
|
226
|
+
TargetServiceId
|
|
227
|
+
> = z.object({
|
|
228
|
+
ip: z.string(),
|
|
229
|
+
port: z.number().int(),
|
|
230
|
+
protocol: z.string(),
|
|
231
|
+
transportProtocol: TargetTransportProtocol$outboundSchema,
|
|
232
|
+
}).transform((v) => {
|
|
233
|
+
return remap$(v, {
|
|
234
|
+
transportProtocol: "transport_protocol",
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @internal
|
|
240
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
241
|
+
*/
|
|
242
|
+
export namespace TargetServiceId$ {
|
|
243
|
+
/** @deprecated use `TargetServiceId$inboundSchema` instead. */
|
|
244
|
+
export const inboundSchema = TargetServiceId$inboundSchema;
|
|
245
|
+
/** @deprecated use `TargetServiceId$outboundSchema` instead. */
|
|
246
|
+
export const outboundSchema = TargetServiceId$outboundSchema;
|
|
247
|
+
/** @deprecated use `TargetServiceId$Outbound` instead. */
|
|
248
|
+
export type Outbound = TargetServiceId$Outbound;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export function targetServiceIdToJSON(
|
|
252
|
+
targetServiceId: TargetServiceId,
|
|
253
|
+
): string {
|
|
254
|
+
return JSON.stringify(TargetServiceId$outboundSchema.parse(targetServiceId));
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export function targetServiceIdFromJSON(
|
|
258
|
+
jsonString: string,
|
|
259
|
+
): SafeParseResult<TargetServiceId, SDKValidationError> {
|
|
260
|
+
return safeParse(
|
|
261
|
+
jsonString,
|
|
262
|
+
(x) => TargetServiceId$inboundSchema.parse(JSON.parse(x)),
|
|
263
|
+
`Failed to parse 'TargetServiceId' from JSON`,
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** @internal */
|
|
268
|
+
export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
|
|
269
|
+
.object({
|
|
270
|
+
service_id: z.lazy(() => TargetServiceId$inboundSchema),
|
|
271
|
+
}).transform((v) => {
|
|
272
|
+
return remap$(v, {
|
|
273
|
+
"service_id": "serviceId",
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
/** @internal */
|
|
278
|
+
export type One$Outbound = {
|
|
279
|
+
service_id: TargetServiceId$Outbound;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/** @internal */
|
|
283
|
+
export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
|
|
284
|
+
.object({
|
|
285
|
+
serviceId: z.lazy(() => TargetServiceId$outboundSchema),
|
|
286
|
+
}).transform((v) => {
|
|
287
|
+
return remap$(v, {
|
|
288
|
+
serviceId: "service_id",
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @internal
|
|
294
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
295
|
+
*/
|
|
296
|
+
export namespace One$ {
|
|
297
|
+
/** @deprecated use `One$inboundSchema` instead. */
|
|
298
|
+
export const inboundSchema = One$inboundSchema;
|
|
299
|
+
/** @deprecated use `One$outboundSchema` instead. */
|
|
300
|
+
export const outboundSchema = One$outboundSchema;
|
|
301
|
+
/** @deprecated use `One$Outbound` instead. */
|
|
302
|
+
export type Outbound = One$Outbound;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export function oneToJSON(one: One): string {
|
|
306
|
+
return JSON.stringify(One$outboundSchema.parse(one));
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export function oneFromJSON(
|
|
310
|
+
jsonString: string,
|
|
311
|
+
): SafeParseResult<One, SDKValidationError> {
|
|
312
|
+
return safeParse(
|
|
313
|
+
jsonString,
|
|
314
|
+
(x) => One$inboundSchema.parse(JSON.parse(x)),
|
|
315
|
+
`Failed to parse 'One' from JSON`,
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** @internal */
|
|
320
|
+
export const ScansRescanInputBodyTarget$inboundSchema: z.ZodType<
|
|
321
|
+
ScansRescanInputBodyTarget,
|
|
322
|
+
z.ZodTypeDef,
|
|
323
|
+
unknown
|
|
324
|
+
> = z.union([z.lazy(() => One$inboundSchema), z.lazy(() => Two$inboundSchema)]);
|
|
325
|
+
|
|
326
|
+
/** @internal */
|
|
327
|
+
export type ScansRescanInputBodyTarget$Outbound = One$Outbound | Two$Outbound;
|
|
328
|
+
|
|
329
|
+
/** @internal */
|
|
330
|
+
export const ScansRescanInputBodyTarget$outboundSchema: z.ZodType<
|
|
331
|
+
ScansRescanInputBodyTarget$Outbound,
|
|
332
|
+
z.ZodTypeDef,
|
|
333
|
+
ScansRescanInputBodyTarget
|
|
334
|
+
> = z.union([
|
|
335
|
+
z.lazy(() => One$outboundSchema),
|
|
336
|
+
z.lazy(() => Two$outboundSchema),
|
|
337
|
+
]);
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @internal
|
|
341
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
342
|
+
*/
|
|
343
|
+
export namespace ScansRescanInputBodyTarget$ {
|
|
344
|
+
/** @deprecated use `ScansRescanInputBodyTarget$inboundSchema` instead. */
|
|
345
|
+
export const inboundSchema = ScansRescanInputBodyTarget$inboundSchema;
|
|
346
|
+
/** @deprecated use `ScansRescanInputBodyTarget$outboundSchema` instead. */
|
|
347
|
+
export const outboundSchema = ScansRescanInputBodyTarget$outboundSchema;
|
|
348
|
+
/** @deprecated use `ScansRescanInputBodyTarget$Outbound` instead. */
|
|
349
|
+
export type Outbound = ScansRescanInputBodyTarget$Outbound;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function scansRescanInputBodyTargetToJSON(
|
|
353
|
+
scansRescanInputBodyTarget: ScansRescanInputBodyTarget,
|
|
354
|
+
): string {
|
|
355
|
+
return JSON.stringify(
|
|
356
|
+
ScansRescanInputBodyTarget$outboundSchema.parse(scansRescanInputBodyTarget),
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export function scansRescanInputBodyTargetFromJSON(
|
|
361
|
+
jsonString: string,
|
|
362
|
+
): SafeParseResult<ScansRescanInputBodyTarget, SDKValidationError> {
|
|
363
|
+
return safeParse(
|
|
364
|
+
jsonString,
|
|
365
|
+
(x) => ScansRescanInputBodyTarget$inboundSchema.parse(JSON.parse(x)),
|
|
366
|
+
`Failed to parse 'ScansRescanInputBodyTarget' from JSON`,
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** @internal */
|
|
371
|
+
export const ScansRescanInputBody$inboundSchema: z.ZodType<
|
|
372
|
+
ScansRescanInputBody,
|
|
373
|
+
z.ZodTypeDef,
|
|
374
|
+
unknown
|
|
375
|
+
> = z.object({
|
|
376
|
+
target: z.union([
|
|
377
|
+
z.lazy(() => One$inboundSchema),
|
|
378
|
+
z.lazy(() => Two$inboundSchema),
|
|
379
|
+
]),
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
/** @internal */
|
|
383
|
+
export type ScansRescanInputBody$Outbound = {
|
|
384
|
+
target: One$Outbound | Two$Outbound;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
/** @internal */
|
|
388
|
+
export const ScansRescanInputBody$outboundSchema: z.ZodType<
|
|
389
|
+
ScansRescanInputBody$Outbound,
|
|
390
|
+
z.ZodTypeDef,
|
|
391
|
+
ScansRescanInputBody
|
|
392
|
+
> = z.object({
|
|
393
|
+
target: z.union([
|
|
394
|
+
z.lazy(() => One$outboundSchema),
|
|
395
|
+
z.lazy(() => Two$outboundSchema),
|
|
396
|
+
]),
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* @internal
|
|
401
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
402
|
+
*/
|
|
403
|
+
export namespace ScansRescanInputBody$ {
|
|
404
|
+
/** @deprecated use `ScansRescanInputBody$inboundSchema` instead. */
|
|
405
|
+
export const inboundSchema = ScansRescanInputBody$inboundSchema;
|
|
406
|
+
/** @deprecated use `ScansRescanInputBody$outboundSchema` instead. */
|
|
407
|
+
export const outboundSchema = ScansRescanInputBody$outboundSchema;
|
|
408
|
+
/** @deprecated use `ScansRescanInputBody$Outbound` instead. */
|
|
409
|
+
export type Outbound = ScansRescanInputBody$Outbound;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export function scansRescanInputBodyToJSON(
|
|
413
|
+
scansRescanInputBody: ScansRescanInputBody,
|
|
414
|
+
): string {
|
|
415
|
+
return JSON.stringify(
|
|
416
|
+
ScansRescanInputBody$outboundSchema.parse(scansRescanInputBody),
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export function scansRescanInputBodyFromJSON(
|
|
421
|
+
jsonString: string,
|
|
422
|
+
): SafeParseResult<ScansRescanInputBody, SDKValidationError> {
|
|
423
|
+
return safeParse(
|
|
424
|
+
jsonString,
|
|
425
|
+
(x) => ScansRescanInputBody$inboundSchema.parse(JSON.parse(x)),
|
|
426
|
+
`Failed to parse 'ScansRescanInputBody' from JSON`,
|
|
427
|
+
);
|
|
428
|
+
}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
10
|
|
|
10
11
|
export type Screenshot = {
|
|
12
|
+
extractedText?: string | undefined;
|
|
11
13
|
handle?: string | undefined;
|
|
12
14
|
};
|
|
13
15
|
|
|
@@ -17,11 +19,17 @@ export const Screenshot$inboundSchema: z.ZodType<
|
|
|
17
19
|
z.ZodTypeDef,
|
|
18
20
|
unknown
|
|
19
21
|
> = z.object({
|
|
22
|
+
extracted_text: z.string().optional(),
|
|
20
23
|
handle: z.string().optional(),
|
|
24
|
+
}).transform((v) => {
|
|
25
|
+
return remap$(v, {
|
|
26
|
+
"extracted_text": "extractedText",
|
|
27
|
+
});
|
|
21
28
|
});
|
|
22
29
|
|
|
23
30
|
/** @internal */
|
|
24
31
|
export type Screenshot$Outbound = {
|
|
32
|
+
extracted_text?: string | undefined;
|
|
25
33
|
handle?: string | undefined;
|
|
26
34
|
};
|
|
27
35
|
|
|
@@ -31,7 +39,12 @@ export const Screenshot$outboundSchema: z.ZodType<
|
|
|
31
39
|
z.ZodTypeDef,
|
|
32
40
|
Screenshot
|
|
33
41
|
> = z.object({
|
|
42
|
+
extractedText: z.string().optional(),
|
|
34
43
|
handle: z.string().optional(),
|
|
44
|
+
}).transform((v) => {
|
|
45
|
+
return remap$(v, {
|
|
46
|
+
extractedText: "extracted_text",
|
|
47
|
+
});
|
|
35
48
|
});
|
|
36
49
|
|
|
37
50
|
/**
|
|
@@ -9,6 +9,10 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
export type SearchAggregateInputBody = {
|
|
12
|
+
/**
|
|
13
|
+
* Specifies which document level's count is returned per term bucket, primarily for nested fields. This is the same functionality available in the Count By dropdown in the Report Builder UI. When aggregating on nested fields like 'host.services.port': empty string (default) counts documents at the deepest level containing the field; '.' counts root documents (e.g. counts matching 'host'); 'host.services' counts documents at the specified nested level.
|
|
14
|
+
*/
|
|
15
|
+
countByLevel?: string | undefined;
|
|
12
16
|
/**
|
|
13
17
|
* field to aggregate by
|
|
14
18
|
*/
|
|
@@ -33,12 +37,14 @@ export const SearchAggregateInputBody$inboundSchema: z.ZodType<
|
|
|
33
37
|
z.ZodTypeDef,
|
|
34
38
|
unknown
|
|
35
39
|
> = z.object({
|
|
40
|
+
count_by_level: z.string().optional(),
|
|
36
41
|
field: z.string(),
|
|
37
42
|
filter_by_query: z.boolean().default(false),
|
|
38
43
|
number_of_buckets: z.number().int(),
|
|
39
44
|
query: z.string(),
|
|
40
45
|
}).transform((v) => {
|
|
41
46
|
return remap$(v, {
|
|
47
|
+
"count_by_level": "countByLevel",
|
|
42
48
|
"filter_by_query": "filterByQuery",
|
|
43
49
|
"number_of_buckets": "numberOfBuckets",
|
|
44
50
|
});
|
|
@@ -46,6 +52,7 @@ export const SearchAggregateInputBody$inboundSchema: z.ZodType<
|
|
|
46
52
|
|
|
47
53
|
/** @internal */
|
|
48
54
|
export type SearchAggregateInputBody$Outbound = {
|
|
55
|
+
count_by_level?: string | undefined;
|
|
49
56
|
field: string;
|
|
50
57
|
filter_by_query: boolean;
|
|
51
58
|
number_of_buckets: number;
|
|
@@ -58,12 +65,14 @@ export const SearchAggregateInputBody$outboundSchema: z.ZodType<
|
|
|
58
65
|
z.ZodTypeDef,
|
|
59
66
|
SearchAggregateInputBody
|
|
60
67
|
> = z.object({
|
|
68
|
+
countByLevel: z.string().optional(),
|
|
61
69
|
field: z.string(),
|
|
62
70
|
filterByQuery: z.boolean().default(false),
|
|
63
71
|
numberOfBuckets: z.number().int(),
|
|
64
72
|
query: z.string(),
|
|
65
73
|
}).transform((v) => {
|
|
66
74
|
return remap$(v, {
|
|
75
|
+
countByLevel: "count_by_level",
|
|
67
76
|
filterByQuery: "filter_by_query",
|
|
68
77
|
numberOfBuckets: "number_of_buckets",
|
|
69
78
|
});
|
|
@@ -19,6 +19,10 @@ export type SearchValueCountsInputBody = {
|
|
|
19
19
|
* Groups of field-value pairs to count matches for.
|
|
20
20
|
*/
|
|
21
21
|
andCountConditions: Array<CountCondition> | null;
|
|
22
|
+
/**
|
|
23
|
+
* CenQL query string to filter documents
|
|
24
|
+
*/
|
|
25
|
+
query?: string | undefined;
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
/** @internal */
|
|
@@ -28,6 +32,7 @@ export const SearchValueCountsInputBody$inboundSchema: z.ZodType<
|
|
|
28
32
|
unknown
|
|
29
33
|
> = z.object({
|
|
30
34
|
and_count_conditions: z.nullable(z.array(CountCondition$inboundSchema)),
|
|
35
|
+
query: z.string().optional(),
|
|
31
36
|
}).transform((v) => {
|
|
32
37
|
return remap$(v, {
|
|
33
38
|
"and_count_conditions": "andCountConditions",
|
|
@@ -37,6 +42,7 @@ export const SearchValueCountsInputBody$inboundSchema: z.ZodType<
|
|
|
37
42
|
/** @internal */
|
|
38
43
|
export type SearchValueCountsInputBody$Outbound = {
|
|
39
44
|
and_count_conditions: Array<CountCondition$Outbound> | null;
|
|
45
|
+
query?: string | undefined;
|
|
40
46
|
};
|
|
41
47
|
|
|
42
48
|
/** @internal */
|
|
@@ -46,6 +52,7 @@ export const SearchValueCountsInputBody$outboundSchema: z.ZodType<
|
|
|
46
52
|
SearchValueCountsInputBody
|
|
47
53
|
> = z.object({
|
|
48
54
|
andCountConditions: z.nullable(z.array(CountCondition$outboundSchema)),
|
|
55
|
+
query: z.string().optional(),
|
|
49
56
|
}).transform((v) => {
|
|
50
57
|
return remap$(v, {
|
|
51
58
|
andCountConditions: "and_count_conditions",
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const ServiceIdTransportProtocol = {
|
|
13
|
+
Unknown: "",
|
|
14
|
+
Tcp: "tcp",
|
|
15
|
+
Udp: "udp",
|
|
16
|
+
Icmp: "icmp",
|
|
17
|
+
Quic: "quic",
|
|
18
|
+
} as const;
|
|
19
|
+
export type ServiceIdTransportProtocol = ClosedEnum<
|
|
20
|
+
typeof ServiceIdTransportProtocol
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
export type ServiceId = {
|
|
24
|
+
ip?: string | undefined;
|
|
25
|
+
port?: number | undefined;
|
|
26
|
+
protocol?: string | undefined;
|
|
27
|
+
transportProtocol?: ServiceIdTransportProtocol | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const ServiceIdTransportProtocol$inboundSchema: z.ZodNativeEnum<
|
|
32
|
+
typeof ServiceIdTransportProtocol
|
|
33
|
+
> = z.nativeEnum(ServiceIdTransportProtocol);
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const ServiceIdTransportProtocol$outboundSchema: z.ZodNativeEnum<
|
|
37
|
+
typeof ServiceIdTransportProtocol
|
|
38
|
+
> = ServiceIdTransportProtocol$inboundSchema;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
43
|
+
*/
|
|
44
|
+
export namespace ServiceIdTransportProtocol$ {
|
|
45
|
+
/** @deprecated use `ServiceIdTransportProtocol$inboundSchema` instead. */
|
|
46
|
+
export const inboundSchema = ServiceIdTransportProtocol$inboundSchema;
|
|
47
|
+
/** @deprecated use `ServiceIdTransportProtocol$outboundSchema` instead. */
|
|
48
|
+
export const outboundSchema = ServiceIdTransportProtocol$outboundSchema;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const ServiceId$inboundSchema: z.ZodType<
|
|
53
|
+
ServiceId,
|
|
54
|
+
z.ZodTypeDef,
|
|
55
|
+
unknown
|
|
56
|
+
> = z.object({
|
|
57
|
+
ip: z.string().optional(),
|
|
58
|
+
port: z.number().int().optional(),
|
|
59
|
+
protocol: z.string().optional(),
|
|
60
|
+
transport_protocol: ServiceIdTransportProtocol$inboundSchema.optional(),
|
|
61
|
+
}).transform((v) => {
|
|
62
|
+
return remap$(v, {
|
|
63
|
+
"transport_protocol": "transportProtocol",
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export type ServiceId$Outbound = {
|
|
69
|
+
ip?: string | undefined;
|
|
70
|
+
port?: number | undefined;
|
|
71
|
+
protocol?: string | undefined;
|
|
72
|
+
transport_protocol?: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const ServiceId$outboundSchema: z.ZodType<
|
|
77
|
+
ServiceId$Outbound,
|
|
78
|
+
z.ZodTypeDef,
|
|
79
|
+
ServiceId
|
|
80
|
+
> = z.object({
|
|
81
|
+
ip: z.string().optional(),
|
|
82
|
+
port: z.number().int().optional(),
|
|
83
|
+
protocol: z.string().optional(),
|
|
84
|
+
transportProtocol: ServiceIdTransportProtocol$outboundSchema.optional(),
|
|
85
|
+
}).transform((v) => {
|
|
86
|
+
return remap$(v, {
|
|
87
|
+
transportProtocol: "transport_protocol",
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
94
|
+
*/
|
|
95
|
+
export namespace ServiceId$ {
|
|
96
|
+
/** @deprecated use `ServiceId$inboundSchema` instead. */
|
|
97
|
+
export const inboundSchema = ServiceId$inboundSchema;
|
|
98
|
+
/** @deprecated use `ServiceId$outboundSchema` instead. */
|
|
99
|
+
export const outboundSchema = ServiceId$outboundSchema;
|
|
100
|
+
/** @deprecated use `ServiceId$Outbound` instead. */
|
|
101
|
+
export type Outbound = ServiceId$Outbound;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function serviceIdToJSON(serviceId: ServiceId): string {
|
|
105
|
+
return JSON.stringify(ServiceId$outboundSchema.parse(serviceId));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function serviceIdFromJSON(
|
|
109
|
+
jsonString: string,
|
|
110
|
+
): SafeParseResult<ServiceId, SDKValidationError> {
|
|
111
|
+
return safeParse(
|
|
112
|
+
jsonString,
|
|
113
|
+
(x) => ServiceId$inboundSchema.parse(JSON.parse(x)),
|
|
114
|
+
`Failed to parse 'ServiceId' from JSON`,
|
|
115
|
+
);
|
|
116
|
+
}
|