| 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 PutPackageOriginConfiguration} — `domain`, `domainOwner`, and |
| 8 | * `repository` are injected from the bound {@link Repository}. |
| 9 | */ |
| 10 | export interface PutPackageOriginConfigurationRequest extends Omit< |
| 11 | codeartifact.PutPackageOriginConfigurationRequest, |
| 12 | "domain" | "domainOwner" | "repository" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for `codeartifact:PutPackageOriginConfiguration`. |
| 17 | * |
| 18 | * Sets a package's origin controls — whether new versions can be published directly and whether versions can be ingested from upstream/external sources. Provide the implementation with |
| 19 | * `Effect.provide(AWS.CodeArtifact.PutPackageOriginConfigurationHttp)`. |
| 20 | * ### Managing Package Origins |
| 21 | * **Example:** Block Upstream Ingestion |
| 22 | * ```typescript |
| 23 | * const putOrigin = yield* AWS.CodeArtifact.PutPackageOriginConfiguration(repo); |
| 24 | * |
| 25 | * const res = yield* putOrigin({ |
| 26 | * format: "generic", |
| 27 | * namespace: "my-ns", |
| 28 | * package: "my-package", |
| 29 | * restrictions: { publish: "ALLOW", upstream: "BLOCK" }, |
| 30 | * }); |
| 31 | * console.log(res.originConfiguration?.restrictions); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface PutPackageOriginConfiguration extends Binding.Service< |
| 37 | PutPackageOriginConfiguration, |
| 38 | "AWS.CodeArtifact.PutPackageOriginConfiguration", |
| 39 | ( |
| 40 | repository: Repository, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: PutPackageOriginConfigurationRequest, |
| 44 | ) => Effect.Effect< |
| 45 | codeartifact.PutPackageOriginConfigurationResult, |
| 46 | codeartifact.PutPackageOriginConfigurationError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | |
| 51 | export const PutPackageOriginConfiguration = |
| 52 | Binding.Service<PutPackageOriginConfiguration>( |
| 53 | "AWS.CodeArtifact.PutPackageOriginConfiguration", |
| 54 | ); |