@censys/platform-sdk 0.10.1 → 0.10.2
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 +6 -0
- package/docs/sdks/threathunting/README.md +250 -1
- package/funcs/accountManagementGetMemberCreditUsage.js.map +1 -1
- package/funcs/accountManagementGetOrganizationCreditUsage.js.map +1 -1
- package/funcs/accountManagementGetOrganizationCredits.js.map +1 -1
- package/funcs/accountManagementGetOrganizationDetails.js.map +1 -1
- package/funcs/accountManagementInviteUserToOrganization.js.map +1 -1
- package/funcs/accountManagementListOrganizationMembers.js.map +1 -1
- package/funcs/accountManagementRemoveOrganizationMember.js.map +1 -1
- package/funcs/accountManagementUpdateOrganizationMember.js.map +1 -1
- package/funcs/collectionsAggregate.js.map +1 -1
- package/funcs/collectionsDelete.js.map +1 -1
- package/funcs/collectionsGet.js.map +1 -1
- package/funcs/collectionsListEvents.js.map +1 -1
- package/funcs/collectionsSearch.js.map +1 -1
- package/funcs/collectionsUpdate.js.map +1 -1
- package/funcs/globalDataGetCertificate.js.map +1 -1
- package/funcs/globalDataGetCertificateRaw.js.map +1 -1
- package/funcs/globalDataGetHost.js.map +1 -1
- package/funcs/globalDataGetHostTimeline.js.map +1 -1
- package/funcs/globalDataGetTrackedScan.js.map +1 -1
- package/funcs/globalDataGetWebProperty.js.map +1 -1
- package/funcs/globalDataListServicesOnHost.js.map +1 -1
- package/funcs/threatHuntingCreateCenseyeJob.d.ts +18 -0
- package/funcs/threatHuntingCreateCenseyeJob.d.ts.map +1 -0
- package/funcs/threatHuntingCreateCenseyeJob.js +131 -0
- package/funcs/threatHuntingCreateCenseyeJob.js.map +1 -0
- package/funcs/threatHuntingGetCenseyeJob.d.ts +18 -0
- package/funcs/threatHuntingGetCenseyeJob.d.ts.map +1 -0
- package/funcs/threatHuntingGetCenseyeJob.js +134 -0
- package/funcs/threatHuntingGetCenseyeJob.js.map +1 -0
- package/funcs/threatHuntingGetCenseyeJobResults.d.ts +18 -0
- package/funcs/threatHuntingGetCenseyeJobResults.d.ts.map +1 -0
- package/funcs/threatHuntingGetCenseyeJobResults.js +136 -0
- package/funcs/threatHuntingGetCenseyeJobResults.js.map +1 -0
- package/funcs/threatHuntingGetHostObservationsWithCertificate.js.map +1 -1
- package/funcs/threatHuntingGetTrackedScanThreatHunting.js.map +1 -1
- package/funcs/threatHuntingValueCounts.d.ts +1 -1
- package/funcs/threatHuntingValueCounts.js +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +20 -5
- package/lib/encodings.js.map +1 -1
- package/lib/files.d.ts +13 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +19 -0
- package/lib/files.js.map +1 -1
- package/lib/matchers.d.ts.map +1 -1
- package/lib/matchers.js +0 -1
- package/lib/matchers.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +8 -4
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +1 -2
- package/lib/security.js.map +1 -1
- package/lib/url.d.ts.map +1 -1
- package/lib/url.js +4 -2
- package/lib/url.js.map +1 -1
- package/models/components/censeyejob.d.ts +59 -0
- package/models/components/censeyejob.d.ts.map +1 -0
- package/models/components/censeyejob.js +85 -0
- package/models/components/censeyejob.js.map +1 -0
- package/models/components/censeyeresult.d.ts +18 -0
- package/models/components/censeyeresult.d.ts.map +1 -0
- package/models/components/censeyeresult.js +57 -0
- package/models/components/censeyeresult.js.map +1 -0
- package/models/components/censeyeresultsresponse.d.ts +18 -0
- package/models/components/censeyeresultsresponse.d.ts.map +1 -0
- package/models/components/censeyeresultsresponse.js +57 -0
- package/models/components/censeyeresultsresponse.js.map +1 -0
- package/models/components/censeyetarget.d.ts +30 -0
- package/models/components/censeyetarget.d.ts.map +1 -0
- package/models/components/censeyetarget.js +75 -0
- package/models/components/censeyetarget.js.map +1 -0
- package/models/components/countcondition.d.ts +1 -1
- package/models/components/createcenseyejobinputbody.d.ts +13 -0
- package/models/components/createcenseyejobinputbody.d.ts.map +1 -0
- package/models/components/createcenseyejobinputbody.js +50 -0
- package/models/components/createcenseyejobinputbody.js.map +1 -0
- package/models/components/fieldvaluepair.d.ts +5 -0
- package/models/components/fieldvaluepair.d.ts.map +1 -1
- package/models/components/fieldvaluepair.js +11 -1
- package/models/components/fieldvaluepair.js.map +1 -1
- package/models/components/host.d.ts +12 -0
- package/models/components/host.d.ts.map +1 -1
- package/models/components/host.js +7 -0
- package/models/components/host.js.map +1 -1
- package/models/components/index.d.ts +21 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +21 -0
- package/models/components/index.js.map +1 -1
- package/models/components/networkclassification.d.ts +27 -0
- package/models/components/networkclassification.d.ts.map +1 -0
- package/models/components/networkclassification.js +60 -0
- package/models/components/networkclassification.js.map +1 -0
- package/models/components/networkmobileinfo.d.ts +21 -0
- package/models/components/networkmobileinfo.d.ts.map +1 -0
- package/models/components/networkmobileinfo.js +57 -0
- package/models/components/networkmobileinfo.js.map +1 -0
- package/models/components/privacy.d.ts +39 -0
- package/models/components/privacy.d.ts.map +1 -0
- package/models/components/privacy.js +64 -0
- package/models/components/privacy.js.map +1 -0
- package/models/components/privacytorinfo.d.ts +11 -0
- package/models/components/privacytorinfo.d.ts.map +1 -0
- package/models/components/privacytorinfo.js +51 -0
- package/models/components/privacytorinfo.js.map +1 -0
- package/models/components/privacytorinforelay.d.ts +140 -0
- package/models/components/privacytorinforelay.d.ts.map +1 -0
- package/models/components/privacytorinforelay.js +114 -0
- package/models/components/privacytorinforelay.js.map +1 -0
- package/models/components/privacytorinforelayexitpolicysummary.d.ts +17 -0
- package/models/components/privacytorinforelayexitpolicysummary.d.ts.map +1 -0
- package/models/components/privacytorinforelayexitpolicysummary.js +51 -0
- package/models/components/privacytorinforelayexitpolicysummary.js.map +1 -0
- package/models/components/reputation.d.ts +26 -0
- package/models/components/reputation.d.ts.map +1 -0
- package/models/components/reputation.js +71 -0
- package/models/components/reputation.js.map +1 -0
- package/models/components/reputationevidence.d.ts +17 -0
- package/models/components/reputationevidence.d.ts.map +1 -0
- package/models/components/reputationevidence.js +65 -0
- package/models/components/reputationevidence.js.map +1 -0
- package/models/components/reputationevidenceexternalsignal.d.ts +23 -0
- package/models/components/reputationevidenceexternalsignal.d.ts.map +1 -0
- package/models/components/reputationevidenceexternalsignal.js +62 -0
- package/models/components/reputationevidenceexternalsignal.js.map +1 -0
- package/models/components/reputationevidencefieldvalue.d.ts +11 -0
- package/models/components/reputationevidencefieldvalue.d.ts.map +1 -0
- package/models/components/reputationevidencefieldvalue.js +51 -0
- package/models/components/reputationevidencefieldvalue.js.map +1 -0
- package/models/components/reputationevidencethreat.d.ts +12 -0
- package/models/components/reputationevidencethreat.d.ts.map +1 -0
- package/models/components/reputationevidencethreat.js +59 -0
- package/models/components/reputationevidencethreat.js.map +1 -0
- package/models/components/responseenvelopecenseyejob.d.ts +11 -0
- package/models/components/responseenvelopecenseyejob.d.ts.map +1 -0
- package/models/components/responseenvelopecenseyejob.js +51 -0
- package/models/components/responseenvelopecenseyejob.js.map +1 -0
- package/models/components/responseenvelopecenseyeresultsresponse.d.ts +11 -0
- package/models/components/responseenvelopecenseyeresultsresponse.d.ts.map +1 -0
- package/models/components/responseenvelopecenseyeresultsresponse.js +51 -0
- package/models/components/responseenvelopecenseyeresultsresponse.js.map +1 -0
- package/models/components/sapient.d.ts +15 -0
- package/models/components/sapient.d.ts.map +1 -0
- package/models/components/sapient.js +60 -0
- package/models/components/sapient.js.map +1 -0
- package/models/components/sapienterror.d.ts +11 -0
- package/models/components/sapienterror.d.ts.map +1 -0
- package/models/components/sapienterror.js +56 -0
- package/models/components/sapienterror.js.map +1 -0
- package/models/components/sapientregistrationack.d.ts +11 -0
- package/models/components/sapientregistrationack.d.ts.map +1 -0
- package/models/components/sapientregistrationack.js +56 -0
- package/models/components/sapientregistrationack.js.map +1 -0
- package/models/components/searchvaluecountsinputbody.d.ts +1 -1
- package/models/components/service.d.ts +2 -0
- package/models/components/service.d.ts.map +1 -1
- package/models/components/service.js +2 -0
- package/models/components/service.js.map +1 -1
- package/models/components/servicescan.d.ts +2 -0
- package/models/components/servicescan.d.ts.map +1 -1
- package/models/components/servicescan.js +2 -0
- package/models/components/servicescan.js.map +1 -1
- package/models/components/servicesonhostresponse.d.ts +6 -0
- package/models/components/servicesonhostresponse.d.ts.map +1 -1
- package/models/components/servicesonhostresponse.js +3 -4
- package/models/components/servicesonhostresponse.js.map +1 -1
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/v3threathuntingcenseyejobresults.d.ts +45 -0
- package/models/operations/v3threathuntingcenseyejobresults.d.ts.map +1 -0
- package/models/operations/v3threathuntingcenseyejobresults.js +76 -0
- package/models/operations/v3threathuntingcenseyejobresults.js.map +1 -0
- package/models/operations/v3threathuntingcenseyejobscreate.d.ts +32 -0
- package/models/operations/v3threathuntingcenseyejobscreate.d.ts.map +1 -0
- package/models/operations/v3threathuntingcenseyejobscreate.js +72 -0
- package/models/operations/v3threathuntingcenseyejobscreate.js.map +1 -0
- package/models/operations/v3threathuntingcenseyejobsget.d.ts +35 -0
- package/models/operations/v3threathuntingcenseyejobsget.d.ts.map +1 -0
- package/models/operations/v3threathuntingcenseyejobsget.js +72 -0
- package/models/operations/v3threathuntingcenseyejobsget.js.map +1 -0
- package/package.json +1 -1
- package/sdk/threathunting.d.ts +22 -1
- package/sdk/threathunting.d.ts.map +1 -1
- package/sdk/threathunting.js +31 -1
- package/sdk/threathunting.js.map +1 -1
- package/src/funcs/accountManagementGetMemberCreditUsage.ts +0 -1
- package/src/funcs/accountManagementGetOrganizationCreditUsage.ts +0 -1
- package/src/funcs/accountManagementGetOrganizationCredits.ts +0 -1
- package/src/funcs/accountManagementGetOrganizationDetails.ts +0 -1
- package/src/funcs/accountManagementInviteUserToOrganization.ts +0 -1
- package/src/funcs/accountManagementListOrganizationMembers.ts +0 -1
- package/src/funcs/accountManagementRemoveOrganizationMember.ts +0 -1
- package/src/funcs/accountManagementUpdateOrganizationMember.ts +0 -1
- package/src/funcs/collectionsAggregate.ts +0 -1
- package/src/funcs/collectionsDelete.ts +0 -1
- package/src/funcs/collectionsGet.ts +0 -1
- package/src/funcs/collectionsListEvents.ts +0 -1
- package/src/funcs/collectionsSearch.ts +0 -1
- package/src/funcs/collectionsUpdate.ts +0 -1
- package/src/funcs/globalDataGetCertificate.ts +0 -1
- package/src/funcs/globalDataGetCertificateRaw.ts +0 -1
- package/src/funcs/globalDataGetHost.ts +0 -1
- package/src/funcs/globalDataGetHostTimeline.ts +0 -1
- package/src/funcs/globalDataGetTrackedScan.ts +0 -1
- package/src/funcs/globalDataGetWebProperty.ts +0 -1
- package/src/funcs/globalDataListServicesOnHost.ts +0 -1
- package/src/funcs/threatHuntingCreateCenseyeJob.ts +195 -0
- package/src/funcs/threatHuntingGetCenseyeJob.ts +200 -0
- package/src/funcs/threatHuntingGetCenseyeJobResults.ts +202 -0
- package/src/funcs/threatHuntingGetHostObservationsWithCertificate.ts +0 -1
- package/src/funcs/threatHuntingGetTrackedScanThreatHunting.ts +0 -1
- package/src/funcs/threatHuntingValueCounts.ts +1 -1
- package/src/lib/config.ts +4 -4
- package/src/lib/encodings.ts +23 -4
- package/src/lib/files.ts +22 -0
- package/src/lib/matchers.ts +3 -2
- package/src/lib/sdks.ts +7 -5
- package/src/lib/security.ts +1 -2
- package/src/lib/url.ts +16 -14
- package/src/models/components/censeyejob.ts +106 -0
- package/src/models/components/censeyeresult.ts +48 -0
- package/src/models/components/censeyeresultsresponse.ts +45 -0
- package/src/models/components/censeyetarget.ts +77 -0
- package/src/models/components/countcondition.ts +1 -1
- package/src/models/components/createcenseyejobinputbody.ts +36 -0
- package/src/models/components/fieldvaluepair.ts +21 -0
- package/src/models/components/host.ts +19 -0
- package/src/models/components/index.ts +21 -0
- package/src/models/components/networkclassification.ts +60 -0
- package/src/models/components/networkmobileinfo.ts +49 -0
- package/src/models/components/privacy.ts +73 -0
- package/src/models/components/privacytorinfo.ts +35 -0
- package/src/models/components/privacytorinforelay.ts +227 -0
- package/src/models/components/privacytorinforelayexitpolicysummary.ts +40 -0
- package/src/models/components/reputation.ts +66 -0
- package/src/models/components/reputationevidence.ts +63 -0
- package/src/models/components/reputationevidenceexternalsignal.ts +50 -0
- package/src/models/components/reputationevidencefieldvalue.ts +33 -0
- package/src/models/components/reputationevidencethreat.ts +42 -0
- package/src/models/components/responseenvelopecenseyejob.ts +32 -0
- package/src/models/components/responseenvelopecenseyeresultsresponse.ts +36 -0
- package/src/models/components/sapient.ts +44 -0
- package/src/models/components/sapienterror.ts +38 -0
- package/src/models/components/sapientregistrationack.ts +38 -0
- package/src/models/components/searchvaluecountsinputbody.ts +1 -1
- package/src/models/components/service.ts +3 -0
- package/src/models/components/servicescan.ts +3 -0
- package/src/models/components/servicesonhostresponse.ts +9 -4
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/v3threathuntingcenseyejobresults.ts +107 -0
- package/src/models/operations/v3threathuntingcenseyejobscreate.ts +91 -0
- package/src/models/operations/v3threathuntingcenseyejobsget.ts +87 -0
- package/src/sdk/threathunting.ts +55 -1
- package/tests/sdk.test.ts +412 -259
|
@@ -0,0 +1,195 @@
|
|
|
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
|
+
* CensEye: Create a pivot analysis job
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Create an asynchronous CensEye pivot analysis job for a host, web property, or certificate. The job extracts [default pivot fields](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#default-pivot-fields) from the target asset and counts matching documents for each field-value pair. Poll the job status endpoint to track progress, then retrieve results when complete.<br><br>To use this endpoint, your organization must have access to the Threat Hunting module.<br><br>This endpoint costs 44 credits to execute for a host, 28 credits to execute for a web property, and 7 credits to execute for a certificate.
|
|
33
|
+
*/
|
|
34
|
+
export function threatHuntingCreateCenseyeJob(
|
|
35
|
+
client: SDKCore,
|
|
36
|
+
request: operations.V3ThreathuntingCenseyeJobsCreateRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.V3ThreathuntingCenseyeJobsCreateResponse,
|
|
41
|
+
| errors.AuthenticationError
|
|
42
|
+
| errors.ErrorModel
|
|
43
|
+
| SDKBaseError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: SDKCore,
|
|
62
|
+
request: operations.V3ThreathuntingCenseyeJobsCreateRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.V3ThreathuntingCenseyeJobsCreateResponse,
|
|
68
|
+
| errors.AuthenticationError
|
|
69
|
+
| errors.ErrorModel
|
|
70
|
+
| SDKBaseError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) =>
|
|
85
|
+
operations.V3ThreathuntingCenseyeJobsCreateRequest$outboundSchema.parse(
|
|
86
|
+
value,
|
|
87
|
+
),
|
|
88
|
+
"Input validation failed",
|
|
89
|
+
);
|
|
90
|
+
if (!parsed.ok) {
|
|
91
|
+
return [parsed, { status: "invalid" }];
|
|
92
|
+
}
|
|
93
|
+
const payload = parsed.value;
|
|
94
|
+
const body = encodeJSON("body", payload.CreateCenseyeJobInputBody, {
|
|
95
|
+
explode: true,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v3/threat-hunting/censeye/jobs")();
|
|
99
|
+
|
|
100
|
+
const query = encodeFormQuery({
|
|
101
|
+
"organization_id": payload.organization_id
|
|
102
|
+
?? client._options.organizationId,
|
|
103
|
+
}, { explode: false });
|
|
104
|
+
|
|
105
|
+
const headers = new Headers(compactMap({
|
|
106
|
+
"Content-Type": "application/json",
|
|
107
|
+
Accept: "application/json",
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
const secConfig = await extractSecurity(client._options.personalAccessToken);
|
|
111
|
+
const securityInput = secConfig == null
|
|
112
|
+
? {}
|
|
113
|
+
: { personalAccessToken: secConfig };
|
|
114
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
115
|
+
|
|
116
|
+
const context = {
|
|
117
|
+
options: client._options,
|
|
118
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
119
|
+
operationID: "v3-threathunting-censeye-jobs-create",
|
|
120
|
+
oAuth2Scopes: null,
|
|
121
|
+
|
|
122
|
+
resolvedSecurity: requestSecurity,
|
|
123
|
+
|
|
124
|
+
securitySource: client._options.personalAccessToken,
|
|
125
|
+
retryConfig: options?.retries
|
|
126
|
+
|| client._options.retryConfig
|
|
127
|
+
|| { strategy: "none" },
|
|
128
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const requestRes = client._createRequest(context, {
|
|
132
|
+
security: requestSecurity,
|
|
133
|
+
method: "POST",
|
|
134
|
+
baseURL: options?.serverURL,
|
|
135
|
+
path: path,
|
|
136
|
+
headers: headers,
|
|
137
|
+
query: query,
|
|
138
|
+
body: body,
|
|
139
|
+
userAgent: client._options.userAgent,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [requestRes, { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
errorCodes: ["400", "401", "403", "422", "4XX", "500", "5XX"],
|
|
150
|
+
retryConfig: context.retryConfig,
|
|
151
|
+
retryCodes: context.retryCodes,
|
|
152
|
+
});
|
|
153
|
+
if (!doResult.ok) {
|
|
154
|
+
return [doResult, { status: "request-error", request: req }];
|
|
155
|
+
}
|
|
156
|
+
const response = doResult.value;
|
|
157
|
+
|
|
158
|
+
const responseFields = {
|
|
159
|
+
HttpMeta: { Response: response, Request: req },
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const [result] = await M.match<
|
|
163
|
+
operations.V3ThreathuntingCenseyeJobsCreateResponse,
|
|
164
|
+
| errors.AuthenticationError
|
|
165
|
+
| errors.ErrorModel
|
|
166
|
+
| SDKBaseError
|
|
167
|
+
| ResponseValidationError
|
|
168
|
+
| ConnectionError
|
|
169
|
+
| RequestAbortedError
|
|
170
|
+
| RequestTimeoutError
|
|
171
|
+
| InvalidRequestError
|
|
172
|
+
| UnexpectedClientError
|
|
173
|
+
| SDKValidationError
|
|
174
|
+
>(
|
|
175
|
+
M.json(
|
|
176
|
+
200,
|
|
177
|
+
operations.V3ThreathuntingCenseyeJobsCreateResponse$inboundSchema,
|
|
178
|
+
{ hdrs: true, key: "Result" },
|
|
179
|
+
),
|
|
180
|
+
M.jsonErr(401, errors.AuthenticationError$inboundSchema),
|
|
181
|
+
M.jsonErr([400, 403, 422], errors.ErrorModel$inboundSchema, {
|
|
182
|
+
ctype: "application/problem+json",
|
|
183
|
+
}),
|
|
184
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
185
|
+
ctype: "application/problem+json",
|
|
186
|
+
}),
|
|
187
|
+
M.fail("4XX"),
|
|
188
|
+
M.fail("5XX"),
|
|
189
|
+
)(response, req, { extraFields: responseFields });
|
|
190
|
+
if (!result.ok) {
|
|
191
|
+
return [result, { status: "complete", request: req, response }];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return [result, { status: "complete", request: req, response }];
|
|
195
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } 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
|
+
* CensEye: Get job status
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieve the current status of a CensEye pivot analysis job. Use this to poll for completion before fetching results.<br><br>To use this endpoint, your organization must have access to the Threat Hunting module.
|
|
33
|
+
*/
|
|
34
|
+
export function threatHuntingGetCenseyeJob(
|
|
35
|
+
client: SDKCore,
|
|
36
|
+
request: operations.V3ThreathuntingCenseyeJobsGetRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.V3ThreathuntingCenseyeJobsGetResponse,
|
|
41
|
+
| errors.AuthenticationError
|
|
42
|
+
| errors.ErrorModel
|
|
43
|
+
| SDKBaseError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: SDKCore,
|
|
62
|
+
request: operations.V3ThreathuntingCenseyeJobsGetRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.V3ThreathuntingCenseyeJobsGetResponse,
|
|
68
|
+
| errors.AuthenticationError
|
|
69
|
+
| errors.ErrorModel
|
|
70
|
+
| SDKBaseError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) =>
|
|
85
|
+
operations.V3ThreathuntingCenseyeJobsGetRequest$outboundSchema.parse(
|
|
86
|
+
value,
|
|
87
|
+
),
|
|
88
|
+
"Input validation failed",
|
|
89
|
+
);
|
|
90
|
+
if (!parsed.ok) {
|
|
91
|
+
return [parsed, { status: "invalid" }];
|
|
92
|
+
}
|
|
93
|
+
const payload = parsed.value;
|
|
94
|
+
const body = null;
|
|
95
|
+
|
|
96
|
+
const pathParams = {
|
|
97
|
+
job_id: encodeSimple("job_id", payload.job_id, {
|
|
98
|
+
explode: false,
|
|
99
|
+
charEncoding: "percent",
|
|
100
|
+
}),
|
|
101
|
+
};
|
|
102
|
+
const path = pathToFunc("/v3/threat-hunting/censeye/jobs/{job_id}")(
|
|
103
|
+
pathParams,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const query = encodeFormQuery({
|
|
107
|
+
"organization_id": payload.organization_id
|
|
108
|
+
?? client._options.organizationId,
|
|
109
|
+
}, { explode: false });
|
|
110
|
+
|
|
111
|
+
const headers = new Headers(compactMap({
|
|
112
|
+
Accept: "application/json",
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
const secConfig = await extractSecurity(client._options.personalAccessToken);
|
|
116
|
+
const securityInput = secConfig == null
|
|
117
|
+
? {}
|
|
118
|
+
: { personalAccessToken: secConfig };
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
120
|
+
|
|
121
|
+
const context = {
|
|
122
|
+
options: client._options,
|
|
123
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
124
|
+
operationID: "v3-threathunting-censeye-jobs-get",
|
|
125
|
+
oAuth2Scopes: null,
|
|
126
|
+
|
|
127
|
+
resolvedSecurity: requestSecurity,
|
|
128
|
+
|
|
129
|
+
securitySource: client._options.personalAccessToken,
|
|
130
|
+
retryConfig: options?.retries
|
|
131
|
+
|| client._options.retryConfig
|
|
132
|
+
|| { strategy: "none" },
|
|
133
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const requestRes = client._createRequest(context, {
|
|
137
|
+
security: requestSecurity,
|
|
138
|
+
method: "GET",
|
|
139
|
+
baseURL: options?.serverURL,
|
|
140
|
+
path: path,
|
|
141
|
+
headers: headers,
|
|
142
|
+
query: query,
|
|
143
|
+
body: body,
|
|
144
|
+
userAgent: client._options.userAgent,
|
|
145
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
146
|
+
}, options);
|
|
147
|
+
if (!requestRes.ok) {
|
|
148
|
+
return [requestRes, { status: "invalid" }];
|
|
149
|
+
}
|
|
150
|
+
const req = requestRes.value;
|
|
151
|
+
|
|
152
|
+
const doResult = await client._do(req, {
|
|
153
|
+
context,
|
|
154
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
155
|
+
retryConfig: context.retryConfig,
|
|
156
|
+
retryCodes: context.retryCodes,
|
|
157
|
+
});
|
|
158
|
+
if (!doResult.ok) {
|
|
159
|
+
return [doResult, { status: "request-error", request: req }];
|
|
160
|
+
}
|
|
161
|
+
const response = doResult.value;
|
|
162
|
+
|
|
163
|
+
const responseFields = {
|
|
164
|
+
HttpMeta: { Response: response, Request: req },
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const [result] = await M.match<
|
|
168
|
+
operations.V3ThreathuntingCenseyeJobsGetResponse,
|
|
169
|
+
| errors.AuthenticationError
|
|
170
|
+
| errors.ErrorModel
|
|
171
|
+
| SDKBaseError
|
|
172
|
+
| ResponseValidationError
|
|
173
|
+
| ConnectionError
|
|
174
|
+
| RequestAbortedError
|
|
175
|
+
| RequestTimeoutError
|
|
176
|
+
| InvalidRequestError
|
|
177
|
+
| UnexpectedClientError
|
|
178
|
+
| SDKValidationError
|
|
179
|
+
>(
|
|
180
|
+
M.json(
|
|
181
|
+
200,
|
|
182
|
+
operations.V3ThreathuntingCenseyeJobsGetResponse$inboundSchema,
|
|
183
|
+
{ hdrs: true, key: "Result" },
|
|
184
|
+
),
|
|
185
|
+
M.jsonErr(401, errors.AuthenticationError$inboundSchema),
|
|
186
|
+
M.jsonErr([400, 403, 404], errors.ErrorModel$inboundSchema, {
|
|
187
|
+
ctype: "application/problem+json",
|
|
188
|
+
}),
|
|
189
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
190
|
+
ctype: "application/problem+json",
|
|
191
|
+
}),
|
|
192
|
+
M.fail("4XX"),
|
|
193
|
+
M.fail("5XX"),
|
|
194
|
+
)(response, req, { extraFields: responseFields });
|
|
195
|
+
if (!result.ok) {
|
|
196
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } 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
|
+
* CensEye: Get job results
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieve the results of a completed CensEye pivot analysis job. Each result contains a count and the field-value pairs that were analyzed. Results may be empty if the job is still running.<br><br>Results are paginated. Use the `next_page_token` from the response to fetch subsequent pages.<br><br>To use this endpoint, your organization must have access to the Threat Hunting module.
|
|
33
|
+
*/
|
|
34
|
+
export function threatHuntingGetCenseyeJobResults(
|
|
35
|
+
client: SDKCore,
|
|
36
|
+
request: operations.V3ThreathuntingCenseyeJobResultsRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.V3ThreathuntingCenseyeJobResultsResponse,
|
|
41
|
+
| errors.AuthenticationError
|
|
42
|
+
| errors.ErrorModel
|
|
43
|
+
| SDKBaseError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: SDKCore,
|
|
62
|
+
request: operations.V3ThreathuntingCenseyeJobResultsRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.V3ThreathuntingCenseyeJobResultsResponse,
|
|
68
|
+
| errors.AuthenticationError
|
|
69
|
+
| errors.ErrorModel
|
|
70
|
+
| SDKBaseError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) =>
|
|
85
|
+
operations.V3ThreathuntingCenseyeJobResultsRequest$outboundSchema.parse(
|
|
86
|
+
value,
|
|
87
|
+
),
|
|
88
|
+
"Input validation failed",
|
|
89
|
+
);
|
|
90
|
+
if (!parsed.ok) {
|
|
91
|
+
return [parsed, { status: "invalid" }];
|
|
92
|
+
}
|
|
93
|
+
const payload = parsed.value;
|
|
94
|
+
const body = null;
|
|
95
|
+
|
|
96
|
+
const pathParams = {
|
|
97
|
+
job_id: encodeSimple("job_id", payload.job_id, {
|
|
98
|
+
explode: false,
|
|
99
|
+
charEncoding: "percent",
|
|
100
|
+
}),
|
|
101
|
+
};
|
|
102
|
+
const path = pathToFunc("/v3/threat-hunting/censeye/jobs/{job_id}/results")(
|
|
103
|
+
pathParams,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const query = encodeFormQuery({
|
|
107
|
+
"organization_id": payload.organization_id
|
|
108
|
+
?? client._options.organizationId,
|
|
109
|
+
"page_size": payload.page_size,
|
|
110
|
+
"page_token": payload.page_token,
|
|
111
|
+
}, { explode: false });
|
|
112
|
+
|
|
113
|
+
const headers = new Headers(compactMap({
|
|
114
|
+
Accept: "application/json",
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
const secConfig = await extractSecurity(client._options.personalAccessToken);
|
|
118
|
+
const securityInput = secConfig == null
|
|
119
|
+
? {}
|
|
120
|
+
: { personalAccessToken: secConfig };
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
122
|
+
|
|
123
|
+
const context = {
|
|
124
|
+
options: client._options,
|
|
125
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
126
|
+
operationID: "v3-threathunting-censeye-job-results",
|
|
127
|
+
oAuth2Scopes: null,
|
|
128
|
+
|
|
129
|
+
resolvedSecurity: requestSecurity,
|
|
130
|
+
|
|
131
|
+
securitySource: client._options.personalAccessToken,
|
|
132
|
+
retryConfig: options?.retries
|
|
133
|
+
|| client._options.retryConfig
|
|
134
|
+
|| { strategy: "none" },
|
|
135
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const requestRes = client._createRequest(context, {
|
|
139
|
+
security: requestSecurity,
|
|
140
|
+
method: "GET",
|
|
141
|
+
baseURL: options?.serverURL,
|
|
142
|
+
path: path,
|
|
143
|
+
headers: headers,
|
|
144
|
+
query: query,
|
|
145
|
+
body: body,
|
|
146
|
+
userAgent: client._options.userAgent,
|
|
147
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
148
|
+
}, options);
|
|
149
|
+
if (!requestRes.ok) {
|
|
150
|
+
return [requestRes, { status: "invalid" }];
|
|
151
|
+
}
|
|
152
|
+
const req = requestRes.value;
|
|
153
|
+
|
|
154
|
+
const doResult = await client._do(req, {
|
|
155
|
+
context,
|
|
156
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
157
|
+
retryConfig: context.retryConfig,
|
|
158
|
+
retryCodes: context.retryCodes,
|
|
159
|
+
});
|
|
160
|
+
if (!doResult.ok) {
|
|
161
|
+
return [doResult, { status: "request-error", request: req }];
|
|
162
|
+
}
|
|
163
|
+
const response = doResult.value;
|
|
164
|
+
|
|
165
|
+
const responseFields = {
|
|
166
|
+
HttpMeta: { Response: response, Request: req },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const [result] = await M.match<
|
|
170
|
+
operations.V3ThreathuntingCenseyeJobResultsResponse,
|
|
171
|
+
| errors.AuthenticationError
|
|
172
|
+
| errors.ErrorModel
|
|
173
|
+
| SDKBaseError
|
|
174
|
+
| ResponseValidationError
|
|
175
|
+
| ConnectionError
|
|
176
|
+
| RequestAbortedError
|
|
177
|
+
| RequestTimeoutError
|
|
178
|
+
| InvalidRequestError
|
|
179
|
+
| UnexpectedClientError
|
|
180
|
+
| SDKValidationError
|
|
181
|
+
>(
|
|
182
|
+
M.json(
|
|
183
|
+
200,
|
|
184
|
+
operations.V3ThreathuntingCenseyeJobResultsResponse$inboundSchema,
|
|
185
|
+
{ hdrs: true, key: "Result" },
|
|
186
|
+
),
|
|
187
|
+
M.jsonErr(401, errors.AuthenticationError$inboundSchema),
|
|
188
|
+
M.jsonErr([400, 403, 404], errors.ErrorModel$inboundSchema, {
|
|
189
|
+
ctype: "application/problem+json",
|
|
190
|
+
}),
|
|
191
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
192
|
+
ctype: "application/problem+json",
|
|
193
|
+
}),
|
|
194
|
+
M.fail("4XX"),
|
|
195
|
+
M.fail("5XX"),
|
|
196
|
+
)(response, req, { extraFields: responseFields });
|
|
197
|
+
if (!result.ok) {
|
|
198
|
+
return [result, { status: "complete", request: req, response }];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return [result, { status: "complete", request: req, response }];
|
|
202
|
+
}
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* CensEye: Retrieve value counts to discover pivots
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Get counts of web assets for specific field-value pairs and combinations of field-value pairs. This is similar to the [CensEye functionality](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#/) available in the Platform web UI, but it allows you to define specific fields of interest rather than the [default fields](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#default-pivot-fields) leveraged by the tool in the UI.<br><br>Each array can only target fields within the same nested object. For example, you can combine `host.services.port=80` and `host.services.protocol=SSH` in the same array, but you cannot combine `host.services.port=80` and `host.location.country
|
|
32
|
+
* Get counts of web assets for specific field-value pairs and combinations of field-value pairs. This is similar to the [CensEye functionality](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#/) available in the Platform web UI, but it allows you to define specific fields of interest rather than the [default fields](https://docs.censys.com/docs/platform-threat-hunting-use-censeye-to-build-detections#default-pivot-fields) leveraged by the tool in the UI.<br><br>Each array can only target fields within the same nested object and may contain at most 5 field-value pairs. For example, you can combine `host.services.port=80` and `host.services.protocol=SSH` in the same array, but you cannot combine `host.services.port=80` and `host.location.country="United States"` in the same array. You can input multiple arrays of objects in each API call.<br><br>To use this endpoint, your organization must have access to the Threat Hunting Module. This endpoint costs 1 credit per count condition (array of objects) included in the API call.
|
|
33
33
|
*/
|
|
34
34
|
export function threatHuntingValueCounts(
|
|
35
35
|
client: SDKCore,
|
package/src/lib/config.ts
CHANGED
|
@@ -65,9 +65,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
|
|
66
66
|
export const SDK_METADATA = {
|
|
67
67
|
language: "typescript",
|
|
68
|
-
openapiDocVersion: "1.0.
|
|
69
|
-
sdkVersion: "0.10.
|
|
70
|
-
genVersion: "2.
|
|
68
|
+
openapiDocVersion: "1.0.87",
|
|
69
|
+
sdkVersion: "0.10.2",
|
|
70
|
+
genVersion: "2.869.25",
|
|
71
71
|
userAgent:
|
|
72
|
-
"speakeasy-sdk/typescript 0.10.
|
|
72
|
+
"speakeasy-sdk/typescript 0.10.2 2.869.25 1.0.87 @censys/platform-sdk",
|
|
73
73
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -479,6 +479,23 @@ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
|
|
|
479
479
|
export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
|
|
480
480
|
export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
|
|
481
481
|
|
|
482
|
+
function isBlobLike(val: unknown): val is Blob {
|
|
483
|
+
if (val instanceof Blob) {
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const tag = val[Symbol.toStringTag];
|
|
492
|
+
if (tag !== "Blob" && tag !== "File") {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
return "stream" in val && typeof val.stream === "function";
|
|
497
|
+
}
|
|
498
|
+
|
|
482
499
|
export function appendForm(
|
|
483
500
|
fd: FormData,
|
|
484
501
|
key: string,
|
|
@@ -487,10 +504,12 @@ export function appendForm(
|
|
|
487
504
|
): void {
|
|
488
505
|
if (value == null) {
|
|
489
506
|
return;
|
|
490
|
-
} else if (value
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
507
|
+
} else if (isBlobLike(value)) {
|
|
508
|
+
if (fileName) {
|
|
509
|
+
fd.append(key, value as Blob, fileName);
|
|
510
|
+
} else {
|
|
511
|
+
fd.append(key, value as Blob);
|
|
512
|
+
}
|
|
494
513
|
} else {
|
|
495
514
|
fd.append(key, String(value));
|
|
496
515
|
}
|