@iflyrpa/actions 4.0.9-beta.4 → 4.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iflyrpa/actions",
3
- "version": "4.0.9-beta.4",
3
+ "version": "4.0.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -1,41 +0,0 @@
1
- import type { ResponseData } from "@iflyrpa/share";
2
- /**
3
- * 用户可见的错误文案。
4
- *
5
- * 约定:凡是会进入 ResponseData.message(前端直接展示)的文案都从这里取,
6
- * 不要把 err.message / error.code / 文件路径等技术细节拼进去 —— 那些信息
7
- * 放 logger 与飞书告警里,用户侧只保留「看得懂 + 知道下一步做什么」的文案。
8
- */
9
- export declare const USER_MESSAGE: {
10
- readonly PROXY_UNAVAILABLE: "代理暂时不可用,请稍后重试或使用本地IP";
11
- readonly NETWORK_ERROR: "网络异常,请稍后重试";
12
- readonly SYSTEM_ERROR: "系统异常,请稍后重试或联系客服";
13
- readonly PUBLISH_NETWORK: "发布失败,网络不稳定,请稍后重试";
14
- readonly DOUYIN_ACCOUNT_FETCH_FAILED: "抖音数据获取失败,请稍后重试";
15
- readonly SHIPINHAO_ACCOUNT_FETCH_FAILED: "视频号数据获取失败,请稍后重试";
16
- readonly DOUYIN_POST_FETCH_FAILED: "抖音作品数据获取失败,请稍后重试";
17
- readonly SHIPINHAO_POST_FETCH_FAILED: "视频号作品数据获取失败,请稍后重试";
18
- readonly BJH_POST_FETCH_FAILED: "百家号作品数据获取失败,请稍后重试";
19
- readonly TT_POST_FETCH_FAILED: "头条号作品数据获取失败,请稍后重试";
20
- readonly QRCODE_FETCH_FAILED: "认证二维码获取失败,请稍后重试";
21
- readonly IMAGE_UPLOAD_FAILED: "图片上传失败,请稍后重试或联系客服";
22
- };
23
- /** 发布错误分类:category 只用于日志辨识,userMessage 才是用户可见文案 */
24
- export interface PublishErrorClassification {
25
- category: "代理错误" | "网络错误";
26
- userMessage: string;
27
- }
28
- /**
29
- * 对发布接口抛出的错误做分类,决定是「直接返回用户文案并终止」还是「交回 RPA 兜底」。
30
- *
31
- * 只拦代理/网络类错误 —— 这类错误重试耗尽后 RPA 兜底同样连不上,直接返回更快。
32
- * 返回 null 表示交回调用方 `throw error`,由上层 executeAction 走 RPA 兜底。
33
- *
34
- * 刻意不拦风控(403/461/471)与参数(400/422)错误:executeAction(utils/index.ts:257)
35
- * 只在 code 为 0 或 414 时终止,抛异常则继续执行下一个 action,
36
- * 因此这两类错误抛出后能进 RPA 兜底 —— 走浏览器自动化,用户完成验证后仍有机会发布成功。
37
- * 拦下来会掉掉这条补救路径,所以维持抛出。
38
- *
39
- * 注意 401 无需单列:http.ts 的响应拦截器已把 401 归一为 414(避免触发绘文平台鉴权逻辑)。
40
- */
41
- export declare function classifyPublishError(handledError: ResponseData): PublishErrorClassification | null;
@@ -1,27 +0,0 @@
1
- export type FeishuAlarmLevel = "warning" | "alarm";
2
- export type FeishuAlarmSource = "http" | "proxy";
3
- export interface FeishuAlarmReport {
4
- /** alarm 会额外 @所有人,warning 只发消息 */
5
- level: FeishuAlarmLevel;
6
- /** 业务标识:xiaohongshu / douyin / weixin ... */
7
- platform: string;
8
- /** 告警来源模块 */
9
- source: FeishuAlarmSource;
10
- /** 出错阶段,如 "POST /api/sns/web/v1/feed" */
11
- stage: string;
12
- /** 错误类型,如 HTTP_403 / ECONNRESET / PROXY_UNAVAILABLE */
13
- errorType: string;
14
- /** 接口错误码 */
15
- code?: string | number;
16
- /** 错误信息 */
17
- msg?: string;
18
- /** 请求地址 */
19
- url?: string;
20
- /** 消息标题,默认「RPA异常」 */
21
- title?: string;
22
- }
23
- /**
24
- * 上报错误到飞书群,失败静默:告警链路不能影响主流程。
25
- * 同一 platform + source + errorType + code 组合在 60s 内只发一条。
26
- */
27
- export declare const reportFeishuAlarm: (report: FeishuAlarmReport) => void;