@censys/platform-sdk 0.5.0 → 0.6.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.
Files changed (230) hide show
  1. package/README.md +17 -17
  2. package/docs/sdks/globaldata/README.md +190 -92
  3. package/docs/sdks/threathunting/README.md +29 -21
  4. package/examples/globalDataSearch.example.ts +1 -1
  5. package/examples/package-lock.json +3 -3
  6. package/funcs/globalDataConvertLegacySearchQueries.d.ts +18 -0
  7. package/funcs/globalDataConvertLegacySearchQueries.d.ts.map +1 -0
  8. package/funcs/globalDataConvertLegacySearchQueries.js +134 -0
  9. package/funcs/globalDataConvertLegacySearchQueries.js.map +1 -0
  10. package/funcs/globalDataCreateTrackedScan.d.ts +2 -2
  11. package/funcs/globalDataCreateTrackedScan.js +2 -2
  12. package/funcs/{globalDataGetTrackedScanThreatHunting.d.ts → globalDataGetCertificateRaw.d.ts} +4 -5
  13. package/funcs/globalDataGetCertificateRaw.d.ts.map +1 -0
  14. package/funcs/{globalDataGetHostObservationsWithCertificate.js → globalDataGetCertificateRaw.js} +10 -19
  15. package/funcs/globalDataGetCertificateRaw.js.map +1 -0
  16. package/funcs/globalDataGetCertificates.d.ts +1 -1
  17. package/funcs/globalDataGetCertificates.d.ts.map +1 -1
  18. package/funcs/globalDataGetCertificates.js +9 -6
  19. package/funcs/globalDataGetCertificates.js.map +1 -1
  20. package/funcs/globalDataGetCertificatesRaw.d.ts +18 -0
  21. package/funcs/globalDataGetCertificatesRaw.d.ts.map +1 -0
  22. package/funcs/globalDataGetCertificatesRaw.js +130 -0
  23. package/funcs/globalDataGetCertificatesRaw.js.map +1 -0
  24. package/funcs/globalDataGetHostTimeline.d.ts +1 -1
  25. package/funcs/globalDataGetHostTimeline.js +1 -1
  26. package/funcs/globalDataGetHosts.d.ts +1 -1
  27. package/funcs/globalDataGetHosts.d.ts.map +1 -1
  28. package/funcs/globalDataGetHosts.js +8 -6
  29. package/funcs/globalDataGetHosts.js.map +1 -1
  30. package/funcs/globalDataGetTrackedScan.d.ts +2 -3
  31. package/funcs/globalDataGetTrackedScan.d.ts.map +1 -1
  32. package/funcs/globalDataGetTrackedScan.js +2 -3
  33. package/funcs/globalDataGetTrackedScan.js.map +1 -1
  34. package/funcs/globalDataGetWebProperties.d.ts +1 -1
  35. package/funcs/globalDataGetWebProperties.d.ts.map +1 -1
  36. package/funcs/globalDataGetWebProperties.js +9 -6
  37. package/funcs/globalDataGetWebProperties.js.map +1 -1
  38. package/funcs/threatHuntingCreateTrackedScan.d.ts +2 -2
  39. package/funcs/threatHuntingCreateTrackedScan.js +2 -2
  40. package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts +18 -0
  41. package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts.map +1 -0
  42. package/funcs/threatHuntingGetHostObservationsWithCertificate.js +141 -0
  43. package/funcs/threatHuntingGetHostObservationsWithCertificate.js.map +1 -0
  44. package/funcs/threatHuntingGetTrackedScanThreatHunting.d.ts +18 -0
  45. package/funcs/threatHuntingGetTrackedScanThreatHunting.d.ts.map +1 -0
  46. package/funcs/{globalDataGetTrackedScanThreatHunting.js → threatHuntingGetTrackedScanThreatHunting.js} +5 -6
  47. package/funcs/threatHuntingGetTrackedScanThreatHunting.js.map +1 -0
  48. package/jsr.json +1 -1
  49. package/lib/config.d.ts +4 -4
  50. package/lib/config.js +4 -4
  51. package/lib/security.d.ts.map +1 -1
  52. package/lib/security.js.map +1 -1
  53. package/models/components/alternativequery.d.ts +69 -0
  54. package/models/components/alternativequery.d.ts.map +1 -0
  55. package/models/components/alternativequery.js +93 -0
  56. package/models/components/alternativequery.js.map +1 -0
  57. package/models/components/assetcertificatelistinputbody.d.ts +32 -0
  58. package/models/components/assetcertificatelistinputbody.d.ts.map +1 -0
  59. package/models/components/assetcertificatelistinputbody.js +78 -0
  60. package/models/components/assetcertificatelistinputbody.js.map +1 -0
  61. package/models/components/assethostlistinputbody.d.ts +32 -0
  62. package/models/components/assethostlistinputbody.d.ts.map +1 -0
  63. package/models/components/assethostlistinputbody.js +78 -0
  64. package/models/components/assethostlistinputbody.js.map +1 -0
  65. package/models/components/assetwebpropertylistinputbody.d.ts +32 -0
  66. package/models/components/assetwebpropertylistinputbody.d.ts.map +1 -0
  67. package/models/components/assetwebpropertylistinputbody.js +78 -0
  68. package/models/components/assetwebpropertylistinputbody.js.map +1 -0
  69. package/models/components/asteriskmanagerinterface.d.ts +29 -0
  70. package/models/components/asteriskmanagerinterface.d.ts.map +1 -0
  71. package/models/components/asteriskmanagerinterface.js +69 -0
  72. package/models/components/asteriskmanagerinterface.js.map +1 -0
  73. package/models/components/convertqueryerror.d.ts +32 -0
  74. package/models/components/convertqueryerror.d.ts.map +1 -0
  75. package/models/components/convertqueryerror.js +69 -0
  76. package/models/components/convertqueryerror.js.map +1 -0
  77. package/models/components/index.d.ts +12 -0
  78. package/models/components/index.d.ts.map +1 -1
  79. package/models/components/index.js +12 -0
  80. package/models/components/index.js.map +1 -1
  81. package/models/components/openvpnmgmt.d.ts +37 -0
  82. package/models/components/openvpnmgmt.d.ts.map +1 -0
  83. package/models/components/openvpnmgmt.js +92 -0
  84. package/models/components/openvpnmgmt.js.map +1 -0
  85. package/models/components/rawcertificateresponse.d.ts +31 -0
  86. package/models/components/rawcertificateresponse.d.ts.map +1 -0
  87. package/models/components/rawcertificateresponse.js +80 -0
  88. package/models/components/rawcertificateresponse.js.map +1 -0
  89. package/models/components/rdp.d.ts +2 -0
  90. package/models/components/rdp.d.ts.map +1 -1
  91. package/models/components/rdp.js +4 -0
  92. package/models/components/rdp.js.map +1 -1
  93. package/models/components/responseenvelopelistrawcertificateresponse.d.ts +30 -0
  94. package/models/components/responseenvelopelistrawcertificateresponse.d.ts.map +1 -0
  95. package/models/components/responseenvelopelistrawcertificateresponse.js +72 -0
  96. package/models/components/responseenvelopelistrawcertificateresponse.js.map +1 -0
  97. package/models/components/responseenvelopelistsearchconvertqueryresponse.d.ts +30 -0
  98. package/models/components/responseenvelopelistsearchconvertqueryresponse.d.ts.map +1 -0
  99. package/models/components/responseenvelopelistsearchconvertqueryresponse.js +72 -0
  100. package/models/components/responseenvelopelistsearchconvertqueryresponse.js.map +1 -0
  101. package/models/components/screenshot.d.ts +2 -0
  102. package/models/components/screenshot.d.ts.map +1 -1
  103. package/models/components/screenshot.js +2 -0
  104. package/models/components/screenshot.js.map +1 -1
  105. package/models/components/searchconvertqueryinputbody.d.ts +32 -0
  106. package/models/components/searchconvertqueryinputbody.d.ts.map +1 -0
  107. package/models/components/searchconvertqueryinputbody.js +69 -0
  108. package/models/components/searchconvertqueryinputbody.js.map +1 -0
  109. package/models/components/searchconvertqueryresponse.d.ts +91 -0
  110. package/models/components/searchconvertqueryresponse.d.ts.map +1 -0
  111. package/models/components/searchconvertqueryresponse.js +117 -0
  112. package/models/components/searchconvertqueryresponse.js.map +1 -0
  113. package/models/components/service.d.ts +6 -0
  114. package/models/components/service.d.ts.map +1 -1
  115. package/models/components/service.js +11 -0
  116. package/models/components/service.js.map +1 -1
  117. package/models/components/servicescan.d.ts +6 -0
  118. package/models/components/servicescan.d.ts.map +1 -1
  119. package/models/components/servicescan.js +10 -0
  120. package/models/components/servicescan.js.map +1 -1
  121. package/models/operations/index.d.ts +7 -4
  122. package/models/operations/index.d.ts.map +1 -1
  123. package/models/operations/index.js +7 -4
  124. package/models/operations/index.js.map +1 -1
  125. package/models/operations/v3globaldataassetcertificatelistpost.d.ts +91 -0
  126. package/models/operations/v3globaldataassetcertificatelistpost.d.ts.map +1 -0
  127. package/models/operations/v3globaldataassetcertificatelistpost.js +157 -0
  128. package/models/operations/v3globaldataassetcertificatelistpost.js.map +1 -0
  129. package/models/operations/v3globaldataassetcertificatelistrawpost.d.ts +91 -0
  130. package/models/operations/v3globaldataassetcertificatelistrawpost.d.ts.map +1 -0
  131. package/models/operations/v3globaldataassetcertificatelistrawpost.js +157 -0
  132. package/models/operations/v3globaldataassetcertificatelistrawpost.js.map +1 -0
  133. package/models/operations/v3globaldataassetcertificateraw.d.ts +93 -0
  134. package/models/operations/v3globaldataassetcertificateraw.d.ts.map +1 -0
  135. package/models/operations/v3globaldataassetcertificateraw.js +156 -0
  136. package/models/operations/v3globaldataassetcertificateraw.js.map +1 -0
  137. package/models/operations/v3globaldataassethostlistpost.d.ts +91 -0
  138. package/models/operations/v3globaldataassethostlistpost.d.ts.map +1 -0
  139. package/models/operations/v3globaldataassethostlistpost.js +157 -0
  140. package/models/operations/v3globaldataassethostlistpost.js.map +1 -0
  141. package/models/operations/v3globaldataassethosttimeline.d.ts +2 -2
  142. package/models/operations/v3globaldataassetwebpropertylistpost.d.ts +91 -0
  143. package/models/operations/v3globaldataassetwebpropertylistpost.d.ts.map +1 -0
  144. package/models/operations/v3globaldataassetwebpropertylistpost.js +157 -0
  145. package/models/operations/v3globaldataassetwebpropertylistpost.js.map +1 -0
  146. package/models/operations/v3globaldatasearchconvert.d.ts +91 -0
  147. package/models/operations/v3globaldatasearchconvert.d.ts.map +1 -0
  148. package/models/operations/v3globaldatasearchconvert.js +157 -0
  149. package/models/operations/v3globaldatasearchconvert.js.map +1 -0
  150. package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts +124 -0
  151. package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts.map +1 -0
  152. package/models/operations/v3threathuntinggethostobservationswithcertificate.js +183 -0
  153. package/models/operations/v3threathuntinggethostobservationswithcertificate.js.map +1 -0
  154. package/package.json +3 -3
  155. package/sdk/globaldata.d.ts +24 -19
  156. package/sdk/globaldata.d.ts.map +1 -1
  157. package/sdk/globaldata.js +29 -21
  158. package/sdk/globaldata.js.map +1 -1
  159. package/sdk/threathunting.d.ts +7 -9
  160. package/sdk/threathunting.d.ts.map +1 -1
  161. package/sdk/threathunting.js +11 -13
  162. package/sdk/threathunting.js.map +1 -1
  163. package/src/funcs/globalDataConvertLegacySearchQueries.ts +188 -0
  164. package/src/funcs/globalDataCreateTrackedScan.ts +2 -2
  165. package/src/funcs/{globalDataGetHostObservationsWithCertificate.ts → globalDataGetCertificateRaw.ts} +19 -26
  166. package/src/funcs/globalDataGetCertificates.ts +15 -14
  167. package/src/funcs/globalDataGetCertificatesRaw.ts +187 -0
  168. package/src/funcs/globalDataGetHostTimeline.ts +1 -1
  169. package/src/funcs/globalDataGetHosts.ts +24 -16
  170. package/src/funcs/globalDataGetTrackedScan.ts +2 -3
  171. package/src/funcs/globalDataGetWebProperties.ts +15 -14
  172. package/src/funcs/threatHuntingCreateTrackedScan.ts +2 -2
  173. package/src/funcs/threatHuntingGetHostObservationsWithCertificate.ts +201 -0
  174. package/src/funcs/{globalDataGetTrackedScanThreatHunting.ts → threatHuntingGetTrackedScanThreatHunting.ts} +3 -4
  175. package/src/lib/config.ts +4 -4
  176. package/src/lib/security.ts +4 -1
  177. package/src/models/components/alternativequery.ts +104 -0
  178. package/src/models/components/assetcertificatelistinputbody.ts +80 -0
  179. package/src/models/components/assethostlistinputbody.ts +78 -0
  180. package/src/models/components/assetwebpropertylistinputbody.ts +80 -0
  181. package/src/models/components/asteriskmanagerinterface.ts +66 -0
  182. package/src/models/components/convertqueryerror.ts +69 -0
  183. package/src/models/components/index.ts +12 -0
  184. package/src/models/components/openvpnmgmt.ts +93 -0
  185. package/src/models/components/rawcertificateresponse.ts +79 -0
  186. package/src/models/components/rdp.ts +6 -0
  187. package/src/models/components/responseenvelopelistrawcertificateresponse.ts +84 -0
  188. package/src/models/components/responseenvelopelistsearchconvertqueryresponse.ts +88 -0
  189. package/src/models/components/screenshot.ts +4 -0
  190. package/src/models/components/searchconvertqueryinputbody.ts +71 -0
  191. package/src/models/components/searchconvertqueryresponse.ts +166 -0
  192. package/src/models/components/service.ts +25 -0
  193. package/src/models/components/servicescan.ts +24 -0
  194. package/src/models/operations/index.ts +7 -4
  195. package/src/models/operations/v3globaldataassetcertificatelistpost.ts +265 -0
  196. package/src/models/operations/v3globaldataassetcertificatelistrawpost.ts +269 -0
  197. package/src/models/operations/v3globaldataassetcertificateraw.ts +248 -0
  198. package/src/models/operations/v3globaldataassethostlistpost.ts +238 -0
  199. package/src/models/operations/v3globaldataassethosttimeline.ts +2 -2
  200. package/src/models/operations/v3globaldataassetwebpropertylistpost.ts +265 -0
  201. package/src/models/operations/v3globaldatasearchconvert.ts +234 -0
  202. package/src/models/operations/v3threathuntinggethostobservationswithcertificate.ts +315 -0
  203. package/src/sdk/globaldata.ts +49 -35
  204. package/src/sdk/threathunting.ts +16 -15
  205. package/tests/sdk.test.ts +2 -2
  206. package/funcs/globalDataGetHostObservationsWithCertificate.d.ts +0 -18
  207. package/funcs/globalDataGetHostObservationsWithCertificate.d.ts.map +0 -1
  208. package/funcs/globalDataGetHostObservationsWithCertificate.js.map +0 -1
  209. package/funcs/globalDataGetTrackedScanThreatHunting.d.ts.map +0 -1
  210. package/funcs/globalDataGetTrackedScanThreatHunting.js.map +0 -1
  211. package/models/operations/v3globaldataassetcertificatelist.d.ts +0 -94
  212. package/models/operations/v3globaldataassetcertificatelist.d.ts.map +0 -1
  213. package/models/operations/v3globaldataassetcertificatelist.js +0 -157
  214. package/models/operations/v3globaldataassetcertificatelist.js.map +0 -1
  215. package/models/operations/v3globaldataassethostlist.d.ts +0 -94
  216. package/models/operations/v3globaldataassethostlist.d.ts.map +0 -1
  217. package/models/operations/v3globaldataassethostlist.js +0 -157
  218. package/models/operations/v3globaldataassethostlist.js.map +0 -1
  219. package/models/operations/v3globaldataassetwebpropertylist.d.ts +0 -94
  220. package/models/operations/v3globaldataassetwebpropertylist.d.ts.map +0 -1
  221. package/models/operations/v3globaldataassetwebpropertylist.js +0 -157
  222. package/models/operations/v3globaldataassetwebpropertylist.js.map +0 -1
  223. package/models/operations/v3globaldatagethostobservationswithcertificate.d.ts +0 -124
  224. package/models/operations/v3globaldatagethostobservationswithcertificate.d.ts.map +0 -1
  225. package/models/operations/v3globaldatagethostobservationswithcertificate.js +0 -178
  226. package/models/operations/v3globaldatagethostobservationswithcertificate.js.map +0 -1
  227. package/src/models/operations/v3globaldataassetcertificatelist.ts +0 -259
  228. package/src/models/operations/v3globaldataassethostlist.ts +0 -233
  229. package/src/models/operations/v3globaldataassetwebpropertylist.ts +0 -259
  230. package/src/models/operations/v3globaldatagethostobservationswithcertificate.ts +0 -317
@@ -0,0 +1,201 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SDKCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import * as errors from "../models/errors/index.js";
21
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
22
+ import { SDKBaseError } from "../models/errors/sdkbaseerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Get host history for a certificate
30
+ *
31
+ * @remarks
32
+ * Retrieve the historical observations of hosts associated with a certificate. This is useful for threat hunting, detection engineering, and timeline generation. Certificate history is also visible to Threat Hunting users in the Platform UI on the [certificate timeline](https://docs.censys.com/docs/platform-threat-hunting-use-cert-history-to-build-better-detections#/).<br><br>You can define a specific time frame of interest. If you do not specify a time frame, this endpoint will search the historical dataset that is available to your account. You may also filter results by port and transport protocol.<br><br>This endpoint is available to organizations that have access to the Threat Hunting module. It costs 5 credits per page of results.
33
+ */
34
+ export function threatHuntingGetHostObservationsWithCertificate(
35
+ client: SDKCore,
36
+ request: operations.V3ThreathuntingGetHostObservationsWithCertificateRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ operations.V3ThreathuntingGetHostObservationsWithCertificateResponse,
41
+ | errors.ErrorModel
42
+ | SDKBaseError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: SDKCore,
61
+ request: operations.V3ThreathuntingGetHostObservationsWithCertificateRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ operations.V3ThreathuntingGetHostObservationsWithCertificateResponse,
67
+ | errors.ErrorModel
68
+ | SDKBaseError
69
+ | ResponseValidationError
70
+ | ConnectionError
71
+ | RequestAbortedError
72
+ | RequestTimeoutError
73
+ | InvalidRequestError
74
+ | UnexpectedClientError
75
+ | SDKValidationError
76
+ >,
77
+ APICall,
78
+ ]
79
+ > {
80
+ const parsed = safeParse(
81
+ request,
82
+ (value) =>
83
+ operations
84
+ .V3ThreathuntingGetHostObservationsWithCertificateRequest$outboundSchema
85
+ .parse(value),
86
+ "Input validation failed",
87
+ );
88
+ if (!parsed.ok) {
89
+ return [parsed, { status: "invalid" }];
90
+ }
91
+ const payload = parsed.value;
92
+ const body = null;
93
+
94
+ const pathParams = {
95
+ certificate_id: encodeSimple("certificate_id", payload.certificate_id, {
96
+ explode: false,
97
+ charEncoding: "percent",
98
+ }),
99
+ };
100
+
101
+ const path = pathToFunc(
102
+ "/v3/threat-hunting/certificate/{certificate_id}/observations/hosts",
103
+ )(pathParams);
104
+
105
+ const query = encodeFormQuery({
106
+ "end_time": payload.end_time,
107
+ "organization_id": payload.organization_id
108
+ ?? client._options.organizationId,
109
+ "page_size": payload.page_size,
110
+ "page_token": payload.page_token,
111
+ "port": payload.port,
112
+ "protocol": payload.protocol,
113
+ "start_time": payload.start_time,
114
+ }, { explode: false });
115
+
116
+ const headers = new Headers(compactMap({
117
+ Accept: "application/json",
118
+ }));
119
+
120
+ const secConfig = await extractSecurity(client._options.personalAccessToken);
121
+ const securityInput = secConfig == null
122
+ ? {}
123
+ : { personalAccessToken: secConfig };
124
+ const requestSecurity = resolveGlobalSecurity(securityInput);
125
+
126
+ const context = {
127
+ options: client._options,
128
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
129
+ operationID: "v3-threathunting-get-host-observations-with-certificate",
130
+ oAuth2Scopes: [],
131
+
132
+ resolvedSecurity: requestSecurity,
133
+
134
+ securitySource: client._options.personalAccessToken,
135
+ retryConfig: options?.retries
136
+ || client._options.retryConfig
137
+ || { strategy: "none" },
138
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
139
+ };
140
+
141
+ const requestRes = client._createRequest(context, {
142
+ security: requestSecurity,
143
+ method: "GET",
144
+ baseURL: options?.serverURL,
145
+ path: path,
146
+ headers: headers,
147
+ query: query,
148
+ body: body,
149
+ userAgent: client._options.userAgent,
150
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
151
+ }, options);
152
+ if (!requestRes.ok) {
153
+ return [requestRes, { status: "invalid" }];
154
+ }
155
+ const req = requestRes.value;
156
+
157
+ const doResult = await client._do(req, {
158
+ context,
159
+ errorCodes: ["401", "403", "4XX", "5XX"],
160
+ retryConfig: context.retryConfig,
161
+ retryCodes: context.retryCodes,
162
+ });
163
+ if (!doResult.ok) {
164
+ return [doResult, { status: "request-error", request: req }];
165
+ }
166
+ const response = doResult.value;
167
+
168
+ const responseFields = {
169
+ HttpMeta: { Response: response, Request: req },
170
+ };
171
+
172
+ const [result] = await M.match<
173
+ operations.V3ThreathuntingGetHostObservationsWithCertificateResponse,
174
+ | errors.ErrorModel
175
+ | SDKBaseError
176
+ | ResponseValidationError
177
+ | ConnectionError
178
+ | RequestAbortedError
179
+ | RequestTimeoutError
180
+ | InvalidRequestError
181
+ | UnexpectedClientError
182
+ | SDKValidationError
183
+ >(
184
+ M.json(
185
+ 200,
186
+ operations
187
+ .V3ThreathuntingGetHostObservationsWithCertificateResponse$inboundSchema,
188
+ { hdrs: true, key: "Result" },
189
+ ),
190
+ M.jsonErr([401, 403], errors.ErrorModel$inboundSchema, {
191
+ ctype: "application/problem+json",
192
+ }),
193
+ M.fail("4XX"),
194
+ M.fail("5XX"),
195
+ )(response, req, { extraFields: responseFields });
196
+ if (!result.ok) {
197
+ return [result, { status: "complete", request: req, response }];
198
+ }
199
+
200
+ return [result, { status: "complete", request: req, response }];
201
+ }
@@ -26,13 +26,12 @@ import { APICall, APIPromise } from "../types/async.js";
26
26
  import { Result } from "../types/fp.js";
27
27
 
28
28
  /**
29
- * Get tracked scan details
29
+ * Get scan status
30
30
  *
31
31
  * @remarks
32
- * Retrieve the current status and results of a tracked scan by its ID.
33
- * This endpoint works for both discovery scans and rescans.
32
+ * Retrieve the current status of a scan by its ID. This endpoint works for both [Live Discovery scans](https://docs.censys.com/reference/v3-threathunting-scans-discovery#/) and [Live Rescans](https://docs.censys.com/reference/v3-globaldata-scans-rescan#/).<br><br>If the scan was successful, perform a lookup on the target asset to retrieve detailed scan information.<br><br>This endpoint is available to all Enterprise customers. This endpoint does not cost any credits to execute.
34
33
  */
35
- export function globalDataGetTrackedScanThreatHunting(
34
+ export function threatHuntingGetTrackedScanThreatHunting(
36
35
  client: SDKCore,
37
36
  request: operations.V3ThreathuntingScansGetRequest,
38
37
  options?: RequestOptions,
package/src/lib/config.ts CHANGED
@@ -65,9 +65,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
 
66
66
  export const SDK_METADATA = {
67
67
  language: "typescript",
68
- openapiDocVersion: "1.0.24",
69
- sdkVersion: "0.5.0",
70
- genVersion: "2.671.2",
68
+ openapiDocVersion: "1.0.35",
69
+ sdkVersion: "0.6.0",
70
+ genVersion: "2.690.1",
71
71
  userAgent:
72
- "speakeasy-sdk/typescript 0.5.0 2.671.2 1.0.24 @censys/platform-sdk",
72
+ "speakeasy-sdk/typescript 0.6.0 2.690.1 1.0.35 @censys/platform-sdk",
73
73
  } as const;
@@ -83,7 +83,10 @@ type SecurityInputOAuth2 = {
83
83
  type SecurityInputOAuth2ClientCredentials = {
84
84
  type: "oauth2:client_credentials";
85
85
  value:
86
- | { clientID?: string | undefined; clientSecret?: string | undefined }
86
+ | {
87
+ clientID?: string | undefined;
88
+ clientSecret?: string | undefined;
89
+ }
87
90
  | null
88
91
  | string
89
92
  | undefined;
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export const Targets = {
12
+ Host: "host",
13
+ Web: "web",
14
+ Cert: "cert",
15
+ Unknown: "unknown",
16
+ } as const;
17
+ export type Targets = ClosedEnum<typeof Targets>;
18
+
19
+ export type AlternativeQuery = {
20
+ /**
21
+ * An alternative query that may be used.
22
+ */
23
+ query: string;
24
+ /**
25
+ * The types of Platform data records (host, cert, and web) that can be targeted by the alternative query.
26
+ */
27
+ targets: Array<Targets> | null;
28
+ };
29
+
30
+ /** @internal */
31
+ export const Targets$inboundSchema: z.ZodNativeEnum<typeof Targets> = z
32
+ .nativeEnum(Targets);
33
+
34
+ /** @internal */
35
+ export const Targets$outboundSchema: z.ZodNativeEnum<typeof Targets> =
36
+ Targets$inboundSchema;
37
+
38
+ /**
39
+ * @internal
40
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
41
+ */
42
+ export namespace Targets$ {
43
+ /** @deprecated use `Targets$inboundSchema` instead. */
44
+ export const inboundSchema = Targets$inboundSchema;
45
+ /** @deprecated use `Targets$outboundSchema` instead. */
46
+ export const outboundSchema = Targets$outboundSchema;
47
+ }
48
+
49
+ /** @internal */
50
+ export const AlternativeQuery$inboundSchema: z.ZodType<
51
+ AlternativeQuery,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = z.object({
55
+ query: z.string(),
56
+ targets: z.nullable(z.array(Targets$inboundSchema)),
57
+ });
58
+
59
+ /** @internal */
60
+ export type AlternativeQuery$Outbound = {
61
+ query: string;
62
+ targets: Array<string> | null;
63
+ };
64
+
65
+ /** @internal */
66
+ export const AlternativeQuery$outboundSchema: z.ZodType<
67
+ AlternativeQuery$Outbound,
68
+ z.ZodTypeDef,
69
+ AlternativeQuery
70
+ > = z.object({
71
+ query: z.string(),
72
+ targets: z.nullable(z.array(Targets$outboundSchema)),
73
+ });
74
+
75
+ /**
76
+ * @internal
77
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
+ */
79
+ export namespace AlternativeQuery$ {
80
+ /** @deprecated use `AlternativeQuery$inboundSchema` instead. */
81
+ export const inboundSchema = AlternativeQuery$inboundSchema;
82
+ /** @deprecated use `AlternativeQuery$outboundSchema` instead. */
83
+ export const outboundSchema = AlternativeQuery$outboundSchema;
84
+ /** @deprecated use `AlternativeQuery$Outbound` instead. */
85
+ export type Outbound = AlternativeQuery$Outbound;
86
+ }
87
+
88
+ export function alternativeQueryToJSON(
89
+ alternativeQuery: AlternativeQuery,
90
+ ): string {
91
+ return JSON.stringify(
92
+ AlternativeQuery$outboundSchema.parse(alternativeQuery),
93
+ );
94
+ }
95
+
96
+ export function alternativeQueryFromJSON(
97
+ jsonString: string,
98
+ ): SafeParseResult<AlternativeQuery, SDKValidationError> {
99
+ return safeParse(
100
+ jsonString,
101
+ (x) => AlternativeQuery$inboundSchema.parse(JSON.parse(x)),
102
+ `Failed to parse 'AlternativeQuery' from JSON`,
103
+ );
104
+ }
@@ -0,0 +1,80 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type AssetCertificateListInputBody = {
12
+ /**
13
+ * A list of SHA-256 certificate fingerprints.
14
+ */
15
+ certificateIds: Array<string> | null;
16
+ };
17
+
18
+ /** @internal */
19
+ export const AssetCertificateListInputBody$inboundSchema: z.ZodType<
20
+ AssetCertificateListInputBody,
21
+ z.ZodTypeDef,
22
+ unknown
23
+ > = z.object({
24
+ certificate_ids: z.nullable(z.array(z.string())),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "certificate_ids": "certificateIds",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type AssetCertificateListInputBody$Outbound = {
33
+ certificate_ids: Array<string> | null;
34
+ };
35
+
36
+ /** @internal */
37
+ export const AssetCertificateListInputBody$outboundSchema: z.ZodType<
38
+ AssetCertificateListInputBody$Outbound,
39
+ z.ZodTypeDef,
40
+ AssetCertificateListInputBody
41
+ > = z.object({
42
+ certificateIds: z.nullable(z.array(z.string())),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ certificateIds: "certificate_ids",
46
+ });
47
+ });
48
+
49
+ /**
50
+ * @internal
51
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
+ */
53
+ export namespace AssetCertificateListInputBody$ {
54
+ /** @deprecated use `AssetCertificateListInputBody$inboundSchema` instead. */
55
+ export const inboundSchema = AssetCertificateListInputBody$inboundSchema;
56
+ /** @deprecated use `AssetCertificateListInputBody$outboundSchema` instead. */
57
+ export const outboundSchema = AssetCertificateListInputBody$outboundSchema;
58
+ /** @deprecated use `AssetCertificateListInputBody$Outbound` instead. */
59
+ export type Outbound = AssetCertificateListInputBody$Outbound;
60
+ }
61
+
62
+ export function assetCertificateListInputBodyToJSON(
63
+ assetCertificateListInputBody: AssetCertificateListInputBody,
64
+ ): string {
65
+ return JSON.stringify(
66
+ AssetCertificateListInputBody$outboundSchema.parse(
67
+ assetCertificateListInputBody,
68
+ ),
69
+ );
70
+ }
71
+
72
+ export function assetCertificateListInputBodyFromJSON(
73
+ jsonString: string,
74
+ ): SafeParseResult<AssetCertificateListInputBody, SDKValidationError> {
75
+ return safeParse(
76
+ jsonString,
77
+ (x) => AssetCertificateListInputBody$inboundSchema.parse(JSON.parse(x)),
78
+ `Failed to parse 'AssetCertificateListInputBody' from JSON`,
79
+ );
80
+ }
@@ -0,0 +1,78 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type AssetHostListInputBody = {
12
+ /**
13
+ * A list of host IP addresses.
14
+ */
15
+ hostIds: Array<string> | null;
16
+ };
17
+
18
+ /** @internal */
19
+ export const AssetHostListInputBody$inboundSchema: z.ZodType<
20
+ AssetHostListInputBody,
21
+ z.ZodTypeDef,
22
+ unknown
23
+ > = z.object({
24
+ host_ids: z.nullable(z.array(z.string())),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "host_ids": "hostIds",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type AssetHostListInputBody$Outbound = {
33
+ host_ids: Array<string> | null;
34
+ };
35
+
36
+ /** @internal */
37
+ export const AssetHostListInputBody$outboundSchema: z.ZodType<
38
+ AssetHostListInputBody$Outbound,
39
+ z.ZodTypeDef,
40
+ AssetHostListInputBody
41
+ > = z.object({
42
+ hostIds: z.nullable(z.array(z.string())),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ hostIds: "host_ids",
46
+ });
47
+ });
48
+
49
+ /**
50
+ * @internal
51
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
+ */
53
+ export namespace AssetHostListInputBody$ {
54
+ /** @deprecated use `AssetHostListInputBody$inboundSchema` instead. */
55
+ export const inboundSchema = AssetHostListInputBody$inboundSchema;
56
+ /** @deprecated use `AssetHostListInputBody$outboundSchema` instead. */
57
+ export const outboundSchema = AssetHostListInputBody$outboundSchema;
58
+ /** @deprecated use `AssetHostListInputBody$Outbound` instead. */
59
+ export type Outbound = AssetHostListInputBody$Outbound;
60
+ }
61
+
62
+ export function assetHostListInputBodyToJSON(
63
+ assetHostListInputBody: AssetHostListInputBody,
64
+ ): string {
65
+ return JSON.stringify(
66
+ AssetHostListInputBody$outboundSchema.parse(assetHostListInputBody),
67
+ );
68
+ }
69
+
70
+ export function assetHostListInputBodyFromJSON(
71
+ jsonString: string,
72
+ ): SafeParseResult<AssetHostListInputBody, SDKValidationError> {
73
+ return safeParse(
74
+ jsonString,
75
+ (x) => AssetHostListInputBody$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'AssetHostListInputBody' from JSON`,
77
+ );
78
+ }
@@ -0,0 +1,80 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type AssetWebpropertyListInputBody = {
12
+ /**
13
+ * A list of web property identifiers.
14
+ */
15
+ webpropertyIds: Array<string> | null;
16
+ };
17
+
18
+ /** @internal */
19
+ export const AssetWebpropertyListInputBody$inboundSchema: z.ZodType<
20
+ AssetWebpropertyListInputBody,
21
+ z.ZodTypeDef,
22
+ unknown
23
+ > = z.object({
24
+ webproperty_ids: z.nullable(z.array(z.string())),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "webproperty_ids": "webpropertyIds",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type AssetWebpropertyListInputBody$Outbound = {
33
+ webproperty_ids: Array<string> | null;
34
+ };
35
+
36
+ /** @internal */
37
+ export const AssetWebpropertyListInputBody$outboundSchema: z.ZodType<
38
+ AssetWebpropertyListInputBody$Outbound,
39
+ z.ZodTypeDef,
40
+ AssetWebpropertyListInputBody
41
+ > = z.object({
42
+ webpropertyIds: z.nullable(z.array(z.string())),
43
+ }).transform((v) => {
44
+ return remap$(v, {
45
+ webpropertyIds: "webproperty_ids",
46
+ });
47
+ });
48
+
49
+ /**
50
+ * @internal
51
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
+ */
53
+ export namespace AssetWebpropertyListInputBody$ {
54
+ /** @deprecated use `AssetWebpropertyListInputBody$inboundSchema` instead. */
55
+ export const inboundSchema = AssetWebpropertyListInputBody$inboundSchema;
56
+ /** @deprecated use `AssetWebpropertyListInputBody$outboundSchema` instead. */
57
+ export const outboundSchema = AssetWebpropertyListInputBody$outboundSchema;
58
+ /** @deprecated use `AssetWebpropertyListInputBody$Outbound` instead. */
59
+ export type Outbound = AssetWebpropertyListInputBody$Outbound;
60
+ }
61
+
62
+ export function assetWebpropertyListInputBodyToJSON(
63
+ assetWebpropertyListInputBody: AssetWebpropertyListInputBody,
64
+ ): string {
65
+ return JSON.stringify(
66
+ AssetWebpropertyListInputBody$outboundSchema.parse(
67
+ assetWebpropertyListInputBody,
68
+ ),
69
+ );
70
+ }
71
+
72
+ export function assetWebpropertyListInputBodyFromJSON(
73
+ jsonString: string,
74
+ ): SafeParseResult<AssetWebpropertyListInputBody, SDKValidationError> {
75
+ return safeParse(
76
+ jsonString,
77
+ (x) => AssetWebpropertyListInputBody$inboundSchema.parse(JSON.parse(x)),
78
+ `Failed to parse 'AssetWebpropertyListInputBody' from JSON`,
79
+ );
80
+ }
@@ -0,0 +1,66 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type AsteriskManagerInterface = {
11
+ version?: string | undefined;
12
+ };
13
+
14
+ /** @internal */
15
+ export const AsteriskManagerInterface$inboundSchema: z.ZodType<
16
+ AsteriskManagerInterface,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ version: z.string().optional(),
21
+ });
22
+
23
+ /** @internal */
24
+ export type AsteriskManagerInterface$Outbound = {
25
+ version?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const AsteriskManagerInterface$outboundSchema: z.ZodType<
30
+ AsteriskManagerInterface$Outbound,
31
+ z.ZodTypeDef,
32
+ AsteriskManagerInterface
33
+ > = z.object({
34
+ version: z.string().optional(),
35
+ });
36
+
37
+ /**
38
+ * @internal
39
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
40
+ */
41
+ export namespace AsteriskManagerInterface$ {
42
+ /** @deprecated use `AsteriskManagerInterface$inboundSchema` instead. */
43
+ export const inboundSchema = AsteriskManagerInterface$inboundSchema;
44
+ /** @deprecated use `AsteriskManagerInterface$outboundSchema` instead. */
45
+ export const outboundSchema = AsteriskManagerInterface$outboundSchema;
46
+ /** @deprecated use `AsteriskManagerInterface$Outbound` instead. */
47
+ export type Outbound = AsteriskManagerInterface$Outbound;
48
+ }
49
+
50
+ export function asteriskManagerInterfaceToJSON(
51
+ asteriskManagerInterface: AsteriskManagerInterface,
52
+ ): string {
53
+ return JSON.stringify(
54
+ AsteriskManagerInterface$outboundSchema.parse(asteriskManagerInterface),
55
+ );
56
+ }
57
+
58
+ export function asteriskManagerInterfaceFromJSON(
59
+ jsonString: string,
60
+ ): SafeParseResult<AsteriskManagerInterface, SDKValidationError> {
61
+ return safeParse(
62
+ jsonString,
63
+ (x) => AsteriskManagerInterface$inboundSchema.parse(JSON.parse(x)),
64
+ `Failed to parse 'AsteriskManagerInterface' from JSON`,
65
+ );
66
+ }