| 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 UploadLayerPart} — `repositoryName` is injected from the |
| 8 | * bound {@link Repository} (the registry defaults to the caller's account). |
| 9 | */ |
| 10 | export interface UploadLayerPartRequest extends Omit< |
| 11 | ecr.UploadLayerPartRequest, |
| 12 | "registryId" | "repositoryName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `ecr:UploadLayerPart`. |
| 17 | * |
| 18 | * Uploads one chunk of a layer blob to an open upload in the bound repository (non-final parts must be at least 5 MiB). Provide the implementation with |
| 19 | * `Effect.provide(AWS.ECR.UploadLayerPartHttp)`. |
| 20 | * ### Pushing Images |
| 21 | * **Example:** Upload a Single-Part Layer |
| 22 | * ```typescript |
| 23 | * const uploadPart = yield* AWS.ECR.UploadLayerPart(repository); |
| 24 | * |
| 25 | * yield* uploadPart({ |
| 26 | * uploadId: uploadId!, |
| 27 | * partFirstByte: 0, |
| 28 | * partLastByte: blob.length - 1, |
| 29 | * layerPartBlob: blob, |
| 30 | * }); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface UploadLayerPart extends Binding.Service< |
| 36 | UploadLayerPart, |
| 37 | "AWS.ECR.UploadLayerPart", |
| 38 | ( |
| 39 | repository: Repository, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: UploadLayerPartRequest, |
| 43 | ) => Effect.Effect<ecr.UploadLayerPartResponse, ecr.UploadLayerPartError> |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const UploadLayerPart = Binding.Service<UploadLayerPart>( |
| 48 | "AWS.ECR.UploadLayerPart", |
| 49 | ); |