@censys/platform-sdk 0.8.0 → 0.9.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.
Files changed (383) hide show
  1. package/README.md +14 -8
  2. package/docs/sdks/accountmanagement/README.md +169 -5
  3. package/docs/sdks/collections/README.md +6 -7
  4. package/docs/sdks/globaldata/README.md +0 -1
  5. package/docs/sdks/threathunting/README.md +78 -1
  6. package/examples/package-lock.json +1 -1
  7. package/funcs/accountManagementGetMemberCreditUsage.d.ts +2 -2
  8. package/funcs/accountManagementGetMemberCreditUsage.js +5 -2
  9. package/funcs/accountManagementGetMemberCreditUsage.js.map +1 -1
  10. package/funcs/accountManagementGetOrganizationCreditUsage.d.ts +1 -1
  11. package/funcs/accountManagementGetOrganizationCreditUsage.js +5 -1
  12. package/funcs/accountManagementGetOrganizationCreditUsage.js.map +1 -1
  13. package/funcs/accountManagementGetOrganizationCredits.d.ts +1 -1
  14. package/funcs/accountManagementGetOrganizationCredits.js +1 -1
  15. package/funcs/accountManagementGetUserCredits.d.ts +18 -0
  16. package/funcs/accountManagementGetUserCredits.d.ts.map +1 -0
  17. package/funcs/accountManagementGetUserCredits.js +112 -0
  18. package/funcs/accountManagementGetUserCredits.js.map +1 -0
  19. package/funcs/accountManagementGetUserCreditsUsage.d.ts +18 -0
  20. package/funcs/accountManagementGetUserCreditsUsage.d.ts.map +1 -0
  21. package/funcs/accountManagementGetUserCreditsUsage.js +129 -0
  22. package/funcs/accountManagementGetUserCreditsUsage.js.map +1 -0
  23. package/funcs/collectionsCreate.d.ts +1 -1
  24. package/funcs/collectionsCreate.js +1 -1
  25. package/funcs/collectionsDelete.d.ts +1 -1
  26. package/funcs/collectionsDelete.js +1 -1
  27. package/funcs/collectionsGet.d.ts +1 -1
  28. package/funcs/collectionsGet.js +1 -1
  29. package/funcs/collectionsList.d.ts +1 -1
  30. package/funcs/collectionsList.js +1 -1
  31. package/funcs/collectionsListEvents.d.ts +1 -1
  32. package/funcs/collectionsListEvents.js +1 -1
  33. package/funcs/collectionsUpdate.d.ts +1 -1
  34. package/funcs/collectionsUpdate.js +1 -1
  35. package/funcs/threatHuntingListThreats.d.ts +18 -0
  36. package/funcs/threatHuntingListThreats.d.ts.map +1 -0
  37. package/funcs/threatHuntingListThreats.js +130 -0
  38. package/funcs/threatHuntingListThreats.js.map +1 -0
  39. package/jsr.json +1 -1
  40. package/lib/config.d.ts +4 -4
  41. package/lib/config.js +4 -4
  42. package/lib/encodings.d.ts +1 -0
  43. package/lib/encodings.d.ts.map +1 -1
  44. package/lib/encodings.js +12 -1
  45. package/lib/encodings.js.map +1 -1
  46. package/lib/sdks.js +2 -2
  47. package/lib/sdks.js.map +1 -1
  48. package/models/components/alternativequery.d.ts +3 -3
  49. package/models/components/alternativequery.d.ts.map +1 -1
  50. package/models/components/alternativequery.js +2 -2
  51. package/models/components/alternativequery.js.map +1 -1
  52. package/models/components/attribute.d.ts +4 -3
  53. package/models/components/attribute.d.ts.map +1 -1
  54. package/models/components/attribute.js +3 -2
  55. package/models/components/attribute.js.map +1 -1
  56. package/models/components/certificate.d.ts +5 -5
  57. package/models/components/certificate.d.ts.map +1 -1
  58. package/models/components/certificate.js +3 -3
  59. package/models/components/certificate.js.map +1 -1
  60. package/models/components/certificaterevocationrevocationinfo.d.ts +3 -3
  61. package/models/components/certificaterevocationrevocationinfo.d.ts.map +1 -1
  62. package/models/components/certificaterevocationrevocationinfo.js +2 -2
  63. package/models/components/certificaterevocationrevocationinfo.js.map +1 -1
  64. package/models/components/cobaltstrikeconfig.d.ts +1 -0
  65. package/models/components/cobaltstrikeconfig.d.ts.map +1 -1
  66. package/models/components/cobaltstrikeconfig.js +2 -0
  67. package/models/components/cobaltstrikeconfig.js.map +1 -1
  68. package/models/components/collection.d.ts +9 -5
  69. package/models/components/collection.d.ts.map +1 -1
  70. package/models/components/collection.js +5 -2
  71. package/models/components/collection.js.map +1 -1
  72. package/models/components/creditexpiration.d.ts +4 -0
  73. package/models/components/creditexpiration.d.ts.map +1 -1
  74. package/models/components/creditexpiration.js +2 -0
  75. package/models/components/creditexpiration.js.map +1 -1
  76. package/models/components/creditusagereport.d.ts +44 -5
  77. package/models/components/creditusagereport.d.ts.map +1 -1
  78. package/models/components/creditusagereport.js +28 -7
  79. package/models/components/creditusagereport.js.map +1 -1
  80. package/models/components/creditusagereportperiod.d.ts +33 -0
  81. package/models/components/creditusagereportperiod.d.ts.map +1 -0
  82. package/models/components/creditusagereportperiod.js +65 -0
  83. package/models/components/creditusagereportperiod.js.map +1 -0
  84. package/models/components/cvsscomponents.d.ts +17 -17
  85. package/models/components/cvsscomponents.d.ts.map +1 -1
  86. package/models/components/cvsscomponents.js +9 -9
  87. package/models/components/cvsscomponents.js.map +1 -1
  88. package/models/components/cvssv4components.d.ts +29 -29
  89. package/models/components/cvssv4components.d.ts.map +1 -1
  90. package/models/components/cvssv4components.js +15 -17
  91. package/models/components/cvssv4components.js.map +1 -1
  92. package/models/components/dns.d.ts +5 -5
  93. package/models/components/dns.d.ts.map +1 -1
  94. package/models/components/dns.js +3 -3
  95. package/models/components/dns.js.map +1 -1
  96. package/models/components/dnsresourcerecord.d.ts +3 -3
  97. package/models/components/dnsresourcerecord.d.ts.map +1 -1
  98. package/models/components/dnsresourcerecord.js +2 -1
  99. package/models/components/dnsresourcerecord.js.map +1 -1
  100. package/models/components/endpointscan.d.ts +3 -3
  101. package/models/components/endpointscan.d.ts.map +1 -1
  102. package/models/components/endpointscan.js +2 -1
  103. package/models/components/endpointscan.js.map +1 -1
  104. package/models/components/endpointscanstate.d.ts +5 -3
  105. package/models/components/endpointscanstate.d.ts.map +1 -1
  106. package/models/components/endpointscanstate.js +4 -1
  107. package/models/components/endpointscanstate.js.map +1 -1
  108. package/models/components/eventassetchange.d.ts +3 -3
  109. package/models/components/eventassetchange.d.ts.map +1 -1
  110. package/models/components/eventassetchange.js +2 -2
  111. package/models/components/eventassetchange.js.map +1 -1
  112. package/models/components/eventstatuschange.d.ts +5 -5
  113. package/models/components/eventstatuschange.d.ts.map +1 -1
  114. package/models/components/eventstatuschange.js +3 -4
  115. package/models/components/eventstatuschange.js.map +1 -1
  116. package/models/components/extractedendpointdata.d.ts +17 -0
  117. package/models/components/extractedendpointdata.d.ts.map +1 -0
  118. package/models/components/extractedendpointdata.js +65 -0
  119. package/models/components/extractedendpointdata.js.map +1 -0
  120. package/models/components/extractedendpointdataanalyticsservice.d.ts +11 -0
  121. package/models/components/extractedendpointdataanalyticsservice.d.ts.map +1 -0
  122. package/models/components/extractedendpointdataanalyticsservice.js +51 -0
  123. package/models/components/extractedendpointdataanalyticsservice.js.map +1 -0
  124. package/models/components/extractedendpointdatacopyright.d.ts +13 -0
  125. package/models/components/extractedendpointdatacopyright.d.ts.map +1 -0
  126. package/models/components/extractedendpointdatacopyright.js +59 -0
  127. package/models/components/extractedendpointdatacopyright.js.map +1 -0
  128. package/models/components/hajime.d.ts +10 -0
  129. package/models/components/hajime.d.ts.map +1 -0
  130. package/models/components/hajime.js +56 -0
  131. package/models/components/hajime.js.map +1 -0
  132. package/models/components/hostdnsforwardresolution.d.ts +3 -3
  133. package/models/components/hostdnsforwardresolution.d.ts.map +1 -1
  134. package/models/components/hostdnsforwardresolution.js +2 -2
  135. package/models/components/hostdnsforwardresolution.js.map +1 -1
  136. package/models/components/http.d.ts +7 -0
  137. package/models/components/http.d.ts.map +1 -1
  138. package/models/components/http.js +7 -0
  139. package/models/components/http.js.map +1 -1
  140. package/models/components/httpredirectchainlink.d.ts +25 -0
  141. package/models/components/httpredirectchainlink.d.ts.map +1 -0
  142. package/models/components/httpredirectchainlink.js +70 -0
  143. package/models/components/httpredirectchainlink.js.map +1 -0
  144. package/models/components/index.d.ts +14 -0
  145. package/models/components/index.d.ts.map +1 -1
  146. package/models/components/index.js +14 -0
  147. package/models/components/index.js.map +1 -1
  148. package/models/components/jarmscan.d.ts +3 -3
  149. package/models/components/jarmscan.d.ts.map +1 -1
  150. package/models/components/jarmscan.js +2 -1
  151. package/models/components/jarmscan.js.map +1 -1
  152. package/models/components/kev.d.ts +3 -3
  153. package/models/components/kev.d.ts.map +1 -1
  154. package/models/components/kev.js +2 -2
  155. package/models/components/kev.js.map +1 -1
  156. package/models/components/label.d.ts +4 -3
  157. package/models/components/label.d.ts.map +1 -1
  158. package/models/components/label.js +3 -2
  159. package/models/components/label.js.map +1 -1
  160. package/models/components/matchedservice.d.ts +3 -3
  161. package/models/components/matchedservice.d.ts.map +1 -1
  162. package/models/components/matchedservice.js +2 -1
  163. package/models/components/matchedservice.js.map +1 -1
  164. package/models/components/networklog.d.ts +18 -0
  165. package/models/components/networklog.d.ts.map +1 -0
  166. package/models/components/networklog.js +58 -0
  167. package/models/components/networklog.js.map +1 -0
  168. package/models/components/networklogresourceinfo.d.ts +49 -0
  169. package/models/components/networklogresourceinfo.d.ts.map +1 -0
  170. package/models/components/networklogresourceinfo.js +64 -0
  171. package/models/components/networklogresourceinfo.js.map +1 -0
  172. package/models/components/paginationinfo.d.ts +1 -1
  173. package/models/components/reject.d.ts +3 -3
  174. package/models/components/reject.d.ts.map +1 -1
  175. package/models/components/reject.js +2 -2
  176. package/models/components/reject.js.map +1 -1
  177. package/models/components/representativeinfo.d.ts +3 -3
  178. package/models/components/representativeinfo.d.ts.map +1 -1
  179. package/models/components/representativeinfo.js +2 -1
  180. package/models/components/representativeinfo.js.map +1 -1
  181. package/models/components/responseenvelopethreatslistresponse.d.ts +11 -0
  182. package/models/components/responseenvelopethreatslistresponse.d.ts.map +1 -0
  183. package/models/components/responseenvelopethreatslistresponse.js +51 -0
  184. package/models/components/responseenvelopethreatslistresponse.js.map +1 -0
  185. package/models/components/responseenvelopeusercredits.d.ts +11 -0
  186. package/models/components/responseenvelopeusercredits.d.ts.map +1 -0
  187. package/models/components/responseenvelopeusercredits.js +51 -0
  188. package/models/components/responseenvelopeusercredits.js.map +1 -0
  189. package/models/components/risk.d.ts +8 -7
  190. package/models/components/risk.d.ts.map +1 -1
  191. package/models/components/risk.js +5 -6
  192. package/models/components/risk.js.map +1 -1
  193. package/models/components/rootstore.d.ts +3 -3
  194. package/models/components/rootstore.d.ts.map +1 -1
  195. package/models/components/rootstore.js +2 -1
  196. package/models/components/rootstore.js.map +1 -1
  197. package/models/components/searchconvertqueryresponse.d.ts +3 -3
  198. package/models/components/searchconvertqueryresponse.d.ts.map +1 -1
  199. package/models/components/searchconvertqueryresponse.js +2 -1
  200. package/models/components/searchconvertqueryresponse.js.map +1 -1
  201. package/models/components/service.d.ts +5 -3
  202. package/models/components/service.d.ts.map +1 -1
  203. package/models/components/service.js +4 -1
  204. package/models/components/service.js.map +1 -1
  205. package/models/components/serviceid.d.ts +3 -3
  206. package/models/components/serviceid.d.ts.map +1 -1
  207. package/models/components/serviceid.js +2 -1
  208. package/models/components/serviceid.js.map +1 -1
  209. package/models/components/servicescan.d.ts +5 -3
  210. package/models/components/servicescan.d.ts.map +1 -1
  211. package/models/components/servicescan.js +4 -1
  212. package/models/components/servicescan.js.map +1 -1
  213. package/models/components/sourceusagebreakdown.d.ts +9 -1
  214. package/models/components/sourceusagebreakdown.d.ts.map +1 -1
  215. package/models/components/sourceusagebreakdown.js +7 -0
  216. package/models/components/sourceusagebreakdown.js.map +1 -1
  217. package/models/components/threat.d.ts +4 -3
  218. package/models/components/threat.d.ts.map +1 -1
  219. package/models/components/threat.js +3 -1
  220. package/models/components/threat.js.map +1 -1
  221. package/models/components/threatlistitem.d.ts +42 -0
  222. package/models/components/threatlistitem.d.ts.map +1 -0
  223. package/models/components/threatlistitem.js +66 -0
  224. package/models/components/threatlistitem.js.map +1 -0
  225. package/models/components/threatreference.d.ts +13 -0
  226. package/models/components/threatreference.d.ts.map +1 -0
  227. package/models/components/threatreference.js +50 -0
  228. package/models/components/threatreference.js.map +1 -0
  229. package/models/components/threatslistresponse.d.ts +14 -0
  230. package/models/components/threatslistresponse.d.ts.map +1 -0
  231. package/models/components/threatslistresponse.js +51 -0
  232. package/models/components/threatslistresponse.js.map +1 -0
  233. package/models/components/tls.d.ts +3 -3
  234. package/models/components/tls.d.ts.map +1 -1
  235. package/models/components/tls.js +2 -1
  236. package/models/components/tls.js.map +1 -1
  237. package/models/components/tlsversiondata.d.ts +3 -3
  238. package/models/components/tlsversiondata.d.ts.map +1 -1
  239. package/models/components/tlsversiondata.js +2 -2
  240. package/models/components/tlsversiondata.js.map +1 -1
  241. package/models/components/trackedscantask.d.ts +3 -3
  242. package/models/components/trackedscantask.d.ts.map +1 -1
  243. package/models/components/trackedscantask.js +2 -1
  244. package/models/components/trackedscantask.js.map +1 -1
  245. package/models/components/usercredits.d.ts +17 -0
  246. package/models/components/usercredits.d.ts.map +1 -0
  247. package/models/components/usercredits.js +57 -0
  248. package/models/components/usercredits.js.map +1 -0
  249. package/models/components/vuln.d.ts +8 -7
  250. package/models/components/vuln.d.ts.map +1 -1
  251. package/models/components/vuln.js +5 -4
  252. package/models/components/vuln.js.map +1 -1
  253. package/models/operations/index.d.ts +3 -0
  254. package/models/operations/index.d.ts.map +1 -1
  255. package/models/operations/index.js +3 -0
  256. package/models/operations/index.js.map +1 -1
  257. package/models/operations/v3accountmanagementmembercreditsusage.d.ts +33 -3
  258. package/models/operations/v3accountmanagementmembercreditsusage.d.ts.map +1 -1
  259. package/models/operations/v3accountmanagementmembercreditsusage.js +17 -2
  260. package/models/operations/v3accountmanagementmembercreditsusage.js.map +1 -1
  261. package/models/operations/v3accountmanagementorgcreditsusage.d.ts +38 -3
  262. package/models/operations/v3accountmanagementorgcreditsusage.d.ts.map +1 -1
  263. package/models/operations/v3accountmanagementorgcreditsusage.js +20 -2
  264. package/models/operations/v3accountmanagementorgcreditsusage.js.map +1 -1
  265. package/models/operations/v3accountmanagementusercredits.d.ts +14 -0
  266. package/models/operations/v3accountmanagementusercredits.d.ts.map +1 -0
  267. package/models/operations/v3accountmanagementusercredits.js +58 -0
  268. package/models/operations/v3accountmanagementusercredits.js.map +1 -0
  269. package/models/operations/v3accountmanagementusercreditsusage.d.ts +57 -0
  270. package/models/operations/v3accountmanagementusercreditsusage.d.ts.map +1 -0
  271. package/models/operations/v3accountmanagementusercreditsusage.js +85 -0
  272. package/models/operations/v3accountmanagementusercreditsusage.js.map +1 -0
  273. package/models/operations/v3globaldatasearchaggregate.d.ts +1 -1
  274. package/models/operations/v3globaldatasearchquery.d.ts +1 -1
  275. package/models/operations/v3threathuntingthreatslist.d.ts +35 -0
  276. package/models/operations/v3threathuntingthreatslist.d.ts.map +1 -0
  277. package/models/operations/v3threathuntingthreatslist.js +71 -0
  278. package/models/operations/v3threathuntingthreatslist.js.map +1 -0
  279. package/package.json +1 -1
  280. package/sdk/accountmanagement.d.ts +18 -4
  281. package/sdk/accountmanagement.d.ts.map +1 -1
  282. package/sdk/accountmanagement.js +24 -4
  283. package/sdk/accountmanagement.js.map +1 -1
  284. package/sdk/collections.d.ts +6 -6
  285. package/sdk/collections.js +6 -6
  286. package/sdk/threathunting.d.ts +7 -0
  287. package/sdk/threathunting.d.ts.map +1 -1
  288. package/sdk/threathunting.js +10 -0
  289. package/sdk/threathunting.js.map +1 -1
  290. package/src/funcs/accountManagementGetMemberCreditUsage.ts +5 -2
  291. package/src/funcs/accountManagementGetOrganizationCreditUsage.ts +5 -1
  292. package/src/funcs/accountManagementGetOrganizationCredits.ts +1 -1
  293. package/src/funcs/accountManagementGetUserCredits.ts +163 -0
  294. package/src/funcs/accountManagementGetUserCreditsUsage.ts +190 -0
  295. package/src/funcs/collectionsCreate.ts +1 -1
  296. package/src/funcs/collectionsDelete.ts +1 -1
  297. package/src/funcs/collectionsGet.ts +1 -1
  298. package/src/funcs/collectionsList.ts +1 -1
  299. package/src/funcs/collectionsListEvents.ts +1 -1
  300. package/src/funcs/collectionsUpdate.ts +1 -1
  301. package/src/funcs/threatHuntingListThreats.ts +187 -0
  302. package/src/lib/config.ts +4 -4
  303. package/src/lib/encodings.ts +17 -3
  304. package/src/lib/sdks.ts +2 -2
  305. package/src/models/components/alternativequery.ts +5 -4
  306. package/src/models/components/attribute.ts +6 -4
  307. package/src/models/components/certificate.ts +14 -8
  308. package/src/models/components/certificaterevocationrevocationinfo.ts +5 -4
  309. package/src/models/components/cobaltstrikeconfig.ts +3 -0
  310. package/src/models/components/collection.ts +20 -8
  311. package/src/models/components/creditexpiration.ts +6 -0
  312. package/src/models/components/creditusagereport.ts +70 -11
  313. package/src/models/components/creditusagereportperiod.ts +69 -0
  314. package/src/models/components/cvsscomponents.ts +47 -30
  315. package/src/models/components/cvssv4components.ts +83 -53
  316. package/src/models/components/dns.ts +11 -8
  317. package/src/models/components/dnsresourcerecord.ts +8 -5
  318. package/src/models/components/endpointscan.ts +8 -5
  319. package/src/models/components/endpointscanstate.ts +14 -5
  320. package/src/models/components/eventassetchange.ts +8 -4
  321. package/src/models/components/eventstatuschange.ts +14 -7
  322. package/src/models/components/extractedendpointdata.ts +62 -0
  323. package/src/models/components/extractedendpointdataanalyticsservice.ts +34 -0
  324. package/src/models/components/extractedendpointdatacopyright.ts +43 -0
  325. package/src/models/components/hajime.ts +33 -0
  326. package/src/models/components/hostdnsforwardresolution.ts +8 -4
  327. package/src/models/components/http.ts +15 -0
  328. package/src/models/components/httpredirectchainlink.ts +65 -0
  329. package/src/models/components/index.ts +14 -0
  330. package/src/models/components/jarmscan.ts +8 -5
  331. package/src/models/components/kev.ts +8 -4
  332. package/src/models/components/label.ts +9 -4
  333. package/src/models/components/matchedservice.ts +8 -5
  334. package/src/models/components/networklog.ts +49 -0
  335. package/src/models/components/networklogresourceinfo.ts +84 -0
  336. package/src/models/components/paginationinfo.ts +1 -1
  337. package/src/models/components/reject.ts +8 -4
  338. package/src/models/components/representativeinfo.ts +8 -5
  339. package/src/models/components/responseenvelopethreatslistresponse.ts +36 -0
  340. package/src/models/components/responseenvelopeusercredits.ts +32 -0
  341. package/src/models/components/risk.ts +21 -10
  342. package/src/models/components/rootstore.ts +5 -5
  343. package/src/models/components/searchconvertqueryresponse.ts +8 -5
  344. package/src/models/components/service.ts +11 -5
  345. package/src/models/components/serviceid.ts +8 -5
  346. package/src/models/components/servicescan.ts +11 -5
  347. package/src/models/components/sourceusagebreakdown.ts +16 -1
  348. package/src/models/components/threat.ts +9 -4
  349. package/src/models/components/threatlistitem.ts +81 -0
  350. package/src/models/components/threatreference.ts +34 -0
  351. package/src/models/components/threatslistresponse.ts +38 -0
  352. package/src/models/components/tls.ts +8 -5
  353. package/src/models/components/tlsversiondata.ts +5 -4
  354. package/src/models/components/trackedscantask.ts +8 -5
  355. package/src/models/components/usercredits.ts +45 -0
  356. package/src/models/components/vuln.ts +21 -11
  357. package/src/models/operations/index.ts +3 -0
  358. package/src/models/operations/v3accountmanagementmembercreditsusage.ts +43 -4
  359. package/src/models/operations/v3accountmanagementorgcreditsusage.ts +49 -4
  360. package/src/models/operations/v3accountmanagementusercredits.ts +41 -0
  361. package/src/models/operations/v3accountmanagementusercreditsusage.ts +128 -0
  362. package/src/models/operations/v3globaldatasearchaggregate.ts +1 -1
  363. package/src/models/operations/v3globaldatasearchquery.ts +1 -1
  364. package/src/models/operations/v3threathuntingthreatslist.ts +86 -0
  365. package/src/sdk/accountmanagement.ts +38 -4
  366. package/src/sdk/collections.ts +6 -6
  367. package/src/sdk/threathunting.ts +18 -0
  368. package/src/types/enums.ts +38 -9
  369. package/src/types/index.ts +2 -2
  370. package/src/types/unrecognized.ts +35 -0
  371. package/tsconfig.json +1 -2
  372. package/types/enums.d.ts +8 -11
  373. package/types/enums.d.ts.map +1 -1
  374. package/types/enums.js +59 -3
  375. package/types/enums.js.map +1 -1
  376. package/types/index.d.ts +2 -2
  377. package/types/index.d.ts.map +1 -1
  378. package/types/index.js +16 -3
  379. package/types/index.js.map +1 -1
  380. package/types/unrecognized.d.ts +16 -0
  381. package/types/unrecognized.d.ts.map +1 -0
  382. package/types/unrecognized.js +34 -0
  383. package/types/unrecognized.js.map +1 -0
@@ -5,7 +5,8 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
9
10
  import { Result as SafeParseResult } from "../../types/fp.js";
10
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
12
 
@@ -16,7 +17,7 @@ export const CollectionStatus = {
16
17
  Paused: "paused",
17
18
  Archived: "archived",
18
19
  } as const;
19
- export type CollectionStatus = ClosedEnum<typeof CollectionStatus>;
20
+ export type CollectionStatus = OpenEnum<typeof CollectionStatus>;
20
21
 
21
22
  export const StatusReason = {
22
23
  Unspecified: "unspecified",
@@ -27,11 +28,15 @@ export const StatusReason = {
27
28
  QueryChanged: "query_changed",
28
29
  Initial: "initial",
29
30
  } as const;
30
- export type StatusReason = ClosedEnum<typeof StatusReason>;
31
+ export type StatusReason = OpenEnum<typeof StatusReason>;
31
32
 
32
33
  export type Collection = {
33
34
  addedAssets24Hours: number;
34
35
  createTime: Date;
36
+ /**
37
+ * The ID of a Censys user who created the collection.
38
+ */
39
+ createdBy?: string | undefined;
35
40
  description: string;
36
41
  id: string;
37
42
  name: string;
@@ -43,13 +48,18 @@ export type Collection = {
43
48
  };
44
49
 
45
50
  /** @internal */
46
- export const CollectionStatus$inboundSchema: z.ZodNativeEnum<
47
- typeof CollectionStatus
48
- > = z.nativeEnum(CollectionStatus);
51
+ export const CollectionStatus$inboundSchema: z.ZodType<
52
+ CollectionStatus,
53
+ z.ZodTypeDef,
54
+ unknown
55
+ > = openEnums.inboundSchema(CollectionStatus);
49
56
 
50
57
  /** @internal */
51
- export const StatusReason$inboundSchema: z.ZodNativeEnum<typeof StatusReason> =
52
- z.nativeEnum(StatusReason);
58
+ export const StatusReason$inboundSchema: z.ZodType<
59
+ StatusReason,
60
+ z.ZodTypeDef,
61
+ unknown
62
+ > = openEnums.inboundSchema(StatusReason);
53
63
 
54
64
  /** @internal */
55
65
  export const Collection$inboundSchema: z.ZodType<
@@ -61,6 +71,7 @@ export const Collection$inboundSchema: z.ZodType<
61
71
  create_time: z.string().datetime({ offset: true }).transform(v =>
62
72
  new Date(v)
63
73
  ),
74
+ created_by: z.string().optional(),
64
75
  description: z.string(),
65
76
  id: z.string(),
66
77
  name: z.string(),
@@ -73,6 +84,7 @@ export const Collection$inboundSchema: z.ZodType<
73
84
  return remap$(v, {
74
85
  "added_assets_24_hours": "addedAssets24Hours",
75
86
  "create_time": "createTime",
87
+ "created_by": "createdBy",
76
88
  "removed_assets_24_hours": "removedAssets24Hours",
77
89
  "status_reason": "statusReason",
78
90
  "total_assets": "totalAssets",
@@ -21,6 +21,10 @@ export type CreditExpiration = {
21
21
  * The date and time the credit expiration will expire.
22
22
  */
23
23
  expiresAt?: Date | undefined;
24
+ /**
25
+ * The initial balance of the credit expiration (i.e. how much was purchased).
26
+ */
27
+ initialBalance: number;
24
28
  };
25
29
 
26
30
  /** @internal */
@@ -34,10 +38,12 @@ export const CreditExpiration$inboundSchema: z.ZodType<
34
38
  .optional(),
35
39
  expires_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
36
40
  .optional(),
41
+ initial_balance: z.number().int(),
37
42
  }).transform((v) => {
38
43
  return remap$(v, {
39
44
  "created_at": "createdAt",
40
45
  "expires_at": "expiresAt",
46
+ "initial_balance": "initialBalance",
41
47
  });
42
48
  });
43
49
 
@@ -5,45 +5,104 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
8
10
  import { Result as SafeParseResult } from "../../types/fp.js";
9
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+ import {
13
+ CreditUsageReportPeriod,
14
+ CreditUsageReportPeriod$inboundSchema,
15
+ } from "./creditusagereportperiod.js";
10
16
  import {
11
17
  SourceUsageBreakdown,
12
18
  SourceUsageBreakdown$inboundSchema,
13
19
  } from "./sourceusagebreakdown.js";
14
20
 
21
+ /**
22
+ * The granularity of the report.
23
+ */
24
+ export const Granularity = {
25
+ Daily: "daily",
26
+ Monthly: "monthly",
27
+ } as const;
28
+ /**
29
+ * The granularity of the report.
30
+ */
31
+ export type Granularity = OpenEnum<typeof Granularity>;
32
+
15
33
  export type CreditUsageReport = {
16
34
  /**
17
- * The end date of the window for this report.
35
+ * The breakdown of credits consumed by consumer. This may not be present if the report is generated for a specific user.
36
+ */
37
+ creditsConsumedByConsumer?: string | undefined;
38
+ creditsConsumedBySource: SourceUsageBreakdown;
39
+ /**
40
+ * The end time of the window for this report.
41
+ */
42
+ endTime: Date;
43
+ /**
44
+ * The granularity of the report.
45
+ */
46
+ granularity: Granularity;
47
+ /**
48
+ * The periods of the report (i.e. time buckets).
18
49
  */
19
- endDate: Date;
20
- sourceBreakdown: SourceUsageBreakdown;
50
+ periods: Array<CreditUsageReportPeriod> | null;
21
51
  /**
22
- * The start date of the window for this report.
52
+ * The start time of the window for this report.
23
53
  */
24
- startDate: Date;
54
+ startTime: Date;
55
+ /**
56
+ * The total amount of credits added during the report period.
57
+ */
58
+ totalAdded: number;
25
59
  /**
26
60
  * The total amount of credits consumed during the report period.
27
61
  */
28
62
  totalConsumed: number;
63
+ /**
64
+ * The total amount of credits expired during the report period.
65
+ */
66
+ totalExpired: number;
67
+ /**
68
+ * The total number of transactions during the report period.
69
+ */
70
+ transactionCount: number;
29
71
  };
30
72
 
73
+ /** @internal */
74
+ export const Granularity$inboundSchema: z.ZodType<
75
+ Granularity,
76
+ z.ZodTypeDef,
77
+ unknown
78
+ > = openEnums.inboundSchema(Granularity);
79
+
31
80
  /** @internal */
32
81
  export const CreditUsageReport$inboundSchema: z.ZodType<
33
82
  CreditUsageReport,
34
83
  z.ZodTypeDef,
35
84
  unknown
36
85
  > = z.object({
37
- end_date: z.string().datetime({ offset: true }).transform(v => new Date(v)),
38
- source_breakdown: SourceUsageBreakdown$inboundSchema,
39
- start_date: z.string().datetime({ offset: true }).transform(v => new Date(v)),
86
+ credits_consumed_by_consumer: z.string().optional(),
87
+ credits_consumed_by_source: SourceUsageBreakdown$inboundSchema,
88
+ end_time: z.string().datetime({ offset: true }).transform(v => new Date(v)),
89
+ granularity: Granularity$inboundSchema.default("daily"),
90
+ periods: z.nullable(z.array(CreditUsageReportPeriod$inboundSchema)),
91
+ start_time: z.string().datetime({ offset: true }).transform(v => new Date(v)),
92
+ total_added: z.number().int(),
40
93
  total_consumed: z.number().int(),
94
+ total_expired: z.number().int(),
95
+ transaction_count: z.number().int(),
41
96
  }).transform((v) => {
42
97
  return remap$(v, {
43
- "end_date": "endDate",
44
- "source_breakdown": "sourceBreakdown",
45
- "start_date": "startDate",
98
+ "credits_consumed_by_consumer": "creditsConsumedByConsumer",
99
+ "credits_consumed_by_source": "creditsConsumedBySource",
100
+ "end_time": "endTime",
101
+ "start_time": "startTime",
102
+ "total_added": "totalAdded",
46
103
  "total_consumed": "totalConsumed",
104
+ "total_expired": "totalExpired",
105
+ "transaction_count": "transactionCount",
47
106
  });
48
107
  });
49
108
 
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 CreditUsageReportPeriod = {
12
+ /**
13
+ * The total amount of credits added during the report period.
14
+ */
15
+ creditsAdded: number;
16
+ /**
17
+ * The total amount of credits consumed during the report period.
18
+ */
19
+ creditsConsumed: number;
20
+ /**
21
+ * The total amount of credits expired during the report period.
22
+ */
23
+ creditsExpired: number;
24
+ /**
25
+ * The end date of the window for this report period.
26
+ */
27
+ endDate: Date;
28
+ /**
29
+ * The start date of the window for this report period.
30
+ */
31
+ startDate: Date;
32
+ /**
33
+ * The total number of transactions during the report period.
34
+ */
35
+ transactionCount: number;
36
+ };
37
+
38
+ /** @internal */
39
+ export const CreditUsageReportPeriod$inboundSchema: z.ZodType<
40
+ CreditUsageReportPeriod,
41
+ z.ZodTypeDef,
42
+ unknown
43
+ > = z.object({
44
+ credits_added: z.number().int(),
45
+ credits_consumed: z.number().int(),
46
+ credits_expired: z.number().int(),
47
+ end_date: z.string().datetime({ offset: true }).transform(v => new Date(v)),
48
+ start_date: z.string().datetime({ offset: true }).transform(v => new Date(v)),
49
+ transaction_count: z.number().int(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ "credits_added": "creditsAdded",
53
+ "credits_consumed": "creditsConsumed",
54
+ "credits_expired": "creditsExpired",
55
+ "end_date": "endDate",
56
+ "start_date": "startDate",
57
+ "transaction_count": "transactionCount",
58
+ });
59
+ });
60
+
61
+ export function creditUsageReportPeriodFromJSON(
62
+ jsonString: string,
63
+ ): SafeParseResult<CreditUsageReportPeriod, SDKValidationError> {
64
+ return safeParse(
65
+ jsonString,
66
+ (x) => CreditUsageReportPeriod$inboundSchema.parse(JSON.parse(x)),
67
+ `Failed to parse 'CreditUsageReportPeriod' from JSON`,
68
+ );
69
+ }
@@ -5,7 +5,8 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
9
10
  import { Result as SafeParseResult } from "../../types/fp.js";
10
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
12
 
@@ -20,7 +21,7 @@ export const AttackComplexity = {
20
21
  /**
21
22
  * Indicates conditions beyond the attacker’s control that must exist in order to exploit the vulnerability. The Attack Complexity metric is scored as either Low or High. There are two possible values: Low (L) – There are no specific pre-conditions required for exploitation, High (H) – The attacker must complete some number of preparatory steps in order to get access.
22
23
  */
23
- export type AttackComplexity = ClosedEnum<typeof AttackComplexity>;
24
+ export type AttackComplexity = OpenEnum<typeof AttackComplexity>;
24
25
 
25
26
  /**
26
27
  * Indicates the level of access required for an attacker to exploit the vulnerability. The Attack Vector metric is scored in one of four levels: Network (N) – Vulnerabilities with this rating are remotely exploitable, from one or more hops away, up to, and including, remote exploitation over the Internet, Adjacent (A) – A vulnerability with this rating requires network adjacency for exploitation. The attack must be launched from the same physical or logical network, Local (L) – Vulnerabilities with this rating are not exploitable over a network, Physical (P) – An attacker must physically interact with the target system.
@@ -35,7 +36,7 @@ export const AttackVector = {
35
36
  /**
36
37
  * Indicates the level of access required for an attacker to exploit the vulnerability. The Attack Vector metric is scored in one of four levels: Network (N) – Vulnerabilities with this rating are remotely exploitable, from one or more hops away, up to, and including, remote exploitation over the Internet, Adjacent (A) – A vulnerability with this rating requires network adjacency for exploitation. The attack must be launched from the same physical or logical network, Local (L) – Vulnerabilities with this rating are not exploitable over a network, Physical (P) – An attacker must physically interact with the target system.
37
38
  */
38
- export type AttackVector = ClosedEnum<typeof AttackVector>;
39
+ export type AttackVector = OpenEnum<typeof AttackVector>;
39
40
 
40
41
  /**
41
42
  * If an attack renders information unavailable, such as when a system crashes or through a DDoS attack, availability is negatively impacted. Availability has three possible values: None (N) – There is no loss of availability, Low (L) – Availability might be intermittently limited, or performance might be negatively impacted, as a result of a successful attack, High (H) – There is a complete loss of availability of the impacted system or information.
@@ -49,7 +50,7 @@ export const Availability = {
49
50
  /**
50
51
  * If an attack renders information unavailable, such as when a system crashes or through a DDoS attack, availability is negatively impacted. Availability has three possible values: None (N) – There is no loss of availability, Low (L) – Availability might be intermittently limited, or performance might be negatively impacted, as a result of a successful attack, High (H) – There is a complete loss of availability of the impacted system or information.
51
52
  */
52
- export type Availability = ClosedEnum<typeof Availability>;
53
+ export type Availability = OpenEnum<typeof Availability>;
53
54
 
54
55
  /**
55
56
  * Refers to the disclosure of sensitive information to authorized and unauthorized users, with the goal being that only authorized users are able to access the target data. Confidentiality has three potential values: High (H) – The attacker has full access to all resources in the impacted system, including highly sensitive information such as encryption keys, Low (L) – The attacker has partial access to information, with no control over what, specifically, they are able to access, None (N) – No data is accessible to unauthorized users as a result of the exploit.
@@ -63,7 +64,7 @@ export const Confidentiality = {
63
64
  /**
64
65
  * Refers to the disclosure of sensitive information to authorized and unauthorized users, with the goal being that only authorized users are able to access the target data. Confidentiality has three potential values: High (H) – The attacker has full access to all resources in the impacted system, including highly sensitive information such as encryption keys, Low (L) – The attacker has partial access to information, with no control over what, specifically, they are able to access, None (N) – No data is accessible to unauthorized users as a result of the exploit.
65
66
  */
66
- export type Confidentiality = ClosedEnum<typeof Confidentiality>;
67
+ export type Confidentiality = OpenEnum<typeof Confidentiality>;
67
68
 
68
69
  /**
69
70
  * Refers to whether the protected information has been tampered with or changed in any way. If there is no way for an attacker to alter the accuracy or completeness of the information, integrity has been maintained. Integrity has three values: None (N) – There is no loss of the integrity of any information, Low (L) – A limited amount of information might be tampered with or modified, but there is no serious impact on the protected system, High (H) – The attacker can modify any/all information on the target system, resulting in a complete loss of integrity.
@@ -77,7 +78,7 @@ export const Integrity = {
77
78
  /**
78
79
  * Refers to whether the protected information has been tampered with or changed in any way. If there is no way for an attacker to alter the accuracy or completeness of the information, integrity has been maintained. Integrity has three values: None (N) – There is no loss of the integrity of any information, Low (L) – A limited amount of information might be tampered with or modified, but there is no serious impact on the protected system, High (H) – The attacker can modify any/all information on the target system, resulting in a complete loss of integrity.
79
80
  */
80
- export type Integrity = ClosedEnum<typeof Integrity>;
81
+ export type Integrity = OpenEnum<typeof Integrity>;
81
82
 
82
83
  /**
83
84
  * Describes the level of privileges or access an attacker must have before successful exploitation. There are three possible values: None (N) – There is no privilege or special access required to conduct the attack, Low (L) – The attacker requires basic, “user” level privileges to leverage the exploit, High (H) – Administrative or similar access privileges are required for successful attack.
@@ -91,7 +92,7 @@ export const PrivilegesRequired = {
91
92
  /**
92
93
  * Describes the level of privileges or access an attacker must have before successful exploitation. There are three possible values: None (N) – There is no privilege or special access required to conduct the attack, Low (L) – The attacker requires basic, “user” level privileges to leverage the exploit, High (H) – Administrative or similar access privileges are required for successful attack.
93
94
  */
94
- export type PrivilegesRequired = ClosedEnum<typeof PrivilegesRequired>;
95
+ export type PrivilegesRequired = OpenEnum<typeof PrivilegesRequired>;
95
96
 
96
97
  /**
97
98
  * Determines whether a vulnerability in one system or component can impact another system or component. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a scope change occurs. Scope has two possible ratings: Changed (C) – An exploited vulnerability can have a carry over impact on another system, Unchanged (U) – The exploited vulnerability is limited in damage to only the local security authority.
@@ -104,7 +105,7 @@ export const Scope = {
104
105
  /**
105
106
  * Determines whether a vulnerability in one system or component can impact another system or component. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a scope change occurs. Scope has two possible ratings: Changed (C) – An exploited vulnerability can have a carry over impact on another system, Unchanged (U) – The exploited vulnerability is limited in damage to only the local security authority.
106
107
  */
107
- export type Scope = ClosedEnum<typeof Scope>;
108
+ export type Scope = OpenEnum<typeof Scope>;
108
109
 
109
110
  /**
110
111
  * Describes whether a user, other than the attacker, is required to do anything or participate in exploitation of the vulnerability. User interaction has two possible values: None (N) – No user interaction is required, Required (R) – A user must complete some steps for the exploit to succeed. For example, a user might be required to install some software.
@@ -117,7 +118,7 @@ export const UserInteraction = {
117
118
  /**
118
119
  * Describes whether a user, other than the attacker, is required to do anything or participate in exploitation of the vulnerability. User interaction has two possible values: None (N) – No user interaction is required, Required (R) – A user must complete some steps for the exploit to succeed. For example, a user might be required to install some software.
119
120
  */
120
- export type UserInteraction = ClosedEnum<typeof UserInteraction>;
121
+ export type UserInteraction = OpenEnum<typeof UserInteraction>;
121
122
 
122
123
  export type CVSSComponents = {
123
124
  /**
@@ -155,41 +156,57 @@ export type CVSSComponents = {
155
156
  };
156
157
 
157
158
  /** @internal */
158
- export const AttackComplexity$inboundSchema: z.ZodNativeEnum<
159
- typeof AttackComplexity
160
- > = z.nativeEnum(AttackComplexity);
159
+ export const AttackComplexity$inboundSchema: z.ZodType<
160
+ AttackComplexity,
161
+ z.ZodTypeDef,
162
+ unknown
163
+ > = openEnums.inboundSchema(AttackComplexity);
161
164
 
162
165
  /** @internal */
163
- export const AttackVector$inboundSchema: z.ZodNativeEnum<typeof AttackVector> =
164
- z.nativeEnum(AttackVector);
166
+ export const AttackVector$inboundSchema: z.ZodType<
167
+ AttackVector,
168
+ z.ZodTypeDef,
169
+ unknown
170
+ > = openEnums.inboundSchema(AttackVector);
165
171
 
166
172
  /** @internal */
167
- export const Availability$inboundSchema: z.ZodNativeEnum<typeof Availability> =
168
- z.nativeEnum(Availability);
173
+ export const Availability$inboundSchema: z.ZodType<
174
+ Availability,
175
+ z.ZodTypeDef,
176
+ unknown
177
+ > = openEnums.inboundSchema(Availability);
169
178
 
170
179
  /** @internal */
171
- export const Confidentiality$inboundSchema: z.ZodNativeEnum<
172
- typeof Confidentiality
173
- > = z.nativeEnum(Confidentiality);
180
+ export const Confidentiality$inboundSchema: z.ZodType<
181
+ Confidentiality,
182
+ z.ZodTypeDef,
183
+ unknown
184
+ > = openEnums.inboundSchema(Confidentiality);
174
185
 
175
186
  /** @internal */
176
- export const Integrity$inboundSchema: z.ZodNativeEnum<typeof Integrity> = z
177
- .nativeEnum(Integrity);
187
+ export const Integrity$inboundSchema: z.ZodType<
188
+ Integrity,
189
+ z.ZodTypeDef,
190
+ unknown
191
+ > = openEnums.inboundSchema(Integrity);
178
192
 
179
193
  /** @internal */
180
- export const PrivilegesRequired$inboundSchema: z.ZodNativeEnum<
181
- typeof PrivilegesRequired
182
- > = z.nativeEnum(PrivilegesRequired);
194
+ export const PrivilegesRequired$inboundSchema: z.ZodType<
195
+ PrivilegesRequired,
196
+ z.ZodTypeDef,
197
+ unknown
198
+ > = openEnums.inboundSchema(PrivilegesRequired);
183
199
 
184
200
  /** @internal */
185
- export const Scope$inboundSchema: z.ZodNativeEnum<typeof Scope> = z.nativeEnum(
186
- Scope,
187
- );
201
+ export const Scope$inboundSchema: z.ZodType<Scope, z.ZodTypeDef, unknown> =
202
+ openEnums.inboundSchema(Scope);
188
203
 
189
204
  /** @internal */
190
- export const UserInteraction$inboundSchema: z.ZodNativeEnum<
191
- typeof UserInteraction
192
- > = z.nativeEnum(UserInteraction);
205
+ export const UserInteraction$inboundSchema: z.ZodType<
206
+ UserInteraction,
207
+ z.ZodTypeDef,
208
+ unknown
209
+ > = openEnums.inboundSchema(UserInteraction);
193
210
 
194
211
  /** @internal */
195
212
  export const CVSSComponents$inboundSchema: z.ZodType<