@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
|
@@ -0,0 +1,201 @@
|
|
|
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
|
+
* Get host history for a certificate
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieve the historical observations of hosts associated with a certificate. This is useful for threat hunting, detection engineering, and timeline generation. Certificate history is also visible to Threat Hunting users in the Platform UI on the [certificate timeline](https://docs.censys.com/docs/platform-threat-hunting-use-cert-history-to-build-better-detections#/).<br><br>You can define a specific time frame of interest. If you do not specify a time frame, this endpoint will search the historical dataset that is available to your account. You may also filter results by port and transport protocol.<br><br>This endpoint is available to organizations that have access to the Threat Hunting module. It costs 5 credits per page of results.
|
|
33
|
+
*/
|
|
34
|
+
export function threatHuntingGetHostObservationsWithCertificate(
|
|
35
|
+
client: SDKCore,
|
|
36
|
+
request: operations.V3ThreathuntingGetHostObservationsWithCertificateRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.V3ThreathuntingGetHostObservationsWithCertificateResponse,
|
|
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.V3ThreathuntingGetHostObservationsWithCertificateRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.V3ThreathuntingGetHostObservationsWithCertificateResponse,
|
|
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
|
|
84
|
+
.V3ThreathuntingGetHostObservationsWithCertificateRequest$outboundSchema
|
|
85
|
+
.parse(value),
|
|
86
|
+
"Input validation failed",
|
|
87
|
+
);
|
|
88
|
+
if (!parsed.ok) {
|
|
89
|
+
return [parsed, { status: "invalid" }];
|
|
90
|
+
}
|
|
91
|
+
const payload = parsed.value;
|
|
92
|
+
const body = null;
|
|
93
|
+
|
|
94
|
+
const pathParams = {
|
|
95
|
+
certificate_id: encodeSimple("certificate_id", payload.certificate_id, {
|
|
96
|
+
explode: false,
|
|
97
|
+
charEncoding: "percent",
|
|
98
|
+
}),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const path = pathToFunc(
|
|
102
|
+
"/v3/threat-hunting/certificate/{certificate_id}/observations/hosts",
|
|
103
|
+
)(pathParams);
|
|
104
|
+
|
|
105
|
+
const query = encodeFormQuery({
|
|
106
|
+
"end_time": payload.end_time,
|
|
107
|
+
"organization_id": payload.organization_id
|
|
108
|
+
?? client._options.organizationId,
|
|
109
|
+
"page_size": payload.page_size,
|
|
110
|
+
"page_token": payload.page_token,
|
|
111
|
+
"port": payload.port,
|
|
112
|
+
"protocol": payload.protocol,
|
|
113
|
+
"start_time": payload.start_time,
|
|
114
|
+
}, { explode: false });
|
|
115
|
+
|
|
116
|
+
const headers = new Headers(compactMap({
|
|
117
|
+
Accept: "application/json",
|
|
118
|
+
}));
|
|
119
|
+
|
|
120
|
+
const secConfig = await extractSecurity(client._options.personalAccessToken);
|
|
121
|
+
const securityInput = secConfig == null
|
|
122
|
+
? {}
|
|
123
|
+
: { personalAccessToken: secConfig };
|
|
124
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
125
|
+
|
|
126
|
+
const context = {
|
|
127
|
+
options: client._options,
|
|
128
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
129
|
+
operationID: "v3-threathunting-get-host-observations-with-certificate",
|
|
130
|
+
oAuth2Scopes: [],
|
|
131
|
+
|
|
132
|
+
resolvedSecurity: requestSecurity,
|
|
133
|
+
|
|
134
|
+
securitySource: client._options.personalAccessToken,
|
|
135
|
+
retryConfig: options?.retries
|
|
136
|
+
|| client._options.retryConfig
|
|
137
|
+
|| { strategy: "none" },
|
|
138
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const requestRes = client._createRequest(context, {
|
|
142
|
+
security: requestSecurity,
|
|
143
|
+
method: "GET",
|
|
144
|
+
baseURL: options?.serverURL,
|
|
145
|
+
path: path,
|
|
146
|
+
headers: headers,
|
|
147
|
+
query: query,
|
|
148
|
+
body: body,
|
|
149
|
+
userAgent: client._options.userAgent,
|
|
150
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
151
|
+
}, options);
|
|
152
|
+
if (!requestRes.ok) {
|
|
153
|
+
return [requestRes, { status: "invalid" }];
|
|
154
|
+
}
|
|
155
|
+
const req = requestRes.value;
|
|
156
|
+
|
|
157
|
+
const doResult = await client._do(req, {
|
|
158
|
+
context,
|
|
159
|
+
errorCodes: ["401", "403", "4XX", "5XX"],
|
|
160
|
+
retryConfig: context.retryConfig,
|
|
161
|
+
retryCodes: context.retryCodes,
|
|
162
|
+
});
|
|
163
|
+
if (!doResult.ok) {
|
|
164
|
+
return [doResult, { status: "request-error", request: req }];
|
|
165
|
+
}
|
|
166
|
+
const response = doResult.value;
|
|
167
|
+
|
|
168
|
+
const responseFields = {
|
|
169
|
+
HttpMeta: { Response: response, Request: req },
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const [result] = await M.match<
|
|
173
|
+
operations.V3ThreathuntingGetHostObservationsWithCertificateResponse,
|
|
174
|
+
| errors.ErrorModel
|
|
175
|
+
| SDKBaseError
|
|
176
|
+
| ResponseValidationError
|
|
177
|
+
| ConnectionError
|
|
178
|
+
| RequestAbortedError
|
|
179
|
+
| RequestTimeoutError
|
|
180
|
+
| InvalidRequestError
|
|
181
|
+
| UnexpectedClientError
|
|
182
|
+
| SDKValidationError
|
|
183
|
+
>(
|
|
184
|
+
M.json(
|
|
185
|
+
200,
|
|
186
|
+
operations
|
|
187
|
+
.V3ThreathuntingGetHostObservationsWithCertificateResponse$inboundSchema,
|
|
188
|
+
{ hdrs: true, key: "Result" },
|
|
189
|
+
),
|
|
190
|
+
M.jsonErr([401, 403], errors.ErrorModel$inboundSchema, {
|
|
191
|
+
ctype: "application/problem+json",
|
|
192
|
+
}),
|
|
193
|
+
M.fail("4XX"),
|
|
194
|
+
M.fail("5XX"),
|
|
195
|
+
)(response, req, { extraFields: responseFields });
|
|
196
|
+
if (!result.ok) {
|
|
197
|
+
return [result, { status: "complete", request: req, response }];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return [result, { status: "complete", request: req, response }];
|
|
201
|
+
}
|
|
@@ -26,13 +26,12 @@ 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
|
-
export function
|
|
34
|
+
export function threatHuntingGetTrackedScanThreatHunting(
|
|
36
35
|
client: SDKCore,
|
|
37
36
|
request: operations.V3ThreathuntingScansGetRequest,
|
|
38
37
|
options?: RequestOptions,
|
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.
|
|
70
|
-
genVersion: "2.
|
|
68
|
+
openapiDocVersion: "1.0.35",
|
|
69
|
+
sdkVersion: "0.6.0",
|
|
70
|
+
genVersion: "2.690.1",
|
|
71
71
|
userAgent:
|
|
72
|
-
"speakeasy-sdk/typescript 0.
|
|
72
|
+
"speakeasy-sdk/typescript 0.6.0 2.690.1 1.0.35 @censys/platform-sdk",
|
|
73
73
|
} as const;
|
package/src/lib/security.ts
CHANGED
|
@@ -83,7 +83,10 @@ type SecurityInputOAuth2 = {
|
|
|
83
83
|
type SecurityInputOAuth2ClientCredentials = {
|
|
84
84
|
type: "oauth2:client_credentials";
|
|
85
85
|
value:
|
|
86
|
-
| {
|
|
86
|
+
| {
|
|
87
|
+
clientID?: string | undefined;
|
|
88
|
+
clientSecret?: string | undefined;
|
|
89
|
+
}
|
|
87
90
|
| null
|
|
88
91
|
| string
|
|
89
92
|
| undefined;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export const Targets = {
|
|
12
|
+
Host: "host",
|
|
13
|
+
Web: "web",
|
|
14
|
+
Cert: "cert",
|
|
15
|
+
Unknown: "unknown",
|
|
16
|
+
} as const;
|
|
17
|
+
export type Targets = ClosedEnum<typeof Targets>;
|
|
18
|
+
|
|
19
|
+
export type AlternativeQuery = {
|
|
20
|
+
/**
|
|
21
|
+
* An alternative query that may be used.
|
|
22
|
+
*/
|
|
23
|
+
query: string;
|
|
24
|
+
/**
|
|
25
|
+
* The types of Platform data records (host, cert, and web) that can be targeted by the alternative query.
|
|
26
|
+
*/
|
|
27
|
+
targets: Array<Targets> | null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const Targets$inboundSchema: z.ZodNativeEnum<typeof Targets> = z
|
|
32
|
+
.nativeEnum(Targets);
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const Targets$outboundSchema: z.ZodNativeEnum<typeof Targets> =
|
|
36
|
+
Targets$inboundSchema;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
41
|
+
*/
|
|
42
|
+
export namespace Targets$ {
|
|
43
|
+
/** @deprecated use `Targets$inboundSchema` instead. */
|
|
44
|
+
export const inboundSchema = Targets$inboundSchema;
|
|
45
|
+
/** @deprecated use `Targets$outboundSchema` instead. */
|
|
46
|
+
export const outboundSchema = Targets$outboundSchema;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const AlternativeQuery$inboundSchema: z.ZodType<
|
|
51
|
+
AlternativeQuery,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
unknown
|
|
54
|
+
> = z.object({
|
|
55
|
+
query: z.string(),
|
|
56
|
+
targets: z.nullable(z.array(Targets$inboundSchema)),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export type AlternativeQuery$Outbound = {
|
|
61
|
+
query: string;
|
|
62
|
+
targets: Array<string> | null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const AlternativeQuery$outboundSchema: z.ZodType<
|
|
67
|
+
AlternativeQuery$Outbound,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
AlternativeQuery
|
|
70
|
+
> = z.object({
|
|
71
|
+
query: z.string(),
|
|
72
|
+
targets: z.nullable(z.array(Targets$outboundSchema)),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
78
|
+
*/
|
|
79
|
+
export namespace AlternativeQuery$ {
|
|
80
|
+
/** @deprecated use `AlternativeQuery$inboundSchema` instead. */
|
|
81
|
+
export const inboundSchema = AlternativeQuery$inboundSchema;
|
|
82
|
+
/** @deprecated use `AlternativeQuery$outboundSchema` instead. */
|
|
83
|
+
export const outboundSchema = AlternativeQuery$outboundSchema;
|
|
84
|
+
/** @deprecated use `AlternativeQuery$Outbound` instead. */
|
|
85
|
+
export type Outbound = AlternativeQuery$Outbound;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function alternativeQueryToJSON(
|
|
89
|
+
alternativeQuery: AlternativeQuery,
|
|
90
|
+
): string {
|
|
91
|
+
return JSON.stringify(
|
|
92
|
+
AlternativeQuery$outboundSchema.parse(alternativeQuery),
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function alternativeQueryFromJSON(
|
|
97
|
+
jsonString: string,
|
|
98
|
+
): SafeParseResult<AlternativeQuery, SDKValidationError> {
|
|
99
|
+
return safeParse(
|
|
100
|
+
jsonString,
|
|
101
|
+
(x) => AlternativeQuery$inboundSchema.parse(JSON.parse(x)),
|
|
102
|
+
`Failed to parse 'AlternativeQuery' from JSON`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type AssetCertificateListInputBody = {
|
|
12
|
+
/**
|
|
13
|
+
* A list of SHA-256 certificate fingerprints.
|
|
14
|
+
*/
|
|
15
|
+
certificateIds: Array<string> | null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const AssetCertificateListInputBody$inboundSchema: z.ZodType<
|
|
20
|
+
AssetCertificateListInputBody,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
certificate_ids: z.nullable(z.array(z.string())),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"certificate_ids": "certificateIds",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type AssetCertificateListInputBody$Outbound = {
|
|
33
|
+
certificate_ids: Array<string> | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const AssetCertificateListInputBody$outboundSchema: z.ZodType<
|
|
38
|
+
AssetCertificateListInputBody$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
AssetCertificateListInputBody
|
|
41
|
+
> = z.object({
|
|
42
|
+
certificateIds: z.nullable(z.array(z.string())),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
certificateIds: "certificate_ids",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace AssetCertificateListInputBody$ {
|
|
54
|
+
/** @deprecated use `AssetCertificateListInputBody$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = AssetCertificateListInputBody$inboundSchema;
|
|
56
|
+
/** @deprecated use `AssetCertificateListInputBody$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = AssetCertificateListInputBody$outboundSchema;
|
|
58
|
+
/** @deprecated use `AssetCertificateListInputBody$Outbound` instead. */
|
|
59
|
+
export type Outbound = AssetCertificateListInputBody$Outbound;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function assetCertificateListInputBodyToJSON(
|
|
63
|
+
assetCertificateListInputBody: AssetCertificateListInputBody,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
AssetCertificateListInputBody$outboundSchema.parse(
|
|
67
|
+
assetCertificateListInputBody,
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function assetCertificateListInputBodyFromJSON(
|
|
73
|
+
jsonString: string,
|
|
74
|
+
): SafeParseResult<AssetCertificateListInputBody, SDKValidationError> {
|
|
75
|
+
return safeParse(
|
|
76
|
+
jsonString,
|
|
77
|
+
(x) => AssetCertificateListInputBody$inboundSchema.parse(JSON.parse(x)),
|
|
78
|
+
`Failed to parse 'AssetCertificateListInputBody' from JSON`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type AssetHostListInputBody = {
|
|
12
|
+
/**
|
|
13
|
+
* A list of host IP addresses.
|
|
14
|
+
*/
|
|
15
|
+
hostIds: Array<string> | null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const AssetHostListInputBody$inboundSchema: z.ZodType<
|
|
20
|
+
AssetHostListInputBody,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
host_ids: z.nullable(z.array(z.string())),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"host_ids": "hostIds",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type AssetHostListInputBody$Outbound = {
|
|
33
|
+
host_ids: Array<string> | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const AssetHostListInputBody$outboundSchema: z.ZodType<
|
|
38
|
+
AssetHostListInputBody$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
AssetHostListInputBody
|
|
41
|
+
> = z.object({
|
|
42
|
+
hostIds: z.nullable(z.array(z.string())),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
hostIds: "host_ids",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace AssetHostListInputBody$ {
|
|
54
|
+
/** @deprecated use `AssetHostListInputBody$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = AssetHostListInputBody$inboundSchema;
|
|
56
|
+
/** @deprecated use `AssetHostListInputBody$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = AssetHostListInputBody$outboundSchema;
|
|
58
|
+
/** @deprecated use `AssetHostListInputBody$Outbound` instead. */
|
|
59
|
+
export type Outbound = AssetHostListInputBody$Outbound;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function assetHostListInputBodyToJSON(
|
|
63
|
+
assetHostListInputBody: AssetHostListInputBody,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
AssetHostListInputBody$outboundSchema.parse(assetHostListInputBody),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function assetHostListInputBodyFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<AssetHostListInputBody, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => AssetHostListInputBody$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'AssetHostListInputBody' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type AssetWebpropertyListInputBody = {
|
|
12
|
+
/**
|
|
13
|
+
* A list of web property identifiers.
|
|
14
|
+
*/
|
|
15
|
+
webpropertyIds: Array<string> | null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const AssetWebpropertyListInputBody$inboundSchema: z.ZodType<
|
|
20
|
+
AssetWebpropertyListInputBody,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
webproperty_ids: z.nullable(z.array(z.string())),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"webproperty_ids": "webpropertyIds",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type AssetWebpropertyListInputBody$Outbound = {
|
|
33
|
+
webproperty_ids: Array<string> | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const AssetWebpropertyListInputBody$outboundSchema: z.ZodType<
|
|
38
|
+
AssetWebpropertyListInputBody$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
AssetWebpropertyListInputBody
|
|
41
|
+
> = z.object({
|
|
42
|
+
webpropertyIds: z.nullable(z.array(z.string())),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
webpropertyIds: "webproperty_ids",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace AssetWebpropertyListInputBody$ {
|
|
54
|
+
/** @deprecated use `AssetWebpropertyListInputBody$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = AssetWebpropertyListInputBody$inboundSchema;
|
|
56
|
+
/** @deprecated use `AssetWebpropertyListInputBody$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = AssetWebpropertyListInputBody$outboundSchema;
|
|
58
|
+
/** @deprecated use `AssetWebpropertyListInputBody$Outbound` instead. */
|
|
59
|
+
export type Outbound = AssetWebpropertyListInputBody$Outbound;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function assetWebpropertyListInputBodyToJSON(
|
|
63
|
+
assetWebpropertyListInputBody: AssetWebpropertyListInputBody,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
AssetWebpropertyListInputBody$outboundSchema.parse(
|
|
67
|
+
assetWebpropertyListInputBody,
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function assetWebpropertyListInputBodyFromJSON(
|
|
73
|
+
jsonString: string,
|
|
74
|
+
): SafeParseResult<AssetWebpropertyListInputBody, SDKValidationError> {
|
|
75
|
+
return safeParse(
|
|
76
|
+
jsonString,
|
|
77
|
+
(x) => AssetWebpropertyListInputBody$inboundSchema.parse(JSON.parse(x)),
|
|
78
|
+
`Failed to parse 'AssetWebpropertyListInputBody' from JSON`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type AsteriskManagerInterface = {
|
|
11
|
+
version?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const AsteriskManagerInterface$inboundSchema: z.ZodType<
|
|
16
|
+
AsteriskManagerInterface,
|
|
17
|
+
z.ZodTypeDef,
|
|
18
|
+
unknown
|
|
19
|
+
> = z.object({
|
|
20
|
+
version: z.string().optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type AsteriskManagerInterface$Outbound = {
|
|
25
|
+
version?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const AsteriskManagerInterface$outboundSchema: z.ZodType<
|
|
30
|
+
AsteriskManagerInterface$Outbound,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
AsteriskManagerInterface
|
|
33
|
+
> = z.object({
|
|
34
|
+
version: z.string().optional(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
40
|
+
*/
|
|
41
|
+
export namespace AsteriskManagerInterface$ {
|
|
42
|
+
/** @deprecated use `AsteriskManagerInterface$inboundSchema` instead. */
|
|
43
|
+
export const inboundSchema = AsteriskManagerInterface$inboundSchema;
|
|
44
|
+
/** @deprecated use `AsteriskManagerInterface$outboundSchema` instead. */
|
|
45
|
+
export const outboundSchema = AsteriskManagerInterface$outboundSchema;
|
|
46
|
+
/** @deprecated use `AsteriskManagerInterface$Outbound` instead. */
|
|
47
|
+
export type Outbound = AsteriskManagerInterface$Outbound;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function asteriskManagerInterfaceToJSON(
|
|
51
|
+
asteriskManagerInterface: AsteriskManagerInterface,
|
|
52
|
+
): string {
|
|
53
|
+
return JSON.stringify(
|
|
54
|
+
AsteriskManagerInterface$outboundSchema.parse(asteriskManagerInterface),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function asteriskManagerInterfaceFromJSON(
|
|
59
|
+
jsonString: string,
|
|
60
|
+
): SafeParseResult<AsteriskManagerInterface, SDKValidationError> {
|
|
61
|
+
return safeParse(
|
|
62
|
+
jsonString,
|
|
63
|
+
(x) => AsteriskManagerInterface$inboundSchema.parse(JSON.parse(x)),
|
|
64
|
+
`Failed to parse 'AsteriskManagerInterface' from JSON`,
|
|
65
|
+
);
|
|
66
|
+
}
|