/// /// import { OpenIdConnect } from "./OpenIdConnect"; import { UserService } from "./UserService"; import { SpaceService } from "./SpaceService"; import { TeamService } from "./TeamService"; import { PermissionsService } from "./PermissionsService"; import { InvitationService } from "./InvitationService"; import { PlanService } from "./PlanService"; import { BillingPageTokenService } from "./BillingPageTokenService"; import { BusinessService } from "./BusinessService"; import { NotificationService } from "./NotificationService"; import { type AxiosProxyConfig } from "axios"; import pino from "pino"; import { UserRolesService } from "./UserRolesService"; import http from "http"; import https from "https"; import { LensDesktopKubeService } from "./LensDesktopKubeService"; import { DemoClusterService } from "./DemoClusterService"; import { SSOService } from "./SSOService"; export interface LensPlatformClientOptions { accessToken?: string; getAccessToken?: (url?: string) => Promise; keyCloakAddress: string; keycloakRealm: string; apiEndpointAddress: string; defaultHeaders?: RequestHeaders; httpAdapter?: boolean; logLevel?: "error" | "silent" | "debug"; /** * Proxy configs to be passed to axios. */ proxyConfigs?: AxiosProxyConfig; /** * HTTP agent to be used by axios. */ httpAgent?: http.Agent; /** * HTTPS agent to be used by axios. */ httpsAgent?: https.Agent; } type RequestHeaders = Record; interface DecodedAccessToken { acr: string; "allowed-origins": string[]; aud: string; auth_time: number; azp: "string"; email?: string; email_verified?: boolean; exp: number; given_name?: string; iat: number; iss: string; jti: string; name?: string; nonce: string; preferred_username: string; realm_access: { roles: string[]; }; resource_access: { roles: string[]; }; scope: string; session_state: string; sub: string; typ: string; } declare class LensPlatformClient { accessToken: LensPlatformClientOptions["accessToken"]; getAccessToken: LensPlatformClientOptions["getAccessToken"]; keyCloakAddress: LensPlatformClientOptions["keyCloakAddress"]; keycloakRealm: LensPlatformClientOptions["keycloakRealm"]; apiEndpointAddress: LensPlatformClientOptions["apiEndpointAddress"]; httpAdapter: LensPlatformClientOptions["httpAdapter"]; logLevel: LensPlatformClientOptions["logLevel"]; proxyConfigs: LensPlatformClientOptions["proxyConfigs"]; httpAgent: LensPlatformClientOptions["httpAgent"]; httpsAgent: LensPlatformClientOptions["httpsAgent"]; logger: pino.Logger; user: UserService; lensDesktopKube: LensDesktopKubeService; demoCluster: DemoClusterService; space: SpaceService; roles: UserRolesService; team: TeamService; plan: PlanService; billingPageToken: BillingPageTokenService; business: BusinessService; notification: NotificationService; permission: PermissionsService; invitation: InvitationService; openIDConnect: OpenIdConnect; defaultHeaders: RequestHeaders | undefined; sso: SSOService; constructor(options: LensPlatformClientOptions); getToken(url?: string): Promise; getDecodedAccessToken(): Promise; get authHeader(): Record; /** * A proxied version of request library that * * 1) Prints request/response in console (for developer to debug issues) * 2) Auto add `Authorization: Bearer [token]` * */ get fetch(): import("axios").AxiosStatic; } export type { LensPlatformClient as LensPlatformClientType }; export default LensPlatformClient;