@censys/platform-sdk 0.10.3 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -2
- package/docs/sdks/adversaryinvestigation/README.md +625 -0
- package/docs/sdks/threathunting/README.md +91 -8
- package/funcs/accountManagementGetMemberCreditUsage.d.ts.map +1 -1
- package/funcs/accountManagementGetMemberCreditUsage.js +2 -1
- package/funcs/accountManagementGetMemberCreditUsage.js.map +1 -1
- package/funcs/accountManagementGetOrganizationCreditUsage.d.ts.map +1 -1
- package/funcs/accountManagementGetOrganizationCreditUsage.js +2 -1
- package/funcs/accountManagementGetOrganizationCreditUsage.js.map +1 -1
- package/funcs/accountManagementGetOrganizationCredits.d.ts.map +1 -1
- package/funcs/accountManagementGetOrganizationCredits.js +2 -1
- package/funcs/accountManagementGetOrganizationCredits.js.map +1 -1
- package/funcs/accountManagementGetOrganizationDetails.d.ts.map +1 -1
- package/funcs/accountManagementGetOrganizationDetails.js +2 -1
- package/funcs/accountManagementGetOrganizationDetails.js.map +1 -1
- package/funcs/accountManagementGetUserCredits.d.ts.map +1 -1
- package/funcs/accountManagementGetUserCredits.js +2 -1
- package/funcs/accountManagementGetUserCredits.js.map +1 -1
- package/funcs/accountManagementGetUserCreditsUsage.d.ts.map +1 -1
- package/funcs/accountManagementGetUserCreditsUsage.js +2 -1
- package/funcs/accountManagementGetUserCreditsUsage.js.map +1 -1
- package/funcs/accountManagementInviteUserToOrganization.d.ts.map +1 -1
- package/funcs/accountManagementInviteUserToOrganization.js +2 -1
- package/funcs/accountManagementInviteUserToOrganization.js.map +1 -1
- package/funcs/accountManagementListOrganizationMembers.d.ts.map +1 -1
- package/funcs/accountManagementListOrganizationMembers.js +2 -1
- package/funcs/accountManagementListOrganizationMembers.js.map +1 -1
- package/funcs/accountManagementRemoveOrganizationMember.d.ts.map +1 -1
- package/funcs/accountManagementRemoveOrganizationMember.js +2 -1
- package/funcs/accountManagementRemoveOrganizationMember.js.map +1 -1
- package/funcs/accountManagementUpdateOrganizationMember.d.ts.map +1 -1
- package/funcs/accountManagementUpdateOrganizationMember.js +2 -1
- package/funcs/accountManagementUpdateOrganizationMember.js.map +1 -1
- package/funcs/collectionsAggregate.d.ts.map +1 -1
- package/funcs/collectionsAggregate.js +2 -1
- package/funcs/collectionsAggregate.js.map +1 -1
- package/funcs/collectionsCreate.d.ts.map +1 -1
- package/funcs/collectionsCreate.js +2 -1
- package/funcs/collectionsCreate.js.map +1 -1
- package/funcs/collectionsDelete.d.ts.map +1 -1
- package/funcs/collectionsDelete.js +2 -1
- package/funcs/collectionsDelete.js.map +1 -1
- package/funcs/collectionsGet.d.ts.map +1 -1
- package/funcs/collectionsGet.js +2 -1
- package/funcs/collectionsGet.js.map +1 -1
- package/funcs/collectionsList.d.ts.map +1 -1
- package/funcs/collectionsList.js +2 -1
- package/funcs/collectionsList.js.map +1 -1
- package/funcs/collectionsListEvents.d.ts.map +1 -1
- package/funcs/collectionsListEvents.js +2 -1
- package/funcs/collectionsListEvents.js.map +1 -1
- package/funcs/collectionsSearch.d.ts.map +1 -1
- package/funcs/collectionsSearch.js +2 -1
- package/funcs/collectionsSearch.js.map +1 -1
- package/funcs/collectionsUpdate.d.ts.map +1 -1
- package/funcs/collectionsUpdate.js +2 -1
- package/funcs/collectionsUpdate.js.map +1 -1
- package/funcs/globalDataAggregate.d.ts.map +1 -1
- package/funcs/globalDataAggregate.js +2 -1
- package/funcs/globalDataAggregate.js.map +1 -1
- package/funcs/globalDataConvertLegacySearchQueries.d.ts.map +1 -1
- package/funcs/globalDataConvertLegacySearchQueries.js +2 -1
- package/funcs/globalDataConvertLegacySearchQueries.js.map +1 -1
- package/funcs/globalDataCreateTrackedScan.d.ts.map +1 -1
- package/funcs/globalDataCreateTrackedScan.js +2 -1
- package/funcs/globalDataCreateTrackedScan.js.map +1 -1
- package/funcs/globalDataGetCertificate.d.ts.map +1 -1
- package/funcs/globalDataGetCertificate.js +2 -1
- package/funcs/globalDataGetCertificate.js.map +1 -1
- package/funcs/globalDataGetCertificateRaw.d.ts.map +1 -1
- package/funcs/globalDataGetCertificateRaw.js +2 -1
- package/funcs/globalDataGetCertificateRaw.js.map +1 -1
- package/funcs/globalDataGetCertificates.d.ts.map +1 -1
- package/funcs/globalDataGetCertificates.js +2 -1
- package/funcs/globalDataGetCertificates.js.map +1 -1
- package/funcs/globalDataGetCertificatesRaw.d.ts.map +1 -1
- package/funcs/globalDataGetCertificatesRaw.js +2 -1
- package/funcs/globalDataGetCertificatesRaw.js.map +1 -1
- package/funcs/globalDataGetHost.d.ts.map +1 -1
- package/funcs/globalDataGetHost.js +2 -1
- package/funcs/globalDataGetHost.js.map +1 -1
- package/funcs/globalDataGetHostTimeline.d.ts.map +1 -1
- package/funcs/globalDataGetHostTimeline.js +2 -1
- package/funcs/globalDataGetHostTimeline.js.map +1 -1
- package/funcs/globalDataGetHosts.d.ts.map +1 -1
- package/funcs/globalDataGetHosts.js +2 -1
- package/funcs/globalDataGetHosts.js.map +1 -1
- package/funcs/globalDataGetTrackedScan.d.ts.map +1 -1
- package/funcs/globalDataGetTrackedScan.js +2 -1
- package/funcs/globalDataGetTrackedScan.js.map +1 -1
- package/funcs/globalDataGetWebProperties.d.ts.map +1 -1
- package/funcs/globalDataGetWebProperties.js +2 -1
- package/funcs/globalDataGetWebProperties.js.map +1 -1
- package/funcs/globalDataGetWebProperty.d.ts.map +1 -1
- package/funcs/globalDataGetWebProperty.js +2 -1
- package/funcs/globalDataGetWebProperty.js.map +1 -1
- package/funcs/globalDataListServicesOnHost.d.ts.map +1 -1
- package/funcs/globalDataListServicesOnHost.js +2 -1
- package/funcs/globalDataListServicesOnHost.js.map +1 -1
- package/funcs/globalDataSearch.d.ts.map +1 -1
- package/funcs/globalDataSearch.js +2 -1
- package/funcs/globalDataSearch.js.map +1 -1
- package/funcs/threatHuntingCreateCenseyeJob.d.ts +1 -1
- package/funcs/threatHuntingCreateCenseyeJob.d.ts.map +1 -1
- package/funcs/threatHuntingCreateCenseyeJob.js +3 -2
- package/funcs/threatHuntingCreateCenseyeJob.js.map +1 -1
- package/funcs/threatHuntingCreateTrackedScan.d.ts +1 -1
- package/funcs/threatHuntingCreateTrackedScan.d.ts.map +1 -1
- package/funcs/threatHuntingCreateTrackedScan.js +3 -2
- package/funcs/threatHuntingCreateTrackedScan.js.map +1 -1
- package/funcs/threatHuntingGetCenseyeJob.d.ts +1 -1
- package/funcs/threatHuntingGetCenseyeJob.d.ts.map +1 -1
- package/funcs/threatHuntingGetCenseyeJob.js +3 -2
- package/funcs/threatHuntingGetCenseyeJob.js.map +1 -1
- package/funcs/threatHuntingGetCenseyeJobResults.d.ts +1 -1
- package/funcs/threatHuntingGetCenseyeJobResults.d.ts.map +1 -1
- package/funcs/threatHuntingGetCenseyeJobResults.js +3 -2
- package/funcs/threatHuntingGetCenseyeJobResults.js.map +1 -1
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts +1 -1
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts.map +1 -1
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js +3 -2
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js.map +1 -1
- package/funcs/threatHuntingGetTrackedScanThreatHunting.d.ts.map +1 -1
- package/funcs/threatHuntingGetTrackedScanThreatHunting.js +2 -1
- package/funcs/threatHuntingGetTrackedScanThreatHunting.js.map +1 -1
- package/funcs/threatHuntingListCenseyeJobs.d.ts +18 -0
- package/funcs/threatHuntingListCenseyeJobs.d.ts.map +1 -0
- package/funcs/threatHuntingListCenseyeJobs.js +134 -0
- package/funcs/threatHuntingListCenseyeJobs.js.map +1 -0
- package/funcs/threatHuntingListThreats.d.ts +1 -1
- package/funcs/threatHuntingListThreats.d.ts.map +1 -1
- package/funcs/threatHuntingListThreats.js +3 -2
- package/funcs/threatHuntingListThreats.js.map +1 -1
- package/funcs/threatHuntingValueCounts.d.ts +1 -1
- package/funcs/threatHuntingValueCounts.d.ts.map +1 -1
- package/funcs/threatHuntingValueCounts.js +3 -2
- package/funcs/threatHuntingValueCounts.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/lib/encodings.d.ts +1 -0
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +7 -0
- package/lib/encodings.js.map +1 -1
- package/lib/sdks.d.ts +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +2 -4
- package/lib/sdks.js.map +1 -1
- package/models/components/censeyejobslistresponse.d.ts +18 -0
- package/models/components/censeyejobslistresponse.d.ts.map +1 -0
- package/models/components/censeyejobslistresponse.js +57 -0
- package/models/components/censeyejobslistresponse.js.map +1 -0
- package/models/components/endpointscan.d.ts +2 -0
- package/models/components/endpointscan.d.ts.map +1 -1
- package/models/components/endpointscan.js +2 -0
- package/models/components/endpointscan.js.map +1 -1
- package/models/components/endpointscanstate.d.ts +2 -0
- package/models/components/endpointscanstate.d.ts.map +1 -1
- package/models/components/endpointscanstate.js +2 -0
- package/models/components/endpointscanstate.js.map +1 -1
- package/models/components/greynoise.d.ts +4 -0
- package/models/components/greynoise.d.ts.map +1 -1
- package/models/components/greynoise.js +6 -0
- package/models/components/greynoise.js.map +1 -1
- package/models/components/index.d.ts +6 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +6 -0
- package/models/components/index.js.map +1 -1
- package/models/components/mcp.d.ts +18 -0
- package/models/components/mcp.d.ts.map +1 -0
- package/models/components/mcp.js +66 -0
- package/models/components/mcp.js.map +1 -0
- package/models/components/mcpprompt.d.ts +10 -0
- package/models/components/mcpprompt.d.ts.map +1 -0
- package/models/components/mcpprompt.js +50 -0
- package/models/components/mcpprompt.js.map +1 -0
- package/models/components/mcpresource.d.ts +14 -0
- package/models/components/mcpresource.d.ts.map +1 -0
- package/models/components/mcpresource.js +59 -0
- package/models/components/mcpresource.js.map +1 -0
- package/models/components/mcptool.d.ts +11 -0
- package/models/components/mcptool.d.ts.map +1 -0
- package/models/components/mcptool.js +51 -0
- package/models/components/mcptool.js.map +1 -0
- package/models/components/responseenvelopecenseyejobslistresponse.d.ts +11 -0
- package/models/components/responseenvelopecenseyejobslistresponse.d.ts.map +1 -0
- package/models/components/responseenvelopecenseyejobslistresponse.js +51 -0
- package/models/components/responseenvelopecenseyejobslistresponse.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/v3threathuntingcenseyejobslist.d.ts +55 -0
- package/models/operations/v3threathuntingcenseyejobslist.d.ts.map +1 -0
- package/models/operations/v3threathuntingcenseyejobslist.js +80 -0
- package/models/operations/v3threathuntingcenseyejobslist.js.map +1 -0
- package/package.json +1 -1
- package/sdk/adversaryinvestigation.d.ts +54 -0
- package/sdk/adversaryinvestigation.d.ts.map +1 -0
- package/sdk/adversaryinvestigation.js +82 -0
- package/sdk/adversaryinvestigation.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/threathunting.d.ts +14 -7
- package/sdk/threathunting.d.ts.map +1 -1
- package/sdk/threathunting.js +17 -7
- package/sdk/threathunting.js.map +1 -1
- package/src/funcs/accountManagementGetMemberCreditUsage.ts +3 -1
- package/src/funcs/accountManagementGetOrganizationCreditUsage.ts +3 -1
- package/src/funcs/accountManagementGetOrganizationCredits.ts +3 -1
- package/src/funcs/accountManagementGetOrganizationDetails.ts +3 -1
- package/src/funcs/accountManagementGetUserCredits.ts +3 -1
- package/src/funcs/accountManagementGetUserCreditsUsage.ts +3 -1
- package/src/funcs/accountManagementInviteUserToOrganization.ts +3 -1
- package/src/funcs/accountManagementListOrganizationMembers.ts +3 -1
- package/src/funcs/accountManagementRemoveOrganizationMember.ts +3 -1
- package/src/funcs/accountManagementUpdateOrganizationMember.ts +3 -1
- package/src/funcs/collectionsAggregate.ts +3 -1
- package/src/funcs/collectionsCreate.ts +3 -1
- package/src/funcs/collectionsDelete.ts +3 -1
- package/src/funcs/collectionsGet.ts +3 -1
- package/src/funcs/collectionsList.ts +3 -1
- package/src/funcs/collectionsListEvents.ts +3 -1
- package/src/funcs/collectionsSearch.ts +3 -1
- package/src/funcs/collectionsUpdate.ts +3 -1
- package/src/funcs/globalDataAggregate.ts +3 -1
- package/src/funcs/globalDataConvertLegacySearchQueries.ts +3 -1
- package/src/funcs/globalDataCreateTrackedScan.ts +3 -1
- package/src/funcs/globalDataGetCertificate.ts +3 -1
- package/src/funcs/globalDataGetCertificateRaw.ts +3 -1
- package/src/funcs/globalDataGetCertificates.ts +3 -1
- package/src/funcs/globalDataGetCertificatesRaw.ts +3 -1
- package/src/funcs/globalDataGetHost.ts +3 -1
- package/src/funcs/globalDataGetHostTimeline.ts +3 -1
- package/src/funcs/globalDataGetHosts.ts +3 -1
- package/src/funcs/globalDataGetTrackedScan.ts +3 -1
- package/src/funcs/globalDataGetWebProperties.ts +3 -1
- package/src/funcs/globalDataGetWebProperty.ts +3 -1
- package/src/funcs/globalDataListServicesOnHost.ts +3 -1
- package/src/funcs/globalDataSearch.ts +3 -1
- package/src/funcs/threatHuntingCreateCenseyeJob.ts +4 -2
- package/src/funcs/threatHuntingCreateTrackedScan.ts +4 -2
- package/src/funcs/threatHuntingGetCenseyeJob.ts +4 -2
- package/src/funcs/threatHuntingGetCenseyeJobResults.ts +4 -2
- package/src/funcs/threatHuntingGetHostObservationsWithCertificate.ts +4 -2
- package/src/funcs/threatHuntingGetTrackedScanThreatHunting.ts +3 -1
- package/src/funcs/threatHuntingListCenseyeJobs.ts +199 -0
- package/src/funcs/threatHuntingListThreats.ts +4 -2
- package/src/funcs/threatHuntingValueCounts.ts +4 -2
- package/src/lib/config.ts +4 -4
- package/src/lib/encodings.ts +9 -0
- package/src/lib/sdks.ts +3 -6
- package/src/models/components/censeyejobslistresponse.ts +45 -0
- package/src/models/components/endpointscan.ts +3 -0
- package/src/models/components/endpointscanstate.ts +3 -0
- package/src/models/components/greynoise.ts +10 -0
- package/src/models/components/index.ts +6 -0
- package/src/models/components/mcp.ts +48 -0
- package/src/models/components/mcpprompt.ts +31 -0
- package/src/models/components/mcpresource.ts +44 -0
- package/src/models/components/mcptool.ts +30 -0
- package/src/models/components/responseenvelopecenseyejobslistresponse.ts +41 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/v3threathuntingcenseyejobslist.ts +115 -0
- package/src/sdk/adversaryinvestigation.ts +138 -0
- package/src/sdk/sdk.ts +8 -0
- package/src/sdk/threathunting.ts +25 -7
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -29,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* Live Discovery: Initiate a new scan
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
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
|
|
33
|
+
* 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 Adversary Investigation module. It costs 15 credits to execute this endpoint.
|
|
33
34
|
*/
|
|
34
35
|
export function threatHuntingCreateTrackedScan(
|
|
35
36
|
client: SDKCore,
|
|
@@ -146,7 +147,8 @@ async function $do(
|
|
|
146
147
|
|
|
147
148
|
const doResult = await client._do(req, {
|
|
148
149
|
context,
|
|
149
|
-
|
|
150
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
151
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
150
152
|
retryConfig: context.retryConfig,
|
|
151
153
|
retryCodes: context.retryCodes,
|
|
152
154
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -29,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* CensEye: Get job status
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
32
|
-
* Retrieve the current status of a CensEye pivot analysis job. Use this to poll for completion before fetching results.<br><br>To use this endpoint, your organization must have access to the
|
|
33
|
+
* Retrieve the current status of a CensEye pivot analysis job. Use this to poll for completion before fetching results.<br><br>To use this endpoint, your organization must have access to the Adversary Investigation module.
|
|
33
34
|
*/
|
|
34
35
|
export function threatHuntingGetCenseyeJob(
|
|
35
36
|
client: SDKCore,
|
|
@@ -151,7 +152,8 @@ async function $do(
|
|
|
151
152
|
|
|
152
153
|
const doResult = await client._do(req, {
|
|
153
154
|
context,
|
|
154
|
-
|
|
155
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
156
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
155
157
|
retryConfig: context.retryConfig,
|
|
156
158
|
retryCodes: context.retryCodes,
|
|
157
159
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -29,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* CensEye: Get job results
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
32
|
-
* Retrieve the results of a completed CensEye pivot analysis job. Each result contains a count and the field-value pairs that were analyzed. Results may be empty if the job is still running.<br><br>Results are paginated. Use the `next_page_token` from the response to fetch subsequent pages.<br><br>To use this endpoint, your organization must have access to the
|
|
33
|
+
* Retrieve the results of a completed CensEye pivot analysis job. Each result contains a count and the field-value pairs that were analyzed. Results may be empty if the job is still running.<br><br>Results are paginated. Use the `next_page_token` from the response to fetch subsequent pages.<br><br>To use this endpoint, your organization must have access to the Adversary Investigation module.
|
|
33
34
|
*/
|
|
34
35
|
export function threatHuntingGetCenseyeJobResults(
|
|
35
36
|
client: SDKCore,
|
|
@@ -153,7 +154,8 @@ async function $do(
|
|
|
153
154
|
|
|
154
155
|
const doResult = await client._do(req, {
|
|
155
156
|
context,
|
|
156
|
-
|
|
157
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
158
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
157
159
|
retryConfig: context.retryConfig,
|
|
158
160
|
retryCodes: context.retryCodes,
|
|
159
161
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -29,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* Get host history for a certificate
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
32
|
-
* Retrieve the historical observations of hosts associated with a certificate. This is useful for threat hunting, detection engineering, and timeline generation. Certificate history is also visible to
|
|
33
|
+
* Retrieve the historical observations of hosts associated with a certificate. This is useful for threat hunting, detection engineering, and timeline generation. Certificate history is also visible to Adversary Investigation users in the Platform UI on the [certificate timeline](https://docs.censys.com/docs/platform-threat-hunting-use-cert-history-to-build-better-detections#/).<br><br>You can define a specific time frame of interest. If you do not specify a time frame, this endpoint will search the historical dataset that is available to your account. You may also filter results by port and transport protocol.<br><br>This endpoint is available to organizations that have access to the Adversary Investigation module. It costs 5 credits per page of results.
|
|
33
34
|
*/
|
|
34
35
|
export function threatHuntingGetHostObservationsWithCertificate(
|
|
35
36
|
client: SDKCore,
|
|
@@ -157,7 +158,8 @@ async function $do(
|
|
|
157
158
|
|
|
158
159
|
const doResult = await client._do(req, {
|
|
159
160
|
context,
|
|
160
|
-
|
|
161
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
162
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
161
163
|
retryConfig: context.retryConfig,
|
|
162
164
|
retryCodes: context.retryCodes,
|
|
163
165
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -147,7 +148,8 @@ async function $do(
|
|
|
147
148
|
|
|
148
149
|
const doResult = await client._do(req, {
|
|
149
150
|
context,
|
|
150
|
-
|
|
151
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
152
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
151
153
|
retryConfig: context.retryConfig,
|
|
152
154
|
retryCodes: context.retryCodes,
|
|
153
155
|
});
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKBaseError } from "../models/errors/sdkbaseerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* CensEye: List jobs
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* List CensEye pivot analysis jobs for the current organization. Results are paginated. Optionally filter by asset (host, web property, or certificate).
|
|
34
|
+
*/
|
|
35
|
+
export function threatHuntingListCenseyeJobs(
|
|
36
|
+
client: SDKCore,
|
|
37
|
+
request: operations.V3ThreathuntingCenseyeJobsListRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.V3ThreathuntingCenseyeJobsListResponse,
|
|
42
|
+
| errors.AuthenticationError
|
|
43
|
+
| errors.ErrorModel
|
|
44
|
+
| SDKBaseError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: SDKCore,
|
|
63
|
+
request: operations.V3ThreathuntingCenseyeJobsListRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
operations.V3ThreathuntingCenseyeJobsListResponse,
|
|
69
|
+
| errors.AuthenticationError
|
|
70
|
+
| errors.ErrorModel
|
|
71
|
+
| SDKBaseError
|
|
72
|
+
| ResponseValidationError
|
|
73
|
+
| ConnectionError
|
|
74
|
+
| RequestAbortedError
|
|
75
|
+
| RequestTimeoutError
|
|
76
|
+
| InvalidRequestError
|
|
77
|
+
| UnexpectedClientError
|
|
78
|
+
| SDKValidationError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
82
|
+
> {
|
|
83
|
+
const parsed = safeParse(
|
|
84
|
+
request,
|
|
85
|
+
(value) =>
|
|
86
|
+
operations.V3ThreathuntingCenseyeJobsListRequest$outboundSchema.parse(
|
|
87
|
+
value,
|
|
88
|
+
),
|
|
89
|
+
"Input validation failed",
|
|
90
|
+
);
|
|
91
|
+
if (!parsed.ok) {
|
|
92
|
+
return [parsed, { status: "invalid" }];
|
|
93
|
+
}
|
|
94
|
+
const payload = parsed.value;
|
|
95
|
+
const body = null;
|
|
96
|
+
|
|
97
|
+
const path = pathToFunc("/v3/threat-hunting/censeye/jobs")();
|
|
98
|
+
|
|
99
|
+
const query = encodeFormQuery({
|
|
100
|
+
"certificate_id": payload.certificate_id,
|
|
101
|
+
"host_id": payload.host_id,
|
|
102
|
+
"organization_id": payload.organization_id
|
|
103
|
+
?? client._options.organizationId,
|
|
104
|
+
"page_size": payload.page_size,
|
|
105
|
+
"page_token": payload.page_token,
|
|
106
|
+
"webproperty_id": payload.webproperty_id,
|
|
107
|
+
}, { explode: false });
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const secConfig = await extractSecurity(client._options.personalAccessToken);
|
|
114
|
+
const securityInput = secConfig == null
|
|
115
|
+
? {}
|
|
116
|
+
: { personalAccessToken: secConfig };
|
|
117
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
118
|
+
|
|
119
|
+
const context = {
|
|
120
|
+
options: client._options,
|
|
121
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
122
|
+
operationID: "v3-threathunting-censeye-jobs-list",
|
|
123
|
+
oAuth2Scopes: null,
|
|
124
|
+
|
|
125
|
+
resolvedSecurity: requestSecurity,
|
|
126
|
+
|
|
127
|
+
securitySource: client._options.personalAccessToken,
|
|
128
|
+
retryConfig: options?.retries
|
|
129
|
+
|| client._options.retryConfig
|
|
130
|
+
|| { strategy: "none" },
|
|
131
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const requestRes = client._createRequest(context, {
|
|
135
|
+
security: requestSecurity,
|
|
136
|
+
method: "GET",
|
|
137
|
+
baseURL: options?.serverURL,
|
|
138
|
+
path: path,
|
|
139
|
+
headers: headers,
|
|
140
|
+
query: query,
|
|
141
|
+
body: body,
|
|
142
|
+
userAgent: client._options.userAgent,
|
|
143
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
144
|
+
}, options);
|
|
145
|
+
if (!requestRes.ok) {
|
|
146
|
+
return [requestRes, { status: "invalid" }];
|
|
147
|
+
}
|
|
148
|
+
const req = requestRes.value;
|
|
149
|
+
|
|
150
|
+
const doResult = await client._do(req, {
|
|
151
|
+
context,
|
|
152
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
153
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
154
|
+
retryConfig: context.retryConfig,
|
|
155
|
+
retryCodes: context.retryCodes,
|
|
156
|
+
});
|
|
157
|
+
if (!doResult.ok) {
|
|
158
|
+
return [doResult, { status: "request-error", request: req }];
|
|
159
|
+
}
|
|
160
|
+
const response = doResult.value;
|
|
161
|
+
|
|
162
|
+
const responseFields = {
|
|
163
|
+
HttpMeta: { Response: response, Request: req },
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const [result] = await M.match<
|
|
167
|
+
operations.V3ThreathuntingCenseyeJobsListResponse,
|
|
168
|
+
| errors.AuthenticationError
|
|
169
|
+
| errors.ErrorModel
|
|
170
|
+
| SDKBaseError
|
|
171
|
+
| ResponseValidationError
|
|
172
|
+
| ConnectionError
|
|
173
|
+
| RequestAbortedError
|
|
174
|
+
| RequestTimeoutError
|
|
175
|
+
| InvalidRequestError
|
|
176
|
+
| UnexpectedClientError
|
|
177
|
+
| SDKValidationError
|
|
178
|
+
>(
|
|
179
|
+
M.json(
|
|
180
|
+
200,
|
|
181
|
+
operations.V3ThreathuntingCenseyeJobsListResponse$inboundSchema,
|
|
182
|
+
{ hdrs: true, key: "Result" },
|
|
183
|
+
),
|
|
184
|
+
M.jsonErr(401, errors.AuthenticationError$inboundSchema),
|
|
185
|
+
M.jsonErr([400, 403, 409], errors.ErrorModel$inboundSchema, {
|
|
186
|
+
ctype: "application/problem+json",
|
|
187
|
+
}),
|
|
188
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
189
|
+
ctype: "application/problem+json",
|
|
190
|
+
}),
|
|
191
|
+
M.fail("4XX"),
|
|
192
|
+
M.fail("5XX"),
|
|
193
|
+
)(response, req, { extraFields: responseFields });
|
|
194
|
+
if (!result.ok) {
|
|
195
|
+
return [result, { status: "complete", request: req, response }];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return [result, { status: "complete", request: req, response }];
|
|
199
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -29,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* List active threats
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
32
|
-
* Retrieve a list of active threats observed by Censys by aggregating threat IDs across hosts and web properties. Threats are active if their fingerprint has been identified on hosts or web properties by Censys scans. This information is also available on the [Explore Threats page in the Platform web UI](https://platform.censys.io/threats).<br><br>This endpoint is available to organizations that have access to the
|
|
33
|
+
* Retrieve a list of active threats observed by Censys by aggregating threat IDs across hosts and web properties. Threats are active if their fingerprint has been identified on hosts or web properties by Censys scans. This information is also available on the [Explore Threats page in the Platform web UI](https://platform.censys.io/threats).<br><br>This endpoint is available to organizations that have access to the Adversary Investigation module.
|
|
33
34
|
*/
|
|
34
35
|
export function threatHuntingListThreats(
|
|
35
36
|
client: SDKCore,
|
|
@@ -142,7 +143,8 @@ async function $do(
|
|
|
142
143
|
|
|
143
144
|
const doResult = await client._do(req, {
|
|
144
145
|
context,
|
|
145
|
-
|
|
146
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
147
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
146
148
|
retryConfig: context.retryConfig,
|
|
147
149
|
retryCodes: context.retryCodes,
|
|
148
150
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -29,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* CensEye: Retrieve value counts to discover pivots
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
32
|
-
* Get counts of web assets for specific field-value pairs and combinations of field-value pairs. This is similar to the [CensEye functionality](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#/) available in the Platform web UI, but it allows you to define specific fields of interest rather than the [default fields](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#default-pivot-fields) leveraged by the tool in the UI.<br><br>Each array can only target fields within the same nested object and may contain at most 5 field-value pairs. For example, you can combine `host.services.port=80` and `host.services.protocol=SSH` in the same array, but you cannot combine `host.services.port=80` and `host.location.country="United States"` in the same array. You can input multiple arrays of objects in each API call.<br><br>To use this endpoint, your organization must have access to the
|
|
33
|
+
* Get counts of web assets for specific field-value pairs and combinations of field-value pairs. This is similar to the [CensEye functionality](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#/) available in the Platform web UI, but it allows you to define specific fields of interest rather than the [default fields](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#default-pivot-fields) leveraged by the tool in the UI.<br><br>Each array can only target fields within the same nested object and may contain at most 5 field-value pairs. For example, you can combine `host.services.port=80` and `host.services.protocol=SSH` in the same array, but you cannot combine `host.services.port=80` and `host.location.country="United States"` in the same array. You can input multiple arrays of objects in each API call.<br><br>To use this endpoint, your organization must have access to the Adversary Investigation module. This endpoint costs 1 credit per count condition (array of objects) included in the API call.
|
|
33
34
|
*/
|
|
34
35
|
export function threatHuntingValueCounts(
|
|
35
36
|
client: SDKCore,
|
|
@@ -144,7 +145,8 @@ async function $do(
|
|
|
144
145
|
|
|
145
146
|
const doResult = await client._do(req, {
|
|
146
147
|
context,
|
|
147
|
-
|
|
148
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
149
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
148
150
|
retryConfig: context.retryConfig,
|
|
149
151
|
retryCodes: context.retryCodes,
|
|
150
152
|
});
|
package/src/lib/config.ts
CHANGED
|
@@ -65,9 +65,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
|
|
66
66
|
export const SDK_METADATA = {
|
|
67
67
|
language: "typescript",
|
|
68
|
-
openapiDocVersion: "1.0.
|
|
69
|
-
sdkVersion: "0.10.
|
|
70
|
-
genVersion: "2.
|
|
68
|
+
openapiDocVersion: "1.0.92",
|
|
69
|
+
sdkVersion: "0.10.5",
|
|
70
|
+
genVersion: "2.881.4",
|
|
71
71
|
userAgent:
|
|
72
|
-
"speakeasy-sdk/typescript 0.10.
|
|
72
|
+
"speakeasy-sdk/typescript 0.10.5 2.881.4 1.0.92 @censys/platform-sdk",
|
|
73
73
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -514,3 +514,12 @@ export function appendForm(
|
|
|
514
514
|
fd.append(key, String(value));
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
+
|
|
518
|
+
export async function normalizeBlob(
|
|
519
|
+
value: Pick<Blob, "arrayBuffer" | "type">,
|
|
520
|
+
): Promise<Blob> {
|
|
521
|
+
if (value instanceof Blob) {
|
|
522
|
+
return value;
|
|
523
|
+
}
|
|
524
|
+
return new Blob([await value.arrayBuffer()], { type: value.type });
|
|
525
|
+
}
|
package/src/lib/sdks.ts
CHANGED
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
isConnectionError,
|
|
22
22
|
isTimeoutError,
|
|
23
23
|
matchContentType,
|
|
24
|
-
matchStatusCode,
|
|
25
24
|
} from "./http.js";
|
|
26
25
|
import { Logger } from "./logger.js";
|
|
27
26
|
import { retry, RetryConfig } from "./retries.js";
|
|
@@ -230,7 +229,7 @@ export class ClientSDK {
|
|
|
230
229
|
request: Request,
|
|
231
230
|
options: {
|
|
232
231
|
context: HookContext;
|
|
233
|
-
|
|
232
|
+
isErrorStatusCode: (statusCode: number) => boolean;
|
|
234
233
|
retryConfig: RetryConfig;
|
|
235
234
|
retryCodes: string[];
|
|
236
235
|
},
|
|
@@ -243,7 +242,7 @@ export class ClientSDK {
|
|
|
243
242
|
| UnexpectedClientError
|
|
244
243
|
>
|
|
245
244
|
> {
|
|
246
|
-
const { context,
|
|
245
|
+
const { context, isErrorStatusCode } = options;
|
|
247
246
|
|
|
248
247
|
return retry(
|
|
249
248
|
async () => {
|
|
@@ -255,7 +254,7 @@ export class ClientSDK {
|
|
|
255
254
|
let response = await this.#httpClient.request(req);
|
|
256
255
|
|
|
257
256
|
try {
|
|
258
|
-
if (
|
|
257
|
+
if (isErrorStatusCode(response.status)) {
|
|
259
258
|
const result = await this.#hooks.afterError(
|
|
260
259
|
context,
|
|
261
260
|
response,
|
|
@@ -379,8 +378,6 @@ async function logResponse(
|
|
|
379
378
|
break;
|
|
380
379
|
case matchContentType(res, "application/jsonl")
|
|
381
380
|
|| jsonlLikeContentTypeRE.test(ct):
|
|
382
|
-
logger.log(await res.clone().text());
|
|
383
|
-
break;
|
|
384
381
|
case matchContentType(res, "text/event-stream"):
|
|
385
382
|
logger.log(`<${contentType}>`);
|
|
386
383
|
break;
|
|
@@ -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 { CenseyeJob, CenseyeJob$inboundSchema } from "./censeyejob.js";
|
|
11
|
+
|
|
12
|
+
export type CenseyeJobsListResponse = {
|
|
13
|
+
/**
|
|
14
|
+
* List of CensEye jobs.
|
|
15
|
+
*/
|
|
16
|
+
jobs: Array<CenseyeJob> | null;
|
|
17
|
+
/**
|
|
18
|
+
* Token to retrieve the next page of jobs.
|
|
19
|
+
*/
|
|
20
|
+
nextPageToken?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const CenseyeJobsListResponse$inboundSchema: z.ZodType<
|
|
25
|
+
CenseyeJobsListResponse,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
jobs: z.nullable(z.array(CenseyeJob$inboundSchema)),
|
|
30
|
+
next_page_token: z.string().optional(),
|
|
31
|
+
}).transform((v) => {
|
|
32
|
+
return remap$(v, {
|
|
33
|
+
"next_page_token": "nextPageToken",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export function censeyeJobsListResponseFromJSON(
|
|
38
|
+
jsonString: string,
|
|
39
|
+
): SafeParseResult<CenseyeJobsListResponse, SDKValidationError> {
|
|
40
|
+
return safeParse(
|
|
41
|
+
jsonString,
|
|
42
|
+
(x) => CenseyeJobsListResponse$inboundSchema.parse(JSON.parse(x)),
|
|
43
|
+
`Failed to parse 'CenseyeJobsListResponse' from JSON`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
} from "./ivantiavalanche.js";
|
|
25
25
|
import { Jenkins, Jenkins$inboundSchema } from "./jenkins.js";
|
|
26
26
|
import { Kubernetes, Kubernetes$inboundSchema } from "./kubernetes.js";
|
|
27
|
+
import { Mcp, Mcp$inboundSchema } from "./mcp.js";
|
|
27
28
|
import { Ollama, Ollama$inboundSchema } from "./ollama.js";
|
|
28
29
|
import { OpenDirectory, OpenDirectory$inboundSchema } from "./opendirectory.js";
|
|
29
30
|
import {
|
|
@@ -68,6 +69,7 @@ export type EndpointScan = {
|
|
|
68
69
|
ivantiAvalanche?: IvantiAvalanche | undefined;
|
|
69
70
|
jenkins?: Jenkins | undefined;
|
|
70
71
|
kubernetes?: Kubernetes | undefined;
|
|
72
|
+
mcp?: Mcp | undefined;
|
|
71
73
|
ollama?: Ollama | undefined;
|
|
72
74
|
openDirectory?: OpenDirectory | undefined;
|
|
73
75
|
path?: string | undefined;
|
|
@@ -112,6 +114,7 @@ export const EndpointScan$inboundSchema: z.ZodType<
|
|
|
112
114
|
ivanti_avalanche: IvantiAvalanche$inboundSchema.optional(),
|
|
113
115
|
jenkins: Jenkins$inboundSchema.optional(),
|
|
114
116
|
kubernetes: Kubernetes$inboundSchema.optional(),
|
|
117
|
+
mcp: Mcp$inboundSchema.optional(),
|
|
115
118
|
ollama: Ollama$inboundSchema.optional(),
|
|
116
119
|
open_directory: OpenDirectory$inboundSchema.optional(),
|
|
117
120
|
path: z.string().optional(),
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
} from "./ivantiavalanche.js";
|
|
29
29
|
import { Jenkins, Jenkins$inboundSchema } from "./jenkins.js";
|
|
30
30
|
import { Kubernetes, Kubernetes$inboundSchema } from "./kubernetes.js";
|
|
31
|
+
import { Mcp, Mcp$inboundSchema } from "./mcp.js";
|
|
31
32
|
import { Ollama, Ollama$inboundSchema } from "./ollama.js";
|
|
32
33
|
import { OpenDirectory, OpenDirectory$inboundSchema } from "./opendirectory.js";
|
|
33
34
|
import {
|
|
@@ -71,6 +72,7 @@ export type EndpointScanState = {
|
|
|
71
72
|
ivantiAvalanche?: IvantiAvalanche | undefined;
|
|
72
73
|
jenkins?: Jenkins | undefined;
|
|
73
74
|
kubernetes?: Kubernetes | undefined;
|
|
75
|
+
mcp?: Mcp | undefined;
|
|
74
76
|
ollama?: Ollama | undefined;
|
|
75
77
|
openDirectory?: OpenDirectory | undefined;
|
|
76
78
|
path?: string | undefined;
|
|
@@ -114,6 +116,7 @@ export const EndpointScanState$inboundSchema: z.ZodType<
|
|
|
114
116
|
ivanti_avalanche: IvantiAvalanche$inboundSchema.optional(),
|
|
115
117
|
jenkins: Jenkins$inboundSchema.optional(),
|
|
116
118
|
kubernetes: Kubernetes$inboundSchema.optional(),
|
|
119
|
+
mcp: Mcp$inboundSchema.optional(),
|
|
117
120
|
ollama: Ollama$inboundSchema.optional(),
|
|
118
121
|
open_directory: OpenDirectory$inboundSchema.optional(),
|
|
119
122
|
path: z.string().optional(),
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -17,6 +18,10 @@ export type Greynoise = {
|
|
|
17
18
|
* The classification of the IP address.
|
|
18
19
|
*/
|
|
19
20
|
classification?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The last time the IP address was observed.
|
|
23
|
+
*/
|
|
24
|
+
lastObservedTime?: string | undefined;
|
|
20
25
|
/**
|
|
21
26
|
* The tags associated with the IP address.
|
|
22
27
|
*/
|
|
@@ -31,7 +36,12 @@ export const Greynoise$inboundSchema: z.ZodType<
|
|
|
31
36
|
> = z.object({
|
|
32
37
|
actor: z.string().optional(),
|
|
33
38
|
classification: z.string().optional(),
|
|
39
|
+
last_observed_time: z.string().optional(),
|
|
34
40
|
tags: z.nullable(z.array(GreynoiseTag$inboundSchema)).optional(),
|
|
41
|
+
}).transform((v) => {
|
|
42
|
+
return remap$(v, {
|
|
43
|
+
"last_observed_time": "lastObservedTime",
|
|
44
|
+
});
|
|
35
45
|
});
|
|
36
46
|
|
|
37
47
|
export function greynoiseFromJSON(
|
|
@@ -25,6 +25,7 @@ export * from "./basicconstraints.js";
|
|
|
25
25
|
export * from "./cabforganizationid.js";
|
|
26
26
|
export * from "./capabilities.js";
|
|
27
27
|
export * from "./censeyejob.js";
|
|
28
|
+
export * from "./censeyejobslistresponse.js";
|
|
28
29
|
export * from "./censeyeresult.js";
|
|
29
30
|
export * from "./censeyeresultsresponse.js";
|
|
30
31
|
export * from "./censeyetarget.js";
|
|
@@ -261,6 +262,10 @@ export * from "./lpdmessage.js";
|
|
|
261
262
|
export * from "./matchedservice.js";
|
|
262
263
|
export * from "./mavlink.js";
|
|
263
264
|
export * from "./mavlinkframe.js";
|
|
265
|
+
export * from "./mcp.js";
|
|
266
|
+
export * from "./mcpprompt.js";
|
|
267
|
+
export * from "./mcpresource.js";
|
|
268
|
+
export * from "./mcptool.js";
|
|
264
269
|
export * from "./mdns.js";
|
|
265
270
|
export * from "./mdnsresult.js";
|
|
266
271
|
export * from "./mediacapabilities.js";
|
|
@@ -409,6 +414,7 @@ export * from "./reputationevidenceexternalsignal.js";
|
|
|
409
414
|
export * from "./reputationevidencefieldvalue.js";
|
|
410
415
|
export * from "./reputationevidencethreat.js";
|
|
411
416
|
export * from "./responseenvelopecenseyejob.js";
|
|
417
|
+
export * from "./responseenvelopecenseyejobslistresponse.js";
|
|
412
418
|
export * from "./responseenvelopecenseyeresultsresponse.js";
|
|
413
419
|
export * from "./responseenvelopecertificateasset.js";
|
|
414
420
|
export * from "./responseenvelopecollection.js";
|
|
@@ -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 { McpPrompt, McpPrompt$inboundSchema } from "./mcpprompt.js";
|
|
11
|
+
import { McpResource, McpResource$inboundSchema } from "./mcpresource.js";
|
|
12
|
+
import { McpTool, McpTool$inboundSchema } from "./mcptool.js";
|
|
13
|
+
|
|
14
|
+
export type Mcp = {
|
|
15
|
+
prompts?: Array<McpPrompt> | null | undefined;
|
|
16
|
+
protocolVersion?: string | undefined;
|
|
17
|
+
resources?: Array<McpResource> | null | undefined;
|
|
18
|
+
serverName?: string | undefined;
|
|
19
|
+
serverVersion?: string | undefined;
|
|
20
|
+
tools?: Array<McpTool> | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const Mcp$inboundSchema: z.ZodType<Mcp, z.ZodTypeDef, unknown> = z
|
|
25
|
+
.object({
|
|
26
|
+
prompts: z.nullable(z.array(McpPrompt$inboundSchema)).optional(),
|
|
27
|
+
protocol_version: z.string().optional(),
|
|
28
|
+
resources: z.nullable(z.array(McpResource$inboundSchema)).optional(),
|
|
29
|
+
server_name: z.string().optional(),
|
|
30
|
+
server_version: z.string().optional(),
|
|
31
|
+
tools: z.nullable(z.array(McpTool$inboundSchema)).optional(),
|
|
32
|
+
}).transform((v) => {
|
|
33
|
+
return remap$(v, {
|
|
34
|
+
"protocol_version": "protocolVersion",
|
|
35
|
+
"server_name": "serverName",
|
|
36
|
+
"server_version": "serverVersion",
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export function mcpFromJSON(
|
|
41
|
+
jsonString: string,
|
|
42
|
+
): SafeParseResult<Mcp, SDKValidationError> {
|
|
43
|
+
return safeParse(
|
|
44
|
+
jsonString,
|
|
45
|
+
(x) => Mcp$inboundSchema.parse(JSON.parse(x)),
|
|
46
|
+
`Failed to parse 'Mcp' from JSON`,
|
|
47
|
+
);
|
|
48
|
+
}
|