adspower-browser 2.1.2 → 2.1.3

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/README.MD CHANGED
@@ -142,6 +142,8 @@ ads close-browser <profile_id> # Or JSON: profile_id? | profil
142
142
  ads create-browser '{"group_id":"0","user_proxy_config":{"proxy_soft":"no_proxy"},...}' # group_id + account field required; proxy optional (defaults to no_proxy; proxyid takes priority over user_proxy_config when both given)
143
143
  ads update-browser '{"profile_id":"...",...}' # profile_id required
144
144
  ads delete-browser '{"profile_id":["..."]}' # profile_id required
145
+ ads get-recycle-bin-list '{}' # page?, limit? (1-100). Omit either to use the Local API backend default. Last 30 days only
146
+ ads restore-recycle-bin '{"profile_id":"...","group_id":"123"}' # profile_id or profile_no, group_id required
145
147
  ads get-browser-list '{}' # CLI defaults to page=1,limit=200. Or group_id?, limit?, page?, profile_id[]?, profile_no[]?, sort_type?, sort_order?, tag_ids?, tags_filter?, name?, name_filter?
146
148
  ads get-opened-browser # No params
147
149
  ```
@@ -171,12 +173,12 @@ ads get-group-list '{}' # group_name?, page_size?, page?
171
173
  ### Member
172
174
 
173
175
  ```bash
174
- ads create-member '{"user_group_id":"...","email":"alice@example.com","password":"password1","identity":4}' # identity: 2 admin, 3 manager, 4 staff
175
- ads update-member '{"user_id":"...","name":"Alice"}' # omit authorized_group to keep groups; [] + group_update_type 1 clears
176
+ ads create-member '{"user_group_id":"...","email":"alice@example.com","password":"password1","identity":4}' # identity: 2 admin, 3 manager, 4 staff; manager optional; member only for identity 3
177
+ ads update-member '{"user_id":"...","name":"Alice"}' # omit to keep; empty name/manager/remark/member/authorized_group can clear; do not empty email or identity
176
178
  ads reset-member-password '{"user_id":"..."}' # unbind_phone?: 0|1; new_password is in the response
177
- ads delete-member '{"user_id":"..."}'
178
- ads get-member-list '{}' # user_group_id?, user_id[]?, email[]?, page?, limit? (default 1)
179
- ads get-member-group-list '{}' # page?, limit? (default 1)
179
+ ads delete-member '{"user_id":"..."}' # permanent, not recoverable
180
+ ads get-member-list '{}' # user_group_id?, user_id[]?, email[]?, page?, limit? (default 50, max 200)
181
+ ads get-member-group-list '{}' # page?, limit? (default 50, max 200)
180
182
  ```
181
183
 
182
184
  ### Application (categories)
package/cli/index.js CHANGED
@@ -610,6 +610,23 @@ var LOCAL_API_CONTRACTS = {
610
610
  profile_id: { apiName: "profile_id", location: "body" }
611
611
  }
612
612
  },
613
+ "get-recycle-bin-list": {
614
+ method: "POST",
615
+ path: "/api/v2/browser-profile/recycle-bin/list",
616
+ params: {
617
+ page: { apiName: "page", location: "body" },
618
+ limit: { apiName: "limit", location: "body" }
619
+ }
620
+ },
621
+ "restore-recycle-bin": {
622
+ method: "POST",
623
+ path: "/api/v2/browser-profile/recycle-bin/restore",
624
+ params: {
625
+ profile_id: { apiName: "profile_id", location: "body" },
626
+ profile_no: { apiName: "profile_no", location: "body" },
627
+ group_id: { apiName: "group_id", location: "body" }
628
+ }
629
+ },
613
630
  "get-browser-list": {
614
631
  method: "POST",
615
632
  path: "/api/v2/browser-profile/list",
@@ -948,6 +965,8 @@ var API_ENDPOINTS = {
948
965
  GET_BROWSER_LIST: LOCAL_API_CONTRACTS["get-browser-list"].path,
949
966
  UPDATE_BROWSER: LOCAL_API_CONTRACTS["update-browser"].path,
950
967
  DELETE_BROWSER: LOCAL_API_CONTRACTS["delete-browser"].path,
968
+ GET_RECYCLE_BIN_LIST: LOCAL_API_CONTRACTS["get-recycle-bin-list"].path,
969
+ RESTORE_RECYCLE_BIN: LOCAL_API_CONTRACTS["restore-recycle-bin"].path,
951
970
  GET_PROFILE_COOKIES: LOCAL_API_CONTRACTS["get-profile-cookies"].path,
952
971
  GET_PROFILE_UA: LOCAL_API_CONTRACTS["get-profile-ua"].path,
953
972
  CLOSE_ALL_PROFILES: LOCAL_API_CONTRACTS["close-all-profiles"].path,
@@ -1032,6 +1051,18 @@ var TOOL_INTENT_BY_NAME = {
1032
1051
  triggersEn: "remove profile, delete account, trash browser",
1033
1052
  triggersZh: "\u5220\u9664\u73AF\u5883,\u79FB\u9664profile,\u5220\u6389\u6D4F\u89C8\u5668\u8D26\u53F7"
1034
1053
  },
1054
+ "get-recycle-bin-list": {
1055
+ intentEn: "List browser profiles in the recycle bin from the last 30 days.",
1056
+ intentZh: "\u67E5\u8BE2\u8FD1 30 \u5929\u56DE\u6536\u7AD9\u4E2D\u7684\u6D4F\u89C8\u5668\u73AF\u5883\u3002",
1057
+ triggersEn: "recycle bin, deleted profiles, trash list, recently deleted",
1058
+ triggersZh: "\u56DE\u6536\u7AD9,\u5DF2\u5220\u9664\u73AF\u5883,\u6700\u8FD1\u5220\u9664,\u5783\u573E\u6876\u5217\u8868"
1059
+ },
1060
+ "restore-recycle-bin": {
1061
+ intentEn: "Restore one deleted browser profile from the recycle bin into a target group.",
1062
+ intentZh: "\u628A\u56DE\u6536\u7AD9\u91CC\u7684\u4E00\u4E2A\u73AF\u5883\u6062\u590D\u5230\u6307\u5B9A\u5206\u7EC4\u3002",
1063
+ triggersEn: "restore profile, recover deleted browser, undelete environment",
1064
+ triggersZh: "\u6062\u590D\u73AF\u5883,\u8FD8\u539F\u56DE\u6536\u7AD9,\u627E\u56DE\u5DF2\u5220\u9664\u73AF\u5883"
1065
+ },
1035
1066
  "get-browser-list": {
1036
1067
  intentEn: "List or search browser profiles (pagination, filters).",
1037
1068
  intentZh: "\u5206\u9875/\u6761\u4EF6\u67E5\u8BE2\u6D4F\u89C8\u5668 profile \u5217\u8868\u3002",
@@ -1135,10 +1166,10 @@ var TOOL_INTENT_BY_NAME = {
1135
1166
  triggersZh: "\u91CD\u7F6E\u5BC6\u7801,\u6539\u5BC6\u7801,\u89E3\u7ED1\u624B\u673A"
1136
1167
  },
1137
1168
  "delete-member": {
1138
- intentEn: "Delete a team member by user_id.",
1139
- intentZh: "\u6309 user_id \u5220\u9664\u56E2\u961F\u6210\u5458\u3002",
1140
- triggersEn: "remove member, delete user, delete staff",
1141
- triggersZh: "\u5220\u9664\u6210\u5458,\u79FB\u9664\u7528\u6237,\u5220\u5458\u5DE5"
1169
+ intentEn: "Permanently delete a team member by user_id. Hard delete, not recoverable.",
1170
+ intentZh: "\u6309 user_id \u5F7B\u5E95\u5220\u9664\u56E2\u961F\u6210\u5458\uFF0C\u4E0D\u53EF\u6062\u590D\u3002",
1171
+ triggersEn: "remove member, delete user, delete staff, hard delete",
1172
+ triggersZh: "\u5220\u9664\u6210\u5458,\u79FB\u9664\u7528\u6237,\u5220\u5458\u5DE5,\u5F7B\u5E95\u5220\u9664"
1142
1173
  },
1143
1174
  "get-member-list": {
1144
1175
  intentEn: "List or search team members (pagination, user_id, email).",
@@ -1535,6 +1566,26 @@ var browserHandlers = {
1535
1566
  }
1536
1567
  throw new Error(response.data.msg);
1537
1568
  },
1569
+ async getRecycleBinList(params) {
1570
+ const response = await getApiClient().post(
1571
+ `${getLocalApiBase()}${API_ENDPOINTS.GET_RECYCLE_BIN_LIST}`,
1572
+ buildRequestBodyFor("get-recycle-bin-list", params)
1573
+ );
1574
+ if (response.data.code === 0) {
1575
+ return JSON.stringify(response.data.data, null, 2);
1576
+ }
1577
+ throw new Error(response.data.msg);
1578
+ },
1579
+ async restoreRecycleBin(params) {
1580
+ const response = await getApiClient().post(
1581
+ `${getLocalApiBase()}${API_ENDPOINTS.RESTORE_RECYCLE_BIN}`,
1582
+ buildRequestBodyFor("restore-recycle-bin", params)
1583
+ );
1584
+ if (response.data.code === 0) {
1585
+ return JSON.stringify(response.data.data, null, 2);
1586
+ }
1587
+ throw new Error(response.data.msg);
1588
+ },
1538
1589
  async getBrowserList(params) {
1539
1590
  const requestBody = buildRequestBodyFor("get-browser-list", params);
1540
1591
  const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.GET_BROWSER_LIST}`, requestBody);
@@ -2514,6 +2565,17 @@ var schemas = {
2514
2565
  deleteBrowserSchema: import_zod.z.object({
2515
2566
  profile_id: import_zod.z.array(import_zod.z.string()).describe("The profile ids of the browsers to delete, it is required when you want to delete the browser")
2516
2567
  }).strict(),
2568
+ getRecycleBinListSchema: import_zod.z.object({
2569
+ page: import_zod.z.number().int().min(1).optional().describe("Page number. Omit to use the Local API backend default. Only profiles deleted in the last 30 days and visible to the caller are returned."),
2570
+ limit: import_zod.z.number().int().min(1).max(100).optional().describe("Profiles per page, range 1-100. Omit to use the Local API backend default.")
2571
+ }).strict(),
2572
+ restoreRecycleBinSchema: import_zod.z.object({
2573
+ profile_id: import_zod.z.string().optional().describe("Profile ID in the recycle bin. Either profile_id or profile_no is required. If both are provided, profile_id takes priority."),
2574
+ profile_no: import_zod.z.string().regex(/^\d+$/, "Profile number must be a numeric string").optional().describe("Profile serial number in the recycle bin. Either profile_id or profile_no is required. If both are provided, profile_id takes priority."),
2575
+ group_id: import_zod.z.string().regex(/^\d+$/, "Group ID must be a numeric string").describe('Target group ID after restore. Use get-group-list to find a group the caller can use. "0" is ungrouped.')
2576
+ }).strict().refine((data) => data.profile_id || data.profile_no, {
2577
+ message: "Either profile_id or profile_no must be provided"
2578
+ }),
2517
2579
  getBrowserListSchema: import_zod.z.object({
2518
2580
  group_id: import_zod.z.string().regex(/^\d+$/, "Group ID must be a numeric string").optional().describe("Query by group ID; searches all groups if empty"),
2519
2581
  limit: import_zod.z.number().min(1).max(200).optional().describe("Profiles per page, range 1 ~ 200. If omitted the CLI sends limit=200; the Local API itself defaults to only 1, so always rely on this CLI default or pass an explicit value"),
@@ -2580,8 +2642,8 @@ var schemas = {
2580
2642
  email: import_zod.z.string().max(70).describe("Member email, max 70 characters"),
2581
2643
  password: import_zod.z.string().min(8).max(50).describe("Login password in plaintext, 8 to 50 characters. The Local API hashes it before storing"),
2582
2644
  identity: import_zod.z.union([import_zod.z.literal(2), import_zod.z.literal(3), import_zod.z.literal(4)]).describe("Role type: 2 admin, 3 manager, 4 staff"),
2583
- manager: import_zod.z.string().max(15).optional().describe("Direct manager user_id. Required when identity is 4 (staff)"),
2584
- member: import_zod.z.array(import_zod.z.string()).max(300).optional().describe("Direct subordinate user_id list, max 300. Used when identity is 2 or 3"),
2645
+ manager: import_zod.z.string().max(15).optional().describe("Direct manager user_id. Optional even when identity is 4 (staff); omit for no manager. Only staff may send this field"),
2646
+ member: import_zod.z.array(import_zod.z.string()).max(300).optional().describe("Direct subordinate user_id list, max 300. Only for identity 3 (manager). Do not send for admin (2); the Local API will reject it"),
2585
2647
  authorized_group: import_zod.z.array(import_zod.z.string()).max(1500).optional().describe("Authorized browser group ids, max 1500. Empty array means no groups"),
2586
2648
  profile_limit: import_zod.z.number().optional().describe("Profile quota for this member"),
2587
2649
  remark: import_zod.z.string().max(100).optional().describe("Remark, max 100 characters")
@@ -2589,33 +2651,33 @@ var schemas = {
2589
2651
  updateMemberSchema: import_zod.z.object({
2590
2652
  user_id: import_zod.z.string().max(50).describe("Member user_id to update"),
2591
2653
  user_group_id: import_zod.z.string().max(50).optional().describe("Member group / role id"),
2592
- name: import_zod.z.string().max(50).optional().describe("Member display name, max 50 characters. Empty string clears the name"),
2593
- email: import_zod.z.string().max(70).optional().describe("Member email, max 70 characters"),
2594
- identity: import_zod.z.union([import_zod.z.literal(2), import_zod.z.literal(3), import_zod.z.literal(4)]).optional().describe("Role type: 2 admin, 3 manager, 4 staff"),
2595
- manager: import_zod.z.string().max(15).optional().describe("Direct manager user_id. Empty string clears the manager"),
2596
- member: import_zod.z.array(import_zod.z.string()).max(300).optional().describe("Direct subordinate user_id list, max 300. Empty array clears subordinates"),
2654
+ name: import_zod.z.string().max(50).optional().describe("Member display name, max 50 characters. Empty string clears the name. Omit to keep unchanged"),
2655
+ email: import_zod.z.string().max(70).optional().describe("Member email, max 70 characters. Omit to keep unchanged. Do not send empty string; it will fail validation"),
2656
+ identity: import_zod.z.union([import_zod.z.literal(2), import_zod.z.literal(3), import_zod.z.literal(4)]).optional().describe("Role type: 2 admin, 3 manager, 4 staff. Omit to keep unchanged. Do not send empty; it will fail validation"),
2657
+ manager: import_zod.z.string().max(15).optional().describe("Direct manager user_id. Empty string clears the manager. Omit to keep unchanged. Only staff may send this field"),
2658
+ member: import_zod.z.array(import_zod.z.string()).max(300).optional().describe("Direct subordinate user_id list, max 300. Only for identity 3 (manager). Empty array clears subordinates. Do not send for admin (2)"),
2597
2659
  authorized_group: import_zod.z.array(import_zod.z.string()).max(1500).optional().describe("Authorized browser group ids, max 1500. Omit to keep current groups. Empty array plus group_update_type 1 (default) replaces/clears; 2 appends/keeps"),
2598
2660
  group_update_type: import_zod.z.union([import_zod.z.literal(1), import_zod.z.literal(2)]).optional().describe("How authorized_group is applied: 1 replace (default), 2 append"),
2599
2661
  profile_limit: import_zod.z.number().optional().describe("Profile quota for this member"),
2600
- remark: import_zod.z.string().max(100).optional().describe("Remark, max 100 characters. Empty string clears the remark")
2662
+ remark: import_zod.z.string().max(100).optional().describe("Remark, max 100 characters. Empty string clears the remark. Omit to keep unchanged")
2601
2663
  }).strict(),
2602
2664
  resetMemberPasswordSchema: import_zod.z.object({
2603
2665
  user_id: import_zod.z.string().max(50).describe("Member user_id whose password will be reset"),
2604
2666
  unbind_phone: import_zod.z.union([import_zod.z.literal(0), import_zod.z.literal(1)]).optional().describe("Whether to unbind the member phone: 1 unbind, 0 keep. Default 0")
2605
2667
  }).strict(),
2606
2668
  deleteMemberSchema: import_zod.z.object({
2607
- user_id: import_zod.z.string().max(50).describe("Member user_id to delete")
2669
+ user_id: import_zod.z.string().max(50).describe("Member user_id to permanently delete. Hard delete, not recoverable, does not go to recycle bin")
2608
2670
  }).strict(),
2609
2671
  getMemberListSchema: import_zod.z.object({
2610
2672
  user_group_id: import_zod.z.string().max(50).optional().describe("Filter by member group / role id"),
2611
2673
  user_id: import_zod.z.array(import_zod.z.string()).max(50).optional().describe('Filter by member user_id list, max 50. Example: ["1001","1002"]'),
2612
2674
  email: import_zod.z.array(import_zod.z.string()).max(50).optional().describe('Filter by member email list, max 50. Example: ["a@b.com"]'),
2613
- page: import_zod.z.number().int().min(1).max(1e7).optional().describe("Page number, default 1"),
2614
- limit: import_zod.z.number().int().min(1).max(2e3).optional().describe("Page size, default 1, max 2000")
2675
+ page: import_zod.z.number().int().min(1).max(2e4).optional().describe("Page number, default 1, max 20000"),
2676
+ limit: import_zod.z.number().int().min(1).max(200).optional().describe("Page size, default 50, max 200. Omitting limit returns 50 rows")
2615
2677
  }).strict(),
2616
2678
  getMemberGroupListSchema: import_zod.z.object({
2617
- page: import_zod.z.number().int().min(1).max(1e7).optional().describe("Page number, default 1"),
2618
- limit: import_zod.z.number().int().min(1).max(2e3).optional().describe("Page size, default 1, max 2000")
2679
+ page: import_zod.z.number().int().min(1).max(2e4).optional().describe("Page number, default 1, max 20000"),
2680
+ limit: import_zod.z.number().int().min(1).max(200).optional().describe("Page size, default 50, max 200. Omitting limit returns 50 rows")
2619
2681
  }).strict(),
2620
2682
  getApplicationListSchema: import_zod.z.object({
2621
2683
  category_id: import_zod.z.string().optional().describe("Extension category_id"),
@@ -2826,6 +2888,16 @@ var STATELESS_HANDLERS = {
2826
2888
  description: buildCliCommandDescription("delete-browser", "Delete the browser"),
2827
2889
  paramsDescription: schemaParamsDescription(schemas.deleteBrowserSchema, "delete-browser")
2828
2890
  },
2891
+ "get-recycle-bin-list": {
2892
+ fn: browserHandlers.getRecycleBinList,
2893
+ description: buildCliCommandDescription("get-recycle-bin-list", "List browser profiles in the recycle bin from the last 30 days"),
2894
+ paramsDescription: schemaParamsDescription(schemas.getRecycleBinListSchema, "get-recycle-bin-list")
2895
+ },
2896
+ "restore-recycle-bin": {
2897
+ fn: browserHandlers.restoreRecycleBin,
2898
+ description: buildCliCommandDescription("restore-recycle-bin", "Restore a deleted browser profile from the recycle bin into a group"),
2899
+ paramsDescription: schemaParamsDescription(schemas.restoreRecycleBinSchema, "restore-recycle-bin")
2900
+ },
2829
2901
  "get-browser-list": {
2830
2902
  fn: browserHandlers.getBrowserList,
2831
2903
  description: buildCliCommandDescription("get-browser-list", "Get the list of browsers"),
@@ -2934,7 +3006,7 @@ var STATELESS_HANDLERS = {
2934
3006
  },
2935
3007
  "delete-member": {
2936
3008
  fn: memberHandlers.deleteMember,
2937
- description: buildCliCommandDescription("delete-member", "Delete a team member"),
3009
+ description: buildCliCommandDescription("delete-member", "Permanently delete a team member"),
2938
3010
  paramsDescription: schemaParamsDescription(schemas.deleteMemberSchema, "delete-member")
2939
3011
  },
2940
3012
  "get-member-list": {