@censys/platform-sdk 0.10.1 → 0.10.3

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 (268) hide show
  1. package/README.md +6 -0
  2. package/docs/sdks/threathunting/README.md +250 -1
  3. package/funcs/accountManagementGetMemberCreditUsage.js.map +1 -1
  4. package/funcs/accountManagementGetOrganizationCreditUsage.js.map +1 -1
  5. package/funcs/accountManagementGetOrganizationCredits.js.map +1 -1
  6. package/funcs/accountManagementGetOrganizationDetails.js.map +1 -1
  7. package/funcs/accountManagementInviteUserToOrganization.js.map +1 -1
  8. package/funcs/accountManagementListOrganizationMembers.js.map +1 -1
  9. package/funcs/accountManagementRemoveOrganizationMember.js.map +1 -1
  10. package/funcs/accountManagementUpdateOrganizationMember.js.map +1 -1
  11. package/funcs/collectionsAggregate.js.map +1 -1
  12. package/funcs/collectionsDelete.js.map +1 -1
  13. package/funcs/collectionsGet.js.map +1 -1
  14. package/funcs/collectionsListEvents.js.map +1 -1
  15. package/funcs/collectionsSearch.js.map +1 -1
  16. package/funcs/collectionsUpdate.js.map +1 -1
  17. package/funcs/globalDataGetCertificate.js.map +1 -1
  18. package/funcs/globalDataGetCertificateRaw.js.map +1 -1
  19. package/funcs/globalDataGetHost.js.map +1 -1
  20. package/funcs/globalDataGetHostTimeline.js.map +1 -1
  21. package/funcs/globalDataGetTrackedScan.js.map +1 -1
  22. package/funcs/globalDataGetWebProperty.js.map +1 -1
  23. package/funcs/globalDataListServicesOnHost.js.map +1 -1
  24. package/funcs/threatHuntingCreateCenseyeJob.d.ts +18 -0
  25. package/funcs/threatHuntingCreateCenseyeJob.d.ts.map +1 -0
  26. package/funcs/threatHuntingCreateCenseyeJob.js +131 -0
  27. package/funcs/threatHuntingCreateCenseyeJob.js.map +1 -0
  28. package/funcs/threatHuntingGetCenseyeJob.d.ts +18 -0
  29. package/funcs/threatHuntingGetCenseyeJob.d.ts.map +1 -0
  30. package/funcs/threatHuntingGetCenseyeJob.js +134 -0
  31. package/funcs/threatHuntingGetCenseyeJob.js.map +1 -0
  32. package/funcs/threatHuntingGetCenseyeJobResults.d.ts +18 -0
  33. package/funcs/threatHuntingGetCenseyeJobResults.d.ts.map +1 -0
  34. package/funcs/threatHuntingGetCenseyeJobResults.js +136 -0
  35. package/funcs/threatHuntingGetCenseyeJobResults.js.map +1 -0
  36. package/funcs/threatHuntingGetHostObservationsWithCertificate.js.map +1 -1
  37. package/funcs/threatHuntingGetTrackedScanThreatHunting.js.map +1 -1
  38. package/funcs/threatHuntingValueCounts.d.ts +1 -1
  39. package/funcs/threatHuntingValueCounts.js +1 -1
  40. package/jsr.json +1 -1
  41. package/lib/config.d.ts +4 -4
  42. package/lib/config.js +4 -4
  43. package/lib/config.js.map +1 -1
  44. package/lib/encodings.d.ts.map +1 -1
  45. package/lib/encodings.js +20 -5
  46. package/lib/encodings.js.map +1 -1
  47. package/lib/files.d.ts +13 -0
  48. package/lib/files.d.ts.map +1 -1
  49. package/lib/files.js +19 -0
  50. package/lib/files.js.map +1 -1
  51. package/lib/matchers.d.ts.map +1 -1
  52. package/lib/matchers.js +0 -1
  53. package/lib/matchers.js.map +1 -1
  54. package/lib/sdks.d.ts.map +1 -1
  55. package/lib/sdks.js +8 -4
  56. package/lib/sdks.js.map +1 -1
  57. package/lib/security.d.ts +1 -1
  58. package/lib/security.d.ts.map +1 -1
  59. package/lib/security.js +20 -10
  60. package/lib/security.js.map +1 -1
  61. package/lib/url.d.ts.map +1 -1
  62. package/lib/url.js +4 -2
  63. package/lib/url.js.map +1 -1
  64. package/models/components/censeyejob.d.ts +59 -0
  65. package/models/components/censeyejob.d.ts.map +1 -0
  66. package/models/components/censeyejob.js +85 -0
  67. package/models/components/censeyejob.js.map +1 -0
  68. package/models/components/censeyeresult.d.ts +18 -0
  69. package/models/components/censeyeresult.d.ts.map +1 -0
  70. package/models/components/censeyeresult.js +57 -0
  71. package/models/components/censeyeresult.js.map +1 -0
  72. package/models/components/censeyeresultsresponse.d.ts +18 -0
  73. package/models/components/censeyeresultsresponse.d.ts.map +1 -0
  74. package/models/components/censeyeresultsresponse.js +57 -0
  75. package/models/components/censeyeresultsresponse.js.map +1 -0
  76. package/models/components/censeyetarget.d.ts +30 -0
  77. package/models/components/censeyetarget.d.ts.map +1 -0
  78. package/models/components/censeyetarget.js +75 -0
  79. package/models/components/censeyetarget.js.map +1 -0
  80. package/models/components/countcondition.d.ts +1 -1
  81. package/models/components/createcenseyejobinputbody.d.ts +13 -0
  82. package/models/components/createcenseyejobinputbody.d.ts.map +1 -0
  83. package/models/components/createcenseyejobinputbody.js +50 -0
  84. package/models/components/createcenseyejobinputbody.js.map +1 -0
  85. package/models/components/fieldvaluepair.d.ts +5 -0
  86. package/models/components/fieldvaluepair.d.ts.map +1 -1
  87. package/models/components/fieldvaluepair.js +11 -1
  88. package/models/components/fieldvaluepair.js.map +1 -1
  89. package/models/components/host.d.ts +12 -0
  90. package/models/components/host.d.ts.map +1 -1
  91. package/models/components/host.js +7 -0
  92. package/models/components/host.js.map +1 -1
  93. package/models/components/index.d.ts +21 -0
  94. package/models/components/index.d.ts.map +1 -1
  95. package/models/components/index.js +21 -0
  96. package/models/components/index.js.map +1 -1
  97. package/models/components/networkclassification.d.ts +27 -0
  98. package/models/components/networkclassification.d.ts.map +1 -0
  99. package/models/components/networkclassification.js +60 -0
  100. package/models/components/networkclassification.js.map +1 -0
  101. package/models/components/networkmobileinfo.d.ts +21 -0
  102. package/models/components/networkmobileinfo.d.ts.map +1 -0
  103. package/models/components/networkmobileinfo.js +57 -0
  104. package/models/components/networkmobileinfo.js.map +1 -0
  105. package/models/components/privacy.d.ts +39 -0
  106. package/models/components/privacy.d.ts.map +1 -0
  107. package/models/components/privacy.js +64 -0
  108. package/models/components/privacy.js.map +1 -0
  109. package/models/components/privacytorinfo.d.ts +11 -0
  110. package/models/components/privacytorinfo.d.ts.map +1 -0
  111. package/models/components/privacytorinfo.js +51 -0
  112. package/models/components/privacytorinfo.js.map +1 -0
  113. package/models/components/privacytorinforelay.d.ts +140 -0
  114. package/models/components/privacytorinforelay.d.ts.map +1 -0
  115. package/models/components/privacytorinforelay.js +114 -0
  116. package/models/components/privacytorinforelay.js.map +1 -0
  117. package/models/components/privacytorinforelayexitpolicysummary.d.ts +17 -0
  118. package/models/components/privacytorinforelayexitpolicysummary.d.ts.map +1 -0
  119. package/models/components/privacytorinforelayexitpolicysummary.js +51 -0
  120. package/models/components/privacytorinforelayexitpolicysummary.js.map +1 -0
  121. package/models/components/reputation.d.ts +26 -0
  122. package/models/components/reputation.d.ts.map +1 -0
  123. package/models/components/reputation.js +71 -0
  124. package/models/components/reputation.js.map +1 -0
  125. package/models/components/reputationevidence.d.ts +17 -0
  126. package/models/components/reputationevidence.d.ts.map +1 -0
  127. package/models/components/reputationevidence.js +65 -0
  128. package/models/components/reputationevidence.js.map +1 -0
  129. package/models/components/reputationevidenceexternalsignal.d.ts +23 -0
  130. package/models/components/reputationevidenceexternalsignal.d.ts.map +1 -0
  131. package/models/components/reputationevidenceexternalsignal.js +62 -0
  132. package/models/components/reputationevidenceexternalsignal.js.map +1 -0
  133. package/models/components/reputationevidencefieldvalue.d.ts +11 -0
  134. package/models/components/reputationevidencefieldvalue.d.ts.map +1 -0
  135. package/models/components/reputationevidencefieldvalue.js +51 -0
  136. package/models/components/reputationevidencefieldvalue.js.map +1 -0
  137. package/models/components/reputationevidencethreat.d.ts +12 -0
  138. package/models/components/reputationevidencethreat.d.ts.map +1 -0
  139. package/models/components/reputationevidencethreat.js +59 -0
  140. package/models/components/reputationevidencethreat.js.map +1 -0
  141. package/models/components/responseenvelopecenseyejob.d.ts +11 -0
  142. package/models/components/responseenvelopecenseyejob.d.ts.map +1 -0
  143. package/models/components/responseenvelopecenseyejob.js +51 -0
  144. package/models/components/responseenvelopecenseyejob.js.map +1 -0
  145. package/models/components/responseenvelopecenseyeresultsresponse.d.ts +11 -0
  146. package/models/components/responseenvelopecenseyeresultsresponse.d.ts.map +1 -0
  147. package/models/components/responseenvelopecenseyeresultsresponse.js +51 -0
  148. package/models/components/responseenvelopecenseyeresultsresponse.js.map +1 -0
  149. package/models/components/sapient.d.ts +15 -0
  150. package/models/components/sapient.d.ts.map +1 -0
  151. package/models/components/sapient.js +60 -0
  152. package/models/components/sapient.js.map +1 -0
  153. package/models/components/sapienterror.d.ts +11 -0
  154. package/models/components/sapienterror.d.ts.map +1 -0
  155. package/models/components/sapienterror.js +56 -0
  156. package/models/components/sapienterror.js.map +1 -0
  157. package/models/components/sapientregistrationack.d.ts +11 -0
  158. package/models/components/sapientregistrationack.d.ts.map +1 -0
  159. package/models/components/sapientregistrationack.js +56 -0
  160. package/models/components/sapientregistrationack.js.map +1 -0
  161. package/models/components/searchvaluecountsinputbody.d.ts +1 -1
  162. package/models/components/service.d.ts +2 -0
  163. package/models/components/service.d.ts.map +1 -1
  164. package/models/components/service.js +2 -0
  165. package/models/components/service.js.map +1 -1
  166. package/models/components/servicescan.d.ts +2 -0
  167. package/models/components/servicescan.d.ts.map +1 -1
  168. package/models/components/servicescan.js +2 -0
  169. package/models/components/servicescan.js.map +1 -1
  170. package/models/components/servicesonhostresponse.d.ts +6 -0
  171. package/models/components/servicesonhostresponse.d.ts.map +1 -1
  172. package/models/components/servicesonhostresponse.js +3 -4
  173. package/models/components/servicesonhostresponse.js.map +1 -1
  174. package/models/components/socks.d.ts +1 -0
  175. package/models/components/socks.d.ts.map +1 -1
  176. package/models/components/socks.js +2 -0
  177. package/models/components/socks.js.map +1 -1
  178. package/models/operations/index.d.ts +3 -0
  179. package/models/operations/index.d.ts.map +1 -1
  180. package/models/operations/index.js +3 -0
  181. package/models/operations/index.js.map +1 -1
  182. package/models/operations/v3threathuntingcenseyejobresults.d.ts +45 -0
  183. package/models/operations/v3threathuntingcenseyejobresults.d.ts.map +1 -0
  184. package/models/operations/v3threathuntingcenseyejobresults.js +76 -0
  185. package/models/operations/v3threathuntingcenseyejobresults.js.map +1 -0
  186. package/models/operations/v3threathuntingcenseyejobscreate.d.ts +32 -0
  187. package/models/operations/v3threathuntingcenseyejobscreate.d.ts.map +1 -0
  188. package/models/operations/v3threathuntingcenseyejobscreate.js +72 -0
  189. package/models/operations/v3threathuntingcenseyejobscreate.js.map +1 -0
  190. package/models/operations/v3threathuntingcenseyejobsget.d.ts +35 -0
  191. package/models/operations/v3threathuntingcenseyejobsget.d.ts.map +1 -0
  192. package/models/operations/v3threathuntingcenseyejobsget.js +72 -0
  193. package/models/operations/v3threathuntingcenseyejobsget.js.map +1 -0
  194. package/package.json +1 -1
  195. package/sdk/threathunting.d.ts +22 -1
  196. package/sdk/threathunting.d.ts.map +1 -1
  197. package/sdk/threathunting.js +31 -1
  198. package/sdk/threathunting.js.map +1 -1
  199. package/src/funcs/accountManagementGetMemberCreditUsage.ts +0 -1
  200. package/src/funcs/accountManagementGetOrganizationCreditUsage.ts +0 -1
  201. package/src/funcs/accountManagementGetOrganizationCredits.ts +0 -1
  202. package/src/funcs/accountManagementGetOrganizationDetails.ts +0 -1
  203. package/src/funcs/accountManagementInviteUserToOrganization.ts +0 -1
  204. package/src/funcs/accountManagementListOrganizationMembers.ts +0 -1
  205. package/src/funcs/accountManagementRemoveOrganizationMember.ts +0 -1
  206. package/src/funcs/accountManagementUpdateOrganizationMember.ts +0 -1
  207. package/src/funcs/collectionsAggregate.ts +0 -1
  208. package/src/funcs/collectionsDelete.ts +0 -1
  209. package/src/funcs/collectionsGet.ts +0 -1
  210. package/src/funcs/collectionsListEvents.ts +0 -1
  211. package/src/funcs/collectionsSearch.ts +0 -1
  212. package/src/funcs/collectionsUpdate.ts +0 -1
  213. package/src/funcs/globalDataGetCertificate.ts +0 -1
  214. package/src/funcs/globalDataGetCertificateRaw.ts +0 -1
  215. package/src/funcs/globalDataGetHost.ts +0 -1
  216. package/src/funcs/globalDataGetHostTimeline.ts +0 -1
  217. package/src/funcs/globalDataGetTrackedScan.ts +0 -1
  218. package/src/funcs/globalDataGetWebProperty.ts +0 -1
  219. package/src/funcs/globalDataListServicesOnHost.ts +0 -1
  220. package/src/funcs/threatHuntingCreateCenseyeJob.ts +195 -0
  221. package/src/funcs/threatHuntingGetCenseyeJob.ts +200 -0
  222. package/src/funcs/threatHuntingGetCenseyeJobResults.ts +202 -0
  223. package/src/funcs/threatHuntingGetHostObservationsWithCertificate.ts +0 -1
  224. package/src/funcs/threatHuntingGetTrackedScanThreatHunting.ts +0 -1
  225. package/src/funcs/threatHuntingValueCounts.ts +1 -1
  226. package/src/lib/config.ts +4 -4
  227. package/src/lib/encodings.ts +23 -4
  228. package/src/lib/files.ts +22 -0
  229. package/src/lib/matchers.ts +3 -2
  230. package/src/lib/sdks.ts +7 -5
  231. package/src/lib/security.ts +15 -4
  232. package/src/lib/url.ts +16 -14
  233. package/src/models/components/censeyejob.ts +106 -0
  234. package/src/models/components/censeyeresult.ts +48 -0
  235. package/src/models/components/censeyeresultsresponse.ts +45 -0
  236. package/src/models/components/censeyetarget.ts +77 -0
  237. package/src/models/components/countcondition.ts +1 -1
  238. package/src/models/components/createcenseyejobinputbody.ts +36 -0
  239. package/src/models/components/fieldvaluepair.ts +21 -0
  240. package/src/models/components/host.ts +19 -0
  241. package/src/models/components/index.ts +21 -0
  242. package/src/models/components/networkclassification.ts +60 -0
  243. package/src/models/components/networkmobileinfo.ts +49 -0
  244. package/src/models/components/privacy.ts +73 -0
  245. package/src/models/components/privacytorinfo.ts +35 -0
  246. package/src/models/components/privacytorinforelay.ts +227 -0
  247. package/src/models/components/privacytorinforelayexitpolicysummary.ts +40 -0
  248. package/src/models/components/reputation.ts +66 -0
  249. package/src/models/components/reputationevidence.ts +63 -0
  250. package/src/models/components/reputationevidenceexternalsignal.ts +50 -0
  251. package/src/models/components/reputationevidencefieldvalue.ts +33 -0
  252. package/src/models/components/reputationevidencethreat.ts +42 -0
  253. package/src/models/components/responseenvelopecenseyejob.ts +32 -0
  254. package/src/models/components/responseenvelopecenseyeresultsresponse.ts +36 -0
  255. package/src/models/components/sapient.ts +44 -0
  256. package/src/models/components/sapienterror.ts +38 -0
  257. package/src/models/components/sapientregistrationack.ts +38 -0
  258. package/src/models/components/searchvaluecountsinputbody.ts +1 -1
  259. package/src/models/components/service.ts +3 -0
  260. package/src/models/components/servicescan.ts +3 -0
  261. package/src/models/components/servicesonhostresponse.ts +9 -4
  262. package/src/models/components/socks.ts +3 -0
  263. package/src/models/operations/index.ts +3 -0
  264. package/src/models/operations/v3threathuntingcenseyejobresults.ts +107 -0
  265. package/src/models/operations/v3threathuntingcenseyejobscreate.ts +91 -0
  266. package/src/models/operations/v3threathuntingcenseyejobsget.ts +87 -0
  267. package/src/sdk/threathunting.ts +55 -1
  268. package/tests/sdk.test.ts +412 -259
package/src/lib/files.ts CHANGED
@@ -80,3 +80,25 @@ export function getContentTypeFromFileName(fileName: string): string | null {
80
80
 
81
81
  return mimeTypes[ext] || null;
82
82
  }
83
+
84
+ /**
85
+ * Creates a Blob from file content with the given MIME type.
86
+ *
87
+ * Node.js Buffers are Uint8Array subclasses that may share a pooled
88
+ * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing
89
+ * such a Buffer directly to `new Blob([buf])` can include the entire
90
+ * underlying pool on some runtimes, producing a Blob with extra bytes
91
+ * that corrupts multipart uploads.
92
+ *
93
+ * Copying into a standalone Uint8Array ensures the Blob receives only the
94
+ * intended bytes regardless of runtime behaviour.
95
+ */
96
+ export function bytesToBlob(
97
+ content: Uint8Array<ArrayBufferLike> | ArrayBuffer | Blob | string,
98
+ contentType: string,
99
+ ): Blob {
100
+ if (content instanceof Uint8Array) {
101
+ return new Blob([new Uint8Array(content)], { type: contentType });
102
+ }
103
+ return new Blob([content as BlobPart], { type: contentType });
104
+ }
@@ -248,8 +248,9 @@ export function match<T, E>(
248
248
  raw = body;
249
249
  break;
250
250
  default:
251
- encoding satisfies never;
252
- throw new Error(`Unsupported response type: ${encoding}`);
251
+ throw new Error(
252
+ `Unsupported response type: ${encoding satisfies never}`,
253
+ );
253
254
  }
254
255
 
255
256
  if (matcher.enc === "fail") {
package/src/lib/sdks.ts CHANGED
@@ -124,13 +124,15 @@ export class ClientSDK {
124
124
  if (!base) {
125
125
  return ERR(new InvalidRequestError("No base URL provided for operation"));
126
126
  }
127
- const reqURL = new URL(base);
128
- const inputURL = new URL(path, reqURL);
129
-
127
+ const baseURL = new URL(base);
128
+ let reqURL: URL;
130
129
  if (path) {
131
- reqURL.pathname += reqURL.pathname.endsWith("/") ? "" : "/";
132
- reqURL.pathname += inputURL.pathname.replace(/^\/+/, "");
130
+ baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
131
+ reqURL = new URL(path, baseURL);
132
+ } else {
133
+ reqURL = baseURL;
133
134
  }
135
+ reqURL.hash = "";
134
136
 
135
137
  let finalQuery = query || "";
136
138
 
@@ -197,8 +197,7 @@ export function resolveSecurity(
197
197
  applyBearer(state, spec);
198
198
  break;
199
199
  default:
200
- spec satisfies never;
201
- throw SecurityError.unrecognizedType(type);
200
+ throw SecurityError.unrecognizedType((spec satisfies never, type));
202
201
  }
203
202
  });
204
203
 
@@ -240,8 +239,9 @@ function applyBearer(
240
239
 
241
240
  export function resolveGlobalSecurity(
242
241
  security: Partial<components.Security> | null | undefined,
242
+ allowedFields?: number[],
243
243
  ): SecurityState | null {
244
- return resolveSecurity(
244
+ let inputs: SecurityInput[][] = [
245
245
  [
246
246
  {
247
247
  fieldName: "Authorization",
@@ -249,7 +249,18 @@ export function resolveGlobalSecurity(
249
249
  value: security?.personalAccessToken,
250
250
  },
251
251
  ],
252
- );
252
+ ];
253
+
254
+ if (allowedFields) {
255
+ inputs = allowedFields.map((i) => {
256
+ if (i < 0 || i >= inputs.length) {
257
+ throw new RangeError(`invalid allowedFields index ${i}`);
258
+ }
259
+ return inputs[i]!;
260
+ });
261
+ }
262
+
263
+ return resolveSecurity(...inputs);
253
264
  }
254
265
 
255
266
  export async function extractSecurity<
package/src/lib/url.ts CHANGED
@@ -13,21 +13,23 @@ export function pathToFunc(
13
13
  const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
14
14
 
15
15
  return function buildURLPath(params: Record<string, unknown> = {}): string {
16
- return pathPattern.replace(paramRE, function (_, placeholder) {
17
- if (!hasOwn.call(params, placeholder)) {
18
- throw new Error(`Parameter '${placeholder}' is required`);
19
- }
16
+ return pathPattern
17
+ .replace(paramRE, function (_, placeholder) {
18
+ if (!hasOwn.call(params, placeholder)) {
19
+ throw new Error(`Parameter '${placeholder}' is required`);
20
+ }
20
21
 
21
- const value = params[placeholder];
22
- if (typeof value !== "string" && typeof value !== "number") {
23
- throw new Error(
24
- `Parameter '${placeholder}' must be a string or number`,
25
- );
26
- }
22
+ const value = params[placeholder];
23
+ if (typeof value !== "string" && typeof value !== "number") {
24
+ throw new Error(
25
+ `Parameter '${placeholder}' must be a string or number`,
26
+ );
27
+ }
27
28
 
28
- return options?.charEncoding === "percent"
29
- ? encodeURIComponent(`${value}`)
30
- : `${value}`;
31
- });
29
+ return options?.charEncoding === "percent"
30
+ ? encodeURIComponent(`${value}`)
31
+ : `${value}`;
32
+ })
33
+ .replace(/^\/+/, "");
32
34
  };
33
35
  }
@@ -0,0 +1,106 @@
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 * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
10
+ import { Result as SafeParseResult } from "../../types/fp.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+ import { CenseyeTarget, CenseyeTarget$inboundSchema } from "./censeyetarget.js";
13
+
14
+ /**
15
+ * Current state of the job.
16
+ */
17
+ export const State = {
18
+ Started: "started",
19
+ Completed: "completed",
20
+ Failed: "failed",
21
+ Unknown: "unknown",
22
+ } as const;
23
+ /**
24
+ * Current state of the job.
25
+ */
26
+ export type State = OpenEnum<typeof State>;
27
+
28
+ export type CenseyeJob = {
29
+ /**
30
+ * The point-in-time the asset data was evaluated at.
31
+ */
32
+ atTime?: Date | undefined;
33
+ /**
34
+ * When the job was created.
35
+ */
36
+ createTime?: Date | undefined;
37
+ /**
38
+ * When the job and results will be deleted.
39
+ */
40
+ deleteTime?: Date | undefined;
41
+ /**
42
+ * Error message if the job failed.
43
+ */
44
+ error?: string | undefined;
45
+ /**
46
+ * Unique identifier of the job.
47
+ */
48
+ jobId: string;
49
+ /**
50
+ * Total number of result field-value pairs.
51
+ */
52
+ resultCount?: number | undefined;
53
+ /**
54
+ * Current state of the job.
55
+ */
56
+ state: State;
57
+ target: CenseyeTarget;
58
+ /**
59
+ * When the job was last updated.
60
+ */
61
+ updateTime?: Date | undefined;
62
+ };
63
+
64
+ /** @internal */
65
+ export const State$inboundSchema: z.ZodType<State, z.ZodTypeDef, unknown> =
66
+ openEnums.inboundSchema(State);
67
+
68
+ /** @internal */
69
+ export const CenseyeJob$inboundSchema: z.ZodType<
70
+ CenseyeJob,
71
+ z.ZodTypeDef,
72
+ unknown
73
+ > = z.object({
74
+ at_time: z.string().datetime({ offset: true }).transform(v => new Date(v))
75
+ .optional(),
76
+ create_time: z.string().datetime({ offset: true }).transform(v => new Date(v))
77
+ .optional(),
78
+ delete_time: z.string().datetime({ offset: true }).transform(v => new Date(v))
79
+ .optional(),
80
+ error: z.string().optional(),
81
+ job_id: z.string(),
82
+ result_count: z.number().int().optional(),
83
+ state: State$inboundSchema,
84
+ target: CenseyeTarget$inboundSchema,
85
+ update_time: z.string().datetime({ offset: true }).transform(v => new Date(v))
86
+ .optional(),
87
+ }).transform((v) => {
88
+ return remap$(v, {
89
+ "at_time": "atTime",
90
+ "create_time": "createTime",
91
+ "delete_time": "deleteTime",
92
+ "job_id": "jobId",
93
+ "result_count": "resultCount",
94
+ "update_time": "updateTime",
95
+ });
96
+ });
97
+
98
+ export function censeyeJobFromJSON(
99
+ jsonString: string,
100
+ ): SafeParseResult<CenseyeJob, SDKValidationError> {
101
+ return safeParse(
102
+ jsonString,
103
+ (x) => CenseyeJob$inboundSchema.parse(JSON.parse(x)),
104
+ `Failed to parse 'CenseyeJob' from JSON`,
105
+ );
106
+ }
@@ -0,0 +1,48 @@
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
+ import {
11
+ FieldValuePair,
12
+ FieldValuePair$inboundSchema,
13
+ } from "./fieldvaluepair.js";
14
+
15
+ export type CenseyeResult = {
16
+ /**
17
+ * Number of matching documents for this field-value combination.
18
+ */
19
+ count: number;
20
+ /**
21
+ * The field-value pairs that were counted.
22
+ */
23
+ fieldValuePairs: Array<FieldValuePair> | null;
24
+ };
25
+
26
+ /** @internal */
27
+ export const CenseyeResult$inboundSchema: z.ZodType<
28
+ CenseyeResult,
29
+ z.ZodTypeDef,
30
+ unknown
31
+ > = z.object({
32
+ count: z.number(),
33
+ field_value_pairs: z.nullable(z.array(FieldValuePair$inboundSchema)),
34
+ }).transform((v) => {
35
+ return remap$(v, {
36
+ "field_value_pairs": "fieldValuePairs",
37
+ });
38
+ });
39
+
40
+ export function censeyeResultFromJSON(
41
+ jsonString: string,
42
+ ): SafeParseResult<CenseyeResult, SDKValidationError> {
43
+ return safeParse(
44
+ jsonString,
45
+ (x) => CenseyeResult$inboundSchema.parse(JSON.parse(x)),
46
+ `Failed to parse 'CenseyeResult' from JSON`,
47
+ );
48
+ }
@@ -0,0 +1,45 @@
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
+ import { CenseyeResult, CenseyeResult$inboundSchema } from "./censeyeresult.js";
11
+
12
+ export type CenseyeResultsResponse = {
13
+ /**
14
+ * Token to retrieve the next page of results.
15
+ */
16
+ nextPageToken?: string | undefined;
17
+ /**
18
+ * List of count results.
19
+ */
20
+ results: Array<CenseyeResult> | null;
21
+ };
22
+
23
+ /** @internal */
24
+ export const CenseyeResultsResponse$inboundSchema: z.ZodType<
25
+ CenseyeResultsResponse,
26
+ z.ZodTypeDef,
27
+ unknown
28
+ > = z.object({
29
+ next_page_token: z.string().optional(),
30
+ results: z.nullable(z.array(CenseyeResult$inboundSchema)),
31
+ }).transform((v) => {
32
+ return remap$(v, {
33
+ "next_page_token": "nextPageToken",
34
+ });
35
+ });
36
+
37
+ export function censeyeResultsResponseFromJSON(
38
+ jsonString: string,
39
+ ): SafeParseResult<CenseyeResultsResponse, SDKValidationError> {
40
+ return safeParse(
41
+ jsonString,
42
+ (x) => CenseyeResultsResponse$inboundSchema.parse(JSON.parse(x)),
43
+ `Failed to parse 'CenseyeResultsResponse' from JSON`,
44
+ );
45
+ }
@@ -0,0 +1,77 @@
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 CenseyeTarget = {
12
+ /**
13
+ * SHA-256 fingerprint of the certificate to analyze.
14
+ */
15
+ certificateId?: string | undefined;
16
+ /**
17
+ * IP address of the host to analyze.
18
+ */
19
+ hostId?: string | undefined;
20
+ /**
21
+ * Web property identifier (hostname:port) to analyze.
22
+ */
23
+ webpropertyId?: string | undefined;
24
+ };
25
+
26
+ /** @internal */
27
+ export const CenseyeTarget$inboundSchema: z.ZodType<
28
+ CenseyeTarget,
29
+ z.ZodTypeDef,
30
+ unknown
31
+ > = z.object({
32
+ certificate_id: z.string().optional(),
33
+ host_id: z.string().optional(),
34
+ webproperty_id: z.string().optional(),
35
+ }).transform((v) => {
36
+ return remap$(v, {
37
+ "certificate_id": "certificateId",
38
+ "host_id": "hostId",
39
+ "webproperty_id": "webpropertyId",
40
+ });
41
+ });
42
+ /** @internal */
43
+ export type CenseyeTarget$Outbound = {
44
+ certificate_id?: string | undefined;
45
+ host_id?: string | undefined;
46
+ webproperty_id?: string | undefined;
47
+ };
48
+
49
+ /** @internal */
50
+ export const CenseyeTarget$outboundSchema: z.ZodType<
51
+ CenseyeTarget$Outbound,
52
+ z.ZodTypeDef,
53
+ CenseyeTarget
54
+ > = z.object({
55
+ certificateId: z.string().optional(),
56
+ hostId: z.string().optional(),
57
+ webpropertyId: z.string().optional(),
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ certificateId: "certificate_id",
61
+ hostId: "host_id",
62
+ webpropertyId: "webproperty_id",
63
+ });
64
+ });
65
+
66
+ export function censeyeTargetToJSON(censeyeTarget: CenseyeTarget): string {
67
+ return JSON.stringify(CenseyeTarget$outboundSchema.parse(censeyeTarget));
68
+ }
69
+ export function censeyeTargetFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<CenseyeTarget, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) => CenseyeTarget$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'CenseyeTarget' from JSON`,
76
+ );
77
+ }
@@ -12,7 +12,7 @@ import {
12
12
 
13
13
  export type CountCondition = {
14
14
  /**
15
- * Field-value pairs to count matches for. Must target fields from the same nested object.
15
+ * Field-value pairs to count matches for. Must target fields from the same nested object and may contain at most 5 pairs per group.
16
16
  */
17
17
  fieldValuePairs: Array<FieldValuePair> | null;
18
18
  };
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import {
7
+ CenseyeTarget,
8
+ CenseyeTarget$Outbound,
9
+ CenseyeTarget$outboundSchema,
10
+ } from "./censeyetarget.js";
11
+
12
+ export type CreateCenseyeJobInputBody = {
13
+ target: CenseyeTarget;
14
+ };
15
+
16
+ /** @internal */
17
+ export type CreateCenseyeJobInputBody$Outbound = {
18
+ target: CenseyeTarget$Outbound;
19
+ };
20
+
21
+ /** @internal */
22
+ export const CreateCenseyeJobInputBody$outboundSchema: z.ZodType<
23
+ CreateCenseyeJobInputBody$Outbound,
24
+ z.ZodTypeDef,
25
+ CreateCenseyeJobInputBody
26
+ > = z.object({
27
+ target: CenseyeTarget$outboundSchema,
28
+ });
29
+
30
+ export function createCenseyeJobInputBodyToJSON(
31
+ createCenseyeJobInputBody: CreateCenseyeJobInputBody,
32
+ ): string {
33
+ return JSON.stringify(
34
+ CreateCenseyeJobInputBody$outboundSchema.parse(createCenseyeJobInputBody),
35
+ );
36
+ }
@@ -3,6 +3,9 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
6
9
 
7
10
  export type FieldValuePair = {
8
11
  /**
@@ -15,6 +18,15 @@ export type FieldValuePair = {
15
18
  value: string;
16
19
  };
17
20
 
21
+ /** @internal */
22
+ export const FieldValuePair$inboundSchema: z.ZodType<
23
+ FieldValuePair,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ field: z.string(),
28
+ value: z.string(),
29
+ });
18
30
  /** @internal */
19
31
  export type FieldValuePair$Outbound = {
20
32
  field: string;
@@ -34,3 +46,12 @@ export const FieldValuePair$outboundSchema: z.ZodType<
34
46
  export function fieldValuePairToJSON(fieldValuePair: FieldValuePair): string {
35
47
  return JSON.stringify(FieldValuePair$outboundSchema.parse(fieldValuePair));
36
48
  }
49
+ export function fieldValuePairFromJSON(
50
+ jsonString: string,
51
+ ): SafeParseResult<FieldValuePair, SDKValidationError> {
52
+ return safeParse(
53
+ jsonString,
54
+ (x) => FieldValuePair$inboundSchema.parse(JSON.parse(x)),
55
+ `Failed to parse 'FieldValuePair' from JSON`,
56
+ );
57
+ }
@@ -12,6 +12,12 @@ import { Greynoise, Greynoise$inboundSchema } from "./greynoise.js";
12
12
  import { HostDns, HostDns$inboundSchema } from "./hostdns.js";
13
13
  import { Label, Label$inboundSchema } from "./label.js";
14
14
  import { Location, Location$inboundSchema } from "./location.js";
15
+ import {
16
+ NetworkClassification,
17
+ NetworkClassification$inboundSchema,
18
+ } from "./networkclassification.js";
19
+ import { Privacy, Privacy$inboundSchema } from "./privacy.js";
20
+ import { Reputation, Reputation$inboundSchema } from "./reputation.js";
15
21
  import { Routing, Routing$inboundSchema } from "./routing.js";
16
22
  import { Service, Service$inboundSchema } from "./service.js";
17
23
  import { Whois, Whois$inboundSchema } from "./whois.js";
@@ -24,7 +30,16 @@ export type Host = {
24
30
  ip?: string | undefined;
25
31
  labels?: Array<Label> | null | undefined;
26
32
  location?: Location | undefined;
33
+ /**
34
+ * Information about what type of network the host belongs to.
35
+ */
36
+ network?: Array<NetworkClassification> | null | undefined;
27
37
  operatingSystem?: Attribute | undefined;
38
+ /**
39
+ * Information about privacy services used by the IP, such as VPNs, Proxies, or Tor.
40
+ */
41
+ privacy?: Array<Privacy> | null | undefined;
42
+ reputation?: Reputation | undefined;
28
43
  serviceCount?: number | undefined;
29
44
  services?: Array<Service> | null | undefined;
30
45
  whois?: Whois | undefined;
@@ -40,7 +55,11 @@ export const Host$inboundSchema: z.ZodType<Host, z.ZodTypeDef, unknown> = z
40
55
  ip: z.string().optional(),
41
56
  labels: z.nullable(z.array(Label$inboundSchema)).optional(),
42
57
  location: Location$inboundSchema.optional(),
58
+ network: z.nullable(z.array(NetworkClassification$inboundSchema))
59
+ .optional(),
43
60
  operating_system: Attribute$inboundSchema.optional(),
61
+ privacy: z.nullable(z.array(Privacy$inboundSchema)).optional(),
62
+ reputation: Reputation$inboundSchema.optional(),
44
63
  service_count: z.number().int().optional(),
45
64
  services: z.nullable(z.array(Service$inboundSchema)).optional(),
46
65
  whois: Whois$inboundSchema.optional(),
@@ -24,6 +24,10 @@ export * from "./bacnet.js";
24
24
  export * from "./basicconstraints.js";
25
25
  export * from "./cabforganizationid.js";
26
26
  export * from "./capabilities.js";
27
+ export * from "./censeyejob.js";
28
+ export * from "./censeyeresult.js";
29
+ export * from "./censeyeresultsresponse.js";
30
+ export * from "./censeyetarget.js";
27
31
  export * from "./certificate.js";
28
32
  export * from "./certificateasset.js";
29
33
  export * from "./certificateextensions.js";
@@ -59,6 +63,7 @@ export * from "./coordinates.js";
59
63
  export * from "./countcondition.js";
60
64
  export * from "./cpe.js";
61
65
  export * from "./cpelifecycle.js";
66
+ export * from "./createcenseyejobinputbody.js";
62
67
  export * from "./creditexpiration.js";
63
68
  export * from "./creditusagereport.js";
64
69
  export * from "./creditusagereportperiod.js";
@@ -299,8 +304,10 @@ export * from "./natsio.js";
299
304
  export * from "./nbd.js";
300
305
  export * from "./network.js";
301
306
  export * from "./networkcapabilities.js";
307
+ export * from "./networkclassification.js";
302
308
  export * from "./networklog.js";
303
309
  export * from "./networklogresourceinfo.js";
310
+ export * from "./networkmobileinfo.js";
304
311
  export * from "./nfsmountd.js";
305
312
  export * from "./nmea.js";
306
313
  export * from "./nmeanmeamessage.js";
@@ -356,6 +363,10 @@ export * from "./pprof.js";
356
363
  export * from "./pptp.js";
357
364
  export * from "./pptpresponseinfo.js";
358
365
  export * from "./pptpversion.js";
366
+ export * from "./privacy.js";
367
+ export * from "./privacytorinfo.js";
368
+ export * from "./privacytorinforelay.js";
369
+ export * from "./privacytorinforelayexitpolicysummary.js";
359
370
  export * from "./profinetcm.js";
360
371
  export * from "./prometheus.js";
361
372
  export * from "./prometheusmetricfamily.js";
@@ -392,6 +403,13 @@ export * from "./redlionweb.js";
392
403
  export * from "./reject.js";
393
404
  export * from "./replaycapabilities.js";
394
405
  export * from "./representativeinfo.js";
406
+ export * from "./reputation.js";
407
+ export * from "./reputationevidence.js";
408
+ export * from "./reputationevidenceexternalsignal.js";
409
+ export * from "./reputationevidencefieldvalue.js";
410
+ export * from "./reputationevidencethreat.js";
411
+ export * from "./responseenvelopecenseyejob.js";
412
+ export * from "./responseenvelopecenseyeresultsresponse.js";
395
413
  export * from "./responseenvelopecertificateasset.js";
396
414
  export * from "./responseenvelopecollection.js";
397
415
  export * from "./responseenvelopecollectioneventsresponse.js";
@@ -444,6 +462,9 @@ export * from "./rustdeskrendezvousconfigupdate.js";
444
462
  export * from "./rustdeskrendezvouskeyexchange.js";
445
463
  export * from "./rustdeskrendezvoustestnatresponse.js";
446
464
  export * from "./s7.js";
465
+ export * from "./sapient.js";
466
+ export * from "./sapienterror.js";
467
+ export * from "./sapientregistrationack.js";
447
468
  export * from "./saprouter.js";
448
469
  export * from "./saprouterclientinfo.js";
449
470
  export * from "./saprouterrouterinfo.js";
@@ -0,0 +1,60 @@
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
+ import {
11
+ NetworkMobileInfo,
12
+ NetworkMobileInfo$inboundSchema,
13
+ } from "./networkmobileinfo.js";
14
+
15
+ export type NetworkClassification = {
16
+ /**
17
+ * Whether the host belongs to an Internet hosting service provider.
18
+ */
19
+ hosting?: boolean | undefined;
20
+ /**
21
+ * Whether the host belongs to a mobile network.
22
+ */
23
+ mobile?: boolean | undefined;
24
+ mobileInfo?: NetworkMobileInfo | undefined;
25
+ /**
26
+ * Whether the host belongs to a statellite network.
27
+ */
28
+ satellite?: boolean | undefined;
29
+ /**
30
+ * The source of the data.
31
+ */
32
+ source?: string | undefined;
33
+ };
34
+
35
+ /** @internal */
36
+ export const NetworkClassification$inboundSchema: z.ZodType<
37
+ NetworkClassification,
38
+ z.ZodTypeDef,
39
+ unknown
40
+ > = z.object({
41
+ hosting: z.boolean().optional(),
42
+ mobile: z.boolean().optional(),
43
+ mobile_info: NetworkMobileInfo$inboundSchema.optional(),
44
+ satellite: z.boolean().optional(),
45
+ source: z.string().optional(),
46
+ }).transform((v) => {
47
+ return remap$(v, {
48
+ "mobile_info": "mobileInfo",
49
+ });
50
+ });
51
+
52
+ export function networkClassificationFromJSON(
53
+ jsonString: string,
54
+ ): SafeParseResult<NetworkClassification, SDKValidationError> {
55
+ return safeParse(
56
+ jsonString,
57
+ (x) => NetworkClassification$inboundSchema.parse(JSON.parse(x)),
58
+ `Failed to parse 'NetworkClassification' from JSON`,
59
+ );
60
+ }