oak-external-sdk/lib/service/local/Local.d.ts

33 lines
1.1 KiB
TypeScript

export declare class LocalInstance {
private accessKey;
private secretKey;
constructor(accessKey: string, secretKey: string);
/**
* 计算客户端上传本地服务器需要的凭证
* @param bucket
* @param key
* @returns
*/
getUploadInfo(bucket: string, key?: string): {
key: string | undefined;
uploadToken: string;
bucket: string;
};
/**
* 管理端访问七牛云服务器
* @param path
* @param method
* @param headers
* @param body
*/
private access;
private generateUploadToken;
verifyUploadToken(uploadToken: string): boolean | string;
generateAccessToken(method: string, host: string, path: string, headers: Record<string, any>, query?: string | null, body?: RequestInit['body']): string;
verifyAccessToken(accessToken: string, method: string, host: string, path: string, headers: Record<string, any>, query?: string | null, body?: RequestInit['body']): boolean;
private base64ToUrlSafe;
private hmacSha1;
private urlSafeBase64Encode;
private urlSafeBase64Decode;
}