@iflyrpa/actions 4.1.0-beta.6 → 4.1.0

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.
@@ -22,6 +22,9 @@ export interface FeishuAlarmReport {
22
22
  }
23
23
  /**
24
24
  * 上报错误到飞书群,失败静默:告警链路不能影响主流程。
25
- * 同一 platform + source + errorType + code 组合在 60s 内只发一条。
25
+ * 同一 platform + source + stage + errorType + code 组合在 60s 内只发一条。
26
+ *
27
+ * 节流 key 里必须带 stage:不同接口的同类错误(例如 unread_count 与 personal_info
28
+ * 同时 ECONNABORTED)是两个独立问题,混成一个 key 会让后来的那个被静默吞掉。
26
29
  */
27
30
  export declare const reportFeishuAlarm: (report: FeishuAlarmReport) => void;
@@ -1,5 +1,13 @@
1
1
  import type { LoggerImplement, ResponseData } from "@iflyrpa/share";
2
2
  import { type AxiosRequestConfig, type AxiosResponse, type CreateAxiosDefaults } from "axios";
3
+ /**
4
+ * 判断是否为本机地址(localhost / 回环 IP / .local 等)。
5
+ *
6
+ * 本机地址上的失败来自本地服务或单元测试,不是线上问题,不该进告警群。
7
+ * 用 URL 解析而非字符串包含匹配:`https://api.example.com/?cb=localhost` 这类
8
+ * 参数里带 localhost 的线上地址不能被误判成本机。
9
+ */
10
+ export declare function isLocalAddress(url: string): boolean;
3
11
  export declare class Http {
4
12
  private readonly apiClient;
5
13
  logger?: LoggerImplement;
@@ -10,6 +18,14 @@ export declare class Http {
10
18
  constructor(config?: CreateAxiosDefaults, logger?: LoggerImplement, addr?: string | null, accountId?: number, platform?: string);
11
19
  clearResponseInterceptors(): void;
12
20
  addResponseInterceptor<T = any>(findError: (response: AxiosResponse<T>) => ResponseData | undefined): void;
21
+ /**
22
+ * 请求最终失败(重试耗尽或错误不可重试)后上报飞书告警。
23
+ * 告警所需的 status / axios error code 由响应拦截器写入 error.extra。
24
+ *
25
+ * 两类请求不上报:本机地址(localhost / 127.0.0.1 等)与拿不到 URL 的错误。
26
+ * 前者是本地服务或测试用例,后者没有目标地址无法定位,都属于告警噪音。
27
+ */
28
+ private reportRequestFailure;
13
29
  api<T = any>(config: AxiosRequestConfig, options?: {
14
30
  retries?: number;
15
31
  retryDelay?: number;
@@ -1,4 +1,14 @@
1
1
  export declare const contentLimitLength: (content: string) => boolean;
2
+ /**
3
+ * 从上传接口(completepartuploaddfs)返回的 DownloadURL 中提取 encfilekey。
4
+ *
5
+ * 这个 key 是发布结果与作品列表之间唯一稳定的关联标识:图文与视频发布都返回它,
6
+ * 上层据此把发布记录对上作品。不要改用 clipKey —— clipKey 只是转码任务 id,
7
+ * 发布完成后在作品列表侧查不到对应记录。
8
+ *
9
+ * 取不到时返回空字符串(与图文侧原有行为一致),由调用方决定是否记日志。
10
+ */
11
+ export declare const extractEncFileKey: (downloadUrl?: string) => string;
2
12
  export declare const rid: () => string;
3
13
  /**
4
14
  * UUID v4 生成器
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iflyrpa/actions",
3
- "version": "4.1.0-beta.6",
3
+ "version": "4.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "playwright-core": "^1.46.1",
24
24
  "socks-proxy-agent": "^8.0.4",
25
25
  "ws": "^8.18.3",
26
- "@iflyrpa/share": "0.1.2"
26
+ "@iflyrpa/share": "0.2.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@rslib/core": "^0.4.1",