adspower-browser 2.1.2-beta.1 → 2.1.2-beta.2

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 (2) hide show
  1. package/cli/index.js +2 -73
  2. package/package.json +1 -1
package/cli/index.js CHANGED
@@ -610,23 +610,6 @@ 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
- },
630
613
  "get-browser-list": {
631
614
  method: "POST",
632
615
  path: "/api/v2/browser-profile/list",
@@ -898,8 +881,6 @@ var API_ENDPOINTS = {
898
881
  GET_BROWSER_LIST: LOCAL_API_CONTRACTS["get-browser-list"].path,
899
882
  UPDATE_BROWSER: LOCAL_API_CONTRACTS["update-browser"].path,
900
883
  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,
903
884
  GET_PROFILE_COOKIES: LOCAL_API_CONTRACTS["get-profile-cookies"].path,
904
885
  GET_PROFILE_UA: LOCAL_API_CONTRACTS["get-profile-ua"].path,
905
886
  CLOSE_ALL_PROFILES: LOCAL_API_CONTRACTS["close-all-profiles"].path,
@@ -978,18 +959,6 @@ var TOOL_INTENT_BY_NAME = {
978
959
  triggersEn: "remove profile, delete account, trash browser",
979
960
  triggersZh: "\u5220\u9664\u73AF\u5883,\u79FB\u9664profile,\u5220\u6389\u6D4F\u89C8\u5668\u8D26\u53F7"
980
961
  },
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
- },
993
962
  "get-browser-list": {
994
963
  intentEn: "List or search browser profiles (pagination, filters).",
995
964
  intentZh: "\u5206\u9875/\u6761\u4EF6\u67E5\u8BE2\u6D4F\u89C8\u5668 profile \u5217\u8868\u3002",
@@ -1432,6 +1401,7 @@ var browserHandlers = {
1432
1401
  };
1433
1402
  }
1434
1403
  }
1404
+ console.log("=====> ", JSON.stringify(resolvedParams));
1435
1405
  const requestBody = buildRequestBodyFor("create-browser", resolvedParams);
1436
1406
  const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.CREATE_BROWSER}`, requestBody);
1437
1407
  if (response.data.code === 0) {
@@ -1457,26 +1427,6 @@ var browserHandlers = {
1457
1427
  }
1458
1428
  throw new Error(response.data.msg);
1459
1429
  },
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
- },
1480
1430
  async getBrowserList(params) {
1481
1431
  const requestBody = buildRequestBodyFor("get-browser-list", params);
1482
1432
  const response = await getApiClient().post(`${getLocalApiBase()}${API_ENDPOINTS.GET_BROWSER_LIST}`, requestBody);
@@ -2329,7 +2279,7 @@ var schemas = {
2329
2279
  ipchecker: import_zod.z.enum(["ip2location", "ipapi", "ipfoxy"]).optional().describe("IP query channel"),
2330
2280
  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"),
2331
2281
  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"]'),
2332
- fingerprint_config: fingerprintConfigSchema.optional().default({ browser_kernel_config: { version: "latest", type: "chrome" } }),
2282
+ fingerprint_config: fingerprintConfigSchema.optional().default({ random_ua: { ua_system_version: ["Windows"] }, browser_kernel_config: { version: "latest", type: "chrome" } }),
2333
2283
  platform_account: platformAccountSchema
2334
2284
  }).strict(),
2335
2285
  updateBrowserSchema: import_zod.z.object({
@@ -2389,17 +2339,6 @@ var schemas = {
2389
2339
  deleteBrowserSchema: import_zod.z.object({
2390
2340
  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")
2391
2341
  }).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
- }),
2403
2342
  getBrowserListSchema: import_zod.z.object({
2404
2343
  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"),
2405
2344
  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"),
@@ -2669,16 +2608,6 @@ var STATELESS_HANDLERS = {
2669
2608
  description: buildCliCommandDescription("delete-browser", "Delete the browser"),
2670
2609
  paramsDescription: schemaParamsDescription(schemas.deleteBrowserSchema, "delete-browser")
2671
2610
  },
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
- },
2682
2611
  "get-browser-list": {
2683
2612
  fn: browserHandlers.getBrowserList,
2684
2613
  description: buildCliCommandDescription("get-browser-list", "Get the list of browsers"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adspower-browser",
3
- "version": "2.1.2-beta.1",
3
+ "version": "2.1.2-beta.2",
4
4
  "main": "cli/index.js",
5
5
  "type": "commonjs",
6
6
  "bin": {