UNPKG

@xuanqikai/one-click-upload

Version:

A CLI tool for one-click file upload to cloud storage services (OSS, TOS)

67 lines 1.77 kB
import { CDNConfig, CDNRefreshResult, CDNRefreshTask } from '../types'; /** * 阿里云 CDN 缓存刷新服务 * 基于阿里云 CDN API 实现缓存刷新功能 */ export declare class CDNRefreshService { private config; private endpoint; constructor(config: CDNConfig); /** * 刷新单个 URL 的缓存 */ refreshUrl(url: string): Promise<CDNRefreshResult>; /** * 刷新目录的缓存 */ refreshDirectory(dirUrl: string): Promise<CDNRefreshResult>; /** * 预热单个 URL */ preloadUrl(url: string, options?: { area?: 'domestic' | 'overseas'; l2Preload?: boolean; withHeader?: Record<string, string[]>; queryHashkey?: boolean; consistencyHash?: boolean; }): Promise<CDNRefreshResult>; /** * 批量预热 URL */ preloadUrls(urls: string[], options?: { area?: 'domestic' | 'overseas'; l2Preload?: boolean; withHeader?: Record<string, string[]>; queryHashkey?: boolean; consistencyHash?: boolean; }): Promise<CDNRefreshResult[]>; /** * 批量刷新 URL 缓存 */ refreshUrls(urls: string[]): Promise<CDNRefreshResult[]>; /** * 查询刷新任务状态 */ getRefreshTaskStatus(taskId: string): Promise<CDNRefreshTask | null>; /** * 查询刷新配额 */ getRefreshQuota(): Promise<any>; /** * 构建完整的 CDN URL */ buildCDNUrl(remotePath: string): string; /** * 发送 API 请求 */ private makeRequest; /** * 生成 API 签名 */ private generateSignature; /** * 验证配置 */ validateConfig(): Promise<boolean>; } //# sourceMappingURL=CDNRefreshService.d.ts.map