anchorbrowser 0.1.1__py3-none-any.whl → 0.3.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.
Files changed (39) hide show
  1. anchorbrowser/_client.py +17 -1
  2. anchorbrowser/_models.py +3 -0
  3. anchorbrowser/_version.py +1 -1
  4. anchorbrowser/resources/__init__.py +28 -0
  5. anchorbrowser/resources/batch_sessions.py +288 -0
  6. anchorbrowser/resources/profiles.py +1 -115
  7. anchorbrowser/resources/sessions/__init__.py +14 -0
  8. anchorbrowser/resources/sessions/agent/__init__.py +33 -0
  9. anchorbrowser/resources/sessions/agent/agent.py +273 -0
  10. anchorbrowser/resources/sessions/agent/files.py +280 -0
  11. anchorbrowser/resources/sessions/mouse.py +1 -233
  12. anchorbrowser/resources/sessions/sessions.py +39 -1
  13. anchorbrowser/resources/task.py +465 -0
  14. anchorbrowser/types/__init__.py +7 -1
  15. anchorbrowser/types/batch_session_create_params.py +487 -0
  16. anchorbrowser/types/batch_session_create_response.py +27 -0
  17. anchorbrowser/types/batch_session_retrieve_response.py +90 -0
  18. anchorbrowser/types/session_create_params.py +52 -9
  19. anchorbrowser/types/sessions/__init__.py +0 -4
  20. anchorbrowser/types/sessions/agent/__init__.py +7 -0
  21. anchorbrowser/types/sessions/agent/file_list_response.py +32 -0
  22. anchorbrowser/types/sessions/agent/file_upload_params.py +14 -0
  23. anchorbrowser/types/sessions/agent/file_upload_response.py +17 -0
  24. anchorbrowser/types/task/__init__.py +6 -0
  25. anchorbrowser/types/task/run_execute_params.py +324 -0
  26. anchorbrowser/types/task/run_execute_response.py +33 -0
  27. anchorbrowser/types/task_create_params.py +317 -0
  28. anchorbrowser/types/task_create_response.py +345 -0
  29. anchorbrowser/types/task_list_params.py +15 -0
  30. anchorbrowser/types/task_list_response.py +361 -0
  31. {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/METADATA +6 -6
  32. {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/RECORD +34 -20
  33. anchorbrowser/types/profile_update_params.py +0 -21
  34. anchorbrowser/types/sessions/mouse_down_params.py +0 -18
  35. anchorbrowser/types/sessions/mouse_down_response.py +0 -11
  36. anchorbrowser/types/sessions/mouse_up_params.py +0 -18
  37. anchorbrowser/types/sessions/mouse_up_response.py +0 -11
  38. {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/WHEEL +0 -0
  39. {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Union
5
+ from typing import Union, Iterable
6
6
  from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
7
 
8
8
  from .._types import SequenceNotStr
@@ -13,12 +13,17 @@ __all__ = [
13
13
  "BrowserAdblock",
14
14
  "BrowserCaptchaSolver",
15
15
  "BrowserDisableWebSecurity",
16
+ "BrowserExtraStealth",
16
17
  "BrowserFullscreen",
17
18
  "BrowserHeadless",
18
19
  "BrowserP2pDownload",
19
20
  "BrowserPopupBlocker",
20
21
  "BrowserProfile",
21
22
  "BrowserViewport",
23
+ "Integration",
24
+ "IntegrationConfiguration",
25
+ "IntegrationConfigurationOnePasswordAllSecretsConfig",
26
+ "IntegrationConfigurationOnePasswordSpecificSecretsConfig",
22
27
  "Session",
23
28
  "SessionLiveView",
24
29
  "SessionProxy",
@@ -33,6 +38,12 @@ class SessionCreateParams(TypedDict, total=False):
33
38
  browser: Browser
34
39
  """Browser-specific configurations."""
35
40
 
41
+ integrations: Iterable[Integration]
42
+ """Array of integrations to load in the browser session.
43
+
44
+ Integrations must be previously created using the Integrations API.
45
+ """
46
+
36
47
  session: Session
37
48
  """Session-related configurations."""
38
49
 
@@ -59,6 +70,11 @@ class BrowserDisableWebSecurity(TypedDict, total=False):
59
70
  """
60
71
 
61
72
 
73
+ class BrowserExtraStealth(TypedDict, total=False):
74
+ active: bool
75
+ """Enable or disable extra stealth mode."""
76
+
77
+
62
78
  class BrowserFullscreen(TypedDict, total=False):
63
79
  active: bool
64
80
  """Enable or disable fullscreen mode.
@@ -99,12 +115,6 @@ class BrowserProfile(TypedDict, total=False):
99
115
  browser session ends. Defaults to `false`.
100
116
  """
101
117
 
102
- reset_preferences: bool
103
- """When enabled, resets the profile's preferences on session creation.
104
-
105
- Defaults to `false`.
106
- """
107
-
108
118
 
109
119
  class BrowserViewport(TypedDict, total=False):
110
120
  height: int
@@ -130,6 +140,12 @@ class Browser(TypedDict, total=False):
130
140
  Extensions must be previously uploaded using the Extensions API.
131
141
  """
132
142
 
143
+ extra_stealth: BrowserExtraStealth
144
+ """
145
+ Configuration for extra stealth mode to enhance browser fingerprinting
146
+ protection.
147
+ """
148
+
133
149
  fullscreen: BrowserFullscreen
134
150
  """Configuration for fullscreen mode."""
135
151
 
@@ -149,6 +165,34 @@ class Browser(TypedDict, total=False):
149
165
  """Configuration for the browser's viewport size."""
150
166
 
151
167
 
168
+ class IntegrationConfigurationOnePasswordAllSecretsConfig(TypedDict, total=False):
169
+ load_mode: Required[Literal["all"]]
170
+ """Load all secrets from 1Password"""
171
+
172
+
173
+ class IntegrationConfigurationOnePasswordSpecificSecretsConfig(TypedDict, total=False):
174
+ load_mode: Required[Literal["specific"]]
175
+ """Load specific secrets from 1Password"""
176
+
177
+ secrets: Required[SequenceNotStr[str]]
178
+ """Array of secret references to load"""
179
+
180
+
181
+ IntegrationConfiguration: TypeAlias = Union[
182
+ IntegrationConfigurationOnePasswordAllSecretsConfig, IntegrationConfigurationOnePasswordSpecificSecretsConfig
183
+ ]
184
+
185
+
186
+ class Integration(TypedDict, total=False):
187
+ id: Required[str]
188
+ """Unique integration ID"""
189
+
190
+ configuration: Required[IntegrationConfiguration]
191
+
192
+ type: Required[Literal["1PASSWORD"]]
193
+ """Integration type"""
194
+
195
+
152
196
  class SessionLiveView(TypedDict, total=False):
153
197
  read_only: bool
154
198
  """Enable or disable read-only mode for live viewing. Defaults to `false`."""
@@ -162,7 +206,6 @@ class SessionProxyAnchorProxy(TypedDict, total=False):
162
206
  """City name for precise geographic targeting.
163
207
 
164
208
  Supported for anchor_proxy only. Can only be used when region is also provided.
165
- Example: "San Francisco", "los-angeles", "london"
166
209
  """
167
210
 
168
211
  country_code: Literal[
@@ -368,7 +411,7 @@ class SessionProxyAnchorProxy(TypedDict, total=False):
368
411
  region: str
369
412
  """
370
413
  Region code for more specific geographic targeting. The city parameter can only
371
- be used when region is also provided. Example: "ca" for California
414
+ be used when region is also provided.
372
415
  """
373
416
 
374
417
  type: Literal["anchor_proxy", "anchor_residential", "anchor_mobile", "anchor_gov"]
@@ -2,13 +2,9 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from .mouse_up_params import MouseUpParams as MouseUpParams
6
- from .mouse_down_params import MouseDownParams as MouseDownParams
7
5
  from .mouse_move_params import MouseMoveParams as MouseMoveParams
8
- from .mouse_up_response import MouseUpResponse as MouseUpResponse
9
6
  from .mouse_click_params import MouseClickParams as MouseClickParams
10
7
  from .all_status_response import AllStatusResponse as AllStatusResponse
11
- from .mouse_down_response import MouseDownResponse as MouseDownResponse
12
8
  from .mouse_move_response import MouseMoveResponse as MouseMoveResponse
13
9
  from .clipboard_set_params import ClipboardSetParams as ClipboardSetParams
14
10
  from .keyboard_type_params import KeyboardTypeParams as KeyboardTypeParams
@@ -0,0 +1,7 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .file_list_response import FileListResponse as FileListResponse
6
+ from .file_upload_params import FileUploadParams as FileUploadParams
7
+ from .file_upload_response import FileUploadResponse as FileUploadResponse
@@ -0,0 +1,32 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from ...._models import BaseModel
9
+
10
+ __all__ = ["FileListResponse", "Data", "DataFile"]
11
+
12
+
13
+ class DataFile(BaseModel):
14
+ last_modified: Optional[datetime] = FieldInfo(alias="lastModified", default=None)
15
+ """When the resource was last modified"""
16
+
17
+ name: Optional[str] = None
18
+ """The resource name"""
19
+
20
+ size: Optional[int] = None
21
+ """Resource size in bytes"""
22
+
23
+ type: Optional[str] = None
24
+ """Resource extension/type"""
25
+
26
+
27
+ class Data(BaseModel):
28
+ files: Optional[List[DataFile]] = None
29
+
30
+
31
+ class FileListResponse(BaseModel):
32
+ data: Optional[Data] = None
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ from ...._types import FileTypes
8
+
9
+ __all__ = ["FileUploadParams"]
10
+
11
+
12
+ class FileUploadParams(TypedDict, total=False):
13
+ file: Required[FileTypes]
14
+ """File to upload as agent resource (ZIP files will be extracted automatically)"""
@@ -0,0 +1,17 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from ...._models import BaseModel
6
+
7
+ __all__ = ["FileUploadResponse", "Data"]
8
+
9
+
10
+ class Data(BaseModel):
11
+ message: Optional[str] = None
12
+
13
+ status: Optional[str] = None
14
+
15
+
16
+ class FileUploadResponse(BaseModel):
17
+ data: Optional[Data] = None
@@ -0,0 +1,6 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .run_execute_params import RunExecuteParams as RunExecuteParams
6
+ from .run_execute_response import RunExecuteResponse as RunExecuteResponse
@@ -0,0 +1,324 @@
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
6
+ from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
+
8
+ from ..._utils import PropertyInfo
9
+
10
+ __all__ = [
11
+ "RunExecuteParams",
12
+ "OverrideBrowserConfiguration",
13
+ "OverrideBrowserConfigurationLiveView",
14
+ "OverrideBrowserConfigurationProxy",
15
+ "OverrideBrowserConfigurationProxyAnchorProxy",
16
+ "OverrideBrowserConfigurationProxyCustomProxy",
17
+ "OverrideBrowserConfigurationRecording",
18
+ "OverrideBrowserConfigurationTimeout",
19
+ ]
20
+
21
+
22
+ class RunExecuteParams(TypedDict, total=False):
23
+ task_id: Required[Annotated[str, PropertyInfo(alias="taskId")]]
24
+ """Task identifier"""
25
+
26
+ inputs: Dict[str, str]
27
+ """Environment variables for task execution (keys must start with ANCHOR\\__)"""
28
+
29
+ override_browser_configuration: Annotated[
30
+ OverrideBrowserConfiguration, PropertyInfo(alias="overrideBrowserConfiguration")
31
+ ]
32
+ """Override browser configuration for this execution"""
33
+
34
+ session_id: Annotated[str, PropertyInfo(alias="sessionId")]
35
+ """Optional existing session ID to use"""
36
+
37
+ task_session_id: Annotated[str, PropertyInfo(alias="taskSessionId")]
38
+ """Optional task-specific session ID"""
39
+
40
+ version: str
41
+ """Version to run (draft, latest, or version number)"""
42
+
43
+
44
+ class OverrideBrowserConfigurationLiveView(TypedDict, total=False):
45
+ read_only: bool
46
+ """Enable or disable read-only mode for live viewing. Defaults to `false`."""
47
+
48
+
49
+ class OverrideBrowserConfigurationProxyAnchorProxy(TypedDict, total=False):
50
+ active: Required[bool]
51
+
52
+ city: str
53
+ """City name for precise geographic targeting.
54
+
55
+ Supported for anchor_proxy only. Can only be used when region is also provided.
56
+ """
57
+
58
+ country_code: Literal[
59
+ "af",
60
+ "al",
61
+ "dz",
62
+ "ad",
63
+ "ao",
64
+ "as",
65
+ "ag",
66
+ "ar",
67
+ "am",
68
+ "aw",
69
+ "au",
70
+ "at",
71
+ "az",
72
+ "bs",
73
+ "bh",
74
+ "bb",
75
+ "by",
76
+ "be",
77
+ "bz",
78
+ "bj",
79
+ "bm",
80
+ "bo",
81
+ "ba",
82
+ "br",
83
+ "bg",
84
+ "bf",
85
+ "cm",
86
+ "ca",
87
+ "cv",
88
+ "td",
89
+ "cl",
90
+ "co",
91
+ "cg",
92
+ "cr",
93
+ "ci",
94
+ "hr",
95
+ "cu",
96
+ "cy",
97
+ "cz",
98
+ "dk",
99
+ "dm",
100
+ "do",
101
+ "ec",
102
+ "eg",
103
+ "sv",
104
+ "ee",
105
+ "et",
106
+ "fo",
107
+ "fi",
108
+ "fr",
109
+ "gf",
110
+ "pf",
111
+ "ga",
112
+ "gm",
113
+ "ge",
114
+ "de",
115
+ "gh",
116
+ "gi",
117
+ "gr",
118
+ "gd",
119
+ "gp",
120
+ "gt",
121
+ "gg",
122
+ "gn",
123
+ "gw",
124
+ "gy",
125
+ "ht",
126
+ "hn",
127
+ "hu",
128
+ "is",
129
+ "in",
130
+ "ir",
131
+ "iq",
132
+ "ie",
133
+ "il",
134
+ "it",
135
+ "jm",
136
+ "jp",
137
+ "jo",
138
+ "kz",
139
+ "kw",
140
+ "kg",
141
+ "lv",
142
+ "lb",
143
+ "ly",
144
+ "li",
145
+ "lt",
146
+ "lu",
147
+ "mk",
148
+ "ml",
149
+ "mt",
150
+ "mq",
151
+ "mr",
152
+ "mx",
153
+ "md",
154
+ "mc",
155
+ "me",
156
+ "ma",
157
+ "nl",
158
+ "nz",
159
+ "ni",
160
+ "ng",
161
+ "no",
162
+ "pk",
163
+ "pa",
164
+ "py",
165
+ "pe",
166
+ "ph",
167
+ "pl",
168
+ "pt",
169
+ "pr",
170
+ "qa",
171
+ "ro",
172
+ "lc",
173
+ "sm",
174
+ "sa",
175
+ "sn",
176
+ "rs",
177
+ "sc",
178
+ "sl",
179
+ "sk",
180
+ "si",
181
+ "so",
182
+ "za",
183
+ "kr",
184
+ "es",
185
+ "sr",
186
+ "se",
187
+ "ch",
188
+ "sy",
189
+ "st",
190
+ "tw",
191
+ "tj",
192
+ "tg",
193
+ "tt",
194
+ "tn",
195
+ "tr",
196
+ "tc",
197
+ "ua",
198
+ "ae",
199
+ "us",
200
+ "uy",
201
+ "uz",
202
+ "ve",
203
+ "ye",
204
+ "bd",
205
+ "bw",
206
+ "bn",
207
+ "bi",
208
+ "kh",
209
+ "cn",
210
+ "dj",
211
+ "gq",
212
+ "sz",
213
+ "fj",
214
+ "hk",
215
+ "id",
216
+ "ke",
217
+ "la",
218
+ "ls",
219
+ "lr",
220
+ "mg",
221
+ "mw",
222
+ "my",
223
+ "mv",
224
+ "mn",
225
+ "mz",
226
+ "mm",
227
+ "na",
228
+ "np",
229
+ "nc",
230
+ "ne",
231
+ "om",
232
+ "pg",
233
+ "ru",
234
+ "rw",
235
+ "ws",
236
+ "sg",
237
+ "ss",
238
+ "lk",
239
+ "sd",
240
+ "tz",
241
+ "th",
242
+ "tl",
243
+ "tm",
244
+ "ug",
245
+ "gb",
246
+ "vu",
247
+ "vn",
248
+ "zm",
249
+ "zw",
250
+ "bt",
251
+ "mu",
252
+ ]
253
+ """Supported country codes ISO 2 lowercase
254
+
255
+ **On change make sure to update the Proxy type.**
256
+ """
257
+
258
+ region: str
259
+ """
260
+ Region code for more specific geographic targeting. The city parameter can only
261
+ be used when region is also provided.
262
+ """
263
+
264
+ type: Literal["anchor_proxy", "anchor_residential", "anchor_mobile", "anchor_gov"]
265
+ """**On change make sure to update the country_code.**"""
266
+
267
+
268
+ class OverrideBrowserConfigurationProxyCustomProxy(TypedDict, total=False):
269
+ active: Required[bool]
270
+
271
+ password: Required[str]
272
+ """Proxy password"""
273
+
274
+ server: Required[str]
275
+ """Proxy server address"""
276
+
277
+ type: Required[Literal["custom"]]
278
+
279
+ username: Required[str]
280
+ """Proxy username"""
281
+
282
+
283
+ OverrideBrowserConfigurationProxy: TypeAlias = Union[
284
+ OverrideBrowserConfigurationProxyAnchorProxy, OverrideBrowserConfigurationProxyCustomProxy
285
+ ]
286
+
287
+
288
+ class OverrideBrowserConfigurationRecording(TypedDict, total=False):
289
+ active: bool
290
+ """Enable or disable video recording of the browser session. Defaults to `true`."""
291
+
292
+
293
+ class OverrideBrowserConfigurationTimeout(TypedDict, total=False):
294
+ idle_timeout: int
295
+ """
296
+ The amount of time (in minutes) the browser session waits for new connections
297
+ after all others are closed before stopping. Defaults to `5`.
298
+ """
299
+
300
+ max_duration: int
301
+ """Maximum amount of time (in minutes) for the browser to run before terminating.
302
+
303
+ Defaults to `20`.
304
+ """
305
+
306
+
307
+ class OverrideBrowserConfiguration(TypedDict, total=False):
308
+ initial_url: str
309
+ """The URL to navigate to when the browser session starts.
310
+
311
+ If not provided, the browser will load an empty page.
312
+ """
313
+
314
+ live_view: OverrideBrowserConfigurationLiveView
315
+ """Configuration for live viewing the browser session."""
316
+
317
+ proxy: OverrideBrowserConfigurationProxy
318
+ """Proxy Documentation available at [Proxy Documentation](/advanced/proxy)"""
319
+
320
+ recording: OverrideBrowserConfigurationRecording
321
+ """Configuration for session recording."""
322
+
323
+ timeout: OverrideBrowserConfigurationTimeout
324
+ """Timeout configurations for the browser session."""
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from pydantic import Field as FieldInfo
6
+
7
+ from ..._models import BaseModel
8
+
9
+ __all__ = ["RunExecuteResponse", "Data"]
10
+
11
+
12
+ class Data(BaseModel):
13
+ message: str
14
+ """Execution result message"""
15
+
16
+ success: bool
17
+ """Whether the task executed successfully"""
18
+
19
+ task_id: str = FieldInfo(alias="taskId")
20
+ """Task identifier"""
21
+
22
+ error: Optional[str] = None
23
+ """Error message if execution failed"""
24
+
25
+ execution_time: Optional[float] = FieldInfo(alias="executionTime", default=None)
26
+ """Execution duration in milliseconds"""
27
+
28
+ output: Optional[str] = None
29
+ """Task execution output"""
30
+
31
+
32
+ class RunExecuteResponse(BaseModel):
33
+ data: Optional[Data] = None