@iflyrpa/actions 1.2.6-beta.1 → 1.2.6
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/xiaohongshuPublish/index.d.ts +0 -1
- package/dist/bundle.js +9 -65
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +9 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -65
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -20,7 +20,6 @@ export interface XiaohongshuPublishParams extends ActiomCommonParams {
|
|
|
20
20
|
content: string;
|
|
21
21
|
address?: Xiaohongshu.Location;
|
|
22
22
|
selfDeclaration?: SelfDeclaration;
|
|
23
|
-
topic?: string[];
|
|
24
23
|
visibleRange: "public" | "private";
|
|
25
24
|
isImmediatelyPublish?: boolean;
|
|
26
25
|
scheduledPublish?: string;
|
package/dist/bundle.js
CHANGED
|
@@ -15433,8 +15433,7 @@ var __webpack_exports__ = {};
|
|
|
15433
15433
|
}
|
|
15434
15434
|
}
|
|
15435
15435
|
const xiaohongshuPublish_mock_errnoMap = {
|
|
15436
|
-
903: "账户已登出,需重新登陆重试!"
|
|
15437
|
-
902: "登录已过期,请重新登录!"
|
|
15436
|
+
903: "账户已登出,需重新登陆重试!"
|
|
15438
15437
|
};
|
|
15439
15438
|
const xsEncrypt = new XsEncrypt();
|
|
15440
15439
|
const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
@@ -15504,62 +15503,13 @@ var __webpack_exports__ = {};
|
|
|
15504
15503
|
};
|
|
15505
15504
|
};
|
|
15506
15505
|
const coverInfos = await Promise.all(params.banners.map((it, idx)=>uploadFile(it, idx)));
|
|
15507
|
-
const searchTopic = async (topic)=>await http.api({
|
|
15508
|
-
method: "post",
|
|
15509
|
-
url: "https://edith.xiaohongshu.com/web_api/sns/v1/search/topic",
|
|
15510
|
-
data: {
|
|
15511
|
-
keyword: topic,
|
|
15512
|
-
suggest_topic_request: {
|
|
15513
|
-
title: "",
|
|
15514
|
-
desc: `#${topic}`
|
|
15515
|
-
},
|
|
15516
|
-
page: {
|
|
15517
|
-
page_size: 20,
|
|
15518
|
-
page: 1
|
|
15519
|
-
}
|
|
15520
|
-
},
|
|
15521
|
-
defaultErrorMsg: "话题搜索异常,请稍后重试。"
|
|
15522
|
-
});
|
|
15523
|
-
let topicDesc = [];
|
|
15524
|
-
params.topic && params.topic.length > 0 && await Promise.all(params.topic.map(async (topic)=>{
|
|
15525
|
-
let topicInfo = {
|
|
15526
|
-
id: null,
|
|
15527
|
-
name: null,
|
|
15528
|
-
type: "topic"
|
|
15529
|
-
};
|
|
15530
|
-
const _topicInfo = await searchTopic(topic);
|
|
15531
|
-
if (0 === _topicInfo.data.topic_info_dtos.length || _topicInfo.data.topic_info_dtos[0].name !== topic) {
|
|
15532
|
-
const topicData = {
|
|
15533
|
-
topic_names: topic
|
|
15534
|
-
};
|
|
15535
|
-
const topicDataStr = xsEncrypt.dumps(topicData);
|
|
15536
|
-
const publishXt = Date.now().toString();
|
|
15537
|
-
const publishXs = await xsEncrypt.encryptXs(`/web_api/sns/capa/postgw/topic/batch_customized${topicDataStr}`, a1Cookie, publishXt);
|
|
15538
|
-
let createTopic = await http.api({
|
|
15539
|
-
method: "POST",
|
|
15540
|
-
url: "https://edith.xiaohongshu.com/web_api/sns/capa/postgw/topic/batch_customized",
|
|
15541
|
-
headers: {
|
|
15542
|
-
"x-s": publishXs,
|
|
15543
|
-
"x-t": publishXt
|
|
15544
|
-
},
|
|
15545
|
-
data: topicData,
|
|
15546
|
-
defaultErrorMsg: "话题创建异常,请稍后重试。"
|
|
15547
|
-
});
|
|
15548
|
-
Object.assign(topicInfo, createTopic.data.topic_infos[0]);
|
|
15549
|
-
} else {
|
|
15550
|
-
topicInfo.id = _topicInfo.data.topic_info_dtos[0].id;
|
|
15551
|
-
topicInfo.name = _topicInfo.data.topic_info_dtos[0].name;
|
|
15552
|
-
topicInfo.link = _topicInfo.data.topic_info_dtos[0].link;
|
|
15553
|
-
}
|
|
15554
|
-
topicDesc.push(topicInfo);
|
|
15555
|
-
}));
|
|
15556
15506
|
const publishData = {
|
|
15557
15507
|
common: {
|
|
15558
15508
|
ats: [],
|
|
15559
15509
|
biz_relations: [],
|
|
15560
|
-
desc: params?.content
|
|
15510
|
+
desc: params?.content,
|
|
15561
15511
|
goods_info: {},
|
|
15562
|
-
hash_tag:
|
|
15512
|
+
hash_tag: [],
|
|
15563
15513
|
note_id: "",
|
|
15564
15514
|
source: JSON.stringify({
|
|
15565
15515
|
type: "web",
|
|
@@ -15677,7 +15627,6 @@ var __webpack_exports__ = {};
|
|
|
15677
15627
|
'/api/galaxy/v2/creator/activity_center/list',
|
|
15678
15628
|
'/web_api/sns/v5/creator/topic/template/list',
|
|
15679
15629
|
'/web_api/sns/v5/creator/file/encryption',
|
|
15680
|
-
'/web_api/sns/capa/postgw/topic/batch_customized',
|
|
15681
15630
|
'/web_api/sns/v2/note'
|
|
15682
15631
|
];
|
|
15683
15632
|
await page.route('**', async (route, request)=>{
|
|
@@ -15757,7 +15706,7 @@ var __webpack_exports__ = {};
|
|
|
15757
15706
|
data: page.url()
|
|
15758
15707
|
};
|
|
15759
15708
|
}
|
|
15760
|
-
await page.locator("#content-area .menu-container .publish-video
|
|
15709
|
+
await page.locator("#content-area .menu-container .publish-video a").click();
|
|
15761
15710
|
await page.locator('.creator-container .header .creator-tab:not([style*="-9999px"]) .title').filter({
|
|
15762
15711
|
hasText: /^上传图文$/
|
|
15763
15712
|
}).click();
|
|
@@ -15774,15 +15723,7 @@ var __webpack_exports__ = {};
|
|
|
15774
15723
|
await titleInstance.fill(params.title);
|
|
15775
15724
|
const descInstance = page.locator(".editor-container #quillEditor .ql-editor");
|
|
15776
15725
|
await descInstance.click();
|
|
15777
|
-
await descInstance.
|
|
15778
|
-
if (params.topic && params.topic.length > 0) for (const it of params.topic){
|
|
15779
|
-
await descInstance.pressSequentially(`#${it}`);
|
|
15780
|
-
await page.locator('.ql-mention-loading').waitFor({
|
|
15781
|
-
state: 'detached'
|
|
15782
|
-
});
|
|
15783
|
-
await page.waitForTimeout(1000);
|
|
15784
|
-
await page.locator('#quill-mention-item-0 .item-view-num').click();
|
|
15785
|
-
}
|
|
15726
|
+
await descInstance.fill(params.content);
|
|
15786
15727
|
const container = page.locator(".creator-container .content .scroll-content");
|
|
15787
15728
|
await container.focus();
|
|
15788
15729
|
await page.mouse.wheel(0, 500);
|
|
@@ -15868,13 +15809,16 @@ var __webpack_exports__ = {};
|
|
|
15868
15809
|
if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
|
|
15869
15810
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
15870
15811
|
};
|
|
15871
|
-
var package_namespaceObject =
|
|
15812
|
+
var package_namespaceObject = {
|
|
15813
|
+
i8: "1.2.5"
|
|
15814
|
+
};
|
|
15872
15815
|
class Action {
|
|
15873
15816
|
constructor(task){
|
|
15874
15817
|
this.task = task;
|
|
15875
15818
|
}
|
|
15876
15819
|
async bindTask(func, params) {
|
|
15877
15820
|
let responseData;
|
|
15821
|
+
if (this.task.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
15878
15822
|
if ("object" == typeof params && null !== params) params.cookies = params?.cookies ?? [];
|
|
15879
15823
|
try {
|
|
15880
15824
|
responseData = await func(this.task, params);
|