| 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 DescribePackage} — `domain`, `domainOwner`, and |
| 8 | * `repository` are injected from the bound {@link Repository}. |
| 9 | */ |
| 10 | export interface DescribePackageRequest extends Omit< |
| 11 | codeartifact.DescribePackageRequest, |
| 12 | "domain" | "domainOwner" | "repository" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `codeartifact:DescribePackage`. |
| 17 | * |
| 18 | * Reads a package's description, including its origin configuration, from the bound repository. Provide the implementation with |
| 19 | * `Effect.provide(AWS.CodeArtifact.DescribePackageHttp)`. |
| 20 | * ### Inspecting Packages |
| 21 | * **Example:** Describe a Package |
| 22 | * ```typescript |
| 23 | * const describePackage = yield* AWS.CodeArtifact.DescribePackage(repo); |
| 24 | * |
| 25 | * const res = yield* describePackage({ |
| 26 | * format: "generic", |
| 27 | * namespace: "my-ns", |
| 28 | * package: "my-package", |
| 29 | * }); |
| 30 | * console.log(res.package?.originConfiguration); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface DescribePackage extends Binding.Service< |
| 36 | DescribePackage, |
| 37 | "AWS.CodeArtifact.DescribePackage", |
| 38 | ( |
| 39 | repository: Repository, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: DescribePackageRequest, |
| 43 | ) => Effect.Effect< |
| 44 | codeartifact.DescribePackageResult, |
| 45 | codeartifact.DescribePackageError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | |
| 50 | export const DescribePackage = Binding.Service<DescribePackage>( |
| 51 | "AWS.CodeArtifact.DescribePackage", |
| 52 | ); |