@iflyrpa/actions 1.2.30-beta.3 → 1.2.30-beta.5

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
@@ -270,6 +270,7 @@ type MethodParams<T> = {
270
270
  };
271
271
  export type ActionMethodParams = MethodParams<ActionInstance>;
272
272
  export { version } from "../package.json";
273
+ export { type BaijiahaoPublishParams, BaijiahaoPublishParamsSchema } from "./actions/baijiahaoPublish";
273
274
  export type { sessionCheckResult } from "./actions/common/sessionCheck";
274
275
  export { SessionCheckResultSchema, type WxBjhSessionParams, WxBjhSessionParamsSchema, } from "./actions/common/sessionCheck";
275
276
  export { ConfigDataSchema } from "./actions/getBaijiaohaoConfig";
@@ -279,6 +280,8 @@ export { type SearchAccountInfoParams, SearchAccountInfoParamsSchema } from "./a
279
280
  export { type bjhConfigData, bjhConfigDataSchema, type ttConfigData, ttConfigDataSchema, type wxConfigData, wxConfigDataSchema, type xhsConfigData, xhsConfigDataSchema, } from "./actions/searchAccountInfo/types";
280
281
  export { type FetchArticlesParams, FetchArticlesParamsSchema } from "./actions/searchPublishInfo";
281
282
  export { type FetchArticlesData, FetchArticlesDataSchema } from "./actions/searchPublishInfo/types";
283
+ export { type ToutiaoPublishParams, ToutiaoPublishParamsSchema } from "./actions/toutiaoPublish";
284
+ export { type WeixinPublishParams, WeixinPublishParamsSchema } from "./actions/weixinPublish";
282
285
  export { type XiaohongshuPublishParams, XiaohongshuPublishParamsSchema } from "./actions/xiaohongshuPublish";
283
286
  export { type XhsWebSearchParams, XhsWebSearchParamsSchema } from "./actions/xiaohongshuWebSearch";
284
287
  export { type ActiomCommonParams, ActionCommonParamsSchema } from "./types";
package/dist/index.js CHANGED
@@ -4326,16 +4326,19 @@ var __webpack_exports__ = {};
4326
4326
  UnreadCountSchema: ()=>UnreadCountSchema,
4327
4327
  SessionCheckResultSchema: ()=>SessionCheckResultSchema,
4328
4328
  ActionCommonParamsSchema: ()=>ActionCommonParamsSchema,
4329
+ ToutiaoPublishParamsSchema: ()=>ToutiaoPublishParamsSchema,
4330
+ WeixinPublishParamsSchema: ()=>WeixinPublishParamsSchema,
4329
4331
  WxBjhSessionParamsSchema: ()=>WxBjhSessionParamsSchema,
4330
4332
  CollectionDetailSchema: ()=>CollectionDetailSchema,
4331
4333
  BetaFlag: ()=>BetaFlag,
4332
4334
  bjhConfigDataSchema: ()=>bjhConfigDataSchema,
4335
+ BaijiahaoPublishParamsSchema: ()=>BaijiahaoPublishParamsSchema,
4333
4336
  FetchArticlesDataSchema: ()=>FetchArticlesDataSchema,
4334
4337
  FetchArticlesParamsSchema: ()=>FetchArticlesParamsSchema,
4335
- version: ()=>package_namespaceObject.i8,
4336
4338
  Action: ()=>Action,
4337
4339
  ProxyAgent: ()=>ProxyAgent,
4338
4340
  XiaohongshuPublishParamsSchema: ()=>XiaohongshuPublishParamsSchema,
4341
+ version: ()=>package_namespaceObject.i8,
4339
4342
  wxConfigDataSchema: ()=>wxConfigDataSchema
4340
4343
  });
4341
4344
  const share_namespaceObject = require("@iflyrpa/share");
@@ -4425,7 +4428,6 @@ var __webpack_exports__ = {};
4425
4428
  return response;
4426
4429
  }, (error)=>{
4427
4430
  const foundError = findError(error.response);
4428
- console.log(error);
4429
4431
  const errorResponse = {
4430
4432
  code: error.response?.status || 500,
4431
4433
  message: error.message || "",
@@ -6430,6 +6432,10 @@ var __webpack_exports__ = {};
6430
6432
  return payload;
6431
6433
  };
6432
6434
  });
6435
+ const $ZodAny = /*@__PURE__*/ $constructor("$ZodAny", (inst, def)=>{
6436
+ $ZodType.init(inst, def);
6437
+ inst._zod.parse = (payload)=>payload;
6438
+ });
6433
6439
  const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def)=>{
6434
6440
  $ZodType.init(inst, def);
6435
6441
  inst._zod.parse = (payload)=>payload;
@@ -6804,6 +6810,89 @@ var __webpack_exports__ = {};
6804
6810
  result.value = merged.data;
6805
6811
  return result;
6806
6812
  }
6813
+ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def)=>{
6814
+ $ZodType.init(inst, def);
6815
+ inst._zod.parse = (payload, ctx)=>{
6816
+ const input = payload.value;
6817
+ if (!isPlainObject(input)) {
6818
+ payload.issues.push({
6819
+ expected: "record",
6820
+ code: "invalid_type",
6821
+ input,
6822
+ inst
6823
+ });
6824
+ return payload;
6825
+ }
6826
+ const proms = [];
6827
+ if (def.keyType._zod.values) {
6828
+ const values = def.keyType._zod.values;
6829
+ payload.value = {};
6830
+ for (const key of values)if ("string" == typeof key || "number" == typeof key || "symbol" == typeof key) {
6831
+ const result = def.valueType._zod.run({
6832
+ value: input[key],
6833
+ issues: []
6834
+ }, ctx);
6835
+ if (result instanceof Promise) proms.push(result.then((result)=>{
6836
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6837
+ payload.value[key] = result.value;
6838
+ }));
6839
+ else {
6840
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6841
+ payload.value[key] = result.value;
6842
+ }
6843
+ }
6844
+ let unrecognized;
6845
+ for(const key in input)if (!values.has(key)) {
6846
+ unrecognized = unrecognized ?? [];
6847
+ unrecognized.push(key);
6848
+ }
6849
+ if (unrecognized && unrecognized.length > 0) payload.issues.push({
6850
+ code: "unrecognized_keys",
6851
+ input,
6852
+ inst,
6853
+ keys: unrecognized
6854
+ });
6855
+ } else {
6856
+ payload.value = {};
6857
+ for (const key of Reflect.ownKeys(input)){
6858
+ if ("__proto__" === key) continue;
6859
+ const keyResult = def.keyType._zod.run({
6860
+ value: key,
6861
+ issues: []
6862
+ }, ctx);
6863
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
6864
+ if (keyResult.issues.length) {
6865
+ payload.issues.push({
6866
+ code: "invalid_key",
6867
+ origin: "record",
6868
+ issues: keyResult.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())),
6869
+ input: key,
6870
+ path: [
6871
+ key
6872
+ ],
6873
+ inst
6874
+ });
6875
+ payload.value[keyResult.value] = keyResult.value;
6876
+ continue;
6877
+ }
6878
+ const result = def.valueType._zod.run({
6879
+ value: input[key],
6880
+ issues: []
6881
+ }, ctx);
6882
+ if (result instanceof Promise) proms.push(result.then((result)=>{
6883
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6884
+ payload.value[keyResult.value] = result.value;
6885
+ }));
6886
+ else {
6887
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6888
+ payload.value[keyResult.value] = result.value;
6889
+ }
6890
+ }
6891
+ }
6892
+ if (proms.length) return Promise.all(proms).then(()=>payload);
6893
+ return payload;
6894
+ };
6895
+ });
6807
6896
  const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def)=>{
6808
6897
  $ZodType.init(inst, def);
6809
6898
  const values = util_getEnumValues(def.entries);
@@ -7489,6 +7578,11 @@ var __webpack_exports__ = {};
7489
7578
  ...normalizeParams(params)
7490
7579
  });
7491
7580
  }
7581
+ function _any(Class) {
7582
+ return new Class({
7583
+ type: "any"
7584
+ });
7585
+ }
7492
7586
  function _unknown(Class) {
7493
7587
  return new Class({
7494
7588
  type: "unknown"
@@ -8015,6 +8109,13 @@ var __webpack_exports__ = {};
8015
8109
  function schemas_boolean(params) {
8016
8110
  return _boolean(ZodBoolean, params);
8017
8111
  }
8112
+ const ZodAny = /*@__PURE__*/ $constructor("ZodAny", (inst, def)=>{
8113
+ $ZodAny.init(inst, def);
8114
+ ZodType.init(inst, def);
8115
+ });
8116
+ function any() {
8117
+ return _any(ZodAny);
8118
+ }
8018
8119
  const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def)=>{
8019
8120
  $ZodUnknown.init(inst, def);
8020
8121
  ZodType.init(inst, def);
@@ -8106,6 +8207,20 @@ var __webpack_exports__ = {};
8106
8207
  right: right
8107
8208
  });
8108
8209
  }
8210
+ const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def)=>{
8211
+ $ZodRecord.init(inst, def);
8212
+ ZodType.init(inst, def);
8213
+ inst.keyType = def.keyType;
8214
+ inst.valueType = def.valueType;
8215
+ });
8216
+ function record(keyType, valueType, params) {
8217
+ return new ZodRecord({
8218
+ type: "record",
8219
+ keyType,
8220
+ valueType: valueType,
8221
+ ...normalizeParams(params)
8222
+ });
8223
+ }
8109
8224
  const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def)=>{
8110
8225
  $ZodEnum.init(inst, def);
8111
8226
  ZodType.init(inst, def);
@@ -8341,6 +8456,11 @@ var __webpack_exports__ = {};
8341
8456
  ExecutionState["FAILED"] = "FAILED";
8342
8457
  return ExecutionState;
8343
8458
  }({});
8459
+ const types_errorResponse = (message, code = 500)=>({
8460
+ code,
8461
+ message,
8462
+ data: null
8463
+ });
8344
8464
  const rpa_server_scanRetryMaxCount = 60;
8345
8465
  const rpa_server_waitQrcodeResultMaxTime = 2000 * rpa_server_scanRetryMaxCount;
8346
8466
  const rpaServer = async (task, _params)=>{
@@ -8811,6 +8931,27 @@ var __webpack_exports__ = {};
8811
8931
  retryDelay: 500,
8812
8932
  timeout: 6000
8813
8933
  });
8934
+ const isSuccess = 0 === res.errno;
8935
+ const data = res?.ret?.article_id;
8936
+ const message = isSuccess ? isDraft ? "文章同步成功!" : `文章发布成功!${res.proxyInfo || ""}` : res.errmsg || (isDraft ? "文章同步失败,请稍后重试。" : "文章发布失败,请稍后重试。");
8937
+ const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
8938
+ if (!isSuccess) {
8939
+ await updateTaskState?.({
8940
+ state: share_namespaceObject.TaskState.FAILED,
8941
+ error: message
8942
+ });
8943
+ return {
8944
+ code: 414,
8945
+ data,
8946
+ message
8947
+ };
8948
+ }
8949
+ await updateTaskState?.({
8950
+ state: share_namespaceObject.TaskState.SUCCESS,
8951
+ result: {
8952
+ response: data
8953
+ }
8954
+ });
8814
8955
  return (0, share_namespaceObject.success)(0 === res.errno ? res?.ret?.article_id || "" : "", 0 === res.errno ? `文章发布成功!${http.proxyInfo || ""}` : res.errmsg ?? "文章发布失败,请稍后重试。");
8815
8956
  };
8816
8957
  const rpa_rpaAction = async (task, params)=>{
@@ -9011,6 +9152,47 @@ var __webpack_exports__ = {};
9011
9152
  await page.close();
9012
9153
  return (0, share_namespaceObject.success)(articleId, articleId ? "发布成功" : message);
9013
9154
  };
9155
+ const BaijiahaoPublishParamsSchema = ActionCommonParamsSchema.extend({
9156
+ saveType: schemas_enum([
9157
+ "draft",
9158
+ "publish"
9159
+ ]),
9160
+ token: schemas_string(),
9161
+ title: schemas_string(),
9162
+ content: schemas_string(),
9163
+ proxyLoc: schemas_string().optional(),
9164
+ localIP: schemas_string().optional(),
9165
+ huiwenToken: schemas_string().optional(),
9166
+ settingInfo: schemas_object({
9167
+ baijiahaoTitle: schemas_string(),
9168
+ baijiahaoCoverType: schemas_enum([
9169
+ "single",
9170
+ "multiple"
9171
+ ]),
9172
+ baijiahaoAbstract: schemas_string(),
9173
+ baijiahaoIsAi: schemas_array(schemas_string()),
9174
+ baijiahaoSingleCover: schemas_string(),
9175
+ baijiahaoMultCover: schemas_array(schemas_string()),
9176
+ baijiahaoVerticalCover: schemas_string().optional(),
9177
+ baijiahaoActivity: schemas_array(schemas_object({
9178
+ id: schemas_string(),
9179
+ task_name: schemas_string()
9180
+ }).catchall(any())),
9181
+ baijiahaoPublishConf: schemas_array(schemas_object({
9182
+ confName: schemas_string(),
9183
+ isChecked: schemas_boolean()
9184
+ })).optional(),
9185
+ baijiahaoTopic: record(schemas_string(), any()).optional(),
9186
+ baijiahaoCms: schemas_array(schemas_string()).optional(),
9187
+ baijiahaoEventSpec: schemas_object({
9188
+ time: schemas_string(),
9189
+ pos: schemas_string()
9190
+ }).partial().optional(),
9191
+ baijiahaoEvent2News: schemas_boolean(),
9192
+ baijiahaoSelectActivityCache: schemas_array(schemas_string()),
9193
+ timer: schemas_number().optional()
9194
+ })
9195
+ });
9014
9196
  const baijiahaoPublish = async (task, params)=>{
9015
9197
  params.content = formatSectionHtml(params.content);
9016
9198
  if ("rpa" === params.actionType) return rpa_rpaAction(task, params);
@@ -10688,49 +10870,6 @@ var __webpack_exports__ = {};
10688
10870
  const message = `获取未读消息数${isSuccess ? "成功" : `失败,原因:${res.msg}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
10689
10871
  return (0, share_namespaceObject.success)(unreadCount, message);
10690
10872
  };
10691
- const ttConfigDataSchema = schemas_object({
10692
- fansNum: schemas_number(),
10693
- fansNumYesterday: schemas_number().nullable(),
10694
- readNum: schemas_number(),
10695
- incomeNum: schemas_number(),
10696
- incomeNumYesterday: schemas_number().nullable(),
10697
- showNumYesterday: schemas_number().nullable(),
10698
- readNumYesterday: schemas_number().nullable(),
10699
- likeNumYesterday: schemas_number().nullable(),
10700
- commentNumYesterday: schemas_number().nullable()
10701
- });
10702
- const xhsConfigDataSchema = schemas_object({
10703
- fansNum: schemas_number(),
10704
- favedNum: schemas_number(),
10705
- watchNumLastWeek: schemas_number(),
10706
- likeNumLastWeek: schemas_number(),
10707
- collectNumLastWeek: schemas_number(),
10708
- commentNumLastWeek: schemas_number(),
10709
- fansNumLastWeek: schemas_number(),
10710
- fansNumYesterday: schemas_number()
10711
- });
10712
- const wxConfigDataSchema = schemas_object({
10713
- fansNum: schemas_number(),
10714
- fansNumYesterday: schemas_number(),
10715
- readNumYesterday: schemas_number(),
10716
- shareNumYesterday: schemas_number()
10717
- });
10718
- const bjhConfigDataSchema = schemas_object({
10719
- fansNum: schemas_number(),
10720
- fansNumYesterday: schemas_number().nullable(),
10721
- readNum: schemas_number(),
10722
- incomeNum: schemas_number(),
10723
- incomeNumYesterday: schemas_number().nullable(),
10724
- recommendNumYesterday: schemas_number().nullable(),
10725
- readNumYesterday: schemas_number().nullable(),
10726
- likeNumYesterday: schemas_number().nullable(),
10727
- commentNumYesterday: schemas_number().nullable()
10728
- });
10729
- const types_errorResponse = (message, code = 500)=>({
10730
- code,
10731
- message,
10732
- data: null
10733
- });
10734
10873
  async function getBaijiahaoData(_task, params) {
10735
10874
  const { token } = params;
10736
10875
  if (!token) return types_errorResponse("缺少token", 414);
@@ -12644,6 +12783,27 @@ var __webpack_exports__ = {};
12644
12783
  retryDelay: 500,
12645
12784
  timeout: 12000
12646
12785
  });
12786
+ const isSuccess = 0 === publishResult.code;
12787
+ const data = publishResult.data?.pgc_id;
12788
+ const message = publishResult.message || (isSuccess ? "文章发布成功!" : "文章发布失败,未知错误。");
12789
+ const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
12790
+ if (!isSuccess) {
12791
+ await updateTaskState?.({
12792
+ state: share_namespaceObject.TaskState.FAILED,
12793
+ error: message
12794
+ });
12795
+ return {
12796
+ code: 414,
12797
+ data,
12798
+ message
12799
+ };
12800
+ }
12801
+ await updateTaskState?.({
12802
+ state: share_namespaceObject.TaskState.SUCCESS,
12803
+ result: {
12804
+ response: data
12805
+ }
12806
+ });
12647
12807
  return (0, share_namespaceObject.success)(publishResult.data.pgc_id, `文章发布成功!${task.debug ? ` ${http.proxyInfo}` : ""}`);
12648
12808
  };
12649
12809
  const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
@@ -12871,6 +13031,60 @@ var __webpack_exports__ = {};
12871
13031
  await page.close();
12872
13032
  return (0, share_namespaceObject.success)(articleId, "publish" === params.saveType ? "发布成功" : "保存草稿成功");
12873
13033
  };
13034
+ const ToutiaoPublishParamsSchema = ActionCommonParamsSchema.extend({
13035
+ saveType: union([
13036
+ literal("draft"),
13037
+ literal("publish")
13038
+ ]),
13039
+ title: schemas_string(),
13040
+ content: schemas_string(),
13041
+ proxyLoc: schemas_string().optional(),
13042
+ localIP: schemas_string().optional(),
13043
+ huiwenToken: schemas_string().optional(),
13044
+ settingInfo: schemas_object({
13045
+ toutiaoCoverType: union([
13046
+ literal("single"),
13047
+ literal("multiple"),
13048
+ literal("no")
13049
+ ]),
13050
+ toutiaoTitleType: union([
13051
+ literal("single"),
13052
+ literal("multiple")
13053
+ ]),
13054
+ toutiaoSingleCover: schemas_string(),
13055
+ toutiaoMultCover: schemas_array(schemas_string()),
13056
+ toutiaoAd: schemas_string(),
13057
+ toutiaoOriginal: schemas_string().optional(),
13058
+ toutiaoExclusive: schemas_number().optional(),
13059
+ toutiaoCollectionId: schemas_string().optional(),
13060
+ toutiaoTransWtt: schemas_boolean().optional(),
13061
+ toutiaoClaim: schemas_object({
13062
+ type: schemas_number(),
13063
+ source_author_uid: schemas_string().optional(),
13064
+ source_author_name: schemas_string().optional(),
13065
+ time_format: schemas_string().optional(),
13066
+ position: schemas_object({
13067
+ position: schemas_string(),
13068
+ city: schemas_string(),
13069
+ longitude: schemas_number(),
13070
+ latitude: schemas_number(),
13071
+ type_code: schemas_string(),
13072
+ poi_id: schemas_string()
13073
+ }).optional()
13074
+ }).optional(),
13075
+ toutiaoLocation: schemas_object({
13076
+ label: schemas_string(),
13077
+ value: schemas_string()
13078
+ }).passthrough().optional(),
13079
+ toutiaoTopic: schemas_array(schemas_object({
13080
+ id: schemas_string(),
13081
+ word: schemas_string()
13082
+ })),
13083
+ cntWord: schemas_number(),
13084
+ subTitles: schemas_array(schemas_string()),
13085
+ timer: schemas_number().optional()
13086
+ })
13087
+ });
12874
13088
  const COVER_TYPE = {
12875
13089
  no: 1,
12876
13090
  single: 2,
@@ -14251,7 +14465,18 @@ var __webpack_exports__ = {};
14251
14465
  const qrcodeBuffer = Buffer.from(qrcodeResult);
14252
14466
  const qrcodeFilePath = external_node_path_default().join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
14253
14467
  external_node_fs_default().writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
14254
- params.safeQrcodeCallback ? params.safeQrcodeCallback?.(qrcodeFilePath) : await reporter(10041, "请扫码确认发布!", `data:image/jpeg;base64,${Buffer.from(qrcodeResult).toString("base64")}`);
14468
+ const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
14469
+ if (params.safeQrcodeCallback) params.safeQrcodeCallback?.(qrcodeFilePath);
14470
+ else {
14471
+ const data = `data:image/jpeg;base64,${Buffer.from(qrcodeResult).toString("base64")}`;
14472
+ await reporter(10041, "请扫码确认发布!", data);
14473
+ await updateTaskState?.({
14474
+ state: share_namespaceObject.TaskState.WAIT_SCAN,
14475
+ result: {
14476
+ qrImg: data
14477
+ }
14478
+ });
14479
+ }
14255
14480
  let code = "";
14256
14481
  for(let i = 0; i < utils_scanRetryMaxCount; i++){
14257
14482
  await (0, share_namespaceObject.sleep)(2000);
@@ -14279,11 +14504,18 @@ var __webpack_exports__ = {};
14279
14504
  code = checkScanResult.code;
14280
14505
  break;
14281
14506
  }
14282
- if (i === utils_scanRetryMaxCount - 1) return {
14283
- code: 414,
14284
- message: "二维码已过期,请重试发布。",
14285
- data: ""
14286
- };
14507
+ if (i === utils_scanRetryMaxCount - 1) {
14508
+ const message = "二维码已过期,请重试发布。";
14509
+ await updateTaskState?.({
14510
+ state: share_namespaceObject.TaskState.FAILED,
14511
+ error: message
14512
+ });
14513
+ return {
14514
+ code: 414,
14515
+ message,
14516
+ data: ""
14517
+ };
14518
+ }
14287
14519
  }
14288
14520
  if (!params.masssend) await http.api({
14289
14521
  method: "post",
@@ -14357,6 +14589,12 @@ var __webpack_exports__ = {};
14357
14589
  retryDelay: 500,
14358
14590
  timeout: 12000
14359
14591
  });
14592
+ await updateTaskState?.({
14593
+ state: share_namespaceObject.TaskState.SUCCESS,
14594
+ result: {
14595
+ response: appMsgId
14596
+ }
14597
+ });
14360
14598
  return (0, share_namespaceObject.success)(appMsgId, `微信公众号发布完成!${task.debug ? ` ${http.proxyInfo}` : ""}`);
14361
14599
  };
14362
14600
  const weixinPublish_rpa_waitQrcodeResultMaxTime = 2000 * utils_scanRetryMaxCount;
@@ -14794,9 +15032,66 @@ var __webpack_exports__ = {};
14794
15032
  await page.close();
14795
15033
  return (0, share_namespaceObject.success)(articleId);
14796
15034
  };
15035
+ const WxInteractionSchema = schemas_object({
15036
+ Type: schemas_enum([
15037
+ "public",
15038
+ "private",
15039
+ "off"
15040
+ ]),
15041
+ Option: schemas_object({
15042
+ Comment: schemas_enum([
15043
+ "已关注7天及以上的用户",
15044
+ "已关注的用户",
15045
+ "所有用户"
15046
+ ]),
15047
+ reply: schemas_enum([
15048
+ "已关注7天及以上的用户",
15049
+ "已关注的用户",
15050
+ "所有用户"
15051
+ ]),
15052
+ elect_comment: schemas_boolean(),
15053
+ elect_reply: schemas_boolean()
15054
+ }).optional()
15055
+ });
15056
+ const WeixinPublishParamsSchema = ActionCommonParamsSchema.extend({
15057
+ saveType: schemas_enum([
15058
+ "draft",
15059
+ "publish"
15060
+ ]),
15061
+ masssend: schemas_boolean().optional(),
15062
+ token: union([
15063
+ schemas_string(),
15064
+ schemas_number()
15065
+ ]),
15066
+ title: schemas_string(),
15067
+ content: schemas_string(),
15068
+ uuid: schemas_string().optional(),
15069
+ appMsgId: schemas_string().optional(),
15070
+ operation_seq: schemas_string().optional(),
15071
+ proxyLoc: schemas_string().optional(),
15072
+ localIP: schemas_string().optional(),
15073
+ huiwenToken: schemas_string().optional(),
15074
+ settingInfo: schemas_object({
15075
+ wxCover: schemas_string(),
15076
+ wxAuthor: schemas_string().optional(),
15077
+ wxAbstract: schemas_string().optional(),
15078
+ wxOriginalText: schemas_string().optional(),
15079
+ wxCopyright: schemas_boolean().optional(),
15080
+ wxWhitelist: schemas_array(schemas_string()).optional(),
15081
+ wxRewardTarget: record(schemas_string(), schemas_string()).optional(),
15082
+ wxRewardText: schemas_string().optional(),
15083
+ wxQuickReprint: schemas_boolean().optional(),
15084
+ wxNotAllowRecommend: schemas_boolean().optional(),
15085
+ wxCreationSource: schemas_array(schemas_string()).optional(),
15086
+ wxInteraction: WxInteractionSchema.optional(),
15087
+ timer: schemas_number().optional(),
15088
+ wxTopic: schemas_array(schemas_string()).optional(),
15089
+ wxCollectionInfo: any().optional()
15090
+ })
15091
+ });
14797
15092
  const weixinPublish = async (task, _params)=>{
14798
15093
  const params = defaultParams(_params, {
14799
- masssend: true
15094
+ masssend: false
14800
15095
  });
14801
15096
  params.content = formatSectionHtml(params.content);
14802
15097
  if ("rpa" === params.actionType) return weixinPublish_rpa_rpaAction(task, params);
@@ -15372,7 +15667,8 @@ var __webpack_exports__ = {};
15372
15667
  retryDelay: 20,
15373
15668
  timeout: 3000
15374
15669
  });
15375
- Object.assign(topic, createTopic.data.topic_infos[0]);
15670
+ if (!createTopic?.data) throw types_errorResponse("话题创建失败,请检查话题字段!", 414);
15671
+ Object.assign(topic, createTopic?.data?.topic_infos[0]);
15376
15672
  }
15377
15673
  }));
15378
15674
  const visibleRangeMap = {
@@ -16104,12 +16400,6 @@ var __webpack_exports__ = {};
16104
16400
  response: response?.data?.id || ""
16105
16401
  }
16106
16402
  });
16107
- await updateTaskState?.({
16108
- state: share_namespaceObject.TaskState.SUCCESS,
16109
- result: {
16110
- response: "123456789"
16111
- }
16112
- });
16113
16403
  await page.close();
16114
16404
  return (0, share_namespaceObject.success)(response?.data?.id || "");
16115
16405
  };
@@ -17064,7 +17354,45 @@ var __webpack_exports__ = {};
17064
17354
  const data = isSuccess ? res.data : {};
17065
17355
  return (0, share_namespaceObject.response)(isSuccess ? 0 : 414, message, data);
17066
17356
  };
17067
- var package_namespaceObject = JSON.parse('{"i8":"1.2.30-beta.2"}');
17357
+ var package_namespaceObject = JSON.parse('{"i8":"1.2.30-beta.4"}');
17358
+ const ttConfigDataSchema = schemas_object({
17359
+ fansNum: schemas_number(),
17360
+ fansNumYesterday: schemas_number().nullable(),
17361
+ readNum: schemas_number(),
17362
+ incomeNum: schemas_number(),
17363
+ incomeNumYesterday: schemas_number().nullable(),
17364
+ showNumYesterday: schemas_number().nullable(),
17365
+ readNumYesterday: schemas_number().nullable(),
17366
+ likeNumYesterday: schemas_number().nullable(),
17367
+ commentNumYesterday: schemas_number().nullable()
17368
+ });
17369
+ const xhsConfigDataSchema = schemas_object({
17370
+ fansNum: schemas_number(),
17371
+ favedNum: schemas_number(),
17372
+ watchNumLastWeek: schemas_number(),
17373
+ likeNumLastWeek: schemas_number(),
17374
+ collectNumLastWeek: schemas_number(),
17375
+ commentNumLastWeek: schemas_number(),
17376
+ fansNumLastWeek: schemas_number(),
17377
+ fansNumYesterday: schemas_number()
17378
+ });
17379
+ const wxConfigDataSchema = schemas_object({
17380
+ fansNum: schemas_number(),
17381
+ fansNumYesterday: schemas_number(),
17382
+ readNumYesterday: schemas_number(),
17383
+ shareNumYesterday: schemas_number()
17384
+ });
17385
+ const bjhConfigDataSchema = schemas_object({
17386
+ fansNum: schemas_number(),
17387
+ fansNumYesterday: schemas_number().nullable(),
17388
+ readNum: schemas_number(),
17389
+ incomeNum: schemas_number(),
17390
+ incomeNumYesterday: schemas_number().nullable(),
17391
+ recommendNumYesterday: schemas_number().nullable(),
17392
+ readNumYesterday: schemas_number().nullable(),
17393
+ likeNumYesterday: schemas_number().nullable(),
17394
+ commentNumYesterday: schemas_number().nullable()
17395
+ });
17068
17396
  const BetaFlag = "HuiwenCanary";
17069
17397
  class Action {
17070
17398
  constructor(task){