node-socialite
Version:
Socialite is an OAuth2 authentication tool for Node.js
35 lines (34 loc) • 1.43 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;
/**
* 开启获取用户敏感信息(仅在 scope 为 snsapi_privateinfo 时有效)
*/
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(token: string, userId: string): Promise<Record<string, any>>;
protected getUserDetail(token: string, userTicket: string): Promise<Record<string, any>>;
getAuthUrl(): string;
getTokenUrl(): string;
getUserByToken(token: string): Promise<Record<string, any>>;
mapUserToObject(user: Record<string, any>): User;
}