@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/actions/baijiahaoPublish/index.d.ts +61 -39
- package/dist/actions/searchAccountInfo/types.d.ts +0 -1
- package/dist/actions/toutiaoPublish/index.d.ts +63 -46
- package/dist/actions/weitoutiaoPublish/index.d.ts +1 -1
- package/dist/actions/weixinPublish/index.d.ts +94 -31
- package/dist/bundle.js +388 -60
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +388 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +385 -60
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -7567,16 +7567,19 @@ var __webpack_exports__ = {};
|
|
|
7567
7567
|
UnreadCountSchema: ()=>UnreadCountSchema,
|
|
7568
7568
|
SessionCheckResultSchema: ()=>SessionCheckResultSchema,
|
|
7569
7569
|
ActionCommonParamsSchema: ()=>ActionCommonParamsSchema,
|
|
7570
|
+
ToutiaoPublishParamsSchema: ()=>ToutiaoPublishParamsSchema,
|
|
7571
|
+
WeixinPublishParamsSchema: ()=>WeixinPublishParamsSchema,
|
|
7570
7572
|
WxBjhSessionParamsSchema: ()=>WxBjhSessionParamsSchema,
|
|
7571
7573
|
CollectionDetailSchema: ()=>CollectionDetailSchema,
|
|
7572
7574
|
BetaFlag: ()=>BetaFlag,
|
|
7573
7575
|
bjhConfigDataSchema: ()=>bjhConfigDataSchema,
|
|
7576
|
+
BaijiahaoPublishParamsSchema: ()=>BaijiahaoPublishParamsSchema,
|
|
7574
7577
|
FetchArticlesDataSchema: ()=>FetchArticlesDataSchema,
|
|
7575
7578
|
FetchArticlesParamsSchema: ()=>FetchArticlesParamsSchema,
|
|
7576
|
-
version: ()=>package_namespaceObject.i8,
|
|
7577
7579
|
Action: ()=>Action,
|
|
7578
7580
|
ProxyAgent: ()=>ProxyAgent,
|
|
7579
7581
|
XiaohongshuPublishParamsSchema: ()=>XiaohongshuPublishParamsSchema,
|
|
7582
|
+
version: ()=>package_namespaceObject.i8,
|
|
7580
7583
|
wxConfigDataSchema: ()=>wxConfigDataSchema
|
|
7581
7584
|
});
|
|
7582
7585
|
var common_utils_namespaceObject = {};
|
|
@@ -22159,7 +22162,6 @@ var __webpack_exports__ = {};
|
|
|
22159
22162
|
return response;
|
|
22160
22163
|
}, (error)=>{
|
|
22161
22164
|
const foundError = findError(error.response);
|
|
22162
|
-
console.log(error);
|
|
22163
22165
|
const errorResponse = {
|
|
22164
22166
|
code: error.response?.status || 500,
|
|
22165
22167
|
message: error.message || "",
|
|
@@ -25132,6 +25134,10 @@ var __webpack_exports__ = {};
|
|
|
25132
25134
|
return payload;
|
|
25133
25135
|
};
|
|
25134
25136
|
});
|
|
25137
|
+
const $ZodAny = /*@__PURE__*/ core_$constructor("$ZodAny", (inst, def)=>{
|
|
25138
|
+
schemas_$ZodType.init(inst, def);
|
|
25139
|
+
inst._zod.parse = (payload)=>payload;
|
|
25140
|
+
});
|
|
25135
25141
|
const schemas_$ZodUnknown = /*@__PURE__*/ core_$constructor("$ZodUnknown", (inst, def)=>{
|
|
25136
25142
|
schemas_$ZodType.init(inst, def);
|
|
25137
25143
|
inst._zod.parse = (payload)=>payload;
|
|
@@ -25506,6 +25512,89 @@ var __webpack_exports__ = {};
|
|
|
25506
25512
|
result.value = merged.data;
|
|
25507
25513
|
return result;
|
|
25508
25514
|
}
|
|
25515
|
+
const $ZodRecord = /*@__PURE__*/ core_$constructor("$ZodRecord", (inst, def)=>{
|
|
25516
|
+
schemas_$ZodType.init(inst, def);
|
|
25517
|
+
inst._zod.parse = (payload, ctx)=>{
|
|
25518
|
+
const input = payload.value;
|
|
25519
|
+
if (!util_isPlainObject(input)) {
|
|
25520
|
+
payload.issues.push({
|
|
25521
|
+
expected: "record",
|
|
25522
|
+
code: "invalid_type",
|
|
25523
|
+
input,
|
|
25524
|
+
inst
|
|
25525
|
+
});
|
|
25526
|
+
return payload;
|
|
25527
|
+
}
|
|
25528
|
+
const proms = [];
|
|
25529
|
+
if (def.keyType._zod.values) {
|
|
25530
|
+
const values = def.keyType._zod.values;
|
|
25531
|
+
payload.value = {};
|
|
25532
|
+
for (const key of values)if ("string" == typeof key || "number" == typeof key || "symbol" == typeof key) {
|
|
25533
|
+
const result = def.valueType._zod.run({
|
|
25534
|
+
value: input[key],
|
|
25535
|
+
issues: []
|
|
25536
|
+
}, ctx);
|
|
25537
|
+
if (result instanceof Promise) proms.push(result.then((result)=>{
|
|
25538
|
+
if (result.issues.length) payload.issues.push(...util_prefixIssues(key, result.issues));
|
|
25539
|
+
payload.value[key] = result.value;
|
|
25540
|
+
}));
|
|
25541
|
+
else {
|
|
25542
|
+
if (result.issues.length) payload.issues.push(...util_prefixIssues(key, result.issues));
|
|
25543
|
+
payload.value[key] = result.value;
|
|
25544
|
+
}
|
|
25545
|
+
}
|
|
25546
|
+
let unrecognized;
|
|
25547
|
+
for(const key in input)if (!values.has(key)) {
|
|
25548
|
+
unrecognized = unrecognized ?? [];
|
|
25549
|
+
unrecognized.push(key);
|
|
25550
|
+
}
|
|
25551
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
25552
|
+
code: "unrecognized_keys",
|
|
25553
|
+
input,
|
|
25554
|
+
inst,
|
|
25555
|
+
keys: unrecognized
|
|
25556
|
+
});
|
|
25557
|
+
} else {
|
|
25558
|
+
payload.value = {};
|
|
25559
|
+
for (const key of Reflect.ownKeys(input)){
|
|
25560
|
+
if ("__proto__" === key) continue;
|
|
25561
|
+
const keyResult = def.keyType._zod.run({
|
|
25562
|
+
value: key,
|
|
25563
|
+
issues: []
|
|
25564
|
+
}, ctx);
|
|
25565
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
25566
|
+
if (keyResult.issues.length) {
|
|
25567
|
+
payload.issues.push({
|
|
25568
|
+
code: "invalid_key",
|
|
25569
|
+
origin: "record",
|
|
25570
|
+
issues: keyResult.issues.map((iss)=>util_finalizeIssue(iss, ctx, core_core_config())),
|
|
25571
|
+
input: key,
|
|
25572
|
+
path: [
|
|
25573
|
+
key
|
|
25574
|
+
],
|
|
25575
|
+
inst
|
|
25576
|
+
});
|
|
25577
|
+
payload.value[keyResult.value] = keyResult.value;
|
|
25578
|
+
continue;
|
|
25579
|
+
}
|
|
25580
|
+
const result = def.valueType._zod.run({
|
|
25581
|
+
value: input[key],
|
|
25582
|
+
issues: []
|
|
25583
|
+
}, ctx);
|
|
25584
|
+
if (result instanceof Promise) proms.push(result.then((result)=>{
|
|
25585
|
+
if (result.issues.length) payload.issues.push(...util_prefixIssues(key, result.issues));
|
|
25586
|
+
payload.value[keyResult.value] = result.value;
|
|
25587
|
+
}));
|
|
25588
|
+
else {
|
|
25589
|
+
if (result.issues.length) payload.issues.push(...util_prefixIssues(key, result.issues));
|
|
25590
|
+
payload.value[keyResult.value] = result.value;
|
|
25591
|
+
}
|
|
25592
|
+
}
|
|
25593
|
+
}
|
|
25594
|
+
if (proms.length) return Promise.all(proms).then(()=>payload);
|
|
25595
|
+
return payload;
|
|
25596
|
+
};
|
|
25597
|
+
});
|
|
25509
25598
|
const schemas_$ZodEnum = /*@__PURE__*/ core_$constructor("$ZodEnum", (inst, def)=>{
|
|
25510
25599
|
schemas_$ZodType.init(inst, def);
|
|
25511
25600
|
const values = core_util_getEnumValues(def.entries);
|
|
@@ -26191,6 +26280,11 @@ var __webpack_exports__ = {};
|
|
|
26191
26280
|
...util_normalizeParams(params)
|
|
26192
26281
|
});
|
|
26193
26282
|
}
|
|
26283
|
+
function _any(Class) {
|
|
26284
|
+
return new Class({
|
|
26285
|
+
type: "any"
|
|
26286
|
+
});
|
|
26287
|
+
}
|
|
26194
26288
|
function api_unknown(Class) {
|
|
26195
26289
|
return new Class({
|
|
26196
26290
|
type: "unknown"
|
|
@@ -26717,6 +26811,13 @@ var __webpack_exports__ = {};
|
|
|
26717
26811
|
function classic_schemas_boolean(params) {
|
|
26718
26812
|
return api_boolean(schemas_ZodBoolean, params);
|
|
26719
26813
|
}
|
|
26814
|
+
const ZodAny = /*@__PURE__*/ core_$constructor("ZodAny", (inst, def)=>{
|
|
26815
|
+
$ZodAny.init(inst, def);
|
|
26816
|
+
schemas_ZodType.init(inst, def);
|
|
26817
|
+
});
|
|
26818
|
+
function any() {
|
|
26819
|
+
return _any(ZodAny);
|
|
26820
|
+
}
|
|
26720
26821
|
const schemas_ZodUnknown = /*@__PURE__*/ core_$constructor("ZodUnknown", (inst, def)=>{
|
|
26721
26822
|
schemas_$ZodUnknown.init(inst, def);
|
|
26722
26823
|
schemas_ZodType.init(inst, def);
|
|
@@ -26808,6 +26909,20 @@ var __webpack_exports__ = {};
|
|
|
26808
26909
|
right: right
|
|
26809
26910
|
});
|
|
26810
26911
|
}
|
|
26912
|
+
const ZodRecord = /*@__PURE__*/ core_$constructor("ZodRecord", (inst, def)=>{
|
|
26913
|
+
$ZodRecord.init(inst, def);
|
|
26914
|
+
schemas_ZodType.init(inst, def);
|
|
26915
|
+
inst.keyType = def.keyType;
|
|
26916
|
+
inst.valueType = def.valueType;
|
|
26917
|
+
});
|
|
26918
|
+
function record(keyType, valueType, params) {
|
|
26919
|
+
return new ZodRecord({
|
|
26920
|
+
type: "record",
|
|
26921
|
+
keyType,
|
|
26922
|
+
valueType: valueType,
|
|
26923
|
+
...util_normalizeParams(params)
|
|
26924
|
+
});
|
|
26925
|
+
}
|
|
26811
26926
|
const schemas_ZodEnum = /*@__PURE__*/ core_$constructor("ZodEnum", (inst, def)=>{
|
|
26812
26927
|
schemas_$ZodEnum.init(inst, def);
|
|
26813
26928
|
schemas_ZodType.init(inst, def);
|
|
@@ -27043,6 +27158,11 @@ var __webpack_exports__ = {};
|
|
|
27043
27158
|
ExecutionState["FAILED"] = "FAILED";
|
|
27044
27159
|
return ExecutionState;
|
|
27045
27160
|
}({});
|
|
27161
|
+
const types_errorResponse = (message, code = 500)=>({
|
|
27162
|
+
code,
|
|
27163
|
+
message,
|
|
27164
|
+
data: null
|
|
27165
|
+
});
|
|
27046
27166
|
const rpa_server_scanRetryMaxCount = 60;
|
|
27047
27167
|
const rpa_server_waitQrcodeResultMaxTime = 2000 * rpa_server_scanRetryMaxCount;
|
|
27048
27168
|
const rpaServer = async (task, _params)=>{
|
|
@@ -27511,6 +27631,27 @@ var __webpack_exports__ = {};
|
|
|
27511
27631
|
retryDelay: 500,
|
|
27512
27632
|
timeout: 6000
|
|
27513
27633
|
});
|
|
27634
|
+
const isSuccess = 0 === res.errno;
|
|
27635
|
+
const data = res?.ret?.article_id;
|
|
27636
|
+
const message = isSuccess ? isDraft ? "文章同步成功!" : `文章发布成功!${res.proxyInfo || ""}` : res.errmsg || (isDraft ? "文章同步失败,请稍后重试。" : "文章发布失败,请稍后重试。");
|
|
27637
|
+
const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
|
|
27638
|
+
if (!isSuccess) {
|
|
27639
|
+
await updateTaskState?.({
|
|
27640
|
+
state: types_TaskState.FAILED,
|
|
27641
|
+
error: message
|
|
27642
|
+
});
|
|
27643
|
+
return {
|
|
27644
|
+
code: 414,
|
|
27645
|
+
data,
|
|
27646
|
+
message
|
|
27647
|
+
};
|
|
27648
|
+
}
|
|
27649
|
+
await updateTaskState?.({
|
|
27650
|
+
state: types_TaskState.SUCCESS,
|
|
27651
|
+
result: {
|
|
27652
|
+
response: data
|
|
27653
|
+
}
|
|
27654
|
+
});
|
|
27514
27655
|
return success(0 === res.errno ? res?.ret?.article_id || "" : "", 0 === res.errno ? `文章发布成功!${http.proxyInfo || ""}` : res.errmsg ?? "文章发布失败,请稍后重试。");
|
|
27515
27656
|
};
|
|
27516
27657
|
const rpa_rpaAction = async (task, params)=>{
|
|
@@ -27711,6 +27852,47 @@ var __webpack_exports__ = {};
|
|
|
27711
27852
|
await page.close();
|
|
27712
27853
|
return success(articleId, articleId ? "发布成功" : message);
|
|
27713
27854
|
};
|
|
27855
|
+
const BaijiahaoPublishParamsSchema = ActionCommonParamsSchema.extend({
|
|
27856
|
+
saveType: classic_schemas_enum([
|
|
27857
|
+
"draft",
|
|
27858
|
+
"publish"
|
|
27859
|
+
]),
|
|
27860
|
+
token: classic_schemas_string(),
|
|
27861
|
+
title: classic_schemas_string(),
|
|
27862
|
+
content: classic_schemas_string(),
|
|
27863
|
+
proxyLoc: classic_schemas_string().optional(),
|
|
27864
|
+
localIP: classic_schemas_string().optional(),
|
|
27865
|
+
huiwenToken: classic_schemas_string().optional(),
|
|
27866
|
+
settingInfo: classic_schemas_object({
|
|
27867
|
+
baijiahaoTitle: classic_schemas_string(),
|
|
27868
|
+
baijiahaoCoverType: classic_schemas_enum([
|
|
27869
|
+
"single",
|
|
27870
|
+
"multiple"
|
|
27871
|
+
]),
|
|
27872
|
+
baijiahaoAbstract: classic_schemas_string(),
|
|
27873
|
+
baijiahaoIsAi: classic_schemas_array(classic_schemas_string()),
|
|
27874
|
+
baijiahaoSingleCover: classic_schemas_string(),
|
|
27875
|
+
baijiahaoMultCover: classic_schemas_array(classic_schemas_string()),
|
|
27876
|
+
baijiahaoVerticalCover: classic_schemas_string().optional(),
|
|
27877
|
+
baijiahaoActivity: classic_schemas_array(classic_schemas_object({
|
|
27878
|
+
id: classic_schemas_string(),
|
|
27879
|
+
task_name: classic_schemas_string()
|
|
27880
|
+
}).catchall(any())),
|
|
27881
|
+
baijiahaoPublishConf: classic_schemas_array(classic_schemas_object({
|
|
27882
|
+
confName: classic_schemas_string(),
|
|
27883
|
+
isChecked: classic_schemas_boolean()
|
|
27884
|
+
})).optional(),
|
|
27885
|
+
baijiahaoTopic: record(classic_schemas_string(), any()).optional(),
|
|
27886
|
+
baijiahaoCms: classic_schemas_array(classic_schemas_string()).optional(),
|
|
27887
|
+
baijiahaoEventSpec: classic_schemas_object({
|
|
27888
|
+
time: classic_schemas_string(),
|
|
27889
|
+
pos: classic_schemas_string()
|
|
27890
|
+
}).partial().optional(),
|
|
27891
|
+
baijiahaoEvent2News: classic_schemas_boolean(),
|
|
27892
|
+
baijiahaoSelectActivityCache: classic_schemas_array(classic_schemas_string()),
|
|
27893
|
+
timer: classic_schemas_number().optional()
|
|
27894
|
+
})
|
|
27895
|
+
});
|
|
27714
27896
|
const baijiahaoPublish = async (task, params)=>{
|
|
27715
27897
|
params.content = formatSectionHtml(params.content);
|
|
27716
27898
|
if ("rpa" === params.actionType) return rpa_rpaAction(task, params);
|
|
@@ -29386,49 +29568,6 @@ var __webpack_exports__ = {};
|
|
|
29386
29568
|
const message = `获取未读消息数${isSuccess ? "成功" : `失败,原因:${res.msg}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
29387
29569
|
return success(unreadCount, message);
|
|
29388
29570
|
};
|
|
29389
|
-
const ttConfigDataSchema = classic_schemas_object({
|
|
29390
|
-
fansNum: classic_schemas_number(),
|
|
29391
|
-
fansNumYesterday: classic_schemas_number().nullable(),
|
|
29392
|
-
readNum: classic_schemas_number(),
|
|
29393
|
-
incomeNum: classic_schemas_number(),
|
|
29394
|
-
incomeNumYesterday: classic_schemas_number().nullable(),
|
|
29395
|
-
showNumYesterday: classic_schemas_number().nullable(),
|
|
29396
|
-
readNumYesterday: classic_schemas_number().nullable(),
|
|
29397
|
-
likeNumYesterday: classic_schemas_number().nullable(),
|
|
29398
|
-
commentNumYesterday: classic_schemas_number().nullable()
|
|
29399
|
-
});
|
|
29400
|
-
const xhsConfigDataSchema = classic_schemas_object({
|
|
29401
|
-
fansNum: classic_schemas_number(),
|
|
29402
|
-
favedNum: classic_schemas_number(),
|
|
29403
|
-
watchNumLastWeek: classic_schemas_number(),
|
|
29404
|
-
likeNumLastWeek: classic_schemas_number(),
|
|
29405
|
-
collectNumLastWeek: classic_schemas_number(),
|
|
29406
|
-
commentNumLastWeek: classic_schemas_number(),
|
|
29407
|
-
fansNumLastWeek: classic_schemas_number(),
|
|
29408
|
-
fansNumYesterday: classic_schemas_number()
|
|
29409
|
-
});
|
|
29410
|
-
const wxConfigDataSchema = classic_schemas_object({
|
|
29411
|
-
fansNum: classic_schemas_number(),
|
|
29412
|
-
fansNumYesterday: classic_schemas_number(),
|
|
29413
|
-
readNumYesterday: classic_schemas_number(),
|
|
29414
|
-
shareNumYesterday: classic_schemas_number()
|
|
29415
|
-
});
|
|
29416
|
-
const bjhConfigDataSchema = classic_schemas_object({
|
|
29417
|
-
fansNum: classic_schemas_number(),
|
|
29418
|
-
fansNumYesterday: classic_schemas_number().nullable(),
|
|
29419
|
-
readNum: classic_schemas_number(),
|
|
29420
|
-
incomeNum: classic_schemas_number(),
|
|
29421
|
-
incomeNumYesterday: classic_schemas_number().nullable(),
|
|
29422
|
-
recommendNumYesterday: classic_schemas_number().nullable(),
|
|
29423
|
-
readNumYesterday: classic_schemas_number().nullable(),
|
|
29424
|
-
likeNumYesterday: classic_schemas_number().nullable(),
|
|
29425
|
-
commentNumYesterday: classic_schemas_number().nullable()
|
|
29426
|
-
});
|
|
29427
|
-
const types_errorResponse = (message, code = 500)=>({
|
|
29428
|
-
code,
|
|
29429
|
-
message,
|
|
29430
|
-
data: null
|
|
29431
|
-
});
|
|
29432
29571
|
async function getBaijiahaoData(_task, params) {
|
|
29433
29572
|
const { token } = params;
|
|
29434
29573
|
if (!token) return types_errorResponse("缺少token", 414);
|
|
@@ -31342,6 +31481,27 @@ var __webpack_exports__ = {};
|
|
|
31342
31481
|
retryDelay: 500,
|
|
31343
31482
|
timeout: 12000
|
|
31344
31483
|
});
|
|
31484
|
+
const isSuccess = 0 === publishResult.code;
|
|
31485
|
+
const data = publishResult.data?.pgc_id;
|
|
31486
|
+
const message = publishResult.message || (isSuccess ? "文章发布成功!" : "文章发布失败,未知错误。");
|
|
31487
|
+
const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
|
|
31488
|
+
if (!isSuccess) {
|
|
31489
|
+
await updateTaskState?.({
|
|
31490
|
+
state: types_TaskState.FAILED,
|
|
31491
|
+
error: message
|
|
31492
|
+
});
|
|
31493
|
+
return {
|
|
31494
|
+
code: 414,
|
|
31495
|
+
data,
|
|
31496
|
+
message
|
|
31497
|
+
};
|
|
31498
|
+
}
|
|
31499
|
+
await updateTaskState?.({
|
|
31500
|
+
state: types_TaskState.SUCCESS,
|
|
31501
|
+
result: {
|
|
31502
|
+
response: data
|
|
31503
|
+
}
|
|
31504
|
+
});
|
|
31345
31505
|
return success(publishResult.data.pgc_id, `文章发布成功!${task.debug ? ` ${http.proxyInfo}` : ""}`);
|
|
31346
31506
|
};
|
|
31347
31507
|
const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
|
|
@@ -31569,6 +31729,60 @@ var __webpack_exports__ = {};
|
|
|
31569
31729
|
await page.close();
|
|
31570
31730
|
return success(articleId, "publish" === params.saveType ? "发布成功" : "保存草稿成功");
|
|
31571
31731
|
};
|
|
31732
|
+
const ToutiaoPublishParamsSchema = ActionCommonParamsSchema.extend({
|
|
31733
|
+
saveType: schemas_union([
|
|
31734
|
+
literal("draft"),
|
|
31735
|
+
literal("publish")
|
|
31736
|
+
]),
|
|
31737
|
+
title: classic_schemas_string(),
|
|
31738
|
+
content: classic_schemas_string(),
|
|
31739
|
+
proxyLoc: classic_schemas_string().optional(),
|
|
31740
|
+
localIP: classic_schemas_string().optional(),
|
|
31741
|
+
huiwenToken: classic_schemas_string().optional(),
|
|
31742
|
+
settingInfo: classic_schemas_object({
|
|
31743
|
+
toutiaoCoverType: schemas_union([
|
|
31744
|
+
literal("single"),
|
|
31745
|
+
literal("multiple"),
|
|
31746
|
+
literal("no")
|
|
31747
|
+
]),
|
|
31748
|
+
toutiaoTitleType: schemas_union([
|
|
31749
|
+
literal("single"),
|
|
31750
|
+
literal("multiple")
|
|
31751
|
+
]),
|
|
31752
|
+
toutiaoSingleCover: classic_schemas_string(),
|
|
31753
|
+
toutiaoMultCover: classic_schemas_array(classic_schemas_string()),
|
|
31754
|
+
toutiaoAd: classic_schemas_string(),
|
|
31755
|
+
toutiaoOriginal: classic_schemas_string().optional(),
|
|
31756
|
+
toutiaoExclusive: classic_schemas_number().optional(),
|
|
31757
|
+
toutiaoCollectionId: classic_schemas_string().optional(),
|
|
31758
|
+
toutiaoTransWtt: classic_schemas_boolean().optional(),
|
|
31759
|
+
toutiaoClaim: classic_schemas_object({
|
|
31760
|
+
type: classic_schemas_number(),
|
|
31761
|
+
source_author_uid: classic_schemas_string().optional(),
|
|
31762
|
+
source_author_name: classic_schemas_string().optional(),
|
|
31763
|
+
time_format: classic_schemas_string().optional(),
|
|
31764
|
+
position: classic_schemas_object({
|
|
31765
|
+
position: classic_schemas_string(),
|
|
31766
|
+
city: classic_schemas_string(),
|
|
31767
|
+
longitude: classic_schemas_number(),
|
|
31768
|
+
latitude: classic_schemas_number(),
|
|
31769
|
+
type_code: classic_schemas_string(),
|
|
31770
|
+
poi_id: classic_schemas_string()
|
|
31771
|
+
}).optional()
|
|
31772
|
+
}).optional(),
|
|
31773
|
+
toutiaoLocation: classic_schemas_object({
|
|
31774
|
+
label: classic_schemas_string(),
|
|
31775
|
+
value: classic_schemas_string()
|
|
31776
|
+
}).passthrough().optional(),
|
|
31777
|
+
toutiaoTopic: classic_schemas_array(classic_schemas_object({
|
|
31778
|
+
id: classic_schemas_string(),
|
|
31779
|
+
word: classic_schemas_string()
|
|
31780
|
+
})),
|
|
31781
|
+
cntWord: classic_schemas_number(),
|
|
31782
|
+
subTitles: classic_schemas_array(classic_schemas_string()),
|
|
31783
|
+
timer: classic_schemas_number().optional()
|
|
31784
|
+
})
|
|
31785
|
+
});
|
|
31572
31786
|
const COVER_TYPE = {
|
|
31573
31787
|
no: 1,
|
|
31574
31788
|
single: 2,
|
|
@@ -32949,7 +33163,18 @@ var __webpack_exports__ = {};
|
|
|
32949
33163
|
const qrcodeBuffer = Buffer.from(qrcodeResult);
|
|
32950
33164
|
const qrcodeFilePath = external_node_path_default().join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
|
|
32951
33165
|
external_node_fs_default().writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
|
|
32952
|
-
|
|
33166
|
+
const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
|
|
33167
|
+
if (params.safeQrcodeCallback) params.safeQrcodeCallback?.(qrcodeFilePath);
|
|
33168
|
+
else {
|
|
33169
|
+
const data = `data:image/jpeg;base64,${Buffer.from(qrcodeResult).toString("base64")}`;
|
|
33170
|
+
await reporter(10041, "请扫码确认发布!", data);
|
|
33171
|
+
await updateTaskState?.({
|
|
33172
|
+
state: types_TaskState.WAIT_SCAN,
|
|
33173
|
+
result: {
|
|
33174
|
+
qrImg: data
|
|
33175
|
+
}
|
|
33176
|
+
});
|
|
33177
|
+
}
|
|
32953
33178
|
let code = "";
|
|
32954
33179
|
for(let i = 0; i < utils_scanRetryMaxCount; i++){
|
|
32955
33180
|
await sleep(2000);
|
|
@@ -32977,11 +33202,18 @@ var __webpack_exports__ = {};
|
|
|
32977
33202
|
code = checkScanResult.code;
|
|
32978
33203
|
break;
|
|
32979
33204
|
}
|
|
32980
|
-
if (i === utils_scanRetryMaxCount - 1)
|
|
32981
|
-
|
|
32982
|
-
|
|
32983
|
-
|
|
32984
|
-
|
|
33205
|
+
if (i === utils_scanRetryMaxCount - 1) {
|
|
33206
|
+
const message = "二维码已过期,请重试发布。";
|
|
33207
|
+
await updateTaskState?.({
|
|
33208
|
+
state: types_TaskState.FAILED,
|
|
33209
|
+
error: message
|
|
33210
|
+
});
|
|
33211
|
+
return {
|
|
33212
|
+
code: 414,
|
|
33213
|
+
message,
|
|
33214
|
+
data: ""
|
|
33215
|
+
};
|
|
33216
|
+
}
|
|
32985
33217
|
}
|
|
32986
33218
|
if (!params.masssend) await http.api({
|
|
32987
33219
|
method: "post",
|
|
@@ -33055,6 +33287,12 @@ var __webpack_exports__ = {};
|
|
|
33055
33287
|
retryDelay: 500,
|
|
33056
33288
|
timeout: 12000
|
|
33057
33289
|
});
|
|
33290
|
+
await updateTaskState?.({
|
|
33291
|
+
state: types_TaskState.SUCCESS,
|
|
33292
|
+
result: {
|
|
33293
|
+
response: appMsgId
|
|
33294
|
+
}
|
|
33295
|
+
});
|
|
33058
33296
|
return success(appMsgId, `微信公众号发布完成!${task.debug ? ` ${http.proxyInfo}` : ""}`);
|
|
33059
33297
|
};
|
|
33060
33298
|
const weixinPublish_rpa_waitQrcodeResultMaxTime = 2000 * utils_scanRetryMaxCount;
|
|
@@ -33492,9 +33730,66 @@ var __webpack_exports__ = {};
|
|
|
33492
33730
|
await page.close();
|
|
33493
33731
|
return success(articleId);
|
|
33494
33732
|
};
|
|
33733
|
+
const WxInteractionSchema = classic_schemas_object({
|
|
33734
|
+
Type: classic_schemas_enum([
|
|
33735
|
+
"public",
|
|
33736
|
+
"private",
|
|
33737
|
+
"off"
|
|
33738
|
+
]),
|
|
33739
|
+
Option: classic_schemas_object({
|
|
33740
|
+
Comment: classic_schemas_enum([
|
|
33741
|
+
"已关注7天及以上的用户",
|
|
33742
|
+
"已关注的用户",
|
|
33743
|
+
"所有用户"
|
|
33744
|
+
]),
|
|
33745
|
+
reply: classic_schemas_enum([
|
|
33746
|
+
"已关注7天及以上的用户",
|
|
33747
|
+
"已关注的用户",
|
|
33748
|
+
"所有用户"
|
|
33749
|
+
]),
|
|
33750
|
+
elect_comment: classic_schemas_boolean(),
|
|
33751
|
+
elect_reply: classic_schemas_boolean()
|
|
33752
|
+
}).optional()
|
|
33753
|
+
});
|
|
33754
|
+
const WeixinPublishParamsSchema = ActionCommonParamsSchema.extend({
|
|
33755
|
+
saveType: classic_schemas_enum([
|
|
33756
|
+
"draft",
|
|
33757
|
+
"publish"
|
|
33758
|
+
]),
|
|
33759
|
+
masssend: classic_schemas_boolean().optional(),
|
|
33760
|
+
token: schemas_union([
|
|
33761
|
+
classic_schemas_string(),
|
|
33762
|
+
classic_schemas_number()
|
|
33763
|
+
]),
|
|
33764
|
+
title: classic_schemas_string(),
|
|
33765
|
+
content: classic_schemas_string(),
|
|
33766
|
+
uuid: classic_schemas_string().optional(),
|
|
33767
|
+
appMsgId: classic_schemas_string().optional(),
|
|
33768
|
+
operation_seq: classic_schemas_string().optional(),
|
|
33769
|
+
proxyLoc: classic_schemas_string().optional(),
|
|
33770
|
+
localIP: classic_schemas_string().optional(),
|
|
33771
|
+
huiwenToken: classic_schemas_string().optional(),
|
|
33772
|
+
settingInfo: classic_schemas_object({
|
|
33773
|
+
wxCover: classic_schemas_string(),
|
|
33774
|
+
wxAuthor: classic_schemas_string().optional(),
|
|
33775
|
+
wxAbstract: classic_schemas_string().optional(),
|
|
33776
|
+
wxOriginalText: classic_schemas_string().optional(),
|
|
33777
|
+
wxCopyright: classic_schemas_boolean().optional(),
|
|
33778
|
+
wxWhitelist: classic_schemas_array(classic_schemas_string()).optional(),
|
|
33779
|
+
wxRewardTarget: record(classic_schemas_string(), classic_schemas_string()).optional(),
|
|
33780
|
+
wxRewardText: classic_schemas_string().optional(),
|
|
33781
|
+
wxQuickReprint: classic_schemas_boolean().optional(),
|
|
33782
|
+
wxNotAllowRecommend: classic_schemas_boolean().optional(),
|
|
33783
|
+
wxCreationSource: classic_schemas_array(classic_schemas_string()).optional(),
|
|
33784
|
+
wxInteraction: WxInteractionSchema.optional(),
|
|
33785
|
+
timer: classic_schemas_number().optional(),
|
|
33786
|
+
wxTopic: classic_schemas_array(classic_schemas_string()).optional(),
|
|
33787
|
+
wxCollectionInfo: any().optional()
|
|
33788
|
+
})
|
|
33789
|
+
});
|
|
33495
33790
|
const weixinPublish = async (task, _params)=>{
|
|
33496
33791
|
const params = defaultParams(_params, {
|
|
33497
|
-
masssend:
|
|
33792
|
+
masssend: false
|
|
33498
33793
|
});
|
|
33499
33794
|
params.content = formatSectionHtml(params.content);
|
|
33500
33795
|
if ("rpa" === params.actionType) return weixinPublish_rpa_rpaAction(task, params);
|
|
@@ -34070,7 +34365,8 @@ var __webpack_exports__ = {};
|
|
|
34070
34365
|
retryDelay: 20,
|
|
34071
34366
|
timeout: 3000
|
|
34072
34367
|
});
|
|
34073
|
-
|
|
34368
|
+
if (!createTopic?.data) throw types_errorResponse("话题创建失败,请检查话题字段!", 414);
|
|
34369
|
+
Object.assign(topic, createTopic?.data?.topic_infos[0]);
|
|
34074
34370
|
}
|
|
34075
34371
|
}));
|
|
34076
34372
|
const visibleRangeMap = {
|
|
@@ -34802,12 +35098,6 @@ var __webpack_exports__ = {};
|
|
|
34802
35098
|
response: response?.data?.id || ""
|
|
34803
35099
|
}
|
|
34804
35100
|
});
|
|
34805
|
-
await updateTaskState?.({
|
|
34806
|
-
state: types_TaskState.SUCCESS,
|
|
34807
|
-
result: {
|
|
34808
|
-
response: "123456789"
|
|
34809
|
-
}
|
|
34810
|
-
});
|
|
34811
35101
|
await page.close();
|
|
34812
35102
|
return success(response?.data?.id || "");
|
|
34813
35103
|
};
|
|
@@ -35762,7 +36052,45 @@ var __webpack_exports__ = {};
|
|
|
35762
36052
|
const data = isSuccess ? res.data : {};
|
|
35763
36053
|
return utils_response(isSuccess ? 0 : 414, message, data);
|
|
35764
36054
|
};
|
|
35765
|
-
var package_namespaceObject = JSON.parse('{"i8":"1.2.30-beta.
|
|
36055
|
+
var package_namespaceObject = JSON.parse('{"i8":"1.2.30-beta.4"}');
|
|
36056
|
+
const ttConfigDataSchema = classic_schemas_object({
|
|
36057
|
+
fansNum: classic_schemas_number(),
|
|
36058
|
+
fansNumYesterday: classic_schemas_number().nullable(),
|
|
36059
|
+
readNum: classic_schemas_number(),
|
|
36060
|
+
incomeNum: classic_schemas_number(),
|
|
36061
|
+
incomeNumYesterday: classic_schemas_number().nullable(),
|
|
36062
|
+
showNumYesterday: classic_schemas_number().nullable(),
|
|
36063
|
+
readNumYesterday: classic_schemas_number().nullable(),
|
|
36064
|
+
likeNumYesterday: classic_schemas_number().nullable(),
|
|
36065
|
+
commentNumYesterday: classic_schemas_number().nullable()
|
|
36066
|
+
});
|
|
36067
|
+
const xhsConfigDataSchema = classic_schemas_object({
|
|
36068
|
+
fansNum: classic_schemas_number(),
|
|
36069
|
+
favedNum: classic_schemas_number(),
|
|
36070
|
+
watchNumLastWeek: classic_schemas_number(),
|
|
36071
|
+
likeNumLastWeek: classic_schemas_number(),
|
|
36072
|
+
collectNumLastWeek: classic_schemas_number(),
|
|
36073
|
+
commentNumLastWeek: classic_schemas_number(),
|
|
36074
|
+
fansNumLastWeek: classic_schemas_number(),
|
|
36075
|
+
fansNumYesterday: classic_schemas_number()
|
|
36076
|
+
});
|
|
36077
|
+
const wxConfigDataSchema = classic_schemas_object({
|
|
36078
|
+
fansNum: classic_schemas_number(),
|
|
36079
|
+
fansNumYesterday: classic_schemas_number(),
|
|
36080
|
+
readNumYesterday: classic_schemas_number(),
|
|
36081
|
+
shareNumYesterday: classic_schemas_number()
|
|
36082
|
+
});
|
|
36083
|
+
const bjhConfigDataSchema = classic_schemas_object({
|
|
36084
|
+
fansNum: classic_schemas_number(),
|
|
36085
|
+
fansNumYesterday: classic_schemas_number().nullable(),
|
|
36086
|
+
readNum: classic_schemas_number(),
|
|
36087
|
+
incomeNum: classic_schemas_number(),
|
|
36088
|
+
incomeNumYesterday: classic_schemas_number().nullable(),
|
|
36089
|
+
recommendNumYesterday: classic_schemas_number().nullable(),
|
|
36090
|
+
readNumYesterday: classic_schemas_number().nullable(),
|
|
36091
|
+
likeNumYesterday: classic_schemas_number().nullable(),
|
|
36092
|
+
commentNumYesterday: classic_schemas_number().nullable()
|
|
36093
|
+
});
|
|
35766
36094
|
const BetaFlag = "HuiwenCanary";
|
|
35767
36095
|
class Action {
|
|
35768
36096
|
constructor(task){
|