UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

1,968 lines (1,832 loc) 227 kB
/// <reference types="jest" /> export declare const ACT_ID_MAP: { GP: string; }; /** * 为 Vue 组件添加 emits 属性 * @param {string} filePath 组件地址 * @param {string} [fileContent] 组件内容 * @returns {string} 新的组件内容 * * @example * ```ts * addNameForComponent('xxx.vue'); * ``` */ export declare function addEmitsForComponent(filePath: string, fileContent?: string): string | undefined; export declare function addMsdkNativeCallbackListener(callback: Function): void; /** * 为 Vue 组件添加、修正 name 属性 * @param {string} filePath 组件地址 * @param {string} componentName 组件名称 * @returns {string} 新的组件内容 * * @example * ```ts * addNameForComponent('xxx.vue', 'PressUploader'); * ``` */ export declare function addNameForComponent(filePath: string, componentName: string): any; /** * add num and avoid float number * @param {number} num1 第1个数字 * @param {number} num2 第2个数字 * @returns {number} 结果 * @example * ```ts * addNumber(0.1, 0.2); // 0.3 * ``` */ export declare function addNumber(num1: number, num2: number): number; /** * 添加或更新配置 * * @param {object} config 配置信息 * @param {object} config.keyValue 配置对象 * @param {string} config.keyValue.key 配置的key * @param {string} config.keyValue.value 配置的value * @param {number} config.valueType 配置类型,1: NUMBER, 2: STRING, 3: TEXT, 4: JSON, 5: XML, 18: 日期, 20: yaml * @param {object} config.secretInfo 密钥信息 * @param {string} config.secretInfo.appId 项目Id * @param {string} config.secretInfo.userId 用户Id * @param {string} config.secretInfo.secretKey 密钥 * @param {string} config.secretInfo.envName 配置环境 * @param {string} config.secretInfo.groupName 配置组 * @returns {Promise<object>} 请求Promise * * @example * addOrUpdateRainbowKV({ * keyValue: { * key: 'theKey', * value: 'theValue', * }, * valueType: 2, * secretInfo: { * appId: 'xxx', * userId: 'xxx', * secretKey: 'xxx', * envName: 'prod', * groupName: 'xxx', * } * }).then(() => { * * }) */ export declare function addOrUpdateRainbowKV({ keyValue, valueType, secretInfo, }: ModifyConfigParam): Promise<object>; /** * 增加配置 * * @param {object} config 配置信息 * @param {object} config.keyValue 配置对象 * @param {string} config.keyValue.key 配置的key * @param {string} config.keyValue.value 配置的value * @param {number} config.valueType 配置类型,1: NUMBER, 2: STRING, 3: TEXT, 4: JSON, 5: XML, 18: 日期, 20: yaml * @param {object} config.secretInfo 密钥信息 * @param {string} config.secretInfo.appId 项目Id * @param {string} config.secretInfo.userId 用户Id * @param {string} config.secretInfo.secretKey 密钥 * @param {string} config.secretInfo.envName 配置环境 * @param {string} config.secretInfo.groupName 配置组 * @returns {Promise<object>} 请求Promise * * @example * addRainbowKV({ * keyValue: { * key: 'theKey', * value: 'theValue', * }, * valueType: 2, * secretInfo: { * appId: 'xxx', * userId: 'xxx', * secretKey: 'xxx', * envName: 'prod', * groupName: 'xxx', * } * }).then(() => { * * }) */ export declare function addRainbowKV({ keyValue, valueType, secretInfo, }: ModifyConfigParam): Promise<object>; /** * 为图片增加文字 * * @param {Object} config 配置 * @param {number} config.width 宽度 * @param {number} config.height 高度 * @param {Array<string>} config.textList 文字列表,支持多行 * @param {string} config.imgPath 图片路径 * @returns {string} canvas.toDataURL生成的base64图片 * * @example * * ```ts * const imgUrl = addTextForImg({ * width: 300, * height: 300, * textList: ['第一行', '第二行'], * imgPath: './test.png', * }) * ``` */ export declare function addTextForImg({ width, height, textList, imgPath, }: { width: number; height: number; textList: Array<string>; imgPath: string; }): Promise<string>; export declare function aegisReportErrorV2(mAegisV2: any, options: ReportOptions): void; export declare function aegisReportEventV2(mAegisV2: any, options: EventOptions): void; export declare function aegisReportInfoV2(mAegisV2: any, options: ReportOptions, method?: string): void; export declare class AegisReportInPixui { static options: InitAegisOptions; static aegis: any; static init(options: InitAegisOptions): Promise<any>; static report(info: Record<string, any>): Promise<void>; static info(info: Record<string, any>): Promise<void>; } export declare function aegisReportV2(mAegisV2: any, options: ReportOptions): void; /** * 分析首页Bundle信息 * * @export * @param config 配置 * @param {string} config.domain 域名 * @param {string} config.buildPath 打包路径 * @returns {*} * * @example * ```ts * analyzeIndexBundle({ * domain: '', * buildPath: '', * }) * ``` */ export declare function analyzeIndexBundle({ domain, buildPath }: { domain: string; buildPath: string; }): ({ file: string; size: number; time: number; } | undefined)[]; export declare type AppOptionsType = { Vue: any; App: any; VueRouter?: any; Vuex?: any; VueLazyLoad?: any; routerMap?: Array<any>; vxModule?: Object; vxModuleGetter?: Object; beforeStart?: Function; i18n?: any; routerMode?: 'hash' | 'history'; projectMixins?: any; noDependMixins?: boolean; loginType: string; loginFunction?: Function; uinHandler?: Function; SimpleVueRouter?: boolean; prerender?: boolean; notfound?: string; vue3Router?: { createRouter: Function; createWebHashHistory: Function; }; vue3Vuex?: { createStore: Function; }; }; export declare function ApprovalRainbowReleaseTask({ secretInfo, taskId, versionName, status, rejectReason, }: { secretInfo: ISecretInfo_3; taskId: string | number; versionName: string; status?: number; rejectReason?: string; }): Promise<object>; declare const AREA_MAP: { readonly MAINLAND: "mainland"; readonly OVERSEAS: "overseas"; readonly GLOBAL: "global"; }; export declare function asyncExportTencentDoc({ accessToken, clientId, openId, fileId, exportType, }: ISecretInfo_2 & { fileId: string; exportType: number; }): Promise<any>; /** * 基本请求 * @private * @param {object} config - 配置信息 * @returns {Promise} 请求Promise */ export declare function baseRequestRainbow({ url, data: reqData, secretInfo, }: ReqParam): Promise<object>; /** * 批量发送企业微信机器人base64图片 * @param {object} config 配置信息 * @param {string} config.img base64图片 * @param {string} config.chatId 会话Id * @param {string} config.webhookUrl webhook地址 * @returns {Promise<object>} 请求Promise * @example * * batchSendWxRobotBase64Img({ * img: 'xxx', * chatId: 'xxx', // or ['xxx], or ['ALL'], or 'ALL' * webhookUrl: 'xxx', * }).then(() => { * * }) * */ export declare function batchSendWxRobotBase64Img({ img, chatId, webhookUrl, }: { img: string; } & ISendReq): void; export declare function batchSendWxRobotMarkdown({ content, attachments, chatId, webhookUrl, }: { content: string; attachments?: Array<object>; } & ISendReq): void; export declare function batchSendWxRobotMsg({ content, alias, chatId, webhookUrl, }: { content: string; alias: string | Array<string>; } & ISendReq): void; export declare function batchUpdateTencentSheetV3({ accessToken, clientId, openId, bookId, requests, }: ISecretInfo_2 & { bookId: string; requests: Record<string, any>; }): Promise<any>; /** * 打包并上传到服务器 * @param {object} options 配置 * @param {string} options.hostName 服务器名称 * @param {string} options.hostPwd 服务器密码 * @param {string} [options.root] 项目根目录 * @param {string} [options.bundleName] 打包文件名称 * @example * * await buildAndUpload({ * hostName: '9.9.9.9', * hostPwd: 'xxxx', * bundleName: 'cron-job-svr', * }); * */ export declare function buildAndUpload({ root, bundleName, hostName, hostPwd, hostTargetDir, }: { root?: string; bundleName?: string; hostName: string; hostPwd: string; hostTargetDir: string; }): Promise<any>; /** * 记忆函数:缓存函数的运算结果 * @param {Function} fn 输入函数 * @returns {any} 函数计算结果 * * @example * function test(a) { * return a + 2 * } * * const cachedTest = cached(test) * * cachedTest(1) * * // => 3 * * cachedTest(1) * * // => 3 */ export declare function cached(fn: Function): any; /** * 添加游戏内浏览器jssdk * @example * ```ts * callJsBrowserAdapter(); * ``` */ export declare function callJsBrowserAdapter(): Promise<unknown>; /** * 设置 MSDK 浏览器退出全屏,需提前加载 sdk * @example * ```ts * callJsReSetFullScreen(); * ``` */ export declare const callJsReSetFullScreen: () => void; /** * 设置 MSDK 浏览器全屏,需提前加载 sdk * @param isFullScreen 是否全屏 * @example * ```ts * callJsSetFullScreen(); * callJsSetFullScreen(false); * ``` */ export declare const callJsSetFullScreen: (isFullScreen?: boolean) => void; /** * 横线转驼峰命名,如果第一个字符是字母,则不处理。 * @param {string} str 输入字符串 * @param {boolean} handleSnake 是否处理下划线,默认不处理 * @returns {string} 处理后的字符串 * @example * * camelize('ab-cd-ef') * * // => abCdEf * */ export declare function camelize(str?: string, handleSnake?: boolean): string; /** * 字符串首位大写 * @param {string} str 输入字符串 * @returns {string} 处理后的字符串 * * @example * * capitalize('abc') * * // => Abc */ export declare function capitalize(str: string): string; /** * 检查 localStorage 设置,并展示vConsole * @example * ```ts * checkAndShowVConsole() * ``` */ export declare function checkAndShowVConsole(): void; export declare function checkExportTencentDocProgress({ accessToken, clientId, openId, fileId, operationId, }: ISecretInfo_2 & { fileId: string; operationId: string; }): Promise<any>; export declare function checkFileBaseMinimatch({ file, include, exclude, minimatch, }: { file: string; include: string | string[]; exclude: string | string[]; minimatch: Function; }): boolean; export declare function checkGitClean(dir: string): void; export declare function checkJSFiles(options?: { whiteDir: string[]; excludeReg: RegExp; log: boolean; }): void; export declare function checkLint({ privateToken, gitApiPrefix, workspace, mrUrl, mrId, buildUrl, repo, repoUrl, sourceBranch, targetBranch, docLink, webhookUrl, chatId, checkAll, mentionList, lintFiles, throwError, ignoreSubmodules, }: { privateToken: string; gitApiPrefix: string; workspace: string; mrUrl?: string; mrId?: string; buildUrl: string; repo: string; repoUrl?: string; sourceBranch?: string; targetBranch?: string; docLink: string; webhookUrl: string; chatId?: string[]; checkAll?: boolean; mentionList?: string[]; lintFiles?: string[]; throwError?: boolean; ignoreSubmodules?: boolean; }): Promise<FileMap>; /** * 检查是否是node环境 * @returns {boolean} 是否node环境 * @example const res = checkNodeEnv(); // false */ export declare const checkNodeEnv: () => boolean; /** * 检查字符串长度 * * @export * @param {string} str 字符串 * @param {number} [num = 30] 长度 * @returns {boolean} * * @example * * checkStringLength('123', 2) // true * checkStringLength('123', 3) // true * checkStringLength('123', 4) // false * * */ export declare function checkStringLength(str?: string, num?: number): boolean; export declare function checkTSErrorInMrOrAll({ privateToken, gitApiPrefix, workspace, repo, repoUrl, mrId, mrUrl, sourceBranch, targetBranch, checkAll, buildUrl, docLink, mentionList, postFixList, chatId, webhookUrl, command, }: { privateToken: string; gitApiPrefix: string; workspace: string; repo: string; repoUrl: string; mrId: string; mrUrl: string; sourceBranch: string; targetBranch: string; checkAll: boolean; buildUrl: string; docLink: string; mentionList: string[]; postFixList?: string[]; chatId?: string[]; webhookUrl: string; command?: string; }): Promise<TsErrorFile[]>; /** * 检查是否是ios环境 * @returns {boolean} 是否是ios环境 * * @example * * checkUAIsIOS() * * // => true * */ export declare function checkUAIsIOS(): boolean; /** * 清除全部cookie * * @param {string} domain 域名 * * @example * * clearAll() */ export declare function clearAll(domain?: String): void; /** * 清除cookie * @param {string} key cookie键 * * @example * * clearCookie('name'); * */ export declare function clearCookie(name: string): void; /** * 持久化存储。清理。传 key 就删除。不传清理所有过期的。 * @param {string} [key] * @returns {boolean} 是否清楚成功 */ export declare function clearPersist(key?: string): boolean; /** * 清除(隐藏)上一个toast * @example * ```ts * Toast.clear(); * * clearToast(); * ``` */ export declare const clearToast: () => void; /** * 小程序粘贴 * * @param {string} text 待复制的文本 * @returns {Promise<void>} * @example * * ```ts * clipboardMp('stupid').then(() => {}); * ``` */ export declare function clipboardMp(text: string): Promise<any>; /** * 复制到剪切板 * * @param {string} text 待复制的文本 * @returns {Promise<void>} * @example * * ```ts * clipboardMp('stupid').then(() => {}); * ``` */ export declare function clipboardWeb(text: string): Promise<void>; /** * MSDK 浏览器中,关闭 webView * @example * ```ts * closeMsdkWebview() * ``` */ export declare function closeMsdkWebview(env?: any): void; /** * 关闭任务 * * @param {object} config 配置信息 * @param {string} config.taskId 任务Id * @param {object} config.secretInfo 密钥信息 * @param {string} config.secretInfo.appId 项目Id * @param {string} config.secretInfo.userId 用户Id * @param {string} config.secretInfo.secretKey 密钥 * @param {string} config.secretInfo.envName 配置环境 * @param {string} config.secretInfo.groupName 配置组 * @returns {Promise<object>} 请求Promise * * @example * closeRainbowTask({ * taskId: 'taskId', * secretInfo: { * appId: 'xxx', * userId: 'xxx', * secretKey: 'xxx', * envName: 'prod', * groupName: 'xxx', * } * }).then(() => { * * }) */ export declare function closeRainbowTask({ taskId, secretInfo, }: { taskId: string; secretInfo: ISecretInfo_3; }): Promise<object>; /** * 关闭 vConsole * @example * ```ts * closeVConsole() * ``` */ export declare function closeVConsole(): void; /** * 关闭 webView,包含 msdk 浏览器和其他浏览器 * @example * ```ts * closeWebView() * ``` */ export declare function closeWebView(): void; /** * 对比两个对象列表 * @param {Array<object>} list 现在数据 * @param {Array<object>} preList 参照数据 * @param {string} key 唯一key名称 * @returns {Array<object>} 对比结果,增加为list的每一项增加previousValue和ratio属性 * @example * const list = [ * { * ProjectName: { name: 'ProjectName', value: '脚手架' }, * PagePv: { name: 'PagePv', value: 544343 }, * PageUv: { name: 'PageUv', value: 225275 }, * } * ] * * const preList = [ * { * ProjectName: { name: 'ProjectName', value: '脚手架' }, * PagePv: { name: 'PagePv', value: 123123 }, * PageUv: { name: 'PageUv', value: 33333 }, * } * ] * * compareTwoList(list, preList, 'ProjectName') * * console.log(list) * * [ * { * ProjectName: { name: 'ProjectName', value: '脚手架' }, * PagePv: { * name: 'PagePv', * value: 544343, * ratio: '+342.1%', * previousValue: 123123 * }, * PageUv: { * name: 'PageUv', * value: 225275, * ratio: '+575.8%', * previousValue: 33333 * } * } * ] */ export declare function compareTwoList(list: Array<IPreData>, preList: Array<IPreData>, key: string): IPreData[]; export declare function compareTwoObj(originObj?: Record<string, any>, newObj?: Record<string, any>): { ADDED: Array<string>; UPDATED: Array<string>; DELETED: Array<string>; originObj: object; newObj: object; }; /** * 版本比较 * @param {string} v1 第一个版本 * @param {string} v2 第二个版本 * @returns 比较结果,1 前者大,-1 后者大,0 二者相同 * @example * ```ts * compareVersion('1.1.1', '1.2.1') * // -1 * ``` */ export declare function compareVersion(v1?: string, v2?: string): 0 | 1 | -1; /** * Compile a string to a template function for the path. * @ignore * @param {string} str * @param {Object=} options * @returns {!function(Object=, Object=)} */ declare function compile(str: string, options?: any): (data: any, options: any) => string; export declare type ComponentMapList = Record<string, string[]>; /** * 组装`url`参数,将search参数添加在后面 * @param {string} url 输入URL * @param {Object} queryObj search对象 * @returns {string} 组装后的url * * @example * composeUrlQuery('https://baidu.com', { * name: 'mike', * feel: 'cold', * age: '18', * from: 'test', * }); * // https://baidu.com?name=mike&feel=cold&age=18&from=test * * composeUrlQuery('https://baidu.com?gender=male', { * name: 'mike', * feel: 'cold', * age: '18', * from: 'test', * }); * // https://baidu.com?gender=male&name=mike&feel=cold&age=18&from=test * */ export declare function composeUrlQuery(url: string, queryObj: object): string; declare type ConfigType = unknown; export declare function configWx({ apiList, openTagList, getWxSignaturePromise, }: { apiList?: Array<string>; openTagList?: Array<string>; getWxSignaturePromise: IGetWxSignaturePromise; }): Promise<unknown>; export declare const consoleImage: (url: string) => void; export declare function consoleInfo(shouldLog: boolean, ...args: any[]): void; export declare function consoleLog(shouldLog: boolean, ...args: any[]): void; /** * Dom转化为图片 * @param {string} trigger Dom的id * @param {string} imageElId 需要展示的图片的id * * @example * Dom2Image.convertDomToImage("app", "appImage"); */ export declare function convertDomToImage(trigger: string, imageElId: string, callback: Function): void; /** * image url转canvas * @param image {Image} 图片src * @returns canvas */ export declare function convertImageToCanvas(image: HTMLImageElement): ICanvas; export declare function convertTencentFileId({ accessToken, clientId, openId, type, value, }: ISecretInfo_2 & { type: number; value: string; }): Promise<any>; /** * 拷贝目录以及子文件 * @param {Object} src * @param {Object} dist * @param {Object} callback */ export declare function copyDir(src: string, dist: string, callback?: Function): void; /** * 拷贝文件 * @param {Object} from 文件来自那里 * @param {Object} to 拷贝到那里 */ export declare function copyFile(from: string, to: string): void; /** * 创建canvas的table * @param {object} config 输入配置 * @param {Array<object>} config.data 输入数据 * @param {Array<string>} config.headers 表头列表 * @param {Array<number>} config.cellWidthList 每一格的宽度列表 * @param {string} config.title 标题 * @returns {string} 图片url * @example * * const tableData = [ * { * ProjectName: { name: 'ProjectName', value: 'ProjectA' }, * ALL_SUMMARY: { * name: 'ALL_SUMMARY', * value: 4987, * ratio: '+26.2%', * previousValue: 3953, * idx: 0, * lastIdx: 0, * isMax: true, * isMin: false, * isSecondMax: false, * isSecondMin: false, * }, * ALL_FAIL: { * // ... * }, * }, * { * ProjectName: { name: 'ProjectName', value: 'ProjectB' }, * // ... * }, * ]; * * createCanvasTable({ * data: tableData, * headers: getHeaders(tableData), * title: `007日报 ${date}`, * cellWidthList: [ * 95, * 65, * 65, * 65, * ], * }); */ export declare function createCanvasTable({ data, headers, cellWidthList, title, }: { data: Array<{ [k: string]: { value?: number; isMax?: boolean; isMin?: boolean; isSecondMax?: boolean; isSecondMin?: boolean; ratio?: string | number; }; }>; headers: Array<string>; cellWidthList: Array<number>; title: string; }): string; export declare function createDevopsTemplateInstances({ projectId, templateId, host, pipelineName, pipelineParam, secretInfo, useTemplateSettings, }: ITemplateReq & { pipelineName: string; pipelineParam: Object; useTemplateSettings?: boolean; }): Promise<any>; /** * 创建MR * @param {object} options 输入配置 * @param {string} options.projectName 项目名称 * @param {string} options.privateToken 密钥 * @param {string} options.sourceBranch 源分支 * @param {string} options.targetBranch 目标分支 * @returns {Promise<object>} 请求Promise * @example * * createMR({ * projectName: 't-comm', * privateToken: 'xxxxx', * sourceBranch: 'master', * targetBranch: 'release', * }).then((resp) => { * * }) */ export declare function createMR({ projectName, privateToken, sourceBranch, targetBranch, }: { projectName: string; privateToken: string; sourceBranch: string; targetBranch: string; }): Promise<unknown>; /** * 创建发布任务 * * @param {object} config 配置信息 * @param {string} config.versionName 版本信息 * @param {object} config.secretInfo 密钥信息 * @param {string} config.secretInfo.appId 项目Id * @param {string} config.secretInfo.userId 用户Id * @param {string} config.secretInfo.secretKey 密钥 * @param {string} config.secretInfo.envName 配置环境 * @param {string} config.secretInfo.groupName 配置组 * @returns {Promise<object>} 请求Promise * * @example * createRainbowPublishJob({ * versionName: 'version', * secretInfo: { * appId: 'xxx', * userId: 'xxx', * secretKey: 'xxx', * envName: 'prod', * groupName: 'xxx', * } * }).then(() => { * * }) */ export declare function createRainbowPublishJob({ versionName, secretInfo, creator, approvers, type, }: { versionName: string; secretInfo: ISecretInfo_3; creator: string; approvers: string; type?: number; }): Promise<object>; export declare function createTencentDoc({ accessToken, clientId, openId, type, title, folderId, }: ISecretInfo_2 & { type: number; title: string; folderId?: string; }): Promise<any>; /** * canvas 实现 watermark * @param {object} params 参数 * @param {HTMLElement} params.container 容器 * @param {number} params.width 图片宽 * @param {number} params.height 图片高 * @param {string} params.textAlign 同 ctx.textAlign * @param {string} params.textBaseline 同 ctx.textBaseline * @param {string} params.font 同 ctx.font * @param {string} params.fillStyle 同 ctx.fillStyle * @param {string} params.content 内容 * @param {number} params.rotate 旋转角度 * @param {number} params.zIndex 层级 * * @example * * ```ts * const rtx = 'pony'; * * createWatcherMark({ * content: rtx, * width: '300', * height: '300', * textAlign: 'center', * textBaseline: 'middle', * font: '25px Microsoft Yahei', * fillStyle: 'rgba(184, 184, 184, 0.3)', * rotate: '-50', * zIndex: 1000, * }); * ``` */ export declare function createWatcherMark({ container, width, height, textAlign, textBaseline, font, fillStyle, content, rotate, zIndex, }?: { container?: HTMLElement | undefined; width?: number | undefined; height?: number | undefined; textAlign?: string | undefined; textBaseline?: string | undefined; font?: string | undefined; fillStyle?: string | undefined; content?: string | undefined; rotate?: number | undefined; zIndex?: number | undefined; }): void; /** * 每日合并 * 1. 获取昨天有活跃的分支 * 2. 对于每个分支,进行合并并推送 * - 清理 Git 环境 * - 切到主分支,并拉最新代码 * - 切到当前分支,拉最新代码 * - 尝试执行 git merge * - 对比 merge 前后的 commit 信息是否相同,作为判断 merge 是否成功的依据 * 3. 发送机器人消息 * * * @export * @async * @param {object} param0 参数 * @param {string} param0.webhookUrl 机器人地址 * @param {string} param0.appName 项目名称 * @param {string} param0.devRoot 项目根路径 * @param {string} param0.baseUrl 基础请求 url * @param {string} param0.repoName 仓库名称 * @param {string} param0.privateToken 密钥 * @param {boolean} [param0.isDryRun=false] 是否演练 * @param {string} [param0.mainBranch='develop'] 主分支 * @param {Regexp} [param0.whiteBranchReg=/^release\|develop\|hotfix\\/.+$/] 不处理的分支正则 * @returns {*} * @example * * ```ts * dailyMerge({ * webhookUrl: 'xx', * appName: 'xx', * devRoot: 'xx', * * baseUrl: 'xx', * repoName: 'xx', * privateToken: 'xx', * * isDryRun: false, * }) * ``` */ export declare function dailyMerge({ webhookUrl, appName, devRoot, baseUrl, repoName, privateToken, isDryRun, mainBranch, whiteBranchReg, }: { webhookUrl: string; appName: string; devRoot: string; baseUrl: string; repoName: string; privateToken: string; isDryRun?: boolean; mainBranch?: string; whiteBranchReg?: RegExp; }): Promise<void>; /** * 将日期格式化 * @param {Date} date * @param {string} format * @returns {string} 格式化后的日期字符串 * @example * * const date = new Date('2020-11-27 8:23:24'); * * const res = dateFormat(date, 'yyyy-MM-dd hh:mm:ss') * * // 2020-11-27 08:23:24 */ export declare function dateFormat(date: string | number | Date, fmt: string): string; /** * 防抖,场景:搜索 * * 触发事件后在 n 秒内函数只能执行一次,如果 * 在 n 秒内又触发了事件,则会重新计算函数执行时间 * * @param {Function} fn 主函数 * @param {number} time 间隔时间,单位 `ms` * @param {boolean} immediate 是否立即执行,默认 `false` * @returns 闭包函数 * * @example * * ```ts * function count() { * console.log('xxxxx') * } * window.onscroll = debounce(count, 500) * * window.onscroll = debounce(count, 500, true) * ``` */ export declare function debounce(fn: Function, time: number, immediate?: boolean): (...args: Array<any>) => any; /** * 不用生成中间函数的防抖 * * @example * ```ts * debounceRun(func, args, { * funcKey: 'funcKey', * wait: 500, // 默认 500 * throttle: false, // 是否是节流,默认 false * immediate: true, // 是否立即执行,默认 true * }) * `` */ export declare const debounceRun: (func: Function, args?: any[], options?: { funcKey?: any; wait?: number | undefined; throttle?: boolean | undefined; immediate?: boolean | undefined; debug?: boolean | undefined; }) => void; export declare const decode: (str: string) => string; /** * 将字符串解码,与`encodeUrlParam`相对 * @param {string} obj 输入字符串 * @returns {object} 对象 * @example * * decodeUrlParam('%7B%22a%22%3A1%7D') * * // { a: 1 } * */ export declare function decodeUrlParam(str: string): object; /** * 深度赋值 * @param keyStr 以点拼接的 key,比如 foo.bar * @param target 目标对象 * @param value 目标值 * @example * ```ts * const obj = { a: { b: 1 } }; * deepSet('a.c', obj, 2); * * console.log(obj); * // { a: { b: 1, c: 2 } } * ``` */ export declare function deepSet(keyStr: string, target: Record<string, any>, value: unknown): void; export declare function deleteCOSEmptyFolder({ secretId, secretKey, bucket, region, prefix, }: { secretId: string; secretKey: string; bucket: string; region: string; prefix: string; }): Promise<unknown>; export declare function deleteCOSLongAgoObject({ secretId, secretKey, bucket, region, prefix, keepNumber, }: { secretId: string; secretKey: string; bucket: string; region: string; prefix: string; keepNumber?: number; }): Promise<unknown>; export declare function deleteCOSMultipleObject({ secretId, secretKey, keys, bucket, region, }: { secretId: string; secretKey: string; bucket: string; region: string; keys: Array<string>; }): Promise<unknown>; /** * 删除目录 * @param {Object} path */ export declare function deleteFolder(tPath: string): void; export declare function deleteFolderRecursive(path: string, options?: { deleteFile: boolean; log: boolean; }): void; /** * 删除一个项目 * @param {object} options 输入配置 * @param {string} options.id 项目id * @param {string} options.privateToken 密钥 * @returns {Promise<Array<object>>} 请求Promise * @example * * deleteTGitProject({ * id: '123' * privateToken: 'xxxxx', * }).then((resp) => { * * }) */ export declare function deleteTGitProject({ id, privateToken, }: { id: number | string; privateToken: string; }): Promise<Array<object>>; declare enum DEVICE_TYPE { PC = "PC", MOBILE_HOR = "MOBILE_HORPC", MOBILE_VERT = "MOBILE_VERT" } /** * 隐藏loading toast * @example * ```ts * Toast.dismissLoading(); * ``` */ export declare const dismissLoading: () => void; declare namespace drag { export { dragElement, DRAG_TYPE } } declare enum DRAG_TYPE { DOT_TO_DOT = "DOT_TO_DOT", STEPS = "STEPS" } declare function dragElement({ page, source, target, mode, reverse, stepUnit, }: { page: any; source: any; target: any; mode?: DRAG_TYPE; reverse?: boolean; stepUnit?: number; }): Promise<void>; export declare const e2e: { autoScroll(element: HTMLAnchorElement, page: any, bottomTimes?: number): Promise<void>; dragElement({ page, source, target, mode, reverse, stepUnit, }: { page: any; source: any; target: any; mode?: drag.DRAG_TYPE | undefined; reverse?: boolean | undefined; stepUnit?: number | undefined; }): Promise<void>; DRAG_TYPE: typeof drag.DRAG_TYPE; waitEle(element: HTMLSelectElement, page: any, timeout?: number): Promise<any>; clickBtn(btn: any): Promise<boolean>; findAndClick(element: HTMLSelectElement, page: any, timeout?: number): Promise<any>; justWait(time: number): Promise<unknown>; closeBlankPage(browser: any): Promise<void>; getRect(element: HTMLSelectElement, page: any): Promise<any>; getInnerText(element: HTMLSelectElement, page: any): Promise<any>; findListItemAndClick({ page, element, innerText, }: { page: any; element: HTMLSelectElement; innerText: string; }): Promise<void>; getHref(page: any): Promise<any>; initBrowser({ puppeteer, args, headless, devtools, }: { puppeteer: any; args?: string[] | undefined; headless?: boolean | undefined; devtools?: boolean | undefined; }): Promise<any>; getNewPage(browser: any, device: page.DEVICE_TYPE): Promise<any>; openOrFindPage(browser: any, href: string, device: page.DEVICE_TYPE): Promise<any>; setUserAgent(useragent: string, page: any): Promise<void>; setSessionStorage(key: string, value: string, page: any): Promise<void>; setRoute(page: any, route?: string): Promise<void>; DEVICE_TYPE: typeof page.DEVICE_TYPE; }; /** * 使用鼠标滚轮控制元素的scrollLeft实现左右移动 * @param {HTMLElement} element - 需要控制移动的DOM元素 * @param {Object} [options] - 配置选项 * @param {number} [options.speed=50] - 移动速度(像素/滚动单位) * @param {boolean} [options.preventDefault=true] - 是否阻止默认滚动行为 * @param {boolean} [options.invertDirection=false] - 是否反转滚动方向 */ export declare function enableHorizontalScroll(element: HTMLElement, options?: {}): (() => void) | undefined; export declare const encode: (str: string) => string; /** * 将对象字符串化 * @param {object} obj 输入对象 * @returns {string} 字符串 * @example * * encodeUrlParam({a: 1}) * * // '%7B%22a%22%3A1%7D' * */ export declare function encodeUrlParam(obj: object): string; declare const ERROR_MAP: { BRANCH_EXIST: string; SAME_CONFIG: string; }; export declare class EventBus { private events; constructor(); emit(eventName: string, ...args: Array<any>): void; on(eventName: string, fn: any): void; off(eventName: string, fn: any): void; } declare type EventOptions = string | { name: string; [k: string]: string; }; /** * excel 转 json * @param {object} params 参数 * @returns jsonData * @example * * const options = { * header: ['id', 'name', 'age'], // 可选:自定义表头 * range: 1, // 可选:跳过第一行(标题行) * defval: null, // 可选:空单元格的默认值 * raw: false, // 可选:是否保留原始数据格式 * }; * * excelToJson({ * filePath: CONFIG.xlsxPath, * sheetIndex: 1, * options, * }); * * // [ * // { id: 1, name: '2', age: '3' }, * // { id: 1, name: '2', age: '3' } * // ]; * */ export declare function excelToJson({ filePath, sheetIndex, options, }: { filePath: string; sheetIndex?: number; options?: Record<string, any>; }): any; /** * nodejs 中调用 child_process.execSync 执行命令, * 这个方法会对输出结果截断,只返回第一行内容 * @param {string} command 命令 * @param {string} root 执行命令的目录 * @param {string | object} stdio 结果输出,默认为 pipe * @returns {string} 命令执行结果 */ export declare function execCommand(command: string, root?: string, options?: string | { stdio?: string; line?: number; }): string; export declare function execCommandInTarget(command: string, targetProject: string): void; export declare function exportTencentDoc({ accessToken, clientId, openId, fileId, exportType, waitTime, }: ISecretInfo_2 & { fileId: string; exportType: number; waitTime?: number; }): Promise<string | undefined>; /** * 将属性混合到目标对象中 * @param {object} to 目标对象 * @param {object} from 原始对象 * @returns 处理后的对象 * * @example * const a = { name: 'lee' } * const b = { age: 3 } * extend(a, b) * * console.log(a) * * // => { name: 'lee', age: 3 } */ export declare function extend(to: Record<string, any>, from: Record<string, any>): object; /** * 拼接额外参数 * @param {string} url 地址 * @param {string} removeKeyArr 待添加的参数对象 * @returns 重新拼接的地址 * @example * const url1 = extendUrlParams('http://www.test.com?a=1&b=2&c=3#/detail?d=4', { e: 5 }); // 'http://www.test.com/#/detail?a=1&b=2&c=3&d=4&e=5' */ export declare function extendUrlParams(url?: string, extParamsObj?: {}, forceHistoryMode?: boolean): string; /** * 提取 Vue 组件的 class * @param {obj} params 参数 * @param {string} params.filePath 源文件地址 * @param {string} [params.targetFilePath] 输出文件地址 * @param {Regexp} [params.extractRegexp] 提取正则 * * ```ts * extractClass({ * filePath: 'xxx.vue', * }) * ``` */ export declare function extractClass({ filePath, targetFilePath, extractRegexp, }: { filePath: string; targetFilePath?: string; extractRegexp?: RegExp; }): void; /** * 提取 Vue 组件的 event * @param {obj} params 参数 * @param {string} params.filePath 源文件地址 * @param {string} [params.targetFilePath] 输出文件地址 * @param {Regexp} [params.extractRegexp] 提取正则 * * ```ts * extractEvent({ * filePath: 'xxx.vue', * }) * ``` */ export declare function extractEvent({ filePath, targetFilePath, extractRegexp, }: { filePath: string; targetFilePath?: string; extractRegexp?: RegExp; }): void; /** * 提取 Vue 组件的 props * @param {obj} params 参数 * @param {string} params.filePath 源文件地址 * @param {string} [params.targetFilePath] 输出文件地址 * @param {Regexp} [params.extractRegexp] 提取正则 * * ```ts * extractProps({ * filePath: 'xxx.vue', * }) * ``` */ export declare function extractProps({ filePath, targetFilePath, extractRegexp, }: { filePath: string; targetFilePath?: string; extractRegexp?: RegExp; }): void; export declare function fetchLatestOneRainbowData({ secretInfo, appName, key, valueType, }: { secretInfo: { appId: string; groupName: string; envName: string; }; appName: string; key: string; valueType?: RainbowKeyValueType; }): Promise<{ config: Array<IRemoteConfig>; originConfig: ILocalConfig; equal: boolean; }>; export declare function fetchLatestRainbowData({ secretInfo, appName, }: { secretInfo: ISecretInfo_5; appName: string; }): Promise<{ config: Array<IRemoteConfig>; originConfig: ILocalConfig; equal: boolean; }>; /** * 拉取七彩石配置 * @param {String} key 七彩石的key * @param {object} secretInfo 密钥信息 * @param {string} secretInfo.appId 项目Id * @param {string} secretInfo.envName 环境 * @param {string} secretInfo.groupName 组名称 * @returns {Promise<object>} 请求Promise * * @example * * fetchRainbowConfig('test', { * appId: 'xx', * envName: 'prod', * groupName: 'robot', * }).then((resp) => { * console.log(resp) * }); * */ export declare function fetchRainbowConfig(key: string, secretInfo: Partial<ISecretInfo_3>, options?: { sdk: any; initOptions?: Record<string, any>; isFetchGroup?: boolean; tryJsonParse?: boolean; }): Promise<any>; export declare function fetchRainbowConfigFromSdk({ secretInfo, sdk, initOptions, key, isFetchGroup, tryJsonParse, rainbow, }: { secretInfo: ISecretInfo_3; sdk: any; key: string; initOptions?: Record<string, any>; isFetchGroup?: boolean; tryJsonParse?: boolean; rainbow?: any; }): Promise<unknown>; /** * 获取天气信息 * @returns {Promise<Array>} 天气数据 * @example * * fetchWeatherData().then(content => { * console.log(content) * }) */ export declare function fetchWeatherData<T extends Array<object>>(): Promise<T>; export declare type FileMap = { [k: string]: { reg: RegExp; lintKeyword: string; outputFileName: string; outputFile?: string; isStyle?: boolean; isVue?: boolean; total?: number; errorFiles?: JSErrorFile[]; }; }; export declare interface FilterParams { url: string; limit: number; keepKey: string[]; forceHistoryMode?: boolean | undefined; } /** * 根据地址长度,进行过滤地址参数,允许指定保留特定参数 * @param {object} [params={ limit: 1024 }] 参数 * @param {number} params.url 待过滤地址,默认当前页面地址 * @param {number} params.limit 参数长度限制 * @param {array} params.keepKey 指定保留的参数,比如业务参数、框架参数(登录态、统计上报等) */ export declare function filterUrlParams(params?: FilterParams): string; export declare function findCurrentStage<T extends { start_time: number; end_time: number; }>(list: Array<T>, now: number): T | Partial<T>; /** * 根据路由表,找到 path 对应的 路由名称 * @param {string} path 路由路径 * @param {array} routes 路由表 * @returns {object} 匹配到的路由信息 * * @example * ```ts * const { name, params, meta, path } = findRouteName(rawPath, ALL_ROUTES) || {}; * * console.log('name', name); * ``` */ export declare function findRouteName(path: string, routes: Array<IRoute>): { name: string | undefined; params: { [x: string]: any; }; path: string | undefined; meta: IMeta; } | undefined; declare type Flat<T extends any[]> = T extends [infer F, ...infer R] ? F extends any[] ? [...Flat<F>, ...Flat<R>] : [F, ...Flat<R>] : []; /** * 递归拉平数组 * @param list 数组 * @returns 数组 * * @example * * flat([[[1, 2, 3], 4], 5]) * * // [1, 2, 3, 4, 5] */ export declare function flat<T extends any[]>(list: T[]): Flat<T>; /** * 拉平数组,不会递归处理 * @param {Array<Object>} list - 对象数组 * @param {string} key - 对象的key * @returns {object} 拉平后的对象 * * @example * * const list = [{id: 1, name: 'a'}, {id: 2, name: 'b'}] * * flatten(list, 'id') * * // {1: {id: 1, name: 'a'}, 2: {id: 2, name: 'b'}} * */ export declare function flatten<K extends keyof any, T extends keyof any>(list: Array<Record<K, T>>, key: string): Record<T, Record<K, T>>; /** * 拉平之前数据 * @param {Array<Object>} preDataList 之前的数据,作为对照 * @param {string} key 主键 * @returns {Object} preDataMap * * @example * const data = [{ * ProjectName: { name: 'ProjectName', value: '研发平台' }, * PagePv: { name: 'PagePv', value: 152 }, * PageUv: { name: 'PageUv', value: 7 }, * Score: { name: 'Score', value: 93.92 }, * PageDuration: { name: 'PageDuration', value: 1281.58 }, * PageError: { name: 'PageError', value: 2 }, * }]; * * flattenPreData(data, 'ProjectName'); * * // 输出 * { * 研发平台: { * ProjectName: '研发平台', * PagePv: 152, * PageUv: 7, * Score: 93.92, * PageDuration: 1281.58, * PageError: 2, * }, * }; */ export declare function flattenPreData(preDataList: Array<IPreData>, key: string): { [valueOfPrimaryKey: string]: { [key: string]: ValueType; }; }; export declare function flattenSubPackages(result: IUploadResult): Record<string, any>; export declare function flattenUsingComponentMap(rawMap: Record<string, any>): ComponentMapList; /** * 格式化 bite 单位,最多保留2位小数,最大单位为BB * @param number size bite 单位 * @returns 格式化的字符 * @example * * formatBite(1) * // 1B * * formatBite(100) * // 100B * * formatBite(1000) * // 1000B * * formatBite(10000) * // 9.77KB * * formatBite(100000) * // 97.66KB * * formatBite(1000000) * // 976.56KB * * formatBite(10000000) * // 9.54MB */ export declare function formatBite(size: number): string; /** * 根据传入的参数,移除原来的所有参数,根据传入的 keepParamsObj 进行重新拼接地址,以 hash 模式返回 * @param {string} url 地址 * @param {object} keepParamsObj 参数对象 * @returns 只有传入参数的地址 * @example * const url1 = formatUrlParams('http://www.test.com?a=1&b=2&c=3', { e: 5 }); // http://www.test.com/#/?e=5 * const url2 = formatUrlParams('http://www.test.com?a=1&b=2&c=3#/detail?d=4', { f: 5 }); // http://www.test.com/#/detail?f=5 */ export declare function formatUrlParams(url?: string, keepParamsObj?: Record<string, string | number>, forceHistoryMode?: boolean): string; /** * 获取自定义事件图片并发送 * @param {object} options 配置信息 * @returns {string} 图片url * @example * * const requestMultiImgDate = Date.now() - 1 * 24 * 60 * 60 * 1000; * * const tamGroupIdList = [1, 2, 3]; * * const eventProjectMap = { * 62659: { * name: 'aaaaa', * }, * 57706: { * name: 'bbbbb', * extraProjectId: 66379, * }, * }; * * const eventMap = { * WX_SUC: { * // 总和 * type: 'SUMMARY', * target: ['ENTER_GAME_WX_SUC', 'LAUNCH_GAME_SUC_WX'], * }, * WX_FAIL: { * // 总和 * type: 'SUMMARY', * target: ['ENTER_GAME_WX_FAIL', 'LAUNCH_GAME_FAIL_WX'], * }, * }; * * const eventTableHeaderMap = { * ProjectName: { * name: '项目名称', * tableWidth: 95, * }, * ALL_SUMMARY: { * name: '拉起总数', * tableWidth: 65, * }, * }; * * genCustomEventImgAndSendRobot({ * date: requestLaunchGameDate, * secretInfo: { * getPwdCode, * encrypt, * apiKey: process.env.AEGIS_APP_KEY, * loginName: 'lee', * }, * projectIdMap: eventProjectMap, * eventMap, * tableHeaderMap: eventTableHeaderMap, * webhookUrl: tamRobotWebhook, * chatId: tamRobotChatId, * }); * */ export declare function genCustomEventImgAndSendRobot({ date, projectIdMap, env, secretInfo, eventMap, tableHeaderMap, webhookUrl, chatId, }: { date: number; projectIdMap: Array<string>; env: string; secretInfo: SecretInfoType; eventMap: {}; tableHeaderMap: {}; webhookUrl: string; chatId: string; }): Promise<void>; /** * 生成 CSV 文件内容,可以用于 fs.writeFileSync 输出 * * 第一行为表头 * @param {Array<Array<string>>} dataList 二维数据列表 * @returns 生成的字符串 * @example * * ```ts * generateCSV([['a','b'], ['1', '2']]); * ``` */ export declare function generateCSV(dataList: Array<Array<string>>): string; /** * 生成 CSV 所需数据,可用于传递给 generateCSV 方法 * * @param {Array<Record<string, string | number | boolean>>} list 数据列表 * @param {Record<string, string>} headMap 数据项的 key 和表头标题的映射关系 * @returns 二维数组,第一行是表头 * * @example * ```ts * generateCSVData([ * { * file: 'a.js', * size: 88, * }, * { * file: 'b.js', * size: 66, * } * ], { file: '文件名称', size: '文件大小' }) * * * // [['文件名称', '文件大小'], ['a.js', 88], ['b.js', 66]] * ``` */ export declare function generateCSVData(list: Array<Record<string, string | number | boolean>>, headMap: Record<string, string>): any[][]; export declare function genIterativeComponentMap(usingComponentsMap: IterativeComponentMap): void; /** * 生成多个图片并发送机器人 * @param {object} options 配置 * * @example * * const requestMultiImgDate = Date.now() - 1 * 24 * 60 * 60 * 1000; * * const tamGroupIdList = [1, 2, 3]; * * const summaryScoreTableHeaderMap = { * ProjectName: { * name: '项目名称', * tableWidth: 95, * }, * PagePv: { * name: 'PV', * tableWidth: 65, * }, * }; * * const eventProjectMap = { * 62659: { * name: 'aaaaa', * }, * 57706: { * name: 'bbbbb', * extraProjectId: 66379, * }, * }; * * const eventMap = { * WX_SUC: { * // 总和 * type: 'SUMMARY', * target: ['ENTER_GAME_WX_SUC', 'LAUNCH_GAME_SUC_WX'], * }, * WX_FAIL: { * // 总和 * type: 'SUMMARY', * target: ['ENTER_GAME_WX_FAIL', 'LAUNCH_GAME_FAIL_WX'], * }, * }; * * const eventTableHeaderMap = { * ProjectName: { * name: '项目名称', * tableWidth: 95, * }, * ALL_SUMMARY: { * name: '拉起总数', * tableWidth: 65, * }, * }; * * await genMultiImgAndSendRobot({ * date: requestMultiImgDate, * secretInfo: { * getPwdCode, * encrypt, * apiKey: process.env.AEGIS_APP_KEY, * loginName: 'lee', * }, * webhookUrl: tamRobotWebhook, * chatId: tamRobotChatId, * * groupIdList: tamGroupIdList, * eventProjectIdMap: eventProjectMap, * tableHeaderMap: summaryScoreTableHeaderMap, * * eventMap, * eventTableHeaderMap, * }); * * */ export declare function genMultiImgAndSendRobot({ date, groupIdList, secretInfo, extraDataMap, ignoreProjectIdList, tableHeaderMap, webhookUrl, chatId, env, eventMap, eventProjectIdMap, eventTableHeaderMap, }: { date: number; groupIdList: Array<number>; secretInfo: SecretInfoType; extraDataMap?: Record<string, any>; ignoreProjectIdList?: Array<string | number>; tableHeaderMap?: Record<string, any>; webhookUrl: string; chatId: string; env?: string; eventMap: Record<string, any>; eventProjectIdMap: Record<string, any>; eventTableHeaderMap: Record<string, any>; }): Promise<{ data: ScoreInfoType[]; projectIdList: number[]; } | undefined>; export declare function genQueryToStr(query?: Record<string, string | number>): string; /** * 请求签名Header生成 * @private * @param {object} signInfo 密钥信息 */ export declare function genRainbowHeaderSignature(signInfo: { appID?: string; appId?: string; userID?: string; userId?: string; secretKey: string; signMethod?: ISignMethod; }): { rainbow_sgn_type?: undefined; rainbow_version?: undefined; rainbow_app_id?: undefined; rainbow_user_id?: undefined; rainbow_timestamp?: undefined; rainbow_nonce?: undefined; rainbow_sgn_method?: undefined; rainbow_sgn_body?: undefined; rainbow_signature?: undefined; } | { rainbow_sgn_type: string; rainbow_version: string; rainbow_app_id: string | undefined; rainbow_user_id: string | undefined; rainbow_timestamp: string; rainbow_nonce: string; rainbow_sgn_method: ISignMethod; rainbow_sgn_body: string; rainbow_signature: any; }; export declare function genRobotMessage(list: Array<string | Array<MessageType>>, separator?: string, labelSeparator?: string): string; export declare function genRUMPerfImgAndSend({ secretId, secretKey, id, startTime, endTime, type, title, chatId, webhookUrl, }: { secretId: string; secretKey: string; id: string | number; startTime: number; endTime: number; type?: string; title?: string; chatId: string; webhookUrl: string; }): Promise<void>; /** * 获取jsAPI签名 * * 校验地址:https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=jsapisign * * 文档地址:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html * @param {string} ticket 票据 * @param {string} url 当前url,不包括#之后的部分 * @returns signature */ export declare function genSignature(ticket: string, url: string): { timestamp: number; nonceStr: any; signature: any; url: string; }; /** * 生成TAM汇总数据并发送到机器人 * @param {object} options 配置 * @param {string} options.date 日期,yyyyMMdd格式 * @param {Array<number>} options.groupIdList groupId列表 * * @param {object} options.secretInfo 密钥信息 * @param {string} options.secretInfo.apiKey apiKey * @param {string} options.secretInfo.loginName loginName * @param {Function} options.secretInfo.getPwdCode getPwdCode * @param {Function} options.secretInfo.encrypt encrypt * * @param {object} options.extraDataMap 额外数据Map * @param {object} options.ignoreProjectIdList 忽略的projectIdList * @param {object} options.tableHeaderMap 表格头部Map * * @param {object} options.webhookUrl 机器人回调地址 * @param {object} options.chatId 会话Id * * @example * const requestSummaryScoreDate = Date.now() - 1 * 24 * 60 * 60 * 1000; * * const tamGroupIdList = [1, 2, 3]; * * const summaryScoreTableHeaderMap = { * ProjectName: { * name: '项目名称', * tableWidth: 95, * }, * PagePv: { * name: 'PV', * tableWidth: 65, * }, * }; * * await genSummaryDataAndSendRobot({ * date: requestSummaryScoreDate, * groupIdList: tamGroupIdList, * secretInfo: { * getPwdCode, * encrypt, * apiKey: process.env.AEGIS_APP_KEY, * loginName: 'lee', * }, * webhookU