@iflyrpa/actions 1.2.24-beta.9 → 1.2.25-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.d.ts CHANGED
@@ -12,8 +12,10 @@ import { type ToutiaoPublishParams } from "./actions/toutiaoPublish";
12
12
  import { type GetWxFansSearchParams } from "./actions/common/FansTool";
13
13
  import { type wxSessionParams } from "./actions/common/sessionCheck";
14
14
  import { type SearchAccountInfoParams } from "./actions/searchAccountInfo";
15
+ import { type SearchBjhTopicListParams } from "./actions/searchBjhTopicList";
15
16
  import { type FetchArticlesParams } from "./actions/searchPublishInfo";
16
17
  import { type GetWeixinConfigParams } from "./actions/getWeixinConfig";
18
+ import { type GetWeixinCollectionParams } from "./actions/getWeixinCollection";
17
19
  import { type WeitoutiaoPublishParams } from "./actions/weitoutiaoPublish";
18
20
  import { type WeixinPublishParams } from "./actions/weixinPublish";
19
21
  import { type WeixinmpPublishParams } from "./actions/weixinmpPublish";
@@ -35,10 +37,15 @@ export declare class Action {
35
37
  XhsFansExport(params: ActiomCommonParams): Promise<ResponseData<import("./types").Xiaohongshu.FansCount>>;
36
38
  WxFansExport(params: GetWxFansSearchParams): Promise<ResponseData<import("./types").Weixin.FansCount>>;
37
39
  BjhFansExport(params: ActiomCommonParams): Promise<ResponseData<import("./types").BaiJiaHao.FansCount>>;
40
+ SearchBjhTopicList(params: SearchBjhTopicListParams): Promise<ResponseData<import("./actions/searchBjhTopicList").TopicData[]>>;
38
41
  searchToutiaoUserID(params: SearchToutiaoUserIDParams): Promise<ResponseData<import("./types").Toutiao.SuggestWords[]>>;
39
42
  searchToutiaoLocation(params: SearchToutiaoLocationParams): Promise<ResponseData<import("./types").Toutiao.CityPoi[]>>;
40
43
  getToutiaoConfig(params: GetToutiaoConfigParams): Promise<ResponseData<import("./actions/getToutiaoConfig").GetToutiaoConfigResult>>;
41
44
  getWeixinConfig(params: GetWeixinConfigParams): Promise<ResponseData<import("./actions/getWeixinConfig").ConfigData>>;
45
+ getWeixinCollection(params: GetWeixinCollectionParams): Promise<ResponseData<import("./actions/getWeixinCollection").CollectDetail[]>>;
46
+ getXhsCollection(params: ActiomCommonParams): Promise<ResponseData<import("./actions/getXhsCollection").CollectionDetail[]>>;
47
+ getXhsGroup(params: ActiomCommonParams): Promise<ResponseData<import("./actions/getXhsGroup").GroupDetail[]>>;
48
+ getXhsHotTopic(params: ActiomCommonParams): Promise<ResponseData<import("./actions/getXhsHotTopic").HotTopicDetail[]>>;
42
49
  getBaijiahaoConfig(params: GetBaijiahaoConfigParams): Promise<ResponseData<import("./actions/getBaijiaohaoConfig").ConfigData[]>>;
43
50
  baijiahaoPublish(params: BaijiahaoPublishParams): Promise<ResponseData<string>>;
44
51
  getBaijiahaoActivity(params: GetBaijiahaoActivityParams): Promise<ResponseData<import("./actions/getBaijiahaoActivity").ActivityData[]>>;
package/dist/index.js CHANGED
@@ -2981,27 +2981,60 @@ var __webpack_exports__ = {};
2981
2981
  errorResponse.data = serverError;
2982
2982
  }
2983
2983
  }
2984
+ if (error.code) switch(error.code){
2985
+ case "ECONNRESET":
2986
+ errorResponse.message = "连接被重置,请检查网络或稍后重试!";
2987
+ break;
2988
+ case "ENOTFOUND":
2989
+ errorResponse.message = "域名解析失败,请检查 URL 是否正确!";
2990
+ break;
2991
+ case "ETIMEDOUT":
2992
+ errorResponse.message = "网络请求超时,请检查网络连接!";
2993
+ break;
2994
+ case "ECONNREFUSED":
2995
+ errorResponse.message = "服务器拒绝连接,请稍后重试!";
2996
+ break;
2997
+ case "EAI_AGAIN":
2998
+ errorResponse.message = "DNS 查询超时,请稍后重试!";
2999
+ break;
3000
+ default:
3001
+ errorResponse.message = `网络错误: ${error.message}`;
3002
+ break;
3003
+ }
2984
3004
  return Promise.reject(errorResponse);
2985
3005
  });
2986
3006
  }
2987
- async api(config) {
2988
- try {
2989
- const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
2990
- if (this.adr && null == agent) return Promise.reject({
2991
- code: 200,
2992
- message: "当前发文IP地址暂不支持!"
2993
- });
2994
- const response = await this.apiClient({
2995
- ...config,
2996
- ...agent ? {
2997
- httpAgent: agent,
2998
- httpsAgent: agent
2999
- } : {}
3000
- });
3001
- return response.data;
3002
- } catch (error) {
3003
- return Promise.reject(Http.handleApiError(error));
3004
- }
3007
+ async api(config, options) {
3008
+ const retries = options?.retries ?? 0;
3009
+ const retryDelay = options?.retryDelay ?? 500;
3010
+ const sessionRt = async (Rtimes)=>{
3011
+ try {
3012
+ const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
3013
+ if (this.adr && null == agent) return Promise.reject({
3014
+ code: 200,
3015
+ message: "当前发文IP地址暂不支持!"
3016
+ });
3017
+ this.proxyInfo = agent?.proxy.host;
3018
+ const response = await this.apiClient({
3019
+ ...config,
3020
+ ...agent ? {
3021
+ httpAgent: agent,
3022
+ httpsAgent: agent
3023
+ } : {}
3024
+ });
3025
+ return response.data;
3026
+ } catch (error) {
3027
+ const handledError = Http.handleApiError(error);
3028
+ const isRetry = handledError.code >= 500 || 0 === handledError.code;
3029
+ if (Rtimes < retries && isRetry) {
3030
+ console.log("Loger: 进入重试!");
3031
+ await new Promise((resolve)=>setTimeout(resolve, retryDelay));
3032
+ return sessionRt(Rtimes + 1);
3033
+ }
3034
+ return Promise.reject(handledError);
3035
+ }
3036
+ };
3037
+ return sessionRt(0);
3005
3038
  }
3006
3039
  }
3007
3040
  function getRandomInRange(min, max) {
@@ -3208,6 +3241,71 @@ var __webpack_exports__ = {};
3208
3241
  const share_namespaceObject = require("@iflyrpa/share");
3209
3242
  const external_form_data_namespaceObject = require("form-data");
3210
3243
  var external_form_data_default = /*#__PURE__*/ __webpack_require__.n(external_form_data_namespaceObject);
3244
+ const external_node_crypto_namespaceObject = require("node:crypto");
3245
+ var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
3246
+ const generateTopicHtml = function(topic, id, sv_small_images) {
3247
+ const generateUid = function() {
3248
+ const e = ()=>Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
3249
+ return e() + e() + e() + e() + e() + e() + e() + e();
3250
+ };
3251
+ const topicBase = function(topic, id, sv_small_images) {
3252
+ const t = function(r) {
3253
+ let n = [];
3254
+ let e = 0;
3255
+ for(; e < 256; ++e)n[e] = (e + 256).toString(16).substr(1);
3256
+ let o = 0;
3257
+ return [
3258
+ n[r[o++]],
3259
+ n[r[o++]],
3260
+ n[r[o++]],
3261
+ n[r[o++]],
3262
+ "-",
3263
+ n[r[o++]],
3264
+ n[r[o++]],
3265
+ "-",
3266
+ n[r[o++]],
3267
+ n[r[o++]],
3268
+ "-",
3269
+ n[r[o++]],
3270
+ n[r[o++]],
3271
+ "-",
3272
+ n[r[o++]],
3273
+ n[r[o++]],
3274
+ n[r[o++]],
3275
+ n[r[o++]],
3276
+ n[r[o++]],
3277
+ n[r[o++]]
3278
+ ].join("");
3279
+ };
3280
+ const s = external_node_crypto_default().randomBytes(16);
3281
+ s[6] = 15 & s[6] | 64, s[8] = 63 & s[8] | 128;
3282
+ return {
3283
+ id: id || t(s),
3284
+ sv_small_images: sv_small_images || "",
3285
+ title: topic.replace(/[^\u4E00-\u9FA5a-zA-Z0-9]/g, ""),
3286
+ isCreate: 1
3287
+ };
3288
+ };
3289
+ const n = id ? topicBase(topic, id, sv_small_images) : topicBase(topic);
3290
+ const topicAttr = {
3291
+ style: "border:none;display:inline-block;color:#3E5599;text-decoration:none;font-style:normal;",
3292
+ href: `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&amp;"),
3293
+ target: "_blank",
3294
+ "data-bjh-cover": "".concat(n.sv_small_images && (n.sv_small_images.https || n.sv_small_images.http)),
3295
+ "data-bjh-src": `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&amp;"),
3296
+ "data-bjh-box": "topic",
3297
+ "data-bjh-title": n.title,
3298
+ "data-bjh-id": id || n.id,
3299
+ "data-bjh-type": "topic",
3300
+ contenteditable: "false",
3301
+ "data-ignore-remove-style": "1",
3302
+ "data-bjh-create": id ? "0" : "1",
3303
+ "data-bjh-adinspiration": "0",
3304
+ "data-diagnose-id": generateUid()
3305
+ };
3306
+ const attrStr = Object.entries(topicAttr).map(([key, val])=>`${key}="${val}"`).join(" ");
3307
+ return `<p><span data-diagnose-id=${generateUid()}></span><a ${attrStr}>#${n.title}#</a></p>`;
3308
+ };
3211
3309
  const errnoMap = {
3212
3310
  20040706: "正文图片和封面图片推荐jpg、png格式。",
3213
3311
  20040084: "正文图片和封面图片推荐jpg、png格式。",
@@ -3223,7 +3321,8 @@ var __webpack_exports__ = {};
3223
3321
  20040124: "服务器异常,请稍后重试!",
3224
3322
  20040001: "当前用户未登录,请登陆后重试!",
3225
3323
  401100025: "该应用不支持此媒资类型",
3226
- 401100033: "图片宽高不满足要求"
3324
+ 401100033: "图片宽高不满足要求",
3325
+ '-6': "文章分类信息错误"
3227
3326
  };
3228
3327
  const mockAction = async (task, params)=>{
3229
3328
  const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
@@ -3285,7 +3384,21 @@ var __webpack_exports__ = {};
3285
3384
  };
3286
3385
  const originContentImages = extractImgTag(params.content);
3287
3386
  const targetContentImages = await uploadImages(originContentImages);
3288
- const content = replaceImgSrc(params.content, (dom)=>{
3387
+ if (params.settingInfo.baijiahaoTopic && !params.settingInfo.baijiahaoTopic?.id) {
3388
+ let topicCheck = await http.api({
3389
+ method: "get",
3390
+ url: "https://baijiahao.baidu.com/pcui/topic/topiccheck",
3391
+ params: {
3392
+ topicName: params.settingInfo.baijiahaoTopic?.title
3393
+ }
3394
+ });
3395
+ if (0 != topicCheck.errno) return {
3396
+ code: 200,
3397
+ message: topicCheck.errmsg,
3398
+ data: ''
3399
+ };
3400
+ }
3401
+ const content = replaceImgSrc(params.settingInfo?.baijiahaoTopic && params.settingInfo.baijiahaoTopic?.title ? params.content + generateTopicHtml(params.settingInfo?.baijiahaoTopic?.title, params.settingInfo?.baijiahaoTopic?.id || "", params.settingInfo.baijiahaoTopic?.sv_small_images || "") : params.content, (dom)=>{
3289
3402
  if (dom.attribs.src) {
3290
3403
  const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
3291
3404
  dom.attribs.src = targetContentImages[idx].bos_url;
@@ -3345,6 +3458,14 @@ var __webpack_exports__ = {};
3345
3458
  activity_list,
3346
3459
  ...params.settingInfo.timer ? {
3347
3460
  timer_time: params.settingInfo.timer
3461
+ } : {},
3462
+ ...params.settingInfo.baijiahaoCms ? {
3463
+ 'cate_user_cms[0]': params.settingInfo.baijiahaoCms[0],
3464
+ 'cate_user_cms[1]': params.settingInfo.baijiahaoCms[1]
3465
+ } : {},
3466
+ ...params.settingInfo.baijiahaoEventSpec ? {
3467
+ 'event_spec[time]': params.settingInfo.baijiahaoEventSpec.time,
3468
+ 'event_spec[pos]': params.settingInfo.baijiahaoEventSpec.pos
3348
3469
  } : {}
3349
3470
  };
3350
3471
  const isDraft = "draft" === params.saveType;
@@ -3363,8 +3484,11 @@ var __webpack_exports__ = {};
3363
3484
  referer: "https://baijiahao.baidu.com/builder/rc/edit?type=news"
3364
3485
  },
3365
3486
  defaultErrorMsg: isDraft ? "文章同步出现异常,请稍后重试。" : "文章发布出现异常,请稍后重试。"
3487
+ }, {
3488
+ retries: 2,
3489
+ retryDelay: 500
3366
3490
  });
3367
- return (0, share_namespaceObject.success)(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` : res.errmsg ?? '文章发布失败,请稍后重试。');
3491
+ return (0, share_namespaceObject.success)(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` + (proxyHttp.proxyInfo || "") : res.errmsg ?? '文章发布失败,请稍后重试。');
3368
3492
  };
3369
3493
  const rpaAction = async (task, params)=>{
3370
3494
  const tmpCachePath = task.getTmpPath();
@@ -3793,8 +3917,6 @@ var __webpack_exports__ = {};
3793
3917
  }
3794
3918
  };
3795
3919
  const external_node_buffer_namespaceObject = require("node:buffer");
3796
- const external_node_crypto_namespaceObject = require("node:crypto");
3797
- var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
3798
3920
  class CryptoConfig {
3799
3921
  static{
3800
3922
  this.MAX_32BIT = 0xFFFFFFFF;
@@ -4403,8 +4525,11 @@ var __webpack_exports__ = {};
4403
4525
  const proxyHttp = task?.isBeta ?? false ? new Http({
4404
4526
  headers
4405
4527
  }, params.proxyLoc, params.huiwenToken) : http;
4406
- const publishResult = await proxyHttp.api(publishOption);
4407
- return (0, share_namespaceObject.success)(publishResult.data.pgc_id, `文章发布成功!`);
4528
+ const publishResult = await proxyHttp.api(publishOption, {
4529
+ retries: 2,
4530
+ retryDelay: 500
4531
+ });
4532
+ return (0, share_namespaceObject.success)(publishResult.data.pgc_id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
4408
4533
  };
4409
4534
  const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
4410
4535
  const rpa_rpaAction = async (task, params)=>{
@@ -5073,6 +5198,24 @@ var __webpack_exports__ = {};
5073
5198
  return (0, share_namespaceObject.success)(null, "暂不支持该平台");
5074
5199
  }
5075
5200
  };
5201
+ const searchBjhTopicList = async (_task, params)=>{
5202
+ const cookies = params.cookies ?? [];
5203
+ const http = new Http({
5204
+ headers: {
5205
+ cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
5206
+ token: params.token
5207
+ }
5208
+ });
5209
+ const res = await http.api({
5210
+ method: "get",
5211
+ url: "https://baijiahao.baidu.com/pcui/pcpublisher/searchtopic",
5212
+ params: {
5213
+ content: params.topicContent,
5214
+ resource_type: 1
5215
+ }
5216
+ });
5217
+ return (0, share_namespaceObject.success)(res?.data?.hot ?? [], "百家号" + (0 == res.errno ? "话题获取成功!" : "话题获取失败"));
5218
+ };
5076
5219
  const searchPublishInfo_types_errorResponse = (message, code = 500)=>({
5077
5220
  code,
5078
5221
  message,
@@ -5511,6 +5654,51 @@ var __webpack_exports__ = {};
5511
5654
  };
5512
5655
  return (0, share_namespaceObject.success)(filtered, 0 === res.base_resp.ret ? "微信配置信息获取成功!" : "微信配置信息获取失败!");
5513
5656
  };
5657
+ const getWeixinCollection = async (_task, params)=>{
5658
+ const http = new Http({
5659
+ headers: {
5660
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
5661
+ }
5662
+ });
5663
+ const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
5664
+ const res = await http.api({
5665
+ method: "get",
5666
+ url: "https://mp.weixin.qq.com/cgi-bin/appmsgalbummgr",
5667
+ params: {
5668
+ action: 'list',
5669
+ begin: 0,
5670
+ count: 100,
5671
+ sub_title: '',
5672
+ type: 0,
5673
+ latest: 1,
5674
+ need_pay: 0,
5675
+ fingerprint,
5676
+ token: params.token,
5677
+ lang: 'zh_CN',
5678
+ f: 'json',
5679
+ ajax: 1
5680
+ }
5681
+ });
5682
+ return (0, share_namespaceObject.success)(res.list_resp.items, 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
5683
+ };
5684
+ const getXhsCollection = async (_task, params)=>{
5685
+ const http = new Http({
5686
+ headers: {
5687
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
5688
+ referer: "https://creator.xiaohongshu.com",
5689
+ origin: "https://creator.xiaohongshu.com"
5690
+ }
5691
+ });
5692
+ try {
5693
+ const res = await http.api({
5694
+ method: "get",
5695
+ url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
5696
+ });
5697
+ return (0, share_namespaceObject.success)(0 === res.result ? res.data.collections : [], "合集信息获取" + (0 === res.result ? "成功!" : `失败!`));
5698
+ } catch (error) {
5699
+ return (0, share_namespaceObject.success)([]);
5700
+ }
5701
+ };
5514
5702
  const weitoutiaoPublish_mock_mockAction = async (task, params)=>{
5515
5703
  const tmpCachePath = task.getTmpPath();
5516
5704
  const http = new Http({
@@ -5657,6 +5845,16 @@ var __webpack_exports__ = {};
5657
5845
  Normal: "kQuotaTypeMassSendNormal",
5658
5846
  ProductActivity: "kQuotaTypeMassSendProductActivity"
5659
5847
  };
5848
+ function genTopicHTML(topics) {
5849
+ if (!topics || 0 === topics.length) return "";
5850
+ const rn = ()=>{
5851
+ const O = Date.now().toString(36);
5852
+ const B = Math.random().toString(36).substring(2, 8);
5853
+ return `${O}-${B}`;
5854
+ };
5855
+ const aTags = topics.map((topic)=>`<a class="wx_topic_link" topic-id="${rn()}" style="color: #576B95 !important;" data-topic="1">#${topic}</a>`).join("&nbsp;");
5856
+ return `<p style="line-height: 1.75;margin: 0px 0px 24px;padding: 0px;" data-bothblock="0px"><span leaf="">${aTags}</span></p>`;
5857
+ }
5660
5858
  const GET_QRCODE_DEFAULT_ERROR = "二维码获取异常,请稍后重试。";
5661
5859
  const weixinPublish_mock_errnoMap = {
5662
5860
  200003: "微信公众号号登录状态失效,请重新绑定账号后重试。",
@@ -5671,10 +5869,14 @@ var __webpack_exports__ = {};
5671
5869
  "-1": "系统错误,请注意备份内容后重试",
5672
5870
  770001: "不支持发布审核中或转码中的视频",
5673
5871
  200074: "系统繁忙,请稍后重试!",
5674
- 64702: "标题超出64字长度限制,请修改标题后重试。"
5872
+ 64702: "标题超出64字长度限制,请修改标题后重试。",
5873
+ 64552: "请检查阅读原文中的链接后重试。"
5675
5874
  };
5676
5875
  const ignoreErrno = [
5677
- 154019
5876
+ 154019,
5877
+ 154011,
5878
+ 154008,
5879
+ 154009
5678
5880
  ];
5679
5881
  const userTypeMap = {
5680
5882
  所有用户: 1,
@@ -5779,7 +5981,7 @@ var __webpack_exports__ = {};
5779
5981
  };
5780
5982
  const originContentImages = extractImgTag(params.content);
5781
5983
  const targetContentImages = await uploadImages(originContentImages);
5782
- const content = replaceImgSrc(params.content, (dom)=>{
5984
+ const content = replaceImgSrc(params.settingInfo.wxTopic && params.settingInfo.wxTopic.length > 0 ? params.content + genTopicHTML(params.settingInfo.wxTopic) : params.content, (dom)=>{
5783
5985
  if (dom.attribs.src) {
5784
5986
  const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
5785
5987
  dom.attribs.src = targetContentImages[idx].cdn_url;
@@ -6052,6 +6254,11 @@ var __webpack_exports__ = {};
6052
6254
  allow_fast_reprint0: params?.settingInfo?.wxQuickReprint ? 1 : 0,
6053
6255
  disable_recommend0: params?.settingInfo?.wxNotAllowRecommend ? 1 : 0,
6054
6256
  claim_source_type0: params?.settingInfo?.wxCreationSource?.[0] || "",
6257
+ appmsg_album_info0: JSON.stringify({
6258
+ appmsg_album_infos: params.settingInfo?.wxCollectionInfo ? [
6259
+ params.settingInfo.wxCollectionInfo
6260
+ ] : []
6261
+ }),
6055
6262
  masssend_check: 1,
6056
6263
  is_masssend: 1
6057
6264
  };
@@ -6074,6 +6281,42 @@ var __webpack_exports__ = {};
6074
6281
  data: appMsgId,
6075
6282
  message: "微信公众号保存草稿成功。"
6076
6283
  };
6284
+ let checkTimes = 0;
6285
+ let copyrightStatRes = {
6286
+ base_resp: {
6287
+ ret: -1
6288
+ },
6289
+ list: ''
6290
+ };
6291
+ do {
6292
+ checkTimes++;
6293
+ const copyrightStat = http.api({
6294
+ method: 'post',
6295
+ url: 'https://mp.weixin.qq.com/cgi-bin/masssend',
6296
+ params: {
6297
+ action: 'get_appmsg_copyright_stat',
6298
+ token: params.token,
6299
+ lang: 'zh_CN'
6300
+ },
6301
+ data: weixinPublish_mock_generatorFormData({
6302
+ token: params.token,
6303
+ lang: 'zh_CN',
6304
+ f: 'json',
6305
+ ajax: 1,
6306
+ fingerprint,
6307
+ random: Math.random().toString(),
6308
+ first_check: 1 === checkTimes ? 1 : 0,
6309
+ type: 10,
6310
+ appMsgId
6311
+ })
6312
+ });
6313
+ copyrightStatRes = await copyrightStat;
6314
+ if (154008 === copyrightStatRes.base_resp.ret && copyrightStatRes?.list) return {
6315
+ code: 200,
6316
+ message: `文章内容未通过原创校验,请修改后重试!`,
6317
+ data: JSON.parse(copyrightStatRes.list).list
6318
+ };
6319
+ }while (154011 === copyrightStatRes.base_resp.ret && checkTimes < 10);
6077
6320
  const masssendpage = ()=>http.api({
6078
6321
  method: "get",
6079
6322
  url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
@@ -6387,8 +6630,11 @@ var __webpack_exports__ = {};
6387
6630
  userType: "1"
6388
6631
  }),
6389
6632
  defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
6633
+ }, {
6634
+ retries: 2,
6635
+ retryDelay: 500
6390
6636
  });
6391
- return (0, share_namespaceObject.success)(appMsgId, `微信公众号发布完成!`);
6637
+ return (0, share_namespaceObject.success)(appMsgId, `微信公众号发布完成!` + (proxyHttp.proxyInfo || ""));
6392
6638
  };
6393
6639
  const waitQrcodeResultMaxTime = 2000 * scanRetryMaxCount;
6394
6640
  const weixinPublish_rpa_rpaAction = async (task, params)=>{
@@ -7054,6 +7300,11 @@ var __webpack_exports__ = {};
7054
7300
  const mock_xsEncrypt = new Xhshow();
7055
7301
  const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
7056
7302
  const tmpCachePath = task.getTmpPath();
7303
+ if (params?.selfDeclaration?.type == "source-statement" && "transshipment" == params.selfDeclaration.childType && params.originalBind) return {
7304
+ code: 200,
7305
+ message: "原创声明与转载声明互斥,请重新选择后发布!",
7306
+ data: ""
7307
+ };
7057
7308
  const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
7058
7309
  if (!a1Cookie) return {
7059
7310
  code: 200,
@@ -7188,6 +7439,11 @@ var __webpack_exports__ = {};
7188
7439
  Object.assign(topic, createTopic.data.topic_infos[0]);
7189
7440
  }
7190
7441
  }));
7442
+ const visibleRangeMap = {
7443
+ public: 0,
7444
+ private: 1,
7445
+ friends: 4
7446
+ };
7191
7447
  const publishData = {
7192
7448
  common: {
7193
7449
  ats: [],
@@ -7205,7 +7461,7 @@ var __webpack_exports__ = {};
7205
7461
  type: "normal",
7206
7462
  privacy_info: {
7207
7463
  op_type: 1,
7208
- type: "public" === params.visibleRange ? 0 : 1
7464
+ type: visibleRangeMap[params.visibleRange] || 1
7209
7465
  },
7210
7466
  post_loc: params.address ? {
7211
7467
  name: params.address?.name,
@@ -7257,6 +7513,10 @@ var __webpack_exports__ = {};
7257
7513
  };
7258
7514
  }
7259
7515
  }
7516
+ const bizId = params?.originalBind && (params.cookies.find((it)=>"x-user-id-creator.xiaohongshu.com" === it.name)?.value || await http.api({
7517
+ method: "get",
7518
+ url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
7519
+ }).then((userData)=>userData.data?.userDetail?.id));
7260
7520
  const business_binds = {
7261
7521
  version: 1,
7262
7522
  bizType: "",
@@ -7265,11 +7525,41 @@ var __webpack_exports__ = {};
7265
7525
  notePostTiming: params.isImmediatelyPublish ? {} : {
7266
7526
  postTime: params.scheduledPublish
7267
7527
  },
7268
- noteCollectionBind: {
7269
- id: ""
7528
+ coProduceBind: {
7529
+ enable: !!params?.coProduceBind
7530
+ },
7531
+ noteCopyBind: {
7532
+ copyable: !!params?.noteCopyBind
7533
+ },
7534
+ optionRelationList: params.originalBind ? [
7535
+ {
7536
+ type: "ORIGINAL_STATEMENT",
7537
+ relationList: [
7538
+ {
7539
+ bizId,
7540
+ bizType: "ORIGINAL_STATEMENT",
7541
+ extraInfo: "{}"
7542
+ }
7543
+ ]
7544
+ }
7545
+ ] : [],
7546
+ ...params?.groupBind ? {
7547
+ groupBind: {
7548
+ groupId: params?.groupBind?.group_id,
7549
+ groupName: params.groupBind?.group_name,
7550
+ desc: params.groupBind?.desc,
7551
+ avatar: params.groupBind?.avatar
7552
+ }
7553
+ } : {
7554
+ groupBind: {}
7270
7555
  },
7271
7556
  ...params.selfDeclaration ? {
7272
7557
  userDeclarationBind
7558
+ } : {},
7559
+ ...params?.collectionId ? {
7560
+ noteCollectionBind: {
7561
+ id: params.collectionId
7562
+ }
7273
7563
  } : {}
7274
7564
  };
7275
7565
  publishData.common.business_binds = JSON.stringify(business_binds);
@@ -7290,8 +7580,11 @@ var __webpack_exports__ = {};
7290
7580
  "x-s-common": xscommon
7291
7581
  },
7292
7582
  defaultErrorMsg: "文章发布异常,请稍后重试。"
7583
+ }, {
7584
+ retries: 2,
7585
+ retryDelay: 500
7293
7586
  });
7294
- return (0, share_namespaceObject.success)(publishResult.data?.id, `文章发布成功!`);
7587
+ return (0, share_namespaceObject.success)(publishResult.data?.id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
7295
7588
  };
7296
7589
  const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
7297
7590
  const rpa_xsEncrypt = new Xhshow();
@@ -7512,7 +7805,84 @@ var __webpack_exports__ = {};
7512
7805
  if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
7513
7806
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
7514
7807
  };
7515
- var package_namespaceObject = JSON.parse('{"i8":"1.2.24-beta.8"}');
7808
+ const getXhsGroup_xsEncrypt = new Xhshow();
7809
+ const getXhsGroup = async (_task, params)=>{
7810
+ const http = new Http({
7811
+ headers: {
7812
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
7813
+ referer: "https://creator.xiaohongshu.com",
7814
+ origin: "https://creator.xiaohongshu.com"
7815
+ }
7816
+ });
7817
+ const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
7818
+ if (!a1Cookie) return {
7819
+ code: 200,
7820
+ message: "账号数据异常,请重新绑定账号后重试。",
7821
+ data: []
7822
+ };
7823
+ try {
7824
+ const xt = Date.now().toString();
7825
+ const groupListParams = {
7826
+ note_id: ""
7827
+ };
7828
+ const fatchGroup = "/api/im/web/nns/group_list";
7829
+ const xs = getXhsGroup_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", groupListParams);
7830
+ const res = await http.api({
7831
+ method: "get",
7832
+ url: "https://edith.xiaohongshu.com/api/im/web/nns/group_list",
7833
+ params: groupListParams,
7834
+ headers: {
7835
+ "x-s": xs,
7836
+ "x-t": xt
7837
+ }
7838
+ });
7839
+ return (0, share_namespaceObject.success)(0 === res.code ? res.data.group_list : [], "群聊信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
7840
+ } catch (error) {
7841
+ return (0, share_namespaceObject.success)([]);
7842
+ }
7843
+ };
7844
+ const getXhsHotTopic_xsEncrypt = new Xhshow();
7845
+ const getXhsHotTopic = async (_task, params)=>{
7846
+ const http = new Http({
7847
+ headers: {
7848
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
7849
+ referer: "https://creator.xiaohongshu.com",
7850
+ origin: "https://creator.xiaohongshu.com"
7851
+ }
7852
+ });
7853
+ const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
7854
+ if (!a1Cookie) return {
7855
+ code: 200,
7856
+ message: "账号数据异常,请重新绑定账号后重试。",
7857
+ data: []
7858
+ };
7859
+ try {
7860
+ const xt = Date.now().toString();
7861
+ const hotTopicParams = {
7862
+ sort: 1,
7863
+ type: 1,
7864
+ source: 3,
7865
+ topic_activity: 1
7866
+ };
7867
+ const fatchGroup = "/api/galaxy/v2/creator/activity_center/list";
7868
+ const xs = getXhsHotTopic_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", hotTopicParams);
7869
+ const res = await http.api({
7870
+ method: "get",
7871
+ url: "https://creator.xiaohongshu.com/api/galaxy/v2/creator/activity_center/list",
7872
+ params: hotTopicParams,
7873
+ headers: {
7874
+ "x-s": xs,
7875
+ "x-t": xt
7876
+ }
7877
+ });
7878
+ return (0, share_namespaceObject.success)(0 === res.code ? res.data.activity_list : [], "热门信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
7879
+ } catch (error) {
7880
+ return (0, share_namespaceObject.success)([]);
7881
+ }
7882
+ };
7883
+ var package_namespaceObject = {
7884
+ i8: "1.2.24"
7885
+ };
7516
7886
  const BetaFlag = "HuiwenCanary";
7517
7887
  class Action {
7518
7888
  constructor(task){
@@ -7581,6 +7951,9 @@ var __webpack_exports__ = {};
7581
7951
  BjhFansExport(params) {
7582
7952
  return this.bindTask(BjhFansExport, params);
7583
7953
  }
7954
+ SearchBjhTopicList(params) {
7955
+ return this.bindTask(searchBjhTopicList, params);
7956
+ }
7584
7957
  searchToutiaoUserID(params) {
7585
7958
  return this.bindTask(searchToutiaoUserInfo, params);
7586
7959
  }
@@ -7593,6 +7966,18 @@ var __webpack_exports__ = {};
7593
7966
  getWeixinConfig(params) {
7594
7967
  return this.bindTask(getWeixinConfig, params);
7595
7968
  }
7969
+ getWeixinCollection(params) {
7970
+ return this.bindTask(getWeixinCollection, params);
7971
+ }
7972
+ getXhsCollection(params) {
7973
+ return this.bindTask(getXhsCollection, params);
7974
+ }
7975
+ getXhsGroup(params) {
7976
+ return this.bindTask(getXhsGroup, params);
7977
+ }
7978
+ getXhsHotTopic(params) {
7979
+ return this.bindTask(getXhsHotTopic, params);
7980
+ }
7596
7981
  getBaijiahaoConfig(params) {
7597
7982
  return this.bindTask(getBaijiahaoConfig, params);
7598
7983
  }