mithwire 0.50.3__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.
- mithwire/__init__.py +32 -0
- mithwire/cdp/README.md +4 -0
- mithwire/cdp/__init__.py +6 -0
- mithwire/cdp/accessibility.py +668 -0
- mithwire/cdp/animation.py +494 -0
- mithwire/cdp/audits.py +1995 -0
- mithwire/cdp/autofill.py +292 -0
- mithwire/cdp/background_service.py +215 -0
- mithwire/cdp/bluetooth_emulation.py +626 -0
- mithwire/cdp/browser.py +821 -0
- mithwire/cdp/cache_storage.py +311 -0
- mithwire/cdp/cast.py +172 -0
- mithwire/cdp/console.py +107 -0
- mithwire/cdp/crash_report_context.py +55 -0
- mithwire/cdp/css.py +2750 -0
- mithwire/cdp/database.py +179 -0
- mithwire/cdp/debugger.py +1405 -0
- mithwire/cdp/device_access.py +141 -0
- mithwire/cdp/device_orientation.py +45 -0
- mithwire/cdp/dom.py +2257 -0
- mithwire/cdp/dom_debugger.py +321 -0
- mithwire/cdp/dom_snapshot.py +876 -0
- mithwire/cdp/dom_storage.py +222 -0
- mithwire/cdp/emulation.py +1779 -0
- mithwire/cdp/event_breakpoints.py +56 -0
- mithwire/cdp/extensions.py +238 -0
- mithwire/cdp/fed_cm.py +283 -0
- mithwire/cdp/fetch.py +507 -0
- mithwire/cdp/file_system.py +115 -0
- mithwire/cdp/headless_experimental.py +115 -0
- mithwire/cdp/heap_profiler.py +401 -0
- mithwire/cdp/indexed_db.py +528 -0
- mithwire/cdp/input_.py +701 -0
- mithwire/cdp/inspector.py +95 -0
- mithwire/cdp/io.py +101 -0
- mithwire/cdp/layer_tree.py +464 -0
- mithwire/cdp/log.py +190 -0
- mithwire/cdp/media.py +313 -0
- mithwire/cdp/memory.py +305 -0
- mithwire/cdp/network.py +5342 -0
- mithwire/cdp/overlay.py +1468 -0
- mithwire/cdp/page.py +3972 -0
- mithwire/cdp/performance.py +124 -0
- mithwire/cdp/performance_timeline.py +200 -0
- mithwire/cdp/preload.py +575 -0
- mithwire/cdp/profiler.py +420 -0
- mithwire/cdp/pwa.py +278 -0
- mithwire/cdp/py.typed +0 -0
- mithwire/cdp/runtime.py +1589 -0
- mithwire/cdp/schema.py +50 -0
- mithwire/cdp/security.py +518 -0
- mithwire/cdp/service_worker.py +401 -0
- mithwire/cdp/smart_card_emulation.py +891 -0
- mithwire/cdp/storage.py +1573 -0
- mithwire/cdp/system_info.py +327 -0
- mithwire/cdp/target.py +829 -0
- mithwire/cdp/tethering.py +65 -0
- mithwire/cdp/tracing.py +377 -0
- mithwire/cdp/util.py +18 -0
- mithwire/cdp/web_audio.py +606 -0
- mithwire/cdp/web_authn.py +598 -0
- mithwire/cdp/web_mcp.py +293 -0
- mithwire/core/_contradict.py +142 -0
- mithwire/core/browser.py +923 -0
- mithwire/core/cf_templates/cf_dark_checkbox.png +0 -0
- mithwire/core/cf_templates/cf_light_checkbox.png +0 -0
- mithwire/core/config.py +323 -0
- mithwire/core/connection.py +564 -0
- mithwire/core/element.py +1205 -0
- mithwire/core/tab.py +2202 -0
- mithwire/core/util.py +5063 -0
- mithwire-0.50.3.dist-info/METADATA +1049 -0
- mithwire-0.50.3.dist-info/RECORD +76 -0
- mithwire-0.50.3.dist-info/WHEEL +5 -0
- mithwire-0.50.3.dist-info/licenses/LICENSE.txt +619 -0
- mithwire-0.50.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
# DO NOT EDIT THIS FILE!
|
|
2
|
+
#
|
|
3
|
+
# This file is generated from the CDP specification. If you need to make
|
|
4
|
+
# changes, edit the generator and regenerate all of the modules.
|
|
5
|
+
#
|
|
6
|
+
# CDP domain: IndexedDB (experimental)
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
import enum
|
|
10
|
+
import typing
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
from .util import event_class, T_JSON_DICT
|
|
13
|
+
|
|
14
|
+
from . import runtime
|
|
15
|
+
from . import storage
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class DatabaseWithObjectStores:
|
|
20
|
+
'''
|
|
21
|
+
Database with an array of object stores.
|
|
22
|
+
'''
|
|
23
|
+
#: Database name.
|
|
24
|
+
name: str
|
|
25
|
+
|
|
26
|
+
#: Database version (type is not 'integer', as the standard
|
|
27
|
+
#: requires the version number to be 'unsigned long long')
|
|
28
|
+
version: float
|
|
29
|
+
|
|
30
|
+
#: Object stores in this database.
|
|
31
|
+
object_stores: typing.List[ObjectStore]
|
|
32
|
+
|
|
33
|
+
def to_json(self) -> T_JSON_DICT:
|
|
34
|
+
json: T_JSON_DICT = dict()
|
|
35
|
+
json['name'] = self.name
|
|
36
|
+
json['version'] = self.version
|
|
37
|
+
json['objectStores'] = [i.to_json() for i in self.object_stores]
|
|
38
|
+
return json
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_json(cls, json: T_JSON_DICT) -> DatabaseWithObjectStores:
|
|
42
|
+
return cls(
|
|
43
|
+
name=str(json['name']),
|
|
44
|
+
version=float(json['version']),
|
|
45
|
+
object_stores=[ObjectStore.from_json(i) for i in json['objectStores']],
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@dataclass
|
|
50
|
+
class ObjectStore:
|
|
51
|
+
'''
|
|
52
|
+
Object store.
|
|
53
|
+
'''
|
|
54
|
+
#: Object store name.
|
|
55
|
+
name: str
|
|
56
|
+
|
|
57
|
+
#: Object store key path.
|
|
58
|
+
key_path: KeyPath
|
|
59
|
+
|
|
60
|
+
#: If true, object store has auto increment flag set.
|
|
61
|
+
auto_increment: bool
|
|
62
|
+
|
|
63
|
+
#: Indexes in this object store.
|
|
64
|
+
indexes: typing.List[ObjectStoreIndex]
|
|
65
|
+
|
|
66
|
+
def to_json(self) -> T_JSON_DICT:
|
|
67
|
+
json: T_JSON_DICT = dict()
|
|
68
|
+
json['name'] = self.name
|
|
69
|
+
json['keyPath'] = self.key_path.to_json()
|
|
70
|
+
json['autoIncrement'] = self.auto_increment
|
|
71
|
+
json['indexes'] = [i.to_json() for i in self.indexes]
|
|
72
|
+
return json
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_json(cls, json: T_JSON_DICT) -> ObjectStore:
|
|
76
|
+
return cls(
|
|
77
|
+
name=str(json['name']),
|
|
78
|
+
key_path=KeyPath.from_json(json['keyPath']),
|
|
79
|
+
auto_increment=bool(json['autoIncrement']),
|
|
80
|
+
indexes=[ObjectStoreIndex.from_json(i) for i in json['indexes']],
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@dataclass
|
|
85
|
+
class ObjectStoreIndex:
|
|
86
|
+
'''
|
|
87
|
+
Object store index.
|
|
88
|
+
'''
|
|
89
|
+
#: Index name.
|
|
90
|
+
name: str
|
|
91
|
+
|
|
92
|
+
#: Index key path.
|
|
93
|
+
key_path: KeyPath
|
|
94
|
+
|
|
95
|
+
#: If true, index is unique.
|
|
96
|
+
unique: bool
|
|
97
|
+
|
|
98
|
+
#: If true, index allows multiple entries for a key.
|
|
99
|
+
multi_entry: bool
|
|
100
|
+
|
|
101
|
+
def to_json(self) -> T_JSON_DICT:
|
|
102
|
+
json: T_JSON_DICT = dict()
|
|
103
|
+
json['name'] = self.name
|
|
104
|
+
json['keyPath'] = self.key_path.to_json()
|
|
105
|
+
json['unique'] = self.unique
|
|
106
|
+
json['multiEntry'] = self.multi_entry
|
|
107
|
+
return json
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_json(cls, json: T_JSON_DICT) -> ObjectStoreIndex:
|
|
111
|
+
return cls(
|
|
112
|
+
name=str(json['name']),
|
|
113
|
+
key_path=KeyPath.from_json(json['keyPath']),
|
|
114
|
+
unique=bool(json['unique']),
|
|
115
|
+
multi_entry=bool(json['multiEntry']),
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@dataclass
|
|
120
|
+
class Key:
|
|
121
|
+
'''
|
|
122
|
+
Key.
|
|
123
|
+
'''
|
|
124
|
+
#: Key type.
|
|
125
|
+
type_: str
|
|
126
|
+
|
|
127
|
+
#: Number value.
|
|
128
|
+
number: typing.Optional[float] = None
|
|
129
|
+
|
|
130
|
+
#: String value.
|
|
131
|
+
string: typing.Optional[str] = None
|
|
132
|
+
|
|
133
|
+
#: Date value.
|
|
134
|
+
date: typing.Optional[float] = None
|
|
135
|
+
|
|
136
|
+
#: Array value.
|
|
137
|
+
array: typing.Optional[typing.List[Key]] = None
|
|
138
|
+
|
|
139
|
+
def to_json(self) -> T_JSON_DICT:
|
|
140
|
+
json: T_JSON_DICT = dict()
|
|
141
|
+
json['type'] = self.type_
|
|
142
|
+
if self.number is not None:
|
|
143
|
+
json['number'] = self.number
|
|
144
|
+
if self.string is not None:
|
|
145
|
+
json['string'] = self.string
|
|
146
|
+
if self.date is not None:
|
|
147
|
+
json['date'] = self.date
|
|
148
|
+
if self.array is not None:
|
|
149
|
+
json['array'] = [i.to_json() for i in self.array]
|
|
150
|
+
return json
|
|
151
|
+
|
|
152
|
+
@classmethod
|
|
153
|
+
def from_json(cls, json: T_JSON_DICT) -> Key:
|
|
154
|
+
return cls(
|
|
155
|
+
type_=str(json['type']),
|
|
156
|
+
number=float(json['number']) if json.get('number', None) is not None else None,
|
|
157
|
+
string=str(json['string']) if json.get('string', None) is not None else None,
|
|
158
|
+
date=float(json['date']) if json.get('date', None) is not None else None,
|
|
159
|
+
array=[Key.from_json(i) for i in json['array']] if json.get('array', None) is not None else None,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@dataclass
|
|
164
|
+
class KeyRange:
|
|
165
|
+
'''
|
|
166
|
+
Key range.
|
|
167
|
+
'''
|
|
168
|
+
#: If true lower bound is open.
|
|
169
|
+
lower_open: bool
|
|
170
|
+
|
|
171
|
+
#: If true upper bound is open.
|
|
172
|
+
upper_open: bool
|
|
173
|
+
|
|
174
|
+
#: Lower bound.
|
|
175
|
+
lower: typing.Optional[Key] = None
|
|
176
|
+
|
|
177
|
+
#: Upper bound.
|
|
178
|
+
upper: typing.Optional[Key] = None
|
|
179
|
+
|
|
180
|
+
def to_json(self) -> T_JSON_DICT:
|
|
181
|
+
json: T_JSON_DICT = dict()
|
|
182
|
+
json['lowerOpen'] = self.lower_open
|
|
183
|
+
json['upperOpen'] = self.upper_open
|
|
184
|
+
if self.lower is not None:
|
|
185
|
+
json['lower'] = self.lower.to_json()
|
|
186
|
+
if self.upper is not None:
|
|
187
|
+
json['upper'] = self.upper.to_json()
|
|
188
|
+
return json
|
|
189
|
+
|
|
190
|
+
@classmethod
|
|
191
|
+
def from_json(cls, json: T_JSON_DICT) -> KeyRange:
|
|
192
|
+
return cls(
|
|
193
|
+
lower_open=bool(json['lowerOpen']),
|
|
194
|
+
upper_open=bool(json['upperOpen']),
|
|
195
|
+
lower=Key.from_json(json['lower']) if json.get('lower', None) is not None else None,
|
|
196
|
+
upper=Key.from_json(json['upper']) if json.get('upper', None) is not None else None,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
@dataclass
|
|
201
|
+
class DataEntry:
|
|
202
|
+
'''
|
|
203
|
+
Data entry.
|
|
204
|
+
'''
|
|
205
|
+
#: Key object.
|
|
206
|
+
key: runtime.RemoteObject
|
|
207
|
+
|
|
208
|
+
#: Primary key object.
|
|
209
|
+
primary_key: runtime.RemoteObject
|
|
210
|
+
|
|
211
|
+
#: Value object.
|
|
212
|
+
value: runtime.RemoteObject
|
|
213
|
+
|
|
214
|
+
def to_json(self) -> T_JSON_DICT:
|
|
215
|
+
json: T_JSON_DICT = dict()
|
|
216
|
+
json['key'] = self.key.to_json()
|
|
217
|
+
json['primaryKey'] = self.primary_key.to_json()
|
|
218
|
+
json['value'] = self.value.to_json()
|
|
219
|
+
return json
|
|
220
|
+
|
|
221
|
+
@classmethod
|
|
222
|
+
def from_json(cls, json: T_JSON_DICT) -> DataEntry:
|
|
223
|
+
return cls(
|
|
224
|
+
key=runtime.RemoteObject.from_json(json['key']),
|
|
225
|
+
primary_key=runtime.RemoteObject.from_json(json['primaryKey']),
|
|
226
|
+
value=runtime.RemoteObject.from_json(json['value']),
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
@dataclass
|
|
231
|
+
class KeyPath:
|
|
232
|
+
'''
|
|
233
|
+
Key path.
|
|
234
|
+
'''
|
|
235
|
+
#: Key path type.
|
|
236
|
+
type_: str
|
|
237
|
+
|
|
238
|
+
#: String value.
|
|
239
|
+
string: typing.Optional[str] = None
|
|
240
|
+
|
|
241
|
+
#: Array value.
|
|
242
|
+
array: typing.Optional[typing.List[str]] = None
|
|
243
|
+
|
|
244
|
+
def to_json(self) -> T_JSON_DICT:
|
|
245
|
+
json: T_JSON_DICT = dict()
|
|
246
|
+
json['type'] = self.type_
|
|
247
|
+
if self.string is not None:
|
|
248
|
+
json['string'] = self.string
|
|
249
|
+
if self.array is not None:
|
|
250
|
+
json['array'] = [i for i in self.array]
|
|
251
|
+
return json
|
|
252
|
+
|
|
253
|
+
@classmethod
|
|
254
|
+
def from_json(cls, json: T_JSON_DICT) -> KeyPath:
|
|
255
|
+
return cls(
|
|
256
|
+
type_=str(json['type']),
|
|
257
|
+
string=str(json['string']) if json.get('string', None) is not None else None,
|
|
258
|
+
array=[str(i) for i in json['array']] if json.get('array', None) is not None else None,
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def clear_object_store(
|
|
263
|
+
database_name: str,
|
|
264
|
+
object_store_name: str,
|
|
265
|
+
security_origin: typing.Optional[str] = None,
|
|
266
|
+
storage_key: typing.Optional[str] = None,
|
|
267
|
+
storage_bucket: typing.Optional[storage.StorageBucket] = None
|
|
268
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
269
|
+
'''
|
|
270
|
+
Clears all entries from an object store.
|
|
271
|
+
|
|
272
|
+
:param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
|
|
273
|
+
:param storage_key: *(Optional)* Storage key.
|
|
274
|
+
:param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
|
|
275
|
+
:param database_name: Database name.
|
|
276
|
+
:param object_store_name: Object store name.
|
|
277
|
+
'''
|
|
278
|
+
params: T_JSON_DICT = dict()
|
|
279
|
+
if security_origin is not None:
|
|
280
|
+
params['securityOrigin'] = security_origin
|
|
281
|
+
if storage_key is not None:
|
|
282
|
+
params['storageKey'] = storage_key
|
|
283
|
+
if storage_bucket is not None:
|
|
284
|
+
params['storageBucket'] = storage_bucket.to_json()
|
|
285
|
+
params['databaseName'] = database_name
|
|
286
|
+
params['objectStoreName'] = object_store_name
|
|
287
|
+
cmd_dict: T_JSON_DICT = {
|
|
288
|
+
'method': 'IndexedDB.clearObjectStore',
|
|
289
|
+
'params': params,
|
|
290
|
+
}
|
|
291
|
+
json = yield cmd_dict
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
def delete_database(
|
|
295
|
+
database_name: str,
|
|
296
|
+
security_origin: typing.Optional[str] = None,
|
|
297
|
+
storage_key: typing.Optional[str] = None,
|
|
298
|
+
storage_bucket: typing.Optional[storage.StorageBucket] = None
|
|
299
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
300
|
+
'''
|
|
301
|
+
Deletes a database.
|
|
302
|
+
|
|
303
|
+
:param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
|
|
304
|
+
:param storage_key: *(Optional)* Storage key.
|
|
305
|
+
:param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
|
|
306
|
+
:param database_name: Database name.
|
|
307
|
+
'''
|
|
308
|
+
params: T_JSON_DICT = dict()
|
|
309
|
+
if security_origin is not None:
|
|
310
|
+
params['securityOrigin'] = security_origin
|
|
311
|
+
if storage_key is not None:
|
|
312
|
+
params['storageKey'] = storage_key
|
|
313
|
+
if storage_bucket is not None:
|
|
314
|
+
params['storageBucket'] = storage_bucket.to_json()
|
|
315
|
+
params['databaseName'] = database_name
|
|
316
|
+
cmd_dict: T_JSON_DICT = {
|
|
317
|
+
'method': 'IndexedDB.deleteDatabase',
|
|
318
|
+
'params': params,
|
|
319
|
+
}
|
|
320
|
+
json = yield cmd_dict
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
def delete_object_store_entries(
|
|
324
|
+
database_name: str,
|
|
325
|
+
object_store_name: str,
|
|
326
|
+
key_range: KeyRange,
|
|
327
|
+
security_origin: typing.Optional[str] = None,
|
|
328
|
+
storage_key: typing.Optional[str] = None,
|
|
329
|
+
storage_bucket: typing.Optional[storage.StorageBucket] = None
|
|
330
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
331
|
+
'''
|
|
332
|
+
Delete a range of entries from an object store
|
|
333
|
+
|
|
334
|
+
:param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
|
|
335
|
+
:param storage_key: *(Optional)* Storage key.
|
|
336
|
+
:param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
|
|
337
|
+
:param database_name:
|
|
338
|
+
:param object_store_name:
|
|
339
|
+
:param key_range: Range of entry keys to delete
|
|
340
|
+
'''
|
|
341
|
+
params: T_JSON_DICT = dict()
|
|
342
|
+
if security_origin is not None:
|
|
343
|
+
params['securityOrigin'] = security_origin
|
|
344
|
+
if storage_key is not None:
|
|
345
|
+
params['storageKey'] = storage_key
|
|
346
|
+
if storage_bucket is not None:
|
|
347
|
+
params['storageBucket'] = storage_bucket.to_json()
|
|
348
|
+
params['databaseName'] = database_name
|
|
349
|
+
params['objectStoreName'] = object_store_name
|
|
350
|
+
params['keyRange'] = key_range.to_json()
|
|
351
|
+
cmd_dict: T_JSON_DICT = {
|
|
352
|
+
'method': 'IndexedDB.deleteObjectStoreEntries',
|
|
353
|
+
'params': params,
|
|
354
|
+
}
|
|
355
|
+
json = yield cmd_dict
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
359
|
+
'''
|
|
360
|
+
Disables events from backend.
|
|
361
|
+
'''
|
|
362
|
+
cmd_dict: T_JSON_DICT = {
|
|
363
|
+
'method': 'IndexedDB.disable',
|
|
364
|
+
}
|
|
365
|
+
json = yield cmd_dict
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
|
|
369
|
+
'''
|
|
370
|
+
Enables events from backend.
|
|
371
|
+
'''
|
|
372
|
+
cmd_dict: T_JSON_DICT = {
|
|
373
|
+
'method': 'IndexedDB.enable',
|
|
374
|
+
}
|
|
375
|
+
json = yield cmd_dict
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
def request_data(
|
|
379
|
+
database_name: str,
|
|
380
|
+
object_store_name: str,
|
|
381
|
+
skip_count: int,
|
|
382
|
+
page_size: int,
|
|
383
|
+
security_origin: typing.Optional[str] = None,
|
|
384
|
+
storage_key: typing.Optional[str] = None,
|
|
385
|
+
storage_bucket: typing.Optional[storage.StorageBucket] = None,
|
|
386
|
+
index_name: typing.Optional[str] = None,
|
|
387
|
+
key_range: typing.Optional[KeyRange] = None
|
|
388
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.List[DataEntry], bool]]:
|
|
389
|
+
'''
|
|
390
|
+
Requests data from object store or index.
|
|
391
|
+
|
|
392
|
+
:param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
|
|
393
|
+
:param storage_key: *(Optional)* Storage key.
|
|
394
|
+
:param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
|
|
395
|
+
:param database_name: Database name.
|
|
396
|
+
:param object_store_name: Object store name.
|
|
397
|
+
:param index_name: *(Optional)* Index name. If not specified, it performs an object store data request.
|
|
398
|
+
:param skip_count: Number of records to skip.
|
|
399
|
+
:param page_size: Number of records to fetch.
|
|
400
|
+
:param key_range: *(Optional)* Key range.
|
|
401
|
+
:returns: A tuple with the following items:
|
|
402
|
+
|
|
403
|
+
0. **objectStoreDataEntries** - Array of object store data entries.
|
|
404
|
+
1. **hasMore** - If true, there are more entries to fetch in the given range.
|
|
405
|
+
'''
|
|
406
|
+
params: T_JSON_DICT = dict()
|
|
407
|
+
if security_origin is not None:
|
|
408
|
+
params['securityOrigin'] = security_origin
|
|
409
|
+
if storage_key is not None:
|
|
410
|
+
params['storageKey'] = storage_key
|
|
411
|
+
if storage_bucket is not None:
|
|
412
|
+
params['storageBucket'] = storage_bucket.to_json()
|
|
413
|
+
params['databaseName'] = database_name
|
|
414
|
+
params['objectStoreName'] = object_store_name
|
|
415
|
+
if index_name is not None:
|
|
416
|
+
params['indexName'] = index_name
|
|
417
|
+
params['skipCount'] = skip_count
|
|
418
|
+
params['pageSize'] = page_size
|
|
419
|
+
if key_range is not None:
|
|
420
|
+
params['keyRange'] = key_range.to_json()
|
|
421
|
+
cmd_dict: T_JSON_DICT = {
|
|
422
|
+
'method': 'IndexedDB.requestData',
|
|
423
|
+
'params': params,
|
|
424
|
+
}
|
|
425
|
+
json = yield cmd_dict
|
|
426
|
+
return (
|
|
427
|
+
[DataEntry.from_json(i) for i in json['objectStoreDataEntries']],
|
|
428
|
+
bool(json['hasMore'])
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
def get_metadata(
|
|
433
|
+
database_name: str,
|
|
434
|
+
object_store_name: str,
|
|
435
|
+
security_origin: typing.Optional[str] = None,
|
|
436
|
+
storage_key: typing.Optional[str] = None,
|
|
437
|
+
storage_bucket: typing.Optional[storage.StorageBucket] = None
|
|
438
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[float, float]]:
|
|
439
|
+
'''
|
|
440
|
+
Gets metadata of an object store.
|
|
441
|
+
|
|
442
|
+
:param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
|
|
443
|
+
:param storage_key: *(Optional)* Storage key.
|
|
444
|
+
:param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
|
|
445
|
+
:param database_name: Database name.
|
|
446
|
+
:param object_store_name: Object store name.
|
|
447
|
+
:returns: A tuple with the following items:
|
|
448
|
+
|
|
449
|
+
0. **entriesCount** - the entries count
|
|
450
|
+
1. **keyGeneratorValue** - the current value of key generator, to become the next inserted key into the object store. Valid if objectStore.autoIncrement is true.
|
|
451
|
+
'''
|
|
452
|
+
params: T_JSON_DICT = dict()
|
|
453
|
+
if security_origin is not None:
|
|
454
|
+
params['securityOrigin'] = security_origin
|
|
455
|
+
if storage_key is not None:
|
|
456
|
+
params['storageKey'] = storage_key
|
|
457
|
+
if storage_bucket is not None:
|
|
458
|
+
params['storageBucket'] = storage_bucket.to_json()
|
|
459
|
+
params['databaseName'] = database_name
|
|
460
|
+
params['objectStoreName'] = object_store_name
|
|
461
|
+
cmd_dict: T_JSON_DICT = {
|
|
462
|
+
'method': 'IndexedDB.getMetadata',
|
|
463
|
+
'params': params,
|
|
464
|
+
}
|
|
465
|
+
json = yield cmd_dict
|
|
466
|
+
return (
|
|
467
|
+
float(json['entriesCount']),
|
|
468
|
+
float(json['keyGeneratorValue'])
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
def request_database(
|
|
473
|
+
database_name: str,
|
|
474
|
+
security_origin: typing.Optional[str] = None,
|
|
475
|
+
storage_key: typing.Optional[str] = None,
|
|
476
|
+
storage_bucket: typing.Optional[storage.StorageBucket] = None
|
|
477
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,DatabaseWithObjectStores]:
|
|
478
|
+
'''
|
|
479
|
+
Requests database with given name in given frame.
|
|
480
|
+
|
|
481
|
+
:param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
|
|
482
|
+
:param storage_key: *(Optional)* Storage key.
|
|
483
|
+
:param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
|
|
484
|
+
:param database_name: Database name.
|
|
485
|
+
:returns: Database with an array of object stores.
|
|
486
|
+
'''
|
|
487
|
+
params: T_JSON_DICT = dict()
|
|
488
|
+
if security_origin is not None:
|
|
489
|
+
params['securityOrigin'] = security_origin
|
|
490
|
+
if storage_key is not None:
|
|
491
|
+
params['storageKey'] = storage_key
|
|
492
|
+
if storage_bucket is not None:
|
|
493
|
+
params['storageBucket'] = storage_bucket.to_json()
|
|
494
|
+
params['databaseName'] = database_name
|
|
495
|
+
cmd_dict: T_JSON_DICT = {
|
|
496
|
+
'method': 'IndexedDB.requestDatabase',
|
|
497
|
+
'params': params,
|
|
498
|
+
}
|
|
499
|
+
json = yield cmd_dict
|
|
500
|
+
return DatabaseWithObjectStores.from_json(json['databaseWithObjectStores'])
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
def request_database_names(
|
|
504
|
+
security_origin: typing.Optional[str] = None,
|
|
505
|
+
storage_key: typing.Optional[str] = None,
|
|
506
|
+
storage_bucket: typing.Optional[storage.StorageBucket] = None
|
|
507
|
+
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[str]]:
|
|
508
|
+
'''
|
|
509
|
+
Requests database names for given security origin.
|
|
510
|
+
|
|
511
|
+
:param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
|
|
512
|
+
:param storage_key: *(Optional)* Storage key.
|
|
513
|
+
:param storage_bucket: *(Optional)* Storage bucket. If not specified, it uses the default bucket.
|
|
514
|
+
:returns: Database names for origin.
|
|
515
|
+
'''
|
|
516
|
+
params: T_JSON_DICT = dict()
|
|
517
|
+
if security_origin is not None:
|
|
518
|
+
params['securityOrigin'] = security_origin
|
|
519
|
+
if storage_key is not None:
|
|
520
|
+
params['storageKey'] = storage_key
|
|
521
|
+
if storage_bucket is not None:
|
|
522
|
+
params['storageBucket'] = storage_bucket.to_json()
|
|
523
|
+
cmd_dict: T_JSON_DICT = {
|
|
524
|
+
'method': 'IndexedDB.requestDatabaseNames',
|
|
525
|
+
'params': params,
|
|
526
|
+
}
|
|
527
|
+
json = yield cmd_dict
|
|
528
|
+
return [str(i) for i in json['databaseNames']]
|