| 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 GetDownloadUrlForLayer} — `repositoryName` is injected from the |
| 8 | * bound {@link Repository} (the registry defaults to the caller's account). |
| 9 | */ |
| 10 | export interface GetDownloadUrlForLayerRequest extends Omit< |
| 11 | ecr.GetDownloadUrlForLayerRequest, |
| 12 | "registryId" | "repositoryName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `ecr:GetDownloadUrlForLayer`. |
| 17 | * |
| 18 | * Resolves a pre-signed S3 download URL for an image layer in the bound repository — the blob-download half of a registry pull. Provide the implementation with |
| 19 | * `Effect.provide(AWS.ECR.GetDownloadUrlForLayerHttp)`. |
| 20 | * ### Pulling Images |
| 21 | * **Example:** Download a Layer Blob |
| 22 | * ```typescript |
| 23 | * const getDownloadUrl = yield* AWS.ECR.GetDownloadUrlForLayer(repository); |
| 24 | * |
| 25 | * const res = yield* getDownloadUrl({ layerDigest: "sha256:…" }); |
| 26 | * console.log(res.downloadUrl); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface GetDownloadUrlForLayer extends Binding.Service< |
| 32 | GetDownloadUrlForLayer, |
| 33 | "AWS.ECR.GetDownloadUrlForLayer", |
| 34 | ( |
| 35 | repository: Repository, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: GetDownloadUrlForLayerRequest, |
| 39 | ) => Effect.Effect< |
| 40 | ecr.GetDownloadUrlForLayerResponse, |
| 41 | ecr.GetDownloadUrlForLayerError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const GetDownloadUrlForLayer = Binding.Service<GetDownloadUrlForLayer>( |
| 47 | "AWS.ECR.GetDownloadUrlForLayer", |
| 48 | ); |