41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { CTYunZone, ReqOptionProps } from '../../types/CTYun';
|
||
export declare class CTYunInstance {
|
||
private accessKey;
|
||
private secretKey;
|
||
constructor(accessKey: string, secretKey: string);
|
||
getUploadInfo(bucket: string, zone: CTYunZone, key?: string): {
|
||
key: string | undefined;
|
||
accessKey: string;
|
||
policy: string;
|
||
signature: string;
|
||
uploadHost: string;
|
||
bucket: string;
|
||
};
|
||
getSignInfo(bucket: string): {
|
||
encodePolicy: string;
|
||
signature: string;
|
||
};
|
||
private base64ToUrlSafe;
|
||
private hmacSha1;
|
||
private urlSafeBase64Encode;
|
||
removeFile(bucket: string, zone: CTYunZone, key: string): Promise<void>;
|
||
isExistObject(srcBucket: string, zone: CTYunZone, srcKey: string): Promise<boolean>;
|
||
getAuthorization(reqOptions: ReqOptionProps, zone: CTYunZone): string;
|
||
private getSignatureKey;
|
||
private buildCanonicalRequest;
|
||
private buildCanonicalQueryString;
|
||
private calculatePayloadHash;
|
||
/**
|
||
* 获取预签名对象URL(统一接口)
|
||
* 生成天翼云对象的预签名访问URL(兼容 AWS S3 Signature V4)
|
||
*/
|
||
presignObjectUrl(method: 'GET' | 'PUT' | 'POST' | 'DELETE', bucket: string, zone: CTYunZone, key: string, options?: {
|
||
expires?: number;
|
||
contentType?: string;
|
||
}): Promise<{
|
||
url: string;
|
||
headers?: Record<string, string | string[]>;
|
||
formdata?: Record<string, any>;
|
||
}>;
|
||
}
|