@iflyrpa/actions 4.0.1 → 4.0.2-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/index.mjs CHANGED
@@ -5434,9 +5434,7 @@ function __webpack_require__(moduleId) {
5434
5434
  return module;
5435
5435
  };
5436
5436
  })();
5437
- var package_namespaceObject = {
5438
- i8: "4.0.1"
5439
- };
5437
+ var package_namespaceObject = JSON.parse('{"i8":"4.0.2-beta.0"}');
5440
5438
  var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
5441
5439
  async function ProxyAgent(task, ip, adr, accountId, refresh) {
5442
5440
  const http = new Http({
@@ -10202,6 +10200,7 @@ const mockAction = async (task, params)=>{
10202
10200
  platform: "baijiahao",
10203
10201
  publishParams: publishData
10204
10202
  });
10203
+ task.logger.info(`[baijiahaoPublish] publishResult: ${JSON.stringify(res)} `);
10205
10204
  const isSuccess = 0 === res.errno;
10206
10205
  const data = res?.ret?.article_id;
10207
10206
  const message = isSuccess ? isDraft ? "文章同步成功!" : `文章发布成功!${res.proxyInfo || ""}` : res.errmsg || (isDraft ? "文章同步失败,请稍后重试。" : "文章发布失败,请稍后重试。");
@@ -14474,7 +14473,6 @@ const mock_mockAction = async (task, params)=>{
14474
14473
  }
14475
14474
  publishData.item.common.creation_id = generateRandomString(8) + Date.now();
14476
14475
  let decision = null;
14477
- task.logger.info(`[douyinPublish] proxyHttp 代理信息: ${proxyHttp.proxyInfo} `);
14478
14476
  proxyHttp.addResponseInterceptor((response)=>{
14479
14477
  console.log("拦截器收到响应:", JSON.stringify(response.data));
14480
14478
  task.logger.warn(`[douyinPublish] 拦截器收到响应response.headers: ${JSON.stringify(response.headers)} `);
@@ -14618,9 +14616,6 @@ const mock_mockAction = async (task, params)=>{
14618
14616
  task.logger.error(`生成 sessionDtrait 失败: ${error}`);
14619
14617
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 sessionDtrait 生成异常,请重试", "");
14620
14618
  }
14621
- task.logger.info("[douyinPublish] 发布数据", {
14622
- data: JSON.stringify(publishData)
14623
- });
14624
14619
  task.logger.info(`[douyinPublish] headers: ${JSON.stringify({
14625
14620
  ...headers,
14626
14621
  Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
@@ -14635,29 +14630,55 @@ const mock_mockAction = async (task, params)=>{
14635
14630
  "x-tt-session-dtrait": sessionDtrait || ""
14636
14631
  })}`);
14637
14632
  task.logger.info(`[douyinPublish] url: https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`);
14638
- const publishResult = await proxyHttp.api({
14639
- method: "post",
14640
- url: `https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`,
14641
- data: publishData,
14642
- defaultErrorMsg: "发布异常,请稍后重试。",
14643
- headers: {
14644
- ...headers,
14645
- Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
14646
- "Content-Type": "application/json",
14647
- Accept: "application/json, text/plain, */*",
14648
- "bd-ticket-guard-client-data": bdTicketGuardClientData["headers_bd_ticket_guard_client_data"],
14649
- "bd-ticket-guard-ree-public-key": bdTicketGuardClientData["headers_bd_ticket_guard_ree_public_key"],
14650
- "bd-ticket-guard-version": "2",
14651
- "bd-ticket-guard-web-sign-type": "1",
14652
- "bd-ticket-guard-web-version": "2",
14653
- "x-secsdk-csrf-token": csrfToken,
14654
- "x-tt-session-dtrait": sessionDtrait || ""
14633
+ let publishResult;
14634
+ try {
14635
+ publishResult = await proxyHttp.api({
14636
+ method: "post",
14637
+ url: `https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`,
14638
+ data: publishData,
14639
+ defaultErrorMsg: "发布异常,请稍后重试。",
14640
+ headers: {
14641
+ ...headers,
14642
+ Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
14643
+ "Content-Type": "application/json",
14644
+ Accept: "application/json, text/plain, */*",
14645
+ "bd-ticket-guard-client-data": bdTicketGuardClientData["headers_bd_ticket_guard_client_data"],
14646
+ "bd-ticket-guard-ree-public-key": bdTicketGuardClientData["headers_bd_ticket_guard_ree_public_key"],
14647
+ "bd-ticket-guard-version": "2",
14648
+ "bd-ticket-guard-web-sign-type": "1",
14649
+ "bd-ticket-guard-web-version": "2",
14650
+ "x-secsdk-csrf-token": csrfToken,
14651
+ "x-tt-session-dtrait": sessionDtrait || ""
14652
+ }
14653
+ }, {
14654
+ timeout: 60000,
14655
+ retries: 3,
14656
+ retryDelay: 2000
14657
+ });
14658
+ } catch (error) {
14659
+ const handledError = Http.handleApiError(error);
14660
+ const isProxyOrNetworkError = [
14661
+ 599,
14662
+ 500,
14663
+ 502,
14664
+ 503,
14665
+ 504
14666
+ ].includes(handledError.code);
14667
+ if (isProxyOrNetworkError) {
14668
+ const message = `图文发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
14669
+ task.logger.error(`[douyinPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
14670
+ await updateTaskState?.({
14671
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
14672
+ error: message
14673
+ });
14674
+ return {
14675
+ code: 414,
14676
+ data: "",
14677
+ message
14678
+ };
14655
14679
  }
14656
- }, {
14657
- timeout: 60000,
14658
- retries: 3,
14659
- retryDelay: 2000
14660
- });
14680
+ throw error;
14681
+ }
14661
14682
  task.logger.info(`[douyinPublish] decision值: ${JSON.stringify(decision)}, needsVerification(decision): ${needsVerification(decision)}`);
14662
14683
  if (needsVerification(decision)) {
14663
14684
  const details = [
@@ -15958,7 +15979,7 @@ const getWeixinCollection = async (_task, params)=>{
15958
15979
  ajax: 1
15959
15980
  }
15960
15981
  });
15961
- return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.list_resp.items, 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
15982
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.list_resp?.items ?? [], 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
15962
15983
  };
15963
15984
  const getWeixinConfig = async (_task, params)=>{
15964
15985
  const http = new Http({
@@ -19081,28 +19102,55 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19081
19102
  address: params.address.address,
19082
19103
  uid: params.address.poi_id
19083
19104
  } : void 0;
19084
- const publishResult = await publishDynamic(cookieString, uin, fingerPrintDeviceId, aId, proxyHttp, {
19085
- token: params.huiwenToken || "",
19086
- enverionment: task.enverionment || "development",
19087
- articleId: params.articleId,
19088
- postId: params.articleId,
19089
- eip: proxyHttp.proxyInfo,
19090
- proxyIp: params.localIP,
19091
- accountId: params.accountId,
19092
- uid: params.uid
19093
- }, {
19094
- title: params.title,
19095
- content: params.content,
19096
- images: uploadedImages,
19097
- finderUsername,
19098
- publishType: params.publishType || "1",
19099
- topic: topicNames,
19100
- link: params.link,
19101
- address: addressInfo,
19102
- collection: params.collection,
19103
- scheduledPublish: params.scheduledPublish,
19104
- music: params.music
19105
- });
19105
+ let publishResult;
19106
+ try {
19107
+ publishResult = await publishDynamic(cookieString, uin, fingerPrintDeviceId, aId, proxyHttp, {
19108
+ token: params.huiwenToken || "",
19109
+ enverionment: task.enverionment || "development",
19110
+ articleId: params.articleId,
19111
+ postId: params.articleId,
19112
+ eip: proxyHttp.proxyInfo,
19113
+ proxyIp: params.localIP,
19114
+ accountId: params.accountId,
19115
+ uid: params.uid
19116
+ }, {
19117
+ title: params.title,
19118
+ content: params.content,
19119
+ images: uploadedImages,
19120
+ finderUsername,
19121
+ publishType: params.publishType || "1",
19122
+ topic: topicNames,
19123
+ link: params.link,
19124
+ address: addressInfo,
19125
+ collection: params.collection,
19126
+ scheduledPublish: params.scheduledPublish,
19127
+ music: params.music
19128
+ });
19129
+ } catch (error) {
19130
+ const handledError = Http.handleApiError(error);
19131
+ const isProxyOrNetworkError = [
19132
+ 599,
19133
+ 500,
19134
+ 502,
19135
+ 503,
19136
+ 504
19137
+ ].includes(handledError.code);
19138
+ if (isProxyOrNetworkError) {
19139
+ const message = `图文发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
19140
+ task.logger.error(`[shipinhaoPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
19141
+ await updateTaskState?.({
19142
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
19143
+ error: message
19144
+ });
19145
+ return {
19146
+ code: 414,
19147
+ data: "",
19148
+ message
19149
+ };
19150
+ }
19151
+ throw error;
19152
+ }
19153
+ task.logger.info(`[shipinhaoPublish] publishResult: ${JSON.stringify(publishResult)} `);
19106
19154
  const resultCode = publishResult.data?.baseResp?.errcode ?? publishResult.errCode;
19107
19155
  const resultMsg = publishResult.data?.baseResp?.errmsg ?? publishResult.errMsg;
19108
19156
  if (0 === resultCode) {
@@ -22417,28 +22465,53 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
22417
22465
  isNeedCode: "true",
22418
22466
  userType: "1"
22419
22467
  });
22420
- await proxyHttp.api({
22421
- method: "post",
22422
- url: "https://mp.weixin.qq.com/cgi-bin/masssend",
22423
- params: {
22424
- t: "ajax-response",
22425
- token: params.token,
22426
- lang: "zh_CN",
22427
- ...params.masssend ? {
22428
- ...params.settingInfo.timer ? {
22429
- action: "time_send"
22430
- } : {}
22431
- } : {
22432
- is_release_publish_page: 1
22433
- }
22434
- },
22435
- data: publishData,
22436
- defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
22437
- }, {
22438
- retries: 3,
22439
- retryDelay: 500,
22440
- timeout: 12000
22441
- });
22468
+ try {
22469
+ await proxyHttp.api({
22470
+ method: "post",
22471
+ url: "https://mp.weixin.qq.com/cgi-bin/masssend",
22472
+ params: {
22473
+ t: "ajax-response",
22474
+ token: params.token,
22475
+ lang: "zh_CN",
22476
+ ...params.masssend ? {
22477
+ ...params.settingInfo.timer ? {
22478
+ action: "time_send"
22479
+ } : {}
22480
+ } : {
22481
+ is_release_publish_page: 1
22482
+ }
22483
+ },
22484
+ data: publishData,
22485
+ defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
22486
+ }, {
22487
+ retries: 3,
22488
+ retryDelay: 500,
22489
+ timeout: 12000
22490
+ });
22491
+ } catch (error) {
22492
+ const handledError = Http.handleApiError(error);
22493
+ const isProxyOrNetworkError = [
22494
+ 599,
22495
+ 500,
22496
+ 502,
22497
+ 503,
22498
+ 504
22499
+ ].includes(handledError.code);
22500
+ if (isProxyOrNetworkError) {
22501
+ const message = `文章发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
22502
+ task.logger.error(`[weixinPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
22503
+ await updateTaskState?.({
22504
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
22505
+ error: message
22506
+ });
22507
+ return {
22508
+ code: 414,
22509
+ data: "",
22510
+ message
22511
+ };
22512
+ }
22513
+ throw error;
22514
+ }
22442
22515
  if ("publish" === params.saveType) reportLogger({
22443
22516
  token: params.huiwenToken || "",
22444
22517
  enverionment: task.enverionment || "development",
@@ -23583,7 +23656,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23583
23656
  });
23584
23657
  const proxyHttp = new Http(...args);
23585
23658
  proxyHttp.addResponseInterceptor((response)=>{
23586
- const responseData = response.data;
23659
+ const responseData = response?.data;
23587
23660
  if (response && responseData?.code && 0 !== responseData.code || responseData?.code && !responseData.success) {
23588
23661
  const errmsg = xiaohongshuPublish_mock_errnoMap[responseData.code] || response.config.defaultErrorMsg || "文章发布异常,请稍后重试。";
23589
23662
  return {
@@ -23606,11 +23679,6 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23606
23679
  if (params.banners.length > 18) {
23607
23680
  const num = Math.ceil(params.banners.length / 14);
23608
23681
  for(let i = 0; i < num; i++){
23609
- const start = 14 * i;
23610
- params.banners.length;
23611
- ({
23612
- ...fetchCoverParams
23613
- });
23614
23682
  const batchCoverIdInfo = await proxyHttp.api({
23615
23683
  method: "get",
23616
23684
  baseURL: "https://creator.xiaohongshu.com",
@@ -23623,7 +23691,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23623
23691
  retryDelay: 20,
23624
23692
  timeout: 3000
23625
23693
  });
23626
- for (const item of batchCoverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
23694
+ for (const item of batchCoverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item.fileIds)uploadInfos.push({
23627
23695
  bucket: item.bucket || "",
23628
23696
  uploadAddr: item.uploadAddr || "",
23629
23697
  fileIds: fileId,
@@ -23643,7 +23711,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23643
23711
  retryDelay: 20,
23644
23712
  timeout: 3000
23645
23713
  });
23646
- for (const item of coverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
23714
+ for (const item of coverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item.fileIds)uploadInfos.push({
23647
23715
  bucket: item.bucket || "",
23648
23716
  uploadAddr: item.uploadAddr || "",
23649
23717
  fileIds: fileId,
@@ -23840,7 +23908,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23840
23908
  retries: 3,
23841
23909
  retryDelay: 20,
23842
23910
  timeout: 3000
23843
- }).then((userData)=>userData.data?.userDetail?.id));
23911
+ }).then((userData)=>userData?.data?.userDetail?.id));
23844
23912
  const business_binds = {
23845
23913
  version: 1,
23846
23914
  bizType: "",
@@ -23901,18 +23969,43 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23901
23969
  });
23902
23970
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(data, message);
23903
23971
  }
23904
- task.logger.info(`[xiaohongshuPublish] publishData: ${JSON.stringify(publishData)} `);
23905
- const publishResult = await proxyHttp.api({
23906
- method: "post",
23907
- url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
23908
- data: publishData,
23909
- headers: publishXsHeader,
23910
- defaultErrorMsg: "文章发布异常,请稍后重试。"
23911
- }, {
23912
- retries: 2,
23913
- retryDelay: 500,
23914
- timeout: 12000
23915
- });
23972
+ let publishResult;
23973
+ try {
23974
+ publishResult = await proxyHttp.api({
23975
+ method: "post",
23976
+ url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
23977
+ data: publishData,
23978
+ headers: publishXsHeader,
23979
+ defaultErrorMsg: "文章发布异常,请稍后重试。"
23980
+ }, {
23981
+ retries: 2,
23982
+ retryDelay: 500,
23983
+ timeout: 12000
23984
+ });
23985
+ } catch (error) {
23986
+ const handledError = Http.handleApiError(error);
23987
+ const isProxyOrNetworkError = [
23988
+ 599,
23989
+ 500,
23990
+ 502,
23991
+ 503,
23992
+ 504
23993
+ ].includes(handledError.code);
23994
+ if (isProxyOrNetworkError) {
23995
+ const message = `文章发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23996
+ task.logger.error(`[xiaohongshuPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
23997
+ await updateTaskState?.({
23998
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
23999
+ error: message
24000
+ });
24001
+ return {
24002
+ code: 414,
24003
+ data: "",
24004
+ message
24005
+ };
24006
+ }
24007
+ throw error;
24008
+ }
23916
24009
  reportLogger({
23917
24010
  token: params.huiwenToken || "",
23918
24011
  enverionment: task.enverionment || "development",
@@ -23924,9 +24017,10 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23924
24017
  platform: "xiaohongshu",
23925
24018
  publishParams: publishData
23926
24019
  });
24020
+ task.logger.info(`[xiaohongshuPublish] publishResult: ${JSON.stringify(publishResult)} `);
23927
24021
  const isSuccess = publishResult.success;
23928
24022
  const message = `文章发布${isSuccess ? "成功" : `失败,原因:${publishResult.msg}`}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23929
- const data = isSuccess ? publishResult.data?.id || "" : "";
24023
+ const data = isSuccess ? publishResult?.data?.id || "" : "";
23930
24024
  if (!isSuccess) {
23931
24025
  await updateTaskState?.({
23932
24026
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
@@ -24625,7 +24719,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24625
24719
  });
24626
24720
  const proxyHttp = new Http(...args);
24627
24721
  proxyHttp.addResponseInterceptor((response)=>{
24628
- const responseData = response.data;
24722
+ const responseData = response?.data;
24629
24723
  if (response && responseData?.code && 0 !== responseData.code || responseData?.code && !responseData.success) {
24630
24724
  const errmsg = rpa_server_mock_errnoMap[responseData.code] || response.config.defaultErrorMsg || "文章发布异常,请稍后重试。";
24631
24725
  return {
@@ -24646,7 +24740,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24646
24740
  const fetchCoverXsHeader = rpa_server_mock_xsEncrypt.signHeadersGet(fetchCoverUrl, recordCookie, "ugc", fetchCoverParams);
24647
24741
  const uploadInfos = [];
24648
24742
  if (params.banners.length > 18) {
24649
- let num = Math.ceil(params.banners.length / 14);
24743
+ const num = Math.ceil(params.banners.length / 14);
24650
24744
  for(let i = 0; i < num; i++){
24651
24745
  const start = 14 * i;
24652
24746
  params.banners.length;
@@ -24665,7 +24759,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24665
24759
  retryDelay: 20,
24666
24760
  timeout: 3000
24667
24761
  });
24668
- for (const item of batchCoverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
24762
+ for (const item of batchCoverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item?.fileIds ?? [])uploadInfos.push({
24669
24763
  bucket: item.bucket || "",
24670
24764
  uploadAddr: item.uploadAddr || "",
24671
24765
  fileIds: fileId,
@@ -24685,7 +24779,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24685
24779
  retryDelay: 20,
24686
24780
  timeout: 3000
24687
24781
  });
24688
- for (const item of coverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
24782
+ for (const item of coverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item?.fileIds ?? [])uploadInfos.push({
24689
24783
  bucket: item.bucket || "",
24690
24784
  uploadAddr: item.uploadAddr || "",
24691
24785
  fileIds: fileId,
@@ -24767,7 +24861,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24767
24861
  retryDelay: 20,
24768
24862
  timeout: 3000
24769
24863
  });
24770
- Object.assign(topic, createTopic.data.topic_infos[0]);
24864
+ Object.assign(topic, createTopic?.data?.topic_infos[0]);
24771
24865
  }
24772
24866
  }));
24773
24867
  const visibleRangeMap = {
@@ -24851,7 +24945,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24851
24945
  retries: 3,
24852
24946
  retryDelay: 20,
24853
24947
  timeout: 3000
24854
- }).then((userData)=>userData.data?.userDetail?.id));
24948
+ }).then((userData)=>userData?.data?.userDetail?.id));
24855
24949
  const business_binds = {
24856
24950
  version: 1,
24857
24951
  bizType: "",
@@ -24942,9 +25036,10 @@ const rpaAction_Server_Mock = async (task, params)=>{
24942
25036
  retryDelay: 500,
24943
25037
  timeout: 12000
24944
25038
  });
25039
+ task.logger.info(`[xiaohongshuPublish server mock] publishResult: ${JSON.stringify(publishResult)} `);
24945
25040
  const isSuccess = publishResult.success;
24946
25041
  const message = `文章发布${isSuccess ? "成功" : `失败,原因:${publishResult.msg}`}${task.debug ? ` ${http.proxyInfo}` : ""}`;
24947
- const data = isSuccess ? publishResult.data?.id || "" : "";
25042
+ const data = isSuccess ? publishResult?.data?.id || "" : "";
24948
25043
  if (!isSuccess) {
24949
25044
  await updateTaskState?.({
24950
25045
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
@@ -25143,7 +25238,7 @@ const xiaohongshuWebIntimacySearch = async (_task, params)=>{
25143
25238
  timeout: 3000
25144
25239
  });
25145
25240
  const isSuccess = 0 === res.code;
25146
- if (isSuccess) intimacyDetail = res.data.items;
25241
+ if (isSuccess) intimacyDetail = res.data?.items;
25147
25242
  const message = `搜索@列表数据${isSuccess ? "成功" : `失败,原因:${res.msg}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
25148
25243
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(isSuccess ? 0 : 414, message, intimacyDetail);
25149
25244
  };
@@ -25325,7 +25420,7 @@ const xiaohongshuWebNoteFeed = async (_task, params)=>{
25325
25420
  timeout: 3000
25326
25421
  });
25327
25422
  _task.logger.info(`API 响应: ${JSON.stringify(res)}`);
25328
- const isSuccess = 0 === res.code && res.data && res.data.items && res.data.items.length > 0;
25423
+ const isSuccess = 0 === res.code && res.data && res.data?.items && res.data?.items.length > 0;
25329
25424
  const message = `获取指定文章详情${isSuccess ? "成功" : `失败,原因:${res.msg || "返回数据为空,可能笔记不存在或参数错误"}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
25330
25425
  const data = isSuccess ? res.data?.items[0].note_card || {} : {};
25331
25426
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(isSuccess ? 0 : 414, message, data);