@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/index.mjs
CHANGED
|
@@ -4354,7 +4354,6 @@ class Http {
|
|
|
4354
4354
|
return response;
|
|
4355
4355
|
}, (error)=>{
|
|
4356
4356
|
const foundError = findError(error.response);
|
|
4357
|
-
console.log(error);
|
|
4358
4357
|
const errorResponse = {
|
|
4359
4358
|
code: error.response?.status || 500,
|
|
4360
4359
|
message: error.message || "",
|
|
@@ -6357,6 +6356,10 @@ const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def)=>{
|
|
|
6357
6356
|
return payload;
|
|
6358
6357
|
};
|
|
6359
6358
|
});
|
|
6359
|
+
const $ZodAny = /*@__PURE__*/ $constructor("$ZodAny", (inst, def)=>{
|
|
6360
|
+
$ZodType.init(inst, def);
|
|
6361
|
+
inst._zod.parse = (payload)=>payload;
|
|
6362
|
+
});
|
|
6360
6363
|
const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def)=>{
|
|
6361
6364
|
$ZodType.init(inst, def);
|
|
6362
6365
|
inst._zod.parse = (payload)=>payload;
|
|
@@ -6731,6 +6734,89 @@ function handleIntersectionResults(result, left, right) {
|
|
|
6731
6734
|
result.value = merged.data;
|
|
6732
6735
|
return result;
|
|
6733
6736
|
}
|
|
6737
|
+
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def)=>{
|
|
6738
|
+
$ZodType.init(inst, def);
|
|
6739
|
+
inst._zod.parse = (payload, ctx)=>{
|
|
6740
|
+
const input = payload.value;
|
|
6741
|
+
if (!isPlainObject(input)) {
|
|
6742
|
+
payload.issues.push({
|
|
6743
|
+
expected: "record",
|
|
6744
|
+
code: "invalid_type",
|
|
6745
|
+
input,
|
|
6746
|
+
inst
|
|
6747
|
+
});
|
|
6748
|
+
return payload;
|
|
6749
|
+
}
|
|
6750
|
+
const proms = [];
|
|
6751
|
+
if (def.keyType._zod.values) {
|
|
6752
|
+
const values = def.keyType._zod.values;
|
|
6753
|
+
payload.value = {};
|
|
6754
|
+
for (const key of values)if ("string" == typeof key || "number" == typeof key || "symbol" == typeof key) {
|
|
6755
|
+
const result = def.valueType._zod.run({
|
|
6756
|
+
value: input[key],
|
|
6757
|
+
issues: []
|
|
6758
|
+
}, ctx);
|
|
6759
|
+
if (result instanceof Promise) proms.push(result.then((result)=>{
|
|
6760
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
6761
|
+
payload.value[key] = result.value;
|
|
6762
|
+
}));
|
|
6763
|
+
else {
|
|
6764
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
6765
|
+
payload.value[key] = result.value;
|
|
6766
|
+
}
|
|
6767
|
+
}
|
|
6768
|
+
let unrecognized;
|
|
6769
|
+
for(const key in input)if (!values.has(key)) {
|
|
6770
|
+
unrecognized = unrecognized ?? [];
|
|
6771
|
+
unrecognized.push(key);
|
|
6772
|
+
}
|
|
6773
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
6774
|
+
code: "unrecognized_keys",
|
|
6775
|
+
input,
|
|
6776
|
+
inst,
|
|
6777
|
+
keys: unrecognized
|
|
6778
|
+
});
|
|
6779
|
+
} else {
|
|
6780
|
+
payload.value = {};
|
|
6781
|
+
for (const key of Reflect.ownKeys(input)){
|
|
6782
|
+
if ("__proto__" === key) continue;
|
|
6783
|
+
const keyResult = def.keyType._zod.run({
|
|
6784
|
+
value: key,
|
|
6785
|
+
issues: []
|
|
6786
|
+
}, ctx);
|
|
6787
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
6788
|
+
if (keyResult.issues.length) {
|
|
6789
|
+
payload.issues.push({
|
|
6790
|
+
code: "invalid_key",
|
|
6791
|
+
origin: "record",
|
|
6792
|
+
issues: keyResult.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())),
|
|
6793
|
+
input: key,
|
|
6794
|
+
path: [
|
|
6795
|
+
key
|
|
6796
|
+
],
|
|
6797
|
+
inst
|
|
6798
|
+
});
|
|
6799
|
+
payload.value[keyResult.value] = keyResult.value;
|
|
6800
|
+
continue;
|
|
6801
|
+
}
|
|
6802
|
+
const result = def.valueType._zod.run({
|
|
6803
|
+
value: input[key],
|
|
6804
|
+
issues: []
|
|
6805
|
+
}, ctx);
|
|
6806
|
+
if (result instanceof Promise) proms.push(result.then((result)=>{
|
|
6807
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
6808
|
+
payload.value[keyResult.value] = result.value;
|
|
6809
|
+
}));
|
|
6810
|
+
else {
|
|
6811
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
6812
|
+
payload.value[keyResult.value] = result.value;
|
|
6813
|
+
}
|
|
6814
|
+
}
|
|
6815
|
+
}
|
|
6816
|
+
if (proms.length) return Promise.all(proms).then(()=>payload);
|
|
6817
|
+
return payload;
|
|
6818
|
+
};
|
|
6819
|
+
});
|
|
6734
6820
|
const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def)=>{
|
|
6735
6821
|
$ZodType.init(inst, def);
|
|
6736
6822
|
const values = util_getEnumValues(def.entries);
|
|
@@ -7416,6 +7502,11 @@ function _boolean(Class, params) {
|
|
|
7416
7502
|
...normalizeParams(params)
|
|
7417
7503
|
});
|
|
7418
7504
|
}
|
|
7505
|
+
function _any(Class) {
|
|
7506
|
+
return new Class({
|
|
7507
|
+
type: "any"
|
|
7508
|
+
});
|
|
7509
|
+
}
|
|
7419
7510
|
function _unknown(Class) {
|
|
7420
7511
|
return new Class({
|
|
7421
7512
|
type: "unknown"
|
|
@@ -7942,6 +8033,13 @@ const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def)=>{
|
|
|
7942
8033
|
function schemas_boolean(params) {
|
|
7943
8034
|
return _boolean(ZodBoolean, params);
|
|
7944
8035
|
}
|
|
8036
|
+
const ZodAny = /*@__PURE__*/ $constructor("ZodAny", (inst, def)=>{
|
|
8037
|
+
$ZodAny.init(inst, def);
|
|
8038
|
+
ZodType.init(inst, def);
|
|
8039
|
+
});
|
|
8040
|
+
function any() {
|
|
8041
|
+
return _any(ZodAny);
|
|
8042
|
+
}
|
|
7945
8043
|
const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def)=>{
|
|
7946
8044
|
$ZodUnknown.init(inst, def);
|
|
7947
8045
|
ZodType.init(inst, def);
|
|
@@ -8033,6 +8131,20 @@ function intersection(left, right) {
|
|
|
8033
8131
|
right: right
|
|
8034
8132
|
});
|
|
8035
8133
|
}
|
|
8134
|
+
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def)=>{
|
|
8135
|
+
$ZodRecord.init(inst, def);
|
|
8136
|
+
ZodType.init(inst, def);
|
|
8137
|
+
inst.keyType = def.keyType;
|
|
8138
|
+
inst.valueType = def.valueType;
|
|
8139
|
+
});
|
|
8140
|
+
function record(keyType, valueType, params) {
|
|
8141
|
+
return new ZodRecord({
|
|
8142
|
+
type: "record",
|
|
8143
|
+
keyType,
|
|
8144
|
+
valueType: valueType,
|
|
8145
|
+
...normalizeParams(params)
|
|
8146
|
+
});
|
|
8147
|
+
}
|
|
8036
8148
|
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def)=>{
|
|
8037
8149
|
$ZodEnum.init(inst, def);
|
|
8038
8150
|
ZodType.init(inst, def);
|
|
@@ -8268,6 +8380,11 @@ var types_ExecutionState = /*#__PURE__*/ function(ExecutionState) {
|
|
|
8268
8380
|
ExecutionState["FAILED"] = "FAILED";
|
|
8269
8381
|
return ExecutionState;
|
|
8270
8382
|
}({});
|
|
8383
|
+
const types_errorResponse = (message, code = 500)=>({
|
|
8384
|
+
code,
|
|
8385
|
+
message,
|
|
8386
|
+
data: null
|
|
8387
|
+
});
|
|
8271
8388
|
const rpa_server_scanRetryMaxCount = 60;
|
|
8272
8389
|
const rpa_server_waitQrcodeResultMaxTime = 2000 * rpa_server_scanRetryMaxCount;
|
|
8273
8390
|
const rpaServer = async (task, _params)=>{
|
|
@@ -8736,6 +8853,27 @@ const mockAction = async (task, params)=>{
|
|
|
8736
8853
|
retryDelay: 500,
|
|
8737
8854
|
timeout: 6000
|
|
8738
8855
|
});
|
|
8856
|
+
const isSuccess = 0 === res.errno;
|
|
8857
|
+
const data = res?.ret?.article_id;
|
|
8858
|
+
const message = isSuccess ? isDraft ? "文章同步成功!" : `文章发布成功!${res.proxyInfo || ""}` : res.errmsg || (isDraft ? "文章同步失败,请稍后重试。" : "文章发布失败,请稍后重试。");
|
|
8859
|
+
const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
|
|
8860
|
+
if (!isSuccess) {
|
|
8861
|
+
await updateTaskState?.({
|
|
8862
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
8863
|
+
error: message
|
|
8864
|
+
});
|
|
8865
|
+
return {
|
|
8866
|
+
code: 414,
|
|
8867
|
+
data,
|
|
8868
|
+
message
|
|
8869
|
+
};
|
|
8870
|
+
}
|
|
8871
|
+
await updateTaskState?.({
|
|
8872
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.SUCCESS,
|
|
8873
|
+
result: {
|
|
8874
|
+
response: data
|
|
8875
|
+
}
|
|
8876
|
+
});
|
|
8739
8877
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.errno ? res?.ret?.article_id || "" : "", 0 === res.errno ? `文章发布成功!${http.proxyInfo || ""}` : res.errmsg ?? "文章发布失败,请稍后重试。");
|
|
8740
8878
|
};
|
|
8741
8879
|
const rpa_rpaAction = async (task, params)=>{
|
|
@@ -8936,6 +9074,47 @@ const rpa_rpaAction = async (task, params)=>{
|
|
|
8936
9074
|
await page.close();
|
|
8937
9075
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(articleId, articleId ? "发布成功" : message);
|
|
8938
9076
|
};
|
|
9077
|
+
const BaijiahaoPublishParamsSchema = ActionCommonParamsSchema.extend({
|
|
9078
|
+
saveType: schemas_enum([
|
|
9079
|
+
"draft",
|
|
9080
|
+
"publish"
|
|
9081
|
+
]),
|
|
9082
|
+
token: schemas_string(),
|
|
9083
|
+
title: schemas_string(),
|
|
9084
|
+
content: schemas_string(),
|
|
9085
|
+
proxyLoc: schemas_string().optional(),
|
|
9086
|
+
localIP: schemas_string().optional(),
|
|
9087
|
+
huiwenToken: schemas_string().optional(),
|
|
9088
|
+
settingInfo: schemas_object({
|
|
9089
|
+
baijiahaoTitle: schemas_string(),
|
|
9090
|
+
baijiahaoCoverType: schemas_enum([
|
|
9091
|
+
"single",
|
|
9092
|
+
"multiple"
|
|
9093
|
+
]),
|
|
9094
|
+
baijiahaoAbstract: schemas_string(),
|
|
9095
|
+
baijiahaoIsAi: schemas_array(schemas_string()),
|
|
9096
|
+
baijiahaoSingleCover: schemas_string(),
|
|
9097
|
+
baijiahaoMultCover: schemas_array(schemas_string()),
|
|
9098
|
+
baijiahaoVerticalCover: schemas_string().optional(),
|
|
9099
|
+
baijiahaoActivity: schemas_array(schemas_object({
|
|
9100
|
+
id: schemas_string(),
|
|
9101
|
+
task_name: schemas_string()
|
|
9102
|
+
}).catchall(any())),
|
|
9103
|
+
baijiahaoPublishConf: schemas_array(schemas_object({
|
|
9104
|
+
confName: schemas_string(),
|
|
9105
|
+
isChecked: schemas_boolean()
|
|
9106
|
+
})).optional(),
|
|
9107
|
+
baijiahaoTopic: record(schemas_string(), any()).optional(),
|
|
9108
|
+
baijiahaoCms: schemas_array(schemas_string()).optional(),
|
|
9109
|
+
baijiahaoEventSpec: schemas_object({
|
|
9110
|
+
time: schemas_string(),
|
|
9111
|
+
pos: schemas_string()
|
|
9112
|
+
}).partial().optional(),
|
|
9113
|
+
baijiahaoEvent2News: schemas_boolean(),
|
|
9114
|
+
baijiahaoSelectActivityCache: schemas_array(schemas_string()),
|
|
9115
|
+
timer: schemas_number().optional()
|
|
9116
|
+
})
|
|
9117
|
+
});
|
|
8939
9118
|
const baijiahaoPublish = async (task, params)=>{
|
|
8940
9119
|
params.content = formatSectionHtml(params.content);
|
|
8941
9120
|
if ("rpa" === params.actionType) return rpa_rpaAction(task, params);
|
|
@@ -10611,49 +10790,6 @@ const getXhsUnreadCount = async (_task, params)=>{
|
|
|
10611
10790
|
const message = `获取未读消息数${isSuccess ? "成功" : `失败,原因:${res.msg}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
10612
10791
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(unreadCount, message);
|
|
10613
10792
|
};
|
|
10614
|
-
const ttConfigDataSchema = schemas_object({
|
|
10615
|
-
fansNum: schemas_number(),
|
|
10616
|
-
fansNumYesterday: schemas_number().nullable(),
|
|
10617
|
-
readNum: schemas_number(),
|
|
10618
|
-
incomeNum: schemas_number(),
|
|
10619
|
-
incomeNumYesterday: schemas_number().nullable(),
|
|
10620
|
-
showNumYesterday: schemas_number().nullable(),
|
|
10621
|
-
readNumYesterday: schemas_number().nullable(),
|
|
10622
|
-
likeNumYesterday: schemas_number().nullable(),
|
|
10623
|
-
commentNumYesterday: schemas_number().nullable()
|
|
10624
|
-
});
|
|
10625
|
-
const xhsConfigDataSchema = schemas_object({
|
|
10626
|
-
fansNum: schemas_number(),
|
|
10627
|
-
favedNum: schemas_number(),
|
|
10628
|
-
watchNumLastWeek: schemas_number(),
|
|
10629
|
-
likeNumLastWeek: schemas_number(),
|
|
10630
|
-
collectNumLastWeek: schemas_number(),
|
|
10631
|
-
commentNumLastWeek: schemas_number(),
|
|
10632
|
-
fansNumLastWeek: schemas_number(),
|
|
10633
|
-
fansNumYesterday: schemas_number()
|
|
10634
|
-
});
|
|
10635
|
-
const wxConfigDataSchema = schemas_object({
|
|
10636
|
-
fansNum: schemas_number(),
|
|
10637
|
-
fansNumYesterday: schemas_number(),
|
|
10638
|
-
readNumYesterday: schemas_number(),
|
|
10639
|
-
shareNumYesterday: schemas_number()
|
|
10640
|
-
});
|
|
10641
|
-
const bjhConfigDataSchema = schemas_object({
|
|
10642
|
-
fansNum: schemas_number(),
|
|
10643
|
-
fansNumYesterday: schemas_number().nullable(),
|
|
10644
|
-
readNum: schemas_number(),
|
|
10645
|
-
incomeNum: schemas_number(),
|
|
10646
|
-
incomeNumYesterday: schemas_number().nullable(),
|
|
10647
|
-
recommendNumYesterday: schemas_number().nullable(),
|
|
10648
|
-
readNumYesterday: schemas_number().nullable(),
|
|
10649
|
-
likeNumYesterday: schemas_number().nullable(),
|
|
10650
|
-
commentNumYesterday: schemas_number().nullable()
|
|
10651
|
-
});
|
|
10652
|
-
const types_errorResponse = (message, code = 500)=>({
|
|
10653
|
-
code,
|
|
10654
|
-
message,
|
|
10655
|
-
data: null
|
|
10656
|
-
});
|
|
10657
10793
|
async function getBaijiahaoData(_task, params) {
|
|
10658
10794
|
const { token } = params;
|
|
10659
10795
|
if (!token) return types_errorResponse("缺少token", 414);
|
|
@@ -12563,6 +12699,27 @@ const mock_mockAction = async (task, params)=>{
|
|
|
12563
12699
|
retryDelay: 500,
|
|
12564
12700
|
timeout: 12000
|
|
12565
12701
|
});
|
|
12702
|
+
const isSuccess = 0 === publishResult.code;
|
|
12703
|
+
const data = publishResult.data?.pgc_id;
|
|
12704
|
+
const message = publishResult.message || (isSuccess ? "文章发布成功!" : "文章发布失败,未知错误。");
|
|
12705
|
+
const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
|
|
12706
|
+
if (!isSuccess) {
|
|
12707
|
+
await updateTaskState?.({
|
|
12708
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
12709
|
+
error: message
|
|
12710
|
+
});
|
|
12711
|
+
return {
|
|
12712
|
+
code: 414,
|
|
12713
|
+
data,
|
|
12714
|
+
message
|
|
12715
|
+
};
|
|
12716
|
+
}
|
|
12717
|
+
await updateTaskState?.({
|
|
12718
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.SUCCESS,
|
|
12719
|
+
result: {
|
|
12720
|
+
response: data
|
|
12721
|
+
}
|
|
12722
|
+
});
|
|
12566
12723
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data.pgc_id, `文章发布成功!${task.debug ? ` ${http.proxyInfo}` : ""}`);
|
|
12567
12724
|
};
|
|
12568
12725
|
const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
|
|
@@ -12790,6 +12947,60 @@ const toutiaoPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
12790
12947
|
await page.close();
|
|
12791
12948
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(articleId, "publish" === params.saveType ? "发布成功" : "保存草稿成功");
|
|
12792
12949
|
};
|
|
12950
|
+
const ToutiaoPublishParamsSchema = ActionCommonParamsSchema.extend({
|
|
12951
|
+
saveType: union([
|
|
12952
|
+
literal("draft"),
|
|
12953
|
+
literal("publish")
|
|
12954
|
+
]),
|
|
12955
|
+
title: schemas_string(),
|
|
12956
|
+
content: schemas_string(),
|
|
12957
|
+
proxyLoc: schemas_string().optional(),
|
|
12958
|
+
localIP: schemas_string().optional(),
|
|
12959
|
+
huiwenToken: schemas_string().optional(),
|
|
12960
|
+
settingInfo: schemas_object({
|
|
12961
|
+
toutiaoCoverType: union([
|
|
12962
|
+
literal("single"),
|
|
12963
|
+
literal("multiple"),
|
|
12964
|
+
literal("no")
|
|
12965
|
+
]),
|
|
12966
|
+
toutiaoTitleType: union([
|
|
12967
|
+
literal("single"),
|
|
12968
|
+
literal("multiple")
|
|
12969
|
+
]),
|
|
12970
|
+
toutiaoSingleCover: schemas_string(),
|
|
12971
|
+
toutiaoMultCover: schemas_array(schemas_string()),
|
|
12972
|
+
toutiaoAd: schemas_string(),
|
|
12973
|
+
toutiaoOriginal: schemas_string().optional(),
|
|
12974
|
+
toutiaoExclusive: schemas_number().optional(),
|
|
12975
|
+
toutiaoCollectionId: schemas_string().optional(),
|
|
12976
|
+
toutiaoTransWtt: schemas_boolean().optional(),
|
|
12977
|
+
toutiaoClaim: schemas_object({
|
|
12978
|
+
type: schemas_number(),
|
|
12979
|
+
source_author_uid: schemas_string().optional(),
|
|
12980
|
+
source_author_name: schemas_string().optional(),
|
|
12981
|
+
time_format: schemas_string().optional(),
|
|
12982
|
+
position: schemas_object({
|
|
12983
|
+
position: schemas_string(),
|
|
12984
|
+
city: schemas_string(),
|
|
12985
|
+
longitude: schemas_number(),
|
|
12986
|
+
latitude: schemas_number(),
|
|
12987
|
+
type_code: schemas_string(),
|
|
12988
|
+
poi_id: schemas_string()
|
|
12989
|
+
}).optional()
|
|
12990
|
+
}).optional(),
|
|
12991
|
+
toutiaoLocation: schemas_object({
|
|
12992
|
+
label: schemas_string(),
|
|
12993
|
+
value: schemas_string()
|
|
12994
|
+
}).passthrough().optional(),
|
|
12995
|
+
toutiaoTopic: schemas_array(schemas_object({
|
|
12996
|
+
id: schemas_string(),
|
|
12997
|
+
word: schemas_string()
|
|
12998
|
+
})),
|
|
12999
|
+
cntWord: schemas_number(),
|
|
13000
|
+
subTitles: schemas_array(schemas_string()),
|
|
13001
|
+
timer: schemas_number().optional()
|
|
13002
|
+
})
|
|
13003
|
+
});
|
|
12793
13004
|
const COVER_TYPE = {
|
|
12794
13005
|
no: 1,
|
|
12795
13006
|
single: 2,
|
|
@@ -14170,7 +14381,18 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
14170
14381
|
const qrcodeBuffer = Buffer.from(qrcodeResult);
|
|
14171
14382
|
const qrcodeFilePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
|
|
14172
14383
|
__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
|
|
14173
|
-
|
|
14384
|
+
const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
|
|
14385
|
+
if (params.safeQrcodeCallback) params.safeQrcodeCallback?.(qrcodeFilePath);
|
|
14386
|
+
else {
|
|
14387
|
+
const data = `data:image/jpeg;base64,${Buffer.from(qrcodeResult).toString("base64")}`;
|
|
14388
|
+
await reporter(10041, "请扫码确认发布!", data);
|
|
14389
|
+
await updateTaskState?.({
|
|
14390
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.WAIT_SCAN,
|
|
14391
|
+
result: {
|
|
14392
|
+
qrImg: data
|
|
14393
|
+
}
|
|
14394
|
+
});
|
|
14395
|
+
}
|
|
14174
14396
|
let code = "";
|
|
14175
14397
|
for(let i = 0; i < utils_scanRetryMaxCount; i++){
|
|
14176
14398
|
await (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.sleep)(2000);
|
|
@@ -14198,11 +14420,18 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
14198
14420
|
code = checkScanResult.code;
|
|
14199
14421
|
break;
|
|
14200
14422
|
}
|
|
14201
|
-
if (i === utils_scanRetryMaxCount - 1)
|
|
14202
|
-
|
|
14203
|
-
|
|
14204
|
-
|
|
14205
|
-
|
|
14423
|
+
if (i === utils_scanRetryMaxCount - 1) {
|
|
14424
|
+
const message = "二维码已过期,请重试发布。";
|
|
14425
|
+
await updateTaskState?.({
|
|
14426
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
14427
|
+
error: message
|
|
14428
|
+
});
|
|
14429
|
+
return {
|
|
14430
|
+
code: 414,
|
|
14431
|
+
message,
|
|
14432
|
+
data: ""
|
|
14433
|
+
};
|
|
14434
|
+
}
|
|
14206
14435
|
}
|
|
14207
14436
|
if (!params.masssend) await http.api({
|
|
14208
14437
|
method: "post",
|
|
@@ -14276,6 +14505,12 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
14276
14505
|
retryDelay: 500,
|
|
14277
14506
|
timeout: 12000
|
|
14278
14507
|
});
|
|
14508
|
+
await updateTaskState?.({
|
|
14509
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.SUCCESS,
|
|
14510
|
+
result: {
|
|
14511
|
+
response: appMsgId
|
|
14512
|
+
}
|
|
14513
|
+
});
|
|
14279
14514
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(appMsgId, `微信公众号发布完成!${task.debug ? ` ${http.proxyInfo}` : ""}`);
|
|
14280
14515
|
};
|
|
14281
14516
|
const weixinPublish_rpa_waitQrcodeResultMaxTime = 2000 * utils_scanRetryMaxCount;
|
|
@@ -14713,9 +14948,66 @@ const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
14713
14948
|
await page.close();
|
|
14714
14949
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(articleId);
|
|
14715
14950
|
};
|
|
14951
|
+
const WxInteractionSchema = schemas_object({
|
|
14952
|
+
Type: schemas_enum([
|
|
14953
|
+
"public",
|
|
14954
|
+
"private",
|
|
14955
|
+
"off"
|
|
14956
|
+
]),
|
|
14957
|
+
Option: schemas_object({
|
|
14958
|
+
Comment: schemas_enum([
|
|
14959
|
+
"已关注7天及以上的用户",
|
|
14960
|
+
"已关注的用户",
|
|
14961
|
+
"所有用户"
|
|
14962
|
+
]),
|
|
14963
|
+
reply: schemas_enum([
|
|
14964
|
+
"已关注7天及以上的用户",
|
|
14965
|
+
"已关注的用户",
|
|
14966
|
+
"所有用户"
|
|
14967
|
+
]),
|
|
14968
|
+
elect_comment: schemas_boolean(),
|
|
14969
|
+
elect_reply: schemas_boolean()
|
|
14970
|
+
}).optional()
|
|
14971
|
+
});
|
|
14972
|
+
const WeixinPublishParamsSchema = ActionCommonParamsSchema.extend({
|
|
14973
|
+
saveType: schemas_enum([
|
|
14974
|
+
"draft",
|
|
14975
|
+
"publish"
|
|
14976
|
+
]),
|
|
14977
|
+
masssend: schemas_boolean().optional(),
|
|
14978
|
+
token: union([
|
|
14979
|
+
schemas_string(),
|
|
14980
|
+
schemas_number()
|
|
14981
|
+
]),
|
|
14982
|
+
title: schemas_string(),
|
|
14983
|
+
content: schemas_string(),
|
|
14984
|
+
uuid: schemas_string().optional(),
|
|
14985
|
+
appMsgId: schemas_string().optional(),
|
|
14986
|
+
operation_seq: schemas_string().optional(),
|
|
14987
|
+
proxyLoc: schemas_string().optional(),
|
|
14988
|
+
localIP: schemas_string().optional(),
|
|
14989
|
+
huiwenToken: schemas_string().optional(),
|
|
14990
|
+
settingInfo: schemas_object({
|
|
14991
|
+
wxCover: schemas_string(),
|
|
14992
|
+
wxAuthor: schemas_string().optional(),
|
|
14993
|
+
wxAbstract: schemas_string().optional(),
|
|
14994
|
+
wxOriginalText: schemas_string().optional(),
|
|
14995
|
+
wxCopyright: schemas_boolean().optional(),
|
|
14996
|
+
wxWhitelist: schemas_array(schemas_string()).optional(),
|
|
14997
|
+
wxRewardTarget: record(schemas_string(), schemas_string()).optional(),
|
|
14998
|
+
wxRewardText: schemas_string().optional(),
|
|
14999
|
+
wxQuickReprint: schemas_boolean().optional(),
|
|
15000
|
+
wxNotAllowRecommend: schemas_boolean().optional(),
|
|
15001
|
+
wxCreationSource: schemas_array(schemas_string()).optional(),
|
|
15002
|
+
wxInteraction: WxInteractionSchema.optional(),
|
|
15003
|
+
timer: schemas_number().optional(),
|
|
15004
|
+
wxTopic: schemas_array(schemas_string()).optional(),
|
|
15005
|
+
wxCollectionInfo: any().optional()
|
|
15006
|
+
})
|
|
15007
|
+
});
|
|
14716
15008
|
const weixinPublish = async (task, _params)=>{
|
|
14717
15009
|
const params = defaultParams(_params, {
|
|
14718
|
-
masssend:
|
|
15010
|
+
masssend: false
|
|
14719
15011
|
});
|
|
14720
15012
|
params.content = formatSectionHtml(params.content);
|
|
14721
15013
|
if ("rpa" === params.actionType) return weixinPublish_rpa_rpaAction(task, params);
|
|
@@ -15291,7 +15583,8 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
15291
15583
|
retryDelay: 20,
|
|
15292
15584
|
timeout: 3000
|
|
15293
15585
|
});
|
|
15294
|
-
|
|
15586
|
+
if (!createTopic?.data) throw types_errorResponse("话题创建失败,请检查话题字段!", 414);
|
|
15587
|
+
Object.assign(topic, createTopic?.data?.topic_infos[0]);
|
|
15295
15588
|
}
|
|
15296
15589
|
}));
|
|
15297
15590
|
const visibleRangeMap = {
|
|
@@ -16023,12 +16316,6 @@ const rpaAction_Server = async (task, params)=>{
|
|
|
16023
16316
|
response: response?.data?.id || ""
|
|
16024
16317
|
}
|
|
16025
16318
|
});
|
|
16026
|
-
await updateTaskState?.({
|
|
16027
|
-
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.SUCCESS,
|
|
16028
|
-
result: {
|
|
16029
|
-
response: "123456789"
|
|
16030
|
-
}
|
|
16031
|
-
});
|
|
16032
16319
|
await page.close();
|
|
16033
16320
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(response?.data?.id || "");
|
|
16034
16321
|
};
|
|
@@ -16983,7 +17270,45 @@ const xiaohongshuWebSearch = async (_task, params)=>{
|
|
|
16983
17270
|
const data = isSuccess ? res.data : {};
|
|
16984
17271
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(isSuccess ? 0 : 414, message, data);
|
|
16985
17272
|
};
|
|
16986
|
-
var package_namespaceObject = JSON.parse('{"i8":"1.2.30-beta.
|
|
17273
|
+
var package_namespaceObject = JSON.parse('{"i8":"1.2.30-beta.4"}');
|
|
17274
|
+
const ttConfigDataSchema = schemas_object({
|
|
17275
|
+
fansNum: schemas_number(),
|
|
17276
|
+
fansNumYesterday: schemas_number().nullable(),
|
|
17277
|
+
readNum: schemas_number(),
|
|
17278
|
+
incomeNum: schemas_number(),
|
|
17279
|
+
incomeNumYesterday: schemas_number().nullable(),
|
|
17280
|
+
showNumYesterday: schemas_number().nullable(),
|
|
17281
|
+
readNumYesterday: schemas_number().nullable(),
|
|
17282
|
+
likeNumYesterday: schemas_number().nullable(),
|
|
17283
|
+
commentNumYesterday: schemas_number().nullable()
|
|
17284
|
+
});
|
|
17285
|
+
const xhsConfigDataSchema = schemas_object({
|
|
17286
|
+
fansNum: schemas_number(),
|
|
17287
|
+
favedNum: schemas_number(),
|
|
17288
|
+
watchNumLastWeek: schemas_number(),
|
|
17289
|
+
likeNumLastWeek: schemas_number(),
|
|
17290
|
+
collectNumLastWeek: schemas_number(),
|
|
17291
|
+
commentNumLastWeek: schemas_number(),
|
|
17292
|
+
fansNumLastWeek: schemas_number(),
|
|
17293
|
+
fansNumYesterday: schemas_number()
|
|
17294
|
+
});
|
|
17295
|
+
const wxConfigDataSchema = schemas_object({
|
|
17296
|
+
fansNum: schemas_number(),
|
|
17297
|
+
fansNumYesterday: schemas_number(),
|
|
17298
|
+
readNumYesterday: schemas_number(),
|
|
17299
|
+
shareNumYesterday: schemas_number()
|
|
17300
|
+
});
|
|
17301
|
+
const bjhConfigDataSchema = schemas_object({
|
|
17302
|
+
fansNum: schemas_number(),
|
|
17303
|
+
fansNumYesterday: schemas_number().nullable(),
|
|
17304
|
+
readNum: schemas_number(),
|
|
17305
|
+
incomeNum: schemas_number(),
|
|
17306
|
+
incomeNumYesterday: schemas_number().nullable(),
|
|
17307
|
+
recommendNumYesterday: schemas_number().nullable(),
|
|
17308
|
+
readNumYesterday: schemas_number().nullable(),
|
|
17309
|
+
likeNumYesterday: schemas_number().nullable(),
|
|
17310
|
+
commentNumYesterday: schemas_number().nullable()
|
|
17311
|
+
});
|
|
16987
17312
|
const BetaFlag = "HuiwenCanary";
|
|
16988
17313
|
class Action {
|
|
16989
17314
|
constructor(task){
|
|
@@ -17169,6 +17494,6 @@ class Action {
|
|
|
17169
17494
|
}
|
|
17170
17495
|
}
|
|
17171
17496
|
var __webpack_exports__version = package_namespaceObject.i8;
|
|
17172
|
-
export { Action, ActionCommonParamsSchema, BetaFlag, CollectionDetailSchema, ConfigDataSchema, FetchArticlesDataSchema, FetchArticlesParamsSchema, Http, ProxyAgent, SearchAccountInfoParamsSchema, SessionCheckResultSchema, UnreadCountSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, getFileState, rpaAction_Server_Mock, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
|
|
17497
|
+
export { Action, ActionCommonParamsSchema, BaijiahaoPublishParamsSchema, BetaFlag, CollectionDetailSchema, ConfigDataSchema, FetchArticlesDataSchema, FetchArticlesParamsSchema, Http, ProxyAgent, SearchAccountInfoParamsSchema, SessionCheckResultSchema, ToutiaoPublishParamsSchema, UnreadCountSchema, WeixinPublishParamsSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, getFileState, rpaAction_Server_Mock, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
|
|
17173
17498
|
|
|
17174
17499
|
//# sourceMappingURL=index.mjs.map
|