@censys/platform-sdk 0.5.1 → 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 +255 -70
- package/docs/sdks/threathunting/README.md +9 -88
- 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/globalDataGetCertificateRaw.js +132 -0
- 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 +2 -2
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js +2 -2
- 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 +6 -3
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +6 -3
- 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/package.json +3 -3
- package/sdk/globaldata.d.ts +28 -16
- package/sdk/globaldata.d.ts.map +1 -1
- package/sdk/globaldata.js +34 -16
- package/sdk/globaldata.js.map +1 -1
- package/sdk/threathunting.d.ts +6 -15
- package/sdk/threathunting.d.ts.map +1 -1
- package/sdk/threathunting.js +8 -20
- package/sdk/threathunting.js.map +1 -1
- package/src/funcs/globalDataConvertLegacySearchQueries.ts +188 -0
- package/src/funcs/globalDataCreateTrackedScan.ts +2 -2
- package/src/funcs/globalDataGetCertificateRaw.ts +194 -0
- 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 +2 -2
- 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 +6 -3
- 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/sdk/globaldata.ts +60 -26
- package/src/sdk/threathunting.ts +8 -28
- package/tests/sdk.test.ts +2 -2
- 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/src/models/operations/v3globaldataassetcertificatelist.ts +0 -259
- package/src/models/operations/v3globaldataassethostlist.ts +0 -233
- package/src/models/operations/v3globaldataassetwebpropertylist.ts +0 -259
|
@@ -8,17 +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
|
|
13
|
+
* [getCertificateRaw](#getcertificateraw) - Get a certificate in PEM format
|
|
12
14
|
* [getHosts](#gethosts) - Get multiple hosts
|
|
13
15
|
* [getHost](#gethost) - Get a host
|
|
14
16
|
* [getHostTimeline](#gethosttimeline) - Get host event history
|
|
15
17
|
* [getWebProperties](#getwebproperties) - Get multiple web properties
|
|
16
18
|
* [getWebProperty](#getwebproperty) - Get a web property
|
|
17
|
-
* [createTrackedScan](#createtrackedscan) -
|
|
18
|
-
* [getTrackedScan](#gettrackedscan) - Get
|
|
19
|
+
* [createTrackedScan](#createtrackedscan) - Live Rescan: Initiate a new rescan
|
|
20
|
+
* [getTrackedScan](#gettrackedscan) - Get scan status
|
|
19
21
|
* [aggregate](#aggregate) - Aggregate results for a search query
|
|
22
|
+
* [convertLegacySearchQueries](#convertlegacysearchqueries) - Convert Legacy Search queries to Platform queries
|
|
20
23
|
* [search](#search) - Run a search query
|
|
21
|
-
* [getTrackedScanThreatHunting](#gettrackedscanthreathunting) - Get tracked scan details
|
|
22
24
|
|
|
23
25
|
## getCertificates
|
|
24
26
|
|
|
@@ -26,7 +28,7 @@ Retrieve information about multiple certificates. A certificate ID is its SHA-25
|
|
|
26
28
|
|
|
27
29
|
### Example Usage
|
|
28
30
|
|
|
29
|
-
<!-- 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" -->
|
|
30
32
|
```typescript
|
|
31
33
|
import { SDK } from "@censys/platform-sdk";
|
|
32
34
|
|
|
@@ -37,9 +39,11 @@ const sdk = new SDK({
|
|
|
37
39
|
|
|
38
40
|
async function run() {
|
|
39
41
|
const result = await sdk.globalData.getCertificates({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
assetCertificateListInputBody: {
|
|
43
|
+
certificateIds: [
|
|
44
|
+
"3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
43
47
|
});
|
|
44
48
|
|
|
45
49
|
console.log(result);
|
|
@@ -65,9 +69,11 @@ const sdk = new SDKCore({
|
|
|
65
69
|
|
|
66
70
|
async function run() {
|
|
67
71
|
const res = await globalDataGetCertificates(sdk, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
assetCertificateListInputBody: {
|
|
73
|
+
certificateIds: [
|
|
74
|
+
"3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
71
77
|
});
|
|
72
78
|
if (res.ok) {
|
|
73
79
|
const { value: result } = res;
|
|
@@ -84,14 +90,14 @@ run();
|
|
|
84
90
|
|
|
85
91
|
| Parameter | Type | Required | Description |
|
|
86
92
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
87
|
-
| `request` | [operations.
|
|
93
|
+
| `request` | [operations.V3GlobaldataAssetCertificateListPostRequest](../../models/operations/v3globaldataassetcertificatelistpostrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
88
94
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
89
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. |
|
|
90
96
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
91
97
|
|
|
92
98
|
### Response
|
|
93
99
|
|
|
94
|
-
**Promise\<[operations.
|
|
100
|
+
**Promise\<[operations.V3GlobaldataAssetCertificateListPostResponse](../../models/operations/v3globaldataassetcertificatelistpostresponse.md)\>**
|
|
95
101
|
|
|
96
102
|
### Errors
|
|
97
103
|
|
|
@@ -100,6 +106,90 @@ run();
|
|
|
100
106
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
101
107
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
102
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
|
+
|
|
103
193
|
## getCertificate
|
|
104
194
|
|
|
105
195
|
Retrieve information about a single certificate. A certificate ID is its SHA-256 fingerprint in the Censys dataset.
|
|
@@ -176,13 +266,89 @@ run();
|
|
|
176
266
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
177
267
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
178
268
|
|
|
269
|
+
## getCertificateRaw
|
|
270
|
+
|
|
271
|
+
Retrieve the raw PEM-encoded format of a certificate. A certificate ID is its SHA-256 fingerprint in the Censys dataset.
|
|
272
|
+
|
|
273
|
+
### Example Usage
|
|
274
|
+
|
|
275
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-asset-certificate-raw" method="get" path="/v3/global/asset/certificate/{certificate_id}/raw" -->
|
|
276
|
+
```typescript
|
|
277
|
+
import { SDK } from "@censys/platform-sdk";
|
|
278
|
+
|
|
279
|
+
const sdk = new SDK({
|
|
280
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
281
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
async function run() {
|
|
285
|
+
const result = await sdk.globalData.getCertificateRaw({
|
|
286
|
+
certificateId: "3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
console.log(result);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
run();
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Standalone function
|
|
296
|
+
|
|
297
|
+
The standalone function version of this method:
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
301
|
+
import { globalDataGetCertificateRaw } from "@censys/platform-sdk/funcs/globalDataGetCertificateRaw.js";
|
|
302
|
+
|
|
303
|
+
// Use `SDKCore` for best tree-shaking performance.
|
|
304
|
+
// You can create one instance of it to use across an application.
|
|
305
|
+
const sdk = new SDKCore({
|
|
306
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
307
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
async function run() {
|
|
311
|
+
const res = await globalDataGetCertificateRaw(sdk, {
|
|
312
|
+
certificateId: "3daf2843a77b6f4e6af43cd9b6f6746053b8c928e056e8a724808db8905a94cf",
|
|
313
|
+
});
|
|
314
|
+
if (res.ok) {
|
|
315
|
+
const { value: result } = res;
|
|
316
|
+
console.log(result);
|
|
317
|
+
} else {
|
|
318
|
+
console.log("globalDataGetCertificateRaw failed:", res.error);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
run();
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Parameters
|
|
326
|
+
|
|
327
|
+
| Parameter | Type | Required | Description |
|
|
328
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
329
|
+
| `request` | [operations.V3GlobaldataAssetCertificateRawRequest](../../models/operations/v3globaldataassetcertificaterawrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
330
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
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. |
|
|
332
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
333
|
+
|
|
334
|
+
### Response
|
|
335
|
+
|
|
336
|
+
**Promise\<[operations.V3GlobaldataAssetCertificateRawResponse](../../models/operations/v3globaldataassetcertificaterawresponse.md)\>**
|
|
337
|
+
|
|
338
|
+
### Errors
|
|
339
|
+
|
|
340
|
+
| Error Type | Status Code | Content Type |
|
|
341
|
+
| ------------------------ | ------------------------ | ------------------------ |
|
|
342
|
+
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
343
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
344
|
+
|
|
179
345
|
## getHosts
|
|
180
346
|
|
|
181
347
|
Retrieve information about multiple hosts. A host ID is its IP address.
|
|
182
348
|
|
|
183
349
|
### Example Usage
|
|
184
350
|
|
|
185
|
-
<!-- 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" -->
|
|
186
352
|
```typescript
|
|
187
353
|
import { SDK } from "@censys/platform-sdk";
|
|
188
354
|
|
|
@@ -193,9 +359,11 @@ const sdk = new SDK({
|
|
|
193
359
|
|
|
194
360
|
async function run() {
|
|
195
361
|
const result = await sdk.globalData.getHosts({
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
362
|
+
assetHostListInputBody: {
|
|
363
|
+
hostIds: [
|
|
364
|
+
"8.8.8.8",
|
|
365
|
+
],
|
|
366
|
+
},
|
|
199
367
|
});
|
|
200
368
|
|
|
201
369
|
console.log(result);
|
|
@@ -221,9 +389,11 @@ const sdk = new SDKCore({
|
|
|
221
389
|
|
|
222
390
|
async function run() {
|
|
223
391
|
const res = await globalDataGetHosts(sdk, {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
392
|
+
assetHostListInputBody: {
|
|
393
|
+
hostIds: [
|
|
394
|
+
"8.8.8.8",
|
|
395
|
+
],
|
|
396
|
+
},
|
|
227
397
|
});
|
|
228
398
|
if (res.ok) {
|
|
229
399
|
const { value: result } = res;
|
|
@@ -240,14 +410,14 @@ run();
|
|
|
240
410
|
|
|
241
411
|
| Parameter | Type | Required | Description |
|
|
242
412
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
243
|
-
| `request` | [operations.
|
|
413
|
+
| `request` | [operations.V3GlobaldataAssetHostListPostRequest](../../models/operations/v3globaldataassethostlistpostrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
244
414
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
245
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. |
|
|
246
416
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
247
417
|
|
|
248
418
|
### Response
|
|
249
419
|
|
|
250
|
-
**Promise\<[operations.
|
|
420
|
+
**Promise\<[operations.V3GlobaldataAssetHostListPostResponse](../../models/operations/v3globaldataassethostlistpostresponse.md)\>**
|
|
251
421
|
|
|
252
422
|
### Errors
|
|
253
423
|
|
|
@@ -336,7 +506,7 @@ run();
|
|
|
336
506
|
|
|
337
507
|
## getHostTimeline
|
|
338
508
|
|
|
339
|
-
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.
|
|
340
510
|
|
|
341
511
|
### Example Usage
|
|
342
512
|
|
|
@@ -352,8 +522,8 @@ const sdk = new SDK({
|
|
|
352
522
|
async function run() {
|
|
353
523
|
const result = await sdk.globalData.getHostTimeline({
|
|
354
524
|
hostId: "8.8.8.8",
|
|
355
|
-
startTime: new Date("2025-01-
|
|
356
|
-
endTime: new Date("2025-01-
|
|
525
|
+
startTime: new Date("2025-01-02T00:00:00Z"),
|
|
526
|
+
endTime: new Date("2025-01-01T00:00:00Z"),
|
|
357
527
|
});
|
|
358
528
|
|
|
359
529
|
console.log(result);
|
|
@@ -380,8 +550,8 @@ const sdk = new SDKCore({
|
|
|
380
550
|
async function run() {
|
|
381
551
|
const res = await globalDataGetHostTimeline(sdk, {
|
|
382
552
|
hostId: "8.8.8.8",
|
|
383
|
-
startTime: new Date("2025-01-
|
|
384
|
-
endTime: new Date("2025-01-
|
|
553
|
+
startTime: new Date("2025-01-02T00:00:00Z"),
|
|
554
|
+
endTime: new Date("2025-01-01T00:00:00Z"),
|
|
385
555
|
});
|
|
386
556
|
if (res.ok) {
|
|
387
557
|
const { value: result } = res;
|
|
@@ -420,7 +590,7 @@ Retrieve information about multiple web properties. Web properties are identifie
|
|
|
420
590
|
|
|
421
591
|
### Example Usage
|
|
422
592
|
|
|
423
|
-
<!-- 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" -->
|
|
424
594
|
```typescript
|
|
425
595
|
import { SDK } from "@censys/platform-sdk";
|
|
426
596
|
|
|
@@ -431,9 +601,11 @@ const sdk = new SDK({
|
|
|
431
601
|
|
|
432
602
|
async function run() {
|
|
433
603
|
const result = await sdk.globalData.getWebProperties({
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
604
|
+
assetWebpropertyListInputBody: {
|
|
605
|
+
webpropertyIds: [
|
|
606
|
+
"platform.censys.io:80",
|
|
607
|
+
],
|
|
608
|
+
},
|
|
437
609
|
});
|
|
438
610
|
|
|
439
611
|
console.log(result);
|
|
@@ -459,9 +631,11 @@ const sdk = new SDKCore({
|
|
|
459
631
|
|
|
460
632
|
async function run() {
|
|
461
633
|
const res = await globalDataGetWebProperties(sdk, {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
634
|
+
assetWebpropertyListInputBody: {
|
|
635
|
+
webpropertyIds: [
|
|
636
|
+
"platform.censys.io:80",
|
|
637
|
+
],
|
|
638
|
+
},
|
|
465
639
|
});
|
|
466
640
|
if (res.ok) {
|
|
467
641
|
const { value: result } = res;
|
|
@@ -478,14 +652,14 @@ run();
|
|
|
478
652
|
|
|
479
653
|
| Parameter | Type | Required | Description |
|
|
480
654
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
481
|
-
| `request` | [operations.
|
|
655
|
+
| `request` | [operations.V3GlobaldataAssetWebpropertyListPostRequest](../../models/operations/v3globaldataassetwebpropertylistpostrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
482
656
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
483
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. |
|
|
484
658
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
485
659
|
|
|
486
660
|
### Response
|
|
487
661
|
|
|
488
|
-
**Promise\<[operations.
|
|
662
|
+
**Promise\<[operations.V3GlobaldataAssetWebpropertyListPostResponse](../../models/operations/v3globaldataassetwebpropertylistpostresponse.md)\>**
|
|
489
663
|
|
|
490
664
|
### Errors
|
|
491
665
|
|
|
@@ -574,7 +748,7 @@ run();
|
|
|
574
748
|
|
|
575
749
|
## createTrackedScan
|
|
576
750
|
|
|
577
|
-
|
|
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.
|
|
578
752
|
|
|
579
753
|
### Example Usage
|
|
580
754
|
|
|
@@ -664,8 +838,7 @@ run();
|
|
|
664
838
|
|
|
665
839
|
## getTrackedScan
|
|
666
840
|
|
|
667
|
-
Retrieve the current status
|
|
668
|
-
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.
|
|
669
842
|
|
|
670
843
|
### Example Usage
|
|
671
844
|
|
|
@@ -823,13 +996,13 @@ run();
|
|
|
823
996
|
| errors.ErrorModel | 401, 403 | application/problem+json |
|
|
824
997
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
825
998
|
|
|
826
|
-
##
|
|
999
|
+
## convertLegacySearchQueries
|
|
827
1000
|
|
|
828
|
-
|
|
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.
|
|
829
1002
|
|
|
830
1003
|
### Example Usage
|
|
831
1004
|
|
|
832
|
-
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-
|
|
1005
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-convert" method="post" path="/v3/global/search/convert" -->
|
|
833
1006
|
```typescript
|
|
834
1007
|
import { SDK } from "@censys/platform-sdk";
|
|
835
1008
|
|
|
@@ -839,13 +1012,13 @@ const sdk = new SDK({
|
|
|
839
1012
|
});
|
|
840
1013
|
|
|
841
1014
|
async function run() {
|
|
842
|
-
const result = await sdk.globalData.
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
"
|
|
1015
|
+
const result = await sdk.globalData.convertLegacySearchQueries({
|
|
1016
|
+
searchConvertQueryInputBody: {
|
|
1017
|
+
queries: [
|
|
1018
|
+
"<value 1>",
|
|
1019
|
+
"<value 2>",
|
|
1020
|
+
"<value 3>",
|
|
846
1021
|
],
|
|
847
|
-
pageSize: 1,
|
|
848
|
-
query: "host.services: (protocol=SSH and not port: 22)",
|
|
849
1022
|
},
|
|
850
1023
|
});
|
|
851
1024
|
|
|
@@ -861,7 +1034,7 @@ The standalone function version of this method:
|
|
|
861
1034
|
|
|
862
1035
|
```typescript
|
|
863
1036
|
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
864
|
-
import {
|
|
1037
|
+
import { globalDataConvertLegacySearchQueries } from "@censys/platform-sdk/funcs/globalDataConvertLegacySearchQueries.js";
|
|
865
1038
|
|
|
866
1039
|
// Use `SDKCore` for best tree-shaking performance.
|
|
867
1040
|
// You can create one instance of it to use across an application.
|
|
@@ -871,20 +1044,20 @@ const sdk = new SDKCore({
|
|
|
871
1044
|
});
|
|
872
1045
|
|
|
873
1046
|
async function run() {
|
|
874
|
-
const res = await
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
"
|
|
1047
|
+
const res = await globalDataConvertLegacySearchQueries(sdk, {
|
|
1048
|
+
searchConvertQueryInputBody: {
|
|
1049
|
+
queries: [
|
|
1050
|
+
"<value 1>",
|
|
1051
|
+
"<value 2>",
|
|
1052
|
+
"<value 3>",
|
|
878
1053
|
],
|
|
879
|
-
pageSize: 1,
|
|
880
|
-
query: "host.services: (protocol=SSH and not port: 22)",
|
|
881
1054
|
},
|
|
882
1055
|
});
|
|
883
1056
|
if (res.ok) {
|
|
884
1057
|
const { value: result } = res;
|
|
885
1058
|
console.log(result);
|
|
886
1059
|
} else {
|
|
887
|
-
console.log("
|
|
1060
|
+
console.log("globalDataConvertLegacySearchQueries failed:", res.error);
|
|
888
1061
|
}
|
|
889
1062
|
}
|
|
890
1063
|
|
|
@@ -895,30 +1068,30 @@ run();
|
|
|
895
1068
|
|
|
896
1069
|
| Parameter | Type | Required | Description |
|
|
897
1070
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
898
|
-
| `request` | [operations.
|
|
1071
|
+
| `request` | [operations.V3GlobaldataSearchConvertRequest](../../models/operations/v3globaldatasearchconvertrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
899
1072
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
900
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. |
|
|
901
1074
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
902
1075
|
|
|
903
1076
|
### Response
|
|
904
1077
|
|
|
905
|
-
**Promise\<[operations.
|
|
1078
|
+
**Promise\<[operations.V3GlobaldataSearchConvertResponse](../../models/operations/v3globaldatasearchconvertresponse.md)\>**
|
|
906
1079
|
|
|
907
1080
|
### Errors
|
|
908
1081
|
|
|
909
1082
|
| Error Type | Status Code | Content Type |
|
|
910
1083
|
| ------------------------ | ------------------------ | ------------------------ |
|
|
911
|
-
| errors.ErrorModel | 401
|
|
1084
|
+
| errors.ErrorModel | 401 | application/problem+json |
|
|
1085
|
+
| errors.ErrorModel | 500 | application/problem+json |
|
|
912
1086
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
913
1087
|
|
|
914
|
-
##
|
|
1088
|
+
## search
|
|
915
1089
|
|
|
916
|
-
|
|
917
|
-
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.
|
|
918
1091
|
|
|
919
1092
|
### Example Usage
|
|
920
1093
|
|
|
921
|
-
<!-- UsageSnippet language="typescript" operationID="v3-
|
|
1094
|
+
<!-- UsageSnippet language="typescript" operationID="v3-globaldata-search-query" method="post" path="/v3/global/search/query" -->
|
|
922
1095
|
```typescript
|
|
923
1096
|
import { SDK } from "@censys/platform-sdk";
|
|
924
1097
|
|
|
@@ -928,8 +1101,14 @@ const sdk = new SDK({
|
|
|
928
1101
|
});
|
|
929
1102
|
|
|
930
1103
|
async function run() {
|
|
931
|
-
const result = await sdk.globalData.
|
|
932
|
-
|
|
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
|
+
},
|
|
933
1112
|
});
|
|
934
1113
|
|
|
935
1114
|
console.log(result);
|
|
@@ -944,7 +1123,7 @@ The standalone function version of this method:
|
|
|
944
1123
|
|
|
945
1124
|
```typescript
|
|
946
1125
|
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
947
|
-
import {
|
|
1126
|
+
import { globalDataSearch } from "@censys/platform-sdk/funcs/globalDataSearch.js";
|
|
948
1127
|
|
|
949
1128
|
// Use `SDKCore` for best tree-shaking performance.
|
|
950
1129
|
// You can create one instance of it to use across an application.
|
|
@@ -954,14 +1133,20 @@ const sdk = new SDKCore({
|
|
|
954
1133
|
});
|
|
955
1134
|
|
|
956
1135
|
async function run() {
|
|
957
|
-
const res = await
|
|
958
|
-
|
|
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
|
+
},
|
|
959
1144
|
});
|
|
960
1145
|
if (res.ok) {
|
|
961
1146
|
const { value: result } = res;
|
|
962
1147
|
console.log(result);
|
|
963
1148
|
} else {
|
|
964
|
-
console.log("
|
|
1149
|
+
console.log("globalDataSearch failed:", res.error);
|
|
965
1150
|
}
|
|
966
1151
|
}
|
|
967
1152
|
|
|
@@ -972,14 +1157,14 @@ run();
|
|
|
972
1157
|
|
|
973
1158
|
| Parameter | Type | Required | Description |
|
|
974
1159
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
975
|
-
| `request` | [operations.
|
|
1160
|
+
| `request` | [operations.V3GlobaldataSearchQueryRequest](../../models/operations/v3globaldatasearchqueryrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
976
1161
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
977
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. |
|
|
978
1163
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
979
1164
|
|
|
980
1165
|
### Response
|
|
981
1166
|
|
|
982
|
-
**Promise\<[operations.
|
|
1167
|
+
**Promise\<[operations.V3GlobaldataSearchQueryResponse](../../models/operations/v3globaldatasearchqueryresponse.md)\>**
|
|
983
1168
|
|
|
984
1169
|
### Errors
|
|
985
1170
|
|