anchorbrowser 0.3.12__py3-none-any.whl → 0.4.0__py3-none-any.whl

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,487 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Dict, Union, Iterable
6
- from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
-
8
- from .._types import SequenceNotStr
9
-
10
- __all__ = [
11
- "BatchSessionCreateParams",
12
- "Configuration",
13
- "ConfigurationBrowser",
14
- "ConfigurationBrowserAdblock",
15
- "ConfigurationBrowserCaptchaSolver",
16
- "ConfigurationBrowserDisableWebSecurity",
17
- "ConfigurationBrowserExtraStealth",
18
- "ConfigurationBrowserFullscreen",
19
- "ConfigurationBrowserHeadless",
20
- "ConfigurationBrowserP2pDownload",
21
- "ConfigurationBrowserPopupBlocker",
22
- "ConfigurationBrowserProfile",
23
- "ConfigurationBrowserViewport",
24
- "ConfigurationIntegration",
25
- "ConfigurationIntegrationConfiguration",
26
- "ConfigurationIntegrationConfigurationOnePasswordAllSecretsConfig",
27
- "ConfigurationIntegrationConfigurationOnePasswordSpecificSecretsConfig",
28
- "ConfigurationSession",
29
- "ConfigurationSessionLiveView",
30
- "ConfigurationSessionProxy",
31
- "ConfigurationSessionProxyAnchorProxy",
32
- "ConfigurationSessionProxyCustomProxy",
33
- "ConfigurationSessionRecording",
34
- "ConfigurationSessionTimeout",
35
- ]
36
-
37
-
38
- class BatchSessionCreateParams(TypedDict, total=False):
39
- count: Required[int]
40
- """Number of sessions to create in the batch (1-1000)"""
41
-
42
- configuration: Configuration
43
- """Configuration that applies to all sessions in the batch"""
44
-
45
- metadata: Dict[str, object]
46
- """Optional batch-level metadata for identification and organization"""
47
-
48
-
49
- class ConfigurationBrowserAdblock(TypedDict, total=False):
50
- active: bool
51
- """Enable or disable ad-blocking. Defaults to `true`."""
52
-
53
-
54
- class ConfigurationBrowserCaptchaSolver(TypedDict, total=False):
55
- active: bool
56
- """Enable or disable captcha-solving.
57
-
58
- Requires proxy to be active. Defaults to `false`.
59
- """
60
-
61
-
62
- class ConfigurationBrowserDisableWebSecurity(TypedDict, total=False):
63
- active: bool
64
- """Whether to disable web security features (CORS, same-origin policy, etc.).
65
-
66
- Allows accessing iframes and resources from different origins. Defaults to
67
- `false`.
68
- """
69
-
70
-
71
- class ConfigurationBrowserExtraStealth(TypedDict, total=False):
72
- active: bool
73
- """Enable or disable extra stealth mode."""
74
-
75
-
76
- class ConfigurationBrowserFullscreen(TypedDict, total=False):
77
- active: bool
78
- """Enable or disable fullscreen mode.
79
-
80
- When enabled, the browser will start in fullscreen mode. Defaults to `false`.
81
- """
82
-
83
-
84
- class ConfigurationBrowserHeadless(TypedDict, total=False):
85
- active: bool
86
- """Whether browser should be headless or headful. Defaults to `false`."""
87
-
88
-
89
- class ConfigurationBrowserP2pDownload(TypedDict, total=False):
90
- active: bool
91
- """Enable or disable P2P downloads.
92
-
93
- When enabled, the browser will capture downloads for direct data extraction,
94
- instead of uploading them on Anchor's storage. Defaults to `false`.
95
- """
96
-
97
-
98
- class ConfigurationBrowserPopupBlocker(TypedDict, total=False):
99
- active: bool
100
- """Blocks popups, including ads and CAPTCHA consent banners.
101
-
102
- Requires adblock to be active. Defaults to `true`.
103
- """
104
-
105
-
106
- class ConfigurationBrowserProfile(TypedDict, total=False):
107
- name: str
108
- """The name of the profile to be used during the browser session."""
109
-
110
- persist: bool
111
- """
112
- Indicates whether the browser session profile data should be saved when the
113
- browser session ends. Defaults to `false`.
114
- """
115
-
116
-
117
- class ConfigurationBrowserViewport(TypedDict, total=False):
118
- height: int
119
- """Height of the viewport in pixels. Defaults to `900`."""
120
-
121
- width: int
122
- """Width of the viewport in pixels. Defaults to `1440`."""
123
-
124
-
125
- class ConfigurationBrowser(TypedDict, total=False):
126
- adblock: ConfigurationBrowserAdblock
127
- """Configuration for ad-blocking."""
128
-
129
- captcha_solver: ConfigurationBrowserCaptchaSolver
130
- """Configuration for captcha-solving."""
131
-
132
- disable_web_security: ConfigurationBrowserDisableWebSecurity
133
- """Configuration for disabling web security features."""
134
-
135
- extensions: SequenceNotStr[str]
136
- """Array of extension IDs to load in the browser session.
137
-
138
- Extensions must be previously uploaded using the Extensions API.
139
- """
140
-
141
- extra_stealth: ConfigurationBrowserExtraStealth
142
- """
143
- Configuration for extra stealth mode to enhance browser fingerprinting
144
- protection.
145
- """
146
-
147
- fullscreen: ConfigurationBrowserFullscreen
148
- """Configuration for fullscreen mode."""
149
-
150
- headless: ConfigurationBrowserHeadless
151
- """Configuration for headless mode."""
152
-
153
- p2p_download: ConfigurationBrowserP2pDownload
154
- """Configuration for peer-to-peer download capture functionality."""
155
-
156
- popup_blocker: ConfigurationBrowserPopupBlocker
157
- """Configuration for popup blocking."""
158
-
159
- profile: ConfigurationBrowserProfile
160
- """Options for managing and persisting browser session profiles."""
161
-
162
- viewport: ConfigurationBrowserViewport
163
- """Configuration for the browser's viewport size."""
164
-
165
-
166
- class ConfigurationIntegrationConfigurationOnePasswordAllSecretsConfig(TypedDict, total=False):
167
- load_mode: Required[Literal["all"]]
168
- """Load all secrets from 1Password"""
169
-
170
-
171
- class ConfigurationIntegrationConfigurationOnePasswordSpecificSecretsConfig(TypedDict, total=False):
172
- load_mode: Required[Literal["specific"]]
173
- """Load specific secrets from 1Password"""
174
-
175
- secrets: Required[SequenceNotStr[str]]
176
- """Array of secret references to load"""
177
-
178
-
179
- ConfigurationIntegrationConfiguration: TypeAlias = Union[
180
- ConfigurationIntegrationConfigurationOnePasswordAllSecretsConfig,
181
- ConfigurationIntegrationConfigurationOnePasswordSpecificSecretsConfig,
182
- ]
183
-
184
-
185
- class ConfigurationIntegration(TypedDict, total=False):
186
- id: Required[str]
187
- """Unique integration ID"""
188
-
189
- configuration: Required[ConfigurationIntegrationConfiguration]
190
-
191
- type: Required[Literal["1PASSWORD"]]
192
- """Integration type"""
193
-
194
-
195
- class ConfigurationSessionLiveView(TypedDict, total=False):
196
- read_only: bool
197
- """Enable or disable read-only mode for live viewing. Defaults to `false`."""
198
-
199
-
200
- class ConfigurationSessionProxyAnchorProxy(TypedDict, total=False):
201
- active: Required[bool]
202
-
203
- city: str
204
- """City name for precise geographic targeting.
205
-
206
- Supported for anchor_proxy only. Can only be used when region is also provided.
207
- """
208
-
209
- country_code: Literal[
210
- "af",
211
- "al",
212
- "dz",
213
- "ad",
214
- "ao",
215
- "as",
216
- "ag",
217
- "ar",
218
- "am",
219
- "aw",
220
- "au",
221
- "at",
222
- "az",
223
- "bs",
224
- "bh",
225
- "bb",
226
- "by",
227
- "be",
228
- "bz",
229
- "bj",
230
- "bm",
231
- "bo",
232
- "ba",
233
- "br",
234
- "bg",
235
- "bf",
236
- "cm",
237
- "ca",
238
- "cv",
239
- "td",
240
- "cl",
241
- "co",
242
- "cg",
243
- "cr",
244
- "ci",
245
- "hr",
246
- "cu",
247
- "cy",
248
- "cz",
249
- "dk",
250
- "dm",
251
- "do",
252
- "ec",
253
- "eg",
254
- "sv",
255
- "ee",
256
- "et",
257
- "fo",
258
- "fi",
259
- "fr",
260
- "gf",
261
- "pf",
262
- "ga",
263
- "gm",
264
- "ge",
265
- "de",
266
- "gh",
267
- "gi",
268
- "gr",
269
- "gd",
270
- "gp",
271
- "gt",
272
- "gg",
273
- "gn",
274
- "gw",
275
- "gy",
276
- "ht",
277
- "hn",
278
- "hu",
279
- "is",
280
- "in",
281
- "ir",
282
- "iq",
283
- "ie",
284
- "il",
285
- "it",
286
- "jm",
287
- "jp",
288
- "jo",
289
- "kz",
290
- "kw",
291
- "kg",
292
- "lv",
293
- "lb",
294
- "ly",
295
- "li",
296
- "lt",
297
- "lu",
298
- "mk",
299
- "ml",
300
- "mt",
301
- "mq",
302
- "mr",
303
- "mx",
304
- "md",
305
- "mc",
306
- "me",
307
- "ma",
308
- "nl",
309
- "nz",
310
- "ni",
311
- "ng",
312
- "no",
313
- "pk",
314
- "pa",
315
- "py",
316
- "pe",
317
- "ph",
318
- "pl",
319
- "pt",
320
- "pr",
321
- "qa",
322
- "ro",
323
- "lc",
324
- "sm",
325
- "sa",
326
- "sn",
327
- "rs",
328
- "sc",
329
- "sl",
330
- "sk",
331
- "si",
332
- "so",
333
- "za",
334
- "kr",
335
- "es",
336
- "sr",
337
- "se",
338
- "ch",
339
- "sy",
340
- "st",
341
- "tw",
342
- "tj",
343
- "tg",
344
- "tt",
345
- "tn",
346
- "tr",
347
- "tc",
348
- "ua",
349
- "ae",
350
- "us",
351
- "uy",
352
- "uz",
353
- "ve",
354
- "ye",
355
- "bd",
356
- "bw",
357
- "bn",
358
- "bi",
359
- "kh",
360
- "cn",
361
- "dj",
362
- "gq",
363
- "sz",
364
- "fj",
365
- "hk",
366
- "id",
367
- "ke",
368
- "la",
369
- "ls",
370
- "lr",
371
- "mg",
372
- "mw",
373
- "my",
374
- "mv",
375
- "mn",
376
- "mz",
377
- "mm",
378
- "na",
379
- "np",
380
- "nc",
381
- "ne",
382
- "om",
383
- "pg",
384
- "ru",
385
- "rw",
386
- "ws",
387
- "sg",
388
- "ss",
389
- "lk",
390
- "sd",
391
- "tz",
392
- "th",
393
- "tl",
394
- "tm",
395
- "ug",
396
- "gb",
397
- "vu",
398
- "vn",
399
- "zm",
400
- "zw",
401
- "bt",
402
- "mu",
403
- ]
404
- """Supported country codes ISO 2 lowercase
405
-
406
- **On change make sure to update the Proxy type.**
407
- """
408
-
409
- region: str
410
- """
411
- Region code for more specific geographic targeting. The city parameter can only
412
- be used when region is also provided.
413
- """
414
-
415
- type: Literal["anchor_proxy", "anchor_residential", "anchor_mobile", "anchor_gov"]
416
- """**On change make sure to update the country_code.**"""
417
-
418
-
419
- class ConfigurationSessionProxyCustomProxy(TypedDict, total=False):
420
- active: Required[bool]
421
-
422
- password: Required[str]
423
- """Proxy password"""
424
-
425
- server: Required[str]
426
- """Proxy server address"""
427
-
428
- type: Required[Literal["custom"]]
429
-
430
- username: Required[str]
431
- """Proxy username"""
432
-
433
-
434
- ConfigurationSessionProxy: TypeAlias = Union[ConfigurationSessionProxyAnchorProxy, ConfigurationSessionProxyCustomProxy]
435
-
436
-
437
- class ConfigurationSessionRecording(TypedDict, total=False):
438
- active: bool
439
- """Enable or disable video recording of the browser session. Defaults to `true`."""
440
-
441
-
442
- class ConfigurationSessionTimeout(TypedDict, total=False):
443
- idle_timeout: int
444
- """
445
- The amount of time (in minutes) the browser session waits for new connections
446
- after all others are closed before stopping. Defaults to `5`.
447
- """
448
-
449
- max_duration: int
450
- """Maximum amount of time (in minutes) for the browser to run before terminating.
451
-
452
- Defaults to `20`.
453
- """
454
-
455
-
456
- class ConfigurationSession(TypedDict, total=False):
457
- initial_url: str
458
- """The URL to navigate to when the browser session starts.
459
-
460
- If not provided, the browser will load an empty page.
461
- """
462
-
463
- live_view: ConfigurationSessionLiveView
464
- """Configuration for live viewing the browser session."""
465
-
466
- proxy: ConfigurationSessionProxy
467
- """Proxy Documentation available at [Proxy Documentation](/advanced/proxy)"""
468
-
469
- recording: ConfigurationSessionRecording
470
- """Configuration for session recording."""
471
-
472
- timeout: ConfigurationSessionTimeout
473
- """Timeout configurations for the browser session."""
474
-
475
-
476
- class Configuration(TypedDict, total=False):
477
- browser: ConfigurationBrowser
478
- """Browser-specific configurations."""
479
-
480
- integrations: Iterable[ConfigurationIntegration]
481
- """Array of integrations to load in the browser session.
482
-
483
- Integrations must be previously created using the Integrations API.
484
- """
485
-
486
- session: ConfigurationSession
487
- """Session-related configurations."""
@@ -1,27 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from typing import Optional
4
- from datetime import datetime
5
- from typing_extensions import Literal
6
-
7
- from .._models import BaseModel
8
-
9
- __all__ = ["BatchSessionCreateResponse", "Data"]
10
-
11
-
12
- class Data(BaseModel):
13
- batch_id: Optional[str] = None
14
- """Unique identifier for the batch"""
15
-
16
- created_at: Optional[datetime] = None
17
- """Timestamp when the batch was created"""
18
-
19
- status: Optional[Literal["pending", "processing", "completed", "failed"]] = None
20
- """Current status of the batch"""
21
-
22
- total_requests: Optional[int] = None
23
- """Total number of sessions requested in the batch"""
24
-
25
-
26
- class BatchSessionCreateResponse(BaseModel):
27
- data: Optional[Data] = None
@@ -1,90 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from typing import Dict, List, Optional
4
- from datetime import datetime
5
- from typing_extensions import Literal
6
-
7
- from .._models import BaseModel
8
-
9
- __all__ = ["BatchSessionRetrieveResponse", "Data", "DataProgress", "DataSession"]
10
-
11
-
12
- class DataProgress(BaseModel):
13
- current_phase: Optional[Literal["queued", "provisioning", "configuring", "ready"]] = None
14
- """Current processing phase"""
15
-
16
- percentage: Optional[float] = None
17
- """Completion percentage (0-100)"""
18
-
19
-
20
- class DataSession(BaseModel):
21
- cdp_url: Optional[str] = None
22
- """CDP websocket connection URL (if session is ready)"""
23
-
24
- completed_at: Optional[datetime] = None
25
- """Timestamp when session creation completed"""
26
-
27
- error: Optional[str] = None
28
- """Error message if session creation failed"""
29
-
30
- item_index: Optional[int] = None
31
- """Index of this session within the batch (0-based)"""
32
-
33
- live_view_url: Optional[str] = None
34
- """Live view URL for the session (if session is ready)"""
35
-
36
- metadata: Optional[Dict[str, object]] = None
37
- """Session-specific metadata"""
38
-
39
- retry_count: Optional[int] = None
40
- """Number of times this session creation has been retried"""
41
-
42
- session_id: Optional[str] = None
43
- """Unique identifier for the browser session (if created successfully)"""
44
-
45
- started_at: Optional[datetime] = None
46
- """Timestamp when session creation started"""
47
-
48
- status: Optional[Literal["pending", "processing", "completed", "failed"]] = None
49
- """Current status of this individual session"""
50
-
51
-
52
- class Data(BaseModel):
53
- actual_completion_time: Optional[datetime] = None
54
- """Timestamp when the batch completed (if completed)"""
55
-
56
- batch_id: Optional[str] = None
57
- """Unique identifier for the batch"""
58
-
59
- completed_requests: Optional[int] = None
60
- """Number of sessions successfully created"""
61
-
62
- created_at: Optional[datetime] = None
63
- """Timestamp when the batch was created"""
64
-
65
- error: Optional[str] = None
66
- """Error message if batch failed"""
67
-
68
- failed_requests: Optional[int] = None
69
- """Number of sessions that failed to create"""
70
-
71
- pending_requests: Optional[int] = None
72
- """Number of sessions waiting to be processed"""
73
-
74
- processing_requests: Optional[int] = None
75
- """Number of sessions currently being processed"""
76
-
77
- progress: Optional[DataProgress] = None
78
-
79
- sessions: Optional[List[DataSession]] = None
80
- """Array of individual session details"""
81
-
82
- status: Optional[Literal["pending", "processing", "completed", "failed"]] = None
83
- """Current status of the batch"""
84
-
85
- total_requests: Optional[int] = None
86
- """Total number of sessions requested"""
87
-
88
-
89
- class BatchSessionRetrieveResponse(BaseModel):
90
- data: Optional[Data] = None