@roxybrowser/openapi 1.0.11 → 1.0.12

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/lib/cli.js CHANGED
@@ -125,6 +125,10 @@ var ListAccounts = class {
125
125
 
126
126
  error message: ${result.msg}`;
127
127
  } else {
128
+ const currentPage = params.pageIndex ?? 1;
129
+ const pageSize = params.pageSize ?? 15;
130
+ const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
131
+ const hasNextPage = currentPage < totalPages;
128
132
  text = `Found ${data.total} accounts in workspace ${params.workspaceId}:
129
133
 
130
134
  ${data.rows.map(
@@ -133,7 +137,14 @@ ${data.rows.map(
133
137
  - Platform URL: ${account.platformUrl}
134
138
  - Remarks: ${account.platformRemarks || "N/A"}
135
139
  - Created: ${account.createTime}`
136
- ).join("\n\n")}`;
140
+ ).join("\n\n")}
141
+
142
+ Pagination:
143
+ - currentPage: ${currentPage}
144
+ - pageSize: ${pageSize}
145
+ - totalPages: ${totalPages}
146
+ - hasNextPage: ${hasNextPage}
147
+ ${hasNextPage ? `- nextPageHint: Call roxy_list_accounts again with pageIndex=${currentPage + 1}` : "- nextPageHint: No more pages"}`;
137
148
  }
138
149
  return {
139
150
  content: [
@@ -570,13 +581,13 @@ var ProxyList = class {
570
581
  }
571
582
  async handle(params) {
572
583
  const searchParams = new URLSearchParams();
573
- searchParams.append("workspaceId", params.workspaceId);
584
+ searchParams.append("workspaceId", params.workspaceId.toString());
574
585
  if (params.id)
575
- searchParams.append("id", params.id);
576
- if (params.page_index)
577
- searchParams.append("page_index", params.pageIndex);
578
- if (params.page_size)
579
- searchParams.append("page_size", params.pageSize);
586
+ searchParams.append("id", params.id.toString());
587
+ if (params.pageIndex)
588
+ searchParams.append("page_index", params.pageIndex.toString());
589
+ if (params.pageSize)
590
+ searchParams.append("page_size", params.pageSize.toString());
580
591
  if (!params.workspaceId) {
581
592
  throw new Error("workspaceId is required");
582
593
  }
@@ -584,6 +595,10 @@ var ProxyList = class {
584
595
  let text = "";
585
596
  if (result.code === 0) {
586
597
  const data = result.data;
598
+ const currentPage = params.pageIndex ?? 1;
599
+ const pageSize = params.pageSize ?? 15;
600
+ const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
601
+ const hasNextPage = currentPage < totalPages;
587
602
  const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
588
603
  const statusText = proxy.checkStatus === 1 ? "\u2705 available" : proxy.checkStatus === 2 ? "\u274C unavailable" : "\u23F3 not checked";
589
604
  const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
@@ -610,7 +625,14 @@ ${ipInfo.length > 0 ? `${ipInfo.join("")}
610
625
  }).join("\n\n") : "";
611
626
  text = `\u{1F4CB} **proxy list** (total: ${data.total})
612
627
 
613
- ${proxyListText}`;
628
+ ${proxyListText}
629
+
630
+ Pagination:
631
+ - currentPage: ${currentPage}
632
+ - pageSize: ${pageSize}
633
+ - totalPages: ${totalPages}
634
+ - hasNextPage: ${hasNextPage}
635
+ ${hasNextPage ? `- nextPageHint: Call roxy_list_proxies again with pageIndex=${currentPage + 1}` : "- nextPageHint: No more pages"}`;
614
636
  } else {
615
637
  text = `\u274C **get proxy list failed**
616
638
 
@@ -657,16 +679,20 @@ var ProxyStore = class {
657
679
  async handle(params) {
658
680
  const searchParams = new URLSearchParams();
659
681
  searchParams.append("workspaceId", params.workspaceId.toString());
660
- if (params.page_index)
661
- searchParams.append("page_index", params.page_index.toString());
662
- if (params.page_size)
663
- searchParams.append("page_size", params.page_size.toString());
682
+ if (params.pageIndex)
683
+ searchParams.append("page_index", params.pageIndex.toString());
684
+ if (params.pageSize)
685
+ searchParams.append("page_size", params.pageSize.toString());
664
686
  if (params.type)
665
687
  searchParams.append("type", params.type.toString());
666
688
  const result = await request(`/proxy/bought_list?${searchParams}`);
667
689
  let text = "";
668
690
  if (result.code === 0) {
669
691
  const data = result.data;
692
+ const currentPage = params.pageIndex ?? 1;
693
+ const pageSize = params.pageSize ?? 15;
694
+ const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
695
+ const hasNextPage = currentPage < totalPages;
670
696
  const proxyListText = data.rows.length > 0 ? data.rows.map((proxy, index) => {
671
697
  const statusText = proxy.checkStatus === 1 ? "\u2705 available" : proxy.checkStatus === 2 ? "\u274C unavailable" : "\u23F3 not checked";
672
698
  const name = `proxy (id: ${proxy.id}) ${proxy.remark ? `remark: ${proxy.remark}` : ""}`;
@@ -690,7 +716,14 @@ ${ipInfo.join("")}
690
716
  }).join("\n\n") : "";
691
717
  text = `\u{1F4CB} **proxy store** (total: ${data.total})
692
718
 
693
- ${proxyListText}`;
719
+ ${proxyListText}
720
+
721
+ Pagination:
722
+ - currentPage: ${currentPage}
723
+ - pageSize: ${pageSize}
724
+ - totalPages: ${totalPages}
725
+ - hasNextPage: ${hasNextPage}
726
+ ${hasNextPage ? `- nextPageHint: Call roxy_store_proxies again with pageIndex=${currentPage + 1}` : "- nextPageHint: No more pages"}`;
694
727
  } else {
695
728
  text = `\u274C **get proxy store failed**
696
729
 
@@ -1703,7 +1736,7 @@ var CreateBrowser = class {
1703
1736
  isTimeZone: { type: "boolean", description: "Follow IP for timezone" },
1704
1737
  timeZone: { type: "string", description: "Custom timezone" },
1705
1738
  // Geolocation
1706
- position: { type: "number", enum: [0, 1, 2], description: "Geolocation prompt: 0=ask, 1=allow, 2=deny" },
1739
+ position: { type: "number", description: "Geolocation prompt: 0=ask, 1=allow, 2=deny" },
1707
1740
  isPositionBaseIp: { type: "boolean", description: "Follow IP for geolocation" },
1708
1741
  longitude: { type: "string", description: "Custom longitude" },
1709
1742
  latitude: { type: "string", description: "Custom latitude" },
@@ -1739,14 +1772,14 @@ var CreateBrowser = class {
1739
1772
  stopOpenNet: { type: "boolean", description: "Stop opening if network fails" },
1740
1773
  stopOpenIP: { type: "boolean", description: "Stop opening if IP changes" },
1741
1774
  stopOpenPosition: { type: "boolean", description: "Stop opening if IP location changes" },
1742
- openWorkbench: { type: "number", enum: [0, 1, 2], description: "Open workbench: 0=close, 1=open, 2=follow app" },
1775
+ openWorkbench: { type: "number", description: "Open workbench: 0=close, 1=open, 2=follow app" },
1743
1776
  // Display settings
1744
1777
  resolutionType: { type: "boolean", description: "Custom resolution vs follow system" },
1745
1778
  resolutionX: { type: "string", description: "Custom resolution width" },
1746
1779
  resolutionY: { type: "string", description: "Custom resolution height" },
1747
1780
  fontType: { type: "boolean", description: "Random fonts vs system fonts" },
1748
1781
  // Browser fingerprint settings
1749
- webRTC: { type: "number", enum: [0, 1, 2], description: "WebRTC: 0=replace, 1=real, 2=disable" },
1782
+ webRTC: { type: "number", description: "WebRTC: 0=replace, 1=real, 2=disable" },
1750
1783
  webGL: { type: "boolean", description: "WebGL: random vs real" },
1751
1784
  webGLInfo: { type: "boolean", description: "WebGL info: custom vs real" },
1752
1785
  webGLManufacturer: { type: "string", description: "Custom WebGL manufacturer" },
@@ -2129,6 +2162,10 @@ var ListBrowsers = class {
2129
2162
 
2130
2163
  error message: ${result.msg}`;
2131
2164
  } else {
2165
+ const currentPage = params.pageIndex ?? 1;
2166
+ const pageSize = params.pageSize ?? 15;
2167
+ const totalPages = Math.max(1, Math.ceil((data.total || 0) / pageSize));
2168
+ const hasNextPage = currentPage < totalPages;
2132
2169
  text = `Found ${data.total} browsers in workspace ${params.workspaceId}:
2133
2170
 
2134
2171
  ${data.rows.map(
@@ -2137,7 +2174,14 @@ ${data.rows.map(
2137
2174
  - OSVersion: ${browser.osVersion}
2138
2175
  - OS: ${browser.os}
2139
2176
  - Remark: ${browser.windowRemark}`
2140
- ).join("\n\n")}`;
2177
+ ).join("\n\n")}
2178
+
2179
+ Pagination:
2180
+ - currentPage: ${currentPage}
2181
+ - pageSize: ${pageSize}
2182
+ - totalPages: ${totalPages}
2183
+ - hasNextPage: ${hasNextPage}
2184
+ ${hasNextPage ? `- nextPageHint: Call roxy_list_browsers again with pageIndex=${currentPage + 1}` : "- nextPageHint: No more pages"}`;
2141
2185
  }
2142
2186
  return {
2143
2187
  content: [