1import type * as codeartifact from "@distilled.cloud/aws/codeartifact";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Repository } from "./Repository.ts";
5
6/**
7 * Request for {@link GetRepositoryEndpoint} — `domain`, `domainOwner`, and
8 * `repository` are injected from the bound {@link Repository}.
9 */
10export interface GetRepositoryEndpointRequest extends Omit<
11 codeartifact.GetRepositoryEndpointRequest,
12 "domain" | "domainOwner" | "repository"
13> {}
14
15/**
16 * Runtime binding for `codeartifact:GetRepositoryEndpoint`.
17 *
18 * Resolves the URL package managers (npm, pip, maven, …) use to talk to the bound repository for a given package format. Provide the implementation with
19 * `Effect.provide(AWS.CodeArtifact.GetRepositoryEndpointHttp)`.
20 * ### Resolving the Registry Endpoint
21 * **Example:** Get the npm Endpoint
22 * ```typescript
23 * const getEndpoint = yield* AWS.CodeArtifact.GetRepositoryEndpoint(repo);
24 *
25 * const res = yield* getEndpoint({ format: "npm" });
26 * console.log(res.repositoryEndpoint);
27 * ```
28 *
29 * @binding
30 */
31export interface GetRepositoryEndpoint extends Binding.Service<
32 GetRepositoryEndpoint,
33 "AWS.CodeArtifact.GetRepositoryEndpoint",
34 (
35 repository: Repository,
36 ) => Effect.Effect<
37 (
38 request: GetRepositoryEndpointRequest,
39 ) => Effect.Effect<
40 codeartifact.GetRepositoryEndpointResult,
41 codeartifact.GetRepositoryEndpointError
42 >
43 >
44> {}
45
46export const GetRepositoryEndpoint = Binding.Service<GetRepositoryEndpoint>(
47 "AWS.CodeArtifact.GetRepositoryEndpoint",
48);