@iflyrpa/actions 3.0.4 → 4.0.0-beta.2
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/bundle.js +39 -53
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +39 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -8736,9 +8736,7 @@ var __webpack_exports__ = {};
|
|
|
8736
8736
|
var package_namespaceObject = {
|
|
8737
8737
|
i8: "0.1.0"
|
|
8738
8738
|
};
|
|
8739
|
-
var package_namespaceObject_0 = {
|
|
8740
|
-
i8: "3.0.3"
|
|
8741
|
-
};
|
|
8739
|
+
var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.0-beta.1"}');
|
|
8742
8740
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
8743
8741
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
8744
8742
|
const external_node_http_namespaceObject = require("node:http");
|
|
@@ -34694,13 +34692,21 @@ var __webpack_exports__ = {};
|
|
|
34694
34692
|
console.log("拦截器收到响应:", JSON.stringify(response.data));
|
|
34695
34693
|
task.logger.info(`拦截器收到响应response.headers: ${JSON.stringify(response.headers)} `);
|
|
34696
34694
|
task.logger.info(`拦截器收到响应response.data: ${JSON.stringify(response.data)} `);
|
|
34695
|
+
task.logger.info(`拦截器收到响应response.data类型: ${typeof response.data}, 值: ${JSON.stringify(response.data)}`);
|
|
34697
34696
|
decision = parseVerifyPassportDecision(response.headers["x-tt-verify-passport-decision"]);
|
|
34697
|
+
task.logger.info(`解析后的decision: ${JSON.stringify(decision)}`);
|
|
34698
34698
|
if (needsVerification(decision)) {
|
|
34699
|
-
task.logger.info(
|
|
34699
|
+
task.logger.info(`检测到需要验证,decision.account_flow: ${decision?.account_flow}`);
|
|
34700
|
+
task.logger.info("拦截器即将return,不抛错");
|
|
34701
|
+
return;
|
|
34702
|
+
}
|
|
34703
|
+
task.logger.info("不需要验证,继续检查response.data");
|
|
34704
|
+
if (!response || !response.data) {
|
|
34705
|
+
task.logger.info("response或response.data为空,拦截器return");
|
|
34700
34706
|
return;
|
|
34701
34707
|
}
|
|
34702
|
-
if (!response || !response.data) return;
|
|
34703
34708
|
const responseData = response.data;
|
|
34709
|
+
task.logger.info(`responseData.status_code: ${responseData?.status_code}`);
|
|
34704
34710
|
if (response && responseData?.status_code && 0 !== responseData.status_code) {
|
|
34705
34711
|
const errorCode = 4 === responseData.status_code ? 500 : responseData.status_code;
|
|
34706
34712
|
if (4 === responseData.status_code) task.logger.warn(`抖音服务器错误 status_code: 4,映射为 500 触发重试。原始响应: ${JSON.stringify(responseData)}`);
|
|
@@ -34773,54 +34779,34 @@ var __webpack_exports__ = {};
|
|
|
34773
34779
|
})}`);
|
|
34774
34780
|
task.logger.info(`publishData: ${JSON.stringify(publishData)}`);
|
|
34775
34781
|
task.logger.info(`url: https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`);
|
|
34776
|
-
|
|
34777
|
-
|
|
34778
|
-
|
|
34779
|
-
|
|
34780
|
-
|
|
34781
|
-
|
|
34782
|
-
|
|
34783
|
-
|
|
34784
|
-
|
|
34785
|
-
|
|
34786
|
-
|
|
34787
|
-
|
|
34788
|
-
|
|
34789
|
-
|
|
34790
|
-
|
|
34791
|
-
|
|
34792
|
-
|
|
34793
|
-
|
|
34794
|
-
|
|
34795
|
-
|
|
34796
|
-
|
|
34797
|
-
|
|
34798
|
-
|
|
34799
|
-
|
|
34800
|
-
|
|
34801
|
-
|
|
34802
|
-
|
|
34803
|
-
|
|
34804
|
-
task.logger.error(`TaskId:${task.taskId},create_v2 请求异常,上游错误已屏蔽。上游 code=${upstreamCode},message=${upstreamMessage}`, {
|
|
34805
|
-
error,
|
|
34806
|
-
upstreamData: error?.data,
|
|
34807
|
-
extra: error?.extra
|
|
34808
|
-
});
|
|
34809
|
-
const message = "发布失败,请重试";
|
|
34810
|
-
await updateTaskState?.({
|
|
34811
|
-
state: types_TaskState.FAILED,
|
|
34812
|
-
error: message,
|
|
34813
|
-
result: {
|
|
34814
|
-
data: decision,
|
|
34815
|
-
uploadedImgList: JSON.stringify(publishData.item.common.images)
|
|
34816
|
-
}
|
|
34817
|
-
});
|
|
34818
|
-
return {
|
|
34819
|
-
code: 414,
|
|
34820
|
-
data: "",
|
|
34821
|
-
message
|
|
34822
|
-
};
|
|
34823
|
-
}
|
|
34782
|
+
const publishResult = await proxyHttp.api({
|
|
34783
|
+
method: "post",
|
|
34784
|
+
url: `https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`,
|
|
34785
|
+
data: publishData,
|
|
34786
|
+
defaultErrorMsg: "发布异常,请稍后重试。",
|
|
34787
|
+
headers: {
|
|
34788
|
+
...headers,
|
|
34789
|
+
Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
|
|
34790
|
+
"Content-Type": "application/json",
|
|
34791
|
+
Accept: "application/json, text/plain, */*",
|
|
34792
|
+
"bd-ticket-guard-client-data": bdTicketGuardClientData["headers_bd_ticket_guard_client_data"],
|
|
34793
|
+
"bd-ticket-guard-ree-public-key": bdTicketGuardClientData["headers_bd_ticket_guard_ree_public_key"],
|
|
34794
|
+
"bd-ticket-guard-version": "2",
|
|
34795
|
+
"bd-ticket-guard-web-sign-type": "1",
|
|
34796
|
+
"bd-ticket-guard-web-version": "2",
|
|
34797
|
+
"x-secsdk-csrf-token": csrfToken,
|
|
34798
|
+
"x-tt-session-dtrait": sessionDtrait || ""
|
|
34799
|
+
}
|
|
34800
|
+
}, {
|
|
34801
|
+
timeout: 60000,
|
|
34802
|
+
retries: 3,
|
|
34803
|
+
retryDelay: 2000
|
|
34804
|
+
});
|
|
34805
|
+
task.logger.info("========== api调用完成 ==========");
|
|
34806
|
+
task.logger.info(`publishResult类型: ${typeof publishResult}, 值: ${JSON.stringify(publishResult)}`);
|
|
34807
|
+
task.logger.info(`decision值: ${JSON.stringify(decision)}`);
|
|
34808
|
+
task.logger.info(`needsVerification(decision): ${needsVerification(decision)}`);
|
|
34809
|
+
task.logger.info("不需要验证,继续正常流程");
|
|
34824
34810
|
reportLogger({
|
|
34825
34811
|
token: params.huiwenToken || "",
|
|
34826
34812
|
enverionment: task.enverionment || "development",
|