UNPKG

node-socialite

Version:

Socialite is an OAuth2 authentication tool for Node.js

37 lines (36 loc) 1.46 kB
import { ProviderConfig } from "../../types/global"; import { BaseProvider } from "../Core/BaseProvider"; import { User } from "../Core/User"; /** * @see [网页授权登录](https://developer.work.weixin.qq.com/document/path/91119) */ export declare class OpenWeWork extends BaseProvider { static NAME: string; protected _detailed: boolean; protected _asQrcode: boolean; protected _userType: string; protected _lang: string; protected _suiteTicket: string; protected _agentId: number; protected _suiteAccessToken: string; protected _baseUrl: string; constructor(config: ProviderConfig); getBaseUrl(): string; setAgentId(agentId: number): this; withAgentId(agentId: number): this; detailed(): this; asQrcode(): this; withUserType(userType: string): this; withLang(lang: string): this; withSuiteTicket(suiteTicket: string): this; withSuiteAccessToken(suiteAccessToken: string): this; userFromCode(code: string): Promise<User>; protected getSuiteAccessToken(): Promise<string>; protected createSuiteAccessToken(): Promise<string>; protected getUser(token: string, code: string): Promise<Record<string, any>>; protected getUserByTicket(userTicket: string): Promise<Record<string, any>>; getAuthUrl(): string; getTokenUrl(): string; getUserByToken(token: string): Promise<Record<string, any>>; mapUserToObject(user: Record<string, any>): User; }