| 1 | import type * as ecrpublic from "@distilled.cloud/aws/ecr-public"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { PublicRepository } from "./Repository.ts"; |
| 5 | |
| 6 | /** Request for {@link UploadLayerPart} — `repositoryName` is injected. */ |
| 7 | export interface UploadLayerPartRequest extends Omit< |
| 8 | ecrpublic.UploadLayerPartRequest, |
| 9 | "repositoryName" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `ecr-public:UploadLayerPart`. |
| 14 | * |
| 15 | * Uploads one chunk of an in-flight image layer upload to the bound |
| 16 | * {@link PublicRepository}. Provide the implementation with |
| 17 | * `Effect.provide(AWS.ECRPublic.UploadLayerPartHttp)`. |
| 18 | * |
| 19 | * ### Pushing Images |
| 20 | * **Example:** Upload A Layer Part |
| 21 | * ```typescript |
| 22 | * // init |
| 23 | * const uploadLayerPart = yield* AWS.ECRPublic.UploadLayerPart(repository); |
| 24 | * |
| 25 | * // runtime |
| 26 | * yield* uploadLayerPart({ |
| 27 | * uploadId, |
| 28 | * partFirstByte: 0, |
| 29 | * partLastByte: blob.byteLength - 1, |
| 30 | * layerPartBlob: blob, |
| 31 | * }); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface UploadLayerPart extends Binding.Service< |
| 37 | UploadLayerPart, |
| 38 | "AWS.ECRPublic.UploadLayerPart", |
| 39 | <R extends PublicRepository>( |
| 40 | repository: R, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: UploadLayerPartRequest, |
| 44 | ) => Effect.Effect< |
| 45 | ecrpublic.UploadLayerPartResponse, |
| 46 | ecrpublic.UploadLayerPartError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | |
| 51 | export const UploadLayerPart = Binding.Service<UploadLayerPart>( |
| 52 | "AWS.ECRPublic.UploadLayerPart", |
| 53 | ); |