@censys/platform-sdk 0.8.0 → 0.9.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 +10 -6
- package/docs/sdks/accountmanagement/README.md +72 -2
- package/docs/sdks/collections/README.md +0 -1
- package/docs/sdks/globaldata/README.md +0 -1
- package/docs/sdks/threathunting/README.md +78 -1
- package/examples/package-lock.json +1 -1
- package/funcs/accountManagementGetOrganizationCredits.d.ts +1 -1
- package/funcs/accountManagementGetOrganizationCredits.js +1 -1
- package/funcs/accountManagementGetUserCredits.d.ts +18 -0
- package/funcs/accountManagementGetUserCredits.d.ts.map +1 -0
- package/funcs/accountManagementGetUserCredits.js +112 -0
- package/funcs/accountManagementGetUserCredits.js.map +1 -0
- package/funcs/threatHuntingListThreats.d.ts +18 -0
- package/funcs/threatHuntingListThreats.d.ts.map +1 -0
- package/funcs/threatHuntingListThreats.js +130 -0
- package/funcs/threatHuntingListThreats.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/lib/encodings.d.ts +1 -0
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +12 -1
- package/lib/encodings.js.map +1 -1
- package/models/components/cobaltstrikeconfig.d.ts +1 -0
- package/models/components/cobaltstrikeconfig.d.ts.map +1 -1
- package/models/components/cobaltstrikeconfig.js +2 -0
- package/models/components/cobaltstrikeconfig.js.map +1 -1
- package/models/components/index.d.ts +6 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +6 -0
- package/models/components/index.js.map +1 -1
- package/models/components/responseenvelopethreatslistresponse.d.ts +11 -0
- package/models/components/responseenvelopethreatslistresponse.d.ts.map +1 -0
- package/models/components/responseenvelopethreatslistresponse.js +51 -0
- package/models/components/responseenvelopethreatslistresponse.js.map +1 -0
- package/models/components/responseenvelopeusercredits.d.ts +11 -0
- package/models/components/responseenvelopeusercredits.d.ts.map +1 -0
- package/models/components/responseenvelopeusercredits.js +51 -0
- package/models/components/responseenvelopeusercredits.js.map +1 -0
- package/models/components/threatlistitem.d.ts +42 -0
- package/models/components/threatlistitem.d.ts.map +1 -0
- package/models/components/threatlistitem.js +66 -0
- package/models/components/threatlistitem.js.map +1 -0
- package/models/components/threatreference.d.ts +13 -0
- package/models/components/threatreference.d.ts.map +1 -0
- package/models/components/threatreference.js +50 -0
- package/models/components/threatreference.js.map +1 -0
- package/models/components/threatslistresponse.d.ts +14 -0
- package/models/components/threatslistresponse.d.ts.map +1 -0
- package/models/components/threatslistresponse.js +51 -0
- package/models/components/threatslistresponse.js.map +1 -0
- package/models/components/usercredits.d.ts +17 -0
- package/models/components/usercredits.d.ts.map +1 -0
- package/models/components/usercredits.js +57 -0
- package/models/components/usercredits.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/v3accountmanagementusercredits.d.ts +14 -0
- package/models/operations/v3accountmanagementusercredits.d.ts.map +1 -0
- package/models/operations/v3accountmanagementusercredits.js +58 -0
- package/models/operations/v3accountmanagementusercredits.js.map +1 -0
- package/models/operations/v3globaldatasearchaggregate.d.ts +1 -1
- package/models/operations/v3globaldatasearchquery.d.ts +1 -1
- package/models/operations/v3threathuntingthreatslist.d.ts +35 -0
- package/models/operations/v3threathuntingthreatslist.d.ts.map +1 -0
- package/models/operations/v3threathuntingthreatslist.js +71 -0
- package/models/operations/v3threathuntingthreatslist.js.map +1 -0
- package/package.json +1 -1
- package/sdk/accountmanagement.d.ts +8 -1
- package/sdk/accountmanagement.d.ts.map +1 -1
- package/sdk/accountmanagement.js +11 -1
- package/sdk/accountmanagement.js.map +1 -1
- package/sdk/threathunting.d.ts +7 -0
- package/sdk/threathunting.d.ts.map +1 -1
- package/sdk/threathunting.js +10 -0
- package/sdk/threathunting.js.map +1 -1
- package/src/funcs/accountManagementGetOrganizationCredits.ts +1 -1
- package/src/funcs/accountManagementGetUserCredits.ts +163 -0
- package/src/funcs/threatHuntingListThreats.ts +187 -0
- package/src/lib/config.ts +4 -4
- package/src/lib/encodings.ts +17 -3
- package/src/models/components/cobaltstrikeconfig.ts +3 -0
- package/src/models/components/index.ts +6 -0
- package/src/models/components/responseenvelopethreatslistresponse.ts +36 -0
- package/src/models/components/responseenvelopeusercredits.ts +32 -0
- package/src/models/components/threatlistitem.ts +81 -0
- package/src/models/components/threatreference.ts +34 -0
- package/src/models/components/threatslistresponse.ts +38 -0
- package/src/models/components/usercredits.ts +45 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/v3accountmanagementusercredits.ts +41 -0
- package/src/models/operations/v3globaldatasearchaggregate.ts +1 -1
- package/src/models/operations/v3globaldatasearchquery.ts +1 -1
- package/src/models/operations/v3threathuntingthreatslist.ts +86 -0
- package/src/sdk/accountmanagement.ts +17 -1
- package/src/sdk/threathunting.ts +18 -0
- package/src/types/enums.ts +38 -9
- package/src/types/index.ts +2 -2
- package/src/types/unrecognized.ts +35 -0
- package/tsconfig.json +1 -2
- package/types/enums.d.ts +8 -11
- package/types/enums.d.ts.map +1 -1
- package/types/enums.js +59 -3
- package/types/enums.js.map +1 -1
- package/types/index.d.ts +2 -2
- package/types/index.d.ts.map +1 -1
- package/types/index.js +16 -3
- package/types/index.js.map +1 -1
- package/types/unrecognized.d.ts +16 -0
- package/types/unrecognized.d.ts.map +1 -0
- package/types/unrecognized.js +34 -0
- package/types/unrecognized.js.map +1 -0
package/README.md
CHANGED
|
@@ -111,18 +111,19 @@ run();
|
|
|
111
111
|
<details open>
|
|
112
112
|
<summary>Available methods</summary>
|
|
113
113
|
|
|
114
|
-
### [
|
|
114
|
+
### [AccountManagement](docs/sdks/accountmanagement/README.md)
|
|
115
115
|
|
|
116
116
|
* [getOrganizationDetails](docs/sdks/accountmanagement/README.md#getorganizationdetails) - Get organization details
|
|
117
|
-
* [getOrganizationCredits](docs/sdks/accountmanagement/README.md#getorganizationcredits) - Get organization credit
|
|
117
|
+
* [getOrganizationCredits](docs/sdks/accountmanagement/README.md#getorganizationcredits) - Get organization credit details
|
|
118
118
|
* [getOrganizationCreditUsage](docs/sdks/accountmanagement/README.md#getorganizationcreditusage) - Get organization credit usage
|
|
119
119
|
* [inviteUserToOrganization](docs/sdks/accountmanagement/README.md#inviteusertoorganization) - Invite user to organization
|
|
120
120
|
* [listOrganizationMembers](docs/sdks/accountmanagement/README.md#listorganizationmembers) - List organization members
|
|
121
121
|
* [removeOrganizationMember](docs/sdks/accountmanagement/README.md#removeorganizationmember) - Remove member from organization
|
|
122
122
|
* [updateOrganizationMember](docs/sdks/accountmanagement/README.md#updateorganizationmember) - Update a member's roles in an organization
|
|
123
123
|
* [getMemberCreditUsage](docs/sdks/accountmanagement/README.md#getmembercreditusage) - Get member credit usage
|
|
124
|
+
* [getUserCredits](docs/sdks/accountmanagement/README.md#getusercredits) - Get Free user credit details
|
|
124
125
|
|
|
125
|
-
### [
|
|
126
|
+
### [Collections](docs/sdks/collections/README.md)
|
|
126
127
|
|
|
127
128
|
* [list](docs/sdks/collections/README.md#list) - List collections
|
|
128
129
|
* [create](docs/sdks/collections/README.md#create) - Create a collection
|
|
@@ -133,7 +134,7 @@ run();
|
|
|
133
134
|
* [aggregate](docs/sdks/collections/README.md#aggregate) - Aggregate results for a search query within a collection
|
|
134
135
|
* [search](docs/sdks/collections/README.md#search) - Run a search query within a collection
|
|
135
136
|
|
|
136
|
-
### [
|
|
137
|
+
### [GlobalData](docs/sdks/globaldata/README.md)
|
|
137
138
|
|
|
138
139
|
* [getCertificates](docs/sdks/globaldata/README.md#getcertificates) - Retrieve multiple certificates
|
|
139
140
|
* [getCertificatesRaw](docs/sdks/globaldata/README.md#getcertificatesraw) - Retrieve multiple certificates in PEM format
|
|
@@ -150,11 +151,12 @@ run();
|
|
|
150
151
|
* [convertLegacySearchQueries](docs/sdks/globaldata/README.md#convertlegacysearchqueries) - Convert Legacy Search queries to Platform queries
|
|
151
152
|
* [search](docs/sdks/globaldata/README.md#search) - Run a search query
|
|
152
153
|
|
|
153
|
-
### [
|
|
154
|
+
### [ThreatHunting](docs/sdks/threathunting/README.md)
|
|
154
155
|
|
|
155
156
|
* [getHostObservationsWithCertificate](docs/sdks/threathunting/README.md#gethostobservationswithcertificate) - Get host history for a certificate
|
|
156
157
|
* [createTrackedScan](docs/sdks/threathunting/README.md#createtrackedscan) - Live Discovery: Initiate a new scan
|
|
157
158
|
* [getTrackedScanThreatHunting](docs/sdks/threathunting/README.md#gettrackedscanthreathunting) - Get scan status
|
|
159
|
+
* [listThreats](docs/sdks/threathunting/README.md#listthreats) - List active threats
|
|
158
160
|
* [valueCounts](docs/sdks/threathunting/README.md#valuecounts) - CensEye: Retrieve value counts to discover pivots
|
|
159
161
|
|
|
160
162
|
</details>
|
|
@@ -176,9 +178,10 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
176
178
|
<summary>Available standalone functions</summary>
|
|
177
179
|
|
|
178
180
|
- [`accountManagementGetMemberCreditUsage`](docs/sdks/accountmanagement/README.md#getmembercreditusage) - Get member credit usage
|
|
179
|
-
- [`accountManagementGetOrganizationCredits`](docs/sdks/accountmanagement/README.md#getorganizationcredits) - Get organization credit
|
|
181
|
+
- [`accountManagementGetOrganizationCredits`](docs/sdks/accountmanagement/README.md#getorganizationcredits) - Get organization credit details
|
|
180
182
|
- [`accountManagementGetOrganizationCreditUsage`](docs/sdks/accountmanagement/README.md#getorganizationcreditusage) - Get organization credit usage
|
|
181
183
|
- [`accountManagementGetOrganizationDetails`](docs/sdks/accountmanagement/README.md#getorganizationdetails) - Get organization details
|
|
184
|
+
- [`accountManagementGetUserCredits`](docs/sdks/accountmanagement/README.md#getusercredits) - Get Free user credit details
|
|
182
185
|
- [`accountManagementInviteUserToOrganization`](docs/sdks/accountmanagement/README.md#inviteusertoorganization) - Invite user to organization
|
|
183
186
|
- [`accountManagementListOrganizationMembers`](docs/sdks/accountmanagement/README.md#listorganizationmembers) - List organization members
|
|
184
187
|
- [`accountManagementRemoveOrganizationMember`](docs/sdks/accountmanagement/README.md#removeorganizationmember) - Remove member from organization
|
|
@@ -208,6 +211,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
208
211
|
- [`threatHuntingCreateTrackedScan`](docs/sdks/threathunting/README.md#createtrackedscan) - Live Discovery: Initiate a new scan
|
|
209
212
|
- [`threatHuntingGetHostObservationsWithCertificate`](docs/sdks/threathunting/README.md#gethostobservationswithcertificate) - Get host history for a certificate
|
|
210
213
|
- [`threatHuntingGetTrackedScanThreatHunting`](docs/sdks/threathunting/README.md#gettrackedscanthreathunting) - Get scan status
|
|
214
|
+
- [`threatHuntingListThreats`](docs/sdks/threathunting/README.md#listthreats) - List active threats
|
|
211
215
|
- [`threatHuntingValueCounts`](docs/sdks/threathunting/README.md#valuecounts) - CensEye: Retrieve value counts to discover pivots
|
|
212
216
|
|
|
213
217
|
</details>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# AccountManagement
|
|
2
|
-
(*accountManagement*)
|
|
3
2
|
|
|
4
3
|
## Overview
|
|
5
4
|
|
|
@@ -8,13 +7,14 @@ Endpoints related to the Account Management product
|
|
|
8
7
|
### Available Operations
|
|
9
8
|
|
|
10
9
|
* [getOrganizationDetails](#getorganizationdetails) - Get organization details
|
|
11
|
-
* [getOrganizationCredits](#getorganizationcredits) - Get organization credit
|
|
10
|
+
* [getOrganizationCredits](#getorganizationcredits) - Get organization credit details
|
|
12
11
|
* [getOrganizationCreditUsage](#getorganizationcreditusage) - Get organization credit usage
|
|
13
12
|
* [inviteUserToOrganization](#inviteusertoorganization) - Invite user to organization
|
|
14
13
|
* [listOrganizationMembers](#listorganizationmembers) - List organization members
|
|
15
14
|
* [removeOrganizationMember](#removeorganizationmember) - Remove member from organization
|
|
16
15
|
* [updateOrganizationMember](#updateorganizationmember) - Update a member's roles in an organization
|
|
17
16
|
* [getMemberCreditUsage](#getmembercreditusage) - Get member credit usage
|
|
17
|
+
* [getUserCredits](#getusercredits) - Get Free user credit details
|
|
18
18
|
|
|
19
19
|
## getOrganizationDetails
|
|
20
20
|
|
|
@@ -636,4 +636,74 @@ run();
|
|
|
636
636
|
| -------------------------- | -------------------------- | -------------------------- |
|
|
637
637
|
| errors.AuthenticationError | 401 | application/json |
|
|
638
638
|
| errors.ErrorModel | 400, 403, 404, 422 | application/problem+json |
|
|
639
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
640
|
+
|
|
641
|
+
## getUserCredits
|
|
642
|
+
|
|
643
|
+
Retrieve your Free user account credit balance and refresh information. To retrieve the credit balance for a Starter or Enterprise account, use the [get organization credit details endpoint](https://docs.censys.com/reference/v3-accountmanagement-org-credits).<br><br>This endpoint does not cost any credits to execute.
|
|
644
|
+
|
|
645
|
+
### Example Usage
|
|
646
|
+
|
|
647
|
+
<!-- UsageSnippet language="typescript" operationID="v3-accountmanagement-user-credits" method="get" path="/v3/accounts/users/credits" -->
|
|
648
|
+
```typescript
|
|
649
|
+
import { SDK } from "@censys/platform-sdk";
|
|
650
|
+
|
|
651
|
+
const sdk = new SDK({
|
|
652
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
async function run() {
|
|
656
|
+
const result = await sdk.accountManagement.getUserCredits();
|
|
657
|
+
|
|
658
|
+
console.log(result);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
run();
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
### Standalone function
|
|
665
|
+
|
|
666
|
+
The standalone function version of this method:
|
|
667
|
+
|
|
668
|
+
```typescript
|
|
669
|
+
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
670
|
+
import { accountManagementGetUserCredits } from "@censys/platform-sdk/funcs/accountManagementGetUserCredits.js";
|
|
671
|
+
|
|
672
|
+
// Use `SDKCore` for best tree-shaking performance.
|
|
673
|
+
// You can create one instance of it to use across an application.
|
|
674
|
+
const sdk = new SDKCore({
|
|
675
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
async function run() {
|
|
679
|
+
const res = await accountManagementGetUserCredits(sdk);
|
|
680
|
+
if (res.ok) {
|
|
681
|
+
const { value: result } = res;
|
|
682
|
+
console.log(result);
|
|
683
|
+
} else {
|
|
684
|
+
console.log("accountManagementGetUserCredits failed:", res.error);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
run();
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### Parameters
|
|
692
|
+
|
|
693
|
+
| Parameter | Type | Required | Description |
|
|
694
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
695
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
696
|
+
| `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. |
|
|
697
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
698
|
+
|
|
699
|
+
### Response
|
|
700
|
+
|
|
701
|
+
**Promise\<[operations.V3AccountmanagementUserCreditsResponse](../../models/operations/v3accountmanagementusercreditsresponse.md)\>**
|
|
702
|
+
|
|
703
|
+
### Errors
|
|
704
|
+
|
|
705
|
+
| Error Type | Status Code | Content Type |
|
|
706
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
707
|
+
| errors.AuthenticationError | 401 | application/json |
|
|
708
|
+
| errors.ErrorModel | 404 | application/problem+json |
|
|
639
709
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# ThreatHunting
|
|
2
|
-
(*threatHunting*)
|
|
3
2
|
|
|
4
3
|
## Overview
|
|
5
4
|
|
|
@@ -10,6 +9,7 @@ Endpoints related to the Threat Hunting product
|
|
|
10
9
|
* [getHostObservationsWithCertificate](#gethostobservationswithcertificate) - Get host history for a certificate
|
|
11
10
|
* [createTrackedScan](#createtrackedscan) - Live Discovery: Initiate a new scan
|
|
12
11
|
* [getTrackedScanThreatHunting](#gettrackedscanthreathunting) - Get scan status
|
|
12
|
+
* [listThreats](#listthreats) - List active threats
|
|
13
13
|
* [valueCounts](#valuecounts) - CensEye: Retrieve value counts to discover pivots
|
|
14
14
|
|
|
15
15
|
## getHostObservationsWithCertificate
|
|
@@ -267,6 +267,83 @@ run();
|
|
|
267
267
|
| errors.ErrorModel | 403, 404 | application/problem+json |
|
|
268
268
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
269
269
|
|
|
270
|
+
## listThreats
|
|
271
|
+
|
|
272
|
+
Retrieve a list of active threats observed by Censys by aggregating threat IDs across hosts and web properties. Threats are active if their fingerprint has been identified on hosts or web properties by Censys scans. This information is also available on the [Explore Threats page in the Platform web UI](https://platform.censys.io/threats).
|
|
273
|
+
|
|
274
|
+
### Example Usage
|
|
275
|
+
|
|
276
|
+
<!-- UsageSnippet language="typescript" operationID="v3-threathunting-threats-list" method="get" path="/v3/threat-hunting/threats" -->
|
|
277
|
+
```typescript
|
|
278
|
+
import { SDK } from "@censys/platform-sdk";
|
|
279
|
+
|
|
280
|
+
const sdk = new SDK({
|
|
281
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
282
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
async function run() {
|
|
286
|
+
const result = await sdk.threatHunting.listThreats({
|
|
287
|
+
query: "*",
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
console.log(result);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
run();
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Standalone function
|
|
297
|
+
|
|
298
|
+
The standalone function version of this method:
|
|
299
|
+
|
|
300
|
+
```typescript
|
|
301
|
+
import { SDKCore } from "@censys/platform-sdk/core.js";
|
|
302
|
+
import { threatHuntingListThreats } from "@censys/platform-sdk/funcs/threatHuntingListThreats.js";
|
|
303
|
+
|
|
304
|
+
// Use `SDKCore` for best tree-shaking performance.
|
|
305
|
+
// You can create one instance of it to use across an application.
|
|
306
|
+
const sdk = new SDKCore({
|
|
307
|
+
organizationId: "11111111-2222-3333-4444-555555555555",
|
|
308
|
+
personalAccessToken: "<YOUR_BEARER_TOKEN_HERE>",
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
async function run() {
|
|
312
|
+
const res = await threatHuntingListThreats(sdk, {
|
|
313
|
+
query: "*",
|
|
314
|
+
});
|
|
315
|
+
if (res.ok) {
|
|
316
|
+
const { value: result } = res;
|
|
317
|
+
console.log(result);
|
|
318
|
+
} else {
|
|
319
|
+
console.log("threatHuntingListThreats failed:", res.error);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
run();
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Parameters
|
|
327
|
+
|
|
328
|
+
| Parameter | Type | Required | Description |
|
|
329
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
330
|
+
| `request` | [operations.V3ThreathuntingThreatsListRequest](../../models/operations/v3threathuntingthreatslistrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
331
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
332
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
333
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
334
|
+
|
|
335
|
+
### Response
|
|
336
|
+
|
|
337
|
+
**Promise\<[operations.V3ThreathuntingThreatsListResponse](../../models/operations/v3threathuntingthreatslistresponse.md)\>**
|
|
338
|
+
|
|
339
|
+
### Errors
|
|
340
|
+
|
|
341
|
+
| Error Type | Status Code | Content Type |
|
|
342
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
343
|
+
| errors.AuthenticationError | 401 | application/json |
|
|
344
|
+
| errors.ErrorModel | 403, 422 | application/problem+json |
|
|
345
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
346
|
+
|
|
270
347
|
## valueCounts
|
|
271
348
|
|
|
272
349
|
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=”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.
|
|
@@ -9,7 +9,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
9
9
|
import { APIPromise } from "../types/async.js";
|
|
10
10
|
import { Result } from "../types/fp.js";
|
|
11
11
|
/**
|
|
12
|
-
* Get organization credit
|
|
12
|
+
* Get organization credit details
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
15
|
* Retrieve credit balance and expiration information for an organization. <br><br>Credits expire 12 months after they are acquired.<br><br>This endpoint does not cost any credits to execute.
|
|
@@ -47,7 +47,7 @@ const errors = __importStar(require("../models/errors/index.js"));
|
|
|
47
47
|
const operations = __importStar(require("../models/operations/index.js"));
|
|
48
48
|
const async_js_1 = require("../types/async.js");
|
|
49
49
|
/**
|
|
50
|
-
* Get organization credit
|
|
50
|
+
* Get organization credit details
|
|
51
51
|
*
|
|
52
52
|
* @remarks
|
|
53
53
|
* Retrieve credit balance and expiration information for an organization. <br><br>Credits expire 12 months after they are acquired.<br><br>This endpoint does not cost any credits to execute.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SDKCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
6
|
+
import { SDKBaseError } from "../models/errors/sdkbaseerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* Get Free user credit details
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Retrieve your Free user account credit balance and refresh information. To retrieve the credit balance for a Starter or Enterprise account, use the [get organization credit details endpoint](https://docs.censys.com/reference/v3-accountmanagement-org-credits).<br><br>This endpoint does not cost any credits to execute.
|
|
16
|
+
*/
|
|
17
|
+
export declare function accountManagementGetUserCredits(client: SDKCore, options?: RequestOptions): APIPromise<Result<operations.V3AccountmanagementUserCreditsResponse, errors.AuthenticationError | errors.ErrorModel | SDKBaseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=accountManagementGetUserCredits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountManagementGetUserCredits.d.ts","sourceRoot":"","sources":["../src/funcs/accountManagementGetUserCredits.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sCAAsC,EAC/C,MAAM,CAAC,mBAAmB,GAC1B,MAAM,CAAC,UAAU,GACjB,YAAY,GACZ,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAKA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.accountManagementGetUserCredits = accountManagementGetUserCredits;
|
|
40
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
41
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
42
|
+
const security_js_1 = require("../lib/security.js");
|
|
43
|
+
const url_js_1 = require("../lib/url.js");
|
|
44
|
+
const errors = __importStar(require("../models/errors/index.js"));
|
|
45
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
46
|
+
const async_js_1 = require("../types/async.js");
|
|
47
|
+
/**
|
|
48
|
+
* Get Free user credit details
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* Retrieve your Free user account credit balance and refresh information. To retrieve the credit balance for a Starter or Enterprise account, use the [get organization credit details endpoint](https://docs.censys.com/reference/v3-accountmanagement-org-credits).<br><br>This endpoint does not cost any credits to execute.
|
|
52
|
+
*/
|
|
53
|
+
function accountManagementGetUserCredits(client, options) {
|
|
54
|
+
return new async_js_1.APIPromise($do(client, options));
|
|
55
|
+
}
|
|
56
|
+
async function $do(client, options) {
|
|
57
|
+
const path = (0, url_js_1.pathToFunc)("/v3/accounts/users/credits")();
|
|
58
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
59
|
+
Accept: "application/json",
|
|
60
|
+
}));
|
|
61
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.personalAccessToken);
|
|
62
|
+
const securityInput = secConfig == null
|
|
63
|
+
? {}
|
|
64
|
+
: { personalAccessToken: secConfig };
|
|
65
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
66
|
+
const context = {
|
|
67
|
+
options: client._options,
|
|
68
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
69
|
+
operationID: "v3-accountmanagement-user-credits",
|
|
70
|
+
oAuth2Scopes: null,
|
|
71
|
+
resolvedSecurity: requestSecurity,
|
|
72
|
+
securitySource: client._options.personalAccessToken,
|
|
73
|
+
retryConfig: options?.retries
|
|
74
|
+
|| client._options.retryConfig
|
|
75
|
+
|| { strategy: "none" },
|
|
76
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
77
|
+
};
|
|
78
|
+
const requestRes = client._createRequest(context, {
|
|
79
|
+
security: requestSecurity,
|
|
80
|
+
method: "GET",
|
|
81
|
+
baseURL: options?.serverURL,
|
|
82
|
+
path: path,
|
|
83
|
+
headers: headers,
|
|
84
|
+
userAgent: client._options.userAgent,
|
|
85
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
86
|
+
}, options);
|
|
87
|
+
if (!requestRes.ok) {
|
|
88
|
+
return [requestRes, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const req = requestRes.value;
|
|
91
|
+
const doResult = await client._do(req, {
|
|
92
|
+
context,
|
|
93
|
+
errorCodes: ["401", "404", "4XX", "5XX"],
|
|
94
|
+
retryConfig: context.retryConfig,
|
|
95
|
+
retryCodes: context.retryCodes,
|
|
96
|
+
});
|
|
97
|
+
if (!doResult.ok) {
|
|
98
|
+
return [doResult, { status: "request-error", request: req }];
|
|
99
|
+
}
|
|
100
|
+
const response = doResult.value;
|
|
101
|
+
const responseFields = {
|
|
102
|
+
HttpMeta: { Response: response, Request: req },
|
|
103
|
+
};
|
|
104
|
+
const [result] = await M.match(M.json(200, operations.V3AccountmanagementUserCreditsResponse$inboundSchema, { hdrs: true, key: "Result" }), M.jsonErr(401, errors.AuthenticationError$inboundSchema), M.jsonErr(404, errors.ErrorModel$inboundSchema, {
|
|
105
|
+
ctype: "application/problem+json",
|
|
106
|
+
}), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
107
|
+
if (!result.ok) {
|
|
108
|
+
return [result, { status: "complete", request: req, response }];
|
|
109
|
+
}
|
|
110
|
+
return [result, { status: "complete", request: req, response }];
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=accountManagementGetUserCredits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountManagementGetUserCredits.js","sourceRoot":"","sources":["../src/funcs/accountManagementGetUserCredits.ts"],"names":[],"mappings":";AAA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AC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAa5B,CAAC,CAAC,IAAI,CACJ,GAAG,EACH,UAAU,CAAC,oDAAoD,EAC/D,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAC9B,EACD,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,wBAAwB,EAAE;QAC9C,KAAK,EAAE,0BAA0B;KAClC,CAAC,EACF,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SDKCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
6
|
+
import { SDKBaseError } from "../models/errors/sdkbaseerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* List active threats
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Retrieve a list of active threats observed by Censys by aggregating threat IDs across hosts and web properties. Threats are active if their fingerprint has been identified on hosts or web properties by Censys scans. This information is also available on the [Explore Threats page in the Platform web UI](https://platform.censys.io/threats).
|
|
16
|
+
*/
|
|
17
|
+
export declare function threatHuntingListThreats(client: SDKCore, request: operations.V3ThreathuntingThreatsListRequest, options?: RequestOptions): APIPromise<Result<operations.V3ThreathuntingThreatsListResponse, errors.AuthenticationError | errors.ErrorModel | SDKBaseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=threatHuntingListThreats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threatHuntingListThreats.d.ts","sourceRoot":"","sources":["../src/funcs/threatHuntingListThreats.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,UAAU,CAAC,iCAAiC,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,kCAAkC,EAC3C,MAAM,CAAC,mBAAmB,GAC1B,MAAM,CAAC,UAAU,GACjB,YAAY,GACZ,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.threatHuntingListThreats = threatHuntingListThreats;
|
|
40
|
+
const encodings_js_1 = require("../lib/encodings.js");
|
|
41
|
+
const M = __importStar(require("../lib/matchers.js"));
|
|
42
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
43
|
+
const schemas_js_1 = require("../lib/schemas.js");
|
|
44
|
+
const security_js_1 = require("../lib/security.js");
|
|
45
|
+
const url_js_1 = require("../lib/url.js");
|
|
46
|
+
const errors = __importStar(require("../models/errors/index.js"));
|
|
47
|
+
const operations = __importStar(require("../models/operations/index.js"));
|
|
48
|
+
const async_js_1 = require("../types/async.js");
|
|
49
|
+
/**
|
|
50
|
+
* List active threats
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Retrieve a list of active threats observed by Censys by aggregating threat IDs across hosts and web properties. Threats are active if their fingerprint has been identified on hosts or web properties by Censys scans. This information is also available on the [Explore Threats page in the Platform web UI](https://platform.censys.io/threats).
|
|
54
|
+
*/
|
|
55
|
+
function threatHuntingListThreats(client, request, options) {
|
|
56
|
+
return new async_js_1.APIPromise($do(client, request, options));
|
|
57
|
+
}
|
|
58
|
+
async function $do(client, request, options) {
|
|
59
|
+
const parsed = (0, schemas_js_1.safeParse)(request, (value) => operations.V3ThreathuntingThreatsListRequest$outboundSchema.parse(value), "Input validation failed");
|
|
60
|
+
if (!parsed.ok) {
|
|
61
|
+
return [parsed, { status: "invalid" }];
|
|
62
|
+
}
|
|
63
|
+
const payload = parsed.value;
|
|
64
|
+
const body = null;
|
|
65
|
+
const path = (0, url_js_1.pathToFunc)("/v3/threat-hunting/threats")();
|
|
66
|
+
const query = (0, encodings_js_1.encodeFormQuery)({
|
|
67
|
+
"organization_id": payload.organization_id
|
|
68
|
+
?? client._options.organizationId,
|
|
69
|
+
"query": payload.query,
|
|
70
|
+
}, { explode: false });
|
|
71
|
+
const headers = new Headers((0, primitives_js_1.compactMap)({
|
|
72
|
+
Accept: "application/json",
|
|
73
|
+
}));
|
|
74
|
+
const secConfig = await (0, security_js_1.extractSecurity)(client._options.personalAccessToken);
|
|
75
|
+
const securityInput = secConfig == null
|
|
76
|
+
? {}
|
|
77
|
+
: { personalAccessToken: secConfig };
|
|
78
|
+
const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
|
|
79
|
+
const context = {
|
|
80
|
+
options: client._options,
|
|
81
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
82
|
+
operationID: "v3-threathunting-threats-list",
|
|
83
|
+
oAuth2Scopes: null,
|
|
84
|
+
resolvedSecurity: requestSecurity,
|
|
85
|
+
securitySource: client._options.personalAccessToken,
|
|
86
|
+
retryConfig: options?.retries
|
|
87
|
+
|| client._options.retryConfig
|
|
88
|
+
|| { strategy: "none" },
|
|
89
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
90
|
+
};
|
|
91
|
+
const requestRes = client._createRequest(context, {
|
|
92
|
+
security: requestSecurity,
|
|
93
|
+
method: "GET",
|
|
94
|
+
baseURL: options?.serverURL,
|
|
95
|
+
path: path,
|
|
96
|
+
headers: headers,
|
|
97
|
+
query: query,
|
|
98
|
+
body: body,
|
|
99
|
+
userAgent: client._options.userAgent,
|
|
100
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
101
|
+
}, options);
|
|
102
|
+
if (!requestRes.ok) {
|
|
103
|
+
return [requestRes, { status: "invalid" }];
|
|
104
|
+
}
|
|
105
|
+
const req = requestRes.value;
|
|
106
|
+
const doResult = await client._do(req, {
|
|
107
|
+
context,
|
|
108
|
+
errorCodes: ["401", "403", "422", "4XX", "5XX"],
|
|
109
|
+
retryConfig: context.retryConfig,
|
|
110
|
+
retryCodes: context.retryCodes,
|
|
111
|
+
});
|
|
112
|
+
if (!doResult.ok) {
|
|
113
|
+
return [doResult, { status: "request-error", request: req }];
|
|
114
|
+
}
|
|
115
|
+
const response = doResult.value;
|
|
116
|
+
const responseFields = {
|
|
117
|
+
HttpMeta: { Response: response, Request: req },
|
|
118
|
+
};
|
|
119
|
+
const [result] = await M.match(M.json(200, operations.V3ThreathuntingThreatsListResponse$inboundSchema, {
|
|
120
|
+
hdrs: true,
|
|
121
|
+
key: "Result",
|
|
122
|
+
}), M.jsonErr(401, errors.AuthenticationError$inboundSchema), M.jsonErr([403, 422], errors.ErrorModel$inboundSchema, {
|
|
123
|
+
ctype: "application/problem+json",
|
|
124
|
+
}), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
125
|
+
if (!result.ok) {
|
|
126
|
+
return [result, { status: "complete", request: req, response }];
|
|
127
|
+
}
|
|
128
|
+
return [result, { status: "complete", request: req, response }];
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=threatHuntingListThreats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threatHuntingListThreats.js","sourceRoot":"","sources":["../src/funcs/threatHuntingListThreats.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BH,4DAwBC;AApDD,sDAAsD;AACtD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAQ3C,kEAAoD;AAIpD,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;;GAKG;AACH,SAAgB,wBAAwB,CACtC,MAAe,EACf,OAAqD,EACrD,OAAwB;IAgBxB,OA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