import { c as channels$1, i as ignite$1, p as pipe$1, a as projects$1, r as registry$1, u as users$1, E as Endpoints, M as Method, I as Id, b as ErroredAPIResponse, d as ExtractRouteParams, e as Endpoint, R as Room, P as Project, S as SelfUser, f as MemberRole, g as PAT, N as Node, D as Deployment, G as Group, C as Container, h as ContainerLog, j as Gateway, k as Domain, l as Member, m as ProjectToken, n as Secret, W as Webhook, o as Channel, q as ChannelToken, A as AnyStateObject, s as DeliveryProtocol, t as Regions, F as FleetSchedulingState, v as CreateDeploymentConfig, w as GatewayType, x as DeploymentRollout, H as HealthCheck, y as ChannelType, z as ContainerState, B as DeploymentConfig, J as DeploymentMetadata, T as Timestamp, K as constructEvent, L as PossibleWebhookIDs } from './channels-db8da32e.js'; export { a0 as APIResponse, at as AnyId, ag as Auth, ac as Build, _ as BuildEnvironment, a9 as BuildEnvironmentType, a8 as BuildMetaData, a7 as BuildMetadata, O as BuildMethod, a5 as BuildSettings, Q as BuildState, aU as ByteSizeString, aV as ByteString, aT as ByteUnit, a2 as ChannelEndpoints, a4 as ContainerMetrics, ad as ContainerStrategy, aD as DefaultQuotas, a6 as DeploymentMetaData, af as DeploymentTarget, ak as DomainRedirect, U as DomainState, am as Empty, aI as Event, aH as EventDataMap, aR as FleetEndpoints, aN as FleetStatus, ah as GHRepo, aG as HealthCheckEventUpdate, ar as HopShDomain, ap as ID_PREFIXES, aq as IdPrefixes, al as IgniteEndpoints, ae as Image, ai as ImageGHRepo, as as InternalHopDomain, an as MakeOptional, aa as NixPlan, aP as NodeIP, aO as NodeMetadata, b1 as POSSIBLE_EVENTS, aA as PipeEndpoints, au as PossibleWebhookGroups, aB as ProjectTier, aC as ProjectType, aJ as ProjectsEndpoints, aE as QuotaOverrides, aF as QuotaUsage, aK as RegistryEndpoints, aj as Resources, V as RestartPolicy, X as RolloutState, Y as RuntimeType, a1 as State, $ as SuccessfulAPIResponse, ao as Tag, aQ as TargetID, aL as User, aM as UserEndpoints, ab as ValidationFailure, a3 as VolumeDefinition, Z as VolumeFormat, az as assertId, aS as byteUnits, aX as bytes, ax as getIdPrefix, a_ as gigabytes, ay as id, aW as isValidByteString, aY as kilobytes, aZ as megabytes, a$ as parseSize, b0 as units, aw as validateId, av as validateIdPrefix, b2 as verifyHmac } from './channels-db8da32e.js'; /** * The default base URL for Hop's API. * @public */ declare const DEFAULT_BASE_URL = "https://api.hop.io"; /** * If we are in the browser. * @public */ declare const IS_BROWSER: boolean; /** * If this runtiem supports the Intl API * @public */ declare const SUPPORTS_INTL: boolean; declare namespace api { export { channels$1 as Channels, ignite$1 as Ignite, pipe$1 as Pipe, projects$1 as Projects, registry$1 as Registry, users$1 as Users, }; } /** * A valid ID prefix supported by the Hop API for authetication * @public */ type APIAuthenticationPrefix = 'ptk' | 'bearer' | 'pat'; /** * Extract an endpoint from a given method and path * @public */ type ExtractEndpoint = Extract; /** * Pull all paths for a given method * @internal */ type PathsFor = Extract['path']; /** * All possible authentication ID types * @public */ type APIAuthentication = Id; /** * Validates that an authentication prefix is valid * @param auth - The prefix to validate * @returns `true` if the prefix is valid, `false` otherwise * @public */ declare function validateAPIAuthentication(auth: string): auth is APIAuthenticationPrefix; /** * Options passed to the API client. * This will usually come from Hop#constructor in most cases * @public */ interface APIClientOptions { readonly baseUrl: string; readonly authentication: APIAuthentication; } /** * An error that occurred as a response from the Hop API. * @public */ declare class HopAPIError extends Error { readonly request: Request; readonly response: Response; readonly data: ErroredAPIResponse; readonly status: number; constructor(request: Request, response: Response, data: ErroredAPIResponse); } /** * Generate a query object that includes typed URL params * @public */ type Query = ExtractRouteParams & Record; /** * API Client that is responsible for handling all requests * @public */ declare class APIClient { static getAuthType(auth: APIAuthentication): APIAuthenticationPrefix; private readonly options; private agent; readonly authType: APIAuthenticationPrefix; readonly url: (path: Path, query: Query) => string; constructor(options: APIClientOptions); get>(path: Path, query: Query, init?: RequestInit): Promise<(Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract; leap_token: string | null; }>, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract | null>>, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }> | Extract, { path: Path; method: 'GET'; }>)["res"]>; post['path']>(path: Path, body: Extract['body'], query: Query, init?: RequestInit): Promise<(Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract>, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract | null; }>, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }> | Extract, { path: Path; method: 'POST'; }>)["res"]>; put['path']>(path: Path, body: Extract['body'], query: Query, init?: RequestInit): Promise<(Extract, { path: Path; method: 'PUT'; }> | Extract, { path: Path; method: 'PUT'; }> | Extract, { path: Path; method: 'PUT'; }> | Extract, { path: Path; method: 'PUT'; }> | Extract | null; }>, { path: Path; method: 'PUT'; }> | Extract, { path: Path; method: 'PUT'; }> | Extract, { path: Path; method: 'PUT'; }>)["res"]>; patch['path']>(path: Path, body: Extract['body'], query: Query, init?: RequestInit): Promise<(Extract, { path: Path; method: 'PATCH'; }> | Extract>, { path: Path; method: 'PATCH'; }> | Extract>, { path: Path; method: 'PATCH'; }> | Extract>>, { path: Path; method: 'PATCH'; }> | Extract, { path: Path; method: 'PATCH'; }> | Extract, { path: Path; method: 'PATCH'; }> | Extract, { path: Path; method: 'PATCH'; }> | Extract, { path: Path; method: 'PATCH'; }> | Extract, { path: Path; method: 'PATCH'; }>)["res"]>; delete['path']>(path: Path, body: Extract['body'], query: Query, init?: RequestInit): Promise<(Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }> | Extract, { path: Path; method: 'DELETE'; }>)["res"]>; raw(request: Request): Promise; private executeRequest; private request; } /** * New state to set to a channel, or a callback function that will produce the new state * @public */ type SetStateAction = T | ((oldState: T) => T | Promise); /** * Channels SDK client * @public */ declare const channels: (client: APIClient) => { /** * Creates a new channel * * @param type - The type of the channel to create * @param id - An ID to assign to the channel (optional, set this to `undefined` or `null` if you do not want to specify an ID) * @param project - A project ID (if necessary) to assign this to */ create(type: ChannelType, id?: string | null, options?: { state?: T; } | null | undefined, project?: Id<'project'>): Promise(state: SetStateAction): Promise; patchState(state: SetStateAction): Promise; subscribeToken(token: Id<'leap_token'>): Promise; subscribeTokens(tokens: Id<'leap_token'>[] | Set>): Promise; removeToken(token: Id<'leap_token'>): Promise; publishMessage(name: string, data: unknown): Promise; }>; get(id: string): Promise(state: SetStateAction): Promise; patchState(state: SetStateAction): Promise; subscribeToken(token: Id<'leap_token'>): Promise; subscribeTokens(tokens: Id<'leap_token'>[] | Set>): Promise; removeToken(token: Id<'leap_token'>): Promise; publishMessage(name: string, data: unknown): Promise; }>; /** * Get all channels for a project * * @param project - An optional project ID if authenticating with a PAT or Bearer */ getAll(project?: Id<'project'>): Promise<(Channel & { setState(state: SetStateAction): Promise; patchState(state: SetStateAction): Promise; subscribeToken(token: Id<'leap_token'>): Promise; subscribeTokens(tokens: Id<'leap_token'>[] | Set>): Promise; removeToken(token: Id<'leap_token'>): Promise; publishMessage(name: string, data: unknown): Promise; })[]>; subscribeToken(channel: string | Channel, token: Id<'leap_token'>): Promise; removeToken(channel: string | Channel, token: Id<'leap_token'>): Promise; subscribeTokens(channel: string | Channel, tokens: Iterable>): Promise; removeTokens(channel: string | Channel, tokens: Iterable>): Promise; getAllTokens(channel: string | Channel): Promise; setState(channel: string | Channel, state: SetStateAction): Promise; patchState(channel: string | Channel, state: SetStateAction): Promise; /** * Publishes a new event to a channel * * @param channel - The channel to publish to * @param event - The event name * @param data - The data for this event */ publishMessage(channel: string | Channel, event: string, data: T_5): Promise; delete(id: string): Promise; getStats(id: string): Promise<{ online_count: number; }>; tokens: { delete(token: Id<'leap_token'>): Promise; /** * Creates a new channel token for a project * * @param state - The state to set on the token * @param project - The project to attach this token to */ create(state?: AnyStateObject, project?: Id<'project'>): Promise; setState(id: Id<'leap_token'>, state: AnyStateObject): Promise; get(id: Id<'leap_token'>): Promise; isOnline(idOrToken: `leap_token_${string}` | ChannelToken): Promise; /** * Publishes a direct message to a single token * @param token - The token to publish a direct message to * @param event - The event name * @param data - The data for this event */ publishDirectMessage(token: Id<'leap_token'>, event: string, data: T_6): Promise; }; }; /** * Partial options for the Hop client * @public */ type PartialAPIOptions = Partial> & Pick; /** * Root class containing all methods and types for interacting with the Hop platform. * This will be the entrypoint for most users of the Hop SDK. * * @public * * @example * ```ts * const hop = new Hop(bearerTokenOrPATOrProjectToken); * await hop.ignite.containers.create(deploymentId); * ``` */ declare class Hop { readonly client: APIClient; readonly ignite: { groups: { create(name: string, options?: Partial<{ deploymentIds: `deployment_${string}`[]; position: number; }> | undefined, projectId?: `project_${string}` | undefined): Promise; edit(groupId: `deployment_group_${string}`, { name, position, }: { name?: string | undefined; position?: number | undefined; }, projectId?: `project_${string}` | undefined): Promise; move(deploymentId: `deployment_${string}`, groupId: `deployment_group_${string}` | null, projectId?: `project_${string}` | undefined): Promise; delete(groupId: `deployment_group_${string}`, projectId?: `project_${string}` | undefined): Promise; }; domains: { delete: (id: `domain_${string}`) => Promise; get: (id: `domain_${string}`) => Promise; }; gateways: { addDomain(gatewayId: `gateway_${string}`, domain: string): Promise; get(gatewayId: `gateway_${string}`): Promise; getAll(deploymentId: `deployment_${string}`): Promise<(Gateway & { addDomain(domain: string): Promise; deleteDomain(domainId: `domain_${string}`): Promise; })[]>; create(deployment: `deployment_${string}` | Deployment, config: { type: GatewayType.EXTERNAL; protocol: "http" | null; targetPort: number; name: string; } | { type: GatewayType.INTERNAL; protocol: "http" | null; targetPort: number; name: string; internalDomain: string; }): Promise; deleteDomain(domainId: `domain_${string}`): Promise; }>; }; healthChecks: { create: (deployment: `deployment_${string}`, config: Omit) => Promise; update: (deployment: `deployment_${string}`, config: Partial>) => Promise; }; deployments: { create: { (configOrProject: `project_${string}`, bearerOrPatConfig: CreateDeploymentConfig): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: "http" | null; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: "http" | null; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: `domain_${string}`): Promise; }>; getStorageStats(): Promise | null>>; }>; (configOrProject: CreateDeploymentConfig): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: "http" | null; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: "http" | null; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: `domain_${string}`): Promise; }>; getStorageStats(): Promise | null>>; }>; }; get: { (name: string, projectId?: `project_${string}` | undefined): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: "http" | null; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: "http" | null; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: `domain_${string}`): Promise; }>; getStorageStats(): Promise | null>>; }>; (id: `deployment_${string}`, projectId?: `project_${string}` | undefined): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: "http" | null; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: "http" | null; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: `domain_${string}`): Promise; }>; getStorageStats(): Promise | null>>; }>; }; rollout(id: `deployment_${string}`): Promise; getStorageStats(id: `deployment_${string}`): Promise | null>>; update(deploymentId: `deployment_${string}`, config: Partial): Promise; getContainers(deployment: `deployment_${string}`): Promise; getAll(projectId?: `project_${string}` | undefined): Promise<{ deployments: (Deployment & { getContainers(): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: "http" | null; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: "http" | null; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: `domain_${string}`): Promise; }>; getStorageStats(): Promise | null>>; })[]; groups: Group[]; }>; delete(deployment: `deployment_${string}`): Promise; patchMetadata(deploymentId: `deployment_${string}`, metadata: Partial): Promise; }; containers: { delete: { (container_id: `container_${string}`, options: { recreate: true; }): Promise; (container_id: `container_${string}`, options?: { recreate?: false; } | undefined): Promise; }; getLogs(container: `container_${string}`, options?: Partial<{ sortBy: "timestamp"; orderBy: "desc" | "asc"; limit: number; offset: number; }>): Promise; stop(container: `container_${string}`): Promise; start(container: `container_${string}`): Promise; create(deployment: `deployment_${string}`): Promise; }; }; readonly users: { me: { get(): Promise<{ projects: Project[]; user: SelfUser; project_member_role_map: Record<`project_${string}`, MemberRole>; leap_token: string | null; }>; pats: { create(name: string): Promise; getAll(): Promise; delete(id: `pat_${string}`): Promise; }; }; }; readonly projects: { getAllMembers(projectId?: `project_${string}` | undefined): Promise; getCurrentMember(projectId: `project_${string}`): Promise; projectTokens: { delete(projectTokenId: `ptkid_${string}`, project?: `project_${string}` | undefined): Promise; get(projectId?: `project_${string}` | undefined): Promise; create(flags: number, projectId?: `project_${string}` | undefined): Promise; }; tokens: { delete(projectTokenId: `ptkid_${string}`, project?: `project_${string}` | undefined): Promise; get(projectId?: `project_${string}` | undefined): Promise; create(flags: number, projectId?: `project_${string}` | undefined): Promise; }; webhooks: { constructEvent: typeof constructEvent; getAll(projectId?: `project_${string}` | undefined): Promise; create(webhook_url: string, events: ("ignite.deployment.created" | "ignite.deployment.updated" | "ignite.deployment.deleted" | "ignite.deployment.build.created" | "ignite.deployment.build.started" | "ignite.deployment.build.updated" | "ignite.deployment.build.completed" | "ignite.deployment.build.failed" | "ignite.deployment.build.cancelled" | "ignite.deployment.rollout.created" | "ignite.deployment.rollout.updated" | "ignite.deployment.container.created" | "ignite.deployment.container.updated" | "ignite.deployment.container.metrics_update" | "ignite.deployment.container.deleted" | "ignite.deployment.healthcheck.created" | "ignite.deployment.healthcheck.updated" | "ignite.deployment.healthcheck.deleted" | "ignite.deployment.healthcheck.events.failed" | "ignite.deployment.healthcheck.events.succeeded" | "ignite.deployment.gateway.created" | "ignite.deployment.gateway.updated" | "ignite.deployment.gateway.deleted" | "project.updated" | "project.member.created" | "project.member.updated" | "project.member.deleted" | "project.tokens.created" | "project.tokens.deleted" | "project.secrets.created" | "project.secrets.updated" | "project.secrets.deleted" | "project.finance.transaction")[], projectId?: `project_${string}` | undefined): Promise; edit(webhookId: `webhook_${string}`, { events, webhookUrl, }: { webhookUrl?: string | undefined; events?: ("ignite.deployment.created" | "ignite.deployment.updated" | "ignite.deployment.deleted" | "ignite.deployment.build.created" | "ignite.deployment.build.started" | "ignite.deployment.build.updated" | "ignite.deployment.build.completed" | "ignite.deployment.build.failed" | "ignite.deployment.build.cancelled" | "ignite.deployment.rollout.created" | "ignite.deployment.rollout.updated" | "ignite.deployment.container.created" | "ignite.deployment.container.updated" | "ignite.deployment.container.metrics_update" | "ignite.deployment.container.deleted" | "ignite.deployment.healthcheck.created" | "ignite.deployment.healthcheck.updated" | "ignite.deployment.healthcheck.deleted" | "ignite.deployment.healthcheck.events.failed" | "ignite.deployment.healthcheck.events.succeeded" | "ignite.deployment.gateway.created" | "ignite.deployment.gateway.updated" | "ignite.deployment.gateway.deleted" | "project.updated" | "project.member.created" | "project.member.updated" | "project.member.deleted" | "project.tokens.created" | "project.tokens.deleted" | "project.secrets.created" | "project.secrets.updated" | "project.secrets.deleted" | "project.finance.transaction")[] | undefined; }, projectId?: `project_${string}` | undefined): Promise; delete(webhookId: `webhook_${string}`, projectId?: `project_${string}` | undefined): Promise; regenerateSecret(webhookId: `webhook_${string}`, projectId?: `project_${string}` | undefined): Promise; }; secrets: { getAll(projectId?: `project_${string}` | undefined): Promise; create(name: string, value: string, projectId?: `project_${string}` | undefined): Promise; delete(id: string, projectId?: `project_${string}` | undefined): Promise; }; }; readonly pipe: { rooms: { getAll(project?: `project_${string}` | undefined): Promise<(Room & { delete(): Promise; })[]>; create(name: string, options: { deliveryProtocols: DeliveryProtocol[]; ephemeral?: boolean; ingestProtocol: "rtmp" | "rtp"; hlsConfig?: { wcl_delay: number; artificial_delay: number; max_playout_bitrate_preset: string; }; }): Promise; }>; delete(room: `pipe_room_${string}`): Promise; }; }; readonly registry: { images: { getAll(project?: `project_${string}` | undefined): Promise; getManifest(image: string, project?: `project_${string}` | undefined): Promise<{ digest: { digest: string; size: number; uploaded: string; }; tag: string | null; }[]>; delete(image: string, project?: `project_${string}` | undefined): Promise; }; }; readonly channels: { create(type: ChannelType, id?: string | null | undefined, options?: { state?: T; } | null | undefined, project?: `project_${string}` | undefined): Promise(state: SetStateAction): Promise; patchState(state: SetStateAction): Promise; subscribeToken(token: `leap_token_${string}`): Promise; subscribeTokens(tokens: `leap_token_${string}`[] | Set<`leap_token_${string}`>): Promise; removeToken(token: `leap_token_${string}`): Promise; publishMessage(name: string, data: unknown): Promise; }>; get(id: string): Promise(state: SetStateAction): Promise; patchState(state: SetStateAction): Promise; subscribeToken(token: `leap_token_${string}`): Promise; subscribeTokens(tokens: `leap_token_${string}`[] | Set<`leap_token_${string}`>): Promise; removeToken(token: `leap_token_${string}`): Promise; publishMessage(name: string, data: unknown): Promise; }>; getAll(project?: `project_${string}` | undefined): Promise<(Channel & { setState(state: SetStateAction): Promise; patchState(state: SetStateAction): Promise; subscribeToken(token: `leap_token_${string}`): Promise; subscribeTokens(tokens: `leap_token_${string}`[] | Set<`leap_token_${string}`>): Promise; removeToken(token: `leap_token_${string}`): Promise; publishMessage(name: string, data: unknown): Promise; })[]>; subscribeToken(channel: string | Channel, token: `leap_token_${string}`): Promise; removeToken(channel: string | Channel, token: `leap_token_${string}`): Promise; subscribeTokens(channel: string | Channel, tokens: Iterable<`leap_token_${string}`>): Promise; removeTokens(channel: string | Channel, tokens: Iterable<`leap_token_${string}`>): Promise; getAllTokens(channel: string | Channel): Promise; setState(channel: string | Channel, state: SetStateAction): Promise; patchState(channel: string | Channel, state: SetStateAction): Promise; publishMessage(channel: string | Channel, event: string, data: T_5): Promise; delete(id: string): Promise; getStats(id: string): Promise<{ online_count: number; }>; tokens: { delete(token: `leap_token_${string}`): Promise; create(state?: AnyStateObject, project?: `project_${string}` | undefined): Promise; setState(id: `leap_token_${string}`, state: AnyStateObject): Promise; get(id: `leap_token_${string}`): Promise; isOnline(idOrToken: `leap_token_${string}` | ChannelToken): Promise; publishDirectMessage(token: `leap_token_${string}`, event: string, data: T_6): Promise; }; }; readonly fleet: { getNodes(projectId?: `project_${string}` | undefined): Promise<(Node & { deleteNode(): Promise; editNode(data: { schedulingState: FleetSchedulingState; }): Promise; /** * Root class containing all methods and types for interacting with the Hop platform. * This will be the entrypoint for most users of the Hop SDK. * * @public * * @example * ```ts * const hop = new Hop(bearerTokenOrPATOrProjectToken); * await hop.ignite.containers.create(deploymentId); * ``` */ regenerateToken(): Promise; })[]>; createNode(name: string, schedulingState: FleetSchedulingState, projectId?: `project_${string}` | undefined): Promise<{ node: Node & { deleteNode(): Promise; editNode(data: { schedulingState: FleetSchedulingState; }): Promise; /** * Root class containing all methods and types for interacting with the Hop platform. * This will be the entrypoint for most users of the Hop SDK. * * @public * * @example * ```ts * const hop = new Hop(bearerTokenOrPATOrProjectToken); * await hop.ignite.containers.create(deploymentId); * ``` */ regenerateToken(): Promise; }; token: string; }>; regenerateToken(nodeId: `fleet_node_${string}`, projectId: `project_${string}`): Promise; editNode(nodeId: `fleet_node_${string}`, data: { schedulingState: FleetSchedulingState; }, projectId?: `project_${string}` | undefined): Promise; deleteNode(nodeId: `fleet_node_${string}`, projectId?: `project_${string}` | undefined): Promise; }; constructor(options: PartialAPIOptions); constructor(authentication: APIAuthentication, baseurl?: string); } /** * A list of all permissions and their representative names * @public */ declare enum PROJECT_PERMISSION { ADD_MEMBER = "add_member", REMOVE_MEMBER = "remove_member", GET_PROJECT_MEMBERS = "get_project_members", DELETE_PROJECT = "delete_project", DELETE_DEPLOYMENT = "delete_deployment", DELETE_CONTAINER = "delete_container", UPDATE_CONTAINER_STATE = "update_container_state", READ_DEPLOYMENTS = "read_deployments", CREATE_DEPLOYMENT = "create_deployment", CREATE_CONTAINER = "create_container", UPDATE_CONTAINER_CONFIG = "update_container_config", CREATE_ROOM = "create_room", READ_ROOM = "read_room", DELETE_ROOM = "delete_room", CREATE_ROOM_PRODUCER = "create_room_producer", CREATE_PROJECT_TOKEN = "create_project_token", DELETE_PROJECT_TOKEN = "delete_project_token", READ_PROJECT_TOKENS = "read_project_tokens", READ_CONTAINER_LOGS = "read_container_logs", CREATE_PROJECT_SECRET = "create_project_secret", READ_PROJECT_SECRETS = "read_project_secrets", DELETE_PROJECT_SECRET = "delete_project_secret", GET_REGISTRY_IMAGES = "get_registry_images", CREATE_CHANNEL = "create_channel", CREATE_CHANNEL_TOKEN = "create_channel_token", CREATE_LEAP_TOKEN = "create_leap_token", CREATE_GATEWAY = "create_gateway", ADD_DOMAIN = "add_domain", DELETE_CHANNELS = "delete_channels", UPDATE_CHANNEL_STATE = "update_channel_state", PUBLISH_CHANNEL_MESSAGES = "publish_channel_messages", READ_CHANNELS = "read_channels", READ_LEAP_TOKENS = "read_leap_tokens", MANAGE_CHANNEL_SUBSCRIBERS = "manage_channel_subscribers", UPDATE_LEAP_TOKEN = "update_leap_token", DELETE_DOMAIN = "delete_domain", DELETE_GATEWAY = "delete_gateway", GET_INTERNAL_DOMAIN = "get_internal_domain", MESSAGE_TOKEN = "message_token", ROLLOUT = "rollout", REQUEST_QUOTA_INCREASE = "request_quota_increase", READ_BILLING = "read_billing", READ_GATEWAYS = "read_gateways", DELETE_REGISTRY_IMAGES = "delete_registry_images", CONTAINER_SSH = "container_ssh", TUNNEL_DEPLOYMENT = "tunnel_deployment", CREATE_WEBHOOK = "create_webhook", DELETE_WEBHOOK = "delete_webhook", UPDATE_WEBHOOK = "update_webhook", READ_WEBHOOKS = "read_webhooks" } /** * Individual bitwise permissions * @public */ declare const permissionsMap: { add_member: bigint; remove_member: bigint; get_project_members: bigint; delete_project: bigint; delete_deployment: bigint; delete_container: bigint; update_container_state: bigint; read_deployments: bigint; create_deployment: bigint; create_container: bigint; update_container_config: bigint; create_room: bigint; read_room: bigint; delete_room: bigint; create_room_producer: bigint; create_project_token: bigint; delete_project_token: bigint; read_project_tokens: bigint; read_container_logs: bigint; create_project_secret: bigint; read_project_secrets: bigint; delete_project_secret: bigint; get_registry_images: bigint; create_channel_token: bigint; create_gateway: bigint; add_domain: bigint; delete_channels: bigint; update_channel_state: bigint; read_channels: bigint; publish_channel_messages: bigint; manage_channel_subscribers: bigint; delete_domain: bigint; delete_gateway: bigint; get_internal_domain: bigint; create_leap_token: bigint; read_leap_tokens: bigint; update_leap_token: bigint; message_token: bigint; create_channel: bigint; rollout: bigint; request_quota_increase: bigint; read_billing: bigint; read_gateways: bigint; delete_registry_images: bigint; container_ssh: bigint; tunnel_deployment: bigint; create_webhook: bigint; delete_webhook: bigint; update_webhook: bigint; read_webhooks: bigint; }; /** * Broader permission map * @public */ declare const BROAD_PERMISSIONS_MAP: { MANAGE_MEMBERS: bigint; MANAGE_PROJECT_TOKENS: bigint; MANAGE_DEPLOYMENTS: bigint; MANAGE_PIPE: bigint; MANAGE_SECRETS: bigint; MANAGE_CHANNELS: bigint; MANAGE_REGISTRY: bigint; READ_ONLY: bigint; MANAGE_QUOTAS: bigint; MANAGE_ROLLOUTS: bigint; MANAGE_BILLING: bigint; MANAGE_WEBHOOKS: bigint; }; /** * Bitwise role flags that a user can be as part of a project * @public */ declare const roles: { viewer: bigint; editor: bigint; owner: bigint; }; /** * Permission utility functions * @public */ declare const permissions: { add(value: bigint, flag: bigint): bigint; test(value: bigint, flag: bigint): boolean; subtract(value: bigint, flag: bigint): bigint; }; /** * Ignite SDK client * @public */ declare const ignite: (client: APIClient) => { groups: { create(name: string, options?: Partial<{ deploymentIds: Id<'deployment'>[]; position: number; }>, projectId?: Id<'project'>): Promise; edit(groupId: Id<'deployment_group'>, { name, position, }: { name?: string | undefined; position?: number | undefined; }, projectId?: Id<'project'>): Promise; /** * Moves a deployment to a group, or removes it if groupId is null */ move(deploymentId: Id<'deployment'>, groupId: Id<'deployment_group'> | null, projectId?: Id<'project'>): Promise; delete(groupId: Id<'deployment_group'>, projectId?: Id<'project'>): Promise; }; domains: { delete: (id: Id<'domain'>) => Promise; get: (id: Id<'domain'>) => Promise; }; gateways: { /** * Adds a domain to a gateway * * @param gatewayId - The ID of the gateway * @param domain - The full name of the domain */ addDomain(gatewayId: Id<'gateway'>, domain: string): Promise; /** * Fetches a gateway by ID * * @param gatewayId - The ID of the gateway to retrieve */ get(gatewayId: Id<'gateway'>): Promise; /** * Fetches all gateways attached to a deployment * * @param deploymentId - The ID of the deployment to fetch gateways for */ getAll(deploymentId: Id<'deployment'>): Promise<(Gateway & { addDomain(domain: string): Promise; deleteDomain(domainId: Id<'domain'>): Promise; })[]>; /** * Creates and attaches a gateway to a deployment * * @param deployment - The deployment to create a gateway on * @param type - The type of the gateway to create, either internal or external * @param protocol - The protocol that the gateway will listen for * @param targetPort - The port to listen on */ create(deployment: Deployment | Deployment['id'], config: { type: GatewayType.EXTERNAL; protocol: Gateway['protocol']; targetPort: number; name: string; } | { type: GatewayType.INTERNAL; protocol: Gateway['protocol']; targetPort: number; name: string; internalDomain: string; }): Promise; deleteDomain(domainId: Id<'domain'>): Promise; }>; }; healthChecks: { create: (deployment: Id<'deployment'>, config: Omit) => Promise; update: (deployment: Id<'deployment'>, config: Partial>) => Promise; }; deployments: { create: { (configOrProject: Id<'project'>, bearerOrPatConfig: CreateDeploymentConfig): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: Id<'domain'>): Promise; }>; getStorageStats(): Promise | null>>; }>; (configOrProject: CreateDeploymentConfig): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: Id<'domain'>): Promise; }>; getStorageStats(): Promise | null>>; }>; }; get: { (name: string, projectId?: Id<'project'>): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: Id<'domain'>): Promise; }>; getStorageStats(): Promise | null>>; }>; (id: Id<'deployment'>, projectId?: Id<'project'>): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: Id<'domain'>): Promise; }>; getStorageStats(): Promise | null>>; }>; }; rollout(id: Id<'deployment'>): Promise; getStorageStats(id: Id<'deployment'>): Promise | null>>; update(deploymentId: Id<'deployment'>, config: Partial): Promise; /** * Get all containers for a deployment * * @param deployment - The ID of the deployment to get * @returns A list of all containers for that project */ getContainers(deployment: Id<'deployment'>): Promise; /** * Gets all deployments for a project * * @param projectId - The project ID to list deployments for. You only need to provide this if you are using bearer or PAT authentication. * @returns A list of deployments for the given project. */ getAll(projectId?: Id<'project'>): Promise<{ deployments: (Deployment & { getContainers(): Promise; delete(): Promise; createContainer(): Promise; createGateway(config: { type: GatewayType.EXTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; } | { type: GatewayType.INTERNAL; protocol: Gateway['protocol']; name: string; targetPort: number; internalDomain: string; }): Promise; deleteDomain(domainId: Id<'domain'>): Promise; }>; getStorageStats(): Promise | null>>; })[]; groups: Group[]; }>; /** * Deletes a deployment * * @param deployment - The ID of the deployment */ delete(deployment: Id<'deployment'>): Promise; patchMetadata(deploymentId: Id<'deployment'>, metadata: Partial): Promise; }; containers: { delete: { (container_id: Id<'container'>, options: { recreate: true; }): Promise; (container_id: Id<'container'>, options?: { recreate?: false; }): Promise; }; /** * Get the logs for a container * * @param container - The ID of the container * @returns */ getLogs(container: Id<'container'>, options?: Partial<{ sortBy: 'timestamp'; orderBy: 'desc' | 'asc'; limit: number; offset: number; }>): Promise; /** * Stop a container * @param container - The ID of the container */ stop(container: Id<'container'>): Promise; /** * Start a container * @param container - The ID of the container */ start(container: Id<'container'>): Promise; /** * Creates a container * * @param deployment - The ID of a deployment to create a container in. * @returns The newly created container. */ create(deployment: Id<'deployment'>): Promise; }; }; /** * Pipe SDK client * @public */ declare const pipe: (client: APIClient) => { rooms: { getAll(project?: Id<'project'>): Promise<(Room & { delete(): Promise; })[]>; create(name: string, options: { deliveryProtocols: DeliveryProtocol[]; ephemeral?: boolean; ingestProtocol: 'rtmp' | 'rtp'; hlsConfig?: { wcl_delay: number; artificial_delay: number; max_playout_bitrate_preset: string; }; }): Promise; }>; /** * Deletes a Pipe room * * @param room - The ID of the Pipe room to delete. */ delete(room: Id<'pipe_room'>): Promise; }; }; /** * Projects SDK client * @public */ declare const projects: (client: APIClient) => { getAllMembers(projectId?: Id<'project'>): Promise; /** * Fetch the currently authorized member from a project. * You cannot use this route if you are authorizing with a project token as there is no user attached to it. * * @param projectId - The project ID to fetch a member from * @returns The member authorized by the SDK */ getCurrentMember(projectId: Id<'project'>): Promise; /** * @deprecated Use {@link projectsSDK.tokens} instead */ projectTokens: { /** * Deletes a project token by its ID * * @param projectTokenId - The ID of the project token to delete */ delete(projectTokenId: Id<'ptkid'>, project?: Id<'project'>): Promise; /** * Get all project tokens for a project * * @param projectId - The project to fetch secrets for * @returns An array of all secrets for the project */ get(projectId?: Id<'project'>): Promise; /** * Creates a new project token * * @param projectId - The project to create a key for * @param flags - Permissions for this flag * @returns A newly created project token */ create(flags: number, projectId?: Id<'project'>): Promise; }; tokens: { /** * Deletes a project token by its ID * * @param projectTokenId - The ID of the project token to delete */ delete(projectTokenId: Id<'ptkid'>, project?: Id<'project'>): Promise; /** * Get all project tokens for a project * * @param projectId - The project to fetch secrets for * @returns An array of all secrets for the project */ get(projectId?: Id<'project'>): Promise; /** * Creates a new project token * * @param projectId - The project to create a key for * @param flags - Permissions for this flag * @returns A newly created project token */ create(flags: number, projectId?: Id<'project'>): Promise; }; webhooks: { constructEvent: typeof constructEvent; getAll(projectId?: Id<'project'>): Promise; create(webhook_url: string, events: PossibleWebhookIDs[], projectId?: Id<'project'>): Promise; edit(webhookId: Id<'webhook'>, { events, webhookUrl, }: { webhookUrl?: string | undefined; events?: PossibleWebhookIDs[] | undefined; }, projectId?: Id<'project'>): Promise; delete(webhookId: Id<'webhook'>, projectId?: Id<'project'>): Promise; regenerateSecret(webhookId: Id<'webhook'>, projectId?: Id<'project'>): Promise; }; secrets: { /** * Gets all secrets in a project * * @param projectId - The project to fetch secrets for */ getAll(projectId?: Id<'project'>): Promise; /** * Creates a new project secret * * @param name - The name of the secret * @param value - The value of the secret * @param projectId - The project to create the secret in */ create(name: string, value: string, projectId?: Id<'project'>): Promise; /** * Deletes a secret from a project * * @param id - The secret ID to delete * @param projectId - The project to delete the secret from */ delete(id: Id<'secret'> | Secret['name'], projectId?: Id<'project'>): Promise; }; }; /** * Registry SDK client * @public */ declare const registry: (client: APIClient) => { images: { getAll(project?: Id<'project'>): Promise; getManifest(image: string, project?: Id<'project'>): Promise<{ digest: { digest: string; size: number; uploaded: string; }; tag: string | null; }[]>; delete(image: string, project?: Id<'project'>): Promise; }; }; /** * Users SDK client * @public */ declare const users: (client: APIClient) => { me: { /** * Gets the current user * * @returns The current user authorized by the SDK */ get(): Promise<{ projects: Project[]; user: SelfUser; project_member_role_map: Record<`project_${string}`, MemberRole>; leap_token: string | null; }>; pats: { /** * Creates a PAT for the current user * * @returns The created PAT */ create(name: string): Promise; /** * Fetches all PATs for this user * * @returns A list of all pats */ getAll(): Promise; /** * Deletes a pat * * @param id - The ID of the pat to delete */ delete(id: Id<'pat'>): Promise; }; }; }; declare const fleet: (client: APIClient) => { getNodes(projectId?: Id<'project'>): Promise<(Node & { deleteNode(): Promise; editNode(data: { schedulingState: FleetSchedulingState; }): Promise; regenerateToken(): Promise; })[]>; createNode(name: string, schedulingState: FleetSchedulingState, projectId?: Id<'project'>): Promise<{ node: Node & { deleteNode(): Promise; editNode(data: { schedulingState: FleetSchedulingState; }): Promise; regenerateToken(): Promise; }; token: string; }>; regenerateToken(nodeId: Id<'fleet_node'>, projectId: Id<'project'>): Promise; editNode(nodeId: Id<'fleet_node'>, data: { schedulingState: FleetSchedulingState; }, projectId?: Id<'project'>): Promise; deleteNode(nodeId: Id<'fleet_node'>, projectId?: Id<'project'>): Promise; }; type index_SetStateAction = SetStateAction; declare const index_channels: typeof channels; declare const index_fleet: typeof fleet; declare const index_ignite: typeof ignite; declare const index_pipe: typeof pipe; declare const index_projects: typeof projects; declare const index_registry: typeof registry; declare const index_users: typeof users; declare namespace index { export { index_SetStateAction as SetStateAction, index_channels as channels, index_fleet as fleet, index_ignite as ignite, index_pipe as pipe, index_projects as projects, index_registry as registry, index_users as users, }; } export { api as API, APIAuthentication, APIAuthenticationPrefix, APIClient, APIClientOptions, AnyStateObject, BROAD_PERMISSIONS_MAP, Channel, ChannelToken, ChannelType, channels$1 as Channels, Container, ContainerLog, ContainerState, CreateDeploymentConfig, DEFAULT_BASE_URL, DeliveryProtocol, Deployment, DeploymentConfig, DeploymentMetadata, DeploymentRollout, Domain, Endpoint, Endpoints, ErroredAPIResponse, ExtractEndpoint, ExtractRouteParams, FleetSchedulingState, Gateway, GatewayType, Group, HealthCheck, Hop, HopAPIError, IS_BROWSER, Id, ignite$1 as Ignite, Member, MemberRole, Method, Node, PAT, PROJECT_PERMISSION, PartialAPIOptions, PathsFor, pipe$1 as Pipe, PossibleWebhookIDs, Project, ProjectToken, projects$1 as Projects, Query, Regions, registry$1 as Registry, Room, SUPPORTS_INTL, Secret, SelfUser, Timestamp, users$1 as Users, Webhook, constructEvent, permissions, permissionsMap, roles, index as sdks, validateAPIAuthentication };