@censys/platform-sdk 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/docs/sdks/globaldata/README.md +190 -92
- package/docs/sdks/threathunting/README.md +29 -21
- package/examples/globalDataSearch.example.ts +1 -1
- package/examples/package-lock.json +3 -3
- package/funcs/globalDataConvertLegacySearchQueries.d.ts +18 -0
- package/funcs/globalDataConvertLegacySearchQueries.d.ts.map +1 -0
- package/funcs/globalDataConvertLegacySearchQueries.js +134 -0
- package/funcs/globalDataConvertLegacySearchQueries.js.map +1 -0
- package/funcs/globalDataCreateTrackedScan.d.ts +2 -2
- package/funcs/globalDataCreateTrackedScan.js +2 -2
- package/funcs/{globalDataGetTrackedScanThreatHunting.d.ts → globalDataGetCertificateRaw.d.ts} +4 -5
- package/funcs/globalDataGetCertificateRaw.d.ts.map +1 -0
- package/funcs/{globalDataGetHostObservationsWithCertificate.js → globalDataGetCertificateRaw.js} +10 -19
- package/funcs/globalDataGetCertificateRaw.js.map +1 -0
- package/funcs/globalDataGetCertificates.d.ts +1 -1
- package/funcs/globalDataGetCertificates.d.ts.map +1 -1
- package/funcs/globalDataGetCertificates.js +9 -6
- package/funcs/globalDataGetCertificates.js.map +1 -1
- package/funcs/globalDataGetCertificatesRaw.d.ts +18 -0
- package/funcs/globalDataGetCertificatesRaw.d.ts.map +1 -0
- package/funcs/globalDataGetCertificatesRaw.js +130 -0
- package/funcs/globalDataGetCertificatesRaw.js.map +1 -0
- package/funcs/globalDataGetHostTimeline.d.ts +1 -1
- package/funcs/globalDataGetHostTimeline.js +1 -1
- package/funcs/globalDataGetHosts.d.ts +1 -1
- package/funcs/globalDataGetHosts.d.ts.map +1 -1
- package/funcs/globalDataGetHosts.js +8 -6
- package/funcs/globalDataGetHosts.js.map +1 -1
- package/funcs/globalDataGetTrackedScan.d.ts +2 -3
- package/funcs/globalDataGetTrackedScan.d.ts.map +1 -1
- package/funcs/globalDataGetTrackedScan.js +2 -3
- package/funcs/globalDataGetTrackedScan.js.map +1 -1
- package/funcs/globalDataGetWebProperties.d.ts +1 -1
- package/funcs/globalDataGetWebProperties.d.ts.map +1 -1
- package/funcs/globalDataGetWebProperties.js +9 -6
- package/funcs/globalDataGetWebProperties.js.map +1 -1
- package/funcs/threatHuntingCreateTrackedScan.d.ts +2 -2
- package/funcs/threatHuntingCreateTrackedScan.js +2 -2
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts +18 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.d.ts.map +1 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js +141 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js.map +1 -0
- package/funcs/threatHuntingGetTrackedScanThreatHunting.d.ts +18 -0
- package/funcs/threatHuntingGetTrackedScanThreatHunting.d.ts.map +1 -0
- package/funcs/{globalDataGetTrackedScanThreatHunting.js → threatHuntingGetTrackedScanThreatHunting.js} +5 -6
- package/funcs/threatHuntingGetTrackedScanThreatHunting.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js.map +1 -1
- package/models/components/alternativequery.d.ts +69 -0
- package/models/components/alternativequery.d.ts.map +1 -0
- package/models/components/alternativequery.js +93 -0
- package/models/components/alternativequery.js.map +1 -0
- package/models/components/assetcertificatelistinputbody.d.ts +32 -0
- package/models/components/assetcertificatelistinputbody.d.ts.map +1 -0
- package/models/components/assetcertificatelistinputbody.js +78 -0
- package/models/components/assetcertificatelistinputbody.js.map +1 -0
- package/models/components/assethostlistinputbody.d.ts +32 -0
- package/models/components/assethostlistinputbody.d.ts.map +1 -0
- package/models/components/assethostlistinputbody.js +78 -0
- package/models/components/assethostlistinputbody.js.map +1 -0
- package/models/components/assetwebpropertylistinputbody.d.ts +32 -0
- package/models/components/assetwebpropertylistinputbody.d.ts.map +1 -0
- package/models/components/assetwebpropertylistinputbody.js +78 -0
- package/models/components/assetwebpropertylistinputbody.js.map +1 -0
- package/models/components/asteriskmanagerinterface.d.ts +29 -0
- package/models/components/asteriskmanagerinterface.d.ts.map +1 -0
- package/models/components/asteriskmanagerinterface.js +69 -0
- package/models/components/asteriskmanagerinterface.js.map +1 -0
- package/models/components/convertqueryerror.d.ts +32 -0
- package/models/components/convertqueryerror.d.ts.map +1 -0
- package/models/components/convertqueryerror.js +69 -0
- package/models/components/convertqueryerror.js.map +1 -0
- package/models/components/index.d.ts +12 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +12 -0
- package/models/components/index.js.map +1 -1
- package/models/components/openvpnmgmt.d.ts +37 -0
- package/models/components/openvpnmgmt.d.ts.map +1 -0
- package/models/components/openvpnmgmt.js +92 -0
- package/models/components/openvpnmgmt.js.map +1 -0
- package/models/components/rawcertificateresponse.d.ts +31 -0
- package/models/components/rawcertificateresponse.d.ts.map +1 -0
- package/models/components/rawcertificateresponse.js +80 -0
- package/models/components/rawcertificateresponse.js.map +1 -0
- package/models/components/rdp.d.ts +2 -0
- package/models/components/rdp.d.ts.map +1 -1
- package/models/components/rdp.js +4 -0
- package/models/components/rdp.js.map +1 -1
- package/models/components/responseenvelopelistrawcertificateresponse.d.ts +30 -0
- package/models/components/responseenvelopelistrawcertificateresponse.d.ts.map +1 -0
- package/models/components/responseenvelopelistrawcertificateresponse.js +72 -0
- package/models/components/responseenvelopelistrawcertificateresponse.js.map +1 -0
- package/models/components/responseenvelopelistsearchconvertqueryresponse.d.ts +30 -0
- package/models/components/responseenvelopelistsearchconvertqueryresponse.d.ts.map +1 -0
- package/models/components/responseenvelopelistsearchconvertqueryresponse.js +72 -0
- package/models/components/responseenvelopelistsearchconvertqueryresponse.js.map +1 -0
- package/models/components/screenshot.d.ts +2 -0
- package/models/components/screenshot.d.ts.map +1 -1
- package/models/components/screenshot.js +2 -0
- package/models/components/screenshot.js.map +1 -1
- package/models/components/searchconvertqueryinputbody.d.ts +32 -0
- package/models/components/searchconvertqueryinputbody.d.ts.map +1 -0
- package/models/components/searchconvertqueryinputbody.js +69 -0
- package/models/components/searchconvertqueryinputbody.js.map +1 -0
- package/models/components/searchconvertqueryresponse.d.ts +91 -0
- package/models/components/searchconvertqueryresponse.d.ts.map +1 -0
- package/models/components/searchconvertqueryresponse.js +117 -0
- package/models/components/searchconvertqueryresponse.js.map +1 -0
- package/models/components/service.d.ts +6 -0
- package/models/components/service.d.ts.map +1 -1
- package/models/components/service.js +11 -0
- package/models/components/service.js.map +1 -1
- package/models/components/servicescan.d.ts +6 -0
- package/models/components/servicescan.d.ts.map +1 -1
- package/models/components/servicescan.js +10 -0
- package/models/components/servicescan.js.map +1 -1
- package/models/operations/index.d.ts +7 -4
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +7 -4
- package/models/operations/index.js.map +1 -1
- package/models/operations/v3globaldataassetcertificatelistpost.d.ts +91 -0
- package/models/operations/v3globaldataassetcertificatelistpost.d.ts.map +1 -0
- package/models/operations/v3globaldataassetcertificatelistpost.js +157 -0
- package/models/operations/v3globaldataassetcertificatelistpost.js.map +1 -0
- package/models/operations/v3globaldataassetcertificatelistrawpost.d.ts +91 -0
- package/models/operations/v3globaldataassetcertificatelistrawpost.d.ts.map +1 -0
- package/models/operations/v3globaldataassetcertificatelistrawpost.js +157 -0
- package/models/operations/v3globaldataassetcertificatelistrawpost.js.map +1 -0
- package/models/operations/v3globaldataassetcertificateraw.d.ts +93 -0
- package/models/operations/v3globaldataassetcertificateraw.d.ts.map +1 -0
- package/models/operations/v3globaldataassetcertificateraw.js +156 -0
- package/models/operations/v3globaldataassetcertificateraw.js.map +1 -0
- package/models/operations/v3globaldataassethostlistpost.d.ts +91 -0
- package/models/operations/v3globaldataassethostlistpost.d.ts.map +1 -0
- package/models/operations/v3globaldataassethostlistpost.js +157 -0
- package/models/operations/v3globaldataassethostlistpost.js.map +1 -0
- package/models/operations/v3globaldataassethosttimeline.d.ts +2 -2
- package/models/operations/v3globaldataassetwebpropertylistpost.d.ts +91 -0
- package/models/operations/v3globaldataassetwebpropertylistpost.d.ts.map +1 -0
- package/models/operations/v3globaldataassetwebpropertylistpost.js +157 -0
- package/models/operations/v3globaldataassetwebpropertylistpost.js.map +1 -0
- package/models/operations/v3globaldatasearchconvert.d.ts +91 -0
- package/models/operations/v3globaldatasearchconvert.d.ts.map +1 -0
- package/models/operations/v3globaldatasearchconvert.js +157 -0
- package/models/operations/v3globaldatasearchconvert.js.map +1 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts +124 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.d.ts.map +1 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.js +183 -0
- package/models/operations/v3threathuntinggethostobservationswithcertificate.js.map +1 -0
- package/package.json +3 -3
- package/sdk/globaldata.d.ts +24 -19
- package/sdk/globaldata.d.ts.map +1 -1
- package/sdk/globaldata.js +29 -21
- package/sdk/globaldata.js.map +1 -1
- package/sdk/threathunting.d.ts +7 -9
- package/sdk/threathunting.d.ts.map +1 -1
- package/sdk/threathunting.js +11 -13
- package/sdk/threathunting.js.map +1 -1
- package/src/funcs/globalDataConvertLegacySearchQueries.ts +188 -0
- package/src/funcs/globalDataCreateTrackedScan.ts +2 -2
- package/src/funcs/{globalDataGetHostObservationsWithCertificate.ts → globalDataGetCertificateRaw.ts} +19 -26
- package/src/funcs/globalDataGetCertificates.ts +15 -14
- package/src/funcs/globalDataGetCertificatesRaw.ts +187 -0
- package/src/funcs/globalDataGetHostTimeline.ts +1 -1
- package/src/funcs/globalDataGetHosts.ts +24 -16
- package/src/funcs/globalDataGetTrackedScan.ts +2 -3
- package/src/funcs/globalDataGetWebProperties.ts +15 -14
- package/src/funcs/threatHuntingCreateTrackedScan.ts +2 -2
- package/src/funcs/threatHuntingGetHostObservationsWithCertificate.ts +201 -0
- package/src/funcs/{globalDataGetTrackedScanThreatHunting.ts → threatHuntingGetTrackedScanThreatHunting.ts} +3 -4
- package/src/lib/config.ts +4 -4
- package/src/lib/security.ts +4 -1
- package/src/models/components/alternativequery.ts +104 -0
- package/src/models/components/assetcertificatelistinputbody.ts +80 -0
- package/src/models/components/assethostlistinputbody.ts +78 -0
- package/src/models/components/assetwebpropertylistinputbody.ts +80 -0
- package/src/models/components/asteriskmanagerinterface.ts +66 -0
- package/src/models/components/convertqueryerror.ts +69 -0
- package/src/models/components/index.ts +12 -0
- package/src/models/components/openvpnmgmt.ts +93 -0
- package/src/models/components/rawcertificateresponse.ts +79 -0
- package/src/models/components/rdp.ts +6 -0
- package/src/models/components/responseenvelopelistrawcertificateresponse.ts +84 -0
- package/src/models/components/responseenvelopelistsearchconvertqueryresponse.ts +88 -0
- package/src/models/components/screenshot.ts +4 -0
- package/src/models/components/searchconvertqueryinputbody.ts +71 -0
- package/src/models/components/searchconvertqueryresponse.ts +166 -0
- package/src/models/components/service.ts +25 -0
- package/src/models/components/servicescan.ts +24 -0
- package/src/models/operations/index.ts +7 -4
- package/src/models/operations/v3globaldataassetcertificatelistpost.ts +265 -0
- package/src/models/operations/v3globaldataassetcertificatelistrawpost.ts +269 -0
- package/src/models/operations/v3globaldataassetcertificateraw.ts +248 -0
- package/src/models/operations/v3globaldataassethostlistpost.ts +238 -0
- package/src/models/operations/v3globaldataassethosttimeline.ts +2 -2
- package/src/models/operations/v3globaldataassetwebpropertylistpost.ts +265 -0
- package/src/models/operations/v3globaldatasearchconvert.ts +234 -0
- package/src/models/operations/v3threathuntinggethostobservationswithcertificate.ts +315 -0
- package/src/sdk/globaldata.ts +49 -35
- package/src/sdk/threathunting.ts +16 -15
- package/tests/sdk.test.ts +2 -2
- package/funcs/globalDataGetHostObservationsWithCertificate.d.ts +0 -18
- package/funcs/globalDataGetHostObservationsWithCertificate.d.ts.map +0 -1
- package/funcs/globalDataGetHostObservationsWithCertificate.js.map +0 -1
- package/funcs/globalDataGetTrackedScanThreatHunting.d.ts.map +0 -1
- package/funcs/globalDataGetTrackedScanThreatHunting.js.map +0 -1
- package/models/operations/v3globaldataassetcertificatelist.d.ts +0 -94
- package/models/operations/v3globaldataassetcertificatelist.d.ts.map +0 -1
- package/models/operations/v3globaldataassetcertificatelist.js +0 -157
- package/models/operations/v3globaldataassetcertificatelist.js.map +0 -1
- package/models/operations/v3globaldataassethostlist.d.ts +0 -94
- package/models/operations/v3globaldataassethostlist.d.ts.map +0 -1
- package/models/operations/v3globaldataassethostlist.js +0 -157
- package/models/operations/v3globaldataassethostlist.js.map +0 -1
- package/models/operations/v3globaldataassetwebpropertylist.d.ts +0 -94
- package/models/operations/v3globaldataassetwebpropertylist.d.ts.map +0 -1
- package/models/operations/v3globaldataassetwebpropertylist.js +0 -157
- package/models/operations/v3globaldataassetwebpropertylist.js.map +0 -1
- package/models/operations/v3globaldatagethostobservationswithcertificate.d.ts +0 -124
- package/models/operations/v3globaldatagethostobservationswithcertificate.d.ts.map +0 -1
- package/models/operations/v3globaldatagethostobservationswithcertificate.js +0 -178
- package/models/operations/v3globaldatagethostobservationswithcertificate.js.map +0 -1
- package/src/models/operations/v3globaldataassetcertificatelist.ts +0 -259
- package/src/models/operations/v3globaldataassethostlist.ts +0 -233
- package/src/models/operations/v3globaldataassetwebpropertylist.ts +0 -259
- package/src/models/operations/v3globaldatagethostobservationswithcertificate.ts +0 -317
|
@@ -8,18 +8,19 @@ Endpoints related to the Global Data product
|
|
|
8
8
|
### Available Operations
|
|
9
9
|
|
|
10
10
|
* [getCertificates](#getcertificates) - Get multiple certificates
|
|
11
|
+
* [getCertificatesRaw](#getcertificatesraw) - Get multiple certificates in PEM format
|
|
11
12
|
* [getCertificate](#getcertificate) - Get a certificate
|
|
12
|
-
* [
|
|
13
|
+
* [getCertificateRaw](#getcertificateraw) - Get a certificate in PEM format
|
|
13
14
|
* [getHosts](#gethosts) - Get multiple hosts
|
|
14
15
|
* [getHost](#gethost) - Get a host
|
|
15
16
|
* [getHostTimeline](#gethosttimeline) - Get host event history
|
|
16
17
|
* [getWebProperties](#getwebproperties) - Get multiple web properties
|
|
17
18
|
* [getWebProperty](#getwebproperty) - Get a web property
|
|
18
|
-
* [createTrackedScan](#createtrackedscan) -
|
|
19
|
-
* [getTrackedScan](#gettrackedscan) - Get
|
|
19
|
+
* [createTrackedScan](#createtrackedscan) - Live Rescan: Initiate a new rescan
|
|
20
|
+
* [getTrackedScan](#gettrackedscan) - Get scan status
|
|
20
21
|
* [aggregate](#aggregate) - Aggregate results for a search query
|
|
22
|
+
* [convertLegacySearchQueries](#convertlegacysearchqueries) - Convert Legacy Search queries to Platform queries
|
|
21
23
|
* [search](#search) - Run a search query
|
|
22
|
-
* [getTrackedScanThreatHunting](#gettrackedscanthreathunting) - Get tracked scan details
|
|
23
24
|
|
|
24
25
|
## getCertificates
|
|
25
26
|
|
|
@@ -27,7 +28,7 @@ Retrieve information about multiple certificates. A certificate ID is its SHA-25
|
|
|
27
28
|
|
|
28
29
|
### Example Usage
|
|
29
30
|
|
|
30
|
-
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-certificate-list" method="
|
|
31
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-certificate-list-post" method="post" path="/v3/global/asset/certificate" -->
|
|
31
32
|
```typescript
|
|
32
33
|
import { SDK } from "@censys/platform-sdk";
|
|
33
34
|
|
|
@@ -38,9 +39,11 @@ const sdk = new SDK({
|
|
|
38
39
|
|
|
39
40
|
async function run() {
|
|
40
41
|
const result = await sdk.globalData.getCertificates({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
assetCertificateListInputBody: {
|
|
43
|
+
certificateIds: [
|
|
44
|
+
"3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
44
47
|
});
|
|
45
48
|
|
|
46
49
|
console.log(result);
|
|
@@ -66,9 +69,11 @@ const sdk = new SDKCore({
|
|
|
66
69
|
|
|
67
70
|
async function run() {
|
|
68
71
|
const res = await globalDataGetCertificates(sdk, {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
assetCertificateListInputBody: {
|
|
73
|
+
certificateIds: [
|
|
74
|
+
"3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
72
77
|
});
|
|
73
78
|
if (res.ok) {
|
|
74
79
|
const { value: result } = res;
|
|
@@ -85,14 +90,14 @@ run();
|
|
|
85
90
|
|
|
86
91
|
| Parameter | Type | Required | Description |
|
|
87
92
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
88
|
-
| `request` | [operations.
|
|
93
|
+
| `request` | [operations.V3GlobaldataAssetCertificateListPostRequest](../../models/operations/v3globaldataassetcertificatelistpostrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
89
94
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
90
95
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
91
96
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
92
97
|
|
|
93
98
|
### Response
|
|
94
99
|
|
|
95
|
-
**Promise\<[operations.
|
|
100
|
+
**Promise\<[operations.V3GlobaldataAssetCertificateListPostResponse](../../models/operations/v3globaldataassetcertificatelistpostresponse.md)\>**
|
|
96
101
|
|
|
97
102
|
### Errors
|
|
98
103
|
|
|
@@ -101,6 +106,90 @@ run();
|
|
|
101
106
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
102
107
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
103
108
|
|
|
109
|
+
## getCertificatesRaw
|
|
110
|
+
|
|
111
|
+
Retrieve the raw PEM-encoded format for multiple certificates. A certificate ID is its SHA-256 fingerprint in the Censys dataset.
|
|
112
|
+
|
|
113
|
+
### Example Usage
|
|
114
|
+
|
|
115
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-certificate-list-raw-post" method="post" path="/v3/global/asset/certificate/raw" -->
|
|
116
|
+
```typescript
|
|
117
|
+
import { SDK } from "@censys/platform-sdk";
|
|
118
|
+
|
|
119
|
+
const sdk = new SDK({
|
|
120
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
121
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
async function run() {
|
|
125
|
+
const result = await sdk.globalData.getCertificatesRaw({
|
|
126
|
+
assetCertificateListInputBody: {
|
|
127
|
+
certificateIds: [
|
|
128
|
+
"3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
console.log(result);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
run();
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Standalone function
|
|
140
|
+
|
|
141
|
+
The standalone function version of this method:
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
145
|
+
import { globalDataGetCertificatesRaw } from "@censys/platform-sdk/funcs/globalDataGetCertificatesRaw.js";
|
|
146
|
+
|
|
147
|
+
// Use `SDKCore` for best tree-shaking performance.
|
|
148
|
+
// You can create one instance of it to use across an application.
|
|
149
|
+
const sdk = new SDKCore({
|
|
150
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
151
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
async function run() {
|
|
155
|
+
const res = await globalDataGetCertificatesRaw(sdk, {
|
|
156
|
+
assetCertificateListInputBody: {
|
|
157
|
+
certificateIds: [
|
|
158
|
+
"3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
if (res.ok) {
|
|
163
|
+
const { value: result } = res;
|
|
164
|
+
console.log(result);
|
|
165
|
+
} else {
|
|
166
|
+
console.log("globalDataGetCertificatesRaw failed:", res.error);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
run();
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Parameters
|
|
174
|
+
|
|
175
|
+
| Parameter | Type | Required | Description |
|
|
176
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
177
|
+
| `request` | [operations.V3GlobaldataAssetCertificateListRawPostRequest](../../models/operations/v3globaldataassetcertificatelistrawpostrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
178
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
179
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
180
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
181
|
+
|
|
182
|
+
### Response
|
|
183
|
+
|
|
184
|
+
**Promise\<[operations.V3GlobaldataAssetCertificateListRawPostResponse](../../models/operations/v3globaldataassetcertificatelistrawpostresponse.md)\>**
|
|
185
|
+
|
|
186
|
+
### Errors
|
|
187
|
+
|
|
188
|
+
| Error Type | Status Code | Content Type |
|
|
189
|
+
| ------------------------ | ------------------------ | ------------------------ |
|
|
190
|
+
| errors.ErrorModel | 401, 404 | application/problem+json |
|
|
191
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
192
|
+
|
|
104
193
|
## getCertificate
|
|
105
194
|
|
|
106
195
|
Retrieve information about a single certificate. A certificate ID is its SHA-256 fingerprint in the Censys dataset.
|
|
@@ -177,13 +266,13 @@ run();
|
|
|
177
266
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
178
267
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
179
268
|
|
|
180
|
-
##
|
|
269
|
+
## getCertificateRaw
|
|
181
270
|
|
|
182
|
-
Retrieve
|
|
271
|
+
Retrieve the raw PEM-encoded format of a certificate. A certificate ID is its SHA-256 fingerprint in the Censys dataset.
|
|
183
272
|
|
|
184
273
|
### Example Usage
|
|
185
274
|
|
|
186
|
-
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-
|
|
275
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-certificate-raw" method="get" path="/v3/global/asset/certificate/{certificate_id}/raw" -->
|
|
187
276
|
```typescript
|
|
188
277
|
import { SDK } from "@censys/platform-sdk";
|
|
189
278
|
|
|
@@ -193,13 +282,8 @@ const sdk = new SDK({
|
|
|
193
282
|
});
|
|
194
283
|
|
|
195
284
|
async function run() {
|
|
196
|
-
const result = await sdk.globalData.
|
|
197
|
-
certificateId: "
|
|
198
|
-
startTime: "2023-01-01T00:00:00Z",
|
|
199
|
-
endTime: "2023-12-31T23:59:59Z",
|
|
200
|
-
port: 443,
|
|
201
|
-
protocol: "TCP",
|
|
202
|
-
pageSize: 50,
|
|
285
|
+
const result = await sdk.globalData.getCertificateRaw({
|
|
286
|
+
certificateId: "3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
203
287
|
});
|
|
204
288
|
|
|
205
289
|
console.log(result);
|
|
@@ -214,7 +298,7 @@ The standalone function version of this method:
|
|
|
214
298
|
|
|
215
299
|
```typescript
|
|
216
300
|
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
217
|
-
import {
|
|
301
|
+
import { globalDataGetCertificateRaw } from "@censys/platform-sdk/funcs/globalDataGetCertificateRaw.js";
|
|
218
302
|
|
|
219
303
|
// Use `SDKCore` for best tree-shaking performance.
|
|
220
304
|
// You can create one instance of it to use across an application.
|
|
@@ -224,19 +308,14 @@ const sdk = new SDKCore({
|
|
|
224
308
|
});
|
|
225
309
|
|
|
226
310
|
async function run() {
|
|
227
|
-
const res = await
|
|
228
|
-
certificateId: "
|
|
229
|
-
startTime: "2023-01-01T00:00:00Z",
|
|
230
|
-
endTime: "2023-12-31T23:59:59Z",
|
|
231
|
-
port: 443,
|
|
232
|
-
protocol: "TCP",
|
|
233
|
-
pageSize: 50,
|
|
311
|
+
const res = await globalDataGetCertificateRaw(sdk, {
|
|
312
|
+
certificateId: "3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
234
313
|
});
|
|
235
314
|
if (res.ok) {
|
|
236
315
|
const { value: result } = res;
|
|
237
316
|
console.log(result);
|
|
238
317
|
} else {
|
|
239
|
-
console.log("
|
|
318
|
+
console.log("globalDataGetCertificateRaw failed:", res.error);
|
|
240
319
|
}
|
|
241
320
|
}
|
|
242
321
|
|
|
@@ -247,14 +326,14 @@ run();
|
|
|
247
326
|
|
|
248
327
|
| Parameter | Type | Required | Description |
|
|
249
328
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
250
|
-
| `request` | [operations.
|
|
329
|
+
| `request` | [operations.V3GlobaldataAssetCertificateRawRequest](../../models/operations/v3globaldataassetcertificaterawrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
251
330
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
252
331
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
253
332
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
254
333
|
|
|
255
334
|
### Response
|
|
256
335
|
|
|
257
|
-
**Promise\<[operations.
|
|
336
|
+
**Promise\<[operations.V3GlobaldataAssetCertificateRawResponse](../../models/operations/v3globaldataassetcertificaterawresponse.md)\>**
|
|
258
337
|
|
|
259
338
|
### Errors
|
|
260
339
|
|
|
@@ -269,7 +348,7 @@ Retrieve information about multiple hosts. A host ID is its IP address.
|
|
|
269
348
|
|
|
270
349
|
### Example Usage
|
|
271
350
|
|
|
272
|
-
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-host-list" method="
|
|
351
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-host-list-post" method="post" path="/v3/global/asset/host" -->
|
|
273
352
|
```typescript
|
|
274
353
|
import { SDK } from "@censys/platform-sdk";
|
|
275
354
|
|
|
@@ -280,9 +359,11 @@ const sdk = new SDK({
|
|
|
280
359
|
|
|
281
360
|
async function run() {
|
|
282
361
|
const result = await sdk.globalData.getHosts({
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
362
|
+
assetHostListInputBody: {
|
|
363
|
+
hostIds: [
|
|
364
|
+
"8.8.8.8",
|
|
365
|
+
],
|
|
366
|
+
},
|
|
286
367
|
});
|
|
287
368
|
|
|
288
369
|
console.log(result);
|
|
@@ -308,9 +389,11 @@ const sdk = new SDKCore({
|
|
|
308
389
|
|
|
309
390
|
async function run() {
|
|
310
391
|
const res = await globalDataGetHosts(sdk, {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
392
|
+
assetHostListInputBody: {
|
|
393
|
+
hostIds: [
|
|
394
|
+
"8.8.8.8",
|
|
395
|
+
],
|
|
396
|
+
},
|
|
314
397
|
});
|
|
315
398
|
if (res.ok) {
|
|
316
399
|
const { value: result } = res;
|
|
@@ -327,14 +410,14 @@ run();
|
|
|
327
410
|
|
|
328
411
|
| Parameter | Type | Required | Description |
|
|
329
412
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
330
|
-
| `request` | [operations.
|
|
413
|
+
| `request` | [operations.V3GlobaldataAssetHostListPostRequest](../../models/operations/v3globaldataassethostlistpostrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
331
414
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
332
415
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
333
416
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
334
417
|
|
|
335
418
|
### Response
|
|
336
419
|
|
|
337
|
-
**Promise\<[operations.
|
|
420
|
+
**Promise\<[operations.V3GlobaldataAssetHostListPostResponse](../../models/operations/v3globaldataassethostlistpostresponse.md)\>**
|
|
338
421
|
|
|
339
422
|
### Errors
|
|
340
423
|
|
|
@@ -423,7 +506,7 @@ run();
|
|
|
423
506
|
|
|
424
507
|
## getHostTimeline
|
|
425
508
|
|
|
426
|
-
Retrieve event history for a host. A host ID is its IP address.
|
|
509
|
+
Retrieve event history for a host. A host ID is its IP address.<br><br>Note that when a service protocol changes after a new scan (for example, from `UNKNOWN` to `NETBIOS`), this information will only be reflected in the `scan` object. It will not be shown in the `service_scanned diff` object.
|
|
427
510
|
|
|
428
511
|
### Example Usage
|
|
429
512
|
|
|
@@ -439,8 +522,8 @@ const sdk = new SDK({
|
|
|
439
522
|
async function run() {
|
|
440
523
|
const result = await sdk.globalData.getHostTimeline({
|
|
441
524
|
hostId: "8.8.8.8",
|
|
442
|
-
startTime: new Date("2025-01-
|
|
443
|
-
endTime: new Date("2025-01-
|
|
525
|
+
startTime: new Date("2025-01-02T00:00:00Z"),
|
|
526
|
+
endTime: new Date("2025-01-01T00:00:00Z"),
|
|
444
527
|
});
|
|
445
528
|
|
|
446
529
|
console.log(result);
|
|
@@ -467,8 +550,8 @@ const sdk = new SDKCore({
|
|
|
467
550
|
async function run() {
|
|
468
551
|
const res = await globalDataGetHostTimeline(sdk, {
|
|
469
552
|
hostId: "8.8.8.8",
|
|
470
|
-
startTime: new Date("2025-01-
|
|
471
|
-
endTime: new Date("2025-01-
|
|
553
|
+
startTime: new Date("2025-01-02T00:00:00Z"),
|
|
554
|
+
endTime: new Date("2025-01-01T00:00:00Z"),
|
|
472
555
|
});
|
|
473
556
|
if (res.ok) {
|
|
474
557
|
const { value: result } = res;
|
|
@@ -507,7 +590,7 @@ Retrieve information about multiple web properties. Web properties are identifie
|
|
|
507
590
|
|
|
508
591
|
### Example Usage
|
|
509
592
|
|
|
510
|
-
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-webproperty-list" method="
|
|
593
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-webproperty-list-post" method="post" path="/v3/global/asset/webproperty" -->
|
|
511
594
|
```typescript
|
|
512
595
|
import { SDK } from "@censys/platform-sdk";
|
|
513
596
|
|
|
@@ -518,9 +601,11 @@ const sdk = new SDK({
|
|
|
518
601
|
|
|
519
602
|
async function run() {
|
|
520
603
|
const result = await sdk.globalData.getWebProperties({
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
604
|
+
assetWebpropertyListInputBody: {
|
|
605
|
+
webpropertyIds: [
|
|
606
|
+
"platform.censys.io:80",
|
|
607
|
+
],
|
|
608
|
+
},
|
|
524
609
|
});
|
|
525
610
|
|
|
526
611
|
console.log(result);
|
|
@@ -546,9 +631,11 @@ const sdk = new SDKCore({
|
|
|
546
631
|
|
|
547
632
|
async function run() {
|
|
548
633
|
const res = await globalDataGetWebProperties(sdk, {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
634
|
+
assetWebpropertyListInputBody: {
|
|
635
|
+
webpropertyIds: [
|
|
636
|
+
"platform.censys.io:80",
|
|
637
|
+
],
|
|
638
|
+
},
|
|
552
639
|
});
|
|
553
640
|
if (res.ok) {
|
|
554
641
|
const { value: result } = res;
|
|
@@ -565,14 +652,14 @@ run();
|
|
|
565
652
|
|
|
566
653
|
| Parameter | Type | Required | Description |
|
|
567
654
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
568
|
-
| `request` | [operations.
|
|
655
|
+
| `request` | [operations.V3GlobaldataAssetWebpropertyListPostRequest](../../models/operations/v3globaldataassetwebpropertylistpostrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
569
656
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
570
657
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
571
658
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
572
659
|
|
|
573
660
|
### Response
|
|
574
661
|
|
|
575
|
-
**Promise\<[operations.
|
|
662
|
+
**Promise\<[operations.V3GlobaldataAssetWebpropertyListPostResponse](../../models/operations/v3globaldataassetwebpropertylistpostresponse.md)\>**
|
|
576
663
|
|
|
577
664
|
### Errors
|
|
578
665
|
|
|
@@ -661,7 +748,7 @@ run();
|
|
|
661
748
|
|
|
662
749
|
## createTrackedScan
|
|
663
750
|
|
|
664
|
-
|
|
751
|
+
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.<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-globaldata-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 all Enterprise customers. It costs 10 credits to execute.
|
|
665
752
|
|
|
666
753
|
### Example Usage
|
|
667
754
|
|
|
@@ -751,8 +838,7 @@ run();
|
|
|
751
838
|
|
|
752
839
|
## getTrackedScan
|
|
753
840
|
|
|
754
|
-
Retrieve the current status
|
|
755
|
-
This endpoint works for both discovery scans and rescans.
|
|
841
|
+
Retrieve the current status of a scan by its ID. This endpoint works for both [Live Discovery scans](https://docs.censys.com/reference/v3-threathunting-scans-discovery#/) and [Live Rescans](https://docs.censys.com/reference/v3-globaldata-scans-rescan#/).<br><br>If the scan was successful, perform a lookup on the target asset to retrieve detailed scan information.<br><br>This endpoint is available to all Enterprise customers. This endpoint does not cost any credits to execute.
|
|
756
842
|
|
|
757
843
|
### Example Usage
|
|
758
844
|
|
|
@@ -910,13 +996,13 @@ run();
|
|
|
910
996
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
911
997
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
912
998
|
|
|
913
|
-
##
|
|
999
|
+
## convertLegacySearchQueries
|
|
914
1000
|
|
|
915
|
-
|
|
1001
|
+
Convert Censys Search Language queries used in Legacy Search into Censys Query Language (CenQL) queries for use in the Platform.<br><br>Reference the [documentation on CenQL](https://docs.censys.com/docs/censys-query-language) for more information about query syntax.
|
|
916
1002
|
|
|
917
1003
|
### Example Usage
|
|
918
1004
|
|
|
919
|
-
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-
|
|
1005
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-convert" method="post" path="/v3/global/search/convert" -->
|
|
920
1006
|
```typescript
|
|
921
1007
|
import { SDK } from "@censys/platform-sdk";
|
|
922
1008
|
|
|
@@ -926,13 +1012,13 @@ const sdk = new SDK({
|
|
|
926
1012
|
});
|
|
927
1013
|
|
|
928
1014
|
async function run() {
|
|
929
|
-
const result = await sdk.globalData.
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
"
|
|
1015
|
+
const result = await sdk.globalData.convertLegacySearchQueries({
|
|
1016
|
+
searchConvertQueryInputBody: {
|
|
1017
|
+
queries: [
|
|
1018
|
+
"<value 1>",
|
|
1019
|
+
"<value 2>",
|
|
1020
|
+
"<value 3>",
|
|
933
1021
|
],
|
|
934
|
-
pageSize: 1,
|
|
935
|
-
query: "host.services: (protocol=SSH and not port: 22)",
|
|
936
1022
|
},
|
|
937
1023
|
});
|
|
938
1024
|
|
|
@@ -948,7 +1034,7 @@ The standalone function version of this method:
|
|
|
948
1034
|
|
|
949
1035
|
```typescript
|
|
950
1036
|
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
951
|
-
import {
|
|
1037
|
+
import { globalDataConvertLegacySearchQueries } from "@censys/platform-sdk/funcs/globalDataConvertLegacySearchQueries.js";
|
|
952
1038
|
|
|
953
1039
|
// Use `SDKCore` for best tree-shaking performance.
|
|
954
1040
|
// You can create one instance of it to use across an application.
|
|
@@ -958,20 +1044,20 @@ const sdk = new SDKCore({
|
|
|
958
1044
|
});
|
|
959
1045
|
|
|
960
1046
|
async function run() {
|
|
961
|
-
const res = await
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
"
|
|
1047
|
+
const res = await globalDataConvertLegacySearchQueries(sdk, {
|
|
1048
|
+
searchConvertQueryInputBody: {
|
|
1049
|
+
queries: [
|
|
1050
|
+
"<value 1>",
|
|
1051
|
+
"<value 2>",
|
|
1052
|
+
"<value 3>",
|
|
965
1053
|
],
|
|
966
|
-
pageSize: 1,
|
|
967
|
-
query: "host.services: (protocol=SSH and not port: 22)",
|
|
968
1054
|
},
|
|
969
1055
|
});
|
|
970
1056
|
if (res.ok) {
|
|
971
1057
|
const { value: result } = res;
|
|
972
1058
|
console.log(result);
|
|
973
1059
|
} else {
|
|
974
|
-
console.log("
|
|
1060
|
+
console.log("globalDataConvertLegacySearchQueries failed:", res.error);
|
|
975
1061
|
}
|
|
976
1062
|
}
|
|
977
1063
|
|
|
@@ -982,30 +1068,30 @@ run();
|
|
|
982
1068
|
|
|
983
1069
|
| Parameter | Type | Required | Description |
|
|
984
1070
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
985
|
-
| `request` | [operations.
|
|
1071
|
+
| `request` | [operations.V3GlobaldataSearchConvertRequest](../../models/operations/v3globaldatasearchconvertrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
986
1072
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
987
1073
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
988
1074
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
989
1075
|
|
|
990
1076
|
### Response
|
|
991
1077
|
|
|
992
|
-
**Promise\<[operations.
|
|
1078
|
+
**Promise\<[operations.V3GlobaldataSearchConvertResponse](../../models/operations/v3globaldatasearchconvertresponse.md)\>**
|
|
993
1079
|
|
|
994
1080
|
### Errors
|
|
995
1081
|
|
|
996
1082
|
| Error Type | Status Code | Content Type |
|
|
997
1083
|
| ------------------------ | ------------------------ | ------------------------ |
|
|
998
|
-
| errors.ErrorModel | 401
|
|
1084
|
+
| errors.ErrorModel | 401 | application/problem+json |
|
|
1085
|
+
| errors.ErrorModel | 500 | application/problem+json |
|
|
999
1086
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
1000
1087
|
|
|
1001
|
-
##
|
|
1088
|
+
## search
|
|
1002
1089
|
|
|
1003
|
-
|
|
1004
|
-
This endpoint works for both discovery scans and rescans.
|
|
1090
|
+
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.
|
|
1005
1091
|
|
|
1006
1092
|
### Example Usage
|
|
1007
1093
|
|
|
1008
|
-
<!-- UsageSnippet language="typescript" operationID="v3-
|
|
1094
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-query" method="post" path="/v3/global/search/query" -->
|
|
1009
1095
|
```typescript
|
|
1010
1096
|
import { SDK } from "@censys/platform-sdk";
|
|
1011
1097
|
|
|
@@ -1015,8 +1101,14 @@ const sdk = new SDK({
|
|
|
1015
1101
|
});
|
|
1016
1102
|
|
|
1017
1103
|
async function run() {
|
|
1018
|
-
const result = await sdk.globalData.
|
|
1019
|
-
|
|
1104
|
+
const result = await sdk.globalData.search({
|
|
1105
|
+
searchQueryInputBody: {
|
|
1106
|
+
fields: [
|
|
1107
|
+
"host.ip",
|
|
1108
|
+
],
|
|
1109
|
+
pageSize: 1,
|
|
1110
|
+
query: "host.services: (protocol=SSH and not port: 22)",
|
|
1111
|
+
},
|
|
1020
1112
|
});
|
|
1021
1113
|
|
|
1022
1114
|
console.log(result);
|
|
@@ -1031,7 +1123,7 @@ The standalone function version of this method:
|
|
|
1031
1123
|
|
|
1032
1124
|
```typescript
|
|
1033
1125
|
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
1034
|
-
import {
|
|
1126
|
+
import { globalDataSearch } from "@censys/platform-sdk/funcs/globalDataSearch.js";
|
|
1035
1127
|
|
|
1036
1128
|
// Use `SDKCore` for best tree-shaking performance.
|
|
1037
1129
|
// You can create one instance of it to use across an application.
|
|
@@ -1041,14 +1133,20 @@ const sdk = new SDKCore({
|
|
|
1041
1133
|
});
|
|
1042
1134
|
|
|
1043
1135
|
async function run() {
|
|
1044
|
-
const res = await
|
|
1045
|
-
|
|
1136
|
+
const res = await globalDataSearch(sdk, {
|
|
1137
|
+
searchQueryInputBody: {
|
|
1138
|
+
fields: [
|
|
1139
|
+
"host.ip",
|
|
1140
|
+
],
|
|
1141
|
+
pageSize: 1,
|
|
1142
|
+
query: "host.services: (protocol=SSH and not port: 22)",
|
|
1143
|
+
},
|
|
1046
1144
|
});
|
|
1047
1145
|
if (res.ok) {
|
|
1048
1146
|
const { value: result } = res;
|
|
1049
1147
|
console.log(result);
|
|
1050
1148
|
} else {
|
|
1051
|
-
console.log("
|
|
1149
|
+
console.log("globalDataSearch failed:", res.error);
|
|
1052
1150
|
}
|
|
1053
1151
|
}
|
|
1054
1152
|
|
|
@@ -1059,14 +1157,14 @@ run();
|
|
|
1059
1157
|
|
|
1060
1158
|
| Parameter | Type | Required | Description |
|
|
1061
1159
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1062
|
-
| `request` | [operations.
|
|
1160
|
+
| `request` | [operations.V3GlobaldataSearchQueryRequest](../../models/operations/v3globaldatasearchqueryrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
1063
1161
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
1064
1162
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
1065
1163
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
1066
1164
|
|
|
1067
1165
|
### Response
|
|
1068
1166
|
|
|
1069
|
-
**Promise\<[operations.
|
|
1167
|
+
**Promise\<[operations.V3GlobaldataSearchQueryResponse](../../models/operations/v3globaldatasearchqueryresponse.md)\>**
|
|
1070
1168
|
|
|
1071
1169
|
### Errors
|
|
1072
1170
|
|