vendor/github.com/go-rod/rod/lib/proto/indexed_db.go

392 lines · 12360 bytes

  1// This file is generated by "./lib/proto/generate"
  2
  3package proto
  4
  5/*
  6
  7IndexedDB
  8
  9*/
 10
 11// IndexedDBDatabaseWithObjectStores Database with an array of object stores.
 12type IndexedDBDatabaseWithObjectStores struct {
 13	// Name Database name.
 14	Name string `json:"name"`
 15
 16	// Version Database version (type is not 'integer', as the standard
 17	// requires the version number to be 'unsigned long long')
 18	Version float64 `json:"version"`
 19
 20	// ObjectStores Object stores in this database.
 21	ObjectStores []*IndexedDBObjectStore `json:"objectStores"`
 22}
 23
 24// IndexedDBObjectStore Object store.
 25type IndexedDBObjectStore struct {
 26	// Name Object store name.
 27	Name string `json:"name"`
 28
 29	// KeyPath Object store key path.
 30	KeyPath *IndexedDBKeyPath `json:"keyPath"`
 31
 32	// AutoIncrement If true, object store has auto increment flag set.
 33	AutoIncrement bool `json:"autoIncrement"`
 34
 35	// Indexes in this object store.
 36	Indexes []*IndexedDBObjectStoreIndex `json:"indexes"`
 37}
 38
 39// IndexedDBObjectStoreIndex Object store index.
 40type IndexedDBObjectStoreIndex struct {
 41	// Name Index name.
 42	Name string `json:"name"`
 43
 44	// KeyPath Index key path.
 45	KeyPath *IndexedDBKeyPath `json:"keyPath"`
 46
 47	// Unique If true, index is unique.
 48	Unique bool `json:"unique"`
 49
 50	// MultiEntry If true, index allows multiple entries for a key.
 51	MultiEntry bool `json:"multiEntry"`
 52}
 53
 54// IndexedDBKeyType enum.
 55type IndexedDBKeyType string
 56
 57const (
 58	// IndexedDBKeyTypeNumber enum const.
 59	IndexedDBKeyTypeNumber IndexedDBKeyType = "number"
 60
 61	// IndexedDBKeyTypeString enum const.
 62	IndexedDBKeyTypeString IndexedDBKeyType = "string"
 63
 64	// IndexedDBKeyTypeDate enum const.
 65	IndexedDBKeyTypeDate IndexedDBKeyType = "date"
 66
 67	// IndexedDBKeyTypeArray enum const.
 68	IndexedDBKeyTypeArray IndexedDBKeyType = "array"
 69)
 70
 71// IndexedDBKey Key.
 72type IndexedDBKey struct {
 73	// Type Key type.
 74	Type IndexedDBKeyType `json:"type"`
 75
 76	// Number (optional) Number value.
 77	Number *float64 `json:"number,omitempty"`
 78
 79	// String (optional) String value.
 80	String string `json:"string,omitempty"`
 81
 82	// Date (optional) Date value.
 83	Date *float64 `json:"date,omitempty"`
 84
 85	// Array (optional) Array value.
 86	Array []*IndexedDBKey `json:"array,omitempty"`
 87}
 88
 89// IndexedDBKeyRange Key range.
 90type IndexedDBKeyRange struct {
 91	// Lower (optional) Lower bound.
 92	Lower *IndexedDBKey `json:"lower,omitempty"`
 93
 94	// Upper (optional) Upper bound.
 95	Upper *IndexedDBKey `json:"upper,omitempty"`
 96
 97	// LowerOpen If true lower bound is open.
 98	LowerOpen bool `json:"lowerOpen"`
 99
100	// UpperOpen If true upper bound is open.
101	UpperOpen bool `json:"upperOpen"`
102}
103
104// IndexedDBDataEntry Data entry.
105type IndexedDBDataEntry struct {
106	// Key object.
107	Key *RuntimeRemoteObject `json:"key"`
108
109	// PrimaryKey Primary key object.
110	PrimaryKey *RuntimeRemoteObject `json:"primaryKey"`
111
112	// Value object.
113	Value *RuntimeRemoteObject `json:"value"`
114}
115
116// IndexedDBKeyPathType enum.
117type IndexedDBKeyPathType string
118
119const (
120	// IndexedDBKeyPathTypeNull enum const.
121	IndexedDBKeyPathTypeNull IndexedDBKeyPathType = "null"
122
123	// IndexedDBKeyPathTypeString enum const.
124	IndexedDBKeyPathTypeString IndexedDBKeyPathType = "string"
125
126	// IndexedDBKeyPathTypeArray enum const.
127	IndexedDBKeyPathTypeArray IndexedDBKeyPathType = "array"
128)
129
130// IndexedDBKeyPath Key path.
131type IndexedDBKeyPath struct {
132	// Type Key path type.
133	Type IndexedDBKeyPathType `json:"type"`
134
135	// String (optional) String value.
136	String string `json:"string,omitempty"`
137
138	// Array (optional) Array value.
139	Array []string `json:"array,omitempty"`
140}
141
142// IndexedDBClearObjectStore Clears all entries from an object store.
143type IndexedDBClearObjectStore struct {
144	// SecurityOrigin (optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
145	// Security origin.
146	SecurityOrigin string `json:"securityOrigin,omitempty"`
147
148	// StorageKey (optional) Storage key.
149	StorageKey string `json:"storageKey,omitempty"`
150
151	// StorageBucket (optional) Storage bucket. If not specified, it uses the default bucket.
152	StorageBucket *StorageStorageBucket `json:"storageBucket,omitempty"`
153
154	// DatabaseName Database name.
155	DatabaseName string `json:"databaseName"`
156
157	// ObjectStoreName Object store name.
158	ObjectStoreName string `json:"objectStoreName"`
159}
160
161// ProtoReq name.
162func (m IndexedDBClearObjectStore) ProtoReq() string { return "IndexedDB.clearObjectStore" }
163
164// Call sends the request.
165func (m IndexedDBClearObjectStore) Call(c Client) error {
166	return call(m.ProtoReq(), m, nil, c)
167}
168
169// IndexedDBDeleteDatabase Deletes a database.
170type IndexedDBDeleteDatabase struct {
171	// SecurityOrigin (optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
172	// Security origin.
173	SecurityOrigin string `json:"securityOrigin,omitempty"`
174
175	// StorageKey (optional) Storage key.
176	StorageKey string `json:"storageKey,omitempty"`
177
178	// StorageBucket (optional) Storage bucket. If not specified, it uses the default bucket.
179	StorageBucket *StorageStorageBucket `json:"storageBucket,omitempty"`
180
181	// DatabaseName Database name.
182	DatabaseName string `json:"databaseName"`
183}
184
185// ProtoReq name.
186func (m IndexedDBDeleteDatabase) ProtoReq() string { return "IndexedDB.deleteDatabase" }
187
188// Call sends the request.
189func (m IndexedDBDeleteDatabase) Call(c Client) error {
190	return call(m.ProtoReq(), m, nil, c)
191}
192
193// IndexedDBDeleteObjectStoreEntries Delete a range of entries from an object store.
194type IndexedDBDeleteObjectStoreEntries struct {
195	// SecurityOrigin (optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
196	// Security origin.
197	SecurityOrigin string `json:"securityOrigin,omitempty"`
198
199	// StorageKey (optional) Storage key.
200	StorageKey string `json:"storageKey,omitempty"`
201
202	// StorageBucket (optional) Storage bucket. If not specified, it uses the default bucket.
203	StorageBucket *StorageStorageBucket `json:"storageBucket,omitempty"`
204
205	// DatabaseName ...
206	DatabaseName string `json:"databaseName"`
207
208	// ObjectStoreName ...
209	ObjectStoreName string `json:"objectStoreName"`
210
211	// KeyRange Range of entry keys to delete
212	KeyRange *IndexedDBKeyRange `json:"keyRange"`
213}
214
215// ProtoReq name.
216func (m IndexedDBDeleteObjectStoreEntries) ProtoReq() string {
217	return "IndexedDB.deleteObjectStoreEntries"
218}
219
220// Call sends the request.
221func (m IndexedDBDeleteObjectStoreEntries) Call(c Client) error {
222	return call(m.ProtoReq(), m, nil, c)
223}
224
225// IndexedDBDisable Disables events from backend.
226type IndexedDBDisable struct{}
227
228// ProtoReq name.
229func (m IndexedDBDisable) ProtoReq() string { return "IndexedDB.disable" }
230
231// Call sends the request.
232func (m IndexedDBDisable) Call(c Client) error {
233	return call(m.ProtoReq(), m, nil, c)
234}
235
236// IndexedDBEnable Enables events from backend.
237type IndexedDBEnable struct{}
238
239// ProtoReq name.
240func (m IndexedDBEnable) ProtoReq() string { return "IndexedDB.enable" }
241
242// Call sends the request.
243func (m IndexedDBEnable) Call(c Client) error {
244	return call(m.ProtoReq(), m, nil, c)
245}
246
247// IndexedDBRequestData Requests data from object store or index.
248type IndexedDBRequestData struct {
249	// SecurityOrigin (optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
250	// Security origin.
251	SecurityOrigin string `json:"securityOrigin,omitempty"`
252
253	// StorageKey (optional) Storage key.
254	StorageKey string `json:"storageKey,omitempty"`
255
256	// StorageBucket (optional) Storage bucket. If not specified, it uses the default bucket.
257	StorageBucket *StorageStorageBucket `json:"storageBucket,omitempty"`
258
259	// DatabaseName Database name.
260	DatabaseName string `json:"databaseName"`
261
262	// ObjectStoreName Object store name.
263	ObjectStoreName string `json:"objectStoreName"`
264
265	// IndexName Index name, empty string for object store data requests.
266	IndexName string `json:"indexName"`
267
268	// SkipCount Number of records to skip.
269	SkipCount int `json:"skipCount"`
270
271	// PageSize Number of records to fetch.
272	PageSize int `json:"pageSize"`
273
274	// KeyRange (optional) Key range.
275	KeyRange *IndexedDBKeyRange `json:"keyRange,omitempty"`
276}
277
278// ProtoReq name.
279func (m IndexedDBRequestData) ProtoReq() string { return "IndexedDB.requestData" }
280
281// Call the request.
282func (m IndexedDBRequestData) Call(c Client) (*IndexedDBRequestDataResult, error) {
283	var res IndexedDBRequestDataResult
284	return &res, call(m.ProtoReq(), m, &res, c)
285}
286
287// IndexedDBRequestDataResult ...
288type IndexedDBRequestDataResult struct {
289	// ObjectStoreDataEntries Array of object store data entries.
290	ObjectStoreDataEntries []*IndexedDBDataEntry `json:"objectStoreDataEntries"`
291
292	// HasMore If true, there are more entries to fetch in the given range.
293	HasMore bool `json:"hasMore"`
294}
295
296// IndexedDBGetMetadata Gets metadata of an object store.
297type IndexedDBGetMetadata struct {
298	// SecurityOrigin (optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
299	// Security origin.
300	SecurityOrigin string `json:"securityOrigin,omitempty"`
301
302	// StorageKey (optional) Storage key.
303	StorageKey string `json:"storageKey,omitempty"`
304
305	// StorageBucket (optional) Storage bucket. If not specified, it uses the default bucket.
306	StorageBucket *StorageStorageBucket `json:"storageBucket,omitempty"`
307
308	// DatabaseName Database name.
309	DatabaseName string `json:"databaseName"`
310
311	// ObjectStoreName Object store name.
312	ObjectStoreName string `json:"objectStoreName"`
313}
314
315// ProtoReq name.
316func (m IndexedDBGetMetadata) ProtoReq() string { return "IndexedDB.getMetadata" }
317
318// Call the request.
319func (m IndexedDBGetMetadata) Call(c Client) (*IndexedDBGetMetadataResult, error) {
320	var res IndexedDBGetMetadataResult
321	return &res, call(m.ProtoReq(), m, &res, c)
322}
323
324// IndexedDBGetMetadataResult ...
325type IndexedDBGetMetadataResult struct {
326	// EntriesCount the entries count
327	EntriesCount float64 `json:"entriesCount"`
328
329	// KeyGeneratorValue the current value of key generator, to become the next inserted
330	// key into the object store. Valid if objectStore.autoIncrement
331	// is true.
332	KeyGeneratorValue float64 `json:"keyGeneratorValue"`
333}
334
335// IndexedDBRequestDatabase Requests database with given name in given frame.
336type IndexedDBRequestDatabase struct {
337	// SecurityOrigin (optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
338	// Security origin.
339	SecurityOrigin string `json:"securityOrigin,omitempty"`
340
341	// StorageKey (optional) Storage key.
342	StorageKey string `json:"storageKey,omitempty"`
343
344	// StorageBucket (optional) Storage bucket. If not specified, it uses the default bucket.
345	StorageBucket *StorageStorageBucket `json:"storageBucket,omitempty"`
346
347	// DatabaseName Database name.
348	DatabaseName string `json:"databaseName"`
349}
350
351// ProtoReq name.
352func (m IndexedDBRequestDatabase) ProtoReq() string { return "IndexedDB.requestDatabase" }
353
354// Call the request.
355func (m IndexedDBRequestDatabase) Call(c Client) (*IndexedDBRequestDatabaseResult, error) {
356	var res IndexedDBRequestDatabaseResult
357	return &res, call(m.ProtoReq(), m, &res, c)
358}
359
360// IndexedDBRequestDatabaseResult ...
361type IndexedDBRequestDatabaseResult struct {
362	// DatabaseWithObjectStores Database with an array of object stores.
363	DatabaseWithObjectStores *IndexedDBDatabaseWithObjectStores `json:"databaseWithObjectStores"`
364}
365
366// IndexedDBRequestDatabaseNames Requests database names for given security origin.
367type IndexedDBRequestDatabaseNames struct {
368	// SecurityOrigin (optional) At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
369	// Security origin.
370	SecurityOrigin string `json:"securityOrigin,omitempty"`
371
372	// StorageKey (optional) Storage key.
373	StorageKey string `json:"storageKey,omitempty"`
374
375	// StorageBucket (optional) Storage bucket. If not specified, it uses the default bucket.
376	StorageBucket *StorageStorageBucket `json:"storageBucket,omitempty"`
377}
378
379// ProtoReq name.
380func (m IndexedDBRequestDatabaseNames) ProtoReq() string { return "IndexedDB.requestDatabaseNames" }
381
382// Call the request.
383func (m IndexedDBRequestDatabaseNames) Call(c Client) (*IndexedDBRequestDatabaseNamesResult, error) {
384	var res IndexedDBRequestDatabaseNamesResult
385	return &res, call(m.ProtoReq(), m, &res, c)
386}
387
388// IndexedDBRequestDatabaseNamesResult ...
389type IndexedDBRequestDatabaseNamesResult struct {
390	// DatabaseNames Database names for origin.
391	DatabaseNames []string `json:"databaseNames"`
392}