wechat-work
Version:
sdk for work.weixin.qq.com/api/doc.
23 lines (22 loc) • 1.02 kB
TypeScript
import { IConfig } from "./config.interface";
import { EnumSecretType } from "./secret-type.enum";
export declare class AccessToken {
static getInstance(config: IConfig, secretType: EnumSecretType, agentId?: string): Promise<AccessToken>;
static deSerialize(serialized: string, ttlSeconds?: number): AccessToken;
static fetch(corpId: string, secret: string, secretType: EnumSecretType, agentId?: string): Promise<AccessToken>;
static getStorageKey(corpId: string, secretType: EnumSecretType, agentId?: string): string;
private static getSecret;
corpId: string;
accessToken: string;
expiresIn: number;
createdAt: number;
expiresAt: number;
secretType: EnumSecretType;
agentId?: string;
config?: IConfig;
constructor(corpId: string, accessToken: string, expiresIn: number, secretType: EnumSecretType, agentId?: string, config?: IConfig);
isExpired(): boolean;
readonly storageKey: string;
readonly serialized: string;
ensureNotExpired(): Promise<void>;
}