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