| 1 | import type * as codeartifact from "@distilled.cloud/aws/codeartifact"; |
| 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 UpdatePackageVersionsStatus} — `domain`, `domainOwner`, and |
| 8 | * `repository` are injected from the bound {@link Repository}. |
| 9 | */ |
| 10 | export interface UpdatePackageVersionsStatusRequest extends Omit< |
| 11 | codeartifact.UpdatePackageVersionsStatusRequest, |
| 12 | "domain" | "domainOwner" | "repository" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `codeartifact:UpdatePackageVersionsStatus`. |
| 17 | * |
| 18 | * Transitions package versions between statuses (e.g. `Unfinished` → `Published`, or `Published` → `Archived` to hide them from installs). Provide the implementation with |
| 19 | * `Effect.provide(AWS.CodeArtifact.UpdatePackageVersionsStatusHttp)`. |
| 20 | * ### Managing Version Status |
| 21 | * **Example:** Publish an Unfinished Version |
| 22 | * ```typescript |
| 23 | * const updateStatus = yield* AWS.CodeArtifact.UpdatePackageVersionsStatus(repo); |
| 24 | * |
| 25 | * const res = yield* updateStatus({ |
| 26 | * format: "generic", |
| 27 | * namespace: "my-ns", |
| 28 | * package: "my-package", |
| 29 | * versions: ["1.0.0"], |
| 30 | * targetStatus: "Published", |
| 31 | * }); |
| 32 | * console.log(res.successfulVersions); |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface UpdatePackageVersionsStatus extends Binding.Service< |
| 38 | UpdatePackageVersionsStatus, |
| 39 | "AWS.CodeArtifact.UpdatePackageVersionsStatus", |
| 40 | ( |
| 41 | repository: Repository, |
| 42 | ) => Effect.Effect< |
| 43 | ( |
| 44 | request: UpdatePackageVersionsStatusRequest, |
| 45 | ) => Effect.Effect< |
| 46 | codeartifact.UpdatePackageVersionsStatusResult, |
| 47 | codeartifact.UpdatePackageVersionsStatusError |
| 48 | > |
| 49 | > |
| 50 | > {} |
| 51 | |
| 52 | export const UpdatePackageVersionsStatus = |
| 53 | Binding.Service<UpdatePackageVersionsStatus>( |
| 54 | "AWS.CodeArtifact.UpdatePackageVersionsStatus", |
| 55 | ); |