@amplitude/ampli
Version:
Amplitude CLI
33 lines (32 loc) • 1.16 kB
TypeScript
import * as OAuth2 from 'client-oauth2';
import { UserId } from '../settings';
import { Zone } from '../types';
declare class Auth {
private oauth2;
oauth2Token: OAuth2.Token | null | undefined;
private authorizationState?;
private authorizationSucceeded?;
private authorizationFailed?;
private apiToken;
private withOrg;
private authUserId;
pkceChallenge?: {
code_challenge: string;
code_verifier: string;
};
private fetchAgent?;
getOAuth2(zone: Zone): OAuth2;
private get isActiveAuthMethod();
writeTokensToSettings(userId: UserId): void;
getAccessToken(): Promise<string>;
getAuthorizationUri(port: number, zone: Zone): string;
waitForAuthorizationToComplete(): Promise<void>;
processAuthorizationCode(code: string, state: string, port: number): Promise<void>;
authenticate(apiToken: string | undefined, userId: UserId | undefined, withOrg: string | undefined): void;
getHttpHeaders(): Promise<Record<string, string>>;
private refreshToken;
private static getOAuth2Options;
private request;
}
declare const _default: Auth;
export default _default;