@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -33,11 +33,11 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
*/
|
|
34
34
|
export function globalDataGetCertificates(
|
|
35
35
|
client: SDKCore,
|
|
36
|
-
request: operations.
|
|
36
|
+
request: operations.V3GlobaldataAssetCertificateListPostRequest,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
40
|
-
operations.
|
|
40
|
+
operations.V3GlobaldataAssetCertificateListPostResponse,
|
|
41
41
|
| errors.ErrorModel
|
|
42
42
|
| SDKBaseError
|
|
43
43
|
| ResponseValidationError
|
|
@@ -58,12 +58,12 @@ export function globalDataGetCertificates(
|
|
|
58
58
|
|
|
59
59
|
async function $do(
|
|
60
60
|
client: SDKCore,
|
|
61
|
-
request: operations.
|
|
61
|
+
request: operations.V3GlobaldataAssetCertificateListPostRequest,
|
|
62
62
|
options?: RequestOptions,
|
|
63
63
|
): Promise<
|
|
64
64
|
[
|
|
65
65
|
Result<
|
|
66
|
-
operations.
|
|
66
|
+
operations.V3GlobaldataAssetCertificateListPostResponse,
|
|
67
67
|
| errors.ErrorModel
|
|
68
68
|
| SDKBaseError
|
|
69
69
|
| ResponseValidationError
|
|
@@ -80,26 +80,27 @@ async function $do(
|
|
|
80
80
|
const parsed = safeParse(
|
|
81
81
|
request,
|
|
82
82
|
(value) =>
|
|
83
|
-
operations.
|
|
84
|
-
value,
|
|
85
|
-
),
|
|
83
|
+
operations.V3GlobaldataAssetCertificateListPostRequest$outboundSchema
|
|
84
|
+
.parse(value),
|
|
86
85
|
"Input validation failed",
|
|
87
86
|
);
|
|
88
87
|
if (!parsed.ok) {
|
|
89
88
|
return [parsed, { status: "invalid" }];
|
|
90
89
|
}
|
|
91
90
|
const payload = parsed.value;
|
|
92
|
-
const body =
|
|
91
|
+
const body = encodeJSON("body", payload.AssetCertificateListInputBody, {
|
|
92
|
+
explode: true,
|
|
93
|
+
});
|
|
93
94
|
|
|
94
95
|
const path = pathToFunc("/v3/global/asset/certificate")();
|
|
95
96
|
|
|
96
97
|
const query = encodeFormQuery({
|
|
97
|
-
"certificate_ids": payload.certificate_ids,
|
|
98
98
|
"organization_id": payload.organization_id
|
|
99
99
|
?? client._options.organizationId,
|
|
100
100
|
}, { explode: false });
|
|
101
101
|
|
|
102
102
|
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
103
104
|
Accept: "application/vnd.censys.api.v3.certificate.v1+json",
|
|
104
105
|
}));
|
|
105
106
|
|
|
@@ -112,7 +113,7 @@ async function $do(
|
|
|
112
113
|
const context = {
|
|
113
114
|
options: client._options,
|
|
114
115
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
-
operationID: "v3-globaldata-asset-certificate-list",
|
|
116
|
+
operationID: "v3-globaldata-asset-certificate-list-post",
|
|
116
117
|
oAuth2Scopes: [],
|
|
117
118
|
|
|
118
119
|
resolvedSecurity: requestSecurity,
|
|
@@ -126,7 +127,7 @@ async function $do(
|
|
|
126
127
|
|
|
127
128
|
const requestRes = client._createRequest(context, {
|
|
128
129
|
security: requestSecurity,
|
|
129
|
-
method: "
|
|
130
|
+
method: "POST",
|
|
130
131
|
baseURL: options?.serverURL,
|
|
131
132
|
path: path,
|
|
132
133
|
headers: headers,
|
|
@@ -156,7 +157,7 @@ async function $do(
|
|
|
156
157
|
};
|
|
157
158
|
|
|
158
159
|
const [result] = await M.match<
|
|
159
|
-
operations.
|
|
160
|
+
operations.V3GlobaldataAssetCertificateListPostResponse,
|
|
160
161
|
| errors.ErrorModel
|
|
161
162
|
| SDKBaseError
|
|
162
163
|
| ResponseValidationError
|
|
@@ -169,7 +170,7 @@ async function $do(
|
|
|
169
170
|
>(
|
|
170
171
|
M.json(
|
|
171
172
|
200,
|
|
172
|
-
operations.
|
|
173
|
+
operations.V3GlobaldataAssetCertificateListPostResponse$inboundSchema,
|
|
173
174
|
{
|
|
174
175
|
ctype: "application/vnd.censys.api.v3.certificate.v1+json",
|
|
175
176
|
hdrs: true,
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKBaseError } from "../models/errors/sdkbaseerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get multiple certificates in PEM format
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieve the raw PEM-encoded format for multiple certificates. A certificate ID is its SHA-256 fingerprint in the Censys dataset.
|
|
33
|
+
*/
|
|
34
|
+
export function globalDataGetCertificatesRaw(
|
|
35
|
+
client: SDKCore,
|
|
36
|
+
request: operations.V3GlobaldataAssetCertificateListRawPostRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.V3GlobaldataAssetCertificateListRawPostResponse,
|
|
41
|
+
| errors.ErrorModel
|
|
42
|
+
| SDKBaseError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: SDKCore,
|
|
61
|
+
request: operations.V3GlobaldataAssetCertificateListRawPostRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.V3GlobaldataAssetCertificateListRawPostResponse,
|
|
67
|
+
| errors.ErrorModel
|
|
68
|
+
| SDKBaseError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) =>
|
|
83
|
+
operations.V3GlobaldataAssetCertificateListRawPostRequest$outboundSchema
|
|
84
|
+
.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload.AssetCertificateListInputBody, {
|
|
92
|
+
explode: true,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/v3/global/asset/certificate/raw")();
|
|
96
|
+
|
|
97
|
+
const query = encodeFormQuery({
|
|
98
|
+
"organization_id": payload.organization_id
|
|
99
|
+
?? client._options.organizationId,
|
|
100
|
+
}, { explode: false });
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const secConfig = await extractSecurity(client._options.personalAccessToken);
|
|
108
|
+
const securityInput = secConfig == null
|
|
109
|
+
? {}
|
|
110
|
+
: { personalAccessToken: secConfig };
|
|
111
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
112
|
+
|
|
113
|
+
const context = {
|
|
114
|
+
options: client._options,
|
|
115
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
+
operationID: "v3-globaldata-asset-certificate-list-raw-post",
|
|
117
|
+
oAuth2Scopes: [],
|
|
118
|
+
|
|
119
|
+
resolvedSecurity: requestSecurity,
|
|
120
|
+
|
|
121
|
+
securitySource: client._options.personalAccessToken,
|
|
122
|
+
retryConfig: options?.retries
|
|
123
|
+
|| client._options.retryConfig
|
|
124
|
+
|| { strategy: "none" },
|
|
125
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const requestRes = client._createRequest(context, {
|
|
129
|
+
security: requestSecurity,
|
|
130
|
+
method: "POST",
|
|
131
|
+
baseURL: options?.serverURL,
|
|
132
|
+
path: path,
|
|
133
|
+
headers: headers,
|
|
134
|
+
query: query,
|
|
135
|
+
body: body,
|
|
136
|
+
userAgent: client._options.userAgent,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
errorCodes: ["401", "404", "4XX", "5XX"],
|
|
147
|
+
retryConfig: context.retryConfig,
|
|
148
|
+
retryCodes: context.retryCodes,
|
|
149
|
+
});
|
|
150
|
+
if (!doResult.ok) {
|
|
151
|
+
return [doResult, { status: "request-error", request: req }];
|
|
152
|
+
}
|
|
153
|
+
const response = doResult.value;
|
|
154
|
+
|
|
155
|
+
const responseFields = {
|
|
156
|
+
HttpMeta: { Response: response, Request: req },
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const [result] = await M.match<
|
|
160
|
+
operations.V3GlobaldataAssetCertificateListRawPostResponse,
|
|
161
|
+
| errors.ErrorModel
|
|
162
|
+
| SDKBaseError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.json(
|
|
172
|
+
200,
|
|
173
|
+
operations.V3GlobaldataAssetCertificateListRawPostResponse$inboundSchema,
|
|
174
|
+
{ hdrs: true, key: "Result" },
|
|
175
|
+
),
|
|
176
|
+
M.jsonErr([401, 404], errors.ErrorModel$inboundSchema, {
|
|
177
|
+
ctype: "application/problem+json",
|
|
178
|
+
}),
|
|
179
|
+
M.fail("4XX"),
|
|
180
|
+
M.fail("5XX"),
|
|
181
|
+
)(response, req, { extraFields: responseFields });
|
|
182
|
+
if (!result.ok) {
|
|
183
|
+
return [result, { status: "complete", request: req, response }];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return [result, { status: "complete", request: req, response }];
|
|
187
|
+
}
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Get host event history
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Retrieve event history for a host. A host ID is its IP address.
|
|
32
|
+
* 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.
|
|
33
33
|
*/
|
|
34
34
|
export function globalDataGetHostTimeline(
|
|
35
35
|
client: SDKCore,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -33,11 +33,11 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
*/
|
|
34
34
|
export function globalDataGetHosts(
|
|
35
35
|
client: SDKCore,
|
|
36
|
-
request: operations.
|
|
36
|
+
request: operations.V3GlobaldataAssetHostListPostRequest,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
40
|
-
operations.
|
|
40
|
+
operations.V3GlobaldataAssetHostListPostResponse,
|
|
41
41
|
| errors.ErrorModel
|
|
42
42
|
| SDKBaseError
|
|
43
43
|
| ResponseValidationError
|
|
@@ -58,12 +58,12 @@ export function globalDataGetHosts(
|
|
|
58
58
|
|
|
59
59
|
async function $do(
|
|
60
60
|
client: SDKCore,
|
|
61
|
-
request: operations.
|
|
61
|
+
request: operations.V3GlobaldataAssetHostListPostRequest,
|
|
62
62
|
options?: RequestOptions,
|
|
63
63
|
): Promise<
|
|
64
64
|
[
|
|
65
65
|
Result<
|
|
66
|
-
operations.
|
|
66
|
+
operations.V3GlobaldataAssetHostListPostResponse,
|
|
67
67
|
| errors.ErrorModel
|
|
68
68
|
| SDKBaseError
|
|
69
69
|
| ResponseValidationError
|
|
@@ -80,24 +80,28 @@ async function $do(
|
|
|
80
80
|
const parsed = safeParse(
|
|
81
81
|
request,
|
|
82
82
|
(value) =>
|
|
83
|
-
operations.
|
|
83
|
+
operations.V3GlobaldataAssetHostListPostRequest$outboundSchema.parse(
|
|
84
|
+
value,
|
|
85
|
+
),
|
|
84
86
|
"Input validation failed",
|
|
85
87
|
);
|
|
86
88
|
if (!parsed.ok) {
|
|
87
89
|
return [parsed, { status: "invalid" }];
|
|
88
90
|
}
|
|
89
91
|
const payload = parsed.value;
|
|
90
|
-
const body =
|
|
92
|
+
const body = encodeJSON("body", payload.AssetHostListInputBody, {
|
|
93
|
+
explode: true,
|
|
94
|
+
});
|
|
91
95
|
|
|
92
96
|
const path = pathToFunc("/v3/global/asset/host")();
|
|
93
97
|
|
|
94
98
|
const query = encodeFormQuery({
|
|
95
|
-
"host_ids": payload.host_ids,
|
|
96
99
|
"organization_id": payload.organization_id
|
|
97
100
|
?? client._options.organizationId,
|
|
98
101
|
}, { explode: false });
|
|
99
102
|
|
|
100
103
|
const headers = new Headers(compactMap({
|
|
104
|
+
"Content-Type": "application/json",
|
|
101
105
|
Accept: "application/vnd.censys.api.v3.host.v1+json",
|
|
102
106
|
}));
|
|
103
107
|
|
|
@@ -110,7 +114,7 @@ async function $do(
|
|
|
110
114
|
const context = {
|
|
111
115
|
options: client._options,
|
|
112
116
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
-
operationID: "v3-globaldata-asset-host-list",
|
|
117
|
+
operationID: "v3-globaldata-asset-host-list-post",
|
|
114
118
|
oAuth2Scopes: [],
|
|
115
119
|
|
|
116
120
|
resolvedSecurity: requestSecurity,
|
|
@@ -124,7 +128,7 @@ async function $do(
|
|
|
124
128
|
|
|
125
129
|
const requestRes = client._createRequest(context, {
|
|
126
130
|
security: requestSecurity,
|
|
127
|
-
method: "
|
|
131
|
+
method: "POST",
|
|
128
132
|
baseURL: options?.serverURL,
|
|
129
133
|
path: path,
|
|
130
134
|
headers: headers,
|
|
@@ -154,7 +158,7 @@ async function $do(
|
|
|
154
158
|
};
|
|
155
159
|
|
|
156
160
|
const [result] = await M.match<
|
|
157
|
-
operations.
|
|
161
|
+
operations.V3GlobaldataAssetHostListPostResponse,
|
|
158
162
|
| errors.ErrorModel
|
|
159
163
|
| SDKBaseError
|
|
160
164
|
| ResponseValidationError
|
|
@@ -165,11 +169,15 @@ async function $do(
|
|
|
165
169
|
| UnexpectedClientError
|
|
166
170
|
| SDKValidationError
|
|
167
171
|
>(
|
|
168
|
-
M.json(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
M.json(
|
|
173
|
+
200,
|
|
174
|
+
operations.V3GlobaldataAssetHostListPostResponse$inboundSchema,
|
|
175
|
+
{
|
|
176
|
+
ctype: "application/vnd.censys.api.v3.host.v1+json",
|
|
177
|
+
hdrs: true,
|
|
178
|
+
key: "Result",
|
|
179
|
+
},
|
|
180
|
+
),
|
|
173
181
|
M.jsonErr([401, 403], errors.ErrorModel$inboundSchema, {
|
|
174
182
|
ctype: "application/problem+json",
|
|
175
183
|
}),
|
|
@@ -26,11 +26,10 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Get
|
|
29
|
+
* Get scan status
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Retrieve the current status
|
|
33
|
-
* This endpoint works for both discovery scans and rescans.
|
|
32
|
+
* 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.
|
|
34
33
|
*/
|
|
35
34
|
export function globalDataGetTrackedScan(
|
|
36
35
|
client: SDKCore,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { SDKCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery } from "../lib/encodings.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -33,11 +33,11 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
*/
|
|
34
34
|
export function globalDataGetWebProperties(
|
|
35
35
|
client: SDKCore,
|
|
36
|
-
request: operations.
|
|
36
|
+
request: operations.V3GlobaldataAssetWebpropertyListPostRequest,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
40
|
-
operations.
|
|
40
|
+
operations.V3GlobaldataAssetWebpropertyListPostResponse,
|
|
41
41
|
| errors.ErrorModel
|
|
42
42
|
| SDKBaseError
|
|
43
43
|
| ResponseValidationError
|
|
@@ -58,12 +58,12 @@ export function globalDataGetWebProperties(
|
|
|
58
58
|
|
|
59
59
|
async function $do(
|
|
60
60
|
client: SDKCore,
|
|
61
|
-
request: operations.
|
|
61
|
+
request: operations.V3GlobaldataAssetWebpropertyListPostRequest,
|
|
62
62
|
options?: RequestOptions,
|
|
63
63
|
): Promise<
|
|
64
64
|
[
|
|
65
65
|
Result<
|
|
66
|
-
operations.
|
|
66
|
+
operations.V3GlobaldataAssetWebpropertyListPostResponse,
|
|
67
67
|
| errors.ErrorModel
|
|
68
68
|
| SDKBaseError
|
|
69
69
|
| ResponseValidationError
|
|
@@ -80,26 +80,27 @@ async function $do(
|
|
|
80
80
|
const parsed = safeParse(
|
|
81
81
|
request,
|
|
82
82
|
(value) =>
|
|
83
|
-
operations.
|
|
84
|
-
value,
|
|
85
|
-
),
|
|
83
|
+
operations.V3GlobaldataAssetWebpropertyListPostRequest$outboundSchema
|
|
84
|
+
.parse(value),
|
|
86
85
|
"Input validation failed",
|
|
87
86
|
);
|
|
88
87
|
if (!parsed.ok) {
|
|
89
88
|
return [parsed, { status: "invalid" }];
|
|
90
89
|
}
|
|
91
90
|
const payload = parsed.value;
|
|
92
|
-
const body =
|
|
91
|
+
const body = encodeJSON("body", payload.AssetWebpropertyListInputBody, {
|
|
92
|
+
explode: true,
|
|
93
|
+
});
|
|
93
94
|
|
|
94
95
|
const path = pathToFunc("/v3/global/asset/webproperty")();
|
|
95
96
|
|
|
96
97
|
const query = encodeFormQuery({
|
|
97
98
|
"organization_id": payload.organization_id
|
|
98
99
|
?? client._options.organizationId,
|
|
99
|
-
"webproperty_ids": payload.webproperty_ids,
|
|
100
100
|
}, { explode: false });
|
|
101
101
|
|
|
102
102
|
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
103
104
|
Accept: "application/vnd.censys.api.v3.webproperty.v1+json",
|
|
104
105
|
}));
|
|
105
106
|
|
|
@@ -112,7 +113,7 @@ async function $do(
|
|
|
112
113
|
const context = {
|
|
113
114
|
options: client._options,
|
|
114
115
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
-
operationID: "v3-globaldata-asset-webproperty-list",
|
|
116
|
+
operationID: "v3-globaldata-asset-webproperty-list-post",
|
|
116
117
|
oAuth2Scopes: [],
|
|
117
118
|
|
|
118
119
|
resolvedSecurity: requestSecurity,
|
|
@@ -126,7 +127,7 @@ async function $do(
|
|
|
126
127
|
|
|
127
128
|
const requestRes = client._createRequest(context, {
|
|
128
129
|
security: requestSecurity,
|
|
129
|
-
method: "
|
|
130
|
+
method: "POST",
|
|
130
131
|
baseURL: options?.serverURL,
|
|
131
132
|
path: path,
|
|
132
133
|
headers: headers,
|
|
@@ -156,7 +157,7 @@ async function $do(
|
|
|
156
157
|
};
|
|
157
158
|
|
|
158
159
|
const [result] = await M.match<
|
|
159
|
-
operations.
|
|
160
|
+
operations.V3GlobaldataAssetWebpropertyListPostResponse,
|
|
160
161
|
| errors.ErrorModel
|
|
161
162
|
| SDKBaseError
|
|
162
163
|
| ResponseValidationError
|
|
@@ -169,7 +170,7 @@ async function $do(
|
|
|
169
170
|
>(
|
|
170
171
|
M.json(
|
|
171
172
|
200,
|
|
172
|
-
operations.
|
|
173
|
+
operations.V3GlobaldataAssetWebpropertyListPostResponse$inboundSchema,
|
|
173
174
|
{
|
|
174
175
|
ctype: "application/vnd.censys.api.v3.webproperty.v1+json",
|
|
175
176
|
hdrs: true,
|
|
@@ -26,10 +26,10 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Live Discovery: Initiate a new scan
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
*
|
|
32
|
+
* Initiate a scan to look for a currently unobserved service at a specific IP and port (`ip:port`) or hostname and port (`hostname:port`). This is equivalent to the [Live Discovery](https://docs.censys.com/docs/platform-threat-hunting-use-live-scan-and-rescan-to-validate-infrastructure#/) feature available in the UI, but you can also target web properties in addition to hosts.<br><br>The scan may take several minutes to complete. The response will contain a scan ID that you can use to [monitor the scan's status](https://docs.censys.com/reference/v3-threathunting-scans-get#/). After the scan completes, perform a lookup on the target asset to retrieve detailed scan information.<br><br>This endpoint is available to organizations that have access to the Threat Hunting module. It costs 15 credits to execute this endpoint.
|
|
33
33
|
*/
|
|
34
34
|
export function threatHuntingCreateTrackedScan(
|
|
35
35
|
client: SDKCore,
|