@detectant-api/sdk 0.0.1 → 0.0.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 +111 -0
- package/dist/cjs/BaseClient.d.ts +54 -0
- package/dist/cjs/BaseClient.js +77 -0
- package/dist/cjs/Client.d.ts +86 -0
- package/dist/cjs/Client.js +255 -0
- package/dist/cjs/api/client/index.d.ts +1 -0
- package/dist/cjs/api/client/index.js +17 -0
- package/dist/cjs/api/client/requests/CreateScanBatchRequest.d.ts +5 -0
- package/dist/cjs/api/client/requests/CreateScanBatchRequest.js +3 -0
- package/dist/cjs/api/client/requests/CreateScanRequest.d.ts +5 -0
- package/dist/cjs/api/client/requests/CreateScanRequest.js +3 -0
- package/dist/cjs/api/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/client/requests/index.js +2 -0
- package/dist/cjs/api/errors/BadRequestError.d.ts +7 -0
- package/dist/cjs/api/errors/BadRequestError.js +54 -0
- package/dist/cjs/api/errors/ContentTooLargeError.d.ts +7 -0
- package/dist/cjs/api/errors/ContentTooLargeError.js +54 -0
- package/dist/cjs/api/errors/ForbiddenError.d.ts +7 -0
- package/dist/cjs/api/errors/ForbiddenError.js +54 -0
- package/dist/cjs/api/errors/InternalServerError.d.ts +7 -0
- package/dist/cjs/api/errors/InternalServerError.js +54 -0
- package/dist/cjs/api/errors/NotFoundError.d.ts +7 -0
- package/dist/cjs/api/errors/NotFoundError.js +54 -0
- package/dist/cjs/api/errors/ServiceUnavailableError.d.ts +5 -0
- package/dist/cjs/api/errors/ServiceUnavailableError.js +54 -0
- package/dist/cjs/api/errors/TooManyRequestsError.d.ts +7 -0
- package/dist/cjs/api/errors/TooManyRequestsError.js +54 -0
- package/dist/cjs/api/errors/UnauthorizedError.d.ts +7 -0
- package/dist/cjs/api/errors/UnauthorizedError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +8 -0
- package/dist/cjs/api/errors/index.js +24 -0
- package/dist/cjs/api/index.d.ts +4 -0
- package/dist/cjs/api/index.js +20 -0
- package/dist/cjs/api/resources/health/client/Client.d.ts +43 -0
- package/dist/cjs/api/resources/health/client/Client.js +152 -0
- package/dist/cjs/api/resources/health/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/health/client/index.js +2 -0
- package/dist/cjs/api/resources/health/exports.d.ts +2 -0
- package/dist/cjs/api/resources/health/exports.js +21 -0
- package/dist/cjs/api/resources/health/index.d.ts +1 -0
- package/dist/cjs/api/resources/health/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +42 -0
- package/dist/cjs/api/resources/scans/client/Client.d.ts +54 -0
- package/dist/cjs/api/resources/scans/client/Client.js +196 -0
- package/dist/cjs/api/resources/scans/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/scans/client/index.js +17 -0
- package/dist/cjs/api/resources/scans/client/requests/GetScanRequest.d.ts +10 -0
- package/dist/cjs/api/resources/scans/client/requests/GetScanRequest.js +3 -0
- package/dist/cjs/api/resources/scans/client/requests/ListScansRequest.d.ts +18 -0
- package/dist/cjs/api/resources/scans/client/requests/ListScansRequest.js +3 -0
- package/dist/cjs/api/resources/scans/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/scans/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/scans/exports.d.ts +2 -0
- package/dist/cjs/api/resources/scans/exports.js +21 -0
- package/dist/cjs/api/resources/scans/index.d.ts +1 -0
- package/dist/cjs/api/resources/scans/index.js +17 -0
- package/dist/cjs/api/types/ApiError.d.ts +8 -0
- package/dist/cjs/api/types/ApiError.js +3 -0
- package/dist/cjs/api/types/ErrorResponse.d.ts +4 -0
- package/dist/cjs/api/types/ErrorResponse.js +3 -0
- package/dist/cjs/api/types/HealthResponse.d.ts +10 -0
- package/dist/cjs/api/types/HealthResponse.js +11 -0
- package/dist/cjs/api/types/Scan.d.ts +32 -0
- package/dist/cjs/api/types/Scan.js +17 -0
- package/dist/cjs/api/types/ScanBatchResponse.d.ts +5 -0
- package/dist/cjs/api/types/ScanBatchResponse.js +3 -0
- package/dist/cjs/api/types/ScanBatchResult.d.ts +13 -0
- package/dist/cjs/api/types/ScanBatchResult.js +3 -0
- package/dist/cjs/api/types/ScanFailure.d.ts +11 -0
- package/dist/cjs/api/types/ScanFailure.js +11 -0
- package/dist/cjs/api/types/ScanList.d.ts +7 -0
- package/dist/cjs/api/types/ScanList.js +3 -0
- package/dist/cjs/api/types/TypeAnalysis.d.ts +26 -0
- package/dist/cjs/api/types/TypeAnalysis.js +20 -0
- package/dist/cjs/api/types/TypeAnalysisReason.d.ts +13 -0
- package/dist/cjs/api/types/TypeAnalysisReason.js +12 -0
- package/dist/cjs/api/types/TypeDeclaration.d.ts +6 -0
- package/dist/cjs/api/types/TypeDeclaration.js +3 -0
- package/dist/cjs/api/types/TypeIdentification.d.ts +6 -0
- package/dist/cjs/api/types/TypeIdentification.js +3 -0
- package/dist/cjs/api/types/index.d.ts +12 -0
- package/dist/cjs/api/types/index.js +28 -0
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +20 -0
- package/dist/cjs/auth/HeaderAuthProvider.js +80 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +8 -0
- package/dist/cjs/core/auth/AuthProvider.js +9 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +33 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +11 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/exports.d.ts +2 -0
- package/dist/cjs/core/exports.js +18 -0
- package/dist/cjs/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/cjs/core/fetcher/APIResponse.js +2 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/cjs/core/fetcher/BinaryResponse.js +17 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +56 -0
- package/dist/cjs/core/fetcher/Fetcher.js +244 -0
- package/dist/cjs/core/fetcher/Headers.d.ts +2 -0
- package/dist/cjs/core/fetcher/Headers.js +84 -0
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/cjs/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/cjs/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/cjs/core/fetcher/RawResponse.js +44 -0
- package/dist/cjs/core/fetcher/Supplier.d.ts +4 -0
- package/dist/cjs/core/fetcher/Supplier.js +22 -0
- package/dist/cjs/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/cjs/core/fetcher/createRequestUrl.js +8 -0
- package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +45 -0
- package/dist/cjs/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/cjs/core/fetcher/getFetchFn.js +17 -0
- package/dist/cjs/core/fetcher/getHeader.d.ts +1 -0
- package/dist/cjs/core/fetcher/getHeader.js +11 -0
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/cjs/core/fetcher/getRequestBody.js +27 -0
- package/dist/cjs/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +80 -0
- package/dist/cjs/core/fetcher/index.d.ts +13 -0
- package/dist/cjs/core/fetcher/index.js +19 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +157 -0
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -0
- package/dist/cjs/core/fetcher/makeRequest.js +61 -0
- package/dist/cjs/core/fetcher/redactUrl.d.ts +2 -0
- package/dist/cjs/core/fetcher/redactUrl.js +88 -0
- package/dist/cjs/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/cjs/core/fetcher/requestWithRetries.js +70 -0
- package/dist/cjs/core/fetcher/signals.d.ts +5 -0
- package/dist/cjs/core/fetcher/signals.js +32 -0
- package/dist/cjs/core/file/exports.d.ts +1 -0
- package/dist/cjs/core/file/exports.js +2 -0
- package/dist/cjs/core/file/file.d.ts +10 -0
- package/dist/cjs/core/file/file.js +225 -0
- package/dist/cjs/core/file/index.d.ts +2 -0
- package/dist/cjs/core/file/index.js +18 -0
- package/dist/cjs/core/file/types.d.ts +66 -0
- package/dist/cjs/core/file/types.js +2 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.js +188 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/cjs/core/form-data-utils/index.d.ts +2 -0
- package/dist/cjs/core/form-data-utils/index.js +20 -0
- package/dist/cjs/core/headers.d.ts +2 -0
- package/dist/cjs/core/headers.js +31 -0
- package/dist/cjs/core/index.d.ts +8 -0
- package/dist/cjs/core/index.js +47 -0
- package/dist/cjs/core/json.d.ts +15 -0
- package/dist/cjs/core/json.js +24 -0
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/requestBody.d.ts +12 -0
- package/dist/cjs/core/requestBody.js +26 -0
- package/dist/cjs/core/runtime/index.d.ts +1 -0
- package/dist/cjs/core/runtime/index.js +6 -0
- package/dist/cjs/core/runtime/runtime.d.ts +28 -0
- package/dist/cjs/core/runtime/runtime.js +176 -0
- package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
- package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
- package/dist/cjs/core/url/encodePathParam.js +21 -0
- package/dist/cjs/core/url/index.d.ts +4 -0
- package/dist/cjs/core/url/index.js +11 -0
- package/dist/cjs/core/url/join.d.ts +1 -0
- package/dist/cjs/core/url/join.js +68 -0
- package/dist/cjs/core/url/qs.d.ts +7 -0
- package/dist/cjs/core/url/qs.js +76 -0
- package/dist/cjs/environments.d.ts +4 -0
- package/dist/cjs/environments.js +7 -0
- package/dist/cjs/errors/DetectantApiError.d.ts +15 -0
- package/dist/cjs/errors/DetectantApiError.js +39 -0
- package/dist/cjs/errors/DetectantApiTimeoutError.d.ts +6 -0
- package/dist/cjs/errors/DetectantApiTimeoutError.js +52 -0
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +68 -0
- package/dist/cjs/errors/index.d.ts +2 -0
- package/dist/cjs/errors/index.js +7 -0
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +48 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +4 -0
- package/dist/esm/BaseClient.d.mts +54 -0
- package/dist/esm/BaseClient.mjs +40 -0
- package/dist/esm/Client.d.mts +86 -0
- package/dist/esm/Client.mjs +218 -0
- package/dist/esm/api/client/index.d.mts +1 -0
- package/dist/esm/api/client/index.mjs +1 -0
- package/dist/esm/api/client/requests/CreateScanBatchRequest.d.mts +5 -0
- package/dist/esm/api/client/requests/CreateScanBatchRequest.mjs +2 -0
- package/dist/esm/api/client/requests/CreateScanRequest.d.mts +5 -0
- package/dist/esm/api/client/requests/CreateScanRequest.mjs +2 -0
- package/dist/esm/api/client/requests/index.d.mts +2 -0
- package/dist/esm/api/client/requests/index.mjs +1 -0
- package/dist/esm/api/errors/BadRequestError.d.mts +7 -0
- package/dist/esm/api/errors/BadRequestError.mjs +17 -0
- package/dist/esm/api/errors/ContentTooLargeError.d.mts +7 -0
- package/dist/esm/api/errors/ContentTooLargeError.mjs +17 -0
- package/dist/esm/api/errors/ForbiddenError.d.mts +7 -0
- package/dist/esm/api/errors/ForbiddenError.mjs +17 -0
- package/dist/esm/api/errors/InternalServerError.d.mts +7 -0
- package/dist/esm/api/errors/InternalServerError.mjs +17 -0
- package/dist/esm/api/errors/NotFoundError.d.mts +7 -0
- package/dist/esm/api/errors/NotFoundError.mjs +17 -0
- package/dist/esm/api/errors/ServiceUnavailableError.d.mts +5 -0
- package/dist/esm/api/errors/ServiceUnavailableError.mjs +17 -0
- package/dist/esm/api/errors/TooManyRequestsError.d.mts +7 -0
- package/dist/esm/api/errors/TooManyRequestsError.mjs +17 -0
- package/dist/esm/api/errors/UnauthorizedError.d.mts +7 -0
- package/dist/esm/api/errors/UnauthorizedError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +8 -0
- package/dist/esm/api/errors/index.mjs +8 -0
- package/dist/esm/api/index.d.mts +4 -0
- package/dist/esm/api/index.mjs +4 -0
- package/dist/esm/api/resources/health/client/Client.d.mts +43 -0
- package/dist/esm/api/resources/health/client/Client.mjs +115 -0
- package/dist/esm/api/resources/health/client/index.d.mts +1 -0
- package/dist/esm/api/resources/health/client/index.mjs +1 -0
- package/dist/esm/api/resources/health/exports.d.mts +2 -0
- package/dist/esm/api/resources/health/exports.mjs +3 -0
- package/dist/esm/api/resources/health/index.d.mts +1 -0
- package/dist/esm/api/resources/health/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/scans/client/Client.d.mts +54 -0
- package/dist/esm/api/resources/scans/client/Client.mjs +159 -0
- package/dist/esm/api/resources/scans/client/index.d.mts +1 -0
- package/dist/esm/api/resources/scans/client/index.mjs +1 -0
- package/dist/esm/api/resources/scans/client/requests/GetScanRequest.d.mts +10 -0
- package/dist/esm/api/resources/scans/client/requests/GetScanRequest.mjs +2 -0
- package/dist/esm/api/resources/scans/client/requests/ListScansRequest.d.mts +18 -0
- package/dist/esm/api/resources/scans/client/requests/ListScansRequest.mjs +2 -0
- package/dist/esm/api/resources/scans/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/scans/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/scans/exports.d.mts +2 -0
- package/dist/esm/api/resources/scans/exports.mjs +3 -0
- package/dist/esm/api/resources/scans/index.d.mts +1 -0
- package/dist/esm/api/resources/scans/index.mjs +1 -0
- package/dist/esm/api/types/ApiError.d.mts +8 -0
- package/dist/esm/api/types/ApiError.mjs +2 -0
- package/dist/esm/api/types/ErrorResponse.d.mts +4 -0
- package/dist/esm/api/types/ErrorResponse.mjs +2 -0
- package/dist/esm/api/types/HealthResponse.d.mts +10 -0
- package/dist/esm/api/types/HealthResponse.mjs +8 -0
- package/dist/esm/api/types/Scan.d.mts +32 -0
- package/dist/esm/api/types/Scan.mjs +14 -0
- package/dist/esm/api/types/ScanBatchResponse.d.mts +5 -0
- package/dist/esm/api/types/ScanBatchResponse.mjs +2 -0
- package/dist/esm/api/types/ScanBatchResult.d.mts +13 -0
- package/dist/esm/api/types/ScanBatchResult.mjs +2 -0
- package/dist/esm/api/types/ScanFailure.d.mts +11 -0
- package/dist/esm/api/types/ScanFailure.mjs +8 -0
- package/dist/esm/api/types/ScanList.d.mts +7 -0
- package/dist/esm/api/types/ScanList.mjs +2 -0
- package/dist/esm/api/types/TypeAnalysis.d.mts +26 -0
- package/dist/esm/api/types/TypeAnalysis.mjs +17 -0
- package/dist/esm/api/types/TypeAnalysisReason.d.mts +13 -0
- package/dist/esm/api/types/TypeAnalysisReason.mjs +9 -0
- package/dist/esm/api/types/TypeDeclaration.d.mts +6 -0
- package/dist/esm/api/types/TypeDeclaration.mjs +2 -0
- package/dist/esm/api/types/TypeIdentification.d.mts +6 -0
- package/dist/esm/api/types/TypeIdentification.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +12 -0
- package/dist/esm/api/types/index.mjs +12 -0
- package/dist/esm/auth/HeaderAuthProvider.d.mts +20 -0
- package/dist/esm/auth/HeaderAuthProvider.mjs +43 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +8 -0
- package/dist/esm/core/auth/AuthProvider.mjs +6 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +30 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +4 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/exports.d.mts +2 -0
- package/dist/esm/core/exports.mjs +2 -0
- package/dist/esm/core/fetcher/APIResponse.d.mts +20 -0
- package/dist/esm/core/fetcher/APIResponse.mjs +1 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +19 -0
- package/dist/esm/core/fetcher/BinaryResponse.mjs +14 -0
- package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
- package/dist/esm/core/fetcher/EndpointMetadata.mjs +1 -0
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +56 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +240 -0
- package/dist/esm/core/fetcher/Headers.d.mts +2 -0
- package/dist/esm/core/fetcher/Headers.mjs +82 -0
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +58 -0
- package/dist/esm/core/fetcher/HttpResponsePromise.mjs +99 -0
- package/dist/esm/core/fetcher/RawResponse.d.mts +29 -0
- package/dist/esm/core/fetcher/RawResponse.mjs +40 -0
- package/dist/esm/core/fetcher/Supplier.d.mts +4 -0
- package/dist/esm/core/fetcher/Supplier.mjs +19 -0
- package/dist/esm/core/fetcher/createRequestUrl.d.mts +1 -0
- package/dist/esm/core/fetcher/createRequestUrl.mjs +5 -0
- package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +1 -0
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +42 -0
- package/dist/esm/core/fetcher/getFetchFn.d.mts +1 -0
- package/dist/esm/core/fetcher/getFetchFn.mjs +14 -0
- package/dist/esm/core/fetcher/getHeader.d.mts +1 -0
- package/dist/esm/core/fetcher/getHeader.mjs +8 -0
- package/dist/esm/core/fetcher/getRequestBody.d.mts +7 -0
- package/dist/esm/core/fetcher/getRequestBody.mjs +24 -0
- package/dist/esm/core/fetcher/getResponseBody.d.mts +1 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +77 -0
- package/dist/esm/core/fetcher/index.d.mts +13 -0
- package/dist/esm/core/fetcher/index.mjs +7 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +154 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -0
- package/dist/esm/core/fetcher/makeRequest.mjs +55 -0
- package/dist/esm/core/fetcher/redactUrl.d.mts +2 -0
- package/dist/esm/core/fetcher/redactUrl.mjs +84 -0
- package/dist/esm/core/fetcher/requestWithRetries.d.mts +1 -0
- package/dist/esm/core/fetcher/requestWithRetries.mjs +67 -0
- package/dist/esm/core/fetcher/signals.d.mts +5 -0
- package/dist/esm/core/fetcher/signals.mjs +28 -0
- package/dist/esm/core/file/exports.d.mts +1 -0
- package/dist/esm/core/file/exports.mjs +1 -0
- package/dist/esm/core/file/file.d.mts +10 -0
- package/dist/esm/core/file/file.mjs +188 -0
- package/dist/esm/core/file/index.d.mts +2 -0
- package/dist/esm/core/file/index.mjs +2 -0
- package/dist/esm/core/file/types.d.mts +66 -0
- package/dist/esm/core/file/types.mjs +1 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +150 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
- package/dist/esm/core/form-data-utils/index.d.mts +2 -0
- package/dist/esm/core/form-data-utils/index.mjs +2 -0
- package/dist/esm/core/headers.d.mts +2 -0
- package/dist/esm/core/headers.mjs +27 -0
- package/dist/esm/core/index.d.mts +8 -0
- package/dist/esm/core/index.mjs +8 -0
- package/dist/esm/core/json.d.mts +15 -0
- package/dist/esm/core/json.mjs +19 -0
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/requestBody.d.mts +12 -0
- package/dist/esm/core/requestBody.mjs +23 -0
- package/dist/esm/core/runtime/index.d.mts +1 -0
- package/dist/esm/core/runtime/index.mjs +1 -0
- package/dist/esm/core/runtime/runtime.d.mts +28 -0
- package/dist/esm/core/runtime/runtime.mjs +172 -0
- package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
- package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
- package/dist/esm/core/url/encodePathParam.d.mts +1 -0
- package/dist/esm/core/url/encodePathParam.mjs +18 -0
- package/dist/esm/core/url/index.d.mts +4 -0
- package/dist/esm/core/url/index.mjs +4 -0
- package/dist/esm/core/url/join.d.mts +1 -0
- package/dist/esm/core/url/join.mjs +65 -0
- package/dist/esm/core/url/qs.d.mts +7 -0
- package/dist/esm/core/url/qs.mjs +73 -0
- package/dist/esm/environments.d.mts +4 -0
- package/dist/esm/environments.mjs +4 -0
- package/dist/esm/errors/DetectantApiError.d.mts +15 -0
- package/dist/esm/errors/DetectantApiError.mjs +35 -0
- package/dist/esm/errors/DetectantApiTimeoutError.d.mts +6 -0
- package/dist/esm/errors/DetectantApiTimeoutError.mjs +15 -0
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +32 -0
- package/dist/esm/errors/index.d.mts +2 -0
- package/dist/esm/errors/index.mjs +2 -0
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +6 -0
- package/dist/esm/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -0
- package/dist/esm/version.mjs +1 -0
- package/package.json +91 -1
- package/reference.md +380 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptions } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as DetectantApi from "../../../index.mjs";
|
|
18
|
+
/**
|
|
19
|
+
* Service health probes.
|
|
20
|
+
*/
|
|
21
|
+
export class HealthClient {
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
this._options = normalizeClientOptions(options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns successfully while the API process can serve requests.
|
|
27
|
+
*
|
|
28
|
+
* @param {HealthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link errors.DetectantApiError}
|
|
31
|
+
* @throws {@link errors.DetectantApiTimeoutError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.health.getLiveness()
|
|
35
|
+
*/
|
|
36
|
+
getLiveness(requestOptions) {
|
|
37
|
+
return core.HttpResponsePromise.fromPromise(this.__getLiveness(requestOptions));
|
|
38
|
+
}
|
|
39
|
+
__getLiveness(requestOptions) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
42
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
43
|
+
const _response = yield core.fetcher({
|
|
44
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.DetectantApiEnvironment.Default, "health/live"),
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
48
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
49
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
50
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
51
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
52
|
+
logging: this._options.logging,
|
|
53
|
+
});
|
|
54
|
+
if (_response.ok) {
|
|
55
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
56
|
+
}
|
|
57
|
+
if (_response.error.reason === "status-code") {
|
|
58
|
+
throw new errors.DetectantApiError({
|
|
59
|
+
statusCode: _response.error.statusCode,
|
|
60
|
+
body: _response.error.body,
|
|
61
|
+
rawResponse: _response.rawResponse,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/health/live");
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Checks the database, schema, scanner signatures, and scanning dependencies.
|
|
69
|
+
*
|
|
70
|
+
* @param {HealthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link DetectantApi.ServiceUnavailableError}
|
|
73
|
+
* @throws {@link errors.DetectantApiError}
|
|
74
|
+
* @throws {@link errors.DetectantApiTimeoutError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.health.getReadiness()
|
|
78
|
+
*/
|
|
79
|
+
getReadiness(requestOptions) {
|
|
80
|
+
return core.HttpResponsePromise.fromPromise(this.__getReadiness(requestOptions));
|
|
81
|
+
}
|
|
82
|
+
__getReadiness(requestOptions) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
85
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
86
|
+
const _response = yield core.fetcher({
|
|
87
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.DetectantApiEnvironment.Default, "health/ready"),
|
|
88
|
+
method: "GET",
|
|
89
|
+
headers: _headers,
|
|
90
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
91
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
92
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
93
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
94
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
95
|
+
logging: this._options.logging,
|
|
96
|
+
});
|
|
97
|
+
if (_response.ok) {
|
|
98
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
99
|
+
}
|
|
100
|
+
if (_response.error.reason === "status-code") {
|
|
101
|
+
switch (_response.error.statusCode) {
|
|
102
|
+
case 503:
|
|
103
|
+
throw new DetectantApi.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.DetectantApiError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/health/ready");
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as DetectantApi from "../../../index.mjs";
|
|
5
|
+
export declare namespace ScansClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Submit files and retrieve account-scoped scan results.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ScansClient {
|
|
14
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ScansClient.Options>;
|
|
15
|
+
constructor(options?: ScansClient.Options);
|
|
16
|
+
/**
|
|
17
|
+
* Returns scans owned by the authenticated account in descending creation order.
|
|
18
|
+
*
|
|
19
|
+
* @param {DetectantApi.ListScansRequest} request
|
|
20
|
+
* @param {ScansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
|
+
*
|
|
22
|
+
* @throws {@link DetectantApi.BadRequestError}
|
|
23
|
+
* @throws {@link DetectantApi.UnauthorizedError}
|
|
24
|
+
* @throws {@link DetectantApi.TooManyRequestsError}
|
|
25
|
+
* @throws {@link DetectantApi.InternalServerError}
|
|
26
|
+
* @throws {@link errors.DetectantApiError}
|
|
27
|
+
* @throws {@link errors.DetectantApiTimeoutError}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* await client.scans.listScans()
|
|
31
|
+
*/
|
|
32
|
+
listScans(request?: DetectantApi.ListScansRequest, requestOptions?: ScansClient.RequestOptions): core.HttpResponsePromise<DetectantApi.ScanList>;
|
|
33
|
+
private __listScans;
|
|
34
|
+
/**
|
|
35
|
+
* Returns one scan owned by the authenticated account.
|
|
36
|
+
*
|
|
37
|
+
* @param {DetectantApi.GetScanRequest} request
|
|
38
|
+
* @param {ScansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link DetectantApi.UnauthorizedError}
|
|
41
|
+
* @throws {@link DetectantApi.NotFoundError}
|
|
42
|
+
* @throws {@link DetectantApi.TooManyRequestsError}
|
|
43
|
+
* @throws {@link DetectantApi.InternalServerError}
|
|
44
|
+
* @throws {@link errors.DetectantApiError}
|
|
45
|
+
* @throws {@link errors.DetectantApiTimeoutError}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await client.scans.getScan({
|
|
49
|
+
* scan_id: "scan_0123456789abcdef0123456789abcdef"
|
|
50
|
+
* })
|
|
51
|
+
*/
|
|
52
|
+
getScan(request: DetectantApi.GetScanRequest, requestOptions?: ScansClient.RequestOptions): core.HttpResponsePromise<DetectantApi.Scan>;
|
|
53
|
+
private __getScan;
|
|
54
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as DetectantApi from "../../../index.mjs";
|
|
18
|
+
/**
|
|
19
|
+
* Submit files and retrieve account-scoped scan results.
|
|
20
|
+
*/
|
|
21
|
+
export class ScansClient {
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns scans owned by the authenticated account in descending creation order.
|
|
27
|
+
*
|
|
28
|
+
* @param {DetectantApi.ListScansRequest} request
|
|
29
|
+
* @param {ScansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link DetectantApi.BadRequestError}
|
|
32
|
+
* @throws {@link DetectantApi.UnauthorizedError}
|
|
33
|
+
* @throws {@link DetectantApi.TooManyRequestsError}
|
|
34
|
+
* @throws {@link DetectantApi.InternalServerError}
|
|
35
|
+
* @throws {@link errors.DetectantApiError}
|
|
36
|
+
* @throws {@link errors.DetectantApiTimeoutError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.scans.listScans()
|
|
40
|
+
*/
|
|
41
|
+
listScans(request = {}, requestOptions) {
|
|
42
|
+
return core.HttpResponsePromise.fromPromise(this.__listScans(request, requestOptions));
|
|
43
|
+
}
|
|
44
|
+
__listScans() {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
47
|
+
const { limit, cursor, verdict, filename, engine_signature: engineSignature, detection_rule: detectionRule, } = request;
|
|
48
|
+
const _queryParams = {
|
|
49
|
+
limit,
|
|
50
|
+
cursor,
|
|
51
|
+
verdict,
|
|
52
|
+
filename,
|
|
53
|
+
engine_signature: engineSignature,
|
|
54
|
+
detection_rule: detectionRule,
|
|
55
|
+
};
|
|
56
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
57
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
58
|
+
const _response = yield core.fetcher({
|
|
59
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.DetectantApiEnvironment.Default, "v1/scans"),
|
|
60
|
+
method: "GET",
|
|
61
|
+
headers: _headers,
|
|
62
|
+
queryString: core.url
|
|
63
|
+
.queryBuilder()
|
|
64
|
+
.addMany(_queryParams)
|
|
65
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
66
|
+
.build(),
|
|
67
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
68
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
69
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
70
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
71
|
+
logging: this._options.logging,
|
|
72
|
+
});
|
|
73
|
+
if (_response.ok) {
|
|
74
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
75
|
+
}
|
|
76
|
+
if (_response.error.reason === "status-code") {
|
|
77
|
+
switch (_response.error.statusCode) {
|
|
78
|
+
case 400:
|
|
79
|
+
throw new DetectantApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
80
|
+
case 401:
|
|
81
|
+
throw new DetectantApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
82
|
+
case 429:
|
|
83
|
+
throw new DetectantApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
84
|
+
case 500:
|
|
85
|
+
throw new DetectantApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
86
|
+
default:
|
|
87
|
+
throw new errors.DetectantApiError({
|
|
88
|
+
statusCode: _response.error.statusCode,
|
|
89
|
+
body: _response.error.body,
|
|
90
|
+
rawResponse: _response.rawResponse,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/scans");
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Returns one scan owned by the authenticated account.
|
|
99
|
+
*
|
|
100
|
+
* @param {DetectantApi.GetScanRequest} request
|
|
101
|
+
* @param {ScansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
102
|
+
*
|
|
103
|
+
* @throws {@link DetectantApi.UnauthorizedError}
|
|
104
|
+
* @throws {@link DetectantApi.NotFoundError}
|
|
105
|
+
* @throws {@link DetectantApi.TooManyRequestsError}
|
|
106
|
+
* @throws {@link DetectantApi.InternalServerError}
|
|
107
|
+
* @throws {@link errors.DetectantApiError}
|
|
108
|
+
* @throws {@link errors.DetectantApiTimeoutError}
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* await client.scans.getScan({
|
|
112
|
+
* scan_id: "scan_0123456789abcdef0123456789abcdef"
|
|
113
|
+
* })
|
|
114
|
+
*/
|
|
115
|
+
getScan(request, requestOptions) {
|
|
116
|
+
return core.HttpResponsePromise.fromPromise(this.__getScan(request, requestOptions));
|
|
117
|
+
}
|
|
118
|
+
__getScan(request, requestOptions) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
121
|
+
const { scan_id: scanId } = request;
|
|
122
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
123
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
124
|
+
const _response = yield core.fetcher({
|
|
125
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.DetectantApiEnvironment.Default, `v1/scans/${core.url.encodePathParam(scanId)}`),
|
|
126
|
+
method: "GET",
|
|
127
|
+
headers: _headers,
|
|
128
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
129
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
130
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
131
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
132
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
133
|
+
logging: this._options.logging,
|
|
134
|
+
});
|
|
135
|
+
if (_response.ok) {
|
|
136
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
137
|
+
}
|
|
138
|
+
if (_response.error.reason === "status-code") {
|
|
139
|
+
switch (_response.error.statusCode) {
|
|
140
|
+
case 401:
|
|
141
|
+
throw new DetectantApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
142
|
+
case 404:
|
|
143
|
+
throw new DetectantApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
144
|
+
case 429:
|
|
145
|
+
throw new DetectantApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
146
|
+
case 500:
|
|
147
|
+
throw new DetectantApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
148
|
+
default:
|
|
149
|
+
throw new errors.DetectantApiError({
|
|
150
|
+
statusCode: _response.error.statusCode,
|
|
151
|
+
body: _response.error.body,
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/scans/{scan_id}");
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {}
|
|
4
|
+
*/
|
|
5
|
+
export interface ListScansRequest {
|
|
6
|
+
/** Maximum results to return. Values above 200 are capped at 200; omission uses 50. */
|
|
7
|
+
limit?: number;
|
|
8
|
+
/** Opaque cursor returned as `next_cursor` by a previous request. */
|
|
9
|
+
cursor?: string;
|
|
10
|
+
/** Case-sensitive PostgreSQL `LIKE` fragment matched against the stored verdict; `%` and `_` act as wildcards. */
|
|
11
|
+
verdict?: string;
|
|
12
|
+
/** Case-sensitive PostgreSQL `LIKE` fragment matched against the stored filename; `%` and `_` act as wildcards. */
|
|
13
|
+
filename?: string;
|
|
14
|
+
/** Case-sensitive PostgreSQL `LIKE` fragment matched against the stored engine signature; `%` and `_` act as wildcards. */
|
|
15
|
+
engine_signature?: string;
|
|
16
|
+
/** Case-sensitive PostgreSQL `LIKE` fragment matched against stored detection rules; `%` and `_` act as wildcards. */
|
|
17
|
+
detection_rule?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ApiError {
|
|
2
|
+
/** Stable machine-readable error code. */
|
|
3
|
+
code: string;
|
|
4
|
+
/** Human-readable error message. */
|
|
5
|
+
message: string;
|
|
6
|
+
/** Context such as the ID of a failed stored scan. Empty when no context applies. */
|
|
7
|
+
details: Record<string, string>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as DetectantApi from "../index.mjs";
|
|
2
|
+
export interface Scan {
|
|
3
|
+
/** Server-generated scan identifier. */
|
|
4
|
+
id: string;
|
|
5
|
+
created_at: string;
|
|
6
|
+
status: Scan.Status;
|
|
7
|
+
verdict: Scan.Verdict;
|
|
8
|
+
/** Filename supplied by the multipart upload. */
|
|
9
|
+
filename: string;
|
|
10
|
+
sha256: string;
|
|
11
|
+
size_bytes: number;
|
|
12
|
+
duration_ms: number;
|
|
13
|
+
/** Failure information, or `null` when the scan completed. */
|
|
14
|
+
failure: DetectantApi.ScanFailure | null;
|
|
15
|
+
/** Detection names reported for the file. Empty when no threats were detected. */
|
|
16
|
+
detections: string[];
|
|
17
|
+
type_analysis: DetectantApi.TypeAnalysis;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace Scan {
|
|
20
|
+
const Status: {
|
|
21
|
+
readonly Completed: "completed";
|
|
22
|
+
readonly Failed: "failed";
|
|
23
|
+
};
|
|
24
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
25
|
+
const Verdict: {
|
|
26
|
+
readonly Clean: "clean";
|
|
27
|
+
readonly Malicious: "malicious";
|
|
28
|
+
readonly Suspicious: "suspicious";
|
|
29
|
+
readonly Unknown: "unknown";
|
|
30
|
+
};
|
|
31
|
+
type Verdict = (typeof Verdict)[keyof typeof Verdict];
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var Scan;
|
|
3
|
+
(function (Scan) {
|
|
4
|
+
Scan.Status = {
|
|
5
|
+
Completed: "completed",
|
|
6
|
+
Failed: "failed",
|
|
7
|
+
};
|
|
8
|
+
Scan.Verdict = {
|
|
9
|
+
Clean: "clean",
|
|
10
|
+
Malicious: "malicious",
|
|
11
|
+
Suspicious: "suspicious",
|
|
12
|
+
Unknown: "unknown",
|
|
13
|
+
};
|
|
14
|
+
})(Scan || (Scan = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as DetectantApi from "../index.mjs";
|
|
2
|
+
export interface ScanBatchResult {
|
|
3
|
+
/** Zero-based position of the submitted file. */
|
|
4
|
+
index: number;
|
|
5
|
+
/** Filename supplied by the multipart part. */
|
|
6
|
+
filename: string;
|
|
7
|
+
/** HTTP status that the equivalent single-file request would return. */
|
|
8
|
+
http_status: number;
|
|
9
|
+
/** Stored scan result, including its scan ID, or null when validation failed before a scan was created. */
|
|
10
|
+
scan: DetectantApi.Scan | null;
|
|
11
|
+
/** Per-file validation or scanning error, or null when the scan completed. */
|
|
12
|
+
error: DetectantApi.ApiError | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ScanFailure {
|
|
2
|
+
code: ScanFailure.Code;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export declare namespace ScanFailure {
|
|
6
|
+
const Code: {
|
|
7
|
+
readonly ScannerUnavailable: "SCANNER_UNAVAILABLE";
|
|
8
|
+
readonly ContentExpansionLimitExceeded: "CONTENT_EXPANSION_LIMIT_EXCEEDED";
|
|
9
|
+
};
|
|
10
|
+
type Code = (typeof Code)[keyof typeof Code];
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var ScanFailure;
|
|
3
|
+
(function (ScanFailure) {
|
|
4
|
+
ScanFailure.Code = {
|
|
5
|
+
ScannerUnavailable: "SCANNER_UNAVAILABLE",
|
|
6
|
+
ContentExpansionLimitExceeded: "CONTENT_EXPANSION_LIMIT_EXCEEDED",
|
|
7
|
+
};
|
|
8
|
+
})(ScanFailure || (ScanFailure = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as DetectantApi from "../index.mjs";
|
|
2
|
+
export interface ScanList {
|
|
3
|
+
/** Scan records. Empty when the account has no scans. */
|
|
4
|
+
items: DetectantApi.Scan[];
|
|
5
|
+
/** Opaque cursor for the next page, or `null` when no next page exists. */
|
|
6
|
+
next_cursor: string | null;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as DetectantApi from "../index.mjs";
|
|
2
|
+
export interface TypeAnalysis {
|
|
3
|
+
declared: DetectantApi.TypeDeclaration;
|
|
4
|
+
identified: DetectantApi.TypeIdentification;
|
|
5
|
+
status: TypeAnalysis.Status;
|
|
6
|
+
structurally_valid: boolean | null;
|
|
7
|
+
confidence: TypeAnalysis.Confidence;
|
|
8
|
+
reason: DetectantApi.TypeAnalysisReason | null;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace TypeAnalysis {
|
|
11
|
+
const Status: {
|
|
12
|
+
readonly Match: "match";
|
|
13
|
+
readonly Compatible: "compatible";
|
|
14
|
+
readonly Mismatch: "mismatch";
|
|
15
|
+
readonly Malformed: "malformed";
|
|
16
|
+
readonly Unscannable: "unscannable";
|
|
17
|
+
readonly Unknown: "unknown";
|
|
18
|
+
};
|
|
19
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
20
|
+
const Confidence: {
|
|
21
|
+
readonly High: "high";
|
|
22
|
+
readonly Medium: "medium";
|
|
23
|
+
readonly Low: "low";
|
|
24
|
+
};
|
|
25
|
+
type Confidence = (typeof Confidence)[keyof typeof Confidence];
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var TypeAnalysis;
|
|
3
|
+
(function (TypeAnalysis) {
|
|
4
|
+
TypeAnalysis.Status = {
|
|
5
|
+
Match: "match",
|
|
6
|
+
Compatible: "compatible",
|
|
7
|
+
Mismatch: "mismatch",
|
|
8
|
+
Malformed: "malformed",
|
|
9
|
+
Unscannable: "unscannable",
|
|
10
|
+
Unknown: "unknown",
|
|
11
|
+
};
|
|
12
|
+
TypeAnalysis.Confidence = {
|
|
13
|
+
High: "high",
|
|
14
|
+
Medium: "medium",
|
|
15
|
+
Low: "low",
|
|
16
|
+
};
|
|
17
|
+
})(TypeAnalysis || (TypeAnalysis = {}));
|