export interface PangolinSite { siteId: string; name: string; orgId: string; niceId: string; pubKey?: string; subnet?: string; megabytesIn?: number; megabytesOut?: number; lastSeen?: string; online?: boolean; type?: string; address?: string; } export interface PangolinExitNode { exitNodeId: string; name: string; location?: string; region?: string; online: boolean; capacity?: number; latency?: number; } export interface PangolinResource { resourceId: string; name: string; subdomain?: string; fullDomain?: string; ssl?: boolean; blockAccess?: boolean; active?: boolean; proxyPort?: number; protocol?: string; domainBindings?: string[]; http?: boolean; targets?: PangolinTarget[]; } export interface PangolinTarget { targetId: string; resourceId: string; siteId: string; ip: string; port: number; method: string; enabled?: boolean; } export interface PangolinNewt { newtId: string; secret: string; siteId: string; } export interface PangolinSiteDefaults { newtId: string; newtSecret: string; address: string; } export interface CreateSitePayload { name: string; type?: string; subnet?: string; exitNodeId?: string; newtId?: string; secret?: string; address?: string; } export interface CreateHttpResourcePayload { name: string; domainId: string; subdomain: string; http: true; protocol: 'tcp'; } export interface CreateTargetPayload { siteId: string | number; ip: string; port: number; method: 'http' | 'https'; enabled?: boolean; } export interface PangolinDomain { domainId: string; baseDomain: string; verified: boolean; type?: string; failed?: boolean; configManaged?: boolean; } export interface UpdateResourcePayload { name?: string; subdomain?: string; fullDomain?: string; ssl?: boolean; sso?: boolean; active?: boolean; blockAccess?: boolean; proxyPort?: number; protocol?: string; domainBindings?: string[]; } export interface PangolinCertificate { certId: string; domainId: string; domain: string; status: 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'FAILED'; issuedAt?: string; expiresAt?: string; autoRenew?: boolean; issuer?: string; } export interface UpdateCertificatePayload { autoRenew?: boolean; } export interface PangolinConnectedClient { clientId: string; resourceId: string; ipAddress: string; connectedAt: string; lastSeen: string; bytesIn: number; bytesOut: number; online: boolean; } declare class PangolinClient { private get baseUrl(); private get apiKey(); private get orgId(); get configured(): boolean; private request; /** * Unwrap Pangolin's response envelope: { data: {...}, success, status } * Returns the inner data object, or the raw response if not wrapped. */ private unwrapResponse; healthCheck(): Promise; /** * Get pre-generated Newt credentials for a new site. * Must be called BEFORE createSite() and passed into it. * Endpoint: GET /org/{orgId}/pick-site-defaults */ pickSiteDefaults(): Promise; listSites(): Promise; listExitNodes(): Promise; getSite(siteId: string): Promise; createSite(data: CreateSitePayload): Promise; deleteSite(siteId: string): Promise; /** * List HTTP proxy resources (public resources). * Endpoint: GET /org/{orgId}/resources (NOT /site-resources) */ listResources(): Promise; getResource(resourceId: string): Promise; /** * Create an HTTP proxy resource (public resource). * Endpoint: PUT /org/{orgId}/resource (NOT /site-resource) */ createResource(data: CreateHttpResourcePayload): Promise; updateResource(resourceId: string, data: UpdateResourcePayload): Promise; deleteResource(resourceId: string): Promise; /** * Create a target for a resource (routes traffic to a backend). * Endpoint: PUT /resource/{resourceId}/target (PUT, not POST) */ createTarget(resourceId: string, data: CreateTargetPayload): Promise; /** * List targets for a resource. * Endpoint: GET /resource/{resourceId}/targets (plural — NOT /target) */ listTargets(resourceId: string): Promise; /** * Delete a target by ID. * Endpoint: DELETE /target/{targetId} (NOT nested under /resource/) */ deleteTarget(targetId: string): Promise; listDomains(): Promise; getCertificate(domainId: string, domain: string): Promise; updateCertificate(certId: string, data: UpdateCertificatePayload): Promise; listClients(resourceId: string): Promise; /** * Extract an array from a Pangolin response that may be: * - A direct array * - An object with the array under a named key (e.g., { sites: [...] }) * - An object with { data: [...] } */ private extractArray; } export declare const pangolinClient: PangolinClient; export {}; //# sourceMappingURL=pangolin.client.d.ts.map