adspower-browser 2.1.1 → 2.1.2-beta.1
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 +2 -0
- package/cli/index.js +72 -0
- package/package.json +1 -1
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, default 1). 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
|
```
|
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", default: 1 },
|
|
618
|
+
limit: { apiName: "limit", location: "body", default: 1 }
|
|
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",
|
|
@@ -881,6 +898,8 @@ var API_ENDPOINTS = {
|
|
|
881
898
|
GET_BROWSER_LIST: LOCAL_API_CONTRACTS["get-browser-list"].path,
|
|
882
899
|
UPDATE_BROWSER: LOCAL_API_CONTRACTS["update-browser"].path,
|
|
883
900
|
DELETE_BROWSER: LOCAL_API_CONTRACTS["delete-browser"].path,
|
|
901
|
+
GET_RECYCLE_BIN_LIST: LOCAL_API_CONTRACTS["get-recycle-bin-list"].path,
|
|
902
|
+
RESTORE_RECYCLE_BIN: LOCAL_API_CONTRACTS["restore-recycle-bin"].path,
|
|
884
903
|
GET_PROFILE_COOKIES: LOCAL_API_CONTRACTS["get-profile-cookies"].path,
|
|
885
904
|
GET_PROFILE_UA: LOCAL_API_CONTRACTS["get-profile-ua"].path,
|
|
886
905
|
CLOSE_ALL_PROFILES: LOCAL_API_CONTRACTS["close-all-profiles"].path,
|
|
@@ -959,6 +978,18 @@ var TOOL_INTENT_BY_NAME = {
|
|
|
959
978
|
triggersEn: "remove profile, delete account, trash browser",
|
|
960
979
|
triggersZh: "\u5220\u9664\u73AF\u5883,\u79FB\u9664profile,\u5220\u6389\u6D4F\u89C8\u5668\u8D26\u53F7"
|
|
961
980
|
},
|
|
981
|
+
"get-recycle-bin-list": {
|
|
982
|
+
intentEn: "List browser profiles in the recycle bin from the last 30 days.",
|
|
983
|
+
intentZh: "\u67E5\u8BE2\u8FD1 30 \u5929\u56DE\u6536\u7AD9\u4E2D\u7684\u6D4F\u89C8\u5668\u73AF\u5883\u3002",
|
|
984
|
+
triggersEn: "recycle bin, deleted profiles, trash list, recently deleted",
|
|
985
|
+
triggersZh: "\u56DE\u6536\u7AD9,\u5DF2\u5220\u9664\u73AF\u5883,\u6700\u8FD1\u5220\u9664,\u5783\u573E\u6876\u5217\u8868"
|
|
986
|
+
},
|
|
987
|
+
"restore-recycle-bin": {
|
|
988
|
+
intentEn: "Restore one deleted browser profile from the recycle bin into a target group.",
|
|
989
|
+
intentZh: "\u628A\u56DE\u6536\u7AD9\u91CC\u7684\u4E00\u4E2A\u73AF\u5883\u6062\u590D\u5230\u6307\u5B9A\u5206\u7EC4\u3002",
|
|
990
|
+
triggersEn: "restore profile, recover deleted browser, undelete environment",
|
|
991
|
+
triggersZh: "\u6062\u590D\u73AF\u5883,\u8FD8\u539F\u56DE\u6536\u7AD9,\u627E\u56DE\u5DF2\u5220\u9664\u73AF\u5883"
|
|
992
|
+
},
|
|
962
993
|
"get-browser-list": {
|
|
963
994
|
intentEn: "List or search browser profiles (pagination, filters).",
|
|
964
995
|
intentZh: "\u5206\u9875/\u6761\u4EF6\u67E5\u8BE2\u6D4F\u89C8\u5668 profile \u5217\u8868\u3002",
|
|
@@ -1426,6 +1457,26 @@ var browserHandlers = {
|
|
|
1426
1457
|
}
|
|
1427
1458
|
throw new Error(response.data.msg);
|
|
1428
1459
|
},
|
|
1460
|
+
async getRecycleBinList(params) {
|
|
1461
|
+
const response = await getApiClient().post(
|
|
1462
|
+
`${getLocalApiBase()}${API_ENDPOINTS.GET_RECYCLE_BIN_LIST}`,
|
|
1463
|
+
buildRequestBodyFor("get-recycle-bin-list", params)
|
|
1464
|
+
);
|
|
1465
|
+
if (response.data.code === 0) {
|
|
1466
|
+
return JSON.stringify(response.data.data, null, 2);
|
|
1467
|
+
}
|
|
1468
|
+
throw new Error(response.data.msg);
|
|
1469
|
+
},
|
|
1470
|
+
async restoreRecycleBin(params) {
|
|
1471
|
+
const response = await getApiClient().post(
|
|
1472
|
+
`${getLocalApiBase()}${API_ENDPOINTS.RESTORE_RECYCLE_BIN}`,
|
|
1473
|
+
buildRequestBodyFor("restore-recycle-bin", params)
|
|
1474
|
+
);
|
|
1475
|
+
if (response.data.code === 0) {
|
|
1476
|
+
return JSON.stringify(response.data.data, null, 2);
|
|
1477
|
+
}
|
|
1478
|
+
throw new Error(response.data.msg);
|
|
1479
|
+
},
|
|
1429
1480
|
async getBrowserList(params) {
|
|
1430
1481
|
const requestBody = buildRequestBodyFor("get-browser-list", params);
|
|
1431
1482
|
const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.GET_BROWSER_LIST}`, requestBody);
|
|
@@ -2338,6 +2389,17 @@ var schemas = {
|
|
|
2338
2389
|
deleteBrowserSchema: import_zod.z.object({
|
|
2339
2390
|
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")
|
|
2340
2391
|
}).strict(),
|
|
2392
|
+
getRecycleBinListSchema: import_zod.z.object({
|
|
2393
|
+
page: import_zod.z.number().int().min(1).optional().describe("Page number. Defaults to 1. Only profiles deleted in the last 30 days and visible to the caller are returned."),
|
|
2394
|
+
limit: import_zod.z.number().int().min(1).max(100).optional().describe("Profiles per page, range 1-100. Defaults to 1 when omitted.")
|
|
2395
|
+
}).strict(),
|
|
2396
|
+
restoreRecycleBinSchema: import_zod.z.object({
|
|
2397
|
+
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."),
|
|
2398
|
+
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."),
|
|
2399
|
+
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.')
|
|
2400
|
+
}).strict().refine((data) => data.profile_id || data.profile_no, {
|
|
2401
|
+
message: "Either profile_id or profile_no must be provided"
|
|
2402
|
+
}),
|
|
2341
2403
|
getBrowserListSchema: import_zod.z.object({
|
|
2342
2404
|
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"),
|
|
2343
2405
|
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"),
|
|
@@ -2607,6 +2669,16 @@ var STATELESS_HANDLERS = {
|
|
|
2607
2669
|
description: buildCliCommandDescription("delete-browser", "Delete the browser"),
|
|
2608
2670
|
paramsDescription: schemaParamsDescription(schemas.deleteBrowserSchema, "delete-browser")
|
|
2609
2671
|
},
|
|
2672
|
+
"get-recycle-bin-list": {
|
|
2673
|
+
fn: browserHandlers.getRecycleBinList,
|
|
2674
|
+
description: buildCliCommandDescription("get-recycle-bin-list", "List browser profiles in the recycle bin from the last 30 days"),
|
|
2675
|
+
paramsDescription: schemaParamsDescription(schemas.getRecycleBinListSchema, "get-recycle-bin-list")
|
|
2676
|
+
},
|
|
2677
|
+
"restore-recycle-bin": {
|
|
2678
|
+
fn: browserHandlers.restoreRecycleBin,
|
|
2679
|
+
description: buildCliCommandDescription("restore-recycle-bin", "Restore a deleted browser profile from the recycle bin into a group"),
|
|
2680
|
+
paramsDescription: schemaParamsDescription(schemas.restoreRecycleBinSchema, "restore-recycle-bin")
|
|
2681
|
+
},
|
|
2610
2682
|
"get-browser-list": {
|
|
2611
2683
|
fn: browserHandlers.getBrowserList,
|
|
2612
2684
|
description: buildCliCommandDescription("get-browser-list", "Get the list of browsers"),
|