export declare const AUTH0_CLIENT_ID = "mBtwLFVm39GVZ1HpSRBSdRiLFucYxmMb"; export interface DeviceAuthorization { deviceCode: string; userCode: string; verificationUri: string; verificationUriComplete: string; /** Epoch milliseconds after which the device code is no longer valid. */ expiresAt: number; intervalMs: number; } export interface DeviceTokens { accessToken: string; idToken: string; } export interface OAuthResponse { status: number; data: any; } export interface DeviceFlowDeps { /** Must resolve for non-2xx responses too; the flow reads OAuth error codes from the body. */ post: (url: string, params: URLSearchParams) => Promise; sleep: (ms: number) => Promise; now: () => number; } export declare class DeviceFlowError extends Error { readonly code: string; constructor(code: string, message: string, options?: ErrorOptions); } /** The Auth0 client does not have the device_code grant enabled. */ export declare class DeviceFlowNotAllowedError extends DeviceFlowError { constructor(message: string); } export declare class DeviceFlow { #private; constructor(deps?: Partial); requestAuthorization(): Promise; /** * Polls until the user approves or the code expires. When the answers keep * coming from something other than the login server (a proxy or captive * portal), `onUnexpectedAnswers` is called once per such run with the latest one, and * polling goes on: the user may still be getting past a captive portal, * and the code stays valid. If the code expires during such a run, the * error is a `network_error` rather than `expired_token`. */ pollForTokens(auth: DeviceAuthorization, { onUnexpectedAnswers }?: { onUnexpectedAnswers?: (failure: string) => void; }): Promise; /** * A single token request without waiting, so a caller can check a stored * code and return at once. `tokens` once the user has approved; otherwise * `failure` says why the login server could not answer, if it could not * (the user may then have approved without the CLI seeing it yet). */ pollOnce(auth: DeviceAuthorization): Promise<{ tokens?: DeviceTokens; failure?: string; }>; }