/** * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途 */ import { AppUploadResult } from "utils/app"; export declare type PgyerUploadResult = { url?: string; qrCodeUrl?: string; buildKey?: string; buildShortcutUrl?: string; buildVersion?: string; buildVersionNo?: string; buildQRCodeURL?: string; [key: string]: any; }; export declare type PgyInstallType = 1 | 2 | 3; export declare type UploadOptions = { filePath: string; /** 版本更新说明,对应 buildUpdateDescription */ buildUpdateDescription?: string; /** 安装方式:1 公开 / 2 密码 / 3 邀请 */ buildInstallType?: PgyInstallType; /** 安装密码,仅 buildInstallType = 2 时上传 */ buildPassword?: string; /** 指定渠道短链接,对应 buildChannelShortcut,空则不传 */ buildChannelShortcut?: string; }; /** * 解析 --pgyinstall / --pgypass。 * 默认 pgyinstall=2,密码为当天日期缩写。 * 传入 pgypass 时安装方式固定为 2;显式 pgyinstall=1 或 3 且未传密码时不使用日期密码。 */ export declare function resolvePgyInstall(rawType?: unknown, rawPassword?: unknown): { buildInstallType: PgyInstallType; buildPassword?: string; }; export declare function hasPgyApiKey(): boolean; /** * 上传 ipa / apk / hap。API Key 只从 process.env.PGY_API_KEY 读取。 * 安装方式默认密码安装(buildInstallType = 2),密码默认为当天日期 YYMMDD。 */ export declare function uploadToPgyer(options: UploadOptions): Promise; export declare function assignPgyResult(result: AppUploadResult, platform: string, value: any): void; /** * @description 判断蒲公英上传结果是否含失败项 * @param pgyer result.pgyer * @returns 是否有失败 */ export declare function hasPgyerUploadFailure(pgyer: Record | undefined): boolean; /** * 蒲公英上传失败只记录结果(构建后自动上传阶段先收集,结束时再统一抛错,保证双端产物都在) */ export declare function safeUploadToPgyer(platform: string, createOptions: () => UploadOptions): Promise; /** * 将目录中全部相同后缀产物上传蒲公英(多渠道 apk / 多个 ipa) */ export declare function uploadAllPackagesToPgyer(options: { platform: string; outputDir: string; ext: string; desc: string; pgyInstall: { buildInstallType: PgyInstallType; buildPassword?: string; }; pgyChannelShortcut?: string; versionKey?: string; /** * --pgyupload 直传:产物缺失或上传失败均抛错; * 构建后自动上传默认 false,失败只记录不中断 */ throwOnError?: boolean; }): Promise; /** * 不重新构建,检查 outputPath 下已有 ipa / apk: * 存在则全部上传蒲公英;不存在则抛错(--pgyupload)。 * CI 仅依赖同流水线 needs 注入的前置构建产物,不做跨流水线 API 回源。 */ export declare function uploadExistingPgyPackages(options: { platforms: string[]; outputPath: string; versionKey?: string; desc: string; pgyChannelShortcut: string; pgyinstall: unknown; pgypass: unknown; isTestRobot: boolean; result: AppUploadResult; }): Promise;