/** * Registry endpoints: the one meaning of "which Registry" a location names. * * A Registry is served either at an HTTP(S) origin or from a directory named * by a `file:` URL. Every configured location, `--registry` URL, and endpoint * read back from durable state is decoded here, so equal Registries compare * equal however they were spelled and an unsupported location is refused * before any request, credential, or filesystem work is attempted. * * This module is pure: it parses and serializes with the WHATWG URL API and * never reads settings, credentials, or the disk. Converting a `file:` URL to * a native path belongs to the host adapter. * * @experimental This API is unstable and may change without notice. */ import * as Result from "effect/Result"; import * as Schema from "effect/Schema"; declare const RegistryEndpointValueSchema: Schema.brand; readonly href: Schema.String; }>, "RegistryEndpoint">; /** * A validated Registry endpoint. `href` is the canonical serialization: the * origin of an HTTP(S) Registry, or the canonical `file:` URL of a directory * Registry. Only {@link RegistryEndpointFromString} and * {@link parseRegistryEndpoint} construct one. */ export type RegistryEndpoint = typeof RegistryEndpointValueSchema.Type; /** An endpoint reached over HTTP(S); its `href` is the Registry origin. */ export type HttpRegistryEndpoint = RegistryEndpoint & { readonly transport: "http"; }; /** Why a location is not a Registry endpoint. */ export type RegistryEndpointProblem = "not-a-url" | "unsupported-scheme" | "credentials" | "query" | "fragment" | "path"; /** A refused location, described without any secret-bearing part of it. */ interface RegistryEndpointRejection { readonly problem: RegistryEndpointProblem; /** * The location with userinfo, query, and fragment removed, or a placeholder * when its userinfo cannot be told apart from the rest of it. */ readonly safeInput: string; readonly message: string; } /** * Decode a location into its canonical Registry endpoint, or say why it is * not one. Canonicalization is idempotent: decoding an endpoint's `href` * yields the same endpoint. */ export declare const parseRegistryEndpoint: (input: string) => Result.Result; /** The canonical endpoint a location names; throws on an invalid one. For literals and tests. */ export declare const decodeRegistryEndpointSync: (input: string) => RegistryEndpoint; /** The canonical HTTP(S) endpoint a location names; throws otherwise. For literals and tests. */ export declare const decodeHttpRegistryEndpointSync: (input: string) => HttpRegistryEndpoint; /** * A Registry location string decoded to its canonical endpoint; encoding * writes the canonical serialization back as a string. */ export declare const RegistryEndpointFromString: Schema.decodeTo; readonly href: Schema.String; }>, "RegistryEndpoint">>, Schema.String, never, never>; /** Whether two endpoints name the same Registry. */ export declare const sameRegistryEndpoint: (left: RegistryEndpoint, right: RegistryEndpoint) => boolean; /** Narrow an endpoint to one reached over HTTP(S). */ export declare const isHttpRegistryEndpoint: (endpoint: RegistryEndpoint) => endpoint is HttpRegistryEndpoint; /** * The URL of an API path beneath an endpoint. Every request to a Registry, and * every report of one, is built here so the two always describe the same URL. */ export declare const registryRequestUrl: (endpoint: RegistryEndpoint, apiPath: string) => string; export {}; //# sourceMappingURL=registry-endpoint.d.ts.map