@iflyrpa/actions 1.0.5 → 1.0.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/index.cjs CHANGED
@@ -21886,14 +21886,9 @@ const searchXiaohongshuLocation = async (task, params) => {
21886
21886
  type: 3
21887
21887
  }
21888
21888
  });
21889
- if (data.code === 0) {
21890
- return data.data.poi_list.map((it) => ({
21891
- label: it.name,
21892
- value: it.poi_id
21893
- }));
21894
- }
21895
- return [];
21889
+ return data.code === 0 ? data.data.poi_list : [];
21896
21890
  } catch (error) {
21891
+ task.logger.error("\u83B7\u53D6\u5C0F\u7EA2\u4E66\u5730\u5740\u5931\u8D25");
21897
21892
  return [];
21898
21893
  }
21899
21894
  };
@@ -22614,7 +22609,7 @@ const rpaAction = async (task, params) => {
22614
22609
  if (params.scheduledPublish) {
22615
22610
  await selectDate(".date-picker input", params.scheduledPublish);
22616
22611
  }
22617
- await new Promise((resolve) => {
22612
+ const response = await new Promise((resolve) => {
22618
22613
  const handleResponse = async (response2) => {
22619
22614
  if (response2.url().includes("/web_api/sns/v2/note")) {
22620
22615
  const jsonResponse = await response2.json();
@@ -22626,7 +22621,7 @@ const rpaAction = async (task, params) => {
22626
22621
  page.locator(".submit .publishBtn").click();
22627
22622
  });
22628
22623
  await page.close();
22629
- return "response";
22624
+ return response;
22630
22625
  };
22631
22626
 
22632
22627
  const executeAction = (task, params) => {
package/dist/index.mjs CHANGED
@@ -21868,14 +21868,9 @@ const searchXiaohongshuLocation = async (task, params) => {
21868
21868
  type: 3
21869
21869
  }
21870
21870
  });
21871
- if (data.code === 0) {
21872
- return data.data.poi_list.map((it) => ({
21873
- label: it.name,
21874
- value: it.poi_id
21875
- }));
21876
- }
21877
- return [];
21871
+ return data.code === 0 ? data.data.poi_list : [];
21878
21872
  } catch (error) {
21873
+ task.logger.error("\u83B7\u53D6\u5C0F\u7EA2\u4E66\u5730\u5740\u5931\u8D25");
21879
21874
  return [];
21880
21875
  }
21881
21876
  };
@@ -22596,7 +22591,7 @@ const rpaAction = async (task, params) => {
22596
22591
  if (params.scheduledPublish) {
22597
22592
  await selectDate(".date-picker input", params.scheduledPublish);
22598
22593
  }
22599
- await new Promise((resolve) => {
22594
+ const response = await new Promise((resolve) => {
22600
22595
  const handleResponse = async (response2) => {
22601
22596
  if (response2.url().includes("/web_api/sns/v2/note")) {
22602
22597
  const jsonResponse = await response2.json();
@@ -22608,7 +22603,7 @@ const rpaAction = async (task, params) => {
22608
22603
  page.locator(".submit .publishBtn").click();
22609
22604
  });
22610
22605
  await page.close();
22611
- return "response";
22606
+ return response;
22612
22607
  };
22613
22608
 
22614
22609
  const executeAction = (task, params) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iflyrpa/actions",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -12,7 +12,7 @@ export interface searchXiaohongshuLocationParams extends Omit<ActiomCommonParams
12
12
  page?: number;
13
13
  }
14
14
 
15
- export type PublishAction = CommonAction<searchXiaohongshuLocationParams, { label: string; value: string }[]>;
15
+ export type PublishAction = CommonAction<searchXiaohongshuLocationParams, Xiaohongshu.Location[]>;
16
16
 
17
17
  export const searchXiaohongshuLocation: PublishAction = async (task, params) => {
18
18
  task.logger.info("搜索小红书地址");
@@ -40,15 +40,9 @@ export const searchXiaohongshuLocation: PublishAction = async (task, params) =>
40
40
  },
41
41
  });
42
42
 
43
- if (data.code === 0) {
44
- return data.data.poi_list.map((it) => ({
45
- label: it.name,
46
- value: it.poi_id,
47
- }));
48
- }
49
-
50
- return [];
43
+ return data.code === 0 ? data.data.poi_list : [];
51
44
  } catch (error) {
45
+ task.logger.error("获取小红书地址失败");
52
46
  return [];
53
47
  }
54
48
  };
@@ -222,5 +222,5 @@ export const rpaAction: PublishAction = async (task, params) => {
222
222
  // 关闭页面
223
223
  await page.close();
224
224
 
225
- return "response";
225
+ return response;
226
226
  };