@roxybrowser/openapi 1.0.7 → 1.0.9

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.
@@ -1,5 +1,430 @@
1
1
  import { request } from '../utils/index.js';
2
2
  import { proxyList, proxyStore } from './proxy.js';
3
+ const osversion_windows = [
4
+ {
5
+ label: '11',
6
+ type: 'osVersion-Windows',
7
+ value: '11',
8
+ },
9
+ {
10
+ label: '10',
11
+ type: 'osVersion-Windows',
12
+ value: '10',
13
+ },
14
+ {
15
+ label: '8',
16
+ type: 'osVersion-Windows',
17
+ value: '8',
18
+ },
19
+ {
20
+ label: '7',
21
+ type: 'osVersion-Windows',
22
+ value: '7',
23
+ },
24
+ ];
25
+ const osversion_macos = [
26
+ {
27
+ label: '15.3.2',
28
+ type: 'osVersion-macOS',
29
+ value: '15.3.2',
30
+ },
31
+ {
32
+ label: '15.3.1',
33
+ type: 'osVersion-macOS',
34
+ value: '15.3.1',
35
+ },
36
+ {
37
+ label: '15.3',
38
+ type: 'osVersion-macOS',
39
+ value: '15.3',
40
+ },
41
+ {
42
+ label: '15.2',
43
+ type: 'osVersion-macOS',
44
+ value: '15.2',
45
+ },
46
+ {
47
+ label: '15.1',
48
+ type: 'osVersion-macOS',
49
+ value: '15.1',
50
+ },
51
+ {
52
+ label: '15.0.1',
53
+ type: 'osVersion-macOS',
54
+ value: '15.0.1',
55
+ },
56
+ {
57
+ label: '15.0',
58
+ type: 'osVersion-macOS',
59
+ value: '15.0',
60
+ },
61
+ {
62
+ label: '14.7.4',
63
+ type: 'osVersion-macOS',
64
+ value: '14.7.4',
65
+ },
66
+ {
67
+ label: '14.7.3',
68
+ type: 'osVersion-macOS',
69
+ value: '14.7.3',
70
+ },
71
+ {
72
+ label: '14.7.2',
73
+ type: 'osVersion-macOS',
74
+ value: '14.7.2',
75
+ },
76
+ {
77
+ label: '14.7.1',
78
+ type: 'osVersion-macOS',
79
+ value: '14.7.1',
80
+ },
81
+ {
82
+ label: '14.7',
83
+ type: 'osVersion-macOS',
84
+ value: '14.7',
85
+ },
86
+ {
87
+ label: '14.6.1',
88
+ type: 'osVersion-macOS',
89
+ value: '14.6.1',
90
+ },
91
+ {
92
+ label: '14.6',
93
+ type: 'osVersion-macOS',
94
+ value: '14.6',
95
+ },
96
+ {
97
+ label: '14.5',
98
+ type: 'osVersion-macOS',
99
+ value: '14.5',
100
+ },
101
+ {
102
+ label: '14.4.1',
103
+ type: 'osVersion-macOS',
104
+ value: '14.4.1',
105
+ },
106
+ {
107
+ label: '14.4',
108
+ type: 'osVersion-macOS',
109
+ value: '14.4',
110
+ },
111
+ {
112
+ label: '14.3.1',
113
+ type: 'osVersion-macOS',
114
+ value: '14.3.1',
115
+ },
116
+ {
117
+ label: '14.3',
118
+ type: 'osVersion-macOS',
119
+ value: '14.3',
120
+ },
121
+ {
122
+ label: '14.2.1',
123
+ type: 'osVersion-macOS',
124
+ value: '14.2.1',
125
+ },
126
+ {
127
+ label: '14.2',
128
+ type: 'osVersion-macOS',
129
+ value: '14.2',
130
+ },
131
+ {
132
+ label: '14.1',
133
+ type: 'osVersion-macOS',
134
+ value: '14.1',
135
+ },
136
+ {
137
+ label: '13.7.4',
138
+ type: 'osVersion-macOS',
139
+ value: '13.7.4',
140
+ },
141
+ {
142
+ label: '13.7.3',
143
+ type: 'osVersion-macOS',
144
+ value: '13.7.3',
145
+ },
146
+ {
147
+ label: '13.7.2',
148
+ type: 'osVersion-macOS',
149
+ value: '13.7.2',
150
+ },
151
+ {
152
+ label: '13.7.1',
153
+ type: 'osVersion-macOS',
154
+ value: '13.7.1',
155
+ },
156
+ {
157
+ label: '13.7',
158
+ type: 'osVersion-macOS',
159
+ value: '13.7',
160
+ },
161
+ {
162
+ label: 'ALL',
163
+ type: 'osVersion-macOS',
164
+ value: 'ALL',
165
+ },
166
+ ];
167
+ const osversion_linux = [
168
+ {
169
+ label: 'ALL',
170
+ type: 'osVersion-Linux',
171
+ value: 'ALL',
172
+ },
173
+ ];
174
+ const osversion_android = [
175
+ {
176
+ label: '15',
177
+ type: 'osVersion-Android',
178
+ value: '15',
179
+ },
180
+ {
181
+ label: '14',
182
+ type: 'osVersion-Android',
183
+ value: '14',
184
+ },
185
+ {
186
+ label: '13',
187
+ type: 'osVersion-Android',
188
+ value: '13',
189
+ },
190
+ {
191
+ label: '12',
192
+ type: 'osVersion-Android',
193
+ value: '12',
194
+ },
195
+ {
196
+ label: '11',
197
+ type: 'osVersion-Android',
198
+ value: '11',
199
+ },
200
+ {
201
+ label: '10',
202
+ type: 'osVersion-Android',
203
+ value: '10',
204
+ },
205
+ {
206
+ label: '9',
207
+ type: 'osVersion-Android',
208
+ value: '9',
209
+ },
210
+ ];
211
+ const osversion_ios = [
212
+ {
213
+ label: '18.2',
214
+ type: 'osVersion-IOS',
215
+ value: '18.2',
216
+ },
217
+ {
218
+ label: '18.1',
219
+ type: 'osVersion-IOS',
220
+ value: '18.1',
221
+ },
222
+ {
223
+ label: '18.0',
224
+ type: 'osVersion-IOS',
225
+ value: '18.0',
226
+ },
227
+ {
228
+ label: '17.0',
229
+ type: 'osVersion-IOS',
230
+ value: '17.0',
231
+ },
232
+ {
233
+ label: '16.6',
234
+ type: 'osVersion-IOS',
235
+ value: '16.6',
236
+ },
237
+ {
238
+ label: '16.5',
239
+ type: 'osVersion-IOS',
240
+ value: '16.5',
241
+ },
242
+ {
243
+ label: '16.4',
244
+ type: 'osVersion-IOS',
245
+ value: '16.4',
246
+ },
247
+ {
248
+ label: '16.3',
249
+ type: 'osVersion-IOS',
250
+ value: '16.3',
251
+ },
252
+ {
253
+ label: '16.2',
254
+ type: 'osVersion-IOS',
255
+ value: '16.2',
256
+ },
257
+ {
258
+ label: '16.1',
259
+ type: 'osVersion-IOS',
260
+ value: '16.1',
261
+ },
262
+ {
263
+ label: '16.0',
264
+ type: 'osVersion-IOS',
265
+ value: '16.0',
266
+ },
267
+ {
268
+ label: '15.7',
269
+ type: 'osVersion-IOS',
270
+ value: '15.7',
271
+ },
272
+ {
273
+ label: '15.6',
274
+ type: 'osVersion-IOS',
275
+ value: '15.6',
276
+ },
277
+ {
278
+ label: '15.5',
279
+ type: 'osVersion-IOS',
280
+ value: '15.5',
281
+ },
282
+ {
283
+ label: '15.4',
284
+ type: 'osVersion-IOS',
285
+ value: '15.4',
286
+ },
287
+ {
288
+ label: '15.3',
289
+ type: 'osVersion-IOS',
290
+ value: '15.3',
291
+ },
292
+ {
293
+ label: '15.2',
294
+ type: 'osVersion-IOS',
295
+ value: '15.2',
296
+ },
297
+ {
298
+ label: '15.1',
299
+ type: 'osVersion-IOS',
300
+ value: '15.1',
301
+ },
302
+ {
303
+ label: '15.0',
304
+ type: 'osVersion-IOS',
305
+ value: '15.0',
306
+ },
307
+ {
308
+ label: '14.7',
309
+ type: 'osVersion-IOS',
310
+ value: '14.7',
311
+ },
312
+ {
313
+ label: '14.6',
314
+ type: 'osVersion-IOS',
315
+ value: '14.6',
316
+ },
317
+ {
318
+ label: '14.5',
319
+ type: 'osVersion-IOS',
320
+ value: '14.5',
321
+ },
322
+ {
323
+ label: '14.4',
324
+ type: 'osVersion-IOS',
325
+ value: '14.4',
326
+ },
327
+ {
328
+ label: '14.3',
329
+ type: 'osVersion-IOS',
330
+ value: '14.3',
331
+ },
332
+ {
333
+ label: '14.2',
334
+ type: 'osVersion-IOS',
335
+ value: '14.2',
336
+ },
337
+ {
338
+ label: '14.1',
339
+ type: 'osVersion-IOS',
340
+ value: '14.1',
341
+ },
342
+ {
343
+ label: '14.0',
344
+ type: 'osVersion-IOS',
345
+ value: '14.0',
346
+ },
347
+ ];
348
+ const coreVersion = [
349
+ {
350
+ label: 'RoxyChrome 144',
351
+ type: 'coreVersion',
352
+ value: '144',
353
+ },
354
+ {
355
+ label: 'RoxyChrome 143',
356
+ type: 'coreVersion',
357
+ value: '143',
358
+ },
359
+ {
360
+ label: 'RoxyChrome 142',
361
+ type: 'coreVersion',
362
+ value: '142',
363
+ },
364
+ {
365
+ label: 'RoxyChrome 141',
366
+ type: 'coreVersion',
367
+ value: '141',
368
+ },
369
+ {
370
+ label: 'RoxyChrome 140',
371
+ type: 'coreVersion',
372
+ value: '140',
373
+ },
374
+ {
375
+ label: 'RoxyChrome 139',
376
+ type: 'coreVersion',
377
+ value: '139',
378
+ },
379
+ {
380
+ label: 'RoxyChrome 138',
381
+ type: 'coreVersion',
382
+ value: '138',
383
+ },
384
+ {
385
+ label: 'RoxyChrome 137',
386
+ type: 'coreVersion',
387
+ value: '137',
388
+ },
389
+ {
390
+ label: 'RoxyChrome 136',
391
+ type: 'coreVersion',
392
+ value: '136',
393
+ },
394
+ {
395
+ label: 'RoxyChrome 135',
396
+ type: 'coreVersion',
397
+ value: '135',
398
+ },
399
+ {
400
+ label: 'RoxyChrome 133',
401
+ type: 'coreVersion',
402
+ value: '133',
403
+ },
404
+ {
405
+ label: 'RoxyChrome 130',
406
+ type: 'coreVersion',
407
+ value: '130',
408
+ },
409
+ {
410
+ label: 'RoxyChrome 125',
411
+ type: 'coreVersion',
412
+ value: '125',
413
+ },
414
+ {
415
+ label: 'RoxyChrome 117',
416
+ type: 'coreVersion',
417
+ value: '117',
418
+ },
419
+ {
420
+ label: 'RoxyChrome 109',
421
+ type: 'coreVersion',
422
+ value: '109',
423
+ },
424
+ ];
425
+ function osVersionString() {
426
+ return `Windows: ${osversion_windows.map(item => item.value).join(',')}; macOS: ${osversion_macos.map(item => item.value).join(',')}; Linux: ${osversion_linux.map(item => item.value).join(',')}; Android: ${osversion_android.map(item => item.value).join(',')}; IOS: ${osversion_ios.map(item => item.value).join(',')}`;
427
+ }
3
428
  class CreateBrowser {
4
429
  name = 'roxy_create_browser';
5
430
  description = 'Create a browser with complete configuration control - for expert users needing full parameter access';
@@ -8,56 +433,57 @@ class CreateBrowser {
8
433
  properties: {
9
434
  workspaceId: {
10
435
  type: 'number',
11
- description: 'Workspace ID (required)',
436
+ description: 'Workspace ID',
12
437
  },
13
438
  windowName: {
14
439
  type: 'string',
15
- description: 'Browser window name (optional)',
440
+ description: 'Browser window name',
16
441
  },
17
442
  coreVersion: {
18
443
  type: 'string',
19
- enum: ['144', '143', '142', '141', '140', '138', '137', '136', '135', '133', '130', '125', '117', '109'],
20
- description: 'Browser core version (optional). If not provided, the latest available core version will be used.',
444
+ enum: coreVersion.map(item => item.value),
445
+ description: 'Browser core version. If not provided, the latest available core version will be used.',
21
446
  },
22
447
  os: {
23
448
  type: 'string',
24
449
  enum: ['Windows', 'macOS', 'Linux', 'IOS', 'Android'],
25
- description: 'Operating system (optional, default: Windows)',
450
+ description: 'Operating system (default: Windows)',
26
451
  },
27
452
  osVersion: {
28
453
  type: 'string',
29
- description: `Windows: 11,10,8,7; macOS: 15.3.2,15.3.1,15.3,15.2,15.1,15.0.1,15.0,14.7.4,14.7.3,14.7.2,14.7.1,14.7,14.6.1,14.6,14.5,14.4.1,14.4,14.3.1,14.3,14.2.1,14.2,14.1,13.7.4,13.7.3,13.7.2,13.7.1,13.7; Linux: ALL; Android: 14,13,12,11,10,9; IOS: 18.2,18.1,18.0,17.0,16.6,16.5,16.4,16.3,16.2,16.1,16.0,15.7,15.6,15.5,15.4,15.3,15.2,15.1,15.0,14.7,14.6,14.5,14.4,14.3,14.2,14.1,14.0 (optional)`,
454
+ description: osVersionString(),
30
455
  },
31
456
  userAgent: {
32
457
  type: 'string',
33
- description: 'Custom user agent (optional)',
458
+ description: 'Custom user agent',
34
459
  },
35
460
  cookie: {
36
461
  type: 'array',
37
- description: 'Cookie list (optional)',
462
+ description: 'Cookie list',
463
+ items: { type: 'object' },
38
464
  },
39
465
  searchEngine: {
40
466
  type: 'string',
41
467
  enum: ['Google', 'Microsoft Bing', 'Yahoo', 'Yandex', 'DuckDuckGo'],
42
- description: 'Default search engine (optional)',
468
+ description: 'Default search engine',
43
469
  },
44
470
  labelIds: {
45
471
  type: 'array',
46
472
  items: { type: 'number' },
47
- description: 'Label IDs to assign (optional)',
473
+ description: 'Label IDs to assign',
48
474
  },
49
475
  defaultOpenUrl: {
50
476
  type: 'array',
51
477
  items: { type: 'string' },
52
- description: 'URLs to open by default (optional)',
478
+ description: 'URLs to open by default',
53
479
  },
54
480
  windowRemark: {
55
481
  type: 'string',
56
- description: 'Window remarks/notes (optional)',
482
+ description: 'Window remarks/notes',
57
483
  },
58
484
  projectId: {
59
485
  type: 'number',
60
- description: 'Project ID (optional)',
486
+ description: 'Project ID',
61
487
  },
62
488
  windowPlatformList: {
63
489
  type: 'array',
@@ -73,11 +499,11 @@ class CreateBrowser {
73
499
  platformRemarks: { type: 'string', description: 'Platform remarks' },
74
500
  },
75
501
  },
76
- description: 'Platform account information (optional)',
502
+ description: 'Platform account information',
77
503
  },
78
504
  proxyInfo: {
79
505
  type: 'object',
80
- description: 'Complete proxy configuration object (optional)',
506
+ description: 'Complete proxy configuration object',
81
507
  properties: {
82
508
  // 如果有 moduleId ,则其他参数不可传递 (moduleId 可通过 roxy_list_proxies 或 roxy_store_proxies 获取) 优先使用该参数来绑定代理IP
83
509
  moduleId: { type: 'number', description: `If moduleId is provided, no other parameters may be passed. (moduleId can be obtained via ${proxyList.name} or ${proxyStore.name}. field: id) Priority to use this parameter to bind proxy IP` },
@@ -95,7 +521,7 @@ class CreateBrowser {
95
521
  },
96
522
  fingerInfo: {
97
523
  type: 'object',
98
- description: 'Complete fingerprint configuration (optional)',
524
+ description: 'Complete fingerprint configuration',
99
525
  properties: {
100
526
  // Language and timezone
101
527
  isLanguageBaseIp: { type: 'boolean', description: 'Follow IP for browser language' },
@@ -350,12 +776,12 @@ class OpenBrowser {
350
776
  properties: {
351
777
  workspaceId: {
352
778
  type: 'number',
353
- description: 'Workspace ID (required)',
779
+ description: 'Workspace ID',
354
780
  },
355
781
  dirIds: {
356
782
  type: 'array',
357
783
  items: { type: 'string' },
358
- description: 'Array of browser directory IDs to open (required)',
784
+ description: 'Array of browser directory IDs to open',
359
785
  },
360
786
  forceOpen: {
361
787
  type: 'boolean',
@@ -476,15 +902,15 @@ class ListBrowsers {
476
902
  properties: {
477
903
  workspaceId: {
478
904
  type: 'number',
479
- description: 'Workspace ID (required)',
905
+ description: 'Workspace ID',
480
906
  },
481
907
  projectIds: {
482
908
  type: 'string',
483
- description: 'Comma-separated project IDs (optional)',
909
+ description: 'Comma-separated project IDs',
484
910
  },
485
911
  windowName: {
486
912
  type: 'string',
487
- description: 'Filter by browser window name (optional)',
913
+ description: 'Filter by browser window name',
488
914
  },
489
915
  pageIndex: {
490
916
  type: 'number',
@@ -551,7 +977,7 @@ class CloseBrowsers {
551
977
  dirIds: {
552
978
  type: 'array',
553
979
  items: { type: 'string' },
554
- description: 'Array of browser directory IDs to close (required)',
980
+ description: 'Array of browser directory IDs to close',
555
981
  },
556
982
  },
557
983
  required: ['dirIds'],
@@ -619,12 +1045,12 @@ class DeleteBrowsers {
619
1045
  properties: {
620
1046
  workspaceId: {
621
1047
  type: 'number',
622
- description: 'Workspace ID (required)',
1048
+ description: 'Workspace ID',
623
1049
  },
624
1050
  dirIds: {
625
1051
  type: 'array',
626
1052
  items: { type: 'string' },
627
- description: 'Array of browser directory IDs to delete (required)',
1053
+ description: 'Array of browser directory IDs to delete',
628
1054
  },
629
1055
  },
630
1056
  required: ['workspaceId', 'dirIds'],
@@ -687,11 +1113,11 @@ class GetBrowserDetail {
687
1113
  properties: {
688
1114
  workspaceId: {
689
1115
  type: 'number',
690
- description: 'Workspace ID (required)',
1116
+ description: 'Workspace ID',
691
1117
  },
692
1118
  dirId: {
693
1119
  type: 'string',
694
- description: 'Browser directory ID (required)',
1120
+ description: 'Browser directory ID',
695
1121
  },
696
1122
  },
697
1123
  required: ['workspaceId', 'dirId'],
@@ -768,7 +1194,7 @@ class ClearLocalCache {
768
1194
  dirIds: {
769
1195
  type: 'array',
770
1196
  items: { type: 'string' },
771
- description: 'Array of browser directory IDs (required)',
1197
+ description: 'Array of browser directory IDs',
772
1198
  },
773
1199
  },
774
1200
  required: ['dirIds'],
@@ -800,11 +1226,11 @@ class ClearLocalCache {
800
1226
  text = `❌ **Failed to clear local cache:**\n\n error message: ${result.msg}`;
801
1227
  }
802
1228
  else {
803
- text = `✅ **Local Cache Cleared**
804
-
805
- **Browser Count:** ${params.dirIds.length}
806
-
807
- **Browser IDs:**
1229
+ text = `✅ **Local Cache Cleared**
1230
+
1231
+ **Browser Count:** ${params.dirIds.length}
1232
+
1233
+ **Browser IDs:**
808
1234
  ${params.dirIds.map((id, index) => ` ${index + 1}. \`${id}\``).join('\n')}`;
809
1235
  }
810
1236
  return {
@@ -825,12 +1251,12 @@ class ClearServerCache {
825
1251
  properties: {
826
1252
  workspaceId: {
827
1253
  type: 'number',
828
- description: 'Workspace ID (required)',
1254
+ description: 'Workspace ID',
829
1255
  },
830
1256
  dirIds: {
831
1257
  type: 'array',
832
1258
  items: { type: 'string' },
833
- description: 'Array of browser directory IDs (required)',
1259
+ description: 'Array of browser directory IDs',
834
1260
  },
835
1261
  },
836
1262
  required: ['workspaceId', 'dirIds'],
@@ -865,12 +1291,12 @@ class ClearServerCache {
865
1291
  text = `❌ **Failed to clear server cache:**\n\n error message: ${result.msg}`;
866
1292
  }
867
1293
  else {
868
- text = `✅ **Server Cache Cleared**
869
-
870
- **Workspace:** ${params.workspaceId}
871
- **Browser Count:** ${params.dirIds.length}
872
-
873
- **Browser IDs:**
1294
+ text = `✅ **Server Cache Cleared**
1295
+
1296
+ **Workspace:** ${params.workspaceId}
1297
+ **Browser Count:** ${params.dirIds.length}
1298
+
1299
+ **Browser IDs:**
874
1300
  ${params.dirIds.map((id, index) => ` ${index + 1}. \`${id}\``).join('\n')}`;
875
1301
  }
876
1302
  return {
@@ -891,11 +1317,11 @@ class RandomFingerprint {
891
1317
  properties: {
892
1318
  workspaceId: {
893
1319
  type: 'number',
894
- description: 'Workspace ID (required)',
1320
+ description: 'Workspace ID',
895
1321
  },
896
1322
  dirId: {
897
1323
  type: 'string',
898
- description: 'Browser directory ID (required)',
1324
+ description: 'Browser directory ID',
899
1325
  },
900
1326
  },
901
1327
  required: ['workspaceId', 'dirId'],
@@ -930,11 +1356,11 @@ class RandomFingerprint {
930
1356
  text = `❌ **Failed to randomize fingerprint:**\n\n error message: ${result.msg}`;
931
1357
  }
932
1358
  else {
933
- text = `✅ **Browser Fingerprint Randomized**
934
-
935
- **Browser ID:** \`${params.dirId}\`
936
- **Workspace:** ${params.workspaceId}
937
-
1359
+ text = `✅ **Browser Fingerprint Randomized**
1360
+
1361
+ **Browser ID:** \`${params.dirId}\`
1362
+ **Workspace:** ${params.workspaceId}
1363
+
938
1364
  *Browser fingerprint has been randomized. Restart the browser to apply changes.*`;
939
1365
  }
940
1366
  return {
@@ -955,7 +1381,7 @@ class ListLabels {
955
1381
  properties: {
956
1382
  workspaceId: {
957
1383
  type: 'number',
958
- description: 'Workspace ID (required)',
1384
+ description: 'Workspace ID',
959
1385
  },
960
1386
  },
961
1387
  required: ['workspaceId'],