adspower-browser 2.1.2-beta.2 → 2.1.2-beta.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.
Files changed (3) hide show
  1. package/README.MD +12 -1
  2. package/cli/index.js +322 -2
  3. package/package.json +1 -1
package/README.MD CHANGED
@@ -142,7 +142,7 @@ 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, default 1). Last 30 days only
145
+ ads get-recycle-bin-list '{}' # page?, limit? (1-100). Omit either to use the Local API backend default. Last 30 days only
146
146
  ads restore-recycle-bin '{"profile_id":"...","group_id":"123"}' # profile_id or profile_no, group_id required
147
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?
148
148
  ads get-opened-browser # No params
@@ -170,6 +170,17 @@ ads update-group '{"group_id":"1","group_name":"New Name"}' # group_id + grou
170
170
  ads get-group-list '{}' # group_name?, page_size?, page?
171
171
  ```
172
172
 
173
+ ### Member
174
+
175
+ ```bash
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
178
+ ads reset-member-password '{"user_id":"..."}' # unbind_phone?: 0|1; new_password is in the response
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)
182
+ ```
183
+
173
184
  ### Application (categories)
174
185
 
175
186
  ```bash
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",
@@ -728,6 +745,73 @@ var LOCAL_API_CONTRACTS = {
728
745
  page_size: { apiName: "page_size", location: "query" }
729
746
  }
730
747
  },
748
+ "create-member": {
749
+ method: "POST",
750
+ path: "/api/v2/user/create",
751
+ params: {
752
+ user_group_id: { apiName: "user_group_id", location: "body" },
753
+ name: { apiName: "name", location: "body" },
754
+ email: { apiName: "email", location: "body" },
755
+ password: { apiName: "password", location: "body" },
756
+ identity: { apiName: "identity", location: "body" },
757
+ manager: { apiName: "manager", location: "body" },
758
+ member: { apiName: "member", location: "body" },
759
+ authorized_group: { apiName: "authorized_group", location: "body" },
760
+ profile_limit: { apiName: "profile_limit", location: "body" },
761
+ remark: { apiName: "remark", location: "body" }
762
+ }
763
+ },
764
+ "update-member": {
765
+ method: "POST",
766
+ path: "/api/v2/user/update",
767
+ params: {
768
+ user_id: { apiName: "user_id", location: "body" },
769
+ user_group_id: { apiName: "user_group_id", location: "body" },
770
+ name: { apiName: "name", location: "body" },
771
+ email: { apiName: "email", location: "body" },
772
+ identity: { apiName: "identity", location: "body" },
773
+ manager: { apiName: "manager", location: "body" },
774
+ member: { apiName: "member", location: "body" },
775
+ authorized_group: { apiName: "authorized_group", location: "body" },
776
+ group_update_type: { apiName: "group_update_type", location: "body" },
777
+ profile_limit: { apiName: "profile_limit", location: "body" },
778
+ remark: { apiName: "remark", location: "body" }
779
+ }
780
+ },
781
+ "reset-member-password": {
782
+ method: "POST",
783
+ path: "/api/v2/user/reset_password",
784
+ params: {
785
+ user_id: { apiName: "user_id", location: "body" },
786
+ unbind_phone: { apiName: "unbind_phone", location: "body" }
787
+ }
788
+ },
789
+ "delete-member": {
790
+ method: "POST",
791
+ path: "/api/v2/user/delete",
792
+ params: {
793
+ user_id: { apiName: "user_id", location: "body" }
794
+ }
795
+ },
796
+ "get-member-list": {
797
+ method: "GET",
798
+ path: "/api/v2/user/list",
799
+ params: {
800
+ user_group_id: { apiName: "user_group_id", location: "query" },
801
+ user_id: { apiName: "user_id", location: "query" },
802
+ email: { apiName: "email", location: "query" },
803
+ page: { apiName: "page", location: "query" },
804
+ limit: { apiName: "limit", location: "query" }
805
+ }
806
+ },
807
+ "get-member-group-list": {
808
+ method: "GET",
809
+ path: "/api/v2/user-group/list",
810
+ params: {
811
+ page: { apiName: "page", location: "query" },
812
+ limit: { apiName: "limit", location: "query" }
813
+ }
814
+ },
731
815
  "create-proxy": {
732
816
  method: "POST",
733
817
  path: "/api/v2/proxy-list/create",
@@ -881,6 +965,8 @@ var API_ENDPOINTS = {
881
965
  GET_BROWSER_LIST: LOCAL_API_CONTRACTS["get-browser-list"].path,
882
966
  UPDATE_BROWSER: LOCAL_API_CONTRACTS["update-browser"].path,
883
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,
884
970
  GET_PROFILE_COOKIES: LOCAL_API_CONTRACTS["get-profile-cookies"].path,
885
971
  GET_PROFILE_UA: LOCAL_API_CONTRACTS["get-profile-ua"].path,
886
972
  CLOSE_ALL_PROFILES: LOCAL_API_CONTRACTS["close-all-profiles"].path,
@@ -898,6 +984,12 @@ var API_ENDPOINTS = {
898
984
  GET_GROUP_LIST: LOCAL_API_CONTRACTS["get-group-list"].path,
899
985
  CREATE_GROUP: LOCAL_API_CONTRACTS["create-group"].path,
900
986
  UPDATE_GROUP: LOCAL_API_CONTRACTS["update-group"].path,
987
+ CREATE_MEMBER: LOCAL_API_CONTRACTS["create-member"].path,
988
+ UPDATE_MEMBER: LOCAL_API_CONTRACTS["update-member"].path,
989
+ RESET_MEMBER_PASSWORD: LOCAL_API_CONTRACTS["reset-member-password"].path,
990
+ DELETE_MEMBER: LOCAL_API_CONTRACTS["delete-member"].path,
991
+ GET_MEMBER_LIST: LOCAL_API_CONTRACTS["get-member-list"].path,
992
+ GET_MEMBER_GROUP_LIST: LOCAL_API_CONTRACTS["get-member-group-list"].path,
901
993
  GET_APPLICATION_LIST: LOCAL_API_CONTRACTS["get-application-list"].path,
902
994
  GET_TAG_LIST: LOCAL_API_CONTRACTS["get-tag-list"].path,
903
995
  CREATE_TAG: LOCAL_API_CONTRACTS["create-tag"].path,
@@ -959,6 +1051,18 @@ var TOOL_INTENT_BY_NAME = {
959
1051
  triggersEn: "remove profile, delete account, trash browser",
960
1052
  triggersZh: "\u5220\u9664\u73AF\u5883,\u79FB\u9664profile,\u5220\u6389\u6D4F\u89C8\u5668\u8D26\u53F7"
961
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
+ },
962
1066
  "get-browser-list": {
963
1067
  intentEn: "List or search browser profiles (pagination, filters).",
964
1068
  intentZh: "\u5206\u9875/\u6761\u4EF6\u67E5\u8BE2\u6D4F\u89C8\u5668 profile \u5217\u8868\u3002",
@@ -1043,6 +1147,42 @@ var TOOL_INTENT_BY_NAME = {
1043
1147
  triggersEn: "list groups, search group name",
1044
1148
  triggersZh: "\u5206\u7EC4\u5217\u8868,\u67E5\u7EC4\u540D"
1045
1149
  },
1150
+ "create-member": {
1151
+ intentEn: "Create a team member (admin / manager / staff).",
1152
+ intentZh: "\u65B0\u5EFA\u56E2\u961F\u6210\u5458\uFF08\u7BA1\u7406\u5458 / \u7ECF\u7406 / \u5458\u5DE5\uFF09\u3002",
1153
+ triggersEn: "create member, add user, invite teammate, new staff",
1154
+ triggersZh: "\u521B\u5EFA\u6210\u5458,\u6DFB\u52A0\u7528\u6237,\u9080\u8BF7\u540C\u4E8B,\u65B0\u5EFA\u5458\u5DE5"
1155
+ },
1156
+ "update-member": {
1157
+ intentEn: "Update an existing team member (role, groups, profile limit).",
1158
+ intentZh: "\u7F16\u8F91\u5DF2\u6709\u56E2\u961F\u6210\u5458\uFF08\u8EAB\u4EFD\u3001\u6388\u6743\u5206\u7EC4\u3001\u73AF\u5883\u989D\u5EA6\u7B49\uFF09\u3002",
1159
+ triggersEn: "edit member, change role, update staff, authorized group",
1160
+ triggersZh: "\u7F16\u8F91\u6210\u5458,\u6539\u8EAB\u4EFD,\u66F4\u65B0\u7528\u6237,\u6388\u6743\u5206\u7EC4"
1161
+ },
1162
+ "reset-member-password": {
1163
+ intentEn: "Reset a team member password; new_password is returned in the response.",
1164
+ intentZh: "\u91CD\u7F6E\u6210\u5458\u5BC6\u7801\uFF0C\u6210\u529F\u54CD\u5E94\u91CC\u8FD4\u56DE\u660E\u6587 new_password\u3002",
1165
+ triggersEn: "reset password, new password, unbind phone",
1166
+ triggersZh: "\u91CD\u7F6E\u5BC6\u7801,\u6539\u5BC6\u7801,\u89E3\u7ED1\u624B\u673A"
1167
+ },
1168
+ "delete-member": {
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"
1173
+ },
1174
+ "get-member-list": {
1175
+ intentEn: "List or search team members (pagination, user_id, email).",
1176
+ intentZh: "\u5206\u9875/\u6761\u4EF6\u67E5\u8BE2\u56E2\u961F\u6210\u5458\u5217\u8868\u3002",
1177
+ triggersEn: "list members, search users, query staff, member list",
1178
+ triggersZh: "\u6210\u5458\u5217\u8868,\u67E5\u8BE2\u7528\u6237,\u641C\u7D22\u5458\u5DE5,\u5217\u51FA\u6210\u5458"
1179
+ },
1180
+ "get-member-group-list": {
1181
+ intentEn: "List member groups / roles with pagination.",
1182
+ intentZh: "\u5206\u9875\u67E5\u8BE2\u6210\u5458\u5206\u7EC4\uFF08\u89D2\u8272\uFF09\u5217\u8868\u3002",
1183
+ triggersEn: "member groups, user groups, role list",
1184
+ triggersZh: "\u6210\u5458\u5206\u7EC4,\u7528\u6237\u7EC4,\u89D2\u8272\u5217\u8868"
1185
+ },
1046
1186
  "check-status": {
1047
1187
  intentEn: "Check Local API availability on this machine.",
1048
1188
  intentZh: "\u68C0\u6D4B\u672C\u673A Local API \u662F\u5426\u53EF\u7528\u3002",
@@ -1401,7 +1541,6 @@ var browserHandlers = {
1401
1541
  };
1402
1542
  }
1403
1543
  }
1404
- console.log("=====> ", JSON.stringify(resolvedParams));
1405
1544
  const requestBody = buildRequestBodyFor("create-browser", resolvedParams);
1406
1545
  const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.CREATE_BROWSER}`, requestBody);
1407
1546
  if (response.data.code === 0) {
@@ -1427,6 +1566,26 @@ var browserHandlers = {
1427
1566
  }
1428
1567
  throw new Error(response.data.msg);
1429
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
+ },
1430
1589
  async getBrowserList(params) {
1431
1590
  const requestBody = buildRequestBodyFor("get-browser-list", params);
1432
1591
  const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.GET_BROWSER_LIST}`, requestBody);
@@ -1545,6 +1704,73 @@ var groupHandlers = {
1545
1704
  }
1546
1705
  };
1547
1706
 
1707
+ // ../core/src/handlers/member.ts
1708
+ function serializeMemberListQuery(params) {
1709
+ const queryParams = { ...params };
1710
+ if (Array.isArray(params.user_id)) {
1711
+ queryParams.user_id = JSON.stringify(params.user_id);
1712
+ }
1713
+ if (Array.isArray(params.email)) {
1714
+ queryParams.email = JSON.stringify(params.email);
1715
+ }
1716
+ return queryParams;
1717
+ }
1718
+ var memberHandlers = {
1719
+ async createMember(params) {
1720
+ const requestBody = buildRequestBodyFor("create-member", params);
1721
+ const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.CREATE_MEMBER}`, requestBody);
1722
+ if (response.data.code === 0) {
1723
+ return JSON.stringify(response.data.data, null, 2);
1724
+ }
1725
+ throw new Error(response.data.msg);
1726
+ },
1727
+ async updateMember(params) {
1728
+ const requestBody = buildRequestBodyFor("update-member", params);
1729
+ const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.UPDATE_MEMBER}`, requestBody);
1730
+ if (response.data.code === 0) {
1731
+ return JSON.stringify(response.data.data, null, 2);
1732
+ }
1733
+ throw new Error(response.data.msg);
1734
+ },
1735
+ async resetMemberPassword(params) {
1736
+ const requestBody = buildRequestBodyFor("reset-member-password", params);
1737
+ const response = await getApiClient().post(
1738
+ `${getLocalApiBase()}${API_ENDPOINTS.RESET_MEMBER_PASSWORD}`,
1739
+ requestBody
1740
+ );
1741
+ if (response.data.code === 0) {
1742
+ return JSON.stringify(response.data.data, null, 2);
1743
+ }
1744
+ throw new Error(response.data.msg);
1745
+ },
1746
+ async deleteMember(params) {
1747
+ const requestBody = buildRequestBodyFor("delete-member", params);
1748
+ const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.DELETE_MEMBER}`, requestBody);
1749
+ if (response.data.code === 0) {
1750
+ return JSON.stringify(response.data.data, null, 2);
1751
+ }
1752
+ throw new Error(response.data.msg);
1753
+ },
1754
+ async getMemberList(params) {
1755
+ const query = buildQueryParamsFor("get-member-list", serializeMemberListQuery(params));
1756
+ const response = await getApiClient().get(`${getLocalApiBase()}${API_ENDPOINTS.GET_MEMBER_LIST}`, { params: query });
1757
+ if (response.data.code === 0) {
1758
+ return JSON.stringify(response.data.data, null, 2);
1759
+ }
1760
+ throw new Error(response.data.msg);
1761
+ },
1762
+ async getMemberGroupList(params) {
1763
+ const query = buildQueryParamsFor("get-member-group-list", params);
1764
+ const response = await getApiClient().get(`${getLocalApiBase()}${API_ENDPOINTS.GET_MEMBER_GROUP_LIST}`, {
1765
+ params: query
1766
+ });
1767
+ if (response.data.code === 0) {
1768
+ return JSON.stringify(response.data.data, null, 2);
1769
+ }
1770
+ throw new Error(response.data.msg);
1771
+ }
1772
+ };
1773
+
1548
1774
  // ../core/src/handlers/application.ts
1549
1775
  var applicationHandlers = {
1550
1776
  async checkStatus() {
@@ -2279,7 +2505,7 @@ var schemas = {
2279
2505
  ipchecker: import_zod.z.enum(["ip2location", "ipapi", "ipfoxy"]).optional().describe("IP query channel"),
2280
2506
  category_id: import_zod.z.string().optional().describe("The category id of the browser, you can use the get-application-list tool to get the application list"),
2281
2507
  profile_tag_ids: import_zod.z.array(import_zod.z.string()).max(30).optional().describe('Tag IDs to assign to the profile, max 30 tags per profile. Example: ["tag1","tag2"]'),
2282
- fingerprint_config: fingerprintConfigSchema.optional().default({ random_ua: { ua_system_version: ["Windows"] }, browser_kernel_config: { version: "latest", type: "chrome" } }),
2508
+ fingerprint_config: fingerprintConfigSchema.optional().default({ browser_kernel_config: { version: "latest", type: "chrome" } }),
2283
2509
  platform_account: platformAccountSchema
2284
2510
  }).strict(),
2285
2511
  updateBrowserSchema: import_zod.z.object({
@@ -2339,6 +2565,17 @@ var schemas = {
2339
2565
  deleteBrowserSchema: import_zod.z.object({
2340
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")
2341
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
+ }),
2342
2579
  getBrowserListSchema: import_zod.z.object({
2343
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"),
2344
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"),
@@ -2399,6 +2636,49 @@ var schemas = {
2399
2636
  page_size: import_zod.z.number().optional().describe("The size of the page, max is 100, default is 10"),
2400
2637
  page: import_zod.z.number().optional().describe("The page of the group, default is 1")
2401
2638
  }).strict(),
2639
+ createMemberSchema: import_zod.z.object({
2640
+ user_group_id: import_zod.z.string().max(50).describe("Member group / role id. Use get-member-group-list to obtain it"),
2641
+ name: import_zod.z.string().max(50).optional().describe("Member display name, max 50 characters"),
2642
+ email: import_zod.z.string().max(70).describe("Member email, max 70 characters"),
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"),
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"),
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"),
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"),
2648
+ profile_limit: import_zod.z.number().optional().describe("Profile quota for this member"),
2649
+ remark: import_zod.z.string().max(100).optional().describe("Remark, max 100 characters")
2650
+ }).strict(),
2651
+ updateMemberSchema: import_zod.z.object({
2652
+ user_id: import_zod.z.string().max(50).describe("Member user_id to update"),
2653
+ user_group_id: import_zod.z.string().max(50).optional().describe("Member group / role id"),
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)"),
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"),
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"),
2661
+ profile_limit: import_zod.z.number().optional().describe("Profile quota for this member"),
2662
+ remark: import_zod.z.string().max(100).optional().describe("Remark, max 100 characters. Empty string clears the remark. Omit to keep unchanged")
2663
+ }).strict(),
2664
+ resetMemberPasswordSchema: import_zod.z.object({
2665
+ user_id: import_zod.z.string().max(50).describe("Member user_id whose password will be reset"),
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")
2667
+ }).strict(),
2668
+ deleteMemberSchema: import_zod.z.object({
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")
2670
+ }).strict(),
2671
+ getMemberListSchema: import_zod.z.object({
2672
+ user_group_id: import_zod.z.string().max(50).optional().describe("Filter by member group / role id"),
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"]'),
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"]'),
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")
2677
+ }).strict(),
2678
+ getMemberGroupListSchema: import_zod.z.object({
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")
2681
+ }).strict(),
2402
2682
  getApplicationListSchema: import_zod.z.object({
2403
2683
  category_id: import_zod.z.string().optional().describe("Extension category_id"),
2404
2684
  page: import_zod.z.number().optional().describe("Page number, default 1"),
@@ -2608,6 +2888,16 @@ var STATELESS_HANDLERS = {
2608
2888
  description: buildCliCommandDescription("delete-browser", "Delete the browser"),
2609
2889
  paramsDescription: schemaParamsDescription(schemas.deleteBrowserSchema, "delete-browser")
2610
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
+ },
2611
2901
  "get-browser-list": {
2612
2902
  fn: browserHandlers.getBrowserList,
2613
2903
  description: buildCliCommandDescription("get-browser-list", "Get the list of browsers"),
@@ -2699,6 +2989,36 @@ var STATELESS_HANDLERS = {
2699
2989
  description: buildCliCommandDescription("get-group-list", "Get the list of groups"),
2700
2990
  paramsDescription: schemaParamsDescription(schemas.getGroupListSchema, "get-group-list")
2701
2991
  },
2992
+ "create-member": {
2993
+ fn: memberHandlers.createMember,
2994
+ description: buildCliCommandDescription("create-member", "Create a team member"),
2995
+ paramsDescription: schemaParamsDescription(schemas.createMemberSchema, "create-member")
2996
+ },
2997
+ "update-member": {
2998
+ fn: memberHandlers.updateMember,
2999
+ description: buildCliCommandDescription("update-member", "Update a team member"),
3000
+ paramsDescription: schemaParamsDescription(schemas.updateMemberSchema, "update-member")
3001
+ },
3002
+ "reset-member-password": {
3003
+ fn: memberHandlers.resetMemberPassword,
3004
+ description: buildCliCommandDescription("reset-member-password", "Reset a team member password"),
3005
+ paramsDescription: schemaParamsDescription(schemas.resetMemberPasswordSchema, "reset-member-password")
3006
+ },
3007
+ "delete-member": {
3008
+ fn: memberHandlers.deleteMember,
3009
+ description: buildCliCommandDescription("delete-member", "Permanently delete a team member"),
3010
+ paramsDescription: schemaParamsDescription(schemas.deleteMemberSchema, "delete-member")
3011
+ },
3012
+ "get-member-list": {
3013
+ fn: memberHandlers.getMemberList,
3014
+ description: buildCliCommandDescription("get-member-list", "Get the list of team members"),
3015
+ paramsDescription: schemaParamsDescription(schemas.getMemberListSchema, "get-member-list")
3016
+ },
3017
+ "get-member-group-list": {
3018
+ fn: memberHandlers.getMemberGroupList,
3019
+ description: buildCliCommandDescription("get-member-group-list", "Get the list of member groups"),
3020
+ paramsDescription: schemaParamsDescription(schemas.getMemberGroupListSchema, "get-member-group-list")
3021
+ },
2702
3022
  "check-status": {
2703
3023
  fn: applicationHandlers.checkStatus,
2704
3024
  description: buildCliCommandDescription(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adspower-browser",
3
- "version": "2.1.2-beta.2",
3
+ "version": "2.1.2-beta.3",
4
4
  "main": "cli/index.js",
5
5
  "type": "commonjs",
6
6
  "bin": {