@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
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { SDKCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
6
+ import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
7
7
  import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
@@ -33,11 +33,11 @@ import { Result } from "../types/fp.js";
33
33
  */
34
34
  export function globalDataGetCertificates(
35
35
  client: SDKCore,
36
- request: operations.V3GlobaldataAssetCertificateListRequest,
36
+ request: operations.V3GlobaldataAssetCertificateListPostRequest,
37
37
  options?: RequestOptions,
38
38
  ): APIPromise<
39
39
  Result<
40
- operations.V3GlobaldataAssetCertificateListResponse,
40
+ operations.V3GlobaldataAssetCertificateListPostResponse,
41
41
  | errors.ErrorModel
42
42
  | SDKBaseError
43
43
  | ResponseValidationError
@@ -58,12 +58,12 @@ export function globalDataGetCertificates(
58
58
 
59
59
  async function $do(
60
60
  client: SDKCore,
61
- request: operations.V3GlobaldataAssetCertificateListRequest,
61
+ request: operations.V3GlobaldataAssetCertificateListPostRequest,
62
62
  options?: RequestOptions,
63
63
  ): Promise<
64
64
  [
65
65
  Result<
66
- operations.V3GlobaldataAssetCertificateListResponse,
66
+ operations.V3GlobaldataAssetCertificateListPostResponse,
67
67
  | errors.ErrorModel
68
68
  | SDKBaseError
69
69
  | ResponseValidationError
@@ -80,26 +80,27 @@ async function $do(
80
80
  const parsed = safeParse(
81
81
  request,
82
82
  (value) =>
83
- operations.V3GlobaldataAssetCertificateListRequest$outboundSchema.parse(
84
- value,
85
- ),
83
+ operations.V3GlobaldataAssetCertificateListPostRequest$outboundSchema
84
+ .parse(value),
86
85
  "Input validation failed",
87
86
  );
88
87
  if (!parsed.ok) {
89
88
  return [parsed, { status: "invalid" }];
90
89
  }
91
90
  const payload = parsed.value;
92
- const body = null;
91
+ const body = encodeJSON("body", payload.AssetCertificateListInputBody, {
92
+ explode: true,
93
+ });
93
94
 
94
95
  const path = pathToFunc("/v3/global/asset/certificate")();
95
96
 
96
97
  const query = encodeFormQuery({
97
- "certificate_ids": payload.certificate_ids,
98
98
  "organization_id": payload.organization_id
99
99
  ?? client._options.organizationId,
100
100
  }, { explode: false });
101
101
 
102
102
  const headers = new Headers(compactMap({
103
+ "Content-Type": "application/json",
103
104
  Accept: "application/vnd.censys.api.v3.certificate.v1+json",
104
105
  }));
105
106
 
@@ -112,7 +113,7 @@ async function $do(
112
113
  const context = {
113
114
  options: client._options,
114
115
  baseURL: options?.serverURL ?? client._baseURL ?? "",
115
- operationID: "v3-globaldata-asset-certificate-list",
116
+ operationID: "v3-globaldata-asset-certificate-list-post",
116
117
  oAuth2Scopes: [],
117
118
 
118
119
  resolvedSecurity: requestSecurity,
@@ -126,7 +127,7 @@ async function $do(
126
127
 
127
128
  const requestRes = client._createRequest(context, {
128
129
  security: requestSecurity,
129
- method: "GET",
130
+ method: "POST",
130
131
  baseURL: options?.serverURL,
131
132
  path: path,
132
133
  headers: headers,
@@ -156,7 +157,7 @@ async function $do(
156
157
  };
157
158
 
158
159
  const [result] = await M.match<
159
- operations.V3GlobaldataAssetCertificateListResponse,
160
+ operations.V3GlobaldataAssetCertificateListPostResponse,
160
161
  | errors.ErrorModel
161
162
  | SDKBaseError
162
163
  | ResponseValidationError
@@ -169,7 +170,7 @@ async function $do(
169
170
  >(
170
171
  M.json(
171
172
  200,
172
- operations.V3GlobaldataAssetCertificateListResponse$inboundSchema,
173
+ operations.V3GlobaldataAssetCertificateListPostResponse$inboundSchema,
173
174
  {
174
175
  ctype: "application/vnd.censys.api.v3.certificate.v1+json",
175
176
  hdrs: true,
@@ -0,0 +1,187 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SDKCore } from "../core.js";
6
+ import { encodeFormQuery, encodeJSON } 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 multiple certificates in PEM format
30
+ *
31
+ * @remarks
32
+ * Retrieve the raw PEM-encoded format for multiple certificates. A certificate ID is its SHA-256 fingerprint in the Censys dataset.
33
+ */
34
+ export function globalDataGetCertificatesRaw(
35
+ client: SDKCore,
36
+ request: operations.V3GlobaldataAssetCertificateListRawPostRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ operations.V3GlobaldataAssetCertificateListRawPostResponse,
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.V3GlobaldataAssetCertificateListRawPostRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ operations.V3GlobaldataAssetCertificateListRawPostResponse,
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.V3GlobaldataAssetCertificateListRawPostRequest$outboundSchema
84
+ .parse(value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload.AssetCertificateListInputBody, {
92
+ explode: true,
93
+ });
94
+
95
+ const path = pathToFunc("/v3/global/asset/certificate/raw")();
96
+
97
+ const query = encodeFormQuery({
98
+ "organization_id": payload.organization_id
99
+ ?? client._options.organizationId,
100
+ }, { explode: false });
101
+
102
+ const headers = new Headers(compactMap({
103
+ "Content-Type": "application/json",
104
+ Accept: "application/json",
105
+ }));
106
+
107
+ const secConfig = await extractSecurity(client._options.personalAccessToken);
108
+ const securityInput = secConfig == null
109
+ ? {}
110
+ : { personalAccessToken: secConfig };
111
+ const requestSecurity = resolveGlobalSecurity(securityInput);
112
+
113
+ const context = {
114
+ options: client._options,
115
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
116
+ operationID: "v3-globaldata-asset-certificate-list-raw-post",
117
+ oAuth2Scopes: [],
118
+
119
+ resolvedSecurity: requestSecurity,
120
+
121
+ securitySource: client._options.personalAccessToken,
122
+ retryConfig: options?.retries
123
+ || client._options.retryConfig
124
+ || { strategy: "none" },
125
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
126
+ };
127
+
128
+ const requestRes = client._createRequest(context, {
129
+ security: requestSecurity,
130
+ method: "POST",
131
+ baseURL: options?.serverURL,
132
+ path: path,
133
+ headers: headers,
134
+ query: query,
135
+ body: body,
136
+ userAgent: client._options.userAgent,
137
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
138
+ }, options);
139
+ if (!requestRes.ok) {
140
+ return [requestRes, { status: "invalid" }];
141
+ }
142
+ const req = requestRes.value;
143
+
144
+ const doResult = await client._do(req, {
145
+ context,
146
+ errorCodes: ["401", "404", "4XX", "5XX"],
147
+ retryConfig: context.retryConfig,
148
+ retryCodes: context.retryCodes,
149
+ });
150
+ if (!doResult.ok) {
151
+ return [doResult, { status: "request-error", request: req }];
152
+ }
153
+ const response = doResult.value;
154
+
155
+ const responseFields = {
156
+ HttpMeta: { Response: response, Request: req },
157
+ };
158
+
159
+ const [result] = await M.match<
160
+ operations.V3GlobaldataAssetCertificateListRawPostResponse,
161
+ | errors.ErrorModel
162
+ | SDKBaseError
163
+ | ResponseValidationError
164
+ | ConnectionError
165
+ | RequestAbortedError
166
+ | RequestTimeoutError
167
+ | InvalidRequestError
168
+ | UnexpectedClientError
169
+ | SDKValidationError
170
+ >(
171
+ M.json(
172
+ 200,
173
+ operations.V3GlobaldataAssetCertificateListRawPostResponse$inboundSchema,
174
+ { hdrs: true, key: "Result" },
175
+ ),
176
+ M.jsonErr([401, 404], errors.ErrorModel$inboundSchema, {
177
+ ctype: "application/problem+json",
178
+ }),
179
+ M.fail("4XX"),
180
+ M.fail("5XX"),
181
+ )(response, req, { extraFields: responseFields });
182
+ if (!result.ok) {
183
+ return [result, { status: "complete", request: req, response }];
184
+ }
185
+
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
29
29
  * Get host event history
30
30
  *
31
31
  * @remarks
32
- * Retrieve event history for a host. A host ID is its IP address.
32
+ * Retrieve event history for a host. A host ID is its IP address.<br><br>Note that when a service protocol changes after a new scan (for example, from `UNKNOWN` to `NETBIOS`), this information will only be reflected in the `scan` object. It will not be shown in the `service_scanned diff` object.
33
33
  */
34
34
  export function globalDataGetHostTimeline(
35
35
  client: SDKCore,
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { SDKCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
6
+ import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
7
7
  import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
@@ -33,11 +33,11 @@ import { Result } from "../types/fp.js";
33
33
  */
34
34
  export function globalDataGetHosts(
35
35
  client: SDKCore,
36
- request: operations.V3GlobaldataAssetHostListRequest,
36
+ request: operations.V3GlobaldataAssetHostListPostRequest,
37
37
  options?: RequestOptions,
38
38
  ): APIPromise<
39
39
  Result<
40
- operations.V3GlobaldataAssetHostListResponse,
40
+ operations.V3GlobaldataAssetHostListPostResponse,
41
41
  | errors.ErrorModel
42
42
  | SDKBaseError
43
43
  | ResponseValidationError
@@ -58,12 +58,12 @@ export function globalDataGetHosts(
58
58
 
59
59
  async function $do(
60
60
  client: SDKCore,
61
- request: operations.V3GlobaldataAssetHostListRequest,
61
+ request: operations.V3GlobaldataAssetHostListPostRequest,
62
62
  options?: RequestOptions,
63
63
  ): Promise<
64
64
  [
65
65
  Result<
66
- operations.V3GlobaldataAssetHostListResponse,
66
+ operations.V3GlobaldataAssetHostListPostResponse,
67
67
  | errors.ErrorModel
68
68
  | SDKBaseError
69
69
  | ResponseValidationError
@@ -80,24 +80,28 @@ async function $do(
80
80
  const parsed = safeParse(
81
81
  request,
82
82
  (value) =>
83
- operations.V3GlobaldataAssetHostListRequest$outboundSchema.parse(value),
83
+ operations.V3GlobaldataAssetHostListPostRequest$outboundSchema.parse(
84
+ value,
85
+ ),
84
86
  "Input validation failed",
85
87
  );
86
88
  if (!parsed.ok) {
87
89
  return [parsed, { status: "invalid" }];
88
90
  }
89
91
  const payload = parsed.value;
90
- const body = null;
92
+ const body = encodeJSON("body", payload.AssetHostListInputBody, {
93
+ explode: true,
94
+ });
91
95
 
92
96
  const path = pathToFunc("/v3/global/asset/host")();
93
97
 
94
98
  const query = encodeFormQuery({
95
- "host_ids": payload.host_ids,
96
99
  "organization_id": payload.organization_id
97
100
  ?? client._options.organizationId,
98
101
  }, { explode: false });
99
102
 
100
103
  const headers = new Headers(compactMap({
104
+ "Content-Type": "application/json",
101
105
  Accept: "application/vnd.censys.api.v3.host.v1+json",
102
106
  }));
103
107
 
@@ -110,7 +114,7 @@ async function $do(
110
114
  const context = {
111
115
  options: client._options,
112
116
  baseURL: options?.serverURL ?? client._baseURL ?? "",
113
- operationID: "v3-globaldata-asset-host-list",
117
+ operationID: "v3-globaldata-asset-host-list-post",
114
118
  oAuth2Scopes: [],
115
119
 
116
120
  resolvedSecurity: requestSecurity,
@@ -124,7 +128,7 @@ async function $do(
124
128
 
125
129
  const requestRes = client._createRequest(context, {
126
130
  security: requestSecurity,
127
- method: "GET",
131
+ method: "POST",
128
132
  baseURL: options?.serverURL,
129
133
  path: path,
130
134
  headers: headers,
@@ -154,7 +158,7 @@ async function $do(
154
158
  };
155
159
 
156
160
  const [result] = await M.match<
157
- operations.V3GlobaldataAssetHostListResponse,
161
+ operations.V3GlobaldataAssetHostListPostResponse,
158
162
  | errors.ErrorModel
159
163
  | SDKBaseError
160
164
  | ResponseValidationError
@@ -165,11 +169,15 @@ async function $do(
165
169
  | UnexpectedClientError
166
170
  | SDKValidationError
167
171
  >(
168
- M.json(200, operations.V3GlobaldataAssetHostListResponse$inboundSchema, {
169
- ctype: "application/vnd.censys.api.v3.host.v1+json",
170
- hdrs: true,
171
- key: "Result",
172
- }),
172
+ M.json(
173
+ 200,
174
+ operations.V3GlobaldataAssetHostListPostResponse$inboundSchema,
175
+ {
176
+ ctype: "application/vnd.censys.api.v3.host.v1+json",
177
+ hdrs: true,
178
+ key: "Result",
179
+ },
180
+ ),
173
181
  M.jsonErr([401, 403], errors.ErrorModel$inboundSchema, {
174
182
  ctype: "application/problem+json",
175
183
  }),
@@ -26,11 +26,10 @@ 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
34
  export function globalDataGetTrackedScan(
36
35
  client: SDKCore,
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { SDKCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
6
+ import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
7
7
  import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
@@ -33,11 +33,11 @@ import { Result } from "../types/fp.js";
33
33
  */
34
34
  export function globalDataGetWebProperties(
35
35
  client: SDKCore,
36
- request: operations.V3GlobaldataAssetWebpropertyListRequest,
36
+ request: operations.V3GlobaldataAssetWebpropertyListPostRequest,
37
37
  options?: RequestOptions,
38
38
  ): APIPromise<
39
39
  Result<
40
- operations.V3GlobaldataAssetWebpropertyListResponse,
40
+ operations.V3GlobaldataAssetWebpropertyListPostResponse,
41
41
  | errors.ErrorModel
42
42
  | SDKBaseError
43
43
  | ResponseValidationError
@@ -58,12 +58,12 @@ export function globalDataGetWebProperties(
58
58
 
59
59
  async function $do(
60
60
  client: SDKCore,
61
- request: operations.V3GlobaldataAssetWebpropertyListRequest,
61
+ request: operations.V3GlobaldataAssetWebpropertyListPostRequest,
62
62
  options?: RequestOptions,
63
63
  ): Promise<
64
64
  [
65
65
  Result<
66
- operations.V3GlobaldataAssetWebpropertyListResponse,
66
+ operations.V3GlobaldataAssetWebpropertyListPostResponse,
67
67
  | errors.ErrorModel
68
68
  | SDKBaseError
69
69
  | ResponseValidationError
@@ -80,26 +80,27 @@ async function $do(
80
80
  const parsed = safeParse(
81
81
  request,
82
82
  (value) =>
83
- operations.V3GlobaldataAssetWebpropertyListRequest$outboundSchema.parse(
84
- value,
85
- ),
83
+ operations.V3GlobaldataAssetWebpropertyListPostRequest$outboundSchema
84
+ .parse(value),
86
85
  "Input validation failed",
87
86
  );
88
87
  if (!parsed.ok) {
89
88
  return [parsed, { status: "invalid" }];
90
89
  }
91
90
  const payload = parsed.value;
92
- const body = null;
91
+ const body = encodeJSON("body", payload.AssetWebpropertyListInputBody, {
92
+ explode: true,
93
+ });
93
94
 
94
95
  const path = pathToFunc("/v3/global/asset/webproperty")();
95
96
 
96
97
  const query = encodeFormQuery({
97
98
  "organization_id": payload.organization_id
98
99
  ?? client._options.organizationId,
99
- "webproperty_ids": payload.webproperty_ids,
100
100
  }, { explode: false });
101
101
 
102
102
  const headers = new Headers(compactMap({
103
+ "Content-Type": "application/json",
103
104
  Accept: "application/vnd.censys.api.v3.webproperty.v1+json",
104
105
  }));
105
106
 
@@ -112,7 +113,7 @@ async function $do(
112
113
  const context = {
113
114
  options: client._options,
114
115
  baseURL: options?.serverURL ?? client._baseURL ?? "",
115
- operationID: "v3-globaldata-asset-webproperty-list",
116
+ operationID: "v3-globaldata-asset-webproperty-list-post",
116
117
  oAuth2Scopes: [],
117
118
 
118
119
  resolvedSecurity: requestSecurity,
@@ -126,7 +127,7 @@ async function $do(
126
127
 
127
128
  const requestRes = client._createRequest(context, {
128
129
  security: requestSecurity,
129
- method: "GET",
130
+ method: "POST",
130
131
  baseURL: options?.serverURL,
131
132
  path: path,
132
133
  headers: headers,
@@ -156,7 +157,7 @@ async function $do(
156
157
  };
157
158
 
158
159
  const [result] = await M.match<
159
- operations.V3GlobaldataAssetWebpropertyListResponse,
160
+ operations.V3GlobaldataAssetWebpropertyListPostResponse,
160
161
  | errors.ErrorModel
161
162
  | SDKBaseError
162
163
  | ResponseValidationError
@@ -169,7 +170,7 @@ async function $do(
169
170
  >(
170
171
  M.json(
171
172
  200,
172
- operations.V3GlobaldataAssetWebpropertyListResponse$inboundSchema,
173
+ operations.V3GlobaldataAssetWebpropertyListPostResponse$inboundSchema,
173
174
  {
174
175
  ctype: "application/vnd.censys.api.v3.webproperty.v1+json",
175
176
  hdrs: true,
@@ -26,10 +26,10 @@ import { APICall, APIPromise } from "../types/async.js";
26
26
  import { Result } from "../types/fp.js";
27
27
 
28
28
  /**
29
- * Create a tracked discovery scan
29
+ * Live Discovery: Initiate a new scan
30
30
  *
31
31
  * @remarks
32
- * Create a new tracked discovery scan for a specified target. Discovery scans are used to scan new targets that have not been previously identified. The scan will be queued. The response will contain a scan ID that you can use with the [get tracked scan details endpoint](https://docs.censys.com/reference/v3-globaldata-scans-get#/) to monitor its status and results.<br><br>This endpoint is available to organizations that have access to the Threat Hunting module.
32
+ * Initiate a scan to look for a currently unobserved service at a specific IP and port (`ip:port`) or hostname and port (`hostname:port`). This is equivalent to the [Live Discovery](https://docs.censys.com/docs/platform-threat-hunting-use-live-scan-and-rescan-to-validate-infrastructure#/) feature available in the UI, but you can also target web properties in addition to hosts.<br><br>The scan may take several minutes to complete. The response will contain a scan ID that you can use to [monitor the scan's status](https://docs.censys.com/reference/v3-threathunting-scans-get#/). After the scan completes, perform a lookup on the target asset to retrieve detailed scan information.<br><br>This endpoint is available to organizations that have access to the Threat Hunting module. It costs 15 credits to execute this endpoint.
33
33
  */
34
34
  export function threatHuntingCreateTrackedScan(
35
35
  client: SDKCore,