UNPKG

@salesforce/core

Version:

Core libraries to interact with SFDX projects, orgs, and APIs.

61 lines (60 loc) 1.8 kB
import { AsyncCreatable } from '@salesforce/kit'; import { OAuth2Config } from '@jsforce/jsforce-node'; import { JsonMap, Nullable } from '@salesforce/ts-types'; import { AuthInfo } from './org/authInfo'; /** * @deprecated Will be removed mid January 2026 */ export type DeviceCodeResponse = { device_code: string; interval: number; user_code: string; verification_uri: string; } & JsonMap; /** * @deprecated Will be removed mid January 2026 */ export type DeviceCodePollingResponse = { access_token: string; refresh_token: string; signature: string; scope: string; instance_url: string; id: string; token_type: string; issued_at: string; } & JsonMap; /** * THIS CLASS IS DEPRECATED AND WILL BE REMOVED MID JANUARY 2026. * * @deprecated Use other oauth flows instead */ export declare class DeviceOauthService extends AsyncCreatable<OAuth2Config> { static RESPONSE_TYPE: string; static GRANT_TYPE: string; static SCOPE: string; private static POLLING_COUNT_MAX; private logger; private options; private pollingCount; constructor(options: OAuth2Config); /** * @deprecated Will be removed mid January 2026 */ requestDeviceLogin(): Promise<DeviceCodeResponse>; /** * @deprecated Will be removed mid January 2026 */ awaitDeviceApproval(loginData: DeviceCodeResponse): Promise<Nullable<DeviceCodePollingResponse>>; /** * @deprecated Will be removed mid January 2026 */ authorizeAndSave(approval: DeviceCodePollingResponse): Promise<AuthInfo>; protected init(): Promise<void>; private getLoginOptions; private getPollingOptions; private getDeviceFlowRequestUrl; private poll; private shouldContinuePolling; private pollForDeviceApproval; }