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