/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { globalDataAggregate } from "../funcs/globalDataAggregate.js"; import { globalDataConvertLegacySearchQueries } from "../funcs/globalDataConvertLegacySearchQueries.js"; import { globalDataCreateTrackedScan } from "../funcs/globalDataCreateTrackedScan.js"; import { globalDataGetCertificate } from "../funcs/globalDataGetCertificate.js"; import { globalDataGetCertificateRaw } from "../funcs/globalDataGetCertificateRaw.js"; import { globalDataGetCertificates } from "../funcs/globalDataGetCertificates.js"; import { globalDataGetCertificatesRaw } from "../funcs/globalDataGetCertificatesRaw.js"; import { globalDataGetHost } from "../funcs/globalDataGetHost.js"; import { globalDataGetHosts } from "../funcs/globalDataGetHosts.js"; import { globalDataGetHostTimeline } from "../funcs/globalDataGetHostTimeline.js"; import { globalDataGetTrackedScan } from "../funcs/globalDataGetTrackedScan.js"; import { globalDataGetWebProperties } from "../funcs/globalDataGetWebProperties.js"; import { globalDataGetWebProperty } from "../funcs/globalDataGetWebProperty.js"; import { globalDataListServicesOnHost } from "../funcs/globalDataListServicesOnHost.js"; import { globalDataSearch } from "../funcs/globalDataSearch.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class GlobalData extends ClientSDK { /** * Retrieve multiple certificates * * @remarks * Retrieve information about multiple certificates. You can retrieve up to 1,000 certificates per call. A certificate ID is its SHA-256 fingerprint in the Censys dataset. */ async getCertificates( request: operations.V3GlobaldataAssetCertificateListPostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetCertificates( this, request, options, )); } /** * Retrieve multiple certificates in PEM format * * @remarks * Retrieve the raw PEM-encoded format for multiple certificates. You can retrieve up to 1,000 certificates per call. A certificate ID is its SHA-256 fingerprint in the Censys dataset. */ async getCertificatesRaw( request: operations.V3GlobaldataAssetCertificateListRawPostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetCertificatesRaw( this, request, options, )); } /** * Get a certificate * * @remarks * Retrieve information about a single certificate. A certificate ID is its SHA-256 fingerprint in the Censys dataset. */ async getCertificate( request: operations.V3GlobaldataAssetCertificateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetCertificate( this, request, options, )); } /** * Get a certificate in PEM format * * @remarks * Retrieve the raw PEM-encoded format of a certificate. A certificate ID is its SHA-256 fingerprint in the Censys dataset. */ async getCertificateRaw( request: operations.V3GlobaldataAssetCertificateRawRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetCertificateRaw( this, request, options, )); } /** * Retrieve multiple hosts * * @remarks * Retrieve information about multiple hosts. You can retrieve up to 100 hosts per call. A host ID is its IP address. */ async getHosts( request: operations.V3GlobaldataAssetHostListPostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetHosts( this, request, options, )); } /** * Get a host * * @remarks * Retrieve information about a single host. A host ID is its IP address. */ async getHost( request: operations.V3GlobaldataAssetHostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetHost( this, request, options, )); } /** * Get service history for a host * * @remarks * Retrieve historical service observations for a host. This endpoint returns time ranges during which services were detected on the host.

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 can filter by port number, protocol, and transport protocol. */ async listServicesOnHost( request: operations.V3GlobaldataServiceOnHostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataListServicesOnHost( this, request, options, )); } /** * Get host event history * * @remarks * Retrieve event history for a host. A host ID is its IP address.

Note that when a service protocol changes after a new scan (for example, from `UNKNOWN` to `NETBIOS`), this information will be reflected in the `scan` object. */ async getHostTimeline( request: operations.V3GlobaldataAssetHostTimelineRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetHostTimeline( this, request, options, )); } /** * Retrieve multiple web properties * * @remarks * Retrieve information about multiple web properties. You can retrieve up to 100 web properties per call. Web properties are identified using a combination of a hostname and port joined with a colon, such as `platform.censys.io:80`. */ async getWebProperties( request: operations.V3GlobaldataAssetWebpropertyListPostRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetWebProperties( this, request, options, )); } /** * Get a web property * * @remarks * Retrieve information about a single web property. Web properties are identified using a combination of a hostname and port joined with a colon, such as `platform.censys.io:80`. */ async getWebProperty( request: operations.V3GlobaldataAssetWebpropertyRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetWebProperty( this, request, options, )); } /** * Live Rescan: Initiate a new rescan * * @remarks * Initiate a rescan for a known host service at a specific IP and port (`ip:port`) or hostname and port (`hostname:port`). This is equivalent to the [Live Rescan](https://docs.censys.com/docs/platform-live-rescan#/) feature available in the UI, but you can also target web properties in addition to hosts.

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-globaldata-scans-get#/). After the scan completes, perform a lookup on the target asset to retrieve detailed scan information.

This endpoint is available to all Enterprise customers. It costs 10 credits to execute. */ async createTrackedScan( request: operations.V3GlobaldataScansRescanRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataCreateTrackedScan( this, request, options, )); } /** * Get scan status * * @remarks * Retrieve the current status of a scan by its ID. This endpoint works for both [Live Discovery scans](https://docs.censys.com/reference/v3-threathunting-scans-discovery#/) and [Live Rescans](https://docs.censys.com/reference/v3-globaldata-scans-rescan#/).

If the scan was successful, perform a lookup on the target asset to retrieve detailed scan information.

This endpoint is available to all Enterprise customers. This endpoint does not cost any credits to execute. */ async getTrackedScan( request: operations.V3GlobaldataScansGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataGetTrackedScan( this, request, options, )); } /** * Aggregate results for a search query * * @remarks * Aggregate results for a Platform search query. This functionality is equivalent to the [Report Builder](https://docs.censys.com/docs/platform-report-builder#/) in the Platform web UI. */ async aggregate( request: operations.V3GlobaldataSearchAggregateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataAggregate( this, request, options, )); } /** * Convert Legacy Search queries to Platform queries * * @remarks * Convert Censys Search Language queries used in Legacy Search into Censys Query Language (CenQL) queries for use in the Platform.

Reference the [documentation on CenQL](https://docs.censys.com/docs/censys-query-language) for more information about query syntax. */ async convertLegacySearchQueries( request: operations.V3GlobaldataSearchConvertRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataConvertLegacySearchQueries( this, request, options, )); } /** * Run a search query * * @remarks * Run a search query across Censys data. Reference the [documentation on Censys Query Language](https://docs.censys.com/docs/censys-query-language#/) for information about query syntax. Host services that match your search criteria will be returned in a `matched_services` object. */ async search( request: operations.V3GlobaldataSearchQueryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(globalDataSearch( this, request, options, )); } }