@iflyrpa/actions 4.1.0 → 4.1.1-beta.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.
@@ -76,7 +76,7 @@ export declare const ToutiaoPublishParamsSchema: z.ZodObject<{
76
76
  }, z.core.$strip>;
77
77
  export type ToutiaoPublishParams = z.infer<typeof ToutiaoPublishParamsSchema>;
78
78
  export declare const COVER_TYPE: Record<CoverType, number>;
79
- export declare const getAddTypeValue: (toutiaoAd: ToutiaoPublishParams["settingInfo"]["toutiaoAd"]) => 2 | 3;
79
+ export declare const getAddTypeValue: (toutiaoAd: ToutiaoPublishParams["settingInfo"]["toutiaoAd"]) => 3 | 2;
80
80
  export type PublishAction = CommonAction<ToutiaoPublishParams, string>;
81
81
  export declare const toutiaoPublish: PublishAction;
82
82
  export {};
package/dist/bundle.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! For license information please see bundle.js.LICENSE.txt */
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bf64112a-57bc-5eae-9ede-8d23fc55671f")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fb6eb3b8-9fcc-53e7-9e60-cd649507d5fa")}catch(e){}}();
4
4
  var __webpack_modules__ = {
5
5
  "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports1, __webpack_require__) {
6
6
  "use strict";
@@ -12493,9 +12493,7 @@ var __webpack_exports__ = {};
12493
12493
  var package_namespaceObject = {
12494
12494
  i8: "0.2.0"
12495
12495
  };
12496
- var package_namespaceObject_0 = {
12497
- i8: "4.1.0"
12498
- };
12496
+ var package_namespaceObject_0 = JSON.parse('{"i8":"4.1.1-beta.0"}');
12499
12497
  const external_node_fs_namespaceObject = require("node:fs");
12500
12498
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
12501
12499
  const external_node_http_namespaceObject = require("node:http");
@@ -27524,6 +27522,14 @@ var __webpack_exports__ = {};
27524
27522
  this.logger?.debug(`[告警跳过] 本机地址不上报: ${fullUrl}`);
27525
27523
  return;
27526
27524
  }
27525
+ if (attempts < 3) {
27526
+ const isAuthExpired = 401 === status;
27527
+ const isTimeoutCanceled = "ERR_CANCELED" === axiosCode;
27528
+ if (isAuthExpired || isTimeoutCanceled) {
27529
+ this.logger?.debug(`[告警跳过] 低重试次数(${attempts})的常见错误不上报: status=${status}, code=${error.code}, axiosCode=${axiosCode}, url=${fullUrl}`);
27530
+ return;
27531
+ }
27532
+ }
27527
27533
  const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
27528
27534
  const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
27529
27535
  const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
@@ -34824,42 +34830,16 @@ var __webpack_exports__ = {};
34824
34830
  data: response.data.data
34825
34831
  };
34826
34832
  });
34827
- const loginBasePath = "/api/galaxy/v2/creator/datacenter/account/base";
34833
+ const loginBasePath = "/api/galaxy/creator/home/personal_info";
34828
34834
  const recordCookie = params.cookies.reduce((acc, cookie)=>{
34829
34835
  if (cookie.name && cookie.value) acc[cookie.name] = cookie.value;
34830
34836
  return acc;
34831
34837
  }, {});
34832
- let loginBaseXsHeader;
34833
- try {
34834
- loginBaseXsHeader = sessionCheck_xsEncrypt.signHeadersGet(loginBasePath, recordCookie, "xhs-pc-web", null);
34835
- } catch (signError) {
34836
- _task.logger?.error("[XhsSessionCheck] 签名生成失败 - 环境快照", {
34837
- accountId: params.accountId,
34838
- error: signError instanceof Error ? signError.message : String(signError),
34839
- stack: _task.debug ? signError instanceof Error ? signError.stack : void 0 : void 0,
34840
- hasA1: !!recordCookie.a1,
34841
- env: {
34842
- processType: process.type,
34843
- memoryUsage: {
34844
- heapUsed: `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)} MB`,
34845
- heapTotal: `${Math.round(process.memoryUsage().heapTotal / 1024 / 1024)} MB`
34846
- },
34847
- hasProxy: !!params.proxyLoc,
34848
- timeSinceLastLog: Date.now() - lastEnvLogTime
34849
- }
34850
- });
34851
- return {
34852
- code: 500,
34853
- message: "账号签名生成失败,请稍后重试。",
34854
- data: check
34855
- };
34856
- }
34857
34838
  const baseInfoStart = Date.now();
34858
34839
  const _baseInfo = http.api({
34859
34840
  method: "get",
34860
34841
  baseURL: "https://creator.xiaohongshu.com",
34861
- url: loginBasePath,
34862
- headers: loginBaseXsHeader
34842
+ url: loginBasePath
34863
34843
  }, {
34864
34844
  retries: 3,
34865
34845
  retryDelay: 300,
@@ -34869,7 +34849,7 @@ var __webpack_exports__ = {};
34869
34849
  const serverDate = e?.extra?.serverDate;
34870
34850
  const serverTimestamp = serverDate ? new Date(serverDate).getTime() : null;
34871
34851
  const timeDriftMs = serverTimestamp ? clientTimestamp - serverTimestamp : null;
34872
- _task.logger?.warn("[XhsSessionCheck] creator base 接口请求失败", {
34852
+ _task.logger?.warn("[XhsSessionCheck] creator personal_info 接口请求失败", {
34873
34853
  accountId: params.accountId,
34874
34854
  duration: Date.now() - baseInfoStart,
34875
34855
  code: e?.code,
@@ -34887,7 +34867,31 @@ var __webpack_exports__ = {};
34887
34867
  });
34888
34868
  const webSessionPath = "/api/sns/web/unread_count";
34889
34869
  const webSessionData = {};
34890
- const webSessionXsHeader = sessionCheck_xsEncrypt.signHeadersPost(webSessionPath, recordCookie, "xhs-pc-web", webSessionData);
34870
+ let webSessionXsHeader;
34871
+ try {
34872
+ webSessionXsHeader = sessionCheck_xsEncrypt.signHeadersPost(webSessionPath, recordCookie, "xhs-pc-web", webSessionData);
34873
+ } catch (signError) {
34874
+ _task.logger?.error("[XhsSessionCheck] 签名生成失败 - 环境快照", {
34875
+ accountId: params.accountId,
34876
+ error: signError instanceof Error ? signError.message : String(signError),
34877
+ stack: _task.debug ? signError instanceof Error ? signError.stack : void 0 : void 0,
34878
+ hasA1: !!recordCookie.a1,
34879
+ env: {
34880
+ processType: process.type,
34881
+ memoryUsage: {
34882
+ heapUsed: `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)} MB`,
34883
+ heapTotal: `${Math.round(process.memoryUsage().heapTotal / 1024 / 1024)} MB`
34884
+ },
34885
+ hasProxy: !!params.proxyLoc,
34886
+ timeSinceLastLog: Date.now() - lastEnvLogTime
34887
+ }
34888
+ });
34889
+ return {
34890
+ code: 500,
34891
+ message: "账号签名生成失败,请稍后重试。",
34892
+ data: check
34893
+ };
34894
+ }
34891
34895
  const _web_session = http.api({
34892
34896
  method: "GET",
34893
34897
  url: "https://edith.xiaohongshu.com/api/sns/web/unread_count",
@@ -42016,9 +42020,10 @@ var __webpack_exports__ = {};
42016
42020
  timeout: 3000
42017
42021
  });
42018
42022
  }
42023
+ const isPublished = (note)=>!note.schedule_post_time;
42019
42024
  const articleInfo = await fetchArticles(pageNum, onlySuccess);
42020
42025
  let hasNextpage = -1 !== articleInfo.data.page;
42021
- const filtered = articleInfo.data.notes;
42026
+ const filtered = articleInfo.data.notes.filter(isPublished);
42022
42027
  let currentPage = pageNum + 1;
42023
42028
  const usedPages = new Set();
42024
42029
  while(filtered.length < pageSize && hasNextpage){
@@ -42028,7 +42033,7 @@ var __webpack_exports__ = {};
42028
42033
  }
42029
42034
  const res = await fetchArticles(currentPage, onlySuccess);
42030
42035
  usedPages.add(currentPage);
42031
- const validItems = res.data.notes;
42036
+ const validItems = res.data.notes.filter(isPublished);
42032
42037
  filtered.push(...validItems);
42033
42038
  currentPage++;
42034
42039
  hasNextpage = -1 !== res.data.page;
@@ -52555,4 +52560,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
52555
52560
  });
52556
52561
 
52557
52562
  //# sourceMappingURL=bundle.js.map
52558
- //# debugId=bf64112a-57bc-5eae-9ede-8d23fc55671f
52563
+ //# debugId=fb6eb3b8-9fcc-53e7-9e60-cd649507d5fa