@iflyrpa/actions 1.1.29 → 1.1.30
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/bundle.js +45 -19
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +45 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -14009,6 +14009,9 @@ var __webpack_exports__ = {};
|
|
|
14009
14009
|
const weixinPublish_mock_errnoMap = {
|
|
14010
14010
|
200003: "微信公众号号登录状态失效,请重新绑定账号后重试。"
|
|
14011
14011
|
};
|
|
14012
|
+
const ignoreErrno = [
|
|
14013
|
+
154019
|
|
14014
|
+
];
|
|
14012
14015
|
const generatorFormData = (data)=>{
|
|
14013
14016
|
const formData = new URLSearchParams();
|
|
14014
14017
|
for (const [key, value] of Object.entries(data))formData.append(key, String(value));
|
|
@@ -14046,7 +14049,7 @@ var __webpack_exports__ = {};
|
|
|
14046
14049
|
});
|
|
14047
14050
|
http.addResponseInterceptor((response)=>{
|
|
14048
14051
|
const responseData = response.data;
|
|
14049
|
-
if (responseData?.base_resp && 0 !== responseData.base_resp.ret) {
|
|
14052
|
+
if (responseData?.base_resp && 0 !== responseData.base_resp.ret && !ignoreErrno.includes(responseData.base_resp.ret)) {
|
|
14050
14053
|
const errmsg = weixinPublish_mock_errnoMap[responseData.base_resp.ret] || response.config.defaultErrorMsg || responseData.base_resp.err_msg || "Unknown error";
|
|
14051
14054
|
return {
|
|
14052
14055
|
code: responseData.base_resp.ret,
|
|
@@ -14176,20 +14179,44 @@ var __webpack_exports__ = {};
|
|
|
14176
14179
|
message: "微信公众号保存草稿成功。"
|
|
14177
14180
|
};
|
|
14178
14181
|
}
|
|
14179
|
-
const
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
|
|
14190
|
-
|
|
14191
|
-
|
|
14192
|
-
|
|
14182
|
+
const masssendpage = ()=>http.api({
|
|
14183
|
+
method: "get",
|
|
14184
|
+
url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
|
|
14185
|
+
params: {
|
|
14186
|
+
token: params.token,
|
|
14187
|
+
lang: "zh_CN",
|
|
14188
|
+
f: "json",
|
|
14189
|
+
ajax: 1,
|
|
14190
|
+
preview_appmsgid: appMsgId,
|
|
14191
|
+
fingerprint,
|
|
14192
|
+
random: Math.random().toString()
|
|
14193
|
+
},
|
|
14194
|
+
defaultErrorMsg: "创建草稿失败,请稍后重试发布。"
|
|
14195
|
+
});
|
|
14196
|
+
let massSendRes = await masssendpage();
|
|
14197
|
+
if (massSendRes.base_resp?.ret === 154019) {
|
|
14198
|
+
task.logger.info("需要同意群发声明");
|
|
14199
|
+
await http.api({
|
|
14200
|
+
method: "post",
|
|
14201
|
+
url: "https://mp.weixin.qq.com/cgi-bin/setprotocolsign",
|
|
14202
|
+
params: {
|
|
14203
|
+
cgi: "setprotocolsign",
|
|
14204
|
+
lang: "zh_CN",
|
|
14205
|
+
token: params.token
|
|
14206
|
+
},
|
|
14207
|
+
data: generatorFormData({
|
|
14208
|
+
token: params.token,
|
|
14209
|
+
lang: "zh_CN",
|
|
14210
|
+
f: "json",
|
|
14211
|
+
ajax: 1,
|
|
14212
|
+
fingerprint,
|
|
14213
|
+
random: Math.random().toString(),
|
|
14214
|
+
issigned: 1
|
|
14215
|
+
})
|
|
14216
|
+
});
|
|
14217
|
+
massSendRes = await masssendpage();
|
|
14218
|
+
}
|
|
14219
|
+
const { operation_seq, mass_send_left } = massSendRes;
|
|
14193
14220
|
if (mass_send_left < 1) return {
|
|
14194
14221
|
code: 200,
|
|
14195
14222
|
message: "今日群发次数用尽,请明天再试。",
|
|
@@ -14595,7 +14622,6 @@ var __webpack_exports__ = {};
|
|
|
14595
14622
|
return success(articleId);
|
|
14596
14623
|
};
|
|
14597
14624
|
const weixinPublish = async (task, params)=>{
|
|
14598
|
-
task.logger.info("开始微信公众号发布");
|
|
14599
14625
|
if ("rpa" === params.actionType) return weixinPublish_rpa_rpaAction(task, params);
|
|
14600
14626
|
if ("mockApi" === params.actionType) return weixinPublish_mock_mockAction(task, params);
|
|
14601
14627
|
return executeAction(weixinPublish_mock_mockAction, weixinPublish_rpa_rpaAction)(task, params);
|
|
@@ -15196,7 +15222,7 @@ var __webpack_exports__ = {};
|
|
|
15196
15222
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
15197
15223
|
};
|
|
15198
15224
|
var package_namespaceObject = {
|
|
15199
|
-
i8: "1.1.
|
|
15225
|
+
i8: "1.1.29"
|
|
15200
15226
|
};
|
|
15201
15227
|
class Action {
|
|
15202
15228
|
constructor(task){
|
|
@@ -15213,8 +15239,8 @@ var __webpack_exports__ = {};
|
|
|
15213
15239
|
}
|
|
15214
15240
|
if (0 !== responseData.code) {
|
|
15215
15241
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data));
|
|
15216
|
-
this.task.logger.info(
|
|
15217
|
-
} else this.task.logger.info(
|
|
15242
|
+
this.task.logger.info(`${func.name} action failed`);
|
|
15243
|
+
} else this.task.logger.info(`${func.name} action success`);
|
|
15218
15244
|
return responseData;
|
|
15219
15245
|
}
|
|
15220
15246
|
searchToutiaoTopicList(params) {
|