@iflyrpa/actions 3.0.4 → 4.0.0-beta.1

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/index.js CHANGED
@@ -5489,9 +5489,7 @@ var __webpack_exports__ = {};
5489
5489
  });
5490
5490
  const package_json_namespaceObject = require("@iflyrpa/share/package.json");
5491
5491
  var package_json_default = /*#__PURE__*/ __webpack_require__.n(package_json_namespaceObject);
5492
- var package_namespaceObject = {
5493
- i8: "3.0.3"
5494
- };
5492
+ var package_namespaceObject = JSON.parse('{"i8":"3.0.5-beta.0"}');
5495
5493
  const share_namespaceObject = require("@iflyrpa/share");
5496
5494
  const external_node_fs_namespaceObject = require("node:fs");
5497
5495
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
@@ -5596,6 +5594,13 @@ var __webpack_exports__ = {};
5596
5594
  }
5597
5595
  };
5598
5596
  if (foundError) Object.assign(errorResponse, foundError);
5597
+ if (error.response?.status === 403) {
5598
+ this.logger?.warn(`[403 详细信息] URL: ${error.config?.url}`);
5599
+ this.logger?.warn(`[403 响应头] ${JSON.stringify(error.response?.headers || {})}`);
5600
+ this.logger?.warn(`[403 响应体] ${JSON.stringify(error.response?.data || null)}`);
5601
+ const verifyDecision = error.response?.headers?.["x-tt-verify-passport-decision"];
5602
+ if (verifyDecision) this.logger?.warn(`[403 验证决策] x-tt-verify-passport-decision: ${verifyDecision}`);
5603
+ }
5599
5604
  if (error.response?.data) {
5600
5605
  if ("object" == typeof error.response.data) {
5601
5606
  const serverError = error.response.data;
@@ -14564,54 +14569,49 @@ var __webpack_exports__ = {};
14564
14569
  })}`);
14565
14570
  task.logger.info(`publishData: ${JSON.stringify(publishData)}`);
14566
14571
  task.logger.info(`url: https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`);
14567
- let publishResult;
14568
- try {
14569
- publishResult = await proxyHttp.api({
14570
- method: "post",
14571
- url: `https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`,
14572
- data: publishData,
14573
- defaultErrorMsg: "发布异常,请稍后重试。",
14574
- headers: {
14575
- ...headers,
14576
- Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
14577
- "Content-Type": "application/json",
14578
- Accept: "application/json, text/plain, */*",
14579
- "bd-ticket-guard-client-data": bdTicketGuardClientData["headers_bd_ticket_guard_client_data"],
14580
- "bd-ticket-guard-ree-public-key": bdTicketGuardClientData["headers_bd_ticket_guard_ree_public_key"],
14581
- "bd-ticket-guard-version": "2",
14582
- "bd-ticket-guard-web-sign-type": "1",
14583
- "bd-ticket-guard-web-version": "2",
14584
- "x-secsdk-csrf-token": csrfToken,
14585
- "x-tt-session-dtrait": sessionDtrait || ""
14586
- }
14587
- }, {
14588
- timeout: 60000,
14589
- retries: 3,
14590
- retryDelay: 2000
14591
- });
14592
- } catch (error) {
14593
- const upstreamMessage = error?.message || String(error);
14594
- const upstreamCode = error?.code;
14595
- task.logger.error(`TaskId:${task.taskId},create_v2 请求异常,上游错误已屏蔽。上游 code=${upstreamCode},message=${upstreamMessage}`, {
14596
- error,
14597
- upstreamData: error?.data,
14598
- extra: error?.extra
14599
- });
14600
- const message = "发布失败,请重试";
14572
+ const publishResult = await proxyHttp.api({
14573
+ method: "post",
14574
+ url: `https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`,
14575
+ data: publishData,
14576
+ defaultErrorMsg: "发布异常,请稍后重试。",
14577
+ headers: {
14578
+ ...headers,
14579
+ Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
14580
+ "Content-Type": "application/json",
14581
+ Accept: "application/json, text/plain, */*",
14582
+ "bd-ticket-guard-client-data": bdTicketGuardClientData["headers_bd_ticket_guard_client_data"],
14583
+ "bd-ticket-guard-ree-public-key": bdTicketGuardClientData["headers_bd_ticket_guard_ree_public_key"],
14584
+ "bd-ticket-guard-version": "2",
14585
+ "bd-ticket-guard-web-sign-type": "1",
14586
+ "bd-ticket-guard-web-version": "2",
14587
+ "x-secsdk-csrf-token": csrfToken,
14588
+ "x-tt-session-dtrait": sessionDtrait || ""
14589
+ }
14590
+ }, {
14591
+ timeout: 60000,
14592
+ retries: 3,
14593
+ retryDelay: 2000
14594
+ });
14595
+ task.logger.info("========== api调用完成 ==========");
14596
+ task.logger.info(`decision值: ${JSON.stringify(decision)}, needsVerification(decision): ${needsVerification(decision)}`);
14597
+ if (needsVerification(decision)) {
14598
+ task.logger.warn(`TaskId:${task.taskId},检测到需要验证,准备返回验证信息`);
14601
14599
  await updateTaskState?.({
14602
- state: share_namespaceObject.TaskState.FAILED,
14603
- error: message,
14600
+ state: share_namespaceObject.TaskState.SUCCESS,
14604
14601
  result: {
14605
- data: decision,
14606
- uploadedImgList: JSON.stringify(publishData.item.common.images)
14602
+ response: decision
14607
14603
  }
14608
14604
  });
14605
+ task.logger.info("返回验证响应: code=0, message=操作成功");
14609
14606
  return {
14610
- code: 414,
14611
- data: "",
14612
- message
14607
+ code: 0,
14608
+ data: {
14609
+ result: decision
14610
+ },
14611
+ message: "操作成功"
14613
14612
  };
14614
14613
  }
14614
+ task.logger.info("不需要验证,继续正常流程");
14615
14615
  reportLogger({
14616
14616
  token: params.huiwenToken || "",
14617
14617
  enverionment: task.enverionment || "development",