parsek-cdp 0.1.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.
- parsek_cdp/__init__.py +55 -0
- parsek_cdp/_logging.py +49 -0
- parsek_cdp/cdp/__init__.py +247 -0
- parsek_cdp/cdp/accessibility/__init__.py +15 -0
- parsek_cdp/cdp/accessibility/events.py +35 -0
- parsek_cdp/cdp/accessibility/functions.py +202 -0
- parsek_cdp/cdp/accessibility/types.py +235 -0
- parsek_cdp/cdp/animation/__init__.py +15 -0
- parsek_cdp/cdp/animation/events.py +52 -0
- parsek_cdp/cdp/animation/functions.py +140 -0
- parsek_cdp/cdp/animation/types.py +113 -0
- parsek_cdp/cdp/audits/__init__.py +15 -0
- parsek_cdp/cdp/audits/events.py +21 -0
- parsek_cdp/cdp/audits/functions.py +95 -0
- parsek_cdp/cdp/audits/types.py +1051 -0
- parsek_cdp/cdp/autofill/__init__.py +15 -0
- parsek_cdp/cdp/autofill/events.py +27 -0
- parsek_cdp/cdp/autofill/functions.py +64 -0
- parsek_cdp/cdp/autofill/types.py +108 -0
- parsek_cdp/cdp/backgroundservice/__init__.py +15 -0
- parsek_cdp/cdp/backgroundservice/events.py +40 -0
- parsek_cdp/cdp/backgroundservice/functions.py +59 -0
- parsek_cdp/cdp/backgroundservice/types.py +63 -0
- parsek_cdp/cdp/bluetoothemulation/__init__.py +15 -0
- parsek_cdp/cdp/bluetoothemulation/events.py +70 -0
- parsek_cdp/cdp/bluetoothemulation/functions.py +247 -0
- parsek_cdp/cdp/bluetoothemulation/types.py +120 -0
- parsek_cdp/cdp/browser/__init__.py +15 -0
- parsek_cdp/cdp/browser/events.py +46 -0
- parsek_cdp/cdp/browser/functions.py +350 -0
- parsek_cdp/cdp/browser/types.py +158 -0
- parsek_cdp/cdp/cachestorage/__init__.py +15 -0
- parsek_cdp/cdp/cachestorage/events.py +13 -0
- parsek_cdp/cdp/cachestorage/functions.py +126 -0
- parsek_cdp/cdp/cachestorage/types.py +89 -0
- parsek_cdp/cdp/cast/__init__.py +15 -0
- parsek_cdp/cdp/cast/events.py +38 -0
- parsek_cdp/cdp/cast/functions.py +77 -0
- parsek_cdp/cdp/cast/types.py +23 -0
- parsek_cdp/cdp/console/__init__.py +15 -0
- parsek_cdp/cdp/console/events.py +22 -0
- parsek_cdp/cdp/console/functions.py +36 -0
- parsek_cdp/cdp/console/types.py +30 -0
- parsek_cdp/cdp/css/__init__.py +15 -0
- parsek_cdp/cdp/css/events.py +79 -0
- parsek_cdp/cdp/css/functions.py +788 -0
- parsek_cdp/cdp/css/types.py +742 -0
- parsek_cdp/cdp/debugger/__init__.py +15 -0
- parsek_cdp/cdp/debugger/events.py +164 -0
- parsek_cdp/cdp/debugger/functions.py +663 -0
- parsek_cdp/cdp/debugger/types.py +171 -0
- parsek_cdp/cdp/deviceaccess/__init__.py +15 -0
- parsek_cdp/cdp/deviceaccess/events.py +30 -0
- parsek_cdp/cdp/deviceaccess/functions.py +54 -0
- parsek_cdp/cdp/deviceaccess/types.py +28 -0
- parsek_cdp/cdp/deviceorientation/__init__.py +15 -0
- parsek_cdp/cdp/deviceorientation/events.py +13 -0
- parsek_cdp/cdp/deviceorientation/functions.py +35 -0
- parsek_cdp/cdp/deviceorientation/types.py +10 -0
- parsek_cdp/cdp/dom/__init__.py +15 -0
- parsek_cdp/cdp/dom/events.py +228 -0
- parsek_cdp/cdp/dom/functions.py +1033 -0
- parsek_cdp/cdp/dom/types.py +293 -0
- parsek_cdp/cdp/domdebugger/__init__.py +15 -0
- parsek_cdp/cdp/domdebugger/events.py +13 -0
- parsek_cdp/cdp/domdebugger/functions.py +155 -0
- parsek_cdp/cdp/domdebugger/types.py +57 -0
- parsek_cdp/cdp/domsnapshot/__init__.py +15 -0
- parsek_cdp/cdp/domsnapshot/events.py +13 -0
- parsek_cdp/cdp/domsnapshot/functions.py +111 -0
- parsek_cdp/cdp/domsnapshot/types.py +312 -0
- parsek_cdp/cdp/domstorage/__init__.py +15 -0
- parsek_cdp/cdp/domstorage/events.py +60 -0
- parsek_cdp/cdp/domstorage/functions.py +79 -0
- parsek_cdp/cdp/domstorage/types.py +30 -0
- parsek_cdp/cdp/emulation/__init__.py +15 -0
- parsek_cdp/cdp/emulation/events.py +17 -0
- parsek_cdp/cdp/emulation/functions.py +688 -0
- parsek_cdp/cdp/emulation/types.py +305 -0
- parsek_cdp/cdp/eventbreakpoints/__init__.py +15 -0
- parsek_cdp/cdp/eventbreakpoints/events.py +13 -0
- parsek_cdp/cdp/eventbreakpoints/functions.py +41 -0
- parsek_cdp/cdp/eventbreakpoints/types.py +10 -0
- parsek_cdp/cdp/extensions/__init__.py +15 -0
- parsek_cdp/cdp/extensions/events.py +13 -0
- parsek_cdp/cdp/extensions/functions.py +118 -0
- parsek_cdp/cdp/extensions/types.py +19 -0
- parsek_cdp/cdp/fedcm/__init__.py +15 -0
- parsek_cdp/cdp/fedcm/events.py +45 -0
- parsek_cdp/cdp/fedcm/functions.py +93 -0
- parsek_cdp/cdp/fedcm/types.py +72 -0
- parsek_cdp/cdp/fetch/__init__.py +15 -0
- parsek_cdp/cdp/fetch/events.py +82 -0
- parsek_cdp/cdp/fetch/functions.py +215 -0
- parsek_cdp/cdp/fetch/types.py +81 -0
- parsek_cdp/cdp/filesystem/__init__.py +15 -0
- parsek_cdp/cdp/filesystem/events.py +13 -0
- parsek_cdp/cdp/filesystem/functions.py +36 -0
- parsek_cdp/cdp/filesystem/types.py +54 -0
- parsek_cdp/cdp/headlessexperimental/__init__.py +15 -0
- parsek_cdp/cdp/headlessexperimental/events.py +13 -0
- parsek_cdp/cdp/headlessexperimental/functions.py +77 -0
- parsek_cdp/cdp/headlessexperimental/types.py +24 -0
- parsek_cdp/cdp/heapprofiler/__init__.py +15 -0
- parsek_cdp/cdp/heapprofiler/events.py +65 -0
- parsek_cdp/cdp/heapprofiler/functions.py +193 -0
- parsek_cdp/cdp/heapprofiler/types.py +57 -0
- parsek_cdp/cdp/indexeddb/__init__.py +15 -0
- parsek_cdp/cdp/indexeddb/events.py +13 -0
- parsek_cdp/cdp/indexeddb/functions.py +232 -0
- parsek_cdp/cdp/indexeddb/types.py +120 -0
- parsek_cdp/cdp/input/__init__.py +15 -0
- parsek_cdp/cdp/input/events.py +25 -0
- parsek_cdp/cdp/input/functions.py +361 -0
- parsek_cdp/cdp/input/types.py +87 -0
- parsek_cdp/cdp/inspector/__init__.py +15 -0
- parsek_cdp/cdp/inspector/events.py +41 -0
- parsek_cdp/cdp/inspector/functions.py +27 -0
- parsek_cdp/cdp/inspector/types.py +10 -0
- parsek_cdp/cdp/io/__init__.py +15 -0
- parsek_cdp/cdp/io/events.py +13 -0
- parsek_cdp/cdp/io/functions.py +77 -0
- parsek_cdp/cdp/io/types.py +13 -0
- parsek_cdp/cdp/layertree/__init__.py +15 -0
- parsek_cdp/cdp/layertree/events.py +36 -0
- parsek_cdp/cdp/layertree/functions.py +178 -0
- parsek_cdp/cdp/layertree/types.py +104 -0
- parsek_cdp/cdp/log/__init__.py +15 -0
- parsek_cdp/cdp/log/events.py +22 -0
- parsek_cdp/cdp/log/functions.py +54 -0
- parsek_cdp/cdp/log/types.py +57 -0
- parsek_cdp/cdp/media/__init__.py +15 -0
- parsek_cdp/cdp/media/events.py +87 -0
- parsek_cdp/cdp/media/functions.py +27 -0
- parsek_cdp/cdp/media/types.py +101 -0
- parsek_cdp/cdp/memory/__init__.py +15 -0
- parsek_cdp/cdp/memory/events.py +13 -0
- parsek_cdp/cdp/memory/functions.py +164 -0
- parsek_cdp/cdp/memory/types.py +71 -0
- parsek_cdp/cdp/mixins/__init__.py +21 -0
- parsek_cdp/cdp/mixins/datatype.py +123 -0
- parsek_cdp/cdp/mixins/event.py +78 -0
- parsek_cdp/cdp/mixins/namespace.py +31 -0
- parsek_cdp/cdp/network/__init__.py +15 -0
- parsek_cdp/cdp/network/events.py +726 -0
- parsek_cdp/cdp/network/functions.py +734 -0
- parsek_cdp/cdp/network/types.py +1247 -0
- parsek_cdp/cdp/overlay/__init__.py +15 -0
- parsek_cdp/cdp/overlay/events.py +54 -0
- parsek_cdp/cdp/overlay/functions.py +407 -0
- parsek_cdp/cdp/overlay/types.py +328 -0
- parsek_cdp/cdp/page/__init__.py +15 -0
- parsek_cdp/cdp/page/events.py +416 -0
- parsek_cdp/cdp/page/functions.py +1081 -0
- parsek_cdp/cdp/page/types.py +1088 -0
- parsek_cdp/cdp/performance/__init__.py +15 -0
- parsek_cdp/cdp/performance/events.py +24 -0
- parsek_cdp/cdp/performance/functions.py +63 -0
- parsek_cdp/cdp/performance/types.py +22 -0
- parsek_cdp/cdp/performancetimeline/__init__.py +15 -0
- parsek_cdp/cdp/performancetimeline/events.py +22 -0
- parsek_cdp/cdp/performancetimeline/functions.py +30 -0
- parsek_cdp/cdp/performancetimeline/types.py +85 -0
- parsek_cdp/cdp/preload/__init__.py +15 -0
- parsek_cdp/cdp/preload/events.py +116 -0
- parsek_cdp/cdp/preload/functions.py +25 -0
- parsek_cdp/cdp/preload/types.py +267 -0
- parsek_cdp/cdp/profiler/__init__.py +15 -0
- parsek_cdp/cdp/profiler/events.py +64 -0
- parsek_cdp/cdp/profiler/functions.py +134 -0
- parsek_cdp/cdp/profiler/types.py +105 -0
- parsek_cdp/cdp/pwa/__init__.py +15 -0
- parsek_cdp/cdp/pwa/events.py +13 -0
- parsek_cdp/cdp/pwa/functions.py +196 -0
- parsek_cdp/cdp/pwa/types.py +45 -0
- parsek_cdp/cdp/runtime/__init__.py +15 -0
- parsek_cdp/cdp/runtime/events.py +123 -0
- parsek_cdp/cdp/runtime/functions.py +552 -0
- parsek_cdp/cdp/runtime/types.py +319 -0
- parsek_cdp/cdp/schema/__init__.py +15 -0
- parsek_cdp/cdp/schema/events.py +13 -0
- parsek_cdp/cdp/schema/functions.py +32 -0
- parsek_cdp/cdp/schema/types.py +22 -0
- parsek_cdp/cdp/security/__init__.py +15 -0
- parsek_cdp/cdp/security/events.py +64 -0
- parsek_cdp/cdp/security/functions.py +66 -0
- parsek_cdp/cdp/security/types.py +168 -0
- parsek_cdp/cdp/serviceworker/__init__.py +15 -0
- parsek_cdp/cdp/serviceworker/events.py +43 -0
- parsek_cdp/cdp/serviceworker/functions.py +115 -0
- parsek_cdp/cdp/serviceworker/types.py +95 -0
- parsek_cdp/cdp/storage/__init__.py +15 -0
- parsek_cdp/cdp/storage/events.py +288 -0
- parsek_cdp/cdp/storage/functions.py +571 -0
- parsek_cdp/cdp/storage/types.py +656 -0
- parsek_cdp/cdp/systeminfo/__init__.py +15 -0
- parsek_cdp/cdp/systeminfo/events.py +13 -0
- parsek_cdp/cdp/systeminfo/functions.py +75 -0
- parsek_cdp/cdp/systeminfo/types.py +132 -0
- parsek_cdp/cdp/target/__init__.py +15 -0
- parsek_cdp/cdp/target/events.py +109 -0
- parsek_cdp/cdp/target/functions.py +424 -0
- parsek_cdp/cdp/target/types.py +83 -0
- parsek_cdp/cdp/tethering/__init__.py +15 -0
- parsek_cdp/cdp/tethering/events.py +22 -0
- parsek_cdp/cdp/tethering/functions.py +35 -0
- parsek_cdp/cdp/tethering/types.py +10 -0
- parsek_cdp/cdp/tracing/__init__.py +15 -0
- parsek_cdp/cdp/tracing/events.py +61 -0
- parsek_cdp/cdp/tracing/functions.py +119 -0
- parsek_cdp/cdp/tracing/types.py +81 -0
- parsek_cdp/cdp/webaudio/__init__.py +15 -0
- parsek_cdp/cdp/webaudio/events.py +184 -0
- parsek_cdp/cdp/webaudio/functions.py +51 -0
- parsek_cdp/cdp/webaudio/types.py +155 -0
- parsek_cdp/cdp/webauthn/__init__.py +15 -0
- parsek_cdp/cdp/webauthn/events.py +69 -0
- parsek_cdp/cdp/webauthn/functions.py +214 -0
- parsek_cdp/cdp/webauthn/types.py +96 -0
- parsek_cdp/core/__init__.py +18 -0
- parsek_cdp/core/browser.py +240 -0
- parsek_cdp/core/browser_context.py +58 -0
- parsek_cdp/core/element.py +405 -0
- parsek_cdp/core/feature.py +376 -0
- parsek_cdp/core/frame.py +351 -0
- parsek_cdp/core/pagable.py +175 -0
- parsek_cdp/core/page.py +163 -0
- parsek_cdp/core/target.py +490 -0
- parsek_cdp/features/__init__.py +14 -0
- parsek_cdp/features/request_listener/__init__.py +256 -0
- parsek_cdp/features/request_listener/events.py +48 -0
- parsek_cdp/features/request_listener/types.py +235 -0
- parsek_cdp/generate.py +642 -0
- parsek_cdp/parsek/__init__.py +18 -0
- parsek_cdp/parsek/events.py +38 -0
- parsek_cdp/parsek/types.py +36 -0
- parsek_cdp/py.typed +0 -0
- parsek_cdp-0.1.0.dist-info/METADATA +277 -0
- parsek_cdp-0.1.0.dist-info/RECORD +242 -0
- parsek_cdp-0.1.0.dist-info/WHEEL +5 -0
- parsek_cdp-0.1.0.dist-info/licenses/LICENSE +201 -0
- parsek_cdp-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""Custom types and enums for the CacheStorage domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
|
|
7
|
+
|
|
8
|
+
from ..mixins.datatype import DataType, FieldMeta, register
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from ..storage.types import StorageBucket as Storage_StorageBucket
|
|
12
|
+
|
|
13
|
+
type CacheId = str # Unique identifier of the Cache object.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@register("CacheStorage.CachedResponseType")
|
|
17
|
+
class CachedResponseType(str, Enum):
|
|
18
|
+
"""type of HTTP response cached"""
|
|
19
|
+
BASIC = 'basic'
|
|
20
|
+
CORS = 'cors'
|
|
21
|
+
DEFAULT = 'default'
|
|
22
|
+
ERROR = 'error'
|
|
23
|
+
OPAQUERESPONSE = 'opaqueResponse'
|
|
24
|
+
OPAQUEREDIRECT = 'opaqueRedirect'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@register("CacheStorage.DataEntry")
|
|
28
|
+
@dataclass
|
|
29
|
+
class DataEntry(DataType):
|
|
30
|
+
"""Data entry."""
|
|
31
|
+
request_url: str
|
|
32
|
+
request_method: str
|
|
33
|
+
request_headers: List[Header]
|
|
34
|
+
response_time: float
|
|
35
|
+
response_status: int
|
|
36
|
+
response_status_text: str
|
|
37
|
+
response_type: CachedResponseType
|
|
38
|
+
response_headers: List[Header]
|
|
39
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
40
|
+
FieldMeta('request_url', 'requestURL', False, 'primitive'),
|
|
41
|
+
FieldMeta('request_method', 'requestMethod', False, 'primitive'),
|
|
42
|
+
FieldMeta('request_headers', 'requestHeaders', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CacheStorage.Header')),
|
|
43
|
+
FieldMeta('response_time', 'responseTime', False, 'primitive'),
|
|
44
|
+
FieldMeta('response_status', 'responseStatus', False, 'primitive'),
|
|
45
|
+
FieldMeta('response_status_text', 'responseStatusText', False, 'primitive'),
|
|
46
|
+
FieldMeta('response_type', 'responseType', False, 'enum', ref='CacheStorage.CachedResponseType'),
|
|
47
|
+
FieldMeta('response_headers', 'responseHeaders', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CacheStorage.Header')),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@register("CacheStorage.Cache")
|
|
52
|
+
@dataclass
|
|
53
|
+
class Cache(DataType):
|
|
54
|
+
"""Cache identifier."""
|
|
55
|
+
cache_id: CacheId
|
|
56
|
+
security_origin: str
|
|
57
|
+
storage_key: str
|
|
58
|
+
cache_name: str
|
|
59
|
+
storage_bucket: Optional[Storage_StorageBucket] = None
|
|
60
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
61
|
+
FieldMeta('cache_id', 'cacheId', False, 'primitive'),
|
|
62
|
+
FieldMeta('security_origin', 'securityOrigin', False, 'primitive'),
|
|
63
|
+
FieldMeta('storage_key', 'storageKey', False, 'primitive'),
|
|
64
|
+
FieldMeta('cache_name', 'cacheName', False, 'primitive'),
|
|
65
|
+
FieldMeta('storage_bucket', 'storageBucket', True, 'object', ref='Storage.StorageBucket'),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@register("CacheStorage.Header")
|
|
70
|
+
@dataclass
|
|
71
|
+
class Header(DataType):
|
|
72
|
+
name: str
|
|
73
|
+
value: str
|
|
74
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
75
|
+
FieldMeta('name', 'name', False, 'primitive'),
|
|
76
|
+
FieldMeta('value', 'value', False, 'primitive'),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@register("CacheStorage.CachedResponse")
|
|
81
|
+
@dataclass
|
|
82
|
+
class CachedResponse(DataType):
|
|
83
|
+
"""Cached response"""
|
|
84
|
+
body: str
|
|
85
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
86
|
+
FieldMeta('body', 'body', False, 'primitive'),
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
__all__ = ["Cache", "CacheId", "CachedResponse", "CachedResponseType", "DataEntry", "Header"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""The Cast CDP domain (generated).
|
|
2
|
+
|
|
3
|
+
Importing ``Cast`` from ``parsek_cdp.cdp`` gives a namespace with this
|
|
4
|
+
domain's events and types as attributes (``Cast.SomeEvent`` /
|
|
5
|
+
``Cast.SomeType``); commands run on a target via ``page.cdp.Cast``.
|
|
6
|
+
"""
|
|
7
|
+
from . import events, functions, types
|
|
8
|
+
from .functions import Cast
|
|
9
|
+
from .events import * # noqa: F401,F403 -- expose events on the namespace
|
|
10
|
+
from .types import * # noqa: F401,F403 -- expose types on the namespace
|
|
11
|
+
|
|
12
|
+
#: Protocol domain name (used by features that declare ``domains=(Cast,)``).
|
|
13
|
+
DOMAIN = "Cast"
|
|
14
|
+
|
|
15
|
+
__all__ = ["events", "functions", "types", "Cast", "DOMAIN"]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Events for the Cast domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import FieldMeta
|
|
8
|
+
from ..mixins.event import Event, register_event
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from .types import Sink
|
|
12
|
+
|
|
13
|
+
@register_event("Cast.sinksUpdated")
|
|
14
|
+
@dataclass
|
|
15
|
+
class SinksUpdated(Event):
|
|
16
|
+
"""
|
|
17
|
+
This is fired whenever the list of available sinks changes. A sink is a
|
|
18
|
+
device or a software surface that you can cast to.
|
|
19
|
+
"""
|
|
20
|
+
sinks: List[Sink]
|
|
21
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
22
|
+
FieldMeta('sinks', 'sinks', False, 'array', inner=FieldMeta('', '', False, 'object', ref='Cast.Sink')),
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@register_event("Cast.issueUpdated")
|
|
27
|
+
@dataclass
|
|
28
|
+
class IssueUpdated(Event):
|
|
29
|
+
"""
|
|
30
|
+
This is fired whenever the outstanding issue/error message changes.
|
|
31
|
+
|issueMessage| is empty if there is no issue.
|
|
32
|
+
"""
|
|
33
|
+
issue_message: str
|
|
34
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
35
|
+
FieldMeta('issue_message', 'issueMessage', False, 'primitive'),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
__all__ = ["IssueUpdated", "SinksUpdated"]
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Commands for the Cast domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import DataType, FieldMeta, encode
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Cast:
|
|
11
|
+
"""Commands of the Cast domain, bound to a target."""
|
|
12
|
+
|
|
13
|
+
def __init__(self, target: Any) -> None:
|
|
14
|
+
self._target = target
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
async def enable(self, *, presentation_url: Optional[str] = None) -> None:
|
|
18
|
+
"""
|
|
19
|
+
Starts observing for sinks that can be used for tab mirroring, and if set,
|
|
20
|
+
sinks compatible with |presentationUrl| as well. When sinks are found, a
|
|
21
|
+
|sinksUpdated| event is fired.
|
|
22
|
+
Also starts observing for issue messages. When an issue is added or removed,
|
|
23
|
+
an |issueUpdated| event is fired.
|
|
24
|
+
:param presentation_url:
|
|
25
|
+
"""
|
|
26
|
+
_params: Dict[str, Any] = {}
|
|
27
|
+
if presentation_url is not None:
|
|
28
|
+
_params['presentationUrl'] = encode(FieldMeta('', '', False, 'primitive'), presentation_url)
|
|
29
|
+
_result = await self._target.send('Cast.enable', _params)
|
|
30
|
+
return None
|
|
31
|
+
|
|
32
|
+
async def disable(self) -> None:
|
|
33
|
+
"""Stops observing for sinks and issues."""
|
|
34
|
+
_params: Dict[str, Any] = {}
|
|
35
|
+
_result = await self._target.send('Cast.disable', _params)
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
async def set_sink_to_use(self, *, sink_name: str) -> None:
|
|
39
|
+
"""
|
|
40
|
+
Sets a sink to be used when the web page requests the browser to choose a
|
|
41
|
+
sink via Presentation API, Remote Playback API, or Cast SDK.
|
|
42
|
+
:param sink_name:
|
|
43
|
+
"""
|
|
44
|
+
_params: Dict[str, Any] = {}
|
|
45
|
+
_params['sinkName'] = encode(FieldMeta('', '', False, 'primitive'), sink_name)
|
|
46
|
+
_result = await self._target.send('Cast.setSinkToUse', _params)
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
async def start_desktop_mirroring(self, *, sink_name: str) -> None:
|
|
50
|
+
"""
|
|
51
|
+
Starts mirroring the desktop to the sink.
|
|
52
|
+
:param sink_name:
|
|
53
|
+
"""
|
|
54
|
+
_params: Dict[str, Any] = {}
|
|
55
|
+
_params['sinkName'] = encode(FieldMeta('', '', False, 'primitive'), sink_name)
|
|
56
|
+
_result = await self._target.send('Cast.startDesktopMirroring', _params)
|
|
57
|
+
return None
|
|
58
|
+
|
|
59
|
+
async def start_tab_mirroring(self, *, sink_name: str) -> None:
|
|
60
|
+
"""
|
|
61
|
+
Starts mirroring the tab to the sink.
|
|
62
|
+
:param sink_name:
|
|
63
|
+
"""
|
|
64
|
+
_params: Dict[str, Any] = {}
|
|
65
|
+
_params['sinkName'] = encode(FieldMeta('', '', False, 'primitive'), sink_name)
|
|
66
|
+
_result = await self._target.send('Cast.startTabMirroring', _params)
|
|
67
|
+
return None
|
|
68
|
+
|
|
69
|
+
async def stop_casting(self, *, sink_name: str) -> None:
|
|
70
|
+
"""
|
|
71
|
+
Stops the active Cast session on the sink.
|
|
72
|
+
:param sink_name:
|
|
73
|
+
"""
|
|
74
|
+
_params: Dict[str, Any] = {}
|
|
75
|
+
_params['sinkName'] = encode(FieldMeta('', '', False, 'primitive'), sink_name)
|
|
76
|
+
_result = await self._target.send('Cast.stopCasting', _params)
|
|
77
|
+
return None
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Custom types and enums for the Cast domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional
|
|
7
|
+
|
|
8
|
+
from ..mixins.datatype import DataType, FieldMeta, register
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@register("Cast.Sink")
|
|
12
|
+
@dataclass
|
|
13
|
+
class Sink(DataType):
|
|
14
|
+
name: str
|
|
15
|
+
id: str
|
|
16
|
+
session: Optional[str] = None
|
|
17
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
18
|
+
FieldMeta('name', 'name', False, 'primitive'),
|
|
19
|
+
FieldMeta('id', 'id', False, 'primitive'),
|
|
20
|
+
FieldMeta('session', 'session', True, 'primitive'),
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
__all__ = ["Sink"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""The Console CDP domain (generated).
|
|
2
|
+
|
|
3
|
+
Importing ``Console`` from ``parsek_cdp.cdp`` gives a namespace with this
|
|
4
|
+
domain's events and types as attributes (``Console.SomeEvent`` /
|
|
5
|
+
``Console.SomeType``); commands run on a target via ``page.cdp.Console``.
|
|
6
|
+
"""
|
|
7
|
+
from . import events, functions, types
|
|
8
|
+
from .functions import Console
|
|
9
|
+
from .events import * # noqa: F401,F403 -- expose events on the namespace
|
|
10
|
+
from .types import * # noqa: F401,F403 -- expose types on the namespace
|
|
11
|
+
|
|
12
|
+
#: Protocol domain name (used by features that declare ``domains=(Console,)``).
|
|
13
|
+
DOMAIN = "Console"
|
|
14
|
+
|
|
15
|
+
__all__ = ["events", "functions", "types", "Console", "DOMAIN"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Events for the Console domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import FieldMeta
|
|
8
|
+
from ..mixins.event import Event, register_event
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from .types import ConsoleMessage
|
|
12
|
+
|
|
13
|
+
@register_event("Console.messageAdded")
|
|
14
|
+
@dataclass
|
|
15
|
+
class MessageAdded(Event):
|
|
16
|
+
"""Issued when new console message is added."""
|
|
17
|
+
message: ConsoleMessage
|
|
18
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
19
|
+
FieldMeta('message', 'message', False, 'object', ref='Console.ConsoleMessage'),
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
__all__ = ["MessageAdded"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Commands for the Console domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import DataType, FieldMeta, encode
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Console:
|
|
11
|
+
"""Commands of the Console domain, bound to a target."""
|
|
12
|
+
|
|
13
|
+
def __init__(self, target: Any) -> None:
|
|
14
|
+
self._target = target
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
async def clear_messages(self) -> None:
|
|
18
|
+
"""Does nothing."""
|
|
19
|
+
_params: Dict[str, Any] = {}
|
|
20
|
+
_result = await self._target.send('Console.clearMessages', _params)
|
|
21
|
+
return None
|
|
22
|
+
|
|
23
|
+
async def disable(self) -> None:
|
|
24
|
+
"""Disables console domain, prevents further console messages from being reported to the client."""
|
|
25
|
+
_params: Dict[str, Any] = {}
|
|
26
|
+
_result = await self._target.send('Console.disable', _params)
|
|
27
|
+
return None
|
|
28
|
+
|
|
29
|
+
async def enable(self) -> None:
|
|
30
|
+
"""
|
|
31
|
+
Enables console domain, sends the messages collected so far to the client by means of the
|
|
32
|
+
`messageAdded` notification.
|
|
33
|
+
"""
|
|
34
|
+
_params: Dict[str, Any] = {}
|
|
35
|
+
_result = await self._target.send('Console.enable', _params)
|
|
36
|
+
return None
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Custom types and enums for the Console domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional
|
|
7
|
+
|
|
8
|
+
from ..mixins.datatype import DataType, FieldMeta, register
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@register("Console.ConsoleMessage")
|
|
12
|
+
@dataclass
|
|
13
|
+
class ConsoleMessage(DataType):
|
|
14
|
+
"""Console message."""
|
|
15
|
+
source: Literal['xml', 'javascript', 'network', 'console-api', 'storage', 'appcache', 'rendering', 'security', 'other', 'deprecation', 'worker']
|
|
16
|
+
level: Literal['log', 'warning', 'error', 'debug', 'info']
|
|
17
|
+
text: str
|
|
18
|
+
url: Optional[str] = None
|
|
19
|
+
line: Optional[int] = None
|
|
20
|
+
column: Optional[int] = None
|
|
21
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
22
|
+
FieldMeta('source', 'source', False, 'primitive'),
|
|
23
|
+
FieldMeta('level', 'level', False, 'primitive'),
|
|
24
|
+
FieldMeta('text', 'text', False, 'primitive'),
|
|
25
|
+
FieldMeta('url', 'url', True, 'primitive'),
|
|
26
|
+
FieldMeta('line', 'line', True, 'primitive'),
|
|
27
|
+
FieldMeta('column', 'column', True, 'primitive'),
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
__all__ = ["ConsoleMessage"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""The CSS CDP domain (generated).
|
|
2
|
+
|
|
3
|
+
Importing ``CSS`` from ``parsek_cdp.cdp`` gives a namespace with this
|
|
4
|
+
domain's events and types as attributes (``CSS.SomeEvent`` /
|
|
5
|
+
``CSS.SomeType``); commands run on a target via ``page.cdp.CSS``.
|
|
6
|
+
"""
|
|
7
|
+
from . import events, functions, types
|
|
8
|
+
from .functions import CSS
|
|
9
|
+
from .events import * # noqa: F401,F403 -- expose events on the namespace
|
|
10
|
+
from .types import * # noqa: F401,F403 -- expose types on the namespace
|
|
11
|
+
|
|
12
|
+
#: Protocol domain name (used by features that declare ``domains=(CSS,)``).
|
|
13
|
+
DOMAIN = "CSS"
|
|
14
|
+
|
|
15
|
+
__all__ = ["events", "functions", "types", "CSS", "DOMAIN"]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""Events for the CSS domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import FieldMeta
|
|
8
|
+
from ..mixins.event import Event, register_event
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from .types import (
|
|
12
|
+
CSSStyleSheetHeader,
|
|
13
|
+
FontFace,
|
|
14
|
+
)
|
|
15
|
+
from ..dom.types import NodeId as DOM_NodeId
|
|
16
|
+
from ..dom.types import StyleSheetId as DOM_StyleSheetId
|
|
17
|
+
|
|
18
|
+
@register_event("CSS.fontsUpdated")
|
|
19
|
+
@dataclass
|
|
20
|
+
class FontsUpdated(Event):
|
|
21
|
+
"""
|
|
22
|
+
Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded
|
|
23
|
+
web font.
|
|
24
|
+
"""
|
|
25
|
+
font: Optional[FontFace] = None
|
|
26
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
27
|
+
FieldMeta('font', 'font', True, 'object', ref='CSS.FontFace'),
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@register_event("CSS.mediaQueryResultChanged")
|
|
32
|
+
@dataclass
|
|
33
|
+
class MediaQueryResultChanged(Event):
|
|
34
|
+
"""
|
|
35
|
+
Fires whenever a MediaQuery result changes (for example, after a browser window has been
|
|
36
|
+
resized.) The current implementation considers only viewport-dependent media features.
|
|
37
|
+
"""
|
|
38
|
+
__FIELDS__: ClassVar[tuple] = ()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@register_event("CSS.styleSheetAdded")
|
|
42
|
+
@dataclass
|
|
43
|
+
class StyleSheetAdded(Event):
|
|
44
|
+
"""Fired whenever an active document stylesheet is added."""
|
|
45
|
+
header: CSSStyleSheetHeader
|
|
46
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
47
|
+
FieldMeta('header', 'header', False, 'object', ref='CSS.CSSStyleSheetHeader'),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@register_event("CSS.styleSheetChanged")
|
|
52
|
+
@dataclass
|
|
53
|
+
class StyleSheetChanged(Event):
|
|
54
|
+
"""Fired whenever a stylesheet is changed as a result of the client operation."""
|
|
55
|
+
style_sheet_id: DOM_StyleSheetId
|
|
56
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
57
|
+
FieldMeta('style_sheet_id', 'styleSheetId', False, 'primitive'),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@register_event("CSS.styleSheetRemoved")
|
|
62
|
+
@dataclass
|
|
63
|
+
class StyleSheetRemoved(Event):
|
|
64
|
+
"""Fired whenever an active document stylesheet is removed."""
|
|
65
|
+
style_sheet_id: DOM_StyleSheetId
|
|
66
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
67
|
+
FieldMeta('style_sheet_id', 'styleSheetId', False, 'primitive'),
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@register_event("CSS.computedStyleUpdated")
|
|
72
|
+
@dataclass
|
|
73
|
+
class ComputedStyleUpdated(Event):
|
|
74
|
+
node_id: DOM_NodeId
|
|
75
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
76
|
+
FieldMeta('node_id', 'nodeId', False, 'primitive'),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
__all__ = ["ComputedStyleUpdated", "FontsUpdated", "MediaQueryResultChanged", "StyleSheetAdded", "StyleSheetChanged", "StyleSheetRemoved"]
|