001package Torello.Browser.BrowserAPI;
002
003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
004// Java-HTML Imports
005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
006
007import Torello.Browser.*;
008import Torello.Browser.helper.*;
009import Torello.Browser.JavaScriptAPI.*;
010import Torello.JSON.*;
011
012import Torello.Java.ReadOnly.ReadOnlyList;
013import Torello.Java.ReadOnly.ReadOnlyArrayList;
014
015import Torello.JavaDoc.Annotations.StaticFunctional;
016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;
017
018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.IndexedDB$$Commands;
019
020
021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
022// JDK Imports
023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
024
025import javax.json.JsonObject;
026import javax.json.JsonValue;
027
028/**
029 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN>
030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
031 */
032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
033public class IndexedDB
034{
035    // No Pubic Constructors
036    private IndexedDB() { }
037
038
039
040    // ********************************************************************************************
041    // ********************************************************************************************
042    // Basic Types
043    // ********************************************************************************************
044    // ********************************************************************************************
045
046
047    /**
048     * Data entry.
049     * 
050     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI>
051     */
052    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
053    public static class DataEntry
054        extends BaseType<DataEntry>
055        implements java.io.Serializable
056    {
057        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
058        protected static final long serialVersionUID = 1;
059
060        private static final NestedHelper<IndexedDB.DataEntry> singleton =
061            Torello.Browser.BrowserAPI.NestedHelpers.Types.
062                IndexedDB$$DataEntry$$.singleton;
063
064        /** Key object. */
065        public final RunTime.RemoteObject key;
066
067        /** Primary key object. */
068        public final RunTime.RemoteObject primaryKey;
069
070        /** Value object. */
071        public final RunTime.RemoteObject value;
072
073        /** Constructor.  Please review this class' fields for documentation. */
074        public DataEntry(
075                ReadOnlyList<Boolean> isPresent, RunTime.RemoteObject key,
076                RunTime.RemoteObject primaryKey, RunTime.RemoteObject value
077            )
078        {
079            super(singleton, Domains.IndexedDB, "DataEntry", 3);
080
081            this.key        = key;
082            this.primaryKey = primaryKey;
083            this.value      = value;
084
085            this.isPresent = (isPresent == null)
086                ? singleton.generateIsPresentList(this)
087                : THROWS.check(isPresent, 3, "IndexedDB.DataEntry");
088        }
089
090        /** Creates an instance of this class from a {@link JsonObject}.*/
091        public static DataEntry fromJSON(JsonObject jo)
092        { return singleton.fromJSON(jo); }
093
094        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
095        public static NestedDescriptor<DataEntry> descriptor()
096        { return singleton.descriptor(); }
097    }
098
099    /**
100     * Database with an array of object stores.
101     * 
102     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI>
103     */
104    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
105    public static class DatabaseWithObjectStores
106        extends BaseType<DatabaseWithObjectStores>
107        implements java.io.Serializable
108    {
109        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
110        protected static final long serialVersionUID = 1;
111
112        private static final NestedHelper<IndexedDB.DatabaseWithObjectStores> singleton =
113            Torello.Browser.BrowserAPI.NestedHelpers.Types.
114                IndexedDB$$DatabaseWithObjectStores$$.singleton;
115
116        /** Database name. */
117        public final String name;
118
119        /**
120         * Database version (type is not 'integer', as the standard
121         * requires the version number to be 'unsigned long long')
122         */
123        public final Number version;
124
125        /** Object stores in this database. */
126        public final IndexedDB.ObjectStore[] objectStores;
127
128        /** Constructor.  Please review this class' fields for documentation. */
129        public DatabaseWithObjectStores(
130                ReadOnlyList<Boolean> isPresent, String name, Number version,
131                ObjectStore[] objectStores
132            )
133        {
134            super(singleton, Domains.IndexedDB, "DatabaseWithObjectStores", 3);
135
136            this.name           = name;
137            this.version        = version;
138            this.objectStores   = objectStores;
139
140            this.isPresent = (isPresent == null)
141                ? singleton.generateIsPresentList(this)
142                : THROWS.check(isPresent, 3, "IndexedDB.DatabaseWithObjectStores");
143        }
144
145        /** Creates an instance of this class from a {@link JsonObject}.*/
146        public static DatabaseWithObjectStores fromJSON(JsonObject jo)
147        { return singleton.fromJSON(jo); }
148
149        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
150        public static NestedDescriptor<DatabaseWithObjectStores> descriptor()
151        { return singleton.descriptor(); }
152    }
153
154    /**
155     * Key.
156     * 
157     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI>
158     */
159    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
160    public static class Key
161        extends BaseType<Key>
162        implements java.io.Serializable
163    {
164        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
165        protected static final long serialVersionUID = 1;
166
167        private static final NestedHelper<IndexedDB.Key> singleton =
168            Torello.Browser.BrowserAPI.NestedHelpers.Types.
169                IndexedDB$$Key$$.singleton;
170
171        /**
172         * Key type.
173         * <EMBED CLASS='external-html' DATA-D=IndexedDB DATA-C=Key DATA-F=type DATA-FILE-ID=CDP.EL1>
174         * @see BaseType#enumStrList(String)
175         */
176        public final String type;
177
178        /**
179         * Number value.
180         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
181         */
182        public final Number number;
183
184        /**
185         * String value.
186         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
187         */
188        public final String string;
189
190        /**
191         * Date value.
192         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
193         */
194        public final Number date;
195
196        /**
197         * Array value.
198         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
199         */
200        public final IndexedDB.Key[] array;
201
202        /** Constructor.  Please review this class' fields for documentation. */
203        public Key(
204                ReadOnlyList<Boolean> isPresent, String type, Number number, String string,
205                Number date, Key[] array
206            )
207        {
208            super(singleton, Domains.IndexedDB, "Key", 5);
209
210            this.type   = type;
211            this.number = number;
212            this.string = string;
213            this.date   = date;
214            this.array  = array;
215
216            this.isPresent = (isPresent == null)
217                ? singleton.generateIsPresentList(this)
218                : THROWS.check(isPresent, 5, "IndexedDB.Key");
219        }
220
221        /** Creates an instance of this class from a {@link JsonObject}.*/
222        public static Key fromJSON(JsonObject jo)
223        { return singleton.fromJSON(jo); }
224
225        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
226        public static NestedDescriptor<Key> descriptor()
227        { return singleton.descriptor(); }
228    }
229
230    /**
231     * Key path.
232     * 
233     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI>
234     */
235    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
236    public static class KeyPath
237        extends BaseType<KeyPath>
238        implements java.io.Serializable
239    {
240        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
241        protected static final long serialVersionUID = 1;
242
243        private static final NestedHelper<IndexedDB.KeyPath> singleton =
244            Torello.Browser.BrowserAPI.NestedHelpers.Types.
245                IndexedDB$$KeyPath$$.singleton;
246
247        /**
248         * Key path type.
249         * <EMBED CLASS='external-html' DATA-D=IndexedDB DATA-C=KeyPath DATA-F=type DATA-FILE-ID=CDP.EL1>
250         * @see BaseType#enumStrList(String)
251         */
252        public final String type;
253
254        /**
255         * String value.
256         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
257         */
258        public final String string;
259
260        /**
261         * Array value.
262         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
263         */
264        public final String[] array;
265
266        /** Constructor.  Please review this class' fields for documentation. */
267        public KeyPath(ReadOnlyList<Boolean> isPresent, String type, String string, String[] array)
268        {
269            super(singleton, Domains.IndexedDB, "KeyPath", 3);
270
271            this.type   = type;
272            this.string = string;
273            this.array  = array;
274
275            this.isPresent = (isPresent == null)
276                ? singleton.generateIsPresentList(this)
277                : THROWS.check(isPresent, 3, "IndexedDB.KeyPath");
278        }
279
280        /** Creates an instance of this class from a {@link JsonObject}.*/
281        public static KeyPath fromJSON(JsonObject jo)
282        { return singleton.fromJSON(jo); }
283
284        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
285        public static NestedDescriptor<KeyPath> descriptor()
286        { return singleton.descriptor(); }
287    }
288
289    /**
290     * Key range.
291     * 
292     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI>
293     */
294    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
295    public static class KeyRange
296        extends BaseType<KeyRange>
297        implements java.io.Serializable
298    {
299        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
300        protected static final long serialVersionUID = 1;
301
302        private static final NestedHelper<IndexedDB.KeyRange> singleton =
303            Torello.Browser.BrowserAPI.NestedHelpers.Types.
304                IndexedDB$$KeyRange$$.singleton;
305
306        /**
307         * Lower bound.
308         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
309         */
310        public final IndexedDB.Key lower;
311
312        /**
313         * Upper bound.
314         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
315         */
316        public final IndexedDB.Key upper;
317
318        /** If true lower bound is open. */
319        public final boolean lowerOpen;
320
321        /** If true upper bound is open. */
322        public final boolean upperOpen;
323
324        /** Constructor.  Please review this class' fields for documentation. */
325        public KeyRange(
326                ReadOnlyList<Boolean> isPresent, Key lower, Key upper, boolean lowerOpen,
327                boolean upperOpen
328            )
329        {
330            super(singleton, Domains.IndexedDB, "KeyRange", 4);
331
332            this.lower      = lower;
333            this.upper      = upper;
334            this.lowerOpen  = lowerOpen;
335            this.upperOpen  = upperOpen;
336
337            this.isPresent = (isPresent == null)
338                ? singleton.generateIsPresentList(this)
339                : THROWS.check(isPresent, 4, "IndexedDB.KeyRange");
340        }
341
342        /** Creates an instance of this class from a {@link JsonObject}.*/
343        public static KeyRange fromJSON(JsonObject jo)
344        { return singleton.fromJSON(jo); }
345
346        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
347        public static NestedDescriptor<KeyRange> descriptor()
348        { return singleton.descriptor(); }
349    }
350
351    /**
352     * Object store.
353     * 
354     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI>
355     */
356    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
357    public static class ObjectStore
358        extends BaseType<ObjectStore>
359        implements java.io.Serializable
360    {
361        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
362        protected static final long serialVersionUID = 1;
363
364        private static final NestedHelper<IndexedDB.ObjectStore> singleton =
365            Torello.Browser.BrowserAPI.NestedHelpers.Types.
366                IndexedDB$$ObjectStore$$.singleton;
367
368        /** Object store name. */
369        public final String name;
370
371        /** Object store key path. */
372        public final IndexedDB.KeyPath keyPath;
373
374        /** If true, object store has auto increment flag set. */
375        public final boolean autoIncrement;
376
377        /** Indexes in this object store. */
378        public final IndexedDB.ObjectStoreIndex[] indexes;
379
380        /** Constructor.  Please review this class' fields for documentation. */
381        public ObjectStore(
382                ReadOnlyList<Boolean> isPresent, String name, KeyPath keyPath,
383                boolean autoIncrement, ObjectStoreIndex[] indexes
384            )
385        {
386            super(singleton, Domains.IndexedDB, "ObjectStore", 4);
387
388            this.name           = name;
389            this.keyPath        = keyPath;
390            this.autoIncrement  = autoIncrement;
391            this.indexes        = indexes;
392
393            this.isPresent = (isPresent == null)
394                ? singleton.generateIsPresentList(this)
395                : THROWS.check(isPresent, 4, "IndexedDB.ObjectStore");
396        }
397
398        /** Creates an instance of this class from a {@link JsonObject}.*/
399        public static ObjectStore fromJSON(JsonObject jo)
400        { return singleton.fromJSON(jo); }
401
402        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
403        public static NestedDescriptor<ObjectStore> descriptor()
404        { return singleton.descriptor(); }
405    }
406
407    /**
408     * Object store index.
409     * 
410     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI>
411     */
412    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
413    public static class ObjectStoreIndex
414        extends BaseType<ObjectStoreIndex>
415        implements java.io.Serializable
416    {
417        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
418        protected static final long serialVersionUID = 1;
419
420        private static final NestedHelper<IndexedDB.ObjectStoreIndex> singleton =
421            Torello.Browser.BrowserAPI.NestedHelpers.Types.
422                IndexedDB$$ObjectStoreIndex$$.singleton;
423
424        /** Index name. */
425        public final String name;
426
427        /** Index key path. */
428        public final IndexedDB.KeyPath keyPath;
429
430        /** If true, index is unique. */
431        public final boolean unique;
432
433        /** If true, index allows multiple entries for a key. */
434        public final boolean multiEntry;
435
436        /** Constructor.  Please review this class' fields for documentation. */
437        public ObjectStoreIndex(
438                ReadOnlyList<Boolean> isPresent, String name, KeyPath keyPath, boolean unique,
439                boolean multiEntry
440            )
441        {
442            super(singleton, Domains.IndexedDB, "ObjectStoreIndex", 4);
443
444            this.name       = name;
445            this.keyPath    = keyPath;
446            this.unique     = unique;
447            this.multiEntry = multiEntry;
448
449            this.isPresent = (isPresent == null)
450                ? singleton.generateIsPresentList(this)
451                : THROWS.check(isPresent, 4, "IndexedDB.ObjectStoreIndex");
452        }
453
454        /** Creates an instance of this class from a {@link JsonObject}.*/
455        public static ObjectStoreIndex fromJSON(JsonObject jo)
456        { return singleton.fromJSON(jo); }
457
458        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
459        public static NestedDescriptor<ObjectStoreIndex> descriptor()
460        { return singleton.descriptor(); }
461    }
462
463
464    // ********************************************************************************************
465    // ********************************************************************************************
466    // Command-Return Types
467    // ********************************************************************************************
468    // ********************************************************************************************
469
470
471    /**
472     * Gets metadata of an object store.
473     * 
474     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI DATA-CMD=getMetadata>
475     * @see IndexedDB#getMetadata
476     */
477    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_CMD_JDHBI")
478    public static class getMetadata$$RET
479        extends BaseType<getMetadata$$RET>
480        implements java.io.Serializable
481    {
482        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
483        protected static final long serialVersionUID = 1;
484
485        private static final NestedHelper<IndexedDB.getMetadata$$RET> singleton =
486            Torello.Browser.BrowserAPI.NestedHelpers.CmdReturns.
487                IndexedDB$$getMetadata$$RET.singleton;
488
489        /** the entries count */
490        public final Number entriesCount;
491
492        /**
493         * the current value of key generator, to become the next inserted
494         * key into the object store. Valid if objectStore.autoIncrement
495         * is true.
496         */
497        public final Number keyGeneratorValue;
498
499        /** Constructor.  Please review this class' fields for documentation. */
500        public getMetadata$$RET
501            (ReadOnlyList<Boolean> isPresent, Number entriesCount, Number keyGeneratorValue)
502        {
503            super(singleton, Domains.IndexedDB, "getMetadata", 2);
504
505            this.entriesCount       = entriesCount;
506            this.keyGeneratorValue  = keyGeneratorValue;
507
508            this.isPresent = (isPresent == null)
509                ? singleton.generateIsPresentList(this)
510                : THROWS.check(isPresent, 2, "IndexedDB.getMetadata$$RET");
511        }
512
513        /** Creates an instance of this class from a {@link JsonObject}.*/
514        public static getMetadata$$RET fromJSON(JsonObject jo)
515        { return singleton.fromJSON(jo); }
516
517        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
518        public static NestedDescriptor<getMetadata$$RET> descriptor()
519        { return singleton.descriptor(); }
520    }
521
522    /**
523     * Requests data from object store or index.
524     * 
525     * <EMBED CLASS=globalDefs DATA-DOMAIN=IndexedDB DATA-API=BrowserAPI DATA-CMD=requestData>
526     * @see IndexedDB#requestData
527     */
528    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_CMD_JDHBI")
529    public static class requestData$$RET
530        extends BaseType<requestData$$RET>
531        implements java.io.Serializable
532    {
533        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
534        protected static final long serialVersionUID = 1;
535
536        private static final NestedHelper<IndexedDB.requestData$$RET> singleton =
537            Torello.Browser.BrowserAPI.NestedHelpers.CmdReturns.
538                IndexedDB$$requestData$$RET.singleton;
539
540        /** Array of object store data entries. */
541        public final IndexedDB.DataEntry[] objectStoreDataEntries;
542
543        /** If true, there are more entries to fetch in the given range. */
544        public final boolean hasMore;
545
546        /** Constructor.  Please review this class' fields for documentation. */
547        public requestData$$RET
548            (ReadOnlyList<Boolean> isPresent, DataEntry[] objectStoreDataEntries, boolean hasMore)
549        {
550            super(singleton, Domains.IndexedDB, "requestData", 2);
551
552            this.objectStoreDataEntries = objectStoreDataEntries;
553            this.hasMore                = hasMore;
554
555            this.isPresent = (isPresent == null)
556                ? singleton.generateIsPresentList(this)
557                : THROWS.check(isPresent, 2, "IndexedDB.requestData$$RET");
558        }
559
560        /** Creates an instance of this class from a {@link JsonObject}.*/
561        public static requestData$$RET fromJSON(JsonObject jo)
562        { return singleton.fromJSON(jo); }
563
564        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
565        public static NestedDescriptor<requestData$$RET> descriptor()
566        { return singleton.descriptor(); }
567    }
568
569
570
571
572    // ********************************************************************************************
573    // ********************************************************************************************
574    // Commands
575    // ********************************************************************************************
576    // ********************************************************************************************
577
578
579    /**
580     * Clears all entries from an object store.
581     * 
582     * <BR /><BR /><DIV CLASS=JDHint>
583     * 👍 Because of the sheer number of input parameters to this method, there is a
584     * a {@link CommandBuilder} variant to this method which may be invoked instead.
585     * 
586     * <BR /><BR />
587     * Please View: {@link #clearObjectStore()}
588     * </DIV>
589     * 
590     * @param securityOrigin 
591     * At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
592     * Security origin.
593     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
594     * 
595     * @param storageKey Storage key.
596     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
597     * 
598     * @param storageBucket Storage bucket. If not specified, it uses the default bucket.
599     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
600     * 
601     * @param databaseName Database name.
602     * 
603     * @param objectStoreName Object store name.
604     * 
605     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
606     *
607     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
608     * browser receives the invocation-request.
609     *
610     * <BR /><BR /><DIV CLASS=JDHint>
611     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
612     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
613     * the Browser Function has run to completion.
614     * </DIV>
615     */
616    public static Script<Void> clearObjectStore(
617            String securityOrigin, String storageKey, Storage.StorageBucket storageBucket,
618            String databaseName, String objectStoreName
619        )
620    {
621        // Convert all Method Parameters into a JSON Request-Object (as a String)
622        final String requestJSON = WriteJSON.get(
623            IndexedDB$$Commands.clearObjectStore$$, "IndexedDB.clearObjectStore",
624            securityOrigin, storageKey, storageBucket, databaseName, objectStoreName
625        );
626
627        return Script.NO_RET(Domains.IndexedDB, "clearObjectStore", requestJSON);
628    }
629
630    /**
631     * Deletes a database.
632     * 
633     * @param securityOrigin 
634     * At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
635     * Security origin.
636     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
637     * 
638     * @param storageKey Storage key.
639     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
640     * 
641     * @param storageBucket Storage bucket. If not specified, it uses the default bucket.
642     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
643     * 
644     * @param databaseName Database name.
645     * 
646     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
647     *
648     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
649     * browser receives the invocation-request.
650     *
651     * <BR /><BR /><DIV CLASS=JDHint>
652     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
653     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
654     * the Browser Function has run to completion.
655     * </DIV>
656     */
657    public static Script<Void> deleteDatabase(
658            String securityOrigin, String storageKey, Storage.StorageBucket storageBucket,
659            String databaseName
660        )
661    {
662        // Convert all Method Parameters into a JSON Request-Object (as a String)
663        final String requestJSON = WriteJSON.get(
664            IndexedDB$$Commands.deleteDatabase$$, "IndexedDB.deleteDatabase",
665            securityOrigin, storageKey, storageBucket, databaseName
666        );
667
668        return Script.NO_RET(Domains.IndexedDB, "deleteDatabase", requestJSON);
669    }
670
671    /**
672     * Delete a range of entries from an object store
673     * 
674     * <BR /><BR /><DIV CLASS=JDHint>
675     * 👍 Because of the sheer number of input parameters to this method, there is a
676     * a {@link CommandBuilder} variant to this method which may be invoked instead.
677     * 
678     * <BR /><BR />
679     * Please View: {@link #deleteObjectStoreEntries()}
680     * </DIV>
681     * 
682     * @param securityOrigin 
683     * At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
684     * Security origin.
685     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
686     * 
687     * @param storageKey Storage key.
688     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
689     * 
690     * @param storageBucket Storage bucket. If not specified, it uses the default bucket.
691     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
692     * 
693     * @param databaseName -
694     * 
695     * @param objectStoreName -
696     * 
697     * @param keyRange Range of entry keys to delete
698     * 
699     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
700     *
701     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
702     * browser receives the invocation-request.
703     *
704     * <BR /><BR /><DIV CLASS=JDHint>
705     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
706     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
707     * the Browser Function has run to completion.
708     * </DIV>
709     */
710    public static Script<Void> deleteObjectStoreEntries(
711            String securityOrigin, String storageKey, Storage.StorageBucket storageBucket,
712            String databaseName, String objectStoreName, KeyRange keyRange
713        )
714    {
715        // Convert all Method Parameters into a JSON Request-Object (as a String)
716        final String requestJSON = WriteJSON.get(
717            IndexedDB$$Commands.deleteObjectStoreEntries$$, "IndexedDB.deleteObjectStoreEntries",
718            securityOrigin, storageKey, storageBucket, databaseName, objectStoreName, keyRange
719        );
720
721        return Script.NO_RET(Domains.IndexedDB, "deleteObjectStoreEntries", requestJSON);
722    }
723
724    /**
725     * Disables events from backend.
726     * 
727     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
728     *
729     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
730     * browser receives the invocation-request.
731     *
732     * <BR /><BR /><DIV CLASS=JDHint>
733     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
734     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
735     * the Browser Function has run to completion.
736     * </DIV>
737     */
738    public static Script<Void> disable()
739    {
740        // Ultra-Simple Request JSON - Because this method has no parameters
741        final String requestJSON = "{\"method\":\"IndexedDB.disable\"}";
742
743        return Script.NO_RET(Domains.IndexedDB, "disable", requestJSON);
744    }
745
746    /**
747     * Enables events from backend.
748     * 
749     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
750     *
751     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
752     * browser receives the invocation-request.
753     *
754     * <BR /><BR /><DIV CLASS=JDHint>
755     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
756     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
757     * the Browser Function has run to completion.
758     * </DIV>
759     */
760    public static Script<Void> enable()
761    {
762        // Ultra-Simple Request JSON - Because this method has no parameters
763        final String requestJSON = "{\"method\":\"IndexedDB.enable\"}";
764
765        return Script.NO_RET(Domains.IndexedDB, "enable", requestJSON);
766    }
767
768    /**
769     * Gets metadata of an object store.
770     * 
771     * <BR /><BR /><DIV CLASS=JDHint>
772     * 👍 Because of the sheer number of input parameters to this method, there is a
773     * a {@link CommandBuilder} variant to this method which may be invoked instead.
774     * 
775     * <BR /><BR />
776     * Please View: {@link #getMetadata()}
777     * </DIV>
778     * 
779     * @param securityOrigin 
780     * At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
781     * Security origin.
782     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
783     * 
784     * @param storageKey Storage key.
785     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
786     * 
787     * @param storageBucket Storage bucket. If not specified, it uses the default bucket.
788     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
789     * 
790     * @param databaseName Database name.
791     * 
792     * @param objectStoreName Object store name.
793     * 
794     * @return An instance of <CODE>{@link Script}&lt;{@link getMetadata$$RET}&gt;</CODE>
795     * 
796     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
797     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
798     * <CODE>&lt;{@link getMetadata$$RET}&gt;</CODE> will be returned
799     *
800     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
801     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
802     * be retrieved.</I>
803     *
804     * <BR /><BR /><DIV CLASS=JDHint>
805     * This Browser Function's {@code Promise} returns:{@link getMetadata$$RET}
806     * A dedicated return type implies that the browser may return more than 1 datum
807     * </DIV>
808     */
809    public static Script<getMetadata$$RET> getMetadata(
810            String securityOrigin, String storageKey, Storage.StorageBucket storageBucket,
811            String databaseName, String objectStoreName
812        )
813    {
814        // Convert all Method Parameters into a JSON Request-Object (as a String)
815        final String requestJSON = WriteJSON.get(
816            IndexedDB$$Commands.getMetadata$$, "IndexedDB.getMetadata",
817            securityOrigin, storageKey, storageBucket, databaseName, objectStoreName
818        );
819
820        return new Script<>(
821            Domains.IndexedDB, "getMetadata", requestJSON,
822            getMetadata$$RET::fromJSON,
823            getMetadata$$RET.class
824        );
825    }
826
827    /**
828     * Requests data from object store or index.
829     * 
830     * <BR /><BR /><DIV CLASS=JDHint>
831     * 👍 Because of the sheer number of input parameters to this method, there is a
832     * a {@link CommandBuilder} variant to this method which may be invoked instead.
833     * 
834     * <BR /><BR />
835     * Please View: {@link #requestData()}
836     * </DIV>
837     * 
838     * @param securityOrigin 
839     * At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
840     * Security origin.
841     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
842     * 
843     * @param storageKey Storage key.
844     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
845     * 
846     * @param storageBucket Storage bucket. If not specified, it uses the default bucket.
847     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
848     * 
849     * @param databaseName Database name.
850     * 
851     * @param objectStoreName Object store name.
852     * 
853     * @param indexName Index name, empty string for object store data requests.
854     * 
855     * @param skipCount Number of records to skip.
856     * 
857     * @param pageSize Number of records to fetch.
858     * 
859     * @param keyRange Key range.
860     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
861     * 
862     * @return An instance of <CODE>{@link Script}&lt;{@link requestData$$RET}&gt;</CODE>
863     * 
864     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
865     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
866     * <CODE>&lt;{@link requestData$$RET}&gt;</CODE> will be returned
867     *
868     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
869     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
870     * be retrieved.</I>
871     *
872     * <BR /><BR /><DIV CLASS=JDHint>
873     * This Browser Function's {@code Promise} returns:{@link requestData$$RET}
874     * A dedicated return type implies that the browser may return more than 1 datum
875     * </DIV>
876     */
877    public static Script<requestData$$RET> requestData(
878            String securityOrigin, String storageKey, Storage.StorageBucket storageBucket,
879            String databaseName, String objectStoreName, String indexName, int skipCount,
880            int pageSize, KeyRange keyRange
881        )
882    {
883        // Convert all Method Parameters into a JSON Request-Object (as a String)
884        final String requestJSON = WriteJSON.get(
885            IndexedDB$$Commands.requestData$$, "IndexedDB.requestData",
886            securityOrigin, storageKey, storageBucket, databaseName, objectStoreName, indexName,
887            skipCount, pageSize, keyRange
888        );
889
890        return new Script<>(
891            Domains.IndexedDB, "requestData", requestJSON,
892            requestData$$RET::fromJSON,
893            requestData$$RET.class
894        );
895    }
896
897    /**
898     * Requests database with given name in given frame.
899     * 
900     * @param securityOrigin 
901     * At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
902     * Security origin.
903     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
904     * 
905     * @param storageKey Storage key.
906     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
907     * 
908     * @param storageBucket Storage bucket. If not specified, it uses the default bucket.
909     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
910     * 
911     * @param databaseName Database name.
912     * 
913     * @return An instance of <CODE>{@link Script}
914     * &lt;{@link IndexedDB.DatabaseWithObjectStores}&gt;</CODE>
915     * 
916     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
917     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
918     * <CODE>&lt;{@link IndexedDB.DatabaseWithObjectStores}&gt;</CODE> will be returned
919     *
920     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
921     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
922     * be retrieved.</I>
923     *
924     * <BR /><BR /><DIV CLASS=JDHint>
925     * This Browser Function's {@code Promise} returns:
926     * <CODE>{@link IndexedDB.DatabaseWithObjectStores} (<B>databaseWithObjectStores</B>)</CODE>
927     * <BR />
928     * Database with an array of object stores.
929     * </DIV>
930     */
931    public static Script<IndexedDB.DatabaseWithObjectStores> requestDatabase(
932            String securityOrigin, String storageKey, Storage.StorageBucket storageBucket,
933            String databaseName
934        )
935    {
936        // Convert all Method Parameters into a JSON Request-Object (as a String)
937        final String requestJSON = WriteJSON.get(
938            IndexedDB$$Commands.requestDatabase$$, "IndexedDB.requestDatabase",
939            securityOrigin, storageKey, storageBucket, databaseName
940        );
941
942        return new Script<>(
943            Domains.IndexedDB, "requestDatabase", requestJSON,
944            IndexedDB$$Commands::requestDatabase,
945            IndexedDB.DatabaseWithObjectStores.class
946        );
947    }
948
949    /**
950     * Requests database names for given security origin.
951     * 
952     * @param securityOrigin 
953     * At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
954     * Security origin.
955     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
956     * 
957     * @param storageKey Storage key.
958     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
959     * 
960     * @param storageBucket Storage bucket. If not specified, it uses the default bucket.
961     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
962     * 
963     * @return An instance of <CODE>{@link Script}&lt;String[]&gt;</CODE>
964     * 
965     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
966     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
967     * <CODE>&lt;String[]&gt;</CODE> will be returned
968     *
969     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
970     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
971     * be retrieved.</I>
972     *
973     * <BR /><BR /><DIV CLASS=JDHint>
974     * This Browser Function's {@code Promise} returns:
975     * <CODE>String[] (<B>databaseNames</B>)</CODE>
976     * <BR />
977     * Database names for origin.
978     * </DIV>
979     */
980    public static Script<String[]> requestDatabaseNames
981        (String securityOrigin, String storageKey, Storage.StorageBucket storageBucket)
982    {
983        // Convert all Method Parameters into a JSON Request-Object (as a String)
984        final String requestJSON = WriteJSON.get(
985            IndexedDB$$Commands.requestDatabaseNames$$, "IndexedDB.requestDatabaseNames",
986            securityOrigin, storageKey, storageBucket
987        );
988
989        return new Script<>(
990            Domains.IndexedDB, "requestDatabaseNames", requestJSON,
991            IndexedDB$$Commands::requestDatabaseNames,
992            String[].class
993        );
994    }
995
996
997    // ********************************************************************************************
998    // ********************************************************************************************
999    // CommandBuilder Getter-Methods
1000    // ********************************************************************************************
1001    // ********************************************************************************************
1002
1003
1004    /**
1005     * Creates a buider for conveniently assigning parameters to this method.
1006     * 
1007     * <BR /><BR /><DIV CLASS=JDHint>
1008     * Note that the original method expects 5 parameters, and can be cumbersome.
1009     * </DIV>
1010     * 
1011     * @return {@link CommandBuilder} instance, for assigning parameter values, one by one.
1012     * @see #clearObjectStore
1013     */
1014    public static CommandBuilder<Void> clearObjectStore()
1015    { return CommandBuilder.builder(IndexedDB$$Commands.clearObjectStore$$); }
1016
1017    /**
1018     * Creates a buider for conveniently assigning parameters to this method.
1019     * 
1020     * <BR /><BR /><DIV CLASS=JDHint>
1021     * Note that the original method expects 6 parameters, and can be cumbersome.
1022     * </DIV>
1023     * 
1024     * @return {@link CommandBuilder} instance, for assigning parameter values, one by one.
1025     * @see #deleteObjectStoreEntries
1026     */
1027    public static CommandBuilder<Void> deleteObjectStoreEntries()
1028    { return CommandBuilder.builder(IndexedDB$$Commands.deleteObjectStoreEntries$$); }
1029
1030    /**
1031     * Creates a buider for conveniently assigning parameters to this method.
1032     * 
1033     * <BR /><BR /><DIV CLASS=JDHint>
1034     * Note that the original method expects 5 parameters, and can be cumbersome.
1035     * </DIV>
1036     * 
1037     * @return {@link CommandBuilder} instance, for assigning parameter values, one by one.
1038     * @see #getMetadata
1039     */
1040    public static CommandBuilder<getMetadata$$RET> getMetadata()
1041    { return CommandBuilder.builder(IndexedDB$$Commands.getMetadata$$); }
1042
1043    /**
1044     * Creates a buider for conveniently assigning parameters to this method.
1045     * 
1046     * <BR /><BR /><DIV CLASS=JDHint>
1047     * Note that the original method expects 9 parameters, and can be cumbersome.
1048     * </DIV>
1049     * 
1050     * @return {@link CommandBuilder} instance, for assigning parameter values, one by one.
1051     * @see #requestData
1052     */
1053    public static CommandBuilder<requestData$$RET> requestData()
1054    { return CommandBuilder.builder(IndexedDB$$Commands.requestData$$); }
1055
1056
1057}