node-socialite
Version:
Socialite is an OAuth2 authentication tool for Node.js
31 lines (30 loc) • 1.21 kB
TypeScript
import { ProviderConfig } from "../../types/global";
import { BaseProvider } from "../Core/BaseProvider";
import { User } from "../Core/User";
/**
* @see [网页授权登录](https://developer.work.weixin.qq.com/document/path/91335)
*/
export declare class WeWork extends BaseProvider {
static NAME: string;
protected _detailed: boolean;
protected _asQrcode: boolean;
protected _agentId: number;
protected _apiAccessToken: string;
protected _baseUrl: string;
constructor(config: ProviderConfig);
getBaseUrl(): string;
setAgentId(agentId: number): this;
withAgentId(agentId: number): this;
detailed(): this;
asQrcode(): this;
withApiAccessToken(apiAccessToken: string): this;
userFromCode(code: string): Promise<User>;
protected getApiAccessToken(): Promise<string>;
protected createApiAccessToken(): Promise<string>;
protected getUser(token: string, code: string): Promise<Record<string, any>>;
protected getUserById(userId: string): Promise<Record<string, any>>;
getAuthUrl(): string;
getTokenUrl(): string;
getUserByToken(token: string): Promise<Record<string, any>>;
mapUserToObject(user: Record<string, any>): User;
}