t-comm
Version:
专业、稳定、纯粹的工具库
51 lines (50 loc) • 1.63 kB
TypeScript
/**
* 部署配置选项
*/
export interface DeployPagesOptions {
/** 域名,如 t-comm.pages.woa.com 或简写 t-comm */
cname: string;
/** 要部署的本地目录路径 */
directory: string;
/** API Key,不传则从环境变量 OA_PAGES_API_KEY 获取 */
apiKey?: string;
/** 访问权限:public(免登录) | tof(需登录) | git(仅 git 成员) | whitelist(白名单)。新建网站默认 whitelist */
visibility?: 'public' | 'tof' | 'git' | 'whitelist';
/** 网站描述(最多 100 个字) */
description?: string;
/** 仅预览,不实际上传 */
dryRun?: boolean;
/**
* 部署前是否清理远程已有文件。
* 适用于历史文件过多导致后续上传失败的场景。
* 默认 false。
*/
cleanBeforeDeploy?: boolean;
/**
* 仅清理匹配前缀的远程文件(可传单个或多个前缀)。
* 仅在 cleanBeforeDeploy 为 true 时生效,未传则清理全部远程文件。
* 例如 'assets/' 仅清理 assets 目录下的文件。
*/
cleanPrefix?: string | string[];
}
/**
* 部署结果
*/
export interface DeployPagesResult {
/** 是否成功 */
success: boolean;
/** 网站 URL */
url: string;
/** 管理页面 URL */
adminUrl: string;
/** 完整域名 */
cname: string;
/** 文件总数 */
totalFiles: number;
/** 批次数 */
totalBatches: number;
/** 部署前清理的远程文件数(仅在 cleanBeforeDeploy=true 时有意义) */
deletedFiles?: number;
/** 错误信息(失败时) */
error?: string;
}