| 1 | import type * as ecr from "@distilled.cloud/aws/ecr"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Repository } from "./Repository.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request for {@link DescribeImageScanFindings} — `repositoryName` is injected from the |
| 8 | * bound {@link Repository} (the registry defaults to the caller's account). |
| 9 | */ |
| 10 | export interface DescribeImageScanFindingsRequest extends Omit< |
| 11 | ecr.DescribeImageScanFindingsRequest, |
| 12 | "registryId" | "repositoryName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `ecr:DescribeImageScanFindings`. |
| 17 | * |
| 18 | * Returns the vulnerability findings of the most recent scan of an image in the bound repository. Provide the implementation with |
| 19 | * `Effect.provide(AWS.ECR.DescribeImageScanFindingsHttp)`. |
| 20 | * ### Image Scanning |
| 21 | * **Example:** Read Scan Findings |
| 22 | * ```typescript |
| 23 | * const describeScanFindings = yield* AWS.ECR.DescribeImageScanFindings(repository); |
| 24 | * |
| 25 | * const res = yield* describeScanFindings({ imageId: { imageTag: "latest" } }); |
| 26 | * console.log(res.imageScanFindings?.findingSeverityCounts); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface DescribeImageScanFindings extends Binding.Service< |
| 32 | DescribeImageScanFindings, |
| 33 | "AWS.ECR.DescribeImageScanFindings", |
| 34 | ( |
| 35 | repository: Repository, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: DescribeImageScanFindingsRequest, |
| 39 | ) => Effect.Effect< |
| 40 | ecr.DescribeImageScanFindingsResponse, |
| 41 | ecr.DescribeImageScanFindingsError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const DescribeImageScanFindings = |
| 47 | Binding.Service<DescribeImageScanFindings>( |
| 48 | "AWS.ECR.DescribeImageScanFindings", |
| 49 | ); |