@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.mjs
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]="ada3d1d4-f1a5-538c-a9a1-1629c0cddc82")}catch(e){}}();
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
|
|
@@ -4352,9 +4352,7 @@ function __webpack_require__(moduleId) {
|
|
|
4352
4352
|
return module;
|
|
4353
4353
|
};
|
|
4354
4354
|
})();
|
|
4355
|
-
var package_namespaceObject = {
|
|
4356
|
-
i8: "4.1.0"
|
|
4357
|
-
};
|
|
4355
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.1.1-beta.0"}');
|
|
4358
4356
|
const USER_MESSAGE = {
|
|
4359
4357
|
PROXY_UNAVAILABLE: "代理暂时不可用,请稍后重试或使用本地IP",
|
|
4360
4358
|
NETWORK_ERROR: "网络异常,请稍后重试",
|
|
@@ -4836,6 +4834,14 @@ class Http {
|
|
|
4836
4834
|
this.logger?.debug(`[告警跳过] 本机地址不上报: ${fullUrl}`);
|
|
4837
4835
|
return;
|
|
4838
4836
|
}
|
|
4837
|
+
if (attempts < 3) {
|
|
4838
|
+
const isAuthExpired = 401 === status;
|
|
4839
|
+
const isTimeoutCanceled = "ERR_CANCELED" === axiosCode;
|
|
4840
|
+
if (isAuthExpired || isTimeoutCanceled) {
|
|
4841
|
+
this.logger?.debug(`[告警跳过] 低重试次数(${attempts})的常见错误不上报: status=${status}, code=${error.code}, axiosCode=${axiosCode}, url=${fullUrl}`);
|
|
4842
|
+
return;
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4839
4845
|
const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
|
|
4840
4846
|
const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
|
|
4841
4847
|
const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
|
|
@@ -11166,42 +11172,16 @@ const XhsSessionCheck = async (_task, params)=>{
|
|
|
11166
11172
|
data: response.data.data
|
|
11167
11173
|
};
|
|
11168
11174
|
});
|
|
11169
|
-
const loginBasePath = "/api/galaxy/
|
|
11175
|
+
const loginBasePath = "/api/galaxy/creator/home/personal_info";
|
|
11170
11176
|
const recordCookie = params.cookies.reduce((acc, cookie)=>{
|
|
11171
11177
|
if (cookie.name && cookie.value) acc[cookie.name] = cookie.value;
|
|
11172
11178
|
return acc;
|
|
11173
11179
|
}, {});
|
|
11174
|
-
let loginBaseXsHeader;
|
|
11175
|
-
try {
|
|
11176
|
-
loginBaseXsHeader = sessionCheck_xsEncrypt.signHeadersGet(loginBasePath, recordCookie, "xhs-pc-web", null);
|
|
11177
|
-
} catch (signError) {
|
|
11178
|
-
_task.logger?.error("[XhsSessionCheck] 签名生成失败 - 环境快照", {
|
|
11179
|
-
accountId: params.accountId,
|
|
11180
|
-
error: signError instanceof Error ? signError.message : String(signError),
|
|
11181
|
-
stack: _task.debug ? signError instanceof Error ? signError.stack : void 0 : void 0,
|
|
11182
|
-
hasA1: !!recordCookie.a1,
|
|
11183
|
-
env: {
|
|
11184
|
-
processType: process.type,
|
|
11185
|
-
memoryUsage: {
|
|
11186
|
-
heapUsed: `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)} MB`,
|
|
11187
|
-
heapTotal: `${Math.round(process.memoryUsage().heapTotal / 1024 / 1024)} MB`
|
|
11188
|
-
},
|
|
11189
|
-
hasProxy: !!params.proxyLoc,
|
|
11190
|
-
timeSinceLastLog: Date.now() - lastEnvLogTime
|
|
11191
|
-
}
|
|
11192
|
-
});
|
|
11193
|
-
return {
|
|
11194
|
-
code: 500,
|
|
11195
|
-
message: "账号签名生成失败,请稍后重试。",
|
|
11196
|
-
data: check
|
|
11197
|
-
};
|
|
11198
|
-
}
|
|
11199
11180
|
const baseInfoStart = Date.now();
|
|
11200
11181
|
const _baseInfo = http.api({
|
|
11201
11182
|
method: "get",
|
|
11202
11183
|
baseURL: "https://creator.xiaohongshu.com",
|
|
11203
|
-
url: loginBasePath
|
|
11204
|
-
headers: loginBaseXsHeader
|
|
11184
|
+
url: loginBasePath
|
|
11205
11185
|
}, {
|
|
11206
11186
|
retries: 3,
|
|
11207
11187
|
retryDelay: 300,
|
|
@@ -11211,7 +11191,7 @@ const XhsSessionCheck = async (_task, params)=>{
|
|
|
11211
11191
|
const serverDate = e?.extra?.serverDate;
|
|
11212
11192
|
const serverTimestamp = serverDate ? new Date(serverDate).getTime() : null;
|
|
11213
11193
|
const timeDriftMs = serverTimestamp ? clientTimestamp - serverTimestamp : null;
|
|
11214
|
-
_task.logger?.warn("[XhsSessionCheck] creator
|
|
11194
|
+
_task.logger?.warn("[XhsSessionCheck] creator personal_info 接口请求失败", {
|
|
11215
11195
|
accountId: params.accountId,
|
|
11216
11196
|
duration: Date.now() - baseInfoStart,
|
|
11217
11197
|
code: e?.code,
|
|
@@ -11229,7 +11209,31 @@ const XhsSessionCheck = async (_task, params)=>{
|
|
|
11229
11209
|
});
|
|
11230
11210
|
const webSessionPath = "/api/sns/web/unread_count";
|
|
11231
11211
|
const webSessionData = {};
|
|
11232
|
-
|
|
11212
|
+
let webSessionXsHeader;
|
|
11213
|
+
try {
|
|
11214
|
+
webSessionXsHeader = sessionCheck_xsEncrypt.signHeadersPost(webSessionPath, recordCookie, "xhs-pc-web", webSessionData);
|
|
11215
|
+
} catch (signError) {
|
|
11216
|
+
_task.logger?.error("[XhsSessionCheck] 签名生成失败 - 环境快照", {
|
|
11217
|
+
accountId: params.accountId,
|
|
11218
|
+
error: signError instanceof Error ? signError.message : String(signError),
|
|
11219
|
+
stack: _task.debug ? signError instanceof Error ? signError.stack : void 0 : void 0,
|
|
11220
|
+
hasA1: !!recordCookie.a1,
|
|
11221
|
+
env: {
|
|
11222
|
+
processType: process.type,
|
|
11223
|
+
memoryUsage: {
|
|
11224
|
+
heapUsed: `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)} MB`,
|
|
11225
|
+
heapTotal: `${Math.round(process.memoryUsage().heapTotal / 1024 / 1024)} MB`
|
|
11226
|
+
},
|
|
11227
|
+
hasProxy: !!params.proxyLoc,
|
|
11228
|
+
timeSinceLastLog: Date.now() - lastEnvLogTime
|
|
11229
|
+
}
|
|
11230
|
+
});
|
|
11231
|
+
return {
|
|
11232
|
+
code: 500,
|
|
11233
|
+
message: "账号签名生成失败,请稍后重试。",
|
|
11234
|
+
data: check
|
|
11235
|
+
};
|
|
11236
|
+
}
|
|
11233
11237
|
const _web_session = http.api({
|
|
11234
11238
|
method: "GET",
|
|
11235
11239
|
url: "https://edith.xiaohongshu.com/api/sns/web/unread_count",
|
|
@@ -16863,9 +16867,10 @@ async function handleXiaohongshuData(_task, params) {
|
|
|
16863
16867
|
timeout: 3000
|
|
16864
16868
|
});
|
|
16865
16869
|
}
|
|
16870
|
+
const isPublished = (note)=>!note.schedule_post_time;
|
|
16866
16871
|
const articleInfo = await fetchArticles(pageNum, onlySuccess);
|
|
16867
16872
|
let hasNextpage = -1 !== articleInfo.data.page;
|
|
16868
|
-
const filtered = articleInfo.data.notes;
|
|
16873
|
+
const filtered = articleInfo.data.notes.filter(isPublished);
|
|
16869
16874
|
let currentPage = pageNum + 1;
|
|
16870
16875
|
const usedPages = new Set();
|
|
16871
16876
|
while(filtered.length < pageSize && hasNextpage){
|
|
@@ -16875,7 +16880,7 @@ async function handleXiaohongshuData(_task, params) {
|
|
|
16875
16880
|
}
|
|
16876
16881
|
const res = await fetchArticles(currentPage, onlySuccess);
|
|
16877
16882
|
usedPages.add(currentPage);
|
|
16878
|
-
const validItems = res.data.notes;
|
|
16883
|
+
const validItems = res.data.notes.filter(isPublished);
|
|
16879
16884
|
filtered.push(...validItems);
|
|
16880
16885
|
currentPage++;
|
|
16881
16886
|
hasNextpage = -1 !== res.data.page;
|
|
@@ -27398,4 +27403,4 @@ var __webpack_exports__version = package_namespaceObject.i8;
|
|
|
27398
27403
|
export { Action, ActionCommonParamsSchema, BaijiahaoPublishParamsSchema, BetaFlag, CollectionDetailSchema, ConfigDataSchema, DouyinCheckVerifyQrCodeParamsSchema, DouyinCreateCommentReplyParamsSchema, DouyinGetCollectionParamsSchema, DouyinGetCommentListParamsSchema, DouyinGetCommentReplyListParamsSchema, DouyinGetHotParamsSchema, DouyinGetLocationParamsSchema, DouyinGetMusicByCategoryParamsSchema, DouyinGetMusicCategoryParamsSchema, DouyinGetMusicParamsSchema, DouyinGetTopicsParamsSchema, DouyinGetVerifyQrCodeParamsSchema, DouyinGetWorkListParamsSchema, DouyinPublishParamsSchema, FetchArticlesDataSchema, FetchArticlesParamsSchema, Http, ProxyAgent, SearchAccountInfoParamsSchema, SessionCheckResultSchema, ShipinhaoCheckLinkValidateParamsSchema, ShipinhaoGetLocationParamsSchema, ShipinhaoGetMsgParamsSchema, ShipinhaoPublishParamsSchema, ShipinhaoPublishVideoParamsSchema, ShipinhaoSendMsgParamsSchema, ToutiaoPublishParamsSchema, UnreadCountSchema, WeixinPublishParamsSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, douyinConfigDataSchema, getFileState, reportLogger, rpaAction_Server_Mock, shipinhaoConfigDataSchema, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
|
|
27399
27404
|
|
|
27400
27405
|
//# sourceMappingURL=index.mjs.map
|
|
27401
|
-
//# debugId=
|
|
27406
|
+
//# debugId=ada3d1d4-f1a5-538c-a9a1-1629c0cddc82
|