@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.
- package/dist/actions/toutiaoPublish/index.d.ts +1 -1
- package/dist/bundle.js +42 -37
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +42 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="56541751-7175-5826-bba1-27edba330f54")}catch(e){}}();
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
4
|
"./src/utils/XhsXsCommonEnc.js": function(module) {
|
|
5
5
|
var encrypt_lookup = [
|
|
@@ -4403,9 +4403,7 @@ var __webpack_exports__ = {};
|
|
|
4403
4403
|
});
|
|
4404
4404
|
const package_json_namespaceObject = require("@iflyrpa/share/package.json");
|
|
4405
4405
|
var package_json_default = /*#__PURE__*/ __webpack_require__.n(package_json_namespaceObject);
|
|
4406
|
-
var package_namespaceObject = {
|
|
4407
|
-
i8: "4.1.0"
|
|
4408
|
-
};
|
|
4406
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.1.1-beta.0"}');
|
|
4409
4407
|
const share_namespaceObject = require("@iflyrpa/share");
|
|
4410
4408
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
4411
4409
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
@@ -4903,6 +4901,14 @@ var __webpack_exports__ = {};
|
|
|
4903
4901
|
this.logger?.debug(`[告警跳过] 本机地址不上报: ${fullUrl}`);
|
|
4904
4902
|
return;
|
|
4905
4903
|
}
|
|
4904
|
+
if (attempts < 3) {
|
|
4905
|
+
const isAuthExpired = 401 === status;
|
|
4906
|
+
const isTimeoutCanceled = "ERR_CANCELED" === axiosCode;
|
|
4907
|
+
if (isAuthExpired || isTimeoutCanceled) {
|
|
4908
|
+
this.logger?.debug(`[告警跳过] 低重试次数(${attempts})的常见错误不上报: status=${status}, code=${error.code}, axiosCode=${axiosCode}, url=${fullUrl}`);
|
|
4909
|
+
return;
|
|
4910
|
+
}
|
|
4911
|
+
}
|
|
4906
4912
|
const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
|
|
4907
4913
|
const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
|
|
4908
4914
|
const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
|
|
@@ -11239,42 +11245,16 @@ var __webpack_exports__ = {};
|
|
|
11239
11245
|
data: response.data.data
|
|
11240
11246
|
};
|
|
11241
11247
|
});
|
|
11242
|
-
const loginBasePath = "/api/galaxy/
|
|
11248
|
+
const loginBasePath = "/api/galaxy/creator/home/personal_info";
|
|
11243
11249
|
const recordCookie = params.cookies.reduce((acc, cookie)=>{
|
|
11244
11250
|
if (cookie.name && cookie.value) acc[cookie.name] = cookie.value;
|
|
11245
11251
|
return acc;
|
|
11246
11252
|
}, {});
|
|
11247
|
-
let loginBaseXsHeader;
|
|
11248
|
-
try {
|
|
11249
|
-
loginBaseXsHeader = sessionCheck_xsEncrypt.signHeadersGet(loginBasePath, recordCookie, "xhs-pc-web", null);
|
|
11250
|
-
} catch (signError) {
|
|
11251
|
-
_task.logger?.error("[XhsSessionCheck] 签名生成失败 - 环境快照", {
|
|
11252
|
-
accountId: params.accountId,
|
|
11253
|
-
error: signError instanceof Error ? signError.message : String(signError),
|
|
11254
|
-
stack: _task.debug ? signError instanceof Error ? signError.stack : void 0 : void 0,
|
|
11255
|
-
hasA1: !!recordCookie.a1,
|
|
11256
|
-
env: {
|
|
11257
|
-
processType: process.type,
|
|
11258
|
-
memoryUsage: {
|
|
11259
|
-
heapUsed: `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)} MB`,
|
|
11260
|
-
heapTotal: `${Math.round(process.memoryUsage().heapTotal / 1024 / 1024)} MB`
|
|
11261
|
-
},
|
|
11262
|
-
hasProxy: !!params.proxyLoc,
|
|
11263
|
-
timeSinceLastLog: Date.now() - lastEnvLogTime
|
|
11264
|
-
}
|
|
11265
|
-
});
|
|
11266
|
-
return {
|
|
11267
|
-
code: 500,
|
|
11268
|
-
message: "账号签名生成失败,请稍后重试。",
|
|
11269
|
-
data: check
|
|
11270
|
-
};
|
|
11271
|
-
}
|
|
11272
11253
|
const baseInfoStart = Date.now();
|
|
11273
11254
|
const _baseInfo = http.api({
|
|
11274
11255
|
method: "get",
|
|
11275
11256
|
baseURL: "https://creator.xiaohongshu.com",
|
|
11276
|
-
url: loginBasePath
|
|
11277
|
-
headers: loginBaseXsHeader
|
|
11257
|
+
url: loginBasePath
|
|
11278
11258
|
}, {
|
|
11279
11259
|
retries: 3,
|
|
11280
11260
|
retryDelay: 300,
|
|
@@ -11284,7 +11264,7 @@ var __webpack_exports__ = {};
|
|
|
11284
11264
|
const serverDate = e?.extra?.serverDate;
|
|
11285
11265
|
const serverTimestamp = serverDate ? new Date(serverDate).getTime() : null;
|
|
11286
11266
|
const timeDriftMs = serverTimestamp ? clientTimestamp - serverTimestamp : null;
|
|
11287
|
-
_task.logger?.warn("[XhsSessionCheck] creator
|
|
11267
|
+
_task.logger?.warn("[XhsSessionCheck] creator personal_info 接口请求失败", {
|
|
11288
11268
|
accountId: params.accountId,
|
|
11289
11269
|
duration: Date.now() - baseInfoStart,
|
|
11290
11270
|
code: e?.code,
|
|
@@ -11302,7 +11282,31 @@ var __webpack_exports__ = {};
|
|
|
11302
11282
|
});
|
|
11303
11283
|
const webSessionPath = "/api/sns/web/unread_count";
|
|
11304
11284
|
const webSessionData = {};
|
|
11305
|
-
|
|
11285
|
+
let webSessionXsHeader;
|
|
11286
|
+
try {
|
|
11287
|
+
webSessionXsHeader = sessionCheck_xsEncrypt.signHeadersPost(webSessionPath, recordCookie, "xhs-pc-web", webSessionData);
|
|
11288
|
+
} catch (signError) {
|
|
11289
|
+
_task.logger?.error("[XhsSessionCheck] 签名生成失败 - 环境快照", {
|
|
11290
|
+
accountId: params.accountId,
|
|
11291
|
+
error: signError instanceof Error ? signError.message : String(signError),
|
|
11292
|
+
stack: _task.debug ? signError instanceof Error ? signError.stack : void 0 : void 0,
|
|
11293
|
+
hasA1: !!recordCookie.a1,
|
|
11294
|
+
env: {
|
|
11295
|
+
processType: process.type,
|
|
11296
|
+
memoryUsage: {
|
|
11297
|
+
heapUsed: `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)} MB`,
|
|
11298
|
+
heapTotal: `${Math.round(process.memoryUsage().heapTotal / 1024 / 1024)} MB`
|
|
11299
|
+
},
|
|
11300
|
+
hasProxy: !!params.proxyLoc,
|
|
11301
|
+
timeSinceLastLog: Date.now() - lastEnvLogTime
|
|
11302
|
+
}
|
|
11303
|
+
});
|
|
11304
|
+
return {
|
|
11305
|
+
code: 500,
|
|
11306
|
+
message: "账号签名生成失败,请稍后重试。",
|
|
11307
|
+
data: check
|
|
11308
|
+
};
|
|
11309
|
+
}
|
|
11306
11310
|
const _web_session = http.api({
|
|
11307
11311
|
method: "GET",
|
|
11308
11312
|
url: "https://edith.xiaohongshu.com/api/sns/web/unread_count",
|
|
@@ -16945,9 +16949,10 @@ var __webpack_exports__ = {};
|
|
|
16945
16949
|
timeout: 3000
|
|
16946
16950
|
});
|
|
16947
16951
|
}
|
|
16952
|
+
const isPublished = (note)=>!note.schedule_post_time;
|
|
16948
16953
|
const articleInfo = await fetchArticles(pageNum, onlySuccess);
|
|
16949
16954
|
let hasNextpage = -1 !== articleInfo.data.page;
|
|
16950
|
-
const filtered = articleInfo.data.notes;
|
|
16955
|
+
const filtered = articleInfo.data.notes.filter(isPublished);
|
|
16951
16956
|
let currentPage = pageNum + 1;
|
|
16952
16957
|
const usedPages = new Set();
|
|
16953
16958
|
while(filtered.length < pageSize && hasNextpage){
|
|
@@ -16957,7 +16962,7 @@ var __webpack_exports__ = {};
|
|
|
16957
16962
|
}
|
|
16958
16963
|
const res = await fetchArticles(currentPage, onlySuccess);
|
|
16959
16964
|
usedPages.add(currentPage);
|
|
16960
|
-
const validItems = res.data.notes;
|
|
16965
|
+
const validItems = res.data.notes.filter(isPublished);
|
|
16961
16966
|
filtered.push(...validItems);
|
|
16962
16967
|
currentPage++;
|
|
16963
16968
|
hasNextpage = -1 !== res.data.page;
|
|
@@ -27484,4 +27489,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
27484
27489
|
});
|
|
27485
27490
|
|
|
27486
27491
|
//# sourceMappingURL=index.js.map
|
|
27487
|
-
//# debugId=
|
|
27492
|
+
//# debugId=56541751-7175-5826-bba1-27edba330f54
|